content
stringlengths
5
1.04M
avg_line_length
float64
1.75
12.9k
max_line_length
int64
2
244k
alphanum_fraction
float64
0
0.98
licenses
list
repository_name
stringlengths
7
92
path
stringlengths
3
249
size
int64
5
1.04M
lang
stringclasses
2 values
using MSFramework.Application; using MSFramework.Shared; using Ordering.Domain.AggregateRoots; namespace Ordering.Application.Commands { public class ChangeOrderAddressCommand : IRequest { public Address NewAddress { get; set; } public ObjectId OrderId { get; set; } } }
20.428571
50
0.762238
[ "MIT" ]
jonechenug/MSFramework
src/Ordering.Application/Commands/ChangeOrderAddressCommand.cs
288
C#
// MIT License // Copyright (c) 2011-2016 Elisée Maurer, Sparklin Labs, Creative Patterns // Copyright (c) 2016 Thomas Morgner, Rabbit-StewDio Ltd. // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Steropes.UI.Input; using Steropes.UI.Input.MouseInput; using Steropes.UI.Util; namespace Steropes.UI.Components.Window.Events { /// <summary> /// Detects mouse-clicks by monitoring the stream of events that pass by. A click only happens /// if the mouse-down and mouse-up happen to occur on the same component, within a given time frame /// and within a few pixels from the original mouse-down event. /// If a click is detected, the "Clicked" event will be inserted immediately before the mouse-up event /// to allow user code to correctly handle UI animations and to fully track the state of the mouse-button. /// </summary> public class MouseClickDetector : EventFilterBase<MouseEventData>, IComponentEventSource<MouseEventData, IWidget> { static readonly List<MouseButton> buttons = MouseButtonExtensions.GetAll(); readonly IComponentEventSource<MouseEventData, IWidget> eventSource; readonly EnumMap<MouseButton, MouseClickRecord> lastDownTime; readonly EventQueue<MouseEventData> queue; WeakReference<IWidget> lastComponentSeen; public MouseClickDetector(IComponentEventSource<MouseEventData, IWidget> eventSource) { DragThreshold = 4; DoubleClickDelay = 0.5f; queue = new EventQueue<MouseEventData>(); this.eventSource = eventSource; lastDownTime = new EnumMap<MouseButton, MouseClickRecord>(buttons); lastDownTime.Fill(MouseClickRecord.Invalid); lastComponentSeen = new WeakReference<IWidget>(null); } public IWidget Component => eventSource.Component; public float DoubleClickDelay { get; set; } public int DragThreshold { get; set; } protected override IEventSource<MouseEventData> Source => eventSource; public override bool PullEventData(out MouseEventData data) { if (queue.PullEventData(out data)) { return true; } if (!eventSource.PullEventData(out data)) { return false; } IWidget widget; if (!lastComponentSeen.TryGetTarget(out widget) || !ReferenceEquals(eventSource.Component, widget)) { lastDownTime.Fill(MouseClickRecord.Invalid); lastComponentSeen = new WeakReference<IWidget>(eventSource.Component); } switch (data.EventType) { case MouseEventType.Down: HandleMouseDown(ref data); break; case MouseEventType.Up: HandleMouseUp(ref data); break; } return true; } void HandleMouseDown(ref MouseEventData data) { MouseClickRecord lastData; if (!lastDownTime.TryGet(data.Button, out lastData)) { return; } if (IsWithinClickTime(data.Time.TotalSeconds, lastData.Time, lastData.Count) && IsWithinClickDistance(data.Position, lastData.Position)) { // potential double click .. lastData.Count += 1; lastData.Time = data.Time.TotalSeconds; // not updating position .. lastDownTime[data.Button] = lastData; } else { // normal first click, eventually after double click timed out lastData.Count = 1; lastData.Time = data.Time.TotalSeconds; lastData.Position = data.Position; lastDownTime[data.Button] = lastData; } } void HandleMouseUp(ref MouseEventData data) { MouseClickRecord recordedClickTime; if (!lastDownTime.TryGet(data.Button, out recordedClickTime)) { return; } if (IsWithinClickTime(data.Time.TotalSeconds, recordedClickTime.Time, recordedClickTime.Count - 1) && IsWithinClickDistance(data.Position, recordedClickTime.Position)) { queue.PushEvent(data); data = data.ConvertInto(MouseEventType.Clicked, recordedClickTime.Count); } } bool IsWithinClickDistance(Point a, Point b) { // crude distance avoids square root. return Math.Abs(a.X - b.X) <= DragThreshold && Math.Abs(a.Y - b.Y) <= DragThreshold; } bool IsWithinClickTime(double currentTime, double recordedTime, int recordedClicks) { if (double.IsInfinity(recordedTime)) { return false; } if (recordedClicks < 1) { return true; } return currentTime - recordedTime < DoubleClickDelay; } struct MouseClickRecord { public double Time { get; set; } public int Count { get; set; } public Point Position { get; set; } public static readonly MouseClickRecord Invalid = new MouseClickRecord { Time = float.PositiveInfinity, Count = 0, Position = new Point(int.MinValue, int.MinValue) }; } } }
34.085714
173
0.692205
[ "MIT" ]
RabbitStewDio/Steropes.UI
src/Steropes.UI/Components/Window/Events/MouseClickDetector.cs
5,968
C#
// // Klak - Utilities for creative coding with Unity // // Copyright (C) 2016 Keijiro Takahashi // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // using UnityEngine; using UnityEditor; using System; using System.Collections.Generic; namespace Klak.Wiring { [CustomEditor(typeof(MaterialColorOut))] public class MaterialColorOutEditor : Editor { SerializedProperty _target; SerializedProperty _propertyName; string[] _propertyList; // cached property list Shader _cachedShader; // shader used to cache the list void OnEnable() { _target = serializedObject.FindProperty("_target"); _propertyName = serializedObject.FindProperty("_propertyName"); } void OnDisable() { _target = null; _propertyName = null; _propertyList = null; _cachedShader = null; } // Retrieve shader from a target renderer. Shader RetrieveTargetShader(UnityEngine.Object target) { var renderer = target as Renderer; if (renderer == null) return null; var material = renderer.sharedMaterial; if (material == null) return null; return material.shader; } // Cache properties of a given shader if it's // different from a previously given one. void CachePropertyList(Shader shader) { if (_cachedShader == shader) return; var temp = new List<string>(); var count = ShaderUtil.GetPropertyCount(shader); for (var i = 0; i < count; i++) { var propType = ShaderUtil.GetPropertyType(shader, i); if (propType == ShaderUtil.ShaderPropertyType.Color) temp.Add(ShaderUtil.GetPropertyName(shader, i)); } _propertyList = temp.ToArray(); _cachedShader = shader; } public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(_target); // Try to retrieve the target shader. var shader = RetrieveTargetShader(_target.objectReferenceValue); if (shader != null) { // Cache the property list of the target shader. CachePropertyList(shader); // If there are suitable candidates... if (_propertyList.Length > 0) { // Show the drop-down list. var index = Array.IndexOf(_propertyList, _propertyName.stringValue); var newIndex = EditorGUILayout.Popup("Property", index, _propertyList); // Update the property if the selection was changed. if (index != newIndex) _propertyName.stringValue = _propertyList[newIndex]; } else _propertyName.stringValue = ""; // reset on failure } else _propertyName.stringValue = ""; // reset on failure serializedObject.ApplyModifiedProperties(); } } }
35.206612
91
0.612441
[ "MIT" ]
Adjuvant/videolab
Assets/Klak/Wiring/Editor/Output/MaterialColorOutEditor.cs
4,260
C#
using InfluxDB.Client.Core; using System; using System.Collections.Generic; using System.Reflection; using System.Text; using System.Text.Json; namespace NetCoreUtils.Database.InfluxDb { public class MeasurementBase { [Column(IsTimestamp = true)] public DateTime Time { get; set; } /// <summary> /// Only properties with [Column] attributes will be added to the dictionary /// </summary> protected SortedDictionary<string, object> GetDict() { var dict = new SortedDictionary<string, object>(); // add "_measurement" field dict.Add("_measurement", this.GetType().GetCustomAttribute<Measurement>().Name); // add other property fields with the key names exactly the same with those in the InfluxDB 2.x var properties = this.GetType().GetProperties(); foreach (var prop in properties) { var columnAttr = prop.GetCustomAttribute<Column>(); if (columnAttr == null) continue; string key = columnAttr.Name; // for properties explicitly specified column names, i.e. applied [Column("some_name")] object value = prop.GetValue(this); if (key == null) { if (columnAttr.IsTimestamp) // for timestamp property { key = "_time"; value = ((DateTime)prop.GetValue(this)).ToString("yyyy-MM-dd HH:mm:ss"); } else // for properties without explicit names, i.e. only applied [Column] { key = prop.Name; } } dict.Add(key, value); } return dict; } public string ToJson() { var dict = this.GetDict(); var options = new JsonSerializerOptions { WriteIndented = true, }; return JsonSerializer.Serialize(dict, options); } public override string ToString() { var sb = new StringBuilder(); var dict = this.GetDict(); foreach (var item in dict) sb.Append($"{item.Key} = {item.Value}; "); return sb.ToString(); } } }
30.987013
135
0.520536
[ "MIT" ]
li-rongcheng/NetCoreUtils
NetCoreUtils.Database/NetCoreUtils.Database.InfluxDb/MeasurementBase.cs
2,388
C#
using M5.BitArraySerialization; using ProtoBuf; using System; using static Pineapple.Common.Preconditions; namespace M5.BloomFilter.Serialization { [ProtoContract] public class BloomFilter { public BloomFilter() { } public BloomFilter(IBloomFilter bloomFilter) { CheckIsNotNull(nameof(bloomFilter), bloomFilter); HashBits = new BitArray(bloomFilter.HashBits); var hashMethod = bloomFilter.Hash.ToHashMethod(); if (hashMethod == HashMethod.Unknown) throw new Exception("No hashmethod found."); HashMethod = hashMethod; var s = bloomFilter.Statistics; M = s.M; K = s.K; N = s.N; P = s.P; } [ProtoMember(1, Name = "hb")] public BitArray HashBits { get; set; } [ProtoMember(2, Name = "hm")] public HashMethod HashMethod { get; set; } [ProtoMember(3, Name = "m")] public int M { get; set; } [ProtoMember(4, Name = "k")] public short K { get; set; } [ProtoMember(5, Name = "n")] public long N { get; set; } [ProtoMember(6, Name = "p")] public double P { get; set; } public ReadOnlyFilter AsBloomFilter() { return new ReadOnlyFilter(HashBits.AsBitArray(), HashMethod, M, N, K, P); } } }
25
85
0.547368
[ "Apache-2.0" ]
MILL5/M5.BloomFilter
M5.BloomFilter.Serialization.ProtoBuf/BloomFilter.cs
1,427
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System.Threading; namespace Azure { /// <summary> /// Options that can be used to control the behavior of a request sent by a client. /// </summary> public class RequestContext : RequestOptions { /// <summary> /// Initializes a new instance of the <see cref="RequestContext"/> class. /// </summary> public RequestContext() : base() { } /// <summary> /// Initializes a new instance of the <see cref="RequestContext"/> class from /// a <see cref="RequestOptions"/> instance. /// </summary> public RequestContext(RequestOptions options) : base(options) { } /// <summary> /// Initializes a new instance of the <see cref="RequestContext"/> class using the given <see cref="ErrorOptions"/>. /// </summary> /// <param name="options"></param> public static implicit operator RequestContext(ErrorOptions options) => new RequestContext { ErrorOptions = options }; /// <summary> /// The token to check for cancellation. /// </summary> public CancellationToken CancellationToken { get; set; } = CancellationToken.None; } }
32.975
126
0.605004
[ "MIT" ]
Kyle8329/azure-sdk-for-net
sdk/core/Azure.Core/src/RequestContext.cs
1,321
C#
using System; namespace CCLLC.Core { public interface ICache { void Add(string key, object data, TimeSpan lifetime); void Add(string key, object data, int seconds); void Add<T>(string key, T data, TimeSpan lifetime); void Add<T>(string key, T data, int seconds); object Get(string key); T Get<T>(string key); bool Exists(string key); void Remove(string key); } }
18.666667
61
0.598214
[ "MIT" ]
ScottColson/CCLLCBusinessTransactionFramework
CDS/CCLLC.BTF.Process.CDSSolution/Plugins/App_Packages/CCLLC.Core.ProcessModel.1.1.5/Interfaces/ICache.cs
450
C#
/* * Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the runtime.sagemaker-2017-05-13.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.SageMakerRuntime.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.SageMakerRuntime.Model.Internal.MarshallTransformations { /// <summary> /// InvokeEndpoint Request Marshaller /// </summary> public class InvokeEndpointRequestMarshaller : IMarshaller<IRequest, InvokeEndpointRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((InvokeEndpointRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(InvokeEndpointRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.SageMakerRuntime"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-05-13"; request.HttpMethod = "POST"; if (!publicRequest.IsSetEndpointName()) throw new AmazonSageMakerRuntimeException("Request object does not have required field EndpointName set"); request.AddPathResource("{EndpointName}", StringUtils.FromString(publicRequest.EndpointName)); request.ResourcePath = "/endpoints/{EndpointName}/invocations"; request.MarshallerVersion = 2; request.ContentStream = publicRequest.Body ?? new MemoryStream(); request.Headers[Amazon.Util.HeaderKeys.ContentLengthHeader] = request.ContentStream.Length.ToString(CultureInfo.InvariantCulture); request.Headers[Amazon.Util.HeaderKeys.ContentTypeHeader] = "binary/octet-stream"; if(publicRequest.IsSetAccept()) request.Headers["Accept"] = publicRequest.Accept; if(publicRequest.IsSetContentType()) request.Headers["Content-Type"] = publicRequest.ContentType; if(publicRequest.IsSetCustomAttributes()) request.Headers["X-Amzn-SageMaker-Custom-Attributes"] = publicRequest.CustomAttributes; if(publicRequest.IsSetTargetModel()) request.Headers["X-Amzn-SageMaker-Target-Model"] = publicRequest.TargetModel; return request; } private static InvokeEndpointRequestMarshaller _instance = new InvokeEndpointRequestMarshaller(); internal static InvokeEndpointRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static InvokeEndpointRequestMarshaller Instance { get { return _instance; } } } }
39.028571
143
0.65715
[ "Apache-2.0" ]
Melvinerall/aws-sdk-net
sdk/src/Services/SageMakerRuntime/Generated/Model/Internal/MarshallTransformations/InvokeEndpointRequestMarshaller.cs
4,098
C#
using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 namespace aws { #pragma warning disable CS8618 [JsiiByValue(fqn: "aws.Wafv2WebAclRuleStatementOrStatementStatementOrStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchSingleHeader")] public class Wafv2WebAclRuleStatementOrStatementStatementOrStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchSingleHeader : aws.IWafv2WebAclRuleStatementOrStatementStatementOrStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchSingleHeader { [JsiiProperty(name: "name", typeJson: "{\"primitive\":\"string\"}", isOverride: true)] public string Name { get; set; } } }
38.8
289
0.787371
[ "MIT" ]
scottenriquez/cdktf-alpha-csharp-testing
resources/.gen/aws/aws/Wafv2WebAclRuleStatementOrStatementStatementOrStatementStatementAndStatementStatementSizeConstraintStatementFieldToMatchSingleHeader.cs
776
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNative.DataMigration.Outputs { [OutputType] public sealed class ConnectToTargetSqlDbTaskOutputResponse { /// <summary> /// Source databases as a map from database name to database id /// </summary> public readonly ImmutableDictionary<string, string> Databases; /// <summary> /// Result identifier /// </summary> public readonly string Id; /// <summary> /// Target server brand version /// </summary> public readonly string TargetServerBrandVersion; /// <summary> /// Version of the target server /// </summary> public readonly string TargetServerVersion; [OutputConstructor] private ConnectToTargetSqlDbTaskOutputResponse( ImmutableDictionary<string, string> databases, string id, string targetServerBrandVersion, string targetServerVersion) { Databases = databases; Id = id; TargetServerBrandVersion = targetServerBrandVersion; TargetServerVersion = targetServerVersion; } } }
29.52
81
0.634824
[ "Apache-2.0" ]
pulumi-bot/pulumi-azure-native
sdk/dotnet/DataMigration/Outputs/ConnectToTargetSqlDbTaskOutputResponse.cs
1,476
C#
using System; namespace ToHUI { class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); } } }
13.307692
46
0.50289
[ "Apache-2.0" ]
210215-USF-NET/I.G-code
code_week1/Firstcode/TourofHeroes/ToHUI/Program.cs
175
C#
using Handelabra.Sentinels.Engine.Controller; using Handelabra.Sentinels.Engine.Model; using System; using System.Collections; using System.Collections.Generic; using System.Linq; namespace Chasejyd.Rockstar { public class BlondeAmbitionCardController : RockstarCardController { public BlondeAmbitionCardController(Card card, TurnTakerController turnTakerController) : base(card, turnTakerController) { } public override IEnumerator Play() { //Deal one Target 2 Melee damage. Deal a second target 2 Projectile Damage. List<DealDamageAction> targets = new List<DealDamageAction>(); IEnumerator firstDamage = base.GameController.SelectTargetsAndDealDamage(this.DecisionMaker, new DamageSource(base.GameController, base.CharacterCard), 2, DamageType.Melee, new int?(1), false, new int?(1), storedResultsDamage: targets, addStatusEffect: RemoveEndOfTurnResponse, cardSource: GetCardSource()); IEnumerator secondDamage = base.GameController.SelectTargetsAndDealDamage(this.DecisionMaker, new DamageSource(base.GameController, base.CharacterCard), 2, DamageType.Projectile, new int?(1), false, new int?(1), additionalCriteria: (Card c) => !(from d in targets select d.Target).Contains(c), addStatusEffect: RemoveEndOfTurnResponse, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return base.GameController.StartCoroutine(firstDamage); yield return base.GameController.StartCoroutine(secondDamage); } else { base.GameController.ExhaustCoroutine(firstDamage); base.GameController.ExhaustCoroutine(secondDamage); } yield break; } private IEnumerator RemoveEndOfTurnResponse(DealDamageAction dd) { //Non-character-card targets dealt damage this way may not use any End of Turn abilities until the start of {Rockstar}'s next turn. if (dd != null && dd.DidDealDamage && dd.Target != null && !dd.Target.IsCharacter) { PreventPhaseEffectStatusEffect preventPhaseEffectStatusEffect = new PreventPhaseEffectStatusEffect(); preventPhaseEffectStatusEffect.UntilStartOfNextTurn(TurnTaker); preventPhaseEffectStatusEffect.CardCriteria.IsSpecificCard = dd.Target; IEnumerator coroutine = AddStatusEffect(preventPhaseEffectStatusEffect); if (base.UseUnityCoroutines) { yield return base.GameController.StartCoroutine(coroutine); } else { base.GameController.ExhaustCoroutine(coroutine); } } } } }
50.819672
359
0.609677
[ "MIT" ]
wrhyme29/ChasejydMods
Controller/Heroes/Rockstar/Cards/BlondeAmbitionCardController.cs
3,102
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; [assembly: Microsoft.AspNetCore.Identity.UI.UIFrameworkAttribute("Bootstrap5")] [assembly: Microsoft.Extensions.Configuration.UserSecrets.UserSecretsIdAttribute("aspnet-DNEBlazor-3B2C7558-54D0-4AB6-B519-440F5DD4C9D7")] [assembly: System.Reflection.AssemblyCompanyAttribute("DNEBlazor")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] [assembly: System.Reflection.AssemblyProductAttribute("DNEBlazor")] [assembly: System.Reflection.AssemblyTitleAttribute("DNEBlazor")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] // Generated by the MSBuild WriteCodeFragment class.
46
138
0.683946
[ "MIT" ]
tahmidradit/DNEBlazor
DNEBlazor/obj/Debug/net6.0/DNEBlazor.AssemblyInfo.cs
1,196
C#
/* Copyright 2011 repetier repetierdev@gmail.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace RepetierHost.model { public class IniSection { public string name; public Dictionary<string, string> entries; public IniSection(string _name) { entries = new Dictionary<string, string>(); name = _name; } public void addLine(string l) { int p = l.IndexOf('='); string name = l.Substring(0, p).Trim(); if (!entries.ContainsKey(name)) entries.Add(name, l); } public void merge(IniSection s) { foreach (String name in s.entries.Keys) { if (name == "extrusion_multiplier" || name == "filament_diameter" || name=="first_layer_temperature" || name =="temperature") { if (entries.ContainsKey(name)) { string full = s.entries[name]; int p = full.IndexOf('='); if (p >= 0) full = full.Substring(p + 1).Trim(); entries[name] += "," + full; } else { entries.Add(name, s.entries[name]); } } } } } public class IniFile { public string path = ""; public Dictionary<string, IniSection> sections = new Dictionary<string, IniSection>(); public void read(string _path) { if (_path != null) path = _path; IniSection actSect = null; actSect = new IniSection(""); sections.Add("", actSect); if (!File.Exists(path)) return; string[] lines = File.ReadAllLines(path, Encoding.UTF8); foreach (string line in lines) { string tl = line.Trim(); if (tl.StartsWith("#")) continue; // comment if (tl.StartsWith("[") && tl.EndsWith("]")) { string secname = tl.Substring(1, tl.Length - 2); actSect = sections[secname]; if (actSect == null) { actSect = new IniSection(secname); sections.Add(secname, actSect); } continue; } int p = tl.IndexOf('='); if (p < 0) continue; actSect.addLine(line); } } public void add(IniFile f) { foreach (IniSection s in f.sections.Values) { if (!sections.ContainsKey(s.name)) { sections.Add(s.name, new IniSection(s.name)); } IniSection ms = sections[s.name]; foreach (string ent in s.entries.Values) ms.addLine(ent); } } /// <summary> /// Merges the values of both ini files by seperating values by a , /// </summary> /// <param name="f"></param> public void merge(IniFile f) { foreach (IniSection s in f.sections.Values) { if (!sections.ContainsKey(s.name)) { sections.Add(s.name, new IniSection(s.name)); } else { sections[s.name].merge(s); } /*IniSection ms = sections[s.name]; foreach (string ent in s.entries.Values) ms.addLine(ent);*/ } } public void flatten() { IniSection flat = sections[""]; LinkedList<IniSection> dellist = new LinkedList<IniSection>(); foreach (IniSection s in sections.Values) { if (s.name == "") continue; foreach (string line in s.entries.Values) flat.addLine(line); dellist.AddLast(s); } foreach (IniSection s in dellist) sections.Remove(s.name); } public void write(string path) { LinkedList<string> lines = new LinkedList<string>(); foreach (IniSection s in sections.Values) { if (s.name != "") lines.AddLast("[" + s.name + "]"); foreach (string line in s.entries.Values) lines.AddLast(line); } File.WriteAllLines(path, lines.ToArray()); } } }
34.8375
117
0.457122
[ "ECL-2.0", "Apache-2.0" ]
KouOuchi/Repetier-Host
src/RepetierHost/model/IniManager.cs
5,576
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.CodeDom; using System.Linq; using Microsoft.TestCommon; namespace System.Web.Mvc.Test { public class ViewUserControlControlBuilderTest { [Fact] public void BuilderWithoutInheritsDoesNothing() { // Arrange var builder = new ViewUserControlControlBuilder(); var derivedType = new CodeTypeDeclaration(); derivedType.BaseTypes.Add("basetype"); // Act builder.ProcessGeneratedCode(null, null, derivedType, null, null); // Assert Assert.Equal("basetype", derivedType.BaseTypes.Cast<CodeTypeReference>().Single().BaseType); } [Fact] public void BuilderWithInheritsSetsBaseType() { // Arrange var builder = new ViewUserControlControlBuilder { Inherits = "inheritedtype" }; var derivedType = new CodeTypeDeclaration(); derivedType.BaseTypes.Add("basetype"); // Act builder.ProcessGeneratedCode(null, null, derivedType, null, null); // Assert Assert.Equal("inheritedtype", derivedType.BaseTypes.Cast<CodeTypeReference>().Single().BaseType); } } }
32.395349
111
0.630294
[ "Apache-2.0" ]
1508553303/AspNetWebStack
test/System.Web.Mvc.Test/Test/ViewUserControlControlBuilderTest.cs
1,395
C#
// Copyright (c) Huy Hoang. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using Dash.Engine; using FluentAssertions; using Xunit; namespace Dash.Tests.Engine { public class BuildOutputTests { [Fact] public void Ctor_PathContent_ShouldAssignToProperties() { // Arrange var path = "c:/temp/foo.cs"; var content = "public class Foobar {}"; // Act var sut = new BuildOutput(path, content); // Assert sut.Path.Should().Be(@"c:/temp/foo.cs"); sut.GeneratedSourceCodeContent.Should().Be(content); } [Fact] public void Equals_Object_IsNull_ShouldReturnFalse() { // Arrange var sut = new BuildOutput("c:/foo", "foo"); // Act var result = sut.Equals((object?) null); // Assert result.Should().BeFalse(); } [Fact] public void Equals_Object_IsItself_ShouldReturnTrue() { // Arrange var sut = new BuildOutput("c:/foo", "foo"); // Act var result = sut.Equals((object) sut); // Assert result.Should().BeTrue(); } [Fact] public void Equals_Object_IsDifferentType_ShouldReturnFalse() { // Arrange var sut = new BuildOutput("c:/foo", "foo"); var s = (object) "c:/foo"; // Act var result = sut.Equals(s); // Assert result.Should().BeFalse(); } [Fact] public void Equals_Object_SamePath_ShouldReturnTrue() { // Arrange var sut = new BuildOutput("c:/foo", "foo"); var buildOutput = new BuildOutput("c:/foo", "foo"); // Act var result = sut.Equals((object) buildOutput); // Assert result.Should().BeTrue(); } [Fact] public void Equals_Object_ItemHasDifferentPath_ShouldReturnFalse() { // Arrange var sut = new BuildOutput("c:/foo", "foo"); var buildOutput = new BuildOutput("c:/bar", "foo"); // Act var result = sut.Equals(buildOutput); // Assert result.Should().BeFalse(); } [Fact] public void Equals_BuildOutput_HasSamePath_ShouldReturnTrue() { // Arrange var sut = new BuildOutput("c:/foo", "foo"); var buildOutput = new BuildOutput("c:/foo", "foo"); // Act var result = sut.Equals(buildOutput); // Assert result.Should().BeTrue(); } [Fact] public void GetHashCode_SamePath_ShouldProduceTheSameHashCode() { // Arrange var sut = new BuildOutput("c:/foo.bar", "foo"); var hashCode = new BuildOutput("c:/foo.bar", "foo bar").GetHashCode(); // Act var result = sut.GetHashCode(); // Assert result.Should().Be(hashCode); } } }
26.129032
107
0.504938
[ "Apache-2.0" ]
dotnet-dash/dash
src/Dash/test/Dash.Tests/Engine/BuildOutputTests.cs
3,242
C#
using System.Collections.Generic; using System.Linq; using Duality.Editor.Plugins.Base.Properties; using Duality.Resources; namespace Duality.Editor.Plugins.Base.UndoRedoActions { public class ClearAtlasAction : UndoRedoAction { private Pixmap[] pixmaps = null; private List<Rect[]> originalRects = null; public override string Name { get { return EditorBaseRes.UndoRedo_ClearAtlas; } } public ClearAtlasAction(IEnumerable<Pixmap> pixmapsEnum) { this.pixmaps = pixmapsEnum.ToArray(); } public override void Do() { this.originalRects = new List<Rect[]>(); for (int i = 0; i < this.pixmaps.Length; i++) { // Copy the existing atlas this.originalRects.Add(this.pixmaps[i].Atlas == null ? null : this.pixmaps[i].Atlas.ToArray()); this.pixmaps[i].Atlas = null; } DualityEditorApp.NotifyObjPropChanged(this, new ObjectSelection(this.pixmaps.Distinct())); } public override void Undo() { for (int i = 0; i < this.pixmaps.Length; i++) { this.pixmaps[i].Atlas = this.originalRects[i] == null ? null : new List<Rect>(this.originalRects[i]); } DualityEditorApp.NotifyObjPropChanged(this, new ObjectSelection(this.pixmaps.Distinct())); } } }
23.45283
93
0.686243
[ "MIT" ]
AdamsLair/duality
Source/Plugins/EditorBase/UndoRedoActions/ClearAtlasAction.cs
1,245
C#
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace ParticleEmitter { public struct ParticleGeneratorOptions { /// <summary> /// The Texture to use for the particles /// </summary> public Texture2D Texture; /// <summary> /// The total number of particles to generate /// </summary> public int Count; /// <summary> /// The color mask to use when rendering the particles /// </summary> public Color Color; /// <summary> /// The minimum and maximum velocity allowed for the particles /// </summary> public MinMaxFloat Velocity; /// <summary> /// The type of emission the particles will follow /// </summary> public EmissionType EmissionType; /// <summary> /// The minimum and maximum rotation velocity allowed for the particles /// </summary> public MinMaxFloat RotationVelocity; /// <summary> /// The minimum and maximum to scale the render of the particles /// </summary> public MinMaxFloat Scale; /// <summary> /// The minimum and maximum time allowed for particles to live /// </summary> public MinMaxFloat TimeToLive; /// <summary> /// Should the particles fade out over time before being destoryed /// </summary> public bool Fade; } /// <summary> /// A simple struct to represent minimum and maximum float values /// </summary> public struct MinMaxFloat { public float Minimum; public float Maximum; } }
27.412698
83
0.567458
[ "MIT" ]
manbeardgames/particle-emitter
source/ParticleEmitter/ParticleGeneratorOptions.cs
1,729
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Application.OrderForms.Queries.GetFormInformations { public class GetFormInformationDto { public string TemplateName { get; set; } public string Type { get; set; } public int MaxRetryCount { get; set; } public int RetryFrequence { get; set; } public int ExpireInMinutes { get; set; } } }
26
60
0.688034
[ "MIT" ]
hub-burgan-com-tr/bbt.endorsement
src/Application/OrderForms/Queries/GetFormInformations/GetFormInformationDto.cs
470
C#
using NUnit.Framework; using System; using System.Collections.Generic; namespace Exercise.Tests { [TestFixture] public class ListIteratorTests { private ListIterator listIterator; [SetUp] public void SetUp() { this.listIterator = new ListIterator(new List<string>() { "a", "b" }); } [Test] public void MoveReturnsFalseWhenIndexOutOfCollection() { // Arrange // Act this.listIterator.Move(); // Assert Assert.IsFalse(this.listIterator.Move()); } [Test] public void MoveReturnsTrueWhenIndexInsideCollection() { // Arrange // Act // Assert Assert.IsTrue(this.listIterator.Move()); } [Test] public void HasNextCorrectlyReturnsFalse() { // Arrange // Act this.listIterator.Move(); // Assert Assert.IsFalse(this.listIterator.HasNext()); } [Test] public void HasNextCorrectlyReturnsTrue() { // Arrange // Act // Assert Assert.IsTrue(this.listIterator.HasNext()); } [Test] public void PrintCurrentElement() { // Arrange // Act string element = this.listIterator.Print(); // Assert Assert.AreEqual("a", element); } [Test] public void TryPrintWhenEmpty() { // Arrange this.listIterator = new ListIterator(new List<string>()); // Act // Assert Exception e = Assert.Throws<InvalidOperationException>(() => this.listIterator.Print()); Assert.AreEqual("Invalid Operation!", e.Message); } } }
21.41573
100
0.498426
[ "MIT" ]
Koceto/SoftUni
C# Fundamentals/C# OOP Advanced/Unit Testing/Exercise.Tests/ListIteratorTests.cs
1,908
C#
// Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Globalization; using System.Linq; using System.Runtime.Serialization; using System.Threading; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.Diagnostics; using Roslyn.Test.Utilities; using Roslyn.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.CSharp.UnitTests { public partial class DiagnosticAnalyzerTests : CompilingTestBase { [Serializable] class TestDiagnostic : Diagnostic, ISerializable { private readonly string id; private readonly string kind; private readonly DiagnosticSeverity severity; private readonly Location location; private readonly string message; private readonly bool isWarningAsError; private readonly object[] arguments; private static readonly Location[] emptyLocations = new Location[0]; public TestDiagnostic(string id, string kind, DiagnosticSeverity severity, Location location, string message, bool isWarningAsError, params object[] arguments) { this.id = id; this.kind = kind; this.severity = severity; this.location = location; this.message = message; this.isWarningAsError = isWarningAsError; this.arguments = arguments; } public override IReadOnlyList<Location> AdditionalLocations { get { return emptyLocations; } } public override string Id { get { return id; } } public override string Category { get { return kind; } } public override Location Location { get { return location; } } internal override IReadOnlyList<object> Arguments { get { return arguments; } } public override DiagnosticSeverity Severity { get { return severity; } } public override int WarningLevel { get { return 2; } } public override bool IsWarningAsError { get { return isWarningAsError; } } public override bool Equals(Diagnostic obj) { if (obj == null || this.GetType() != obj.GetType()) return false; TestDiagnostic other = (TestDiagnostic)obj; return this.id == other.id && this.kind == other.kind && this.location == other.location && this.message == other.message && SameData(this.arguments, other.arguments); } private static bool SameData(object[] d1, object[] d2) { return (d1 == null) == (d2 == null) && (d1 == null || d1.SequenceEqual(d2)); } public override string GetMessage(CultureInfo culture = null) { return string.Format(message, arguments); } private TestDiagnostic(SerializationInfo info, StreamingContext context) { this.id = info.GetString("id"); this.kind = info.GetString("kind"); this.message = info.GetString("message"); this.location = (Location)info.GetValue("location", typeof(Location)); this.severity = (DiagnosticSeverity)info.GetValue("severity", typeof(DiagnosticSeverity)); this.isWarningAsError = info.GetBoolean("isWarningAsError"); this.arguments = (object[])info.GetValue("arguments", typeof(object[])); } void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("id", this.id); info.AddValue("kind", this.kind); info.AddValue("message", this.message); info.AddValue("location", this.location, typeof(Location)); info.AddValue("severity", this.severity, typeof(DiagnosticSeverity)); info.AddValue("isWarningAsError", this.isWarningAsError); info.AddValue("arguments", this.arguments, typeof(object[])); } internal override Diagnostic WithLocation(Location location) { // We do not implement "additional locations" throw new NotImplementedException(); } internal override Diagnostic WithWarningAsError(bool isWarningAsError) { if (isWarningAsError && severity == DiagnosticSeverity.Warning) { return new TestDiagnostic(id, kind, DiagnosticSeverity.Error, location, message, true, arguments); } else { return this; } } } class ComplainAboutX : ISyntaxNodeAnalyzer<SyntaxKind> { private static readonly DiagnosticDescriptor CA9999_UseOfVariableThatStartsWithX = new DiagnosticDescriptor(id: "CA9999", description: "CA9999_UseOfVariableThatStartsWithX", messageFormat: "Use of variable whose name starts with 'x': '{0}'", category: "Test", defaultSeverity: DiagnosticSeverity.Warning); public ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get { return ImmutableArray.Create(CA9999_UseOfVariableThatStartsWithX); } } private static readonly ImmutableArray<SyntaxKind> kindsOfInterest = ImmutableArray.Create<SyntaxKind> ( // A use of an identifier. Note that identifiers used in a definitional context use a different syntax SyntaxKind.IdentifierName ); public ImmutableArray<SyntaxKind> SyntaxKindsOfInterest { get { return kindsOfInterest; } } public void AnalyzeNode(SyntaxNode node, SemanticModel semanticModel, Action<Diagnostic> addDiagnostic, CancellationToken cancellationToken) { var id = (IdentifierNameSyntax)node; if (id.Identifier.ValueText.StartsWith("x")) { addDiagnostic(new TestDiagnostic("CA9999_UseOfVariableThatStartsWithX", "CsTest", DiagnosticSeverity.Warning, id.Location, "Use of variable whose name starts with 'x': '{0}'", false, id.Identifier.ValueText)); } } } [WorkItem(892467)] [Fact] public void SimplestDiagnosticAnalyzerTest() { string source = @"public class C : NotFound { int x1(int x2) { int x3 = x1(x2); return x3 + 1; } }"; CreateCompilationWithMscorlib45(source) .VerifyDiagnostics( // (1,18): error CS0246: The type or namespace name 'NotFound' could not be found (are you missing a using directive or an assembly reference?) // public class C : NotFound Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "NotFound").WithArguments("NotFound") ) .VerifyAnalyzerDiagnostics(new IDiagnosticAnalyzer[] { new ComplainAboutX() }, // (5,18): warning CA9999_UseOfVariableThatStartsWithX: Use of variable whose name starts with 'x': 'x1' // int x3 = x1(x2); Diagnostic("CA9999_UseOfVariableThatStartsWithX", "x1").WithArguments("x1"), // (5,21): warning CA9999_UseOfVariableThatStartsWithX: Use of variable whose name starts with 'x': 'x2' // int x3 = x1(x2); Diagnostic("CA9999_UseOfVariableThatStartsWithX", "x2").WithArguments("x2"), // (6,16): warning CA9999_UseOfVariableThatStartsWithX: Use of variable whose name starts with 'x': 'x3' // return x3 + 1; Diagnostic("CA9999_UseOfVariableThatStartsWithX", "x3").WithArguments("x3") ); } [WorkItem(892467)] [Fact] public void SimplestDiagnosticAnalyzerTestInInitializer() { string source = @"delegate int D(out int x); public class C : NotFound { static int x1 = 2; static int x2 = 3; int x3 = x1 + x2; D d1 = (out int x4) => (x4 = 1) + @x4; }"; // TODO: Compilation create doesn't accept analyzers anymore. CreateCompilationWithMscorlib45(source).VerifyDiagnostics( // (2,18): error CS0246: The type or namespace name 'NotFound' could not be found (are you missing a using directive or an assembly reference?) // public class C : NotFound Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "NotFound").WithArguments("NotFound") ) .VerifyAnalyzerDiagnostics(new IDiagnosticAnalyzer[] { new ComplainAboutX() }, // (6,14): warning CA9999_UseOfVariableThatStartsWithX: Use of variable whose name starts with 'x': 'x1' // int x3 = x1 + x2; Diagnostic("CA9999_UseOfVariableThatStartsWithX", "x1").WithArguments("x1"), // (6,19): warning CA9999_UseOfVariableThatStartsWithX: Use of variable whose name starts with 'x': 'x2' // int x3 = x1 + x2; Diagnostic("CA9999_UseOfVariableThatStartsWithX", "x2").WithArguments("x2"), // (7,29): warning CA9999_UseOfVariableThatStartsWithX: Use of variable whose name starts with 'x': 'x4' // D d1 = (out int x4) => (x4 = 1) + @x4; Diagnostic("CA9999_UseOfVariableThatStartsWithX", "x4").WithArguments("x4"), // (7,39): warning CA9999_UseOfVariableThatStartsWithX: Use of variable whose name starts with 'x': 'x4' // D d1 = (out int x4) => (x4 = 1) + @x4; Diagnostic("CA9999_UseOfVariableThatStartsWithX", "@x4").WithArguments("x4") ); } [WorkItem(892467)] [Fact] public void DiagnosticAnalyzerSuppressDiagnostic() { string source = @" public class C : NotFound { int x1(int x2) { int x3 = x1(x2); return x3 + 1; } }"; // TODO: Compilation create doesn't accept analyzers anymore. var options = TestOptions.Dll.WithSpecificDiagnosticOptions( new[] { KeyValuePair.Create("CA9999_UseOfVariableThatStartsWithX", ReportDiagnostic.Suppress) }); CreateCompilationWithMscorlib45(source, compOptions: options/*, analyzers: new IDiagnosticAnalyzerFactory[] { new ComplainAboutX() }*/).VerifyDiagnostics( // (2,18): error CS0246: The type or namespace name 'NotFound' could not be found (are you missing a using directive or an assembly reference?) // public class C : NotFound Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "NotFound").WithArguments("NotFound")); } [WorkItem(892467)] [Fact] public void DiagnosticAnalyzerWarnAsError() { string source = @" public class C : NotFound { int x1(int x2) { int x3 = x1(x2); return x3 + 1; } }"; // TODO: Compilation create doesn't accept analyzers anymore. var options = TestOptions.Dll.WithSpecificDiagnosticOptions( new[] { KeyValuePair.Create("CA9999_UseOfVariableThatStartsWithX", ReportDiagnostic.Error) }); CreateCompilationWithMscorlib45(source, compOptions: options).VerifyDiagnostics( // (2,18): error CS0246: The type or namespace name 'NotFound' could not be found (are you missing a using directive or an assembly reference?) // public class C : NotFound Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "NotFound").WithArguments("NotFound")) .VerifyAnalyzerDiagnostics(new IDiagnosticAnalyzer[] { new ComplainAboutX() }, // (6,18): error CA9999_UseOfVariableThatStartsWithX: Use of variable whose name starts with 'x': 'x1' // int x3 = x1(x2); Diagnostic("CA9999_UseOfVariableThatStartsWithX", "x1").WithArguments("x1").WithWarningAsError(true), // (6,21): error CA9999_UseOfVariableThatStartsWithX: Use of variable whose name starts with 'x': 'x2' // int x3 = x1(x2); Diagnostic("CA9999_UseOfVariableThatStartsWithX", "x2").WithArguments("x2").WithWarningAsError(true), // (7,16): error CA9999_UseOfVariableThatStartsWithX: Use of variable whose name starts with 'x': 'x3' // return x3 + 1; Diagnostic("CA9999_UseOfVariableThatStartsWithX", "x3").WithArguments("x3").WithWarningAsError(true)); } [WorkItem(892467)] [Fact] public void DiagnosticAnalyzerWarnAsErrorGlobal() { string source = @" public class C : NotFound { int x1(int x2) { int x3 = x1(x2); return x3 + 1; } }"; var options = TestOptions.Dll.WithGeneralDiagnosticOption(ReportDiagnostic.Error); CreateCompilationWithMscorlib45(source, compOptions: options).VerifyDiagnostics( // (2,18): error CS0246: The type or namespace name 'NotFound' could not be found (are you missing a using directive or an assembly reference?) // public class C : NotFound Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "NotFound").WithArguments("NotFound") ) .VerifyAnalyzerDiagnostics(new IDiagnosticAnalyzer[] { new ComplainAboutX() }, // (6,18): error CA9999_UseOfVariableThatStartsWithX: Use of variable whose name starts with 'x': 'x1' // int x3 = x1(x2); Diagnostic("CA9999_UseOfVariableThatStartsWithX", "x1").WithArguments("x1").WithWarningAsError(true), // (6,21): error CA9999_UseOfVariableThatStartsWithX: Use of variable whose name starts with 'x': 'x2' // int x3 = x1(x2); Diagnostic("CA9999_UseOfVariableThatStartsWithX", "x2").WithArguments("x2").WithWarningAsError(true), // (7,16): error CA9999_UseOfVariableThatStartsWithX: Use of variable whose name starts with 'x': 'x3' // return x3 + 1; Diagnostic("CA9999_UseOfVariableThatStartsWithX", "x3").WithArguments("x3").WithWarningAsError(true)); } class SyntaxAndSymbolAnalyzer : ISyntaxNodeAnalyzer<SyntaxKind>, ISymbolAnalyzer { private static readonly DiagnosticDescriptor descriptor = new DiagnosticDescriptor("XX0001", "My Syntax/Symbol Diagnostic", "My Syntax/Symbol Diagnostic for '{0}'", "Compiler", DiagnosticSeverity.Warning); public ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get { return ImmutableArray.Create(descriptor); } } public ImmutableArray<SymbolKind> SymbolKindsOfInterest { get { return ImmutableArray.Create(SymbolKind.NamedType); } } public ImmutableArray<SyntaxKind> SyntaxKindsOfInterest { get { return ImmutableArray.Create(SyntaxKind.Attribute, SyntaxKind.ClassDeclaration, SyntaxKind.UsingStatement); } } public void AnalyzeNode(SyntaxNode node, SemanticModel semanticModel, Action<Diagnostic> addDiagnostic, CancellationToken cancellationToken) { switch (node.CSharpKind()) { case SyntaxKind.Attribute: var diag1 = CodeAnalysis.Diagnostic.Create(descriptor, node.GetLocation(), "Attribute"); addDiagnostic(diag1); break; case SyntaxKind.ClassDeclaration: var diag2 = CodeAnalysis.Diagnostic.Create(descriptor, node.GetLocation(), "ClassDeclaration"); addDiagnostic(diag2); break; case SyntaxKind.UsingStatement: var diag3 = CodeAnalysis.Diagnostic.Create(descriptor, node.GetLocation(), "UsingStatement"); addDiagnostic(diag3); break; } } public void AnalyzeSymbol(ISymbol symbol, Compilation compilation, Action<Diagnostic> addDiagnostic, CancellationToken cancellationToken) { var diag1 = CodeAnalysis.Diagnostic.Create(descriptor, symbol.Locations[0], "NamedType"); addDiagnostic(diag1); } } [WorkItem(914236)] [Fact(Skip = "914236")] public void DiagnosticAnalyzerSyntaxNodeAndSymbolAnalysis() { string source = @" using System; [Obsolete] public class C { }"; var options = TestOptions.Dll.WithGeneralDiagnosticOption(ReportDiagnostic.Error); CreateCompilationWithMscorlib45(source, compOptions: options) .VerifyDiagnostics() .VerifyAnalyzerDiagnostics(new IDiagnosticAnalyzer[] { new SyntaxAndSymbolAnalyzer() }, // Symbol diagnostics Diagnostic("XX0001", "C").WithWarningAsError(true), // Syntax diagnostics Diagnostic("XX0001", "using System;").WithWarningAsError(true), Diagnostic("XX0001", "[Obsolete]").WithWarningAsError(true), Diagnostic("XX0001", "C").WithWarningAsError(true)); } } }
46.533333
238
0.596154
[ "Apache-2.0" ]
codemonkey85/roslyn
Src/Compilers/CSharp/Test/Semantic/Diagnostics/DiagnosticAnalyzerTests.cs
18,148
C#
namespace OJS.Web { using System.Web.Optimization; public class BundleConfig { public static void RegisterBundles(BundleCollection bundles) { RegisterScripts(bundles); RegisterStyles(bundles); } private static void RegisterScripts(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/global").Include( "~/Scripts/global.js")); bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js", "~/Scripts/jquery.unobtrusive-ajax.js")); bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( "~/Scripts/jquery.unobtrusive*", "~/Scripts/jquery.validate*")); bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( "~/Scripts/bootstrap.js")); bundles.Add(new ScriptBundle("~/bundles/knockout").Include( "~/Scripts/knockout-{version}.js")); bundles.Add(new ScriptBundle("~/bundles/kendo").Include( "~/Scripts/KendoUI/2014.2.903/kendo.web.js", "~/Scripts/KendoUI/2014.2.903/kendo.aspnetmvc.js", "~/Scripts/KendoUI/2014.2.903/cultures/kendo.culture.bg.js", "~/Scripts/KendoUI/2014.2.903/cultures/kendo.culture.en-GB.js")); bundles.Add(new ScriptBundle("~/bundles/codemirror").Include( "~/Scripts/CodeMirror/codemirror.js", "~/Scripts/CodeMirror/mode/clike.js", "~/Scripts/CodeMirror/mode/javascript.js")); } private static void RegisterStyles(BundleCollection bundles) { bundles.Add(new StyleBundle("~/Content/css").Include( "~/Content/site.css")); bundles.Add(new StyleBundle("~/Content/KendoUI/kendo").Include( "~/Content/KendoUI/kendo.common.css", "~/Content/KendoUI/kendo.black.css")); bundles.Add(new StyleBundle("~/Content/bootstrap/bootstrap").Include( "~/Content/bootstrap/themes/bootstrap-theme-cyborg.css")); bundles.Add(new StyleBundle("~/Content/CodeMirror/codemirror").Include( "~/Content/CodeMirror/codemirror.css", "~/Content/CodeMirror/theme/tomorrow-night-eighties.css", "~/Content/CodeMirror/theme/the-matrix.css")); bundles.Add(new StyleBundle("~/Content/Contests/submission-page").Include( "~/Content/Contests/submission-page.css")); } } }
42.030303
89
0.549748
[ "MIT" ]
SveGeorgiev/OpenJudgeSystem
Open Judge System/Web/OJS.Web/App_Start/BundleConfig.cs
2,776
C#
using System; namespace AstRoslyn { public class TypeIntent { public Type Type { get; set; } public int Intent { get; set; } } }
13.333333
39
0.56875
[ "MIT" ]
arise-project/iso3
AstGraphDbConnector/AstRoslyn/TypeIntent.cs
162
C#
using AskMe.API.Controllers; using AskMe.API.Models; using AskMe.Domain.Interfaces; using AskMe.Domain.Models; using AutoBogus; using AutoMapper; using FluentAssertions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Moq; using System.Collections.Generic; using System.Threading.Tasks; using Xunit; using Xunit.Sdk; namespace AskMe.UnitTest.API.Controllers { public class ExamsControllerTests { private readonly Mock<IExamService> _examService; private readonly Mock<IMapper> _mapper; private readonly ExamsController _sut; public ExamsControllerTests() { _mapper = new Mock<IMapper>(); _examService = new Mock<IExamService>(); _sut = new ExamsController(_mapper.Object, _examService.Object); } [Fact] public void ExamsController_Inherits_ControllerBase() { typeof(ExamsController).Should().BeAssignableTo<ControllerBase>(); } [Fact] public void ExamsController_DecoratedWithAutorizeAttribute() { typeof(ExamsController).Should().BeDecoratedWith<AuthorizeAttribute>(); } [Fact] public void ExamsController_DecoratedWithRouteAttribute() { typeof(ExamsController).Should().BeDecoratedWith<RouteAttribute>(a => a.Template == "api/users/{userId}/exams"); } [Fact] public void ExamsController_DecoratedWithApiControllerAttribute() { typeof(ExamsController).Should().BeDecoratedWith<ApiControllerAttribute>(); } [Fact] public void GetExams_DecoratedWithGetAttribute() { typeof(ExamsController).GetMethod("GetExams", new[] { typeof(int) }).Should() .BeDecoratedWith<HttpGetAttribute>(); } [Fact] public async Task GetExams_WithUserId_ReturnsExamList() { //Arrange var userId = AutoFaker.Generate<int>(); var exams = AutoFaker.Generate<List<Exam>>(); _examService.Setup(x => x.GetExams(It.IsAny<int>())) .ReturnsAsync(exams); //Act var result = await _sut.GetExams(userId); //Assert result.Should().BeOfType<OkObjectResult>(); ((OkObjectResult)result).StatusCode.Should().Be(StatusCodes.Status200OK); ((OkObjectResult)result).Value.Should().BeEquivalentTo(exams); } [Fact] public async Task GetExam_WithExamId_ReturnsExistingExam() { //Arrange var examId = AutoFaker.Generate<int>(); var exam = AutoFaker.Generate<Exam>(); var examDto = AutoFaker.Generate<ExamDto>(); _examService.Setup(x => x.GetExamById(It.IsAny<int>())) .ReturnsAsync(exam); _mapper.Setup(x => x.Map<ExamDto>(exam)) .Returns(examDto); //Act var result = await _sut.GetExam(examId); //Assert result.Should().BeOfType<OkObjectResult>(); ((OkObjectResult)result).StatusCode.Should().Be(StatusCodes.Status200OK); ((OkObjectResult)result).Value.Should().BeEquivalentTo(examDto); } [Fact] public async Task GetExam_WithNotExistingExamId_ReturnsNotFound() { //Arrange var examId = AutoFaker.Generate<int>(); var exam = (Exam)null; _examService.Setup(x => x.GetExamById(It.IsAny<int>())) .ReturnsAsync(exam); //Act var result = await _sut.GetExam(examId); //Assert result.Should().BeOfType<NotFoundResult>(); ((NotFoundResult)result).StatusCode.Should().Be(StatusCodes.Status404NotFound); } } }
32.214876
124
0.608517
[ "MIT" ]
x17127271/AskMeAPI
AskMe.UnitTest/API/Controllers/ExamsControllerTests.cs
3,900
C#
// // ResolveAssemblyReference.cs: Searches for assembly files. // // Author: // Marek Sieradzki (marek.sieradzki@gmail.com) // Ankit Jain (jankit@novell.com) // // (C) 2006 Marek Sieradzki // Copyright 2009 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Security; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; namespace Microsoft.Build.Tasks { public class ResolveAssemblyReference : TaskExtension { bool autoUnify; ITaskItem[] assemblyFiles; ITaskItem[] assemblies; string appConfigFile; string[] allowedAssemblyExtensions; string[] allowedRelatedFileExtensions; string[] candidateAssemblyFiles; ITaskItem[] copyLocalFiles; ITaskItem[] filesWritten; bool findDependencies; bool findRelatedFiles; bool findSatellites; bool findSerializationAssemblies; string[] installedAssemblyTables; ITaskItem[] relatedFiles; ITaskItem[] resolvedDependencyFiles; ITaskItem[] resolvedFiles; ITaskItem[] satelliteFiles; ITaskItem[] scatterFiles; string[] searchPaths; ITaskItem[] serializationAssemblyFiles; bool silent; string stateFile; ITaskItem[] suggestedRedirects; string[] targetFrameworkDirectories; string targetProcessorArchitecture; static string [] default_assembly_extensions; AssemblyResolver assembly_resolver; List<string> dependency_search_paths; Dictionary<string, ResolvedReference> assemblyNameToResolvedRef; Dictionary<string, ITaskItem> tempSatelliteFiles, tempRelatedFiles, tempResolvedDepFiles, tempCopyLocalFiles; List<ITaskItem> tempResolvedFiles; List<PrimaryReference> primaryReferences; Dictionary<string, string> alreadyScannedAssemblyNames; Dictionary<string, string> conflictWarningsCache; //FIXME: construct and use a graph of the dependencies, useful across projects static ResolveAssemblyReference () { default_assembly_extensions = new string [] { ".dll", ".exe" }; } public ResolveAssemblyReference () { assembly_resolver = new AssemblyResolver (); } //FIXME: make this reusable public override bool Execute () { if (assemblies == null && assemblyFiles == null) // nothing to resolve return true; LogTaskParameters (); assembly_resolver.Log = Log; tempResolvedFiles = new List<ITaskItem> (); tempCopyLocalFiles = new Dictionary<string, ITaskItem> (); tempSatelliteFiles = new Dictionary<string, ITaskItem> (); tempRelatedFiles = new Dictionary<string, ITaskItem> (); tempResolvedDepFiles = new Dictionary<string, ITaskItem> (); primaryReferences = new List<PrimaryReference> (); assemblyNameToResolvedRef = new Dictionary<string, ResolvedReference> (); conflictWarningsCache = new Dictionary<string, string> (); ResolveAssemblies (); ResolveAssemblyFiles (); resolvedFiles = tempResolvedFiles.ToArray (); alreadyScannedAssemblyNames = new Dictionary<string, string> (); // the first element is place holder for parent assembly's dir dependency_search_paths = new List<string> () { String.Empty }; dependency_search_paths.AddRange (searchPaths); // resolve dependencies foreach (PrimaryReference pref in primaryReferences) ResolveAssemblyFileDependencies (pref.TaskItem, pref.ParentCopyLocal); copyLocalFiles = tempCopyLocalFiles.Values.ToArray (); satelliteFiles = tempSatelliteFiles.Values.ToArray (); relatedFiles = tempRelatedFiles.Values.ToArray (); resolvedDependencyFiles = tempResolvedDepFiles.Values.ToArray (); tempResolvedFiles.Clear (); tempCopyLocalFiles.Clear (); tempSatelliteFiles.Clear (); tempRelatedFiles.Clear (); tempResolvedDepFiles.Clear (); alreadyScannedAssemblyNames.Clear (); primaryReferences.Clear (); assemblyNameToResolvedRef.Clear (); conflictWarningsCache.Clear (); dependency_search_paths = null; return true; } void ResolveAssemblies () { if (assemblies == null || assemblies.Length == 0) return; foreach (ITaskItem item in assemblies) { if (!String.IsNullOrEmpty (item.GetMetadata ("SubType"))) { Log.LogWarning ("Reference '{0}' has non-empty SubType. Ignoring.", item.ItemSpec); continue; } LogWithPrecedingNewLine (MessageImportance.Low, "Primary Reference {0}", item.ItemSpec); ResolvedReference resolved_ref = ResolveReference (item, searchPaths, true); if (resolved_ref == null) { Log.LogWarning ("Reference '{0}' not resolved", item.ItemSpec); assembly_resolver.LogSearchLoggerMessages (MessageImportance.Normal); } else { Log.LogMessage (MessageImportance.Low, "\tReference {0} resolved to {1}. CopyLocal = {2}", item.ItemSpec, resolved_ref.TaskItem, resolved_ref.TaskItem.GetMetadata ("CopyLocal")); Log.LogMessage (MessageImportance.Low, "\tReference found at search path {0}", resolved_ref.FoundInSearchPathAsString); assembly_resolver.LogSearchLoggerMessages (MessageImportance.Low); if (TryAddNewReference (tempResolvedFiles, resolved_ref) && !IsFromGacOrTargetFramework (resolved_ref) && resolved_ref.FoundInSearchPath != SearchPath.PkgConfig) { primaryReferences.Add (new PrimaryReference ( resolved_ref.TaskItem, resolved_ref.TaskItem.GetMetadata ("CopyLocal"))); } } } } // Use @search_paths to resolve the reference ResolvedReference ResolveReference (ITaskItem item, IEnumerable<string> search_paths, bool set_copy_local) { ResolvedReference resolved = null; bool specific_version; assembly_resolver.ResetSearchLogger (); if (!TryGetSpecificVersionValue (item, out specific_version)) return null; foreach (string spath in search_paths) { assembly_resolver.LogSearchMessage ("For searchpath {0}", spath); if (String.Compare (spath, "{HintPathFromItem}") == 0) { resolved = assembly_resolver.ResolveHintPathReference (item, specific_version); } else if (String.Compare (spath, "{TargetFrameworkDirectory}") == 0) { if (targetFrameworkDirectories == null) continue; foreach (string fpath in targetFrameworkDirectories) { resolved = assembly_resolver.FindInTargetFramework (item, fpath, specific_version); if (resolved != null) break; } } else if (String.Compare (spath, "{GAC}") == 0) { resolved = assembly_resolver.ResolveGacReference (item, specific_version); } else if (String.Compare (spath, "{RawFileName}") == 0) { //FIXME: identify assembly names, as extract the name, and try with that? AssemblyName aname; if (assembly_resolver.TryGetAssemblyNameFromFile (item.ItemSpec, out aname)) resolved = assembly_resolver.GetResolvedReference (item, item.ItemSpec, aname, true, SearchPath.RawFileName); } else if (String.Compare (spath, "{CandidateAssemblyFiles}") == 0) { assembly_resolver.LogSearchMessage ( "Warning: {{CandidateAssemblyFiles}} not supported currently"); } else if (String.Compare (spath, "{PkgConfig}") == 0) { resolved = assembly_resolver.ResolvePkgConfigReference (item, specific_version); } else { resolved = assembly_resolver.FindInDirectory ( item, spath, allowedAssemblyExtensions ?? default_assembly_extensions, specific_version); } if (resolved != null) break; } if (resolved != null && set_copy_local) SetCopyLocal (resolved.TaskItem, resolved.CopyLocal.ToString ()); return resolved; } bool TryGetSpecificVersionValue (ITaskItem item, out bool specific_version) { specific_version = true; string value = item.GetMetadata ("SpecificVersion"); if (String.IsNullOrEmpty (value)) { //AssemblyName name = new AssemblyName (item.ItemSpec); // If SpecificVersion is not specified, then // it is true if the Include is a strong name else false //specific_version = assembly_resolver.IsStrongNamed (name); // msbuild seems to just look for a ',' in the name :/ specific_version = item.ItemSpec.IndexOf (',') >= 0; return true; } if (Boolean.TryParse (value, out specific_version)) return true; Log.LogError ("Item '{0}' has attribute SpecificVersion with invalid value '{1}' " + "which could not be converted to a boolean.", item.ItemSpec, value); return false; } //FIXME: Consider CandidateAssemblyFiles also here void ResolveAssemblyFiles () { if (assemblyFiles == null) return; foreach (ITaskItem item in assemblyFiles) { assembly_resolver.ResetSearchLogger (); if (!File.Exists (item.ItemSpec)) { LogWithPrecedingNewLine (MessageImportance.Low, "Primary Reference from AssemblyFiles {0}, file not found. Ignoring", item.ItemSpec); continue; } LogWithPrecedingNewLine (MessageImportance.Low, "Primary Reference from AssemblyFiles {0}", item.ItemSpec); string copy_local; AssemblyName aname; if (!assembly_resolver.TryGetAssemblyNameFromFile (item.ItemSpec, out aname)) { Log.LogWarning ("Reference '{0}' not resolved", item.ItemSpec); assembly_resolver.LogSearchLoggerMessages (MessageImportance.Normal); continue; } assembly_resolver.LogSearchLoggerMessages (MessageImportance.Low); ResolvedReference rr = assembly_resolver.GetResolvedReference (item, item.ItemSpec, aname, true, SearchPath.RawFileName); copy_local = rr.CopyLocal.ToString (); if (!TryAddNewReference (tempResolvedFiles, rr)) // already resolved continue; SetCopyLocal (rr.TaskItem, copy_local); FindAndAddRelatedFiles (item.ItemSpec, copy_local); FindAndAddSatellites (item.ItemSpec, copy_local); if (FindDependencies && !IsFromGacOrTargetFramework (rr) && rr.FoundInSearchPath != SearchPath.PkgConfig) primaryReferences.Add (new PrimaryReference (item, copy_local)); } } // Tries to resolve assemblies referenced by @item // Skips gac references // @item : filename void ResolveAssemblyFileDependencies (ITaskItem item, string parent_copy_local) { Queue<string> dependencies = new Queue<string> (); dependencies.Enqueue (item.ItemSpec); while (dependencies.Count > 0) { string filename = Path.GetFullPath (dependencies.Dequeue ()); Assembly asm = Assembly.ReflectionOnlyLoadFrom (filename); if (alreadyScannedAssemblyNames.ContainsKey (asm.FullName)) continue; // set the 1st search path to this ref's base path // Will be used for resolving the dependencies dependency_search_paths [0] = Path.GetDirectoryName (filename); foreach (AssemblyName aname in asm.GetReferencedAssemblies ()) { if (alreadyScannedAssemblyNames.ContainsKey (aname.FullName)) continue; ResolvedReference resolved_ref = ResolveDependencyByAssemblyName ( aname, asm.FullName, parent_copy_local); if (IncludeDependencies (resolved_ref, aname.FullName)) { tempResolvedDepFiles[resolved_ref.AssemblyName.FullName] = resolved_ref.TaskItem; dependencies.Enqueue (resolved_ref.TaskItem.ItemSpec); } } alreadyScannedAssemblyNames.Add (asm.FullName, String.Empty); } } // Resolves by looking dependency_search_paths // which is dir of parent reference file, and // SearchPaths ResolvedReference ResolveDependencyByAssemblyName (AssemblyName aname, string parent_asm_name, string parent_copy_local) { // This will check for compatible assembly name/version ResolvedReference resolved_ref; if (TryGetResolvedReferenceByAssemblyName (aname, false, out resolved_ref)) return resolved_ref; LogWithPrecedingNewLine (MessageImportance.Low, "Dependency {0}", aname); Log.LogMessage (MessageImportance.Low, "\tRequired by {0}", parent_asm_name); ITaskItem item = new TaskItem (aname.FullName); item.SetMetadata ("SpecificVersion", "false"); resolved_ref = ResolveReference (item, dependency_search_paths, false); if (resolved_ref != null) { Log.LogMessage (MessageImportance.Low, "\tReference {0} resolved to {1}.", aname, resolved_ref.TaskItem.ItemSpec); Log.LogMessage (MessageImportance.Low, "\tReference found at search path {0}", resolved_ref.FoundInSearchPathAsString); assembly_resolver.LogSearchLoggerMessages (MessageImportance.Low); if (resolved_ref.FoundInSearchPath == SearchPath.Directory) { // override CopyLocal with parent's val SetCopyLocal (resolved_ref.TaskItem, parent_copy_local); Log.LogMessage (MessageImportance.Low, "\tThis is CopyLocal {0} as parent item has this value", parent_copy_local); if (TryAddNewReference (tempResolvedFiles, resolved_ref)) { FindAndAddRelatedFiles (resolved_ref.TaskItem.ItemSpec, parent_copy_local); FindAndAddSatellites (resolved_ref.TaskItem.ItemSpec, parent_copy_local); } } else { //gac or tgtfmwk Log.LogMessage (MessageImportance.Low, "\tThis is CopyLocal false as it is in the GAC," + "target framework directory or provided by a package."); TryAddNewReference (tempResolvedFiles, resolved_ref); } } else { Log.LogMessage (MessageImportance.Low, "Could not resolve the assembly \"{0}\".", aname); assembly_resolver.LogSearchLoggerMessages (MessageImportance.Low); } return resolved_ref; } void FindAndAddRelatedFiles (string filename, string parent_copy_local) { if (!findRelatedFiles || allowedRelatedFileExtensions == null) return; foreach (string ext in allowedRelatedFileExtensions) { string rfile = Path.ChangeExtension (filename, ext); if (File.Exists (rfile)) { ITaskItem item = new TaskItem (rfile); SetCopyLocal (item, parent_copy_local); tempRelatedFiles.AddUniqueFile (item); } } } void FindAndAddSatellites (string filename, string parent_copy_local) { if (!FindSatellites) return; string basepath = Path.GetDirectoryName (filename); string resource = String.Format ("{0}{1}{2}", Path.GetFileNameWithoutExtension (filename), ".resources", Path.GetExtension (filename)); string dir_sep = Path.DirectorySeparatorChar.ToString (); foreach (string dir in Directory.GetDirectories (basepath)) { string culture = Path.GetFileName (dir); if (!CultureNamesTable.ContainsKey (culture)) continue; string res_path = Path.Combine (dir, resource); if (File.Exists (res_path)) { ITaskItem item = new TaskItem (res_path); SetCopyLocal (item, parent_copy_local); item.SetMetadata ("DestinationSubdirectory", culture + dir_sep); tempSatelliteFiles.AddUniqueFile (item); } } } // returns true is it was new bool TryAddNewReference (List<ITaskItem> file_list, ResolvedReference key_ref) { ResolvedReference found_ref; if (!TryGetResolvedReferenceByAssemblyName (key_ref.AssemblyName, key_ref.IsPrimary, out found_ref)) { assemblyNameToResolvedRef [key_ref.AssemblyName.Name] = key_ref; file_list.Add (key_ref.TaskItem); return true; } return false; } void SetCopyLocal (ITaskItem item, string copy_local) { item.SetMetadata ("CopyLocal", copy_local); // Assumed to be valid value if (Boolean.Parse (copy_local)) tempCopyLocalFiles.AddUniqueFile (item); } bool TryGetResolvedReferenceByAssemblyName (AssemblyName key_aname, bool is_primary, out ResolvedReference found_ref) { found_ref = null; // Match by just name if (!assemblyNameToResolvedRef.TryGetValue (key_aname.Name, out found_ref)) // not there return false; // match for full name if (AssemblyResolver.AssemblyNamesCompatible (key_aname, found_ref.AssemblyName, true, false)) // exact match, so its already there, dont add anything return true; // we have a name match, but version mismatch! assembly_resolver.LogSearchMessage ("A conflict was detected between '{0}' and '{1}'", key_aname.FullName, found_ref.AssemblyName.FullName); if (is_primary == found_ref.IsPrimary) { assembly_resolver.LogSearchMessage ("Unable to choose between the two. " + "Choosing '{0}' arbitrarily.", found_ref.AssemblyName.FullName); return true; } // since all dependencies are processed after // all primary refererences, the one in the cache // has to be a primary // Prefer a primary reference over a dependency assembly_resolver.LogSearchMessage ("Choosing '{0}' as it is a primary reference.", found_ref.AssemblyName.FullName); // If we can successfully use the primary reference, don't log a warning. It's too // verbose. //LogConflictWarning (found_ref.AssemblyName.FullName, key_aname.FullName); return true; } void LogWithPrecedingNewLine (MessageImportance importance, string format, params object [] args) { Log.LogMessage (importance, String.Empty); Log.LogMessage (importance, format, args); } // conflict b/w @main and @conflicting, picking @main void LogConflictWarning (string main, string conflicting) { string key = main + ":" + conflicting; if (!conflictWarningsCache.ContainsKey (key)) { Log.LogWarning ("Found a conflict between : '{0}' and '{1}'. Using '{0}' reference.", main, conflicting); conflictWarningsCache [key] = key; } } bool IsFromGacOrTargetFramework (ResolvedReference rr) { return rr.FoundInSearchPath == SearchPath.Gac || rr.FoundInSearchPath == SearchPath.TargetFrameworkDirectory; } bool IncludeDependencies (ResolvedReference rr, string aname) { if (rr == null) return false; if (aname.Equals ("System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")) return true; return !IsFromGacOrTargetFramework (rr) && rr.FoundInSearchPath != SearchPath.PkgConfig; } void LogTaskParameters () { Log.LogMessage (MessageImportance.Low, "TargetFrameworkDirectories:"); if (TargetFrameworkDirectories != null) foreach (string dir in TargetFrameworkDirectories) Log.LogMessage (MessageImportance.Low, "\t{0}", dir); Log.LogMessage (MessageImportance.Low, "SearchPaths:"); if (SearchPaths != null) foreach (string path in SearchPaths) Log.LogMessage (MessageImportance.Low, "\t{0}", path); } public bool AutoUnify { get { return autoUnify; } set { autoUnify = value; } } public ITaskItem[] AssemblyFiles { get { return assemblyFiles; } set { assemblyFiles = value; } } public ITaskItem[] Assemblies { get { return assemblies; } set { assemblies = value; } } public string AppConfigFile { get { return appConfigFile; } set { appConfigFile = value; } } public string[] AllowedAssemblyExtensions { get { return allowedAssemblyExtensions; } set { allowedAssemblyExtensions = value; } } public string[] AllowedRelatedFileExtensions { get { return allowedRelatedFileExtensions; } set { allowedRelatedFileExtensions = value; } } public string[] CandidateAssemblyFiles { get { return candidateAssemblyFiles; } set { candidateAssemblyFiles = value; } } [Output] public ITaskItem[] CopyLocalFiles { get { return copyLocalFiles; } } [Output] public ITaskItem[] FilesWritten { get { return filesWritten; } set { filesWritten = value; } } public bool FindDependencies { get { return findDependencies; } set { findDependencies = value; } } public bool FindRelatedFiles { get { return findRelatedFiles; } set { findRelatedFiles = value; } } public bool FindSatellites { get { return findSatellites; } set { findSatellites = value; } } public bool FindSerializationAssemblies { get { return findSerializationAssemblies; } set { findSerializationAssemblies = value; } } public string[] InstalledAssemblyTables { get { return installedAssemblyTables; } set { installedAssemblyTables = value; } } [Output] public ITaskItem[] RelatedFiles { get { return relatedFiles; } } [Output] public ITaskItem[] ResolvedDependencyFiles { get { return resolvedDependencyFiles; } } [Output] public ITaskItem[] ResolvedFiles { get { return resolvedFiles; } } [Output] public ITaskItem[] SatelliteFiles { get { return satelliteFiles; } } [Output] public ITaskItem[] ScatterFiles { get { return scatterFiles; } } [Required] public string[] SearchPaths { get { return searchPaths; } set { searchPaths = value; } } [Output] public ITaskItem[] SerializationAssemblyFiles { get { return serializationAssemblyFiles; } } public bool Silent { get { return silent; } set { silent = value; } } public string StateFile { get { return stateFile; } set { stateFile = value; } } [Output] public ITaskItem[] SuggestedRedirects { get { return suggestedRedirects; } } #if NET_4_0 public string TargetFrameworkMoniker { get; set; } public string TargetFrameworkMonikerDisplayName { get; set; } #endif public string TargetFrameworkVersion { get; set; } public string[] TargetFrameworkDirectories { get { return targetFrameworkDirectories; } set { targetFrameworkDirectories = value; } } public string TargetProcessorArchitecture { get { return targetProcessorArchitecture; } set { targetProcessorArchitecture = value; } } static Dictionary<string, string> cultureNamesTable; static Dictionary<string, string> CultureNamesTable { get { if (cultureNamesTable == null) { cultureNamesTable = new Dictionary<string, string> (); foreach (CultureInfo ci in CultureInfo.GetCultures (CultureTypes.AllCultures)) cultureNamesTable [ci.Name] = ci.Name; } return cultureNamesTable; } } } static class ResolveAssemblyReferenceHelper { public static void AddUniqueFile (this Dictionary<string, ITaskItem> dic, ITaskItem item) { if (dic == null) throw new ArgumentNullException ("dic"); if (item == null) throw new ArgumentNullException ("item"); string fullpath = Path.GetFullPath (item.ItemSpec); if (!dic.ContainsKey (fullpath)) dic [fullpath] = item; } } struct PrimaryReference { public ITaskItem TaskItem; public string ParentCopyLocal; public PrimaryReference (ITaskItem item, string parent_copy_local) { TaskItem = item; ParentCopyLocal = parent_copy_local; } } }
32.688615
119
0.709736
[ "Apache-2.0" ]
3-1415926/mono
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs
23,830
C#
using Sokoban.Model; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; namespace Sokoban { public class Parser { private Maze _maze; private int _level; public Parser(int level) { _level = level; } public Maze ReadFile() { _maze = new Maze(); String LevelPath = @"Doolhof\doolhof" + _level + ".txt"; String[] readString = System.IO.File.ReadAllLines(LevelPath); int width = 0; int height = readString.Length; for(int i = 0; i < height; i++) // Pak de langste lengte die een lijn in het tekstbestand heeft { if(readString[i].Length > width) { width = readString[i].Length; } } NonMoveableGameObject[,] levelArray = new NonMoveableGameObject[width, height]; for(int y = 0; y < height; y++) // Full Multidimensional Array { for(int x = 0; x < width; x++) { try { NonMoveableGameObject tempObject = null; switch (readString[y].ElementAt(x)) { case '.': tempObject = new Floor(); break; case '#': tempObject = new Wall(); break; case 'o': tempObject = new Floor(); // Plaats crate hierin tempObject.Crate = new Crate(); break; case 'x': tempObject = new Destination(); break; case '@': tempObject = new Floor(); tempObject.Player = new Player(); break; default: tempObject = new Empty(); break; } levelArray[x, y] = tempObject; } catch { NonMoveableGameObject tempObject = new Empty(); levelArray[x, y] = tempObject; } } } _maze.InitMaze(levelArray, width, height); return _maze; } } }
32.86747
107
0.375733
[ "Apache-2.0" ]
StijnvH00/modl3_Sokoban
Sokoban/Sokoban/ViewModel/Parser.cs
2,730
C#
using FluentValidation; using SyncTrayzor.Properties; using System; namespace SyncTrayzor.Pages.Settings { public class SyncthingAddressValidator : AbstractValidator<SettingItem<string>> { public SyncthingAddressValidator() { RuleFor(x => x.Value).NotEmpty().WithMessage(Resources.SettingsView_Validation_NotShouldBeEmpty); RuleFor(x => x.Value).Must(str => { // URI seems to think https://http://something is valid... if (str.StartsWith("http:") || str.StartsWith("https:")) return false; str = "http://" + str; return Uri.TryCreate(str, UriKind.Absolute, out var uri) && uri.IsWellFormedOriginalString() && uri.PathAndQuery == "/" && uri.Fragment == ""; }).WithMessage(Resources.SettingsView_Validation_InvalidUrl); } } }
38.25
159
0.595861
[ "MIT" ]
Bararie/SyncTrayzor
src/SyncTrayzor/Pages/Settings/SyncthingAddressValidator.cs
897
C#
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. #nullable enable #pragma warning disable CS0618 // Type or member is obsolete using DocumentFormat.OpenXml; using DocumentFormat.OpenXml.Framework; using DocumentFormat.OpenXml.Framework.Metadata; using DocumentFormat.OpenXml.Packaging; using DocumentFormat.OpenXml.Validation.Schema; using DocumentFormat.OpenXml.Validation.Semantic; using DocumentFormat.OpenXml.VariantTypes; using System; using System.Collections.Generic; using System.IO.Packaging; namespace DocumentFormat.OpenXml.CustomProperties { /// <summary> /// <para>Custom File Properties.</para> /// <para>This class is available in Office 2007 and above.</para> /// <para>When the object is serialized out as xml, it's qualified name is op:Properties.</para> /// </summary> /// <remark> /// <para>The following table lists the possible child types:</para> /// <list type="bullet"> /// <item><description><see cref="DocumentFormat.OpenXml.CustomProperties.CustomDocumentProperty" /> <c>&lt;op:property></c></description></item> /// </list> /// </remark> [SchemaAttr("op:Properties")] public partial class Properties : OpenXmlPartRootElement { /// <summary> /// Initializes a new instance of the Properties class. /// </summary> public Properties() : base() { } /// <summary> /// Initializes a new instance of the Properties class with the specified child elements. /// </summary> /// <param name="childElements">Specifies the child elements.</param> public Properties(IEnumerable<OpenXmlElement> childElements) : base(childElements) { } /// <summary> /// Initializes a new instance of the Properties class with the specified child elements. /// </summary> /// <param name="childElements">Specifies the child elements.</param> public Properties(params OpenXmlElement[] childElements) : base(childElements) { } /// <summary> /// Initializes a new instance of the Properties class from outer XML. /// </summary> /// <param name="outerXml">Specifies the outer XML of the element.</param> public Properties(string outerXml) : base(outerXml) { } internal override void ConfigureMetadata(ElementMetadata.Builder builder) { base.ConfigureMetadata(builder); builder.SetSchema("op:Properties"); builder.AddChild<DocumentFormat.OpenXml.CustomProperties.CustomDocumentProperty>(); builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1) { new ElementParticle(typeof(DocumentFormat.OpenXml.CustomProperties.CustomDocumentProperty), 0, 0) }; } /// <inheritdoc/> public override OpenXmlElement CloneNode(bool deep) => CloneImp<Properties>(deep); internal Properties(CustomFilePropertiesPart ownerPart) : base(ownerPart) { } /// <summary> /// Loads the DOM from the CustomFilePropertiesPart /// </summary> /// <param name="openXmlPart">Specifies the part to be loaded.</param> public void Load(CustomFilePropertiesPart openXmlPart) { LoadFromPart(openXmlPart); } /// <summary> /// Saves the DOM into the CustomFilePropertiesPart. /// </summary> /// <param name="openXmlPart">Specifies the part to save to.</param> public void Save(CustomFilePropertiesPart openXmlPart) { base.SaveToPart(openXmlPart); } /// <summary> /// Gets the CustomFilePropertiesPart associated with this element. /// </summary> public CustomFilePropertiesPart? CustomFilePropertiesPart { get => OpenXmlPart as CustomFilePropertiesPart; internal set => OpenXmlPart = value; } } /// <summary> /// <para>Custom File Property.</para> /// <para>This class is available in Office 2007 and above.</para> /// <para>When the object is serialized out as xml, it's qualified name is op:property.</para> /// </summary> /// <remark> /// <para>The following table lists the possible child types:</para> /// <list type="bullet"> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTArray" /> <c>&lt;vt:array></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTClipboardData" /> <c>&lt;vt:cf></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTEmpty" /> <c>&lt;vt:empty></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTNull" /> <c>&lt;vt:null></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTVector" /> <c>&lt;vt:vector></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTVStreamData" /> <c>&lt;vt:vstream></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTClassId" /> <c>&lt;vt:clsid></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTCurrency" /> <c>&lt;vt:cy></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTError" /> <c>&lt;vt:error></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTBlob" /> <c>&lt;vt:blob></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTOBlob" /> <c>&lt;vt:oblob></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTStreamData" /> <c>&lt;vt:stream></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTOStreamData" /> <c>&lt;vt:ostream></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTStorage" /> <c>&lt;vt:storage></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTOStorage" /> <c>&lt;vt:ostorage></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTBool" /> <c>&lt;vt:bool></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTByte" /> <c>&lt;vt:i1></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTDate" /> <c>&lt;vt:date></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTFileTime" /> <c>&lt;vt:filetime></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTDecimal" /> <c>&lt;vt:decimal></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTDouble" /> <c>&lt;vt:r8></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTFloat" /> <c>&lt;vt:r4></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTInt32" /> <c>&lt;vt:i4></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTInteger" /> <c>&lt;vt:int></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTInt64" /> <c>&lt;vt:i8></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTShort" /> <c>&lt;vt:i2></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTLPSTR" /> <c>&lt;vt:lpstr></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTLPWSTR" /> <c>&lt;vt:lpwstr></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTBString" /> <c>&lt;vt:bstr></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTUnsignedByte" /> <c>&lt;vt:ui1></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTUnsignedInt32" /> <c>&lt;vt:ui4></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTUnsignedInteger" /> <c>&lt;vt:uint></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTUnsignedInt64" /> <c>&lt;vt:ui8></c></description></item> /// <item><description><see cref="DocumentFormat.OpenXml.VariantTypes.VTUnsignedShort" /> <c>&lt;vt:ui2></c></description></item> /// </list> /// </remark> [SchemaAttr("op:property")] public partial class CustomDocumentProperty : OpenXmlCompositeElement { /// <summary> /// Initializes a new instance of the CustomDocumentProperty class. /// </summary> public CustomDocumentProperty() : base() { } /// <summary> /// Initializes a new instance of the CustomDocumentProperty class with the specified child elements. /// </summary> /// <param name="childElements">Specifies the child elements.</param> public CustomDocumentProperty(IEnumerable<OpenXmlElement> childElements) : base(childElements) { } /// <summary> /// Initializes a new instance of the CustomDocumentProperty class with the specified child elements. /// </summary> /// <param name="childElements">Specifies the child elements.</param> public CustomDocumentProperty(params OpenXmlElement[] childElements) : base(childElements) { } /// <summary> /// Initializes a new instance of the CustomDocumentProperty class from outer XML. /// </summary> /// <param name="outerXml">Specifies the outer XML of the element.</param> public CustomDocumentProperty(string outerXml) : base(outerXml) { } /// <summary> /// <para>Format ID</para> /// <para>Represents the following attribute in the schema: fmtid</para> /// </summary> [SchemaAttr("fmtid")] public StringValue? FormatId { get => GetAttribute<StringValue>(); set => SetAttribute(value); } /// <summary> /// <para>Property ID</para> /// <para>Represents the following attribute in the schema: pid</para> /// </summary> [SchemaAttr("pid")] public Int32Value? PropertyId { get => GetAttribute<Int32Value>(); set => SetAttribute(value); } /// <summary> /// <para>Custom File Property Name</para> /// <para>Represents the following attribute in the schema: name</para> /// </summary> [SchemaAttr("name")] public StringValue? Name { get => GetAttribute<StringValue>(); set => SetAttribute(value); } /// <summary> /// <para>Bookmark Link Target</para> /// <para>Represents the following attribute in the schema: linkTarget</para> /// </summary> [SchemaAttr("linkTarget")] public StringValue? LinkTarget { get => GetAttribute<StringValue>(); set => SetAttribute(value); } internal override void ConfigureMetadata(ElementMetadata.Builder builder) { base.ConfigureMetadata(builder); builder.SetSchema("op:property"); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTArray>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTClipboardData>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTEmpty>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTNull>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTVector>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTVStreamData>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTClassId>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTCurrency>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTError>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTBlob>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTOBlob>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTStreamData>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTOStreamData>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTStorage>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTOStorage>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTBool>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTByte>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTDate>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTFileTime>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTDecimal>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTDouble>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTFloat>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTInt32>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTInteger>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTInt64>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTShort>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTLPSTR>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTLPWSTR>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTBString>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTUnsignedByte>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTUnsignedInt32>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTUnsignedInteger>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTUnsignedInt64>(); builder.AddChild<DocumentFormat.OpenXml.VariantTypes.VTUnsignedShort>(); builder.AddElement<CustomDocumentProperty>() .AddAttribute("fmtid", a => a.FormatId, aBuilder => { aBuilder.AddValidator(RequiredValidator.Instance); aBuilder.AddValidator(new StringValidator() { Pattern = ("\\s*\\{[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\\}\\s*") }); }) .AddAttribute("pid", a => a.PropertyId, aBuilder => { aBuilder.AddValidator(RequiredValidator.Instance); }) .AddAttribute("name", a => a.Name) .AddAttribute("linkTarget", a => a.LinkTarget); builder.Particle = new CompositeParticle.Builder(ParticleType.Choice, 1, 1) { new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTVector), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTArray), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTBlob), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTOBlob), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTEmpty), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTNull), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTByte), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTShort), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTInt32), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTInt64), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTInteger), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTUnsignedByte), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTUnsignedShort), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTUnsignedInt32), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTUnsignedInt64), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTUnsignedInteger), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTFloat), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTDouble), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTDecimal), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTLPSTR), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTLPWSTR), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTBString), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTDate), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTFileTime), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTBool), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTCurrency), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTError), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTStreamData), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTOStreamData), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTStorage), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTOStorage), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTVStreamData), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTClassId), 1, 1), new ElementParticle(typeof(DocumentFormat.OpenXml.VariantTypes.VTClipboardData), 1, 1) }; builder.AddConstraint(new AttributeValueRangeConstraint("op:pid", true, 2, true, double.PositiveInfinity, true)); builder.AddConstraint(new UniqueAttributeValueConstraint("op:name", false, null)); } /// <summary> /// <para>Vector.</para> /// <para>Represents the following element tag in the schema: vt:vector.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTVector? VTVector { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTVector>(); set => SetElement(value); } /// <summary> /// <para>Array.</para> /// <para>Represents the following element tag in the schema: vt:array.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTArray? VTArray { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTArray>(); set => SetElement(value); } /// <summary> /// <para>Binary Blob.</para> /// <para>Represents the following element tag in the schema: vt:blob.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTBlob? VTBlob { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTBlob>(); set => SetElement(value); } /// <summary> /// <para>Binary Blob Object.</para> /// <para>Represents the following element tag in the schema: vt:oblob.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTOBlob? VTOBlob { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTOBlob>(); set => SetElement(value); } /// <summary> /// <para>Empty.</para> /// <para>Represents the following element tag in the schema: vt:empty.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTEmpty? VTEmpty { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTEmpty>(); set => SetElement(value); } /// <summary> /// <para>Null.</para> /// <para>Represents the following element tag in the schema: vt:null.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTNull? VTNull { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTNull>(); set => SetElement(value); } /// <summary> /// <para>1-Byte Signed Integer.</para> /// <para>Represents the following element tag in the schema: vt:i1.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTByte? VTByte { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTByte>(); set => SetElement(value); } /// <summary> /// <para>2-Byte Signed Integer.</para> /// <para>Represents the following element tag in the schema: vt:i2.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTShort? VTShort { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTShort>(); set => SetElement(value); } /// <summary> /// <para>4-Byte Signed Integer.</para> /// <para>Represents the following element tag in the schema: vt:i4.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTInt32? VTInt32 { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTInt32>(); set => SetElement(value); } /// <summary> /// <para>8-Byte Signed Integer.</para> /// <para>Represents the following element tag in the schema: vt:i8.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTInt64? VTInt64 { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTInt64>(); set => SetElement(value); } /// <summary> /// <para>Integer.</para> /// <para>Represents the following element tag in the schema: vt:int.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTInteger? VTInteger { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTInteger>(); set => SetElement(value); } /// <summary> /// <para>1-Byte Unsigned Integer.</para> /// <para>Represents the following element tag in the schema: vt:ui1.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTUnsignedByte? VTUnsignedByte { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTUnsignedByte>(); set => SetElement(value); } /// <summary> /// <para>2-Byte Unsigned Integer.</para> /// <para>Represents the following element tag in the schema: vt:ui2.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTUnsignedShort? VTUnsignedShort { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTUnsignedShort>(); set => SetElement(value); } /// <summary> /// <para>4-Byte Unsigned Integer.</para> /// <para>Represents the following element tag in the schema: vt:ui4.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTUnsignedInt32? VTUnsignedInt32 { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTUnsignedInt32>(); set => SetElement(value); } /// <summary> /// <para>8-Byte Unsigned Integer.</para> /// <para>Represents the following element tag in the schema: vt:ui8.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTUnsignedInt64? VTUnsignedInt64 { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTUnsignedInt64>(); set => SetElement(value); } /// <summary> /// <para>Unsigned Integer.</para> /// <para>Represents the following element tag in the schema: vt:uint.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTUnsignedInteger? VTUnsignedInteger { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTUnsignedInteger>(); set => SetElement(value); } /// <summary> /// <para>4-Byte Real Number.</para> /// <para>Represents the following element tag in the schema: vt:r4.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTFloat? VTFloat { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTFloat>(); set => SetElement(value); } /// <summary> /// <para>8-Byte Real Number.</para> /// <para>Represents the following element tag in the schema: vt:r8.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTDouble? VTDouble { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTDouble>(); set => SetElement(value); } /// <summary> /// <para>Decimal.</para> /// <para>Represents the following element tag in the schema: vt:decimal.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTDecimal? VTDecimal { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTDecimal>(); set => SetElement(value); } /// <summary> /// <para>LPSTR.</para> /// <para>Represents the following element tag in the schema: vt:lpstr.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTLPSTR? VTLPSTR { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTLPSTR>(); set => SetElement(value); } /// <summary> /// <para>LPWSTR.</para> /// <para>Represents the following element tag in the schema: vt:lpwstr.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTLPWSTR? VTLPWSTR { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTLPWSTR>(); set => SetElement(value); } /// <summary> /// <para>Basic String.</para> /// <para>Represents the following element tag in the schema: vt:bstr.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTBString? VTBString { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTBString>(); set => SetElement(value); } /// <summary> /// <para>Date and Time.</para> /// <para>Represents the following element tag in the schema: vt:date.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTDate? VTDate { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTDate>(); set => SetElement(value); } /// <summary> /// <para>File Time.</para> /// <para>Represents the following element tag in the schema: vt:filetime.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTFileTime? VTFileTime { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTFileTime>(); set => SetElement(value); } /// <summary> /// <para>Boolean.</para> /// <para>Represents the following element tag in the schema: vt:bool.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTBool? VTBool { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTBool>(); set => SetElement(value); } /// <summary> /// <para>Currency.</para> /// <para>Represents the following element tag in the schema: vt:cy.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTCurrency? VTCurrency { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTCurrency>(); set => SetElement(value); } /// <summary> /// <para>Error Status Code.</para> /// <para>Represents the following element tag in the schema: vt:error.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTError? VTError { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTError>(); set => SetElement(value); } /// <summary> /// <para>Binary Stream.</para> /// <para>Represents the following element tag in the schema: vt:stream.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTStreamData? VTStreamData { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTStreamData>(); set => SetElement(value); } /// <summary> /// <para>Binary Stream Object.</para> /// <para>Represents the following element tag in the schema: vt:ostream.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTOStreamData? VTOStreamData { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTOStreamData>(); set => SetElement(value); } /// <summary> /// <para>Binary Storage.</para> /// <para>Represents the following element tag in the schema: vt:storage.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTStorage? VTStorage { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTStorage>(); set => SetElement(value); } /// <summary> /// <para>Binary Storage Object.</para> /// <para>Represents the following element tag in the schema: vt:ostorage.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTOStorage? VTOStorage { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTOStorage>(); set => SetElement(value); } /// <summary> /// <para>Binary Versioned Stream.</para> /// <para>Represents the following element tag in the schema: vt:vstream.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTVStreamData? VTVStreamData { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTVStreamData>(); set => SetElement(value); } /// <summary> /// <para>Class ID.</para> /// <para>Represents the following element tag in the schema: vt:clsid.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTClassId? VTClassId { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTClassId>(); set => SetElement(value); } /// <summary> /// <para>Clipboard Data.</para> /// <para>Represents the following element tag in the schema: vt:cf.</para> /// </summary> /// <remark> /// xmlns:vt = http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes /// </remark> public DocumentFormat.OpenXml.VariantTypes.VTClipboardData? VTClipboardData { get => GetElement<DocumentFormat.OpenXml.VariantTypes.VTClipboardData>(); set => SetElement(value); } /// <inheritdoc/> public override OpenXmlElement CloneNode(bool deep) => CloneImp<CustomDocumentProperty>(deep); } }
47.787013
173
0.620394
[ "MIT" ]
929496959/Open-XML-SDK
src/DocumentFormat.OpenXml/GeneratedCode/schemas_openxmlformats_org_officeDocument_2006_custom-properties.g.cs
36,798
C#
// Copyright 2019 谭杰鹏. All Rights Reserved //https://github.com/JiepengTan using System; using Lockstep.Math; namespace Lockstep.PathFinding { public class Plane { private static long serialVersionUID = -1240652082930747866L; public LVector3 normal = new LVector3(); // 单位长度 public LFloat d = LFloat.zero; // 距离 public Plane(){ } public Plane(LVector3 normal, LFloat d){ this.normal.set(normal).nor(); this.d = d; } public Plane(LVector3 normal, LVector3 point){ this.normal.set(normal).nor(); this.d = -this.normal.dot(point); } public Plane(LVector3 point1, LVector3 point2, LVector3 point3){ set(point1, point2, point3); } public void set(LVector3 point1, LVector3 point2, LVector3 point3){ normal = (point1).sub(point2).cross(point2.x - point3.x, point2.y - point3.y, point2.z - point3.z).nor(); d = -point1.dot(normal); } public LFloat distance(LVector3 point){ return normal.dot(point) + d; } public PlaneSide testPoint(LVector3 point){ LFloat dist = normal.dot(point) + d; if (dist == 0) return PlaneSide.OnPlane; else if (dist < 0) return PlaneSide.Back; else return PlaneSide.Front; } public PlaneSide testPoint(LFloat x, LFloat y, LFloat z){ LFloat dist = normal.dot(x, y, z) + d; if (dist == 0) return PlaneSide.OnPlane; else if (dist < 0) return PlaneSide.Back; else return PlaneSide.Front; } public bool isFrontFacing(LVector3 direction){ LFloat dot = normal.dot(direction); return dot <= 0; } /** @return The normal */ public LVector3 getNormal(){ return normal; } /** @return The distance to the origin */ public LFloat getD(){ return d; } public void set(LVector3 point, LVector3 normal){ this.normal.set(normal); d = -point.dot(normal); } public void set(LFloat pointX, LFloat pointY, LFloat pointZ, LFloat norX, LFloat norY, LFloat norZ){ this.normal.set(norX, norY, norZ); d = -(pointX * norX + pointY * norY + pointZ * norZ); } public void set(Plane plane){ this.normal.set(plane.normal); this.d = plane.d; } public override String ToString(){ return normal.ToString() + ", " + d; } } }
27.33
117
0.532748
[ "MIT" ]
XingHong/SimpleLockStepClient
Assets/Engine.LockstepEngine/Src/PathFinding/NavMesh/Geometry/Plane.cs
2,751
C#
 // Write a program to convert decimal numbers to their binary representation. using System; class DecimalToBinary { /// <summary> /// Check if the input data is valid /// </summary> /// <param name="numberString">String entered from the user</param> /// <returns>Valid integer</returns> static int CheckInput(string numberString) { int number; while (!int.TryParse(numberString, out number)) { Console.Write("Enter valid integer: "); numberString = Console.ReadLine(); } return number; } /// <summary> /// Converts decimal number to binary /// </summary> /// <param name="decimalNumber">Number to be converted</param> /// <returns>Returns the binary represenation as string to avoid Overflow Exception</returns> static string ConvertToBinary(int decimalNumber) { bool positive = true; if (decimalNumber < 0) { decimalNumber = Math.Abs(decimalNumber); positive = false; } string binaryNumber = string.Empty; int remainder; while (decimalNumber != 0) { remainder = decimalNumber % 2; binaryNumber = binaryNumber + remainder.ToString(); decimalNumber /= 2; } // Adding leading zeroes. while (binaryNumber.Length % 4 != 0) { binaryNumber += "0"; } // Convert the string into char array so it is easy to reverse it. char[] binaryArray = binaryNumber.ToCharArray(); Array.Reverse(binaryArray); // Check if the entered number is 0. if (binaryNumber == string.Empty) { return "0"; } binaryNumber = string.Empty; // Add leading spaces for easier reading. for (int i = 0; i < binaryArray.GetLongLength(0); i++) { if (i % 4 == 0 && i != 0) { binaryNumber += " "; } binaryNumber += binaryArray[i].ToString(); } // Check if the number is negative to add -. I know this isn't the best solution but I couldn't think of better one. if (!positive) { binaryArray = binaryNumber.ToCharArray(); Array.Reverse(binaryArray); binaryNumber = new string(binaryArray); binaryNumber += "-"; binaryArray = binaryNumber.ToCharArray(); Array.Reverse(binaryArray); binaryNumber = new string(binaryArray); } return binaryNumber; } static void Main() { Console.Title = "Convert from decimal to binary"; Console.Write("Enter decimal number: "); string decimalNumberString = Console.ReadLine(); int decimalNumber = CheckInput(decimalNumberString); string binaryNumber = ConvertToBinary(decimalNumber); Console.WriteLine("{0} d = {1} b", decimalNumber, binaryNumber); } }
28.196262
124
0.567783
[ "MIT" ]
PetarMetodiev/Telerik-Homeworks
C# Part 2/04.Numeral_Systems/NumeralSystems/01.DecimalToBinary/DecimalToBinary.cs
3,019
C#
namespace GameMath.Tests.Intersections { using NUnit.Framework; public class RectangleIntersectionTests { #region Public Methods and Operators [Test] public void TestNotRectangleIntersectsCircle() { // ARRANGE. var rectangle = new RectangleF(new Vector2F(0.0f, 0.0f), new Vector2F(1.0f, 1.0f)); var circle = new CircleF(new Vector2F(2.0f, 2.0f), 0.5f); // ASSERT. Assert.IsFalse(rectangle.Intersects(circle)); } [Test] public void TestNotRectangleIntersectsRectangle() { // ARRANGE. var first = new RectangleF(new Vector2F(0.0f, 0.0f), new Vector2F(1.0f, 1.0f)); var second = new RectangleF(new Vector2F(2.0f, 0.0f), new Vector2F(1.0f, 1.0f)); // ASSERT. Assert.IsFalse(first.Intersects(second)); } [Test] public void TestRectangleIntersectsCircle() { // ARRANGE. var rectangle = new RectangleF(new Vector2F(0.0f, 0.0f), new Vector2F(1.0f, 1.0f)); var circle = new CircleF(new Vector2F(1.0f, 1.0f), 0.5f); // ASSERT. Assert.IsTrue(rectangle.Intersects(circle)); } [Test] public void TestRectangleIntersectsRectangle() { // ARRANGE. var first = new RectangleF(new Vector2F(0.0f, 0.0f), new Vector2F(2.0f, 2.0f)); var second = new RectangleF(new Vector2F(1.0f, 1.0f), new Vector2F(2.0f, 2.0f)); // ASSERT. Assert.IsTrue(first.Intersects(second)); } #endregion } }
30.4
95
0.554426
[ "MIT" ]
npruehs/game-math
Source/GameMath.Tests/Intersections/RectangleIntersectionTests.cs
1,674
C#
namespace Lykke.OneSky.Json { public interface IProjectType { string Code { get; } string Name { get; } } }
15.222222
33
0.562044
[ "MIT" ]
LykkeCity/Lykke.OneSky
OneSky.CSharp/OneSky.CSharp/Json/Objects/IProjectType.cs
139
C#
#if !NETSTANDARD13 /* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the swf-2012-01-25.normal.json service model. */ using Amazon.Runtime; namespace Amazon.SimpleWorkflow.Model { /// <summary> /// Paginator for the ListClosedWorkflowExecutions operation ///</summary> public interface IListClosedWorkflowExecutionsPaginator { /// <summary> /// Enumerable containing all full responses for the operation /// </summary> IPaginatedEnumerable<ListClosedWorkflowExecutionsResponse> Responses { get; } /// <summary> /// Enumerable containing all of the ExecutionInfos /// </summary> IPaginatedEnumerable<WorkflowExecutionInfo> ExecutionInfos { get; } } } #endif
34.35
102
0.681951
[ "Apache-2.0" ]
philasmar/aws-sdk-net
sdk/src/Services/SimpleWorkflow/Generated/Model/_bcl45+netstandard/IListClosedWorkflowExecutionsPaginator.cs
1,374
C#
using System; using System.Threading.Tasks; using EasyNetQ; using GISA.Core.Communication; using GISA.Core.DomainObjects; using Polly; using RabbitMQ.Client.Exceptions; namespace GISA.MessageBus { public class MessageBus : IMessageBus { private IBus _bus; private IAdvancedBus _advancedBus; private readonly string _connectionString; public MessageBus(string connectionString) { _connectionString = connectionString; TryConnect(); } public bool IsConnected => _bus?.IsConnected ?? false; public IAdvancedBus AdvancedBus => _bus?.Advanced; public void Publish<T>(T message) where T : Entity, IAggregateRoot { TryConnect(); _bus.Publish(message); } public async Task PublishAsync<T>(T message) where T : Entity, IAggregateRoot { TryConnect(); await _bus.PublishAsync(message); } public void Subscribe<T>(string subscriptionId, Action<T> onMessage) where T : class { TryConnect(); _bus.Subscribe(subscriptionId, onMessage); } public void SubscribeAsync<T>(string subscriptionId, Func<T, Task> onMessage) where T : class { TryConnect(); _bus.SubscribeAsync(subscriptionId, onMessage); } public TResponse Request<TRequest, TResponse>(TRequest request) where TRequest : Entity where TResponse : ResponseResult { TryConnect(); return _bus.Request<TRequest, TResponse>(request); } public async Task<TResponse> RequestAsync<TRequest, TResponse>(TRequest request) where TRequest : Entity where TResponse : ResponseResult { TryConnect(); return await _bus.RequestAsync<TRequest, TResponse>(request); } public IDisposable Respond<TRequest, TResponse>(Func<TRequest, TResponse> responder) where TRequest : Entity where TResponse : ResponseResult { TryConnect(); return _bus.Respond(responder); } public IDisposable RespondAsync<TRequest, TResponse>(Func<TRequest, Task<TResponse>> responder) where TRequest : Entity where TResponse : ResponseResult { TryConnect(); return _bus.RespondAsync(responder); } private void TryConnect() { if (IsConnected) { return; } var policy = Policy.Handle<EasyNetQException>() .Or<BrokerUnreachableException>() .WaitAndRetry(3, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))); policy.Execute(() => { _bus = RabbitHutch.CreateBus(_connectionString); _advancedBus = _bus.Advanced; _advancedBus.Disconnected += OnDisconnect; }); } private void OnDisconnect(object s, EventArgs e) { var policy = Policy.Handle<EasyNetQException>() .Or<BrokerUnreachableException>() .RetryForever(); policy.Execute(TryConnect); } public void Dispose() { _bus.Dispose(); } } }
29.657895
103
0.580597
[ "MIT" ]
wellingtoong/GISA
src/building blocks/GISA.MessageBus/MessageBus.cs
3,383
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("PaladinPharmacyCOMv1.Example")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("PaladinPharmacyCOMv1.Example")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("3d18dcd1-cbc9-4267-b4fe-2d3a8dc9e244")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
38.583333
84
0.75306
[ "MIT" ]
PaladinPOS/PharmacyCOMv1
Samples/PaladinPharmacyCOMv1.Example/Properties/AssemblyInfo.cs
1,392
C#
// ----------------------------------------------------------------------- // <copyright file="Double2KeyTests.cs" company="MagicKitchen"> // Copyright (c) MagicKitchen. All rights reserved. // </copyright> // ----------------------------------------------------------------------- namespace MagicKitchen.SplitterSprite4.Common.Test.Spec.Indexer.Dict.Key { using System.Collections.Generic; using MagicKitchen.SplitterSprite4.Common.Spec; using Xunit; public class Double2KeyTests { /// <summary> /// Test getter. /// </summary> /// <param name="path">The os-agnostic path of the spec file.</param> [Theory] [InlineData("foo.spec")] [InlineData("dir/bar.spec")] [InlineData("dir1/dir2/baz.spec")] public void GetterTest(string path) { // arrange var proxy = Utility.TestOutSideProxy(); var agnosticPath = AgnosticPath.FromAgnosticPathString(path); Utility.SetupSpecFile(proxy, path, Utility.JoinLines( "\"properties\":", " \"dict\":", " \"DictBody\":", " \"0.0, 0.0\": \"zero-zero\"", " \"0.0, 1.1\": \"zero-one\"", " \"1.1, 0.0\": \"one-zero\"")); // act var spec = SpecRoot.Fetch(proxy, agnosticPath); var dict = spec.Dict.Double2.Keyword["dict"]; // assert Assert.Equal( new Dictionary<(double, double), string> { { (0.0, 0.0), "zero-zero" }, { (0.0, 1.1), "zero-one" }, { (1.1, 0.0), "one-zero" }, }, dict); } /// <summary> /// Test getter with invalid key. /// </summary> /// <param name="path">The os-agnostic path of the spec file.</param> [Theory] [InlineData("foo.spec")] [InlineData("dir/bar.spec")] [InlineData("dir1/dir2/baz.spec")] public void InvalidKeyGetterTest(string path) { // arrange var proxy = Utility.TestOutSideProxy(); var agnosticPath = AgnosticPath.FromAgnosticPathString(path); Utility.SetupSpecFile(proxy, path, Utility.JoinLines( "\"properties\":", " \"dict\":", " \"DictBody\":", " \"zero\": \"invalid\"", " \"0.0, 0.0\": \"zero-zero\"")); // act var spec = SpecRoot.Fetch(proxy, agnosticPath); // assert Assert.Throws<Spec.InvalidSpecAccessException>(() => { _ = spec.Dict.Double2.Keyword["dict"]; }); } /// <summary> /// Test setter. /// </summary> /// <param name="path">The os-agnostic path of the spec file.</param> [Theory] [InlineData("foo.spec")] [InlineData("dir/bar.spec")] [InlineData("dir1/dir2/baz.spec")] public void SetterTest(string path) { // arrange var proxy = Utility.TestOutSideProxy(); var agnosticPath = AgnosticPath.FromAgnosticPathString(path); Utility.SetupSpecFile(proxy, path, Utility.JoinLines( "\"properties\":", " \"other value\": \"dummy\"")); // act var spec = SpecRoot.Fetch(proxy, agnosticPath); spec.Dict.Double2.Keyword["dict"] = new Dictionary<(double, double), string> { { (0.0, 0.0), "zero-zero" }, { (0.0, 1.1), "zero-one" }, { (1.1, 0.0), "one-zero" }, }; // assert Assert.Equal( Utility.JoinLines( "\"properties\":", " \"other value\": \"dummy\"", " \"dict\":", " \"DictBody\":", " \"0, 0\": \"zero-zero\"", " \"0, 1.1\": \"zero-one\"", " \"1.1, 0\": \"one-zero\""), spec.ToString()); } } }
35.090909
88
0.436411
[ "MIT" ]
polyhedron2/SplitterSprite4
SplitterSprite4/Common.Test/Spec/Indexer/Dict/Key/Double2KeyTests.cs
4,248
C#
/*SFF*/ /************************************************ This class has been generated dynamically. Any changes you make here will be overwritten. ************************************************/ using System; using System.Collections.Generic; namespace TheSharpFactory.Entity.MainDb.Media { /// <summary> /// This enum represents the existing Properties for: Genre. /// </summary> public enum GenreProperty { /// <summary>Type: int.</summary> GenreId, /// <summary>Type: string.</summary> Name, } }
23.458333
64
0.529307
[ "Apache-2.0" ]
TheSharpFactory/mvcsamples
DataAccess/TheSharpFactory.Entity/MainDb/Media/PropertyEnums/GenreProperty.cs
563
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNative.ApiManagement.V20191201Preview.Outputs { /// <summary> /// Email Template Parameter contract. /// </summary> [OutputType] public sealed class EmailTemplateParametersContractPropertiesResponse { /// <summary> /// Template parameter description. /// </summary> public readonly string? Description; /// <summary> /// Template parameter name. /// </summary> public readonly string? Name; /// <summary> /// Template parameter title. /// </summary> public readonly string? Title; [OutputConstructor] private EmailTemplateParametersContractPropertiesResponse( string? description, string? name, string? title) { Description = description; Name = name; Title = title; } } }
26.652174
81
0.612561
[ "Apache-2.0" ]
polivbr/pulumi-azure-native
sdk/dotnet/ApiManagement/V20191201Preview/Outputs/EmailTemplateParametersContractPropertiesResponse.cs
1,226
C#
using System; using System.IO; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using Octokit; using Ookii.Dialogs.Wpf; using ProjectGFN.Clients; using Path = System.IO.Path; using GitHubRepo = Octokit.Repository; namespace ProjectGFN.Windows.Git { /// <summary> /// Interaction logic for CloneWindow.xaml /// </summary> public partial class CloneWindow : Window { public GitHubRepo Repository { get; set; } public List<Branch> Branches = new List<Branch>(); public event EventHandler<CloneEventArgs> Selected; public bool AutoClose { get; set; } = true; public CloneWindow() { InitializeComponent(); this.Loaded += CloneWindow_Loaded; } public async Task InitializeAsync(GitHubRepo repo) { Repository = repo; Branch[] branches = await RepositoryManager.GetBranchesAsync(repo); Branches = new List<Branch>(branches); } public async void CloneWindow_Loaded(object sender, RoutedEventArgs e) { //Path if (!string.IsNullOrWhiteSpace(RepositoryManager.RepositoryPath)) { var prevDirectory = Directory.GetParent(RepositoryManager.RepositoryPath).FullName; xPath.Text = $@"{prevDirectory}\{Repository.Name}"; } //Branches var gridView = new GridView(); xBranches.View = gridView; gridView.Columns.Add(new GridViewColumn {Header = "Branch Name", DisplayMemberBinding = new Binding("BranchName")}); gridView.Columns.Add(new GridViewColumn { Header = "Last Commit Date", DisplayMemberBinding = new Binding("LastCommitDate") }); gridView.Columns.Add(new GridViewColumn { Header = "Default", DisplayMemberBinding = new Binding("Default") }); foreach (var branch in Branches) { var listViewItem = new ListViewItem(); var commit = await GitManager.Client.Repository.Commit.Get(Repository.Id, branch.Commit.Sha); bool isDefault = branch.Name == Repository.DefaultBranch; var cloneItem = new CloneItem(branch.Name, commit.Commit.Author.Date.DateTime, isDefault); listViewItem.Content = cloneItem; xBranches.Items.Add(listViewItem); if (isDefault) { xBranches.SelectedItem = listViewItem; } } } private void xOk_Click(object sender, RoutedEventArgs e) { if (!string.IsNullOrWhiteSpace(xPath.Text) && xBranches.SelectedItem != null && xBranches.SelectedItem is ListViewItem listViewItem) { var cloneItem = listViewItem.Content as CloneItem; var branchName = cloneItem?.BranchName; Selected?.Invoke(this, new CloneEventArgs(xPath.Text, branchName)); if (AutoClose) { this.Close(); } } else { MessageBox.Show("You didn't select any repository.", MainWindow.MainTitle, MessageBoxButton.OK, MessageBoxImage.Warning); } } private void xPathOk_Click(object sender, RoutedEventArgs e) { var dialog = new VistaFolderBrowserDialog(); if (dialog.ShowDialog(this).GetValueOrDefault()) { xPath.Text = $@"{dialog.SelectedPath}\{Repository.Name}"; } } } public class CloneItem { public string BranchName { get; set; } public string LastCommitDate { get; set; } public string Default { get; set; } public CloneItem(string branchName, DateTime date, bool isDefault) { BranchName = branchName; LastCommitDate = date.ToString(); Default = isDefault ? "*" : string.Empty; } } public class CloneEventArgs { public string Path { get; set; } public string BranchName { get; set; } public CloneEventArgs(string path, string branchName) { Path = path; BranchName = branchName; } } }
31.835616
144
0.588855
[ "Apache-2.0" ]
MineEric64/Git4Nextop
Windows/Git/CloneWindow.xaml.cs
4,650
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for details. using System; using System.Drawing; using System.Windows.Forms; using OpenLiveWriter.CoreServices.UI; using OpenLiveWriter.Extensibility.ImageEditing; using OpenLiveWriter.HtmlEditor; using OpenLiveWriter.Localization; using OpenLiveWriter.PostEditor; using OpenLiveWriter.PostEditor.PostHtmlEditing.Sidebar; namespace OpenLiveWriter.PostEditor.PostHtmlEditing { /// <summary> /// Host control for Sidebar which allows us to derive from SidebarControl but still /// use a PrimaryWorkspaceControl to inherit UI framework functionality /// </summary> public class ImagePropertiesSidebarHostControl : SidebarControl { public ImagePropertiesSidebarHostControl( ISidebarContext sidebarContext, IHtmlEditorComponentContext editorContext, IBlogPostImageEditingContext imageEditingContext, CreateFileCallback createFileCallback) { // Instead of creating the image sidebar, we now create the manager for ribbon commands related to image editing. _pictureEditingManager = new PictureEditingManager(editorContext, imageEditingContext, createFileCallback); } public PictureEditingManager PictureEditingManager { get { return _pictureEditingManager; } } private readonly PictureEditingManager _pictureEditingManager; public override void UpdateView(object htmlSelection, bool force) { // delegate UpdateView PictureEditingManager.UpdateView(htmlSelection); } } }
35.734694
125
0.717304
[ "MIT" ]
BobinYang/OpenLiveWriter
src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImagePropertiesSidebarHostControl.cs
1,751
C#
namespace OpenSource.UPnP { partial class AutoUpdate { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AutoUpdate)); this.cancelButton = new System.Windows.Forms.Button(); this.updateButton = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.updateCheckBox = new System.Windows.Forms.CheckBox(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.currentVersionLabel = new System.Windows.Forms.Label(); this.newVersionLabel = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); // // cancelButton // this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.cancelButton.Location = new System.Drawing.Point(258, 136); this.cancelButton.Name = "cancelButton"; this.cancelButton.Size = new System.Drawing.Size(75, 23); this.cancelButton.TabIndex = 0; this.cancelButton.Text = "Cancel"; this.cancelButton.UseVisualStyleBackColor = true; this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); // // updateButton // this.updateButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.updateButton.Location = new System.Drawing.Point(177, 136); this.updateButton.Name = "updateButton"; this.updateButton.Size = new System.Drawing.Size(75, 23); this.updateButton.TabIndex = 1; this.updateButton.Text = "Update"; this.updateButton.UseVisualStyleBackColor = true; this.updateButton.Click += new System.EventHandler(this.updateButton_Click); // // label1 // this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label1.Location = new System.Drawing.Point(12, 9); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(321, 44); this.label1.TabIndex = 2; this.label1.Text = "A new version of the tools are available for download. Click \"Update\" to perform " + "an automatic update of all of the mesh tools."; // // updateCheckBox // this.updateCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.updateCheckBox.AutoSize = true; this.updateCheckBox.Checked = true; this.updateCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; this.updateCheckBox.Location = new System.Drawing.Point(15, 142); this.updateCheckBox.Name = "updateCheckBox"; this.updateCheckBox.Size = new System.Drawing.Size(113, 17); this.updateCheckBox.TabIndex = 3; this.updateCheckBox.Text = "Check for updates"; this.updateCheckBox.UseVisualStyleBackColor = true; this.updateCheckBox.CheckedChanged += new System.EventHandler(this.updateCheckBox_CheckedChanged); // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(27, 23); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(79, 13); this.label2.TabIndex = 4; this.label2.Text = "Current Version"; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(27, 46); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(67, 13); this.label3.TabIndex = 5; this.label3.Text = "New Version"; // // currentVersionLabel // this.currentVersionLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.currentVersionLabel.Location = new System.Drawing.Point(206, 23); this.currentVersionLabel.Name = "currentVersionLabel"; this.currentVersionLabel.Size = new System.Drawing.Size(79, 13); this.currentVersionLabel.TabIndex = 6; this.currentVersionLabel.Text = "v0.00"; this.currentVersionLabel.TextAlign = System.Drawing.ContentAlignment.TopRight; // // newVersionLabel // this.newVersionLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.newVersionLabel.Location = new System.Drawing.Point(206, 46); this.newVersionLabel.Name = "newVersionLabel"; this.newVersionLabel.Size = new System.Drawing.Size(79, 13); this.newVersionLabel.TabIndex = 7; this.newVersionLabel.Text = "v0.00"; this.newVersionLabel.TextAlign = System.Drawing.ContentAlignment.TopRight; // // groupBox1 // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.newVersionLabel); this.groupBox1.Controls.Add(this.label3); this.groupBox1.Controls.Add(this.currentVersionLabel); this.groupBox1.Location = new System.Drawing.Point(15, 56); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(318, 74); this.groupBox1.TabIndex = 8; this.groupBox1.TabStop = false; this.groupBox1.Text = "Version Information"; // // AutoUpdate // this.AcceptButton = this.updateButton; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.cancelButton; this.ClientSize = new System.Drawing.Size(345, 171); this.Controls.Add(this.groupBox1); this.Controls.Add(this.updateCheckBox); this.Controls.Add(this.label1); this.Controls.Add(this.updateButton); this.Controls.Add(this.cancelButton); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "AutoUpdate"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Developer Tools for UPnP Technology update"; this.Load += new System.EventHandler(this.MeshToolsUpdate_Load); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Button cancelButton; private System.Windows.Forms.Button updateButton; private System.Windows.Forms.Label label1; private System.Windows.Forms.CheckBox updateCheckBox; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label currentVersionLabel; private System.Windows.Forms.Label newVersionLabel; private System.Windows.Forms.GroupBox groupBox1; } }
52.383784
179
0.60324
[ "Apache-2.0" ]
okertanov/Developer-Tools-for-UPnP-Technologies
Global/UPnP/AutoUpdate.designer.cs
9,693
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the ssm-2014-11-06.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.SimpleSystemsManagement.Model { /// <summary> /// Parameter Store retains the 100 most recently created versions of a parameter. After /// this number of versions has been created, Parameter Store deletes the oldest version /// when a new one is created. However, if the oldest version has a <i>label</i> attached /// to it, Parameter Store will not delete the version and instead presents this error /// message: /// /// /// <para> /// <code>An error occurred (ParameterMaxVersionLimitExceeded) when calling the PutParameter /// operation: You attempted to create a new version of <i>parameter-name</i> by calling /// the PutParameter API with the overwrite flag. Version <i>version-number</i>, the oldest /// version, can't be deleted because it has a label associated with it. Move the label /// to another version of the parameter, and try again.</code> /// </para> /// /// <para> /// This safeguard is to prevent parameter versions with mission critical labels assigned /// to them from being deleted. To continue creating new parameters, first move the label /// from the oldest version of the parameter to a newer one for use in your operations. /// For information about moving parameter labels, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-labels.html#sysman-paramstore-labels-console-move">Move /// a parameter label (console)</a> or <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-labels.html#sysman-paramstore-labels-cli-move">Move /// a parameter label (CLI)</a> in the <i>AWS Systems Manager User Guide</i>. /// </para> /// </summary> #if !NETSTANDARD [Serializable] #endif public partial class ParameterMaxVersionLimitExceededException : AmazonSimpleSystemsManagementException { /// <summary> /// Constructs a new ParameterMaxVersionLimitExceededException with the specified error /// message. /// </summary> /// <param name="message"> /// Describes the error encountered. /// </param> public ParameterMaxVersionLimitExceededException(string message) : base(message) {} /// <summary> /// Construct instance of ParameterMaxVersionLimitExceededException /// </summary> /// <param name="message"></param> /// <param name="innerException"></param> public ParameterMaxVersionLimitExceededException(string message, Exception innerException) : base(message, innerException) {} /// <summary> /// Construct instance of ParameterMaxVersionLimitExceededException /// </summary> /// <param name="innerException"></param> public ParameterMaxVersionLimitExceededException(Exception innerException) : base(innerException) {} /// <summary> /// Construct instance of ParameterMaxVersionLimitExceededException /// </summary> /// <param name="message"></param> /// <param name="innerException"></param> /// <param name="errorType"></param> /// <param name="errorCode"></param> /// <param name="requestId"></param> /// <param name="statusCode"></param> public ParameterMaxVersionLimitExceededException(string message, Exception innerException, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode) : base(message, innerException, errorType, errorCode, requestId, statusCode) {} /// <summary> /// Construct instance of ParameterMaxVersionLimitExceededException /// </summary> /// <param name="message"></param> /// <param name="errorType"></param> /// <param name="errorCode"></param> /// <param name="requestId"></param> /// <param name="statusCode"></param> public ParameterMaxVersionLimitExceededException(string message, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode) : base(message, errorType, errorCode, requestId, statusCode) {} #if !NETSTANDARD /// <summary> /// Constructs a new instance of the ParameterMaxVersionLimitExceededException class with serialized data. /// </summary> /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param> /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param> /// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is null. </exception> /// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult" /> is zero (0). </exception> protected ParameterMaxVersionLimitExceededException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } /// <summary> /// Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with information about the exception. /// </summary> /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param> /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param> /// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is a null reference (Nothing in Visual Basic). </exception> #if BCL35 [System.Security.Permissions.SecurityPermission( System.Security.Permissions.SecurityAction.LinkDemand, Flags = System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter)] #endif [System.Security.SecurityCritical] // These FxCop rules are giving false-positives for this method [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2134:MethodsMustOverrideWithConsistentTransparencyFxCopRule")] public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { base.GetObjectData(info, context); } #endif } }
52.664384
202
0.695539
[ "Apache-2.0" ]
QPC-database/aws-sdk-net
sdk/src/Services/SimpleSystemsManagement/Generated/Model/ParameterMaxVersionLimitExceededException.cs
7,689
C#
using System; using System.Linq; namespace UiPathTeam.ActivityReader { public class TypeString { static public readonly string[] DEFAULT_NAMESPACES = { "System", "System.Activities", "System.Collections.Generic", "System.Data", }; static public string[] Namespaces { get; set; } static TypeString() { Namespaces = DEFAULT_NAMESPACES; } static public string Symplify(string t) { return new Parser(t).Run(); } private class Parser { static private readonly string DIGITS = "0123456789"; private string _t; private int _i; private char _c; public Parser(string t) { _t = t; } public string Run() { try { Init(); var s = ReadType(); if (IsEnd) { return s; } else { Console.Error.WriteLine("ERROR: TypeString failed: Extra contents: {0}", _t.Substring(CurrentIndex)); return _t; } } catch (Exception ex) { Console.Error.WriteLine("ERROR: TypeString failed: {0}", ex.Message); return _t; } } private string ReadType() { var s1 = ReadName(); var s2 = ReadTemplatePart(); var s3 = ReadArrayPart(); return string.Format("{0}{1}{2}", s1, s2, s3); } private string ReadName() { int pos1 = CurrentIndex; if (IsNameLeadChar) { ReadChar(); } else { return ""; } while (IsNameChar) { ReadChar(); } int pos2 = -1; while (_c == '.' || _c == '/') // It is observed that a slash is used as the most left hand separator of components { pos2 = CurrentIndex; ReadChar(); if (IsNameLeadChar) { ReadChar(); } else { throw new Exception("Name char is missing."); } while (IsNameChar) { ReadChar(); } } return pos2 > 0 && Namespaces.Contains(Substring(pos1, pos2)) ? Substring(pos2 + 1) : Substring(pos1); } private string ReadTemplatePart() { if (_c == '`') { ReadChar(); } else { return ""; } var n = DIGITS.IndexOf(_c); if (n > 0) { ReadChar(); } else { throw new Exception("Non-zero Digit is missing."); } var d = DIGITS.IndexOf(_c); while (d > -1) { n = n * 10 + d; ReadChar(); d = DIGITS.IndexOf(_c); } if (_c == '<') { ReadChar(); } else { throw new Exception("Less-than is missing."); } var s1 = ReadType(); if (s1.Length == 0) { throw new Exception("Template type is missing."); } for (int j = 1; j < n; j++) { if (_c == ',') { ReadChar(); } else { throw new Exception("Comma is missing."); } var s2 = ReadType(); if (s2.Length == 0) { throw new Exception("Template type is missing."); } s1 += "," + s2; } if (_c == '>') { ReadChar(); } else { throw new Exception("Greater-than is missing."); } return string.Format("<{0}>", s1); } private string ReadArrayPart() { int pos = CurrentIndex; if (_c == '[') { ReadChar(); } else { return ""; } if (_c == ']') { ReadChar(); } else { throw new Exception("Closing square bracket is missing."); } while (_c == '[') { ReadChar(); if (_c == ']') { ReadChar(); } else { throw new Exception("Closing square bracket is missing."); } } return Substring(pos); } private void Init() { _i = 0; ReadChar(); } private int CurrentIndex { get { return _i - 1; } } private void ReadChar() { if (_i < _t.Length) { _c = _t[_i++]; } else { _i = _t.Length + 1; _c = (char)0; } } private bool IsEnd { get { return _c == (char)0; } } private bool IsNameLeadChar { get { return Char.IsLetter(_c) || _c == '_'; } } private bool IsNameChar { get { return Char.IsLetterOrDigit(_c) || _c == '_'; } } private string Substring(int start) { return _t.Substring(start, CurrentIndex - start); } private string Substring(int start, int end) { return _t.Substring(start, end - start); } } } }
26.753623
132
0.299702
[ "MIT" ]
UiPathJapan/ActivityReader
TypeString.cs
7,386
C#
using System; using System.Collections.Generic; #nullable disable namespace api.Models.Ttv { public partial class BrKeywordDimFundingDecision { public int DimKeywordId { get; set; } public int DimFundingDecisionId { get; set; } public virtual DimFundingDecision DimFundingDecision { get; set; } public virtual DimKeyword DimKeyword { get; set; } } }
23.411765
74
0.69598
[ "MIT" ]
CSCfi/research-fi-mydata
aspnetcore/src/api/Models/Ttv/BrKeywordDimFundingDecision.cs
400
C#
/* * Copyright 2020 Regan Heath * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.Threading.Tasks; namespace Erlang.NET { public interface IOtpServerTransport : IDisposable { void Start(); int LocalPort { get; } IOtpTransport Accept(); Task<IOtpTransport> AcceptAsync(); void Close(); } }
29.433333
75
0.699887
[ "Apache-2.0" ]
reganheath/Erlang.NET
Erlang.NET/Transport/IOtpServerTransport.cs
885
C#
/*---------------------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. ----------------------------------------------------------*/ using DotRAC.SWP.Codec; namespace dotRAC.ibis.swp.Internal { internal class ServerHostContext : ISwpV8ServerHostContext { private const int HASH_PRIME = 31; private readonly ServiceWireCodecVersion codecVersion; public ServiceWireCodecVersion CodecVersion => codecVersion; public ServerHostContext(ServiceWireCodecVersion codecVersion) => this.codecVersion = codecVersion; public override int GetHashCode() => HASH_PRIME + (int)codecVersion; public override bool Equals(object obj) => obj is ServerHostContext context ? codecVersion == context.codecVersion : false; } }
36.692308
131
0.643606
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
yukon39/dotRAC
src/dotRAC/ibis/swp/Internal/ServerHostContext.cs
956
C#
namespace bot_flash_cards_blip_sdk_csharp { using System; using System.Collections.Generic; using System.Linq; using System.Reflection.Metadata; using Lime.Messaging.Contents; using Lime.Protocol; public class Game { public string Player { get; set; } public int Questions { get; set; } public int Result { get; set; } public List<Person> People { get; set; } public List<Answer> Answers { get; set; } private Person _lastPerson; public MediaLink Run() { Random random = new Random(); var person = random.Next(0, People.Count-1); var document = new MediaLink { Text = People[person].Text, Type = MediaType.Parse("image/jpeg"), AspectRatio = People[person].AspectRatio, Size = People[person].Size, Uri = new Uri(People[person].Uri, UriKind.Absolute), PreviewUri = new Uri(People[person].PreviewUri, UriKind.Absolute) }; _lastPerson = People[person]; People.RemoveAt(person); return document; } public void ProccessAnswer(string answerName) { var isCorrect = false; if (_lastPerson.Name.ToLower().Contains(answerName.ToLower())) { isCorrect = true; } Answers.Add(new Answer(isCorrect, _lastPerson, answerName)); } public int ProccesResult() => Answers.Count((answer) => answer.IsCorrect); public IEnumerable<Answer> ProcessErrors() { var result = from answer in Answers where !answer.IsCorrect select answer; return result; } public DocumentCollection ShowErros() { var documents = new DocumentSelect[ProcessErrors().Count()]; var errors = ProcessErrors(); var position = 0; foreach (var error in ProcessErrors()) { documents[position] = new DocumentSelect { Header = new DocumentContainer { Value = new MediaLink { Title = error.Person.Name, Text = $"You said {error.AnswerName}.", Type = "image/jpeg", Uri = new Uri(error.Person.Uri), } }, Options = new DocumentSelectOption[] { new DocumentSelectOption { Label = new DocumentContainer { Value = new WebLink { Title = "Search on Workplace", Uri = new Uri("https://take.facebook.com/search/top/?q=" + error.Person.Name) } } } } }; position++; } var document = new DocumentCollection { ItemType = "application/vnd.lime.document-select+json", Items = documents, }; return document; } } }
31.418803
117
0.432807
[ "Apache-2.0" ]
BeltrameJP/blip-sdk-csharp
src/Samples/FlashCards/Game.cs
3,676
C#
using System; using Moq; using NUnit.Framework; using SheepAspect.Core; using SheepAspect.MixinsAdvising; using SheepAspect.Pointcuts.Impl; using SheepAspect.UnitTest.TestHelper; using FluentAssertions; namespace SheepAspect.UnitTest.ImplementInterfaceTests { public class ImplementInterfaceTest: AspectTestBase { private static Mock<ITestInterface> interfaceMock; protected override Type TargetType() { return typeof(TestTarget); } protected override void SetupAspect(AspectDefinition aspect) { interfaceMock = new Mock<ITestInterface>(); aspect.Advise( new DeclareMixinFromMethodAdvice(CreatePointcuts<TypePointcut>(aspect, "TestPointcut", "Name:'TestTarget'"), GetAspectMethod("MixinTestAdvice"), null, true)); } public ITestInterface MixinTestAdvice() { return interfaceMock.Object; } [Assert] public void CanMixinMethod() { var stubResult = new object(); interfaceMock.Setup(x => x.SomeMethod(123)).Returns(stubResult); var casted = (ITestInterface)target; casted.SomeMethod(123).Should().Be(stubResult); } } public interface ITestInterface { object SomeMethod(int abc); } public class TestTarget { } }
26.980769
124
0.637919
[ "MIT" ]
erhan0/aop
SheepAspect.UnitTest/ImplementInterfaceTests/ImplementInterfaceTest.cs
1,405
C#
using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using CoolParking.BL.Services; namespace CoolParking.WebAPI { public class Program { public static void Main(string[] args) { TimeService time = new TimeService(); time.Start(); CreateHostBuilder(args).Build().Run(); } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }); } }
26.9
70
0.640644
[ "MIT" ]
MishaHlushko/CoolParking
CoolParking/CoolParking.WebAPI/Program.cs
807
C#
// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschraenkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using Squidex.Infrastructure.TestHelpers; using Xunit; namespace Squidex.Infrastructure.Json.Objects { public class JsonValuesSerializationTests { [Fact] public void Should_deserialize_integer() { var serialized = TestUtils.Deserialize<IJsonValue>(123); Assert.Equal(JsonValue.Create(123), serialized); } [Fact] public void Should_serialize_and_deserialize_null() { var value = JsonValue.Null; var serialized = value.SerializeAndDeserialize(); Assert.Equal(value, serialized); } [Fact] public void Should_serialize_and_deserialize_date() { var value = JsonValue.Create("2008-09-15T15:53:00"); var serialized = value.SerializeAndDeserialize(); Assert.Equal(value, serialized); } [Fact] public void Should_serialize_and_deserialize_string() { var value = JsonValue.Create("my-string"); var serialized = value.SerializeAndDeserialize(); Assert.Equal(value, serialized); } [Fact] public void Should_serialize_and_deserialize_boolean() { var value = JsonValue.Create(true); var serialized = value.SerializeAndDeserialize(); Assert.Equal(value, serialized); } [Fact] public void Should_serialize_and_deserialize_number() { var value = JsonValue.Create(123); var serialized = value.SerializeAndDeserialize(); Assert.Equal(value, serialized); } [Fact] public void Should_serialize_and_deserialize_double_number() { var value = JsonValue.Create(123.5); var serialized = value.SerializeAndDeserialize(); Assert.Equal(value, serialized); } [Fact] public void Should_serialize_and_deserialize_array() { var value = JsonValue.Array(1, 2); var serialized = value.SerializeAndDeserialize(); Assert.Equal(value, serialized); } [Fact] public void Should_serialize_and_deserialize_object() { var value = JsonValue.Object() .Add("1", 1) .Add("2", 1); var serialized = value.SerializeAndDeserialize(); Assert.Equal(value, serialized); } [Fact] public void Should_serialize_and_deserialize_complex_object() { var value = JsonValue.Object() .Add("1", JsonValue.Array( JsonValue.Object().Add("1_1", 11), JsonValue.Object().Add("1_2", 12))) .Add("2", JsonValue.Object().Add("2_1", 11)); var serialized = value.SerializeAndDeserialize(); Assert.Equal(value, serialized); } } }
27.790323
78
0.517411
[ "MIT" ]
Appleseed/squidex
backend/tests/Squidex.Infrastructure.Tests/Json/Objects/JsonValuesSerializationTests.cs
3,448
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; namespace BNG { public class VRUISystem : BaseInputModule { [Header("XR Controller Options : ")] [Tooltip("This setting determines if LeftPointerTransform or RightPointerTransform will be used as a forward vector for World Space UI events")] public ControllerHand SelectedHand = ControllerHand.Right; [Tooltip("A transform on the left controller to use when raycasting for world space UI events")] public Transform LeftPointerTransform; [Tooltip("A transform on the right controller to use when raycasting for world space UI events")] public Transform RightPointerTransform; [Tooltip("A transform on the right controller to use when raycasting for world space UI events")] public List<ControllerBinding> ControllerInput = new List<ControllerBinding>() { ControllerBinding.RightTrigger }; [Tooltip("If true, Left Mouse Button down event will be sent as a click")] public bool AllowMouseInput = true; [Header("Shown for Debug : ")] public GameObject PressingObject; public GameObject DraggingObject; public GameObject ReleasingObject; public PointerEventData EventData { get; private set; } Camera cameraCaster; private GameObject _initialPressObject; private bool _lastInputDown; private static VRUISystem _instance; public static VRUISystem Instance { get { if (_instance == null) { _instance = GameObject.FindObjectOfType<VRUISystem>(); if (_instance == null) { // Check for existing event system EventSystem eventSystem = EventSystem.current; if(eventSystem == null) { eventSystem = new GameObject("EventSystem").AddComponent<EventSystem>(); ; } _instance = eventSystem.gameObject.AddComponent<VRUISystem>(); } } return _instance; } } protected override void Awake() { UpdateControllerHand(SelectedHand); EventData = new PointerEventData(eventSystem); EventData.position = new Vector2(cameraCaster.pixelWidth / 2, cameraCaster.pixelHeight / 2); AssignCameraToAllCanvases(cameraCaster); } void init() { if(cameraCaster == null) { // Create the camera required for the caster. // We can reduce the fov and disable the camera component for performance var go = new GameObject("CameraCaster"); cameraCaster = go.AddComponent<Camera>(); cameraCaster.fieldOfView = 5f; cameraCaster.nearClipPlane = 0.01f; cameraCaster.clearFlags = CameraClearFlags.Nothing; cameraCaster.enabled = false; } } public override void Process() { if(EventData == null) { return; } EventData.position = new Vector2(cameraCaster.pixelWidth / 2, cameraCaster.pixelHeight / 2); eventSystem.RaycastAll(EventData, m_RaycastResultCache); EventData.pointerCurrentRaycast = FindFirstRaycast(m_RaycastResultCache); m_RaycastResultCache.Clear(); // Handle Hover HandlePointerExitAndEnter(EventData, EventData.pointerCurrentRaycast.gameObject); // Handle Drag ExecuteEvents.Execute(EventData.pointerDrag, EventData, ExecuteEvents.dragHandler); bool inputDown = InputReady(); // On Trigger Down > TriggerDownValue this frame but not last if (inputDown && _lastInputDown == false) { PressDown(); } // On Held Down else if(inputDown) { Press(); } // On Release else { Release(); } _lastInputDown = inputDown; } public virtual bool InputReady() { // Check for bound controller button for (int x = 0; x < ControllerInput.Count; x++) { if (InputBridge.Instance.GetControllerBindingValue(ControllerInput[x])) { return true; } } // Keyboard input if (AllowMouseInput && Input.GetMouseButton(0)) { return true; } return false; } public virtual void PressDown() { EventData.pointerPressRaycast = EventData.pointerCurrentRaycast; // Deselect if selection changed if(_initialPressObject != null) { // ExecuteEvents.Execute(_initialPressObject, EventData, ExecuteEvents.deselectHandler); _initialPressObject = null; } _initialPressObject = ExecuteEvents.GetEventHandler<IPointerClickHandler>(EventData.pointerPressRaycast.gameObject); // Set Press Objects and Events SetPressingObject(_initialPressObject); ExecuteEvents.Execute(EventData.pointerPress, EventData, ExecuteEvents.pointerDownHandler); // Set Drag Objects and Events SetDraggingObject(ExecuteEvents.GetEventHandler<IDragHandler>(EventData.pointerPressRaycast.gameObject)); ExecuteEvents.Execute(EventData.pointerDrag, EventData, ExecuteEvents.beginDragHandler); } public void Press() { EventData.pointerPressRaycast = EventData.pointerCurrentRaycast; // Set Press Objects and Events SetPressingObject(ExecuteEvents.GetEventHandler<IPointerClickHandler>(EventData.pointerPressRaycast.gameObject)); ExecuteEvents.Execute(EventData.pointerPress, EventData, ExecuteEvents.pointerDownHandler); // Set Drag Objects and Events SetDraggingObject(ExecuteEvents.GetEventHandler<IDragHandler>(EventData.pointerPressRaycast.gameObject)); ExecuteEvents.Execute(EventData.pointerDrag, EventData, ExecuteEvents.beginDragHandler); } public void Release() { SetReleasingObject(ExecuteEvents.GetEventHandler<IPointerClickHandler>(EventData.pointerCurrentRaycast.gameObject)); // Considered a click event if released after an initial click if (EventData.pointerPress == ReleasingObject) { ExecuteEvents.Execute(EventData.pointerPress, EventData, ExecuteEvents.pointerClickHandler); } ExecuteEvents.Execute(EventData.pointerPress, EventData, ExecuteEvents.pointerUpHandler); ExecuteEvents.Execute(EventData.pointerDrag, EventData, ExecuteEvents.endDragHandler); // Send deselect to // ExecuteEvents.Execute(ReleasingObject, EventData, ExecuteEvents.deselectHandler); ClearAll(); } public virtual void ClearAll() { SetPressingObject(null); SetDraggingObject(null); EventData.pointerCurrentRaycast.Clear(); } public virtual void SetPressingObject(GameObject pressing) { EventData.pointerPress = pressing; PressingObject = pressing; } public virtual void SetDraggingObject(GameObject dragging) { EventData.pointerDrag = dragging; DraggingObject = dragging; } public virtual void SetReleasingObject(GameObject releasing) { ReleasingObject = releasing; } public virtual void AssignCameraToAllCanvases(Camera cam) { Canvas[] allCanvas = FindObjectsOfType<Canvas>(); for (int x = 0; x < allCanvas.Length; x++) { AddCanvasToCamera(allCanvas[x], cam); } } public virtual void AddCanvas(Canvas canvas) { AddCanvasToCamera(canvas, cameraCaster); } public virtual void AddCanvasToCamera(Canvas canvas, Camera cam) { canvas.worldCamera = cam; } public void UpdateControllerHand(ControllerHand hand) { // Make sure variables exist init(); // Setup the Transform if (hand == ControllerHand.Left && LeftPointerTransform != null) { cameraCaster.transform.parent = LeftPointerTransform; cameraCaster.transform.localPosition = Vector3.zero; cameraCaster.transform.localEulerAngles = Vector3.zero; } else if (hand == ControllerHand.Right && RightPointerTransform != null) { cameraCaster.transform.parent = RightPointerTransform; cameraCaster.transform.localPosition = Vector3.zero; cameraCaster.transform.localEulerAngles = Vector3.zero; } } } }
37.937759
152
0.6126
[ "MIT" ]
AhmedFarouk1/GolfVR
Assets/BNG Framework/Scripts/UI/VRUISystem.cs
9,145
C#
/* ********************************************************************* * This Source Code Form is copyright of 51Degrees Mobile Experts Limited. * Copyright © 2015 51Degrees Mobile Experts Limited, 5 Charlotte Close, * Caversham, Reading, Berkshire, United Kingdom RG4 7BY * * This Source Code Form is the subject of the following patent * applications, owned by 51Degrees Mobile Experts Limited of 5 Charlotte * Close, Caversham, Reading, Berkshire, United Kingdom RG4 7BY: * European Patent Application No. 13192291.6; and * United States Patent Application Nos. 14/085,223 and 14/085,301. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. * * If a copy of the MPL was not distributed with this file, You can obtain * one at http://mozilla.org/MPL/2.0/. * * This Source Code Form is "Incompatible With Secondary Licenses", as * defined by the Mozilla Public License, v. 2.0. * ********************************************************************* */ using System.Configuration; using System.Web.Configuration; using System.Xml; namespace FiftyOne.Foundation.Mobile.Configuration { internal static class WebConfig { /// <summary> /// Makes sure the necessary HTTP module remove element is present in the web.config. /// </summary> /// <param name="xml">Xml fragment for the system.webServer web.config section</param> /// <returns>True if a change was made, otherwise false.</returns> private static bool FixRemoveModule(XmlDocument xml) { var changed = false; var module = xml.SelectSingleNode("//modules/remove[@name='Detector']") as XmlElement; if (module == null) { var modules = xml.SelectSingleNode("//modules"); var remove = xml.CreateElement("remove"); remove.Attributes.Append(xml.CreateAttribute("name")); remove.Attributes["name"].Value = "Detector"; modules.InsertBefore(remove, modules.FirstChild); changed = true; } return changed; } /// <summary> /// Makes sure the necessary HTTP module is present in the web.config file to support /// device detection and image optimisation. /// </summary> /// <param name="xml">Xml fragment for the system.webServer web.config section</param> /// <returns>True if a change was made, otherwise false.</returns> private static bool FixAddModule(XmlDocument xml) { var changed = false; var module = xml.SelectSingleNode("//modules/add[@type='FiftyOne.Foundation.Mobile.Detection.DetectorModule, FiftyOne.Foundation']") as XmlElement; if (module != null) { // If image optimisation is enabled and the preCondition attribute // is present then it'll need to be removed. if (module.Attributes["preCondition"] != null) { module.Attributes.RemoveNamedItem("preCondition"); changed = true; } // Make sure the module entry is named "Detector". if ("Detector".Equals(module.GetAttribute("name")) == false) { module.Attributes["name"].Value = "Detector"; changed = true; } } else { // The module entry is missing so add a new one. var modules = xml.SelectSingleNode("//modules"); module = xml.CreateElement("add"); module.Attributes.Append(xml.CreateAttribute("name")); module.Attributes["name"].Value = "Detector"; module.Attributes.Append(xml.CreateAttribute("type")); module.Attributes["type"].Value = "FiftyOne.Foundation.Mobile.Detection.DetectorModule, FiftyOne.Foundation"; modules.InsertAfter(module, modules.LastChild); changed = true; } return changed; } /// <summary> /// Makes sure a HTTP modules section exists in the xml. /// </summary> /// <param name="xml">Xml fragment for the system.webServer web.config section</param> /// <returns>True if a change was made, otherwise false.</returns> private static bool FixAddModules(XmlDocument xml) { var changed = false; var modules = xml.SelectSingleNode("//modules") as XmlElement; if (modules == null) { modules = xml.CreateElement("modules"); xml.FirstChild.InsertBefore(modules, xml.FirstChild.FirstChild); changed = true; } return changed; } /// <summary> /// Ensures that the web.config file has the HTTP module for device /// detection and image optimisation configured correctly. /// </summary> internal static bool SetWebConfigurationModules() { var config = WebConfigurationManager.OpenWebConfiguration("~"); if (config != null) { var section = config.GetSection("system.webServer") as ConfigurationSection; if (section != null) { var changed = false; var xml = new XmlDocument(); xml.LoadXml(section.SectionInformation.GetRawXml()); changed |= FixAddModules(xml); changed |= FixRemoveModule(xml); changed |= FixAddModule(xml); if (changed) { section.SectionInformation.SetRawXml(xml.InnerXml); config.Save(); } } } return true; } } }
42.892857
159
0.555704
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
hl46000/dotNET-Device-Detection
FoundationV3/Mobile/Configuration/WebConfig.cs
6,008
C#
/* * Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the codeguru-reviewer-2019-09-19.normal.json service model. */ using System; using Amazon.Runtime; using Amazon.Util.Internal; namespace Amazon.CodeGuruReviewer { /// <summary> /// Configuration for accessing Amazon CodeGuruReviewer service /// </summary> public partial class AmazonCodeGuruReviewerConfig : ClientConfig { private static readonly string UserAgentString = InternalSDKUtils.BuildUserAgentString("3.3.100.34"); private string _userAgent = UserAgentString; /// <summary> /// Default constructor /// </summary> public AmazonCodeGuruReviewerConfig() { this.AuthenticationServiceName = "codeguru-reviewer"; } /// <summary> /// The constant used to lookup in the region hash the endpoint. /// </summary> public override string RegionEndpointServiceName { get { return "codeguru-reviewer"; } } /// <summary> /// Gets the ServiceVersion property. /// </summary> public override string ServiceVersion { get { return "2019-09-19"; } } /// <summary> /// Gets the value of UserAgent property. /// </summary> public override string UserAgent { get { return _userAgent; } } } }
26.8625
115
0.597022
[ "Apache-2.0" ]
Vfialkin/aws-sdk-net
sdk/src/Services/CodeGuruReviewer/Generated/AmazonCodeGuruReviewerConfig.cs
2,149
C#
// ReSharper disable StringLiteralTypo // ReSharper disable IdentifierTypo // ReSharper disable InconsistentNaming // ReSharper disable UnusedType.Global namespace InControl.NativeDeviceProfiles { // @cond nodoc [Preserve, NativeInputDeviceProfile] public class MadCatzSaitekAV8R02MacNativeProfile : Xbox360DriverMacNativeProfile { public override void Define() { base.Define(); DeviceName = "Mad Catz Saitek AV8R02"; DeviceNotes = "Mad Catz Saitek AV8R02 on Mac"; Matchers = new[] { new InputDeviceMatcher { VendorID = 0x0738, ProductID = 0xcb29, }, }; } } // @endcond }
20.225806
81
0.716108
[ "MIT" ]
EstasAnt/Estsoul
Assets/InControl/Source/Native/DeviceProfiles/Generated/MadCatzSaitekAV8R02MacNativeProfile.cs
627
C#
using System; using System.Collections.Generic; using System.Linq; using UnityEngine; using Ship; using ActionsList; namespace Arcs { public class ArcMobile : GenericArc { private Transform MobileArcPointer; GenericShip Host; private class MobileSubArc { public ArcFacing Facing { get; private set; } public Dictionary<Vector3, float> Limits { get; private set; } public List<Vector3> Edges { get; private set; } public MobileSubArc(ArcFacing facing, Dictionary<Vector3, float> limits, List<Vector3> edges) { Facing = facing; Limits = limits; Edges = edges; } } private static Dictionary<ArcFacing, float> MobileArcRotationValues = new Dictionary<ArcFacing, float> { { ArcFacing.Forward, 0f }, { ArcFacing.Right, 90f }, { ArcFacing.Rear, 180f }, { ArcFacing.Left, 270f } }; private List<MobileSubArc> MobileArcParameters; private MobileSubArc ActiveMobileSubArc; public override ArcFacing Facing { get { return ActiveMobileSubArc.Facing; } set { ActiveMobileSubArc = MobileArcParameters.Find(n => n.Facing == value); } } public override List<Vector3> Edges { get { return ActiveMobileSubArc.Edges; } } public override Dictionary<Vector3, float> Limits { get { return ActiveMobileSubArc.Limits; } } public ArcMobile(GenericShipBase shipBase) : base(shipBase) { ArcType = ArcTypes.Mobile; ShotPermissions = new ArcShotPermissions() { CanShootPrimaryWeapon = true, CanShootTurret = true }; // Arcs MobileArcParameters = new List<MobileSubArc> { new MobileSubArc ( ArcFacing.Forward, new Dictionary<Vector3, float>() { { new Vector3(-shipBase.HALF_OF_FIRINGARC_SIZE, 0, 0), -40f }, { new Vector3( shipBase.HALF_OF_FIRINGARC_SIZE, 0, 0), 40f } }, new List<Vector3>() { new Vector3(-shipBase.HALF_OF_FIRINGARC_SIZE, 0, 0), new Vector3( shipBase.HALF_OF_FIRINGARC_SIZE, 0, 0), } ), new MobileSubArc ( ArcFacing.Left, new Dictionary<Vector3, float>() { { new Vector3(-shipBase.HALF_OF_FIRINGARC_SIZE, 0, -shipBase.SHIPSTAND_SIZE), -140f }, { new Vector3(-shipBase.HALF_OF_FIRINGARC_SIZE, 0, 0), -40f } }, new List<Vector3>() { new Vector3(-shipBase.HALF_OF_FIRINGARC_SIZE, 0, 0), new Vector3(-shipBase.HALF_OF_SHIPSTAND_SIZE, 0, 0), new Vector3(-shipBase.HALF_OF_SHIPSTAND_SIZE, 0, -shipBase.SHIPSTAND_SIZE), new Vector3(-shipBase.HALF_OF_FIRINGARC_SIZE, 0, -shipBase.SHIPSTAND_SIZE), } ), new MobileSubArc ( ArcFacing.Right, new Dictionary<Vector3, float>() { { new Vector3(shipBase.HALF_OF_FIRINGARC_SIZE, 0, 0), 40f }, { new Vector3(shipBase.HALF_OF_FIRINGARC_SIZE, 0, -shipBase.SHIPSTAND_SIZE), 140f }, }, new List<Vector3>() { new Vector3(shipBase.HALF_OF_FIRINGARC_SIZE, 0, 0), new Vector3(shipBase.HALF_OF_SHIPSTAND_SIZE, 0, 0), new Vector3(shipBase.HALF_OF_SHIPSTAND_SIZE, 0, -shipBase.SHIPSTAND_SIZE), new Vector3(shipBase.HALF_OF_FIRINGARC_SIZE, 0, -shipBase.SHIPSTAND_SIZE), } ), new MobileSubArc ( ArcFacing.Rear, new Dictionary<Vector3, float>() { { new Vector3(-shipBase.HALF_OF_FIRINGARC_SIZE, 0, -shipBase.SHIPSTAND_SIZE), -140f }, { new Vector3( shipBase.HALF_OF_FIRINGARC_SIZE, 0, -shipBase.SHIPSTAND_SIZE), 140f } }, new List<Vector3>() { new Vector3(-shipBase.HALF_OF_FIRINGARC_SIZE, 0, -shipBase.SHIPSTAND_SIZE), new Vector3( shipBase.HALF_OF_FIRINGARC_SIZE, 0, -shipBase.SHIPSTAND_SIZE), } ) }; ActiveMobileSubArc = MobileArcParameters[0]; // Events Host = shipBase.Host; SubscribeToShipSetup(Host); // Pointer ShowMobileArcPointer(); } public void RotateArc(ArcFacing facing) { Facing = facing; MobileArcPointer.localEulerAngles = new Vector3(0f, MobileArcRotationValues[facing], 0f); RuleSets.RuleSet.Instance.RotateMobileFiringArc(facing); } public void ShowMobileArcPointer() { MobileArcPointer = Host.GetShipAllPartsTransform().Find("ShipBase").Find("MobileArcPointer"); MobileArcPointer.gameObject.SetActive(true); } private void SubscribeToShipSetup(GenericShip host) { host.OnShipIsPlaced += AskForMobileFiringArcDirection; } public override void RemoveArc() { ShipBase.Host.OnShipIsPlaced -= AskForMobileFiringArcDirection; base.RemoveArc(); } private void AskForMobileFiringArcDirection(GenericShip host) { host.OnShipIsPlaced -= AskForMobileFiringArcDirection; Triggers.RegisterTrigger(new Trigger() { Name = "Mobile Firing Arc direction", TriggerType = TriggerTypes.OnShipIsPlaced, TriggerOwner = host.Owner.PlayerNo, EventHandler = PerformFreeRotateActionForced }); } private void PerformFreeRotateActionForced(object sender, EventArgs e) { Selection.ThisShip.AskPerformFreeAction( new List<GenericAction>() { new RotateArcAction() }, delegate{ Selection.ThisShip.RemoveAlreadyExecutedAction(typeof(RotateArcAction)); Triggers.FinishTrigger(); }, true); } } }
36.705882
110
0.523601
[ "MIT" ]
MatthewBlanchard/FlyCasual
Assets/Scripts/Model/Ships/GenericShip/Arcs/ArcMobile.cs
6,866
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; using System; /// <summary>Get the Continuous Export configuration for this export id.</summary> /// <remarks> /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}" /// </remarks> [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsContinuousExport_Get")] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get the Continuous Export configuration for this export id.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] public partial class GetAzApplicationInsightsContinuousExport_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener { /// <summary>A unique id generatd for the this cmdlet when it is instantiated.</summary> private string __correlationId = System.Guid.NewGuid().ToString(); /// <summary>A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet)</summary> private global::System.Management.Automation.InvocationInfo __invocationInfo; /// <summary>A unique id generatd for the this cmdlet when ProcessRecord() is called.</summary> private string __processRecordId; /// <summary> /// The <see cref="global::System.Threading.CancellationTokenSource" /> for this operation. /// </summary> private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); /// <summary>Wait for .NET debugger to attach</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } /// <summary>The reference to the client API class.</summary> public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; /// <summary> /// The credentials, account, tenant, and subscription used for communication with Azure /// </summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } /// <summary>Backing field for <see cref="ExportId" /> property.</summary> private string _exportId; /// <summary> /// The Continuous Export configuration ID. This is unique within a Application Insights component. /// </summary> [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Continuous Export configuration ID. This is unique within a Application Insights component.")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, Description = @"The Continuous Export configuration ID. This is unique within a Application Insights component.", SerializedName = @"exportId", PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] public string ExportId { get => this._exportId; set => this._exportId = value; } /// <summary>SendAsync Pipeline Steps to be appended to the front of the pipeline</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } /// <summary>SendAsync Pipeline Steps to be prepended to the front of the pipeline</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } /// <summary>Accessor for our copy of the InvocationInfo.</summary> public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } /// <summary> /// <see cref="Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener" /> cancellation delegate. Stops the cmdlet when called. /// </summary> global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; /// <summary><see cref="Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener" /> cancellation token.</summary> global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// <summary>Backing field for <see cref="Name" /> property.</summary> private string _name; /// <summary>The name of the Application Insights component resource.</summary> [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, Description = @"The name of the Application Insights component resource.", SerializedName = @"resourceName", PossibleTypes = new [] { typeof(string) })] [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] public string Name { get => this._name; set => this._name = value; } /// <summary> /// The instance of the <see cref="Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline" /> that the remote call will use. /// </summary> private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } /// <summary>The URI for the proxy server to use</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] public global::System.Uri Proxy { get; set; } /// <summary>Credentials for a proxy server to use for the remote call</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] [global::System.Management.Automation.ValidateNotNull] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } /// <summary>Use the default credentials for the proxy</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } /// <summary>Backing field for <see cref="ResourceGroupName" /> property.</summary> private string _resourceGroupName; /// <summary>The name of the resource group. The name is case insensitive.</summary> [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, Description = @"The name of the resource group. The name is case insensitive.", SerializedName = @"resourceGroupName", PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } /// <summary>Backing field for <see cref="SubscriptionId" /> property.</summary> private string[] _subscriptionId; /// <summary>The ID of the target subscription.</summary> [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, Description = @"The ID of the target subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", Script = @"(Get-AzContext).Subscription.Id")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } /// <summary> /// <c>overrideOnOk</c> will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration">Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration</see> /// from the remote call</param> /// <param name="returnNow">/// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing )</param> partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration> response, ref global::System.Threading.Tasks.Task<bool> returnNow); /// <summary> /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) /// </summary> protected override void BeginProcessing() { var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); if (telemetryId != "" && telemetryId != "internal") { __correlationId = telemetryId; } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); } ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } /// <summary>Performs clean-up after the command execution</summary> protected override void EndProcessing() { } /// <summary> /// Intializes a new instance of the <see cref="GetAzApplicationInsightsContinuousExport_Get" /> cmdlet class. /// </summary> public GetAzApplicationInsightsContinuousExport_Get() { } /// <summary>Handles/Dispatches events during the call to the REST service.</summary> /// <param name="id">The message id</param> /// <param name="token">The message cancellation token. When this call is cancelled, this should be <c>true</c></param> /// <param name="messageData">Detailed message data for the message event.</param> /// <returns> /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the message is completed. /// </returns> async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func<Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventData> messageData) { using( NoSynchronizationContext ) { if (token.IsCancellationRequested) { return ; } switch ( id ) { case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Verbose: { WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); return ; } case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: { WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); return ; } case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: { var data = messageData(); WriteInformation(data.Message, new string[]{}); return ; } case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: { WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); return ; } case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Error: { WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } } await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; } WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); } } /// <summary>Performs execution of the command.</summary> protected override void ProcessRecord() { ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } __processRecordId = System.Guid.NewGuid().ToString(); try { // work using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) { asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token); } } catch (global::System.AggregateException aggregateException) { // unroll the inner exceptions to get the root cause foreach( var innerException in aggregateException.Flatten().InnerExceptions ) { ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } // Write exception out to error channel. WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); } } catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) { ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } // Write exception out to error channel. WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); } finally { ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordEnd).Wait(); } } /// <summary>Performs execution of the command, working asynchronously if required.</summary> /// <returns> /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed. /// </returns> protected async global::System.Threading.Tasks.Task ProcessRecordAsync() { using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); } if (null != HttpPipelineAppend) { Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); } // get the client instance try { foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await this.Client.ExportConfigurationsGet(ResourceGroupName, SubscriptionId, Name, ExportId, onOk, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) { WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,ExportId=ExportId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); } finally { await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); } } } /// <summary>Interrupts currently running code within the command.</summary> protected override void StopProcessing() { ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); base.StopProcessing(); } /// <summary>a delegate that is called when the remote service returns 200 (OK).</summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration">Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration</see> /// from the remote call</param> /// <returns> /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed. /// </returns> private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration> response) { using( NoSynchronizationContext ) { var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false); overrideOnOk(responseMessage, response, ref _returnNow); // if overrideOnOk has returned true, then return right away. if ((null != _returnNow && await _returnNow)) { return ; } // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration WriteObject((await response)); } } } }
75.106557
507
0.690131
[ "MIT" ]
AlanFlorance/azure-powershell
src/ApplicationInsights/generated/cmdlets/GetAzApplicationInsightsContinuousExport_Get.cs
27,124
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the workspaces-2015-04-08.normal.json service model. */ using System; using System.Collections.Generic; using Amazon.Runtime; using Amazon.WorkSpaces.Model; namespace Amazon.WorkSpaces { /// <summary> /// Interface for accessing WorkSpaces /// /// Amazon WorkSpaces Service /// <para> /// Amazon WorkSpaces enables you to provision virtual, cloud-based Microsoft Windows /// and Amazon Linux desktops for your users. /// </para> /// </summary> public partial interface IAmazonWorkSpaces : IAmazonService, IDisposable { #if BCL45 || AWS_ASYNC_ENUMERABLES_API /// <summary> /// Paginators for the service /// </summary> IWorkSpacesPaginatorFactory Paginators { get; } #endif #region AssociateConnectionAlias /// <summary> /// Associates the specified connection alias with the specified directory to enable cross-Region /// redirection. For more information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/cross-region-redirection.html"> /// Cross-Region Redirection for Amazon WorkSpaces</a>. /// /// <note> /// <para> /// Before performing this operation, call <a href="https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeConnectionAliases.html"> /// DescribeConnectionAliases</a> to make sure that the current state of the connection /// alias is <code>CREATED</code>. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the AssociateConnectionAlias service method.</param> /// /// <returns>The response from the AssociateConnectionAlias service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidResourceStateException"> /// The state of the resource is not valid for this operation. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.OperationNotSupportedException"> /// This operation is not supported. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceAssociatedException"> /// The resource is associated with a directory. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/AssociateConnectionAlias">REST API Reference for AssociateConnectionAlias Operation</seealso> AssociateConnectionAliasResponse AssociateConnectionAlias(AssociateConnectionAliasRequest request); /// <summary> /// Initiates the asynchronous execution of the AssociateConnectionAlias operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AssociateConnectionAlias operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAssociateConnectionAlias /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/AssociateConnectionAlias">REST API Reference for AssociateConnectionAlias Operation</seealso> IAsyncResult BeginAssociateConnectionAlias(AssociateConnectionAliasRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the AssociateConnectionAlias operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginAssociateConnectionAlias.</param> /// /// <returns>Returns a AssociateConnectionAliasResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/AssociateConnectionAlias">REST API Reference for AssociateConnectionAlias Operation</seealso> AssociateConnectionAliasResponse EndAssociateConnectionAlias(IAsyncResult asyncResult); #endregion #region AssociateIpGroups /// <summary> /// Associates the specified IP access control group with the specified directory. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AssociateIpGroups service method.</param> /// /// <returns>The response from the AssociateIpGroups service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidResourceStateException"> /// The state of the resource is not valid for this operation. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.OperationNotSupportedException"> /// This operation is not supported. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceLimitExceededException"> /// Your resource limits have been exceeded. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/AssociateIpGroups">REST API Reference for AssociateIpGroups Operation</seealso> AssociateIpGroupsResponse AssociateIpGroups(AssociateIpGroupsRequest request); /// <summary> /// Initiates the asynchronous execution of the AssociateIpGroups operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AssociateIpGroups operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAssociateIpGroups /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/AssociateIpGroups">REST API Reference for AssociateIpGroups Operation</seealso> IAsyncResult BeginAssociateIpGroups(AssociateIpGroupsRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the AssociateIpGroups operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginAssociateIpGroups.</param> /// /// <returns>Returns a AssociateIpGroupsResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/AssociateIpGroups">REST API Reference for AssociateIpGroups Operation</seealso> AssociateIpGroupsResponse EndAssociateIpGroups(IAsyncResult asyncResult); #endregion #region AuthorizeIpRules /// <summary> /// Adds one or more rules to the specified IP access control group. /// /// /// <para> /// This action gives users permission to access their WorkSpaces from the CIDR address /// ranges specified in the rules. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the AuthorizeIpRules service method.</param> /// /// <returns>The response from the AuthorizeIpRules service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidResourceStateException"> /// The state of the resource is not valid for this operation. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceLimitExceededException"> /// Your resource limits have been exceeded. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/AuthorizeIpRules">REST API Reference for AuthorizeIpRules Operation</seealso> AuthorizeIpRulesResponse AuthorizeIpRules(AuthorizeIpRulesRequest request); /// <summary> /// Initiates the asynchronous execution of the AuthorizeIpRules operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AuthorizeIpRules operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAuthorizeIpRules /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/AuthorizeIpRules">REST API Reference for AuthorizeIpRules Operation</seealso> IAsyncResult BeginAuthorizeIpRules(AuthorizeIpRulesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the AuthorizeIpRules operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginAuthorizeIpRules.</param> /// /// <returns>Returns a AuthorizeIpRulesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/AuthorizeIpRules">REST API Reference for AuthorizeIpRules Operation</seealso> AuthorizeIpRulesResponse EndAuthorizeIpRules(IAsyncResult asyncResult); #endregion #region CopyWorkspaceImage /// <summary> /// Copies the specified image from the specified Region to the current Region. For more /// information about copying images, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/copy-custom-image.html"> /// Copy a Custom WorkSpaces Image</a>. /// /// <note> /// <para> /// In the China (Ningxia) Region, you can copy images only within the same Region. /// </para> /// /// <para> /// In the AWS GovCloud (US-West) Region, to copy images to and from other AWS Regions, /// contact AWS Support. /// </para> /// </note> <important> /// <para> /// Before copying a shared image, be sure to verify that it has been shared from the /// correct AWS account. To determine if an image has been shared and to see the AWS account /// ID that owns an image, use the <a href="https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeWorkspaceImages.html">DescribeWorkSpaceImages</a> /// and <a href="https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeWorkspaceImagePermissions.html">DescribeWorkspaceImagePermissions</a> /// API operations. /// </para> /// </important> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CopyWorkspaceImage service method.</param> /// /// <returns>The response from the CopyWorkspaceImage service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.OperationNotSupportedException"> /// This operation is not supported. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceAlreadyExistsException"> /// The specified resource already exists. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceLimitExceededException"> /// Your resource limits have been exceeded. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceUnavailableException"> /// The specified resource is not available. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CopyWorkspaceImage">REST API Reference for CopyWorkspaceImage Operation</seealso> CopyWorkspaceImageResponse CopyWorkspaceImage(CopyWorkspaceImageRequest request); /// <summary> /// Initiates the asynchronous execution of the CopyWorkspaceImage operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CopyWorkspaceImage operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCopyWorkspaceImage /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CopyWorkspaceImage">REST API Reference for CopyWorkspaceImage Operation</seealso> IAsyncResult BeginCopyWorkspaceImage(CopyWorkspaceImageRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the CopyWorkspaceImage operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginCopyWorkspaceImage.</param> /// /// <returns>Returns a CopyWorkspaceImageResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CopyWorkspaceImage">REST API Reference for CopyWorkspaceImage Operation</seealso> CopyWorkspaceImageResponse EndCopyWorkspaceImage(IAsyncResult asyncResult); #endregion #region CreateConnectionAlias /// <summary> /// Creates the specified connection alias for use with cross-Region redirection. For /// more information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/cross-region-redirection.html"> /// Cross-Region Redirection for Amazon WorkSpaces</a>. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateConnectionAlias service method.</param> /// /// <returns>The response from the CreateConnectionAlias service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidResourceStateException"> /// The state of the resource is not valid for this operation. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.OperationNotSupportedException"> /// This operation is not supported. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceAlreadyExistsException"> /// The specified resource already exists. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceLimitExceededException"> /// Your resource limits have been exceeded. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CreateConnectionAlias">REST API Reference for CreateConnectionAlias Operation</seealso> CreateConnectionAliasResponse CreateConnectionAlias(CreateConnectionAliasRequest request); /// <summary> /// Initiates the asynchronous execution of the CreateConnectionAlias operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateConnectionAlias operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateConnectionAlias /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CreateConnectionAlias">REST API Reference for CreateConnectionAlias Operation</seealso> IAsyncResult BeginCreateConnectionAlias(CreateConnectionAliasRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the CreateConnectionAlias operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateConnectionAlias.</param> /// /// <returns>Returns a CreateConnectionAliasResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CreateConnectionAlias">REST API Reference for CreateConnectionAlias Operation</seealso> CreateConnectionAliasResponse EndCreateConnectionAlias(IAsyncResult asyncResult); #endregion #region CreateIpGroup /// <summary> /// Creates an IP access control group. /// /// /// <para> /// An IP access control group provides you with the ability to control the IP addresses /// from which users are allowed to access their WorkSpaces. To specify the CIDR address /// ranges, add rules to your IP access control group and then associate the group with /// your directory. You can add rules when you create the group or at any time using <a>AuthorizeIpRules</a>. /// </para> /// /// <para> /// There is a default IP access control group associated with your directory. If you /// don't associate an IP access control group with your directory, the default group /// is used. The default group includes a default rule that allows users to access their /// WorkSpaces from anywhere. You cannot modify the default IP access control group for /// your directory. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateIpGroup service method.</param> /// /// <returns>The response from the CreateIpGroup service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceAlreadyExistsException"> /// The specified resource already exists. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceCreationFailedException"> /// The resource could not be created. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceLimitExceededException"> /// Your resource limits have been exceeded. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CreateIpGroup">REST API Reference for CreateIpGroup Operation</seealso> CreateIpGroupResponse CreateIpGroup(CreateIpGroupRequest request); /// <summary> /// Initiates the asynchronous execution of the CreateIpGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateIpGroup operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateIpGroup /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CreateIpGroup">REST API Reference for CreateIpGroup Operation</seealso> IAsyncResult BeginCreateIpGroup(CreateIpGroupRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the CreateIpGroup operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateIpGroup.</param> /// /// <returns>Returns a CreateIpGroupResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CreateIpGroup">REST API Reference for CreateIpGroup Operation</seealso> CreateIpGroupResponse EndCreateIpGroup(IAsyncResult asyncResult); #endregion #region CreateTags /// <summary> /// Creates the specified tags for the specified WorkSpaces resource. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateTags service method.</param> /// /// <returns>The response from the CreateTags service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceLimitExceededException"> /// Your resource limits have been exceeded. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CreateTags">REST API Reference for CreateTags Operation</seealso> CreateTagsResponse CreateTags(CreateTagsRequest request); /// <summary> /// Initiates the asynchronous execution of the CreateTags operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateTags operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateTags /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CreateTags">REST API Reference for CreateTags Operation</seealso> IAsyncResult BeginCreateTags(CreateTagsRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the CreateTags operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateTags.</param> /// /// <returns>Returns a CreateTagsResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CreateTags">REST API Reference for CreateTags Operation</seealso> CreateTagsResponse EndCreateTags(IAsyncResult asyncResult); #endregion #region CreateWorkspaces /// <summary> /// Creates one or more WorkSpaces. /// /// /// <para> /// This operation is asynchronous and returns before the WorkSpaces are created. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateWorkspaces service method.</param> /// /// <returns>The response from the CreateWorkspaces service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceLimitExceededException"> /// Your resource limits have been exceeded. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CreateWorkspaces">REST API Reference for CreateWorkspaces Operation</seealso> CreateWorkspacesResponse CreateWorkspaces(CreateWorkspacesRequest request); /// <summary> /// Initiates the asynchronous execution of the CreateWorkspaces operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateWorkspaces operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateWorkspaces /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CreateWorkspaces">REST API Reference for CreateWorkspaces Operation</seealso> IAsyncResult BeginCreateWorkspaces(CreateWorkspacesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the CreateWorkspaces operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateWorkspaces.</param> /// /// <returns>Returns a CreateWorkspacesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CreateWorkspaces">REST API Reference for CreateWorkspaces Operation</seealso> CreateWorkspacesResponse EndCreateWorkspaces(IAsyncResult asyncResult); #endregion #region DeleteConnectionAlias /// <summary> /// Deletes the specified connection alias. For more information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/cross-region-redirection.html"> /// Cross-Region Redirection for Amazon WorkSpaces</a>. /// /// <important> /// <para> /// <b>If you will no longer be using a fully qualified domain name (FQDN) as the registration /// code for your WorkSpaces users, you must take certain precautions to prevent potential /// security issues.</b> For more information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/cross-region-redirection.html#cross-region-redirection-security-considerations"> /// Security Considerations if You Stop Using Cross-Region Redirection</a>. /// </para> /// </important> <note> /// <para> /// To delete a connection alias that has been shared, the shared account must first disassociate /// the connection alias from any directories it has been associated with. Then you must /// unshare the connection alias from the account it has been shared with. You can delete /// a connection alias only after it is no longer shared with any accounts or associated /// with any directories. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteConnectionAlias service method.</param> /// /// <returns>The response from the DeleteConnectionAlias service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidResourceStateException"> /// The state of the resource is not valid for this operation. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.OperationNotSupportedException"> /// This operation is not supported. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceAssociatedException"> /// The resource is associated with a directory. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeleteConnectionAlias">REST API Reference for DeleteConnectionAlias Operation</seealso> DeleteConnectionAliasResponse DeleteConnectionAlias(DeleteConnectionAliasRequest request); /// <summary> /// Initiates the asynchronous execution of the DeleteConnectionAlias operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteConnectionAlias operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteConnectionAlias /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeleteConnectionAlias">REST API Reference for DeleteConnectionAlias Operation</seealso> IAsyncResult BeginDeleteConnectionAlias(DeleteConnectionAliasRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DeleteConnectionAlias operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteConnectionAlias.</param> /// /// <returns>Returns a DeleteConnectionAliasResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeleteConnectionAlias">REST API Reference for DeleteConnectionAlias Operation</seealso> DeleteConnectionAliasResponse EndDeleteConnectionAlias(IAsyncResult asyncResult); #endregion #region DeleteIpGroup /// <summary> /// Deletes the specified IP access control group. /// /// /// <para> /// You cannot delete an IP access control group that is associated with a directory. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteIpGroup service method.</param> /// /// <returns>The response from the DeleteIpGroup service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceAssociatedException"> /// The resource is associated with a directory. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeleteIpGroup">REST API Reference for DeleteIpGroup Operation</seealso> DeleteIpGroupResponse DeleteIpGroup(DeleteIpGroupRequest request); /// <summary> /// Initiates the asynchronous execution of the DeleteIpGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteIpGroup operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteIpGroup /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeleteIpGroup">REST API Reference for DeleteIpGroup Operation</seealso> IAsyncResult BeginDeleteIpGroup(DeleteIpGroupRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DeleteIpGroup operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteIpGroup.</param> /// /// <returns>Returns a DeleteIpGroupResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeleteIpGroup">REST API Reference for DeleteIpGroup Operation</seealso> DeleteIpGroupResponse EndDeleteIpGroup(IAsyncResult asyncResult); #endregion #region DeleteTags /// <summary> /// Deletes the specified tags from the specified WorkSpaces resource. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteTags service method.</param> /// /// <returns>The response from the DeleteTags service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeleteTags">REST API Reference for DeleteTags Operation</seealso> DeleteTagsResponse DeleteTags(DeleteTagsRequest request); /// <summary> /// Initiates the asynchronous execution of the DeleteTags operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteTags operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteTags /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeleteTags">REST API Reference for DeleteTags Operation</seealso> IAsyncResult BeginDeleteTags(DeleteTagsRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DeleteTags operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteTags.</param> /// /// <returns>Returns a DeleteTagsResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeleteTags">REST API Reference for DeleteTags Operation</seealso> DeleteTagsResponse EndDeleteTags(IAsyncResult asyncResult); #endregion #region DeleteWorkspaceImage /// <summary> /// Deletes the specified image from your account. To delete an image, you must first /// delete any bundles that are associated with the image and unshare the image if it /// is shared with other accounts. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteWorkspaceImage service method.</param> /// /// <returns>The response from the DeleteWorkspaceImage service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidResourceStateException"> /// The state of the resource is not valid for this operation. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceAssociatedException"> /// The resource is associated with a directory. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeleteWorkspaceImage">REST API Reference for DeleteWorkspaceImage Operation</seealso> DeleteWorkspaceImageResponse DeleteWorkspaceImage(DeleteWorkspaceImageRequest request); /// <summary> /// Initiates the asynchronous execution of the DeleteWorkspaceImage operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteWorkspaceImage operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteWorkspaceImage /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeleteWorkspaceImage">REST API Reference for DeleteWorkspaceImage Operation</seealso> IAsyncResult BeginDeleteWorkspaceImage(DeleteWorkspaceImageRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DeleteWorkspaceImage operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteWorkspaceImage.</param> /// /// <returns>Returns a DeleteWorkspaceImageResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeleteWorkspaceImage">REST API Reference for DeleteWorkspaceImage Operation</seealso> DeleteWorkspaceImageResponse EndDeleteWorkspaceImage(IAsyncResult asyncResult); #endregion #region DeregisterWorkspaceDirectory /// <summary> /// Deregisters the specified directory. This operation is asynchronous and returns before /// the WorkSpace directory is deregistered. If any WorkSpaces are registered to this /// directory, you must remove them before you can deregister the directory. /// /// <note> /// <para> /// Simple AD and AD Connector are made available to you free of charge to use with WorkSpaces. /// If there are no WorkSpaces being used with your Simple AD or AD Connector directory /// for 30 consecutive days, this directory will be automatically deregistered for use /// with Amazon WorkSpaces, and you will be charged for this directory as per the <a href="http://aws.amazon.com/directoryservice/pricing/">AWS /// Directory Services pricing terms</a>. /// </para> /// /// <para> /// To delete empty directories, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/delete-workspaces-directory.html"> /// Delete the Directory for Your WorkSpaces</a>. If you delete your Simple AD or AD Connector /// directory, you can always create a new one when you want to start using WorkSpaces /// again. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeregisterWorkspaceDirectory service method.</param> /// /// <returns>The response from the DeregisterWorkspaceDirectory service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidResourceStateException"> /// The state of the resource is not valid for this operation. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.OperationNotSupportedException"> /// This operation is not supported. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeregisterWorkspaceDirectory">REST API Reference for DeregisterWorkspaceDirectory Operation</seealso> DeregisterWorkspaceDirectoryResponse DeregisterWorkspaceDirectory(DeregisterWorkspaceDirectoryRequest request); /// <summary> /// Initiates the asynchronous execution of the DeregisterWorkspaceDirectory operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeregisterWorkspaceDirectory operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeregisterWorkspaceDirectory /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeregisterWorkspaceDirectory">REST API Reference for DeregisterWorkspaceDirectory Operation</seealso> IAsyncResult BeginDeregisterWorkspaceDirectory(DeregisterWorkspaceDirectoryRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DeregisterWorkspaceDirectory operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeregisterWorkspaceDirectory.</param> /// /// <returns>Returns a DeregisterWorkspaceDirectoryResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeregisterWorkspaceDirectory">REST API Reference for DeregisterWorkspaceDirectory Operation</seealso> DeregisterWorkspaceDirectoryResponse EndDeregisterWorkspaceDirectory(IAsyncResult asyncResult); #endregion #region DescribeAccount /// <summary> /// Retrieves a list that describes the configuration of Bring Your Own License (BYOL) /// for the specified account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeAccount service method.</param> /// /// <returns>The response from the DescribeAccount service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeAccount">REST API Reference for DescribeAccount Operation</seealso> DescribeAccountResponse DescribeAccount(DescribeAccountRequest request); /// <summary> /// Initiates the asynchronous execution of the DescribeAccount operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeAccount operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeAccount /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeAccount">REST API Reference for DescribeAccount Operation</seealso> IAsyncResult BeginDescribeAccount(DescribeAccountRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DescribeAccount operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeAccount.</param> /// /// <returns>Returns a DescribeAccountResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeAccount">REST API Reference for DescribeAccount Operation</seealso> DescribeAccountResponse EndDescribeAccount(IAsyncResult asyncResult); #endregion #region DescribeAccountModifications /// <summary> /// Retrieves a list that describes modifications to the configuration of Bring Your Own /// License (BYOL) for the specified account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeAccountModifications service method.</param> /// /// <returns>The response from the DescribeAccountModifications service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeAccountModifications">REST API Reference for DescribeAccountModifications Operation</seealso> DescribeAccountModificationsResponse DescribeAccountModifications(DescribeAccountModificationsRequest request); /// <summary> /// Initiates the asynchronous execution of the DescribeAccountModifications operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeAccountModifications operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeAccountModifications /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeAccountModifications">REST API Reference for DescribeAccountModifications Operation</seealso> IAsyncResult BeginDescribeAccountModifications(DescribeAccountModificationsRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DescribeAccountModifications operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeAccountModifications.</param> /// /// <returns>Returns a DescribeAccountModificationsResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeAccountModifications">REST API Reference for DescribeAccountModifications Operation</seealso> DescribeAccountModificationsResponse EndDescribeAccountModifications(IAsyncResult asyncResult); #endregion #region DescribeClientProperties /// <summary> /// Retrieves a list that describes one or more specified Amazon WorkSpaces clients. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeClientProperties service method.</param> /// /// <returns>The response from the DescribeClientProperties service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeClientProperties">REST API Reference for DescribeClientProperties Operation</seealso> DescribeClientPropertiesResponse DescribeClientProperties(DescribeClientPropertiesRequest request); /// <summary> /// Initiates the asynchronous execution of the DescribeClientProperties operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeClientProperties operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeClientProperties /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeClientProperties">REST API Reference for DescribeClientProperties Operation</seealso> IAsyncResult BeginDescribeClientProperties(DescribeClientPropertiesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DescribeClientProperties operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeClientProperties.</param> /// /// <returns>Returns a DescribeClientPropertiesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeClientProperties">REST API Reference for DescribeClientProperties Operation</seealso> DescribeClientPropertiesResponse EndDescribeClientProperties(IAsyncResult asyncResult); #endregion #region DescribeConnectionAliases /// <summary> /// Retrieves a list that describes the connection aliases used for cross-Region redirection. /// For more information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/cross-region-redirection.html"> /// Cross-Region Redirection for Amazon WorkSpaces</a>. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeConnectionAliases service method.</param> /// /// <returns>The response from the DescribeConnectionAliases service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.OperationNotSupportedException"> /// This operation is not supported. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeConnectionAliases">REST API Reference for DescribeConnectionAliases Operation</seealso> DescribeConnectionAliasesResponse DescribeConnectionAliases(DescribeConnectionAliasesRequest request); /// <summary> /// Initiates the asynchronous execution of the DescribeConnectionAliases operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeConnectionAliases operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeConnectionAliases /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeConnectionAliases">REST API Reference for DescribeConnectionAliases Operation</seealso> IAsyncResult BeginDescribeConnectionAliases(DescribeConnectionAliasesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DescribeConnectionAliases operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeConnectionAliases.</param> /// /// <returns>Returns a DescribeConnectionAliasesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeConnectionAliases">REST API Reference for DescribeConnectionAliases Operation</seealso> DescribeConnectionAliasesResponse EndDescribeConnectionAliases(IAsyncResult asyncResult); #endregion #region DescribeConnectionAliasPermissions /// <summary> /// Describes the permissions that the owner of a connection alias has granted to another /// AWS account for the specified connection alias. For more information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/cross-region-redirection.html"> /// Cross-Region Redirection for Amazon WorkSpaces</a>. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeConnectionAliasPermissions service method.</param> /// /// <returns>The response from the DescribeConnectionAliasPermissions service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.OperationNotSupportedException"> /// This operation is not supported. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeConnectionAliasPermissions">REST API Reference for DescribeConnectionAliasPermissions Operation</seealso> DescribeConnectionAliasPermissionsResponse DescribeConnectionAliasPermissions(DescribeConnectionAliasPermissionsRequest request); /// <summary> /// Initiates the asynchronous execution of the DescribeConnectionAliasPermissions operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeConnectionAliasPermissions operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeConnectionAliasPermissions /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeConnectionAliasPermissions">REST API Reference for DescribeConnectionAliasPermissions Operation</seealso> IAsyncResult BeginDescribeConnectionAliasPermissions(DescribeConnectionAliasPermissionsRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DescribeConnectionAliasPermissions operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeConnectionAliasPermissions.</param> /// /// <returns>Returns a DescribeConnectionAliasPermissionsResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeConnectionAliasPermissions">REST API Reference for DescribeConnectionAliasPermissions Operation</seealso> DescribeConnectionAliasPermissionsResponse EndDescribeConnectionAliasPermissions(IAsyncResult asyncResult); #endregion #region DescribeIpGroups /// <summary> /// Describes one or more of your IP access control groups. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeIpGroups service method.</param> /// /// <returns>The response from the DescribeIpGroups service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeIpGroups">REST API Reference for DescribeIpGroups Operation</seealso> DescribeIpGroupsResponse DescribeIpGroups(DescribeIpGroupsRequest request); /// <summary> /// Initiates the asynchronous execution of the DescribeIpGroups operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeIpGroups operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeIpGroups /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeIpGroups">REST API Reference for DescribeIpGroups Operation</seealso> IAsyncResult BeginDescribeIpGroups(DescribeIpGroupsRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DescribeIpGroups operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeIpGroups.</param> /// /// <returns>Returns a DescribeIpGroupsResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeIpGroups">REST API Reference for DescribeIpGroups Operation</seealso> DescribeIpGroupsResponse EndDescribeIpGroups(IAsyncResult asyncResult); #endregion #region DescribeTags /// <summary> /// Describes the specified tags for the specified WorkSpaces resource. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeTags service method.</param> /// /// <returns>The response from the DescribeTags service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeTags">REST API Reference for DescribeTags Operation</seealso> DescribeTagsResponse DescribeTags(DescribeTagsRequest request); /// <summary> /// Initiates the asynchronous execution of the DescribeTags operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeTags operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeTags /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeTags">REST API Reference for DescribeTags Operation</seealso> IAsyncResult BeginDescribeTags(DescribeTagsRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DescribeTags operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeTags.</param> /// /// <returns>Returns a DescribeTagsResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeTags">REST API Reference for DescribeTags Operation</seealso> DescribeTagsResponse EndDescribeTags(IAsyncResult asyncResult); #endregion #region DescribeWorkspaceBundles /// <summary> /// Retrieves a list that describes the available WorkSpace bundles. /// /// /// <para> /// You can filter the results using either bundle ID or owner, but not both. /// </para> /// </summary> /// /// <returns>The response from the DescribeWorkspaceBundles service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceBundles">REST API Reference for DescribeWorkspaceBundles Operation</seealso> DescribeWorkspaceBundlesResponse DescribeWorkspaceBundles(); /// <summary> /// Retrieves a list that describes the available WorkSpace bundles. /// /// /// <para> /// You can filter the results using either bundle ID or owner, but not both. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeWorkspaceBundles service method.</param> /// /// <returns>The response from the DescribeWorkspaceBundles service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceBundles">REST API Reference for DescribeWorkspaceBundles Operation</seealso> DescribeWorkspaceBundlesResponse DescribeWorkspaceBundles(DescribeWorkspaceBundlesRequest request); /// <summary> /// Initiates the asynchronous execution of the DescribeWorkspaceBundles operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeWorkspaceBundles operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeWorkspaceBundles /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceBundles">REST API Reference for DescribeWorkspaceBundles Operation</seealso> IAsyncResult BeginDescribeWorkspaceBundles(DescribeWorkspaceBundlesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DescribeWorkspaceBundles operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeWorkspaceBundles.</param> /// /// <returns>Returns a DescribeWorkspaceBundlesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceBundles">REST API Reference for DescribeWorkspaceBundles Operation</seealso> DescribeWorkspaceBundlesResponse EndDescribeWorkspaceBundles(IAsyncResult asyncResult); #endregion #region DescribeWorkspaceDirectories /// <summary> /// Describes the available directories that are registered with Amazon WorkSpaces. /// </summary> /// /// <returns>The response from the DescribeWorkspaceDirectories service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceDirectories">REST API Reference for DescribeWorkspaceDirectories Operation</seealso> DescribeWorkspaceDirectoriesResponse DescribeWorkspaceDirectories(); /// <summary> /// Describes the available directories that are registered with Amazon WorkSpaces. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeWorkspaceDirectories service method.</param> /// /// <returns>The response from the DescribeWorkspaceDirectories service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceDirectories">REST API Reference for DescribeWorkspaceDirectories Operation</seealso> DescribeWorkspaceDirectoriesResponse DescribeWorkspaceDirectories(DescribeWorkspaceDirectoriesRequest request); /// <summary> /// Initiates the asynchronous execution of the DescribeWorkspaceDirectories operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeWorkspaceDirectories operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeWorkspaceDirectories /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceDirectories">REST API Reference for DescribeWorkspaceDirectories Operation</seealso> IAsyncResult BeginDescribeWorkspaceDirectories(DescribeWorkspaceDirectoriesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DescribeWorkspaceDirectories operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeWorkspaceDirectories.</param> /// /// <returns>Returns a DescribeWorkspaceDirectoriesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceDirectories">REST API Reference for DescribeWorkspaceDirectories Operation</seealso> DescribeWorkspaceDirectoriesResponse EndDescribeWorkspaceDirectories(IAsyncResult asyncResult); #endregion #region DescribeWorkspaceImagePermissions /// <summary> /// Describes the permissions that the owner of an image has granted to other AWS accounts /// for an image. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeWorkspaceImagePermissions service method.</param> /// /// <returns>The response from the DescribeWorkspaceImagePermissions service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceImagePermissions">REST API Reference for DescribeWorkspaceImagePermissions Operation</seealso> DescribeWorkspaceImagePermissionsResponse DescribeWorkspaceImagePermissions(DescribeWorkspaceImagePermissionsRequest request); /// <summary> /// Initiates the asynchronous execution of the DescribeWorkspaceImagePermissions operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeWorkspaceImagePermissions operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeWorkspaceImagePermissions /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceImagePermissions">REST API Reference for DescribeWorkspaceImagePermissions Operation</seealso> IAsyncResult BeginDescribeWorkspaceImagePermissions(DescribeWorkspaceImagePermissionsRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DescribeWorkspaceImagePermissions operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeWorkspaceImagePermissions.</param> /// /// <returns>Returns a DescribeWorkspaceImagePermissionsResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceImagePermissions">REST API Reference for DescribeWorkspaceImagePermissions Operation</seealso> DescribeWorkspaceImagePermissionsResponse EndDescribeWorkspaceImagePermissions(IAsyncResult asyncResult); #endregion #region DescribeWorkspaceImages /// <summary> /// Retrieves a list that describes one or more specified images, if the image identifiers /// are provided. Otherwise, all images in the account are described. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeWorkspaceImages service method.</param> /// /// <returns>The response from the DescribeWorkspaceImages service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceImages">REST API Reference for DescribeWorkspaceImages Operation</seealso> DescribeWorkspaceImagesResponse DescribeWorkspaceImages(DescribeWorkspaceImagesRequest request); /// <summary> /// Initiates the asynchronous execution of the DescribeWorkspaceImages operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeWorkspaceImages operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeWorkspaceImages /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceImages">REST API Reference for DescribeWorkspaceImages Operation</seealso> IAsyncResult BeginDescribeWorkspaceImages(DescribeWorkspaceImagesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DescribeWorkspaceImages operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeWorkspaceImages.</param> /// /// <returns>Returns a DescribeWorkspaceImagesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceImages">REST API Reference for DescribeWorkspaceImages Operation</seealso> DescribeWorkspaceImagesResponse EndDescribeWorkspaceImages(IAsyncResult asyncResult); #endregion #region DescribeWorkspaces /// <summary> /// Describes the specified WorkSpaces. /// /// /// <para> /// You can filter the results by using the bundle identifier, directory identifier, or /// owner, but you can specify only one filter at a time. /// </para> /// </summary> /// /// <returns>The response from the DescribeWorkspaces service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceUnavailableException"> /// The specified resource is not available. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaces">REST API Reference for DescribeWorkspaces Operation</seealso> DescribeWorkspacesResponse DescribeWorkspaces(); /// <summary> /// Describes the specified WorkSpaces. /// /// /// <para> /// You can filter the results by using the bundle identifier, directory identifier, or /// owner, but you can specify only one filter at a time. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeWorkspaces service method.</param> /// /// <returns>The response from the DescribeWorkspaces service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceUnavailableException"> /// The specified resource is not available. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaces">REST API Reference for DescribeWorkspaces Operation</seealso> DescribeWorkspacesResponse DescribeWorkspaces(DescribeWorkspacesRequest request); /// <summary> /// Initiates the asynchronous execution of the DescribeWorkspaces operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeWorkspaces operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeWorkspaces /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaces">REST API Reference for DescribeWorkspaces Operation</seealso> IAsyncResult BeginDescribeWorkspaces(DescribeWorkspacesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DescribeWorkspaces operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeWorkspaces.</param> /// /// <returns>Returns a DescribeWorkspacesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaces">REST API Reference for DescribeWorkspaces Operation</seealso> DescribeWorkspacesResponse EndDescribeWorkspaces(IAsyncResult asyncResult); #endregion #region DescribeWorkspacesConnectionStatus /// <summary> /// Describes the connection status of the specified WorkSpaces. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeWorkspacesConnectionStatus service method.</param> /// /// <returns>The response from the DescribeWorkspacesConnectionStatus service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspacesConnectionStatus">REST API Reference for DescribeWorkspacesConnectionStatus Operation</seealso> DescribeWorkspacesConnectionStatusResponse DescribeWorkspacesConnectionStatus(DescribeWorkspacesConnectionStatusRequest request); /// <summary> /// Initiates the asynchronous execution of the DescribeWorkspacesConnectionStatus operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeWorkspacesConnectionStatus operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeWorkspacesConnectionStatus /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspacesConnectionStatus">REST API Reference for DescribeWorkspacesConnectionStatus Operation</seealso> IAsyncResult BeginDescribeWorkspacesConnectionStatus(DescribeWorkspacesConnectionStatusRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DescribeWorkspacesConnectionStatus operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeWorkspacesConnectionStatus.</param> /// /// <returns>Returns a DescribeWorkspacesConnectionStatusResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspacesConnectionStatus">REST API Reference for DescribeWorkspacesConnectionStatus Operation</seealso> DescribeWorkspacesConnectionStatusResponse EndDescribeWorkspacesConnectionStatus(IAsyncResult asyncResult); #endregion #region DescribeWorkspaceSnapshots /// <summary> /// Describes the snapshots for the specified WorkSpace. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeWorkspaceSnapshots service method.</param> /// /// <returns>The response from the DescribeWorkspaceSnapshots service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceSnapshots">REST API Reference for DescribeWorkspaceSnapshots Operation</seealso> DescribeWorkspaceSnapshotsResponse DescribeWorkspaceSnapshots(DescribeWorkspaceSnapshotsRequest request); /// <summary> /// Initiates the asynchronous execution of the DescribeWorkspaceSnapshots operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeWorkspaceSnapshots operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeWorkspaceSnapshots /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceSnapshots">REST API Reference for DescribeWorkspaceSnapshots Operation</seealso> IAsyncResult BeginDescribeWorkspaceSnapshots(DescribeWorkspaceSnapshotsRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DescribeWorkspaceSnapshots operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeWorkspaceSnapshots.</param> /// /// <returns>Returns a DescribeWorkspaceSnapshotsResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceSnapshots">REST API Reference for DescribeWorkspaceSnapshots Operation</seealso> DescribeWorkspaceSnapshotsResponse EndDescribeWorkspaceSnapshots(IAsyncResult asyncResult); #endregion #region DisassociateConnectionAlias /// <summary> /// Disassociates a connection alias from a directory. Disassociating a connection alias /// disables cross-Region redirection between two directories in different AWS Regions. /// For more information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/cross-region-redirection.html"> /// Cross-Region Redirection for Amazon WorkSpaces</a>. /// /// <note> /// <para> /// Before performing this operation, call <a href="https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeConnectionAliases.html"> /// DescribeConnectionAliases</a> to make sure that the current state of the connection /// alias is <code>CREATED</code>. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DisassociateConnectionAlias service method.</param> /// /// <returns>The response from the DisassociateConnectionAlias service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidResourceStateException"> /// The state of the resource is not valid for this operation. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.OperationNotSupportedException"> /// This operation is not supported. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DisassociateConnectionAlias">REST API Reference for DisassociateConnectionAlias Operation</seealso> DisassociateConnectionAliasResponse DisassociateConnectionAlias(DisassociateConnectionAliasRequest request); /// <summary> /// Initiates the asynchronous execution of the DisassociateConnectionAlias operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DisassociateConnectionAlias operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDisassociateConnectionAlias /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DisassociateConnectionAlias">REST API Reference for DisassociateConnectionAlias Operation</seealso> IAsyncResult BeginDisassociateConnectionAlias(DisassociateConnectionAliasRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DisassociateConnectionAlias operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDisassociateConnectionAlias.</param> /// /// <returns>Returns a DisassociateConnectionAliasResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DisassociateConnectionAlias">REST API Reference for DisassociateConnectionAlias Operation</seealso> DisassociateConnectionAliasResponse EndDisassociateConnectionAlias(IAsyncResult asyncResult); #endregion #region DisassociateIpGroups /// <summary> /// Disassociates the specified IP access control group from the specified directory. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DisassociateIpGroups service method.</param> /// /// <returns>The response from the DisassociateIpGroups service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidResourceStateException"> /// The state of the resource is not valid for this operation. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DisassociateIpGroups">REST API Reference for DisassociateIpGroups Operation</seealso> DisassociateIpGroupsResponse DisassociateIpGroups(DisassociateIpGroupsRequest request); /// <summary> /// Initiates the asynchronous execution of the DisassociateIpGroups operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DisassociateIpGroups operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDisassociateIpGroups /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DisassociateIpGroups">REST API Reference for DisassociateIpGroups Operation</seealso> IAsyncResult BeginDisassociateIpGroups(DisassociateIpGroupsRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the DisassociateIpGroups operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDisassociateIpGroups.</param> /// /// <returns>Returns a DisassociateIpGroupsResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DisassociateIpGroups">REST API Reference for DisassociateIpGroups Operation</seealso> DisassociateIpGroupsResponse EndDisassociateIpGroups(IAsyncResult asyncResult); #endregion #region ImportWorkspaceImage /// <summary> /// Imports the specified Windows 10 Bring Your Own License (BYOL) image into Amazon WorkSpaces. /// The image must be an already licensed Amazon EC2 image that is in your AWS account, /// and you must own the image. For more information about creating BYOL images, see <a /// href="https://docs.aws.amazon.com/workspaces/latest/adminguide/byol-windows-images.html"> /// Bring Your Own Windows Desktop Licenses</a>. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ImportWorkspaceImage service method.</param> /// /// <returns>The response from the ImportWorkspaceImage service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.OperationNotSupportedException"> /// This operation is not supported. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceAlreadyExistsException"> /// The specified resource already exists. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceLimitExceededException"> /// Your resource limits have been exceeded. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ImportWorkspaceImage">REST API Reference for ImportWorkspaceImage Operation</seealso> ImportWorkspaceImageResponse ImportWorkspaceImage(ImportWorkspaceImageRequest request); /// <summary> /// Initiates the asynchronous execution of the ImportWorkspaceImage operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ImportWorkspaceImage operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndImportWorkspaceImage /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ImportWorkspaceImage">REST API Reference for ImportWorkspaceImage Operation</seealso> IAsyncResult BeginImportWorkspaceImage(ImportWorkspaceImageRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the ImportWorkspaceImage operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginImportWorkspaceImage.</param> /// /// <returns>Returns a ImportWorkspaceImageResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ImportWorkspaceImage">REST API Reference for ImportWorkspaceImage Operation</seealso> ImportWorkspaceImageResponse EndImportWorkspaceImage(IAsyncResult asyncResult); #endregion #region ListAvailableManagementCidrRanges /// <summary> /// Retrieves a list of IP address ranges, specified as IPv4 CIDR blocks, that you can /// use for the network management interface when you enable Bring Your Own License (BYOL). /// /// /// /// <para> /// This operation can be run only by AWS accounts that are enabled for BYOL. If your /// account isn't enabled for BYOL, you'll receive an <code>AccessDeniedException</code> /// error. /// </para> /// /// <para> /// The management network interface is connected to a secure Amazon WorkSpaces management /// network. It is used for interactive streaming of the WorkSpace desktop to Amazon WorkSpaces /// clients, and to allow Amazon WorkSpaces to manage the WorkSpace. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAvailableManagementCidrRanges service method.</param> /// /// <returns>The response from the ListAvailableManagementCidrRanges service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ListAvailableManagementCidrRanges">REST API Reference for ListAvailableManagementCidrRanges Operation</seealso> ListAvailableManagementCidrRangesResponse ListAvailableManagementCidrRanges(ListAvailableManagementCidrRangesRequest request); /// <summary> /// Initiates the asynchronous execution of the ListAvailableManagementCidrRanges operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListAvailableManagementCidrRanges operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListAvailableManagementCidrRanges /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ListAvailableManagementCidrRanges">REST API Reference for ListAvailableManagementCidrRanges Operation</seealso> IAsyncResult BeginListAvailableManagementCidrRanges(ListAvailableManagementCidrRangesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the ListAvailableManagementCidrRanges operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginListAvailableManagementCidrRanges.</param> /// /// <returns>Returns a ListAvailableManagementCidrRangesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ListAvailableManagementCidrRanges">REST API Reference for ListAvailableManagementCidrRanges Operation</seealso> ListAvailableManagementCidrRangesResponse EndListAvailableManagementCidrRanges(IAsyncResult asyncResult); #endregion #region MigrateWorkspace /// <summary> /// Migrates a WorkSpace from one operating system or bundle type to another, while retaining /// the data on the user volume. /// /// /// <para> /// The migration process recreates the WorkSpace by using a new root volume from the /// target bundle image and the user volume from the last available snapshot of the original /// WorkSpace. During migration, the original <code>D:\Users\%USERNAME%</code> user profile /// folder is renamed to <code>D:\Users\%USERNAME%MMddyyTHHmmss%.NotMigrated</code>. A /// new <code>D:\Users\%USERNAME%\</code> folder is generated by the new OS. Certain files /// in the old user profile are moved to the new user profile. /// </para> /// /// <para> /// For available migration scenarios, details about what happens during migration, and /// best practices, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/migrate-workspaces.html">Migrate /// a WorkSpace</a>. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the MigrateWorkspace service method.</param> /// /// <returns>The response from the MigrateWorkspace service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.OperationInProgressException"> /// The properties of this WorkSpace are currently being modified. Try again in a moment. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.OperationNotSupportedException"> /// This operation is not supported. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceUnavailableException"> /// The specified resource is not available. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/MigrateWorkspace">REST API Reference for MigrateWorkspace Operation</seealso> MigrateWorkspaceResponse MigrateWorkspace(MigrateWorkspaceRequest request); /// <summary> /// Initiates the asynchronous execution of the MigrateWorkspace operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the MigrateWorkspace operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndMigrateWorkspace /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/MigrateWorkspace">REST API Reference for MigrateWorkspace Operation</seealso> IAsyncResult BeginMigrateWorkspace(MigrateWorkspaceRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the MigrateWorkspace operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginMigrateWorkspace.</param> /// /// <returns>Returns a MigrateWorkspaceResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/MigrateWorkspace">REST API Reference for MigrateWorkspace Operation</seealso> MigrateWorkspaceResponse EndMigrateWorkspace(IAsyncResult asyncResult); #endregion #region ModifyAccount /// <summary> /// Modifies the configuration of Bring Your Own License (BYOL) for the specified account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ModifyAccount service method.</param> /// /// <returns>The response from the ModifyAccount service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidResourceStateException"> /// The state of the resource is not valid for this operation. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceUnavailableException"> /// The specified resource is not available. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyAccount">REST API Reference for ModifyAccount Operation</seealso> ModifyAccountResponse ModifyAccount(ModifyAccountRequest request); /// <summary> /// Initiates the asynchronous execution of the ModifyAccount operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyAccount operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndModifyAccount /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyAccount">REST API Reference for ModifyAccount Operation</seealso> IAsyncResult BeginModifyAccount(ModifyAccountRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the ModifyAccount operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginModifyAccount.</param> /// /// <returns>Returns a ModifyAccountResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyAccount">REST API Reference for ModifyAccount Operation</seealso> ModifyAccountResponse EndModifyAccount(IAsyncResult asyncResult); #endregion #region ModifyClientProperties /// <summary> /// Modifies the properties of the specified Amazon WorkSpaces clients. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ModifyClientProperties service method.</param> /// /// <returns>The response from the ModifyClientProperties service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyClientProperties">REST API Reference for ModifyClientProperties Operation</seealso> ModifyClientPropertiesResponse ModifyClientProperties(ModifyClientPropertiesRequest request); /// <summary> /// Initiates the asynchronous execution of the ModifyClientProperties operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyClientProperties operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndModifyClientProperties /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyClientProperties">REST API Reference for ModifyClientProperties Operation</seealso> IAsyncResult BeginModifyClientProperties(ModifyClientPropertiesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the ModifyClientProperties operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginModifyClientProperties.</param> /// /// <returns>Returns a ModifyClientPropertiesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyClientProperties">REST API Reference for ModifyClientProperties Operation</seealso> ModifyClientPropertiesResponse EndModifyClientProperties(IAsyncResult asyncResult); #endregion #region ModifySelfservicePermissions /// <summary> /// Modifies the self-service WorkSpace management capabilities for your users. For more /// information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/enable-user-self-service-workspace-management.html">Enable /// Self-Service WorkSpace Management Capabilities for Your Users</a>. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ModifySelfservicePermissions service method.</param> /// /// <returns>The response from the ModifySelfservicePermissions service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifySelfservicePermissions">REST API Reference for ModifySelfservicePermissions Operation</seealso> ModifySelfservicePermissionsResponse ModifySelfservicePermissions(ModifySelfservicePermissionsRequest request); /// <summary> /// Initiates the asynchronous execution of the ModifySelfservicePermissions operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifySelfservicePermissions operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndModifySelfservicePermissions /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifySelfservicePermissions">REST API Reference for ModifySelfservicePermissions Operation</seealso> IAsyncResult BeginModifySelfservicePermissions(ModifySelfservicePermissionsRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the ModifySelfservicePermissions operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginModifySelfservicePermissions.</param> /// /// <returns>Returns a ModifySelfservicePermissionsResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifySelfservicePermissions">REST API Reference for ModifySelfservicePermissions Operation</seealso> ModifySelfservicePermissionsResponse EndModifySelfservicePermissions(IAsyncResult asyncResult); #endregion #region ModifyWorkspaceAccessProperties /// <summary> /// Specifies which devices and operating systems users can use to access their WorkSpaces. /// For more information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/update-directory-details.html#control-device-access"> /// Control Device Access</a>. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ModifyWorkspaceAccessProperties service method.</param> /// /// <returns>The response from the ModifyWorkspaceAccessProperties service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceAccessProperties">REST API Reference for ModifyWorkspaceAccessProperties Operation</seealso> ModifyWorkspaceAccessPropertiesResponse ModifyWorkspaceAccessProperties(ModifyWorkspaceAccessPropertiesRequest request); /// <summary> /// Initiates the asynchronous execution of the ModifyWorkspaceAccessProperties operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyWorkspaceAccessProperties operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndModifyWorkspaceAccessProperties /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceAccessProperties">REST API Reference for ModifyWorkspaceAccessProperties Operation</seealso> IAsyncResult BeginModifyWorkspaceAccessProperties(ModifyWorkspaceAccessPropertiesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the ModifyWorkspaceAccessProperties operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginModifyWorkspaceAccessProperties.</param> /// /// <returns>Returns a ModifyWorkspaceAccessPropertiesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceAccessProperties">REST API Reference for ModifyWorkspaceAccessProperties Operation</seealso> ModifyWorkspaceAccessPropertiesResponse EndModifyWorkspaceAccessProperties(IAsyncResult asyncResult); #endregion #region ModifyWorkspaceCreationProperties /// <summary> /// Modify the default properties used to create WorkSpaces. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ModifyWorkspaceCreationProperties service method.</param> /// /// <returns>The response from the ModifyWorkspaceCreationProperties service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.OperationNotSupportedException"> /// This operation is not supported. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceCreationProperties">REST API Reference for ModifyWorkspaceCreationProperties Operation</seealso> ModifyWorkspaceCreationPropertiesResponse ModifyWorkspaceCreationProperties(ModifyWorkspaceCreationPropertiesRequest request); /// <summary> /// Initiates the asynchronous execution of the ModifyWorkspaceCreationProperties operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyWorkspaceCreationProperties operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndModifyWorkspaceCreationProperties /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceCreationProperties">REST API Reference for ModifyWorkspaceCreationProperties Operation</seealso> IAsyncResult BeginModifyWorkspaceCreationProperties(ModifyWorkspaceCreationPropertiesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the ModifyWorkspaceCreationProperties operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginModifyWorkspaceCreationProperties.</param> /// /// <returns>Returns a ModifyWorkspaceCreationPropertiesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceCreationProperties">REST API Reference for ModifyWorkspaceCreationProperties Operation</seealso> ModifyWorkspaceCreationPropertiesResponse EndModifyWorkspaceCreationProperties(IAsyncResult asyncResult); #endregion #region ModifyWorkspaceProperties /// <summary> /// Modifies the specified WorkSpace properties. For important information about how to /// modify the size of the root and user volumes, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/modify-workspaces.html"> /// Modify a WorkSpace</a>. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ModifyWorkspaceProperties service method.</param> /// /// <returns>The response from the ModifyWorkspaceProperties service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidResourceStateException"> /// The state of the resource is not valid for this operation. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.OperationInProgressException"> /// The properties of this WorkSpace are currently being modified. Try again in a moment. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceUnavailableException"> /// The specified resource is not available. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.UnsupportedWorkspaceConfigurationException"> /// The configuration of this WorkSpace is not supported for this operation. For more /// information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/required-service-components.html">Required /// Configuration and Service Components for WorkSpaces </a>. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceProperties">REST API Reference for ModifyWorkspaceProperties Operation</seealso> ModifyWorkspacePropertiesResponse ModifyWorkspaceProperties(ModifyWorkspacePropertiesRequest request); /// <summary> /// Initiates the asynchronous execution of the ModifyWorkspaceProperties operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyWorkspaceProperties operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndModifyWorkspaceProperties /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceProperties">REST API Reference for ModifyWorkspaceProperties Operation</seealso> IAsyncResult BeginModifyWorkspaceProperties(ModifyWorkspacePropertiesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the ModifyWorkspaceProperties operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginModifyWorkspaceProperties.</param> /// /// <returns>Returns a ModifyWorkspacePropertiesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceProperties">REST API Reference for ModifyWorkspaceProperties Operation</seealso> ModifyWorkspacePropertiesResponse EndModifyWorkspaceProperties(IAsyncResult asyncResult); #endregion #region ModifyWorkspaceState /// <summary> /// Sets the state of the specified WorkSpace. /// /// /// <para> /// To maintain a WorkSpace without being interrupted, set the WorkSpace state to <code>ADMIN_MAINTENANCE</code>. /// WorkSpaces in this state do not respond to requests to reboot, stop, start, rebuild, /// or restore. An AutoStop WorkSpace in this state is not stopped. Users cannot log into /// a WorkSpace in the <code>ADMIN_MAINTENANCE</code> state. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ModifyWorkspaceState service method.</param> /// /// <returns>The response from the ModifyWorkspaceState service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidResourceStateException"> /// The state of the resource is not valid for this operation. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceState">REST API Reference for ModifyWorkspaceState Operation</seealso> ModifyWorkspaceStateResponse ModifyWorkspaceState(ModifyWorkspaceStateRequest request); /// <summary> /// Initiates the asynchronous execution of the ModifyWorkspaceState operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyWorkspaceState operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndModifyWorkspaceState /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceState">REST API Reference for ModifyWorkspaceState Operation</seealso> IAsyncResult BeginModifyWorkspaceState(ModifyWorkspaceStateRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the ModifyWorkspaceState operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginModifyWorkspaceState.</param> /// /// <returns>Returns a ModifyWorkspaceStateResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceState">REST API Reference for ModifyWorkspaceState Operation</seealso> ModifyWorkspaceStateResponse EndModifyWorkspaceState(IAsyncResult asyncResult); #endregion #region RebootWorkspaces /// <summary> /// Reboots the specified WorkSpaces. /// /// /// <para> /// You cannot reboot a WorkSpace unless its state is <code>AVAILABLE</code> or <code>UNHEALTHY</code>. /// </para> /// /// <para> /// This operation is asynchronous and returns before the WorkSpaces have rebooted. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the RebootWorkspaces service method.</param> /// /// <returns>The response from the RebootWorkspaces service method, as returned by WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RebootWorkspaces">REST API Reference for RebootWorkspaces Operation</seealso> RebootWorkspacesResponse RebootWorkspaces(RebootWorkspacesRequest request); /// <summary> /// Initiates the asynchronous execution of the RebootWorkspaces operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RebootWorkspaces operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndRebootWorkspaces /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RebootWorkspaces">REST API Reference for RebootWorkspaces Operation</seealso> IAsyncResult BeginRebootWorkspaces(RebootWorkspacesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the RebootWorkspaces operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginRebootWorkspaces.</param> /// /// <returns>Returns a RebootWorkspacesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RebootWorkspaces">REST API Reference for RebootWorkspaces Operation</seealso> RebootWorkspacesResponse EndRebootWorkspaces(IAsyncResult asyncResult); #endregion #region RebuildWorkspaces /// <summary> /// Rebuilds the specified WorkSpace. /// /// /// <para> /// You cannot rebuild a WorkSpace unless its state is <code>AVAILABLE</code>, <code>ERROR</code>, /// <code>UNHEALTHY</code>, <code>STOPPED</code>, or <code>REBOOTING</code>. /// </para> /// /// <para> /// Rebuilding a WorkSpace is a potentially destructive action that can result in the /// loss of data. For more information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/reset-workspace.html">Rebuild /// a WorkSpace</a>. /// </para> /// /// <para> /// This operation is asynchronous and returns before the WorkSpaces have been completely /// rebuilt. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the RebuildWorkspaces service method.</param> /// /// <returns>The response from the RebuildWorkspaces service method, as returned by WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RebuildWorkspaces">REST API Reference for RebuildWorkspaces Operation</seealso> RebuildWorkspacesResponse RebuildWorkspaces(RebuildWorkspacesRequest request); /// <summary> /// Initiates the asynchronous execution of the RebuildWorkspaces operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RebuildWorkspaces operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndRebuildWorkspaces /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RebuildWorkspaces">REST API Reference for RebuildWorkspaces Operation</seealso> IAsyncResult BeginRebuildWorkspaces(RebuildWorkspacesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the RebuildWorkspaces operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginRebuildWorkspaces.</param> /// /// <returns>Returns a RebuildWorkspacesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RebuildWorkspaces">REST API Reference for RebuildWorkspaces Operation</seealso> RebuildWorkspacesResponse EndRebuildWorkspaces(IAsyncResult asyncResult); #endregion #region RegisterWorkspaceDirectory /// <summary> /// Registers the specified directory. This operation is asynchronous and returns before /// the WorkSpace directory is registered. If this is the first time you are registering /// a directory, you will need to create the workspaces_DefaultRole role before you can /// register a directory. For more information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/workspaces-access-control.html#create-default-role"> /// Creating the workspaces_DefaultRole Role</a>. /// </summary> /// <param name="request">Container for the necessary parameters to execute the RegisterWorkspaceDirectory service method.</param> /// /// <returns>The response from the RegisterWorkspaceDirectory service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidResourceStateException"> /// The state of the resource is not valid for this operation. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.OperationNotSupportedException"> /// This operation is not supported. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceLimitExceededException"> /// Your resource limits have been exceeded. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.UnsupportedNetworkConfigurationException"> /// The configuration of this network is not supported for this operation, or your network /// configuration conflicts with the Amazon WorkSpaces management network IP range. For /// more information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/amazon-workspaces-vpc.html"> /// Configure a VPC for Amazon WorkSpaces</a>. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.WorkspacesDefaultRoleNotFoundException"> /// The workspaces_DefaultRole role could not be found. If this is the first time you /// are registering a directory, you will need to create the workspaces_DefaultRole role /// before you can register a directory. For more information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/workspaces-access-control.html#create-default-role">Creating /// the workspaces_DefaultRole Role</a>. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RegisterWorkspaceDirectory">REST API Reference for RegisterWorkspaceDirectory Operation</seealso> RegisterWorkspaceDirectoryResponse RegisterWorkspaceDirectory(RegisterWorkspaceDirectoryRequest request); /// <summary> /// Initiates the asynchronous execution of the RegisterWorkspaceDirectory operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RegisterWorkspaceDirectory operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndRegisterWorkspaceDirectory /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RegisterWorkspaceDirectory">REST API Reference for RegisterWorkspaceDirectory Operation</seealso> IAsyncResult BeginRegisterWorkspaceDirectory(RegisterWorkspaceDirectoryRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the RegisterWorkspaceDirectory operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginRegisterWorkspaceDirectory.</param> /// /// <returns>Returns a RegisterWorkspaceDirectoryResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RegisterWorkspaceDirectory">REST API Reference for RegisterWorkspaceDirectory Operation</seealso> RegisterWorkspaceDirectoryResponse EndRegisterWorkspaceDirectory(IAsyncResult asyncResult); #endregion #region RestoreWorkspace /// <summary> /// Restores the specified WorkSpace to its last known healthy state. /// /// /// <para> /// You cannot restore a WorkSpace unless its state is <code> AVAILABLE</code>, <code>ERROR</code>, /// <code>UNHEALTHY</code>, or <code>STOPPED</code>. /// </para> /// /// <para> /// Restoring a WorkSpace is a potentially destructive action that can result in the loss /// of data. For more information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/restore-workspace.html">Restore /// a WorkSpace</a>. /// </para> /// /// <para> /// This operation is asynchronous and returns before the WorkSpace is completely restored. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the RestoreWorkspace service method.</param> /// /// <returns>The response from the RestoreWorkspace service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RestoreWorkspace">REST API Reference for RestoreWorkspace Operation</seealso> RestoreWorkspaceResponse RestoreWorkspace(RestoreWorkspaceRequest request); /// <summary> /// Initiates the asynchronous execution of the RestoreWorkspace operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RestoreWorkspace operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndRestoreWorkspace /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RestoreWorkspace">REST API Reference for RestoreWorkspace Operation</seealso> IAsyncResult BeginRestoreWorkspace(RestoreWorkspaceRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the RestoreWorkspace operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginRestoreWorkspace.</param> /// /// <returns>Returns a RestoreWorkspaceResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RestoreWorkspace">REST API Reference for RestoreWorkspace Operation</seealso> RestoreWorkspaceResponse EndRestoreWorkspace(IAsyncResult asyncResult); #endregion #region RevokeIpRules /// <summary> /// Removes one or more rules from the specified IP access control group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the RevokeIpRules service method.</param> /// /// <returns>The response from the RevokeIpRules service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidResourceStateException"> /// The state of the resource is not valid for this operation. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RevokeIpRules">REST API Reference for RevokeIpRules Operation</seealso> RevokeIpRulesResponse RevokeIpRules(RevokeIpRulesRequest request); /// <summary> /// Initiates the asynchronous execution of the RevokeIpRules operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RevokeIpRules operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndRevokeIpRules /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RevokeIpRules">REST API Reference for RevokeIpRules Operation</seealso> IAsyncResult BeginRevokeIpRules(RevokeIpRulesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the RevokeIpRules operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginRevokeIpRules.</param> /// /// <returns>Returns a RevokeIpRulesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RevokeIpRules">REST API Reference for RevokeIpRules Operation</seealso> RevokeIpRulesResponse EndRevokeIpRules(IAsyncResult asyncResult); #endregion #region StartWorkspaces /// <summary> /// Starts the specified WorkSpaces. /// /// /// <para> /// You cannot start a WorkSpace unless it has a running mode of <code>AutoStop</code> /// and a state of <code>STOPPED</code>. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the StartWorkspaces service method.</param> /// /// <returns>The response from the StartWorkspaces service method, as returned by WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/StartWorkspaces">REST API Reference for StartWorkspaces Operation</seealso> StartWorkspacesResponse StartWorkspaces(StartWorkspacesRequest request); /// <summary> /// Initiates the asynchronous execution of the StartWorkspaces operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the StartWorkspaces operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStartWorkspaces /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/StartWorkspaces">REST API Reference for StartWorkspaces Operation</seealso> IAsyncResult BeginStartWorkspaces(StartWorkspacesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the StartWorkspaces operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginStartWorkspaces.</param> /// /// <returns>Returns a StartWorkspacesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/StartWorkspaces">REST API Reference for StartWorkspaces Operation</seealso> StartWorkspacesResponse EndStartWorkspaces(IAsyncResult asyncResult); #endregion #region StopWorkspaces /// <summary> /// Stops the specified WorkSpaces. /// /// /// <para> /// You cannot stop a WorkSpace unless it has a running mode of <code>AutoStop</code> /// and a state of <code>AVAILABLE</code>, <code>IMPAIRED</code>, <code>UNHEALTHY</code>, /// or <code>ERROR</code>. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the StopWorkspaces service method.</param> /// /// <returns>The response from the StopWorkspaces service method, as returned by WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/StopWorkspaces">REST API Reference for StopWorkspaces Operation</seealso> StopWorkspacesResponse StopWorkspaces(StopWorkspacesRequest request); /// <summary> /// Initiates the asynchronous execution of the StopWorkspaces operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the StopWorkspaces operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStopWorkspaces /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/StopWorkspaces">REST API Reference for StopWorkspaces Operation</seealso> IAsyncResult BeginStopWorkspaces(StopWorkspacesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the StopWorkspaces operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginStopWorkspaces.</param> /// /// <returns>Returns a StopWorkspacesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/StopWorkspaces">REST API Reference for StopWorkspaces Operation</seealso> StopWorkspacesResponse EndStopWorkspaces(IAsyncResult asyncResult); #endregion #region TerminateWorkspaces /// <summary> /// Terminates the specified WorkSpaces. /// /// <important> /// <para> /// Terminating a WorkSpace is a permanent action and cannot be undone. The user's data /// is destroyed. If you need to archive any user data, contact AWS Support before terminating /// the WorkSpace. /// </para> /// </important> /// <para> /// You can terminate a WorkSpace that is in any state except <code>SUSPENDED</code>. /// </para> /// /// <para> /// This operation is asynchronous and returns before the WorkSpaces have been completely /// terminated. After a WorkSpace is terminated, the <code>TERMINATED</code> state is /// returned only briefly before the WorkSpace directory metadata is cleaned up, so this /// state is rarely returned. To confirm that a WorkSpace is terminated, check for the /// WorkSpace ID by using <a href="https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeWorkspaces.html"> /// DescribeWorkSpaces</a>. If the WorkSpace ID isn't returned, then the WorkSpace has /// been successfully terminated. /// </para> /// <note> /// <para> /// Simple AD and AD Connector are made available to you free of charge to use with WorkSpaces. /// If there are no WorkSpaces being used with your Simple AD or AD Connector directory /// for 30 consecutive days, this directory will be automatically deregistered for use /// with Amazon WorkSpaces, and you will be charged for this directory as per the <a href="http://aws.amazon.com/directoryservice/pricing/">AWS /// Directory Services pricing terms</a>. /// </para> /// /// <para> /// To delete empty directories, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/delete-workspaces-directory.html"> /// Delete the Directory for Your WorkSpaces</a>. If you delete your Simple AD or AD Connector /// directory, you can always create a new one when you want to start using WorkSpaces /// again. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the TerminateWorkspaces service method.</param> /// /// <returns>The response from the TerminateWorkspaces service method, as returned by WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/TerminateWorkspaces">REST API Reference for TerminateWorkspaces Operation</seealso> TerminateWorkspacesResponse TerminateWorkspaces(TerminateWorkspacesRequest request); /// <summary> /// Initiates the asynchronous execution of the TerminateWorkspaces operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the TerminateWorkspaces operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndTerminateWorkspaces /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/TerminateWorkspaces">REST API Reference for TerminateWorkspaces Operation</seealso> IAsyncResult BeginTerminateWorkspaces(TerminateWorkspacesRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the TerminateWorkspaces operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginTerminateWorkspaces.</param> /// /// <returns>Returns a TerminateWorkspacesResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/TerminateWorkspaces">REST API Reference for TerminateWorkspaces Operation</seealso> TerminateWorkspacesResponse EndTerminateWorkspaces(IAsyncResult asyncResult); #endregion #region UpdateConnectionAliasPermission /// <summary> /// Shares or unshares a connection alias with one account by specifying whether that /// account has permission to associate the connection alias with a directory. If the /// association permission is granted, the connection alias is shared with that account. /// If the association permission is revoked, the connection alias is unshared with the /// account. For more information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/cross-region-redirection.html"> /// Cross-Region Redirection for Amazon WorkSpaces</a>. /// /// <note> <ul> <li> /// <para> /// Before performing this operation, call <a href="https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeConnectionAliases.html"> /// DescribeConnectionAliases</a> to make sure that the current state of the connection /// alias is <code>CREATED</code>. /// </para> /// </li> <li> /// <para> /// To delete a connection alias that has been shared, the shared account must first disassociate /// the connection alias from any directories it has been associated with. Then you must /// unshare the connection alias from the account it has been shared with. You can delete /// a connection alias only after it is no longer shared with any accounts or associated /// with any directories. /// </para> /// </li> </ul> </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateConnectionAliasPermission service method.</param> /// /// <returns>The response from the UpdateConnectionAliasPermission service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidResourceStateException"> /// The state of the resource is not valid for this operation. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.OperationNotSupportedException"> /// This operation is not supported. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceAssociatedException"> /// The resource is associated with a directory. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceLimitExceededException"> /// Your resource limits have been exceeded. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/UpdateConnectionAliasPermission">REST API Reference for UpdateConnectionAliasPermission Operation</seealso> UpdateConnectionAliasPermissionResponse UpdateConnectionAliasPermission(UpdateConnectionAliasPermissionRequest request); /// <summary> /// Initiates the asynchronous execution of the UpdateConnectionAliasPermission operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateConnectionAliasPermission operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateConnectionAliasPermission /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/UpdateConnectionAliasPermission">REST API Reference for UpdateConnectionAliasPermission Operation</seealso> IAsyncResult BeginUpdateConnectionAliasPermission(UpdateConnectionAliasPermissionRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the UpdateConnectionAliasPermission operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateConnectionAliasPermission.</param> /// /// <returns>Returns a UpdateConnectionAliasPermissionResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/UpdateConnectionAliasPermission">REST API Reference for UpdateConnectionAliasPermission Operation</seealso> UpdateConnectionAliasPermissionResponse EndUpdateConnectionAliasPermission(IAsyncResult asyncResult); #endregion #region UpdateRulesOfIpGroup /// <summary> /// Replaces the current rules of the specified IP access control group with the specified /// rules. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateRulesOfIpGroup service method.</param> /// /// <returns>The response from the UpdateRulesOfIpGroup service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidResourceStateException"> /// The state of the resource is not valid for this operation. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceLimitExceededException"> /// Your resource limits have been exceeded. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/UpdateRulesOfIpGroup">REST API Reference for UpdateRulesOfIpGroup Operation</seealso> UpdateRulesOfIpGroupResponse UpdateRulesOfIpGroup(UpdateRulesOfIpGroupRequest request); /// <summary> /// Initiates the asynchronous execution of the UpdateRulesOfIpGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateRulesOfIpGroup operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateRulesOfIpGroup /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/UpdateRulesOfIpGroup">REST API Reference for UpdateRulesOfIpGroup Operation</seealso> IAsyncResult BeginUpdateRulesOfIpGroup(UpdateRulesOfIpGroupRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the UpdateRulesOfIpGroup operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateRulesOfIpGroup.</param> /// /// <returns>Returns a UpdateRulesOfIpGroupResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/UpdateRulesOfIpGroup">REST API Reference for UpdateRulesOfIpGroup Operation</seealso> UpdateRulesOfIpGroupResponse EndUpdateRulesOfIpGroup(IAsyncResult asyncResult); #endregion #region UpdateWorkspaceImagePermission /// <summary> /// Shares or unshares an image with one account in the same AWS Region by specifying /// whether that account has permission to copy the image. If the copy image permission /// is granted, the image is shared with that account. If the copy image permission is /// revoked, the image is unshared with the account. /// /// /// <para> /// After an image has been shared, the recipient account can copy the image to other /// AWS Regions as needed. /// </para> /// <note> /// <para> /// In the China (Ningxia) Region, you can copy images only within the same Region. /// </para> /// /// <para> /// In the AWS GovCloud (US-West) Region, to copy images to and from other AWS Regions, /// contact AWS Support. /// </para> /// </note> /// <para> /// For more information about sharing images, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/share-custom-image.html"> /// Share or Unshare a Custom WorkSpaces Image</a>. /// </para> /// <note> <ul> <li> /// <para> /// To delete an image that has been shared, you must unshare the image before you delete /// it. /// </para> /// </li> <li> /// <para> /// Sharing Bring Your Own License (BYOL) images across AWS accounts isn't supported at /// this time in the AWS GovCloud (US-West) Region. To share BYOL images across accounts /// in the AWS GovCloud (US-West) Region, contact AWS Support. /// </para> /// </li> </ul> </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateWorkspaceImagePermission service method.</param> /// /// <returns>The response from the UpdateWorkspaceImagePermission service method, as returned by WorkSpaces.</returns> /// <exception cref="Amazon.WorkSpaces.Model.AccessDeniedException"> /// The user is not authorized to access a resource. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.InvalidParameterValuesException"> /// One or more parameter values are not valid. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.OperationNotSupportedException"> /// This operation is not supported. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceNotFoundException"> /// The resource could not be found. /// </exception> /// <exception cref="Amazon.WorkSpaces.Model.ResourceUnavailableException"> /// The specified resource is not available. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/UpdateWorkspaceImagePermission">REST API Reference for UpdateWorkspaceImagePermission Operation</seealso> UpdateWorkspaceImagePermissionResponse UpdateWorkspaceImagePermission(UpdateWorkspaceImagePermissionRequest request); /// <summary> /// Initiates the asynchronous execution of the UpdateWorkspaceImagePermission operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateWorkspaceImagePermission operation on AmazonWorkSpacesClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateWorkspaceImagePermission /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/UpdateWorkspaceImagePermission">REST API Reference for UpdateWorkspaceImagePermission Operation</seealso> IAsyncResult BeginUpdateWorkspaceImagePermission(UpdateWorkspaceImagePermissionRequest request, AsyncCallback callback, object state); /// <summary> /// Finishes the asynchronous execution of the UpdateWorkspaceImagePermission operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateWorkspaceImagePermission.</param> /// /// <returns>Returns a UpdateWorkspaceImagePermissionResult from WorkSpaces.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/UpdateWorkspaceImagePermission">REST API Reference for UpdateWorkspaceImagePermission Operation</seealso> UpdateWorkspaceImagePermissionResponse EndUpdateWorkspaceImagePermission(IAsyncResult asyncResult); #endregion } }
61.182311
206
0.673751
[ "Apache-2.0" ]
philasmar/aws-sdk-net
sdk/src/Services/WorkSpaces/Generated/_bcl35/IAmazonWorkSpaces.cs
180,549
C#
using Newtonsoft.Json.Serialization; using Seranet.Api.Areas.HelpPage; using Seranet.Api.Core; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Http; using System.Web.Http.Cors; namespace Seranet.Api { public static class WebApiConfig { public static void Register(HttpConfiguration config) { //Auth filter - See configuration in web.config config.Filters.Add(new SeranetAuthAttribute()); // set webapi JSON formatter config.Formatters.XmlFormatter.SupportedMediaTypes.Clear(); var json = config.Formatters.JsonFormatter; json.SerializerSettings.Formatting = Newtonsoft.Json.Formatting.Indented; json.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); //enable cross domain requests var corsAttr = new EnableCorsAttribute("*", "*", "*"); corsAttr.SupportsCredentials = true; config.EnableCors(corsAttr); // Web API routes config.MapHttpAttributeRoutes(); config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/bin/Seranet.Api.xml"))); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); } } }
32.478261
135
0.649264
[ "MIT" ]
99xt/seranet.api
Seranet.Api/App_Start/WebApiConfig.cs
1,496
C#
using System; using UnityEngine; namespace NueExtensions { public static class TransformExtensions { /// <summary> /// Makes the given game objects children of the transform. /// </summary> /// <param name="transform">Parent transform.</param> /// <param name="children">Game objects to make children.</param> public static void AddChildren(this Transform transform, GameObject[] children) => Array.ForEach(children, child => child.transform.parent = transform); /// <summary> /// Makes the game objects of given components children of the transform. /// </summary> /// <param name="transform">Parent transform.</param> /// <param name="children">Components of game objects to make children.</param> public static void AddChildren(this Transform transform, Component[] children) => Array.ForEach(children, child => child.transform.parent = transform); /// <summary> /// Sets the position of a transform's children to zero. /// </summary> /// <param name="transform">Parent transform.</param> /// <param name="recursive">Also reset ancestor positions?</param> public static void ResetChildPositions(this Transform transform, bool recursive = false) { foreach (Transform child in transform) { child.position = Vector3.zero; if (recursive) child.ResetChildPositions(recursive); } } /// <summary> /// Sets the layer of the transform's children. /// </summary> /// <param name="transform">Parent transform.</param> /// <param name="layerName">Name of layer.</param> /// <param name="recursive">Also set ancestor layers?</param> public static void SetChildLayers(this Transform transform, string layerName, bool recursive = false) { var layer = LayerMask.NameToLayer(layerName); SetChildLayersHelper(transform, layer, recursive); } static void SetChildLayersHelper(Transform transform, int layer, bool recursive) { foreach (Transform child in transform) { child.gameObject.layer = layer; if (recursive) SetChildLayersHelper(child, layer, recursive); } } /// <summary> /// Sets the x component of the transform's position. /// </summary> /// <param name="x">Value of x.</param> public static void SetX(this Transform transform, float x) => transform.position = new Vector3(x, transform.position.y, transform.position.z); /// <summary> /// Sets the y component of the transform's position. /// </summary> /// <param name="y">Value of y.</param> public static void SetY(this Transform transform, float y) => transform.position = new Vector3(transform.position.x, y, transform.position.z); /// <summary> /// Sets the z component of the transform's position. /// </summary> /// <param name="z">Value of z.</param> public static void SetZ(this Transform transform, float z) => transform.position = new Vector3(transform.position.x, transform.position.y, z); /// <summary> /// Calculus of the location of this object. Whether it is located at the top or bottom. -1 and 1 respectively. /// </summary> /// <returns></returns> public static int CloserEdge(this Transform transform, Camera camera, int width, int height) { //edge points according to the screen/camera var worldPointTop = camera.ScreenToWorldPoint(new Vector3(width / 2, height)); var worldPointBot = camera.ScreenToWorldPoint(new Vector3(width / 2, 0)); //distance from the pivot to the screen edge var deltaTop = Vector2.Distance(worldPointTop, transform.position); var deltaBottom = Vector2.Distance(worldPointBot, transform.position); return deltaBottom <= deltaTop ? 1 : -1; } } }
42.707071
123
0.603359
[ "MIT" ]
Arefnue/NueExtensions
Assets/NueExtensions/TransformExtensions.cs
4,230
C#
using Tests; using Microsoft.VisualStudio.TestTools.UnitTesting; using FluentAssertions; using Core.Operations.Errors; using Core.Operations.Errors.Extras; using System; using System.Collections.Generic; using System.Linq; using System.Net.Cache; using System.Text; using System.Threading.Tasks; using Core.Models.Logging; using Voodoo; using Voodoo.Messages; using Voodoo.TestData; using Core.Models.Mappings; namespace Tests.Operations.Errors { [TestClass] public class ErrorMappingTests { private Randomizer randomizer = new Randomizer(); private Error arrange() { TestHelper.SetRandomDataSeed(1); var source = new Error(); TestHelper.Randomizer.Randomize(source); return source; } [TestMethod] public void Map_Message_PropertiesTheSame() { var testHelper = new MappingTesterHelper<Error, ErrorRow>(); var source = arrange(); var message = source.ToErrorRow(); var target = new Error(); target.UpdateFrom(message); testHelper.Compare(source, message, new string[]{}); testHelper.Compare(target, message, new string[]{}); } [TestMethod] public void Map_Detail_PropertiesTheSame() { var testHelper = new MappingTesterHelper<Error, ErrorDetail>(); var source = arrange(); var message = source.ToErrorDetail(); var target = new Error(); target.UpdateFrom(message); testHelper.Compare(source, message, new string[]{}); testHelper.Compare(target, message, new string[]{}); } } }
27.149254
64
0.592633
[ "MIT" ]
MiniverCheevy/spa-starter-kit
src/Tests/Operations/Errors/ErrorMappingTests.cs
1,819
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("SC_Console_APP")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SC_Console_APP")] [assembly: AssemblyCopyright("Copyright © 2019")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("08626b44-f47f-43fd-a005-8fb1513df957")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
37.72973
84
0.748567
[ "MIT" ]
ninekorn/SCCoreSystems-rerelease
sc_impulse_physics/SC_Physiks_CSharp/SC_Console_APP/Properties/AssemblyInfo.cs
1,399
C#
using NBi.Xml.Items.Filters; using System; using System.Collections.Generic; using System.Linq; using System.Xml.Serialization; namespace NBi.Xml.Items { public class SetsXml : AbstractMembersItem, IPerspectiveFilter { [XmlAttribute("perspective")] public string Perspective { get; set; } [XmlIgnore] protected virtual string Path { get { return string.Format("[{0}]", Caption); } } public override string TypeName { get { return "sets"; } } internal override Dictionary<string, string> GetRegexMatch() { var dico = base.GetRegexMatch(); dico.Add("sut:perspective", Perspective); return dico; } internal override ICollection<string> GetAutoCategories() { var values = new List<string>(); if (!string.IsNullOrEmpty(Perspective)) values.Add(string.Format("Perspective '{0}'", Perspective)); values.Add("Sets"); return values; } } }
28.25641
90
0.568966
[ "Apache-2.0" ]
CoolsJoris/NBi
NBi.Xml/Items/SetsXml.cs
1,104
C#
#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "3ABDE3CEC43883FB1567CB2D1609593523830BB5652CF0548E003F796486E97C" //------------------------------------------------------------------------------ // <auto-generated> // Этот код создан программой. // Исполняемая версия:4.0.30319.42000 // // Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае // повторной генерации кода. // </auto-generated> //------------------------------------------------------------------------------ using PairTradingView.WpfApp; using System; using System.Diagnostics; using System.Windows; using System.Windows.Automation; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Markup; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Media.Effects; using System.Windows.Media.Imaging; using System.Windows.Media.Media3D; using System.Windows.Media.TextFormatting; using System.Windows.Navigation; using System.Windows.Shapes; using System.Windows.Shell; namespace PairTradingView.WpfApp { /// <summary> /// App /// </summary> public partial class App : System.Windows.Application { /// <summary> /// InitializeComponent /// </summary> [System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] public void InitializeComponent() { #line 5 "..\..\App.xaml" this.StartupUri = new System.Uri("FilesLoaderWindow.xaml", System.UriKind.Relative); #line default #line hidden } /// <summary> /// Application Entry Point. /// </summary> [System.STAThreadAttribute()] [System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] public static void Main() { PairTradingView.WpfApp.App app = new PairTradingView.WpfApp.App(); app.InitializeComponent(); app.Run(); } } }
32.957746
142
0.629915
[ "Apache-2.0" ]
dv-lebedev/PairTradingView
PairTradingView.WpfApp/obj/Debug/App.g.cs
2,476
C#
using System.Collections.Generic; namespace TgBotPillar.Core.Scheme { public class State { public string Text { get; init; } public IList<Handler> TextParameters { get; init; } public Pager Pager { get; init; } public IList<Button> Buttons { get; init; } public Input Input { get; init; } public string Transition { get; init; } public State() { TextParameters = new List<Handler>(); Buttons = new List<Button>(); } } }
22.64
59
0.533569
[ "MIT" ]
mkryuchkov/tg-bot-pillar
TgBotPillar.Core/Scheme/State.cs
566
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Casimodo.Lib { // TODO: Maybe move to type helper. public static class NumericHelper { public static bool IsInteger<T>(this T obj) where T : struct { return IsInteger(typeof(T)); } public static bool IsInteger(this Type type) { type = Nullable.GetUnderlyingType(type) ?? type; return TypeHelper.GetTypeInfo(type).IsPrimitive && // See https://msdn.microsoft.com/en-us/library/exx3b86w.aspx (type == typeof(int) || type == typeof(long) || type == typeof(byte) || type == typeof(short) || type == typeof(uint) || type == typeof(ulong) || type == typeof(sbyte) || type == typeof(ushort)); } public static bool IsNumber(this Type type) { if (type == null) return false; type = Nullable.GetUnderlyingType(type) ?? type; if (TypeHelper.GetTypeInfo(type).IsPrimitive) { return type != typeof(bool) && type != typeof(char) && type != typeof(IntPtr) && type != typeof(UIntPtr); } return type == typeof(decimal); } public static bool IsDecimal(this Type type) { if (type == null) return false; type = Nullable.GetUnderlyingType(type) ?? type; return type == typeof(decimal); } } }
29.310345
77
0.504118
[ "Apache-2.0" ]
Casimodo72/Casimodo.Lib
src/Casimodo.Lib/Helpers/NumericHelper.cs
1,702
C#
using System; using System.Collections.Generic; using System.Linq; using CSharpier.DocTypes; using CSharpier.Utilities; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; namespace CSharpier.SyntaxPrinter.SyntaxNodePrinters { // this is loosely based on prettier/src/language-js/print/binaryish.js public static class BinaryExpression { public static Doc Print(BinaryExpressionSyntax node) { var docs = PrintBinaryExpression(node); var shouldNotIndent = node.Parent is ReturnStatementSyntax or WhereClauseSyntax or EqualsValueClauseSyntax or ArrowExpressionClauseSyntax or ParenthesizedLambdaExpressionSyntax or AssignmentExpressionSyntax or ConditionalExpressionSyntax or SimpleLambdaExpressionSyntax or IfStatementSyntax or WhileStatementSyntax or SwitchExpressionSyntax or DoStatementSyntax or CheckedExpressionSyntax or CatchFilterClauseSyntax or ParenthesizedExpressionSyntax or SwitchStatementSyntax; return shouldNotIndent ? Doc.Group(docs) : Doc.Group(docs[0], Doc.Indent(docs.Skip(1).ToList())); } [ThreadStatic] private static int depth; // The goal of this is to group operators of the same precedence such that they all break or none of them break // for example the following should break on the && before it breaks on the != /* ( one != two && three != four && five != six */ private static List<Doc> PrintBinaryExpression(SyntaxNode node) { if (node is not BinaryExpressionSyntax binaryExpressionSyntax) { return new List<Doc> { Doc.Group(Node.Print(node)) }; } if (depth > 200) { throw new InTooDeepException(); } depth++; try { var docs = new List<Doc>(); // This group ensures that something like == 0 does not end up on its own line var shouldGroup = binaryExpressionSyntax.Kind() != binaryExpressionSyntax.Parent!.Kind() && binaryExpressionSyntax.Left.GetType() != binaryExpressionSyntax.GetType() && binaryExpressionSyntax.Right.GetType() != binaryExpressionSyntax.GetType(); // nested ?? have the next level on the right side, everything else has it on the left var binaryOnTheRight = binaryExpressionSyntax.Kind() == SyntaxKind.CoalesceExpression; if (binaryOnTheRight) { docs.Add( Node.Print(binaryExpressionSyntax.Left), Doc.Line, Token.Print(binaryExpressionSyntax.OperatorToken), " " ); } var possibleBinary = binaryOnTheRight ? binaryExpressionSyntax.Right : binaryExpressionSyntax.Left; // Put all operators with the same precedence level in the same // group. The reason we only need to do this with the `left` // expression is because given an expression like `1 + 2 - 3`, it // is always parsed like `((1 + 2) - 3)`, meaning the `left` side // is where the rest of the expression will exist. Binary // expressions on the right side mean they have a difference // precedence level and should be treated as a separate group, so // print them normally. if ( possibleBinary is BinaryExpressionSyntax childBinary && ShouldFlatten( binaryExpressionSyntax.OperatorToken, childBinary.OperatorToken ) ) { docs.AddRange(PrintBinaryExpression(childBinary)); } else { docs.Add(Node.Print(possibleBinary)); } if (binaryOnTheRight) { return shouldGroup ? new List<Doc> { docs[0], Doc.Group(docs.Skip(1).ToList()) } : docs; } var right = Doc.Concat( Doc.Line, Token.Print(binaryExpressionSyntax.OperatorToken), " ", Node.Print(binaryExpressionSyntax.Right) ); docs.Add(shouldGroup ? Doc.Group(right) : right); return docs; } finally { depth--; } } private static bool ShouldFlatten(SyntaxToken parentToken, SyntaxToken nodeToken) { return GetPrecedence(parentToken) == GetPrecedence(nodeToken); } private static int GetPrecedence(SyntaxToken syntaxToken) { return syntaxToken.Kind() switch { SyntaxKind.QuestionQuestionToken => 1, SyntaxKind.BarBarToken => 2, SyntaxKind.AmpersandAmpersandToken => 3, SyntaxKind.BarToken => 4, SyntaxKind.CaretToken => 5, SyntaxKind.AmpersandToken => 6, SyntaxKind.ExclamationEqualsToken => 7, SyntaxKind.EqualsEqualsToken => 7, SyntaxKind.LessThanToken => 8, SyntaxKind.LessThanEqualsToken => 8, SyntaxKind.GreaterThanToken => 8, SyntaxKind.GreaterThanEqualsToken => 8, SyntaxKind.IsKeyword => 8, SyntaxKind.AsKeyword => 8, SyntaxKind.LessThanLessThanToken => 9, SyntaxKind.GreaterThanGreaterThanToken => 9, SyntaxKind.MinusToken => 10, SyntaxKind.PlusToken => 10, SyntaxKind.AsteriskToken => 11, SyntaxKind.SlashToken => 11, SyntaxKind.PercentToken => 11, _ => throw new Exception($"No precedence defined for {syntaxToken}") }; } } }
38.850575
119
0.517604
[ "MIT" ]
faktored/csharpier
Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/BinaryExpression.cs
6,760
C#
using log4net.Appender; using log4net.Core; using System; using System.IO; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; namespace GatheringTimer { public class TextBoxAppender : AppenderSkeleton { public static TextBox _textBox; public string FormName { get; set; } public string TextBoxName { get; set; } protected override void Append(LoggingEvent loggingEvent) { if (_textBox != null) { _textBox.AppendText(loggingEvent.RenderedMessage + Environment.NewLine); } else { if (String.IsNullOrEmpty(FormName) || String.IsNullOrEmpty(TextBoxName)) return; Form form = Application.OpenForms[FormName]; if (form == null) return; _textBox = form.Controls[TextBoxName] as TextBox; if (_textBox == null) return; form.FormClosing += (s, e) => _textBox = null; } } } public class Logger { public static TextBox textBoxLogger; public static void Error(object msg) { log4net.ILog log = log4net.LogManager.GetLogger("logerror"); Task.Run(() => { log.Error(msg); }); } public static void Error(object msg, Exception ex) { log4net.ILog log = log4net.LogManager.GetLogger("logerror"); if (ex != null) { Task.Run(() => { log.Error(msg, ex); }); } else { Task.Run(() => { log.Error(msg); }); } } public static void Warn(object msg) { log4net.ILog log = log4net.LogManager.GetLogger("logwarn"); Task.Run(() => { log.Warn(msg); }); } public static void Warn(object msg, Exception ex) { log4net.ILog log = log4net.LogManager.GetLogger("logwarn"); if (ex != null) { Task.Run(() => { log.Warn(msg, ex); }); } else { Task.Run(() => { log.Warn(msg); }); } } public static void Info(object msg) { log4net.ILog log = log4net.LogManager.GetLogger("loginfo"); Task.Run(() => { log.Info(msg); }); } public static void Debug(object msg) { log4net.ILog log = log4net.LogManager.GetLogger("logdebug"); Task.Run(() => { log.Debug(msg); }); } public static void Debug(Exception ex) { log4net.ILog log = log4net.LogManager.GetLogger("logdebug"); Task.Run(() => { log.Debug(ex.Message.ToString() + "/r/n" + ex.Source.ToString() + "/r/n" + ex.TargetSite.ToString() + "/r/n" + ex.StackTrace.ToString()); }); } public static void Debug(object msg, Exception ex) { log4net.ILog log = log4net.LogManager.GetLogger("logdebug"); if (ex != null) { Task.Run(() => { log.Debug(msg, ex); }); } else { Task.Run(() => { log.Debug(msg); }); } } } }
25.453947
153
0.420522
[ "MIT" ]
ErinnerMO/FFXIV.GatheringTimer
Util/Logger.cs
3,871
C#
using System.Threading.Tasks; using Shouldly; using Xunit; namespace Bamboo.CRM.Samples { public class SampleAppService_Tests : CRMApplicationTestBase { private readonly ISampleAppService _sampleAppService; public SampleAppService_Tests() { _sampleAppService = GetRequiredService<ISampleAppService>(); } [Fact] public async Task GetAsync() { var result = await _sampleAppService.GetAsync(); result.Value.ShouldBe(42); } [Fact] public async Task GetAuthorizedAsync() { var result = await _sampleAppService.GetAuthorizedAsync(); result.Value.ShouldBe(42); } } }
23.645161
72
0.61528
[ "MIT" ]
BlazorHub/bamboomodules
Bamboo.CRM/test/Bamboo.CRM.Application.Tests/Samples/SampleAppService_Tests.cs
735
C#
/* * Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the globalaccelerator-2018-08-08.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.GlobalAccelerator.Model { /// <summary> /// An accelerator is a complex type that includes one or more listeners that process /// inbound connections and then direct traffic to one or more endpoint groups, each of /// which includes endpoints, such as load balancers. /// </summary> public partial class Accelerator { private string _acceleratorArn; private DateTime? _createdTime; private string _dnsName; private bool? _enabled; private IpAddressType _ipAddressType; private List<IpSet> _ipSets = new List<IpSet>(); private DateTime? _lastModifiedTime; private string _name; private AcceleratorStatus _status; /// <summary> /// Gets and sets the property AcceleratorArn. /// <para> /// The Amazon Resource Name (ARN) of the accelerator. /// </para> /// </summary> [AWSProperty(Max=255)] public string AcceleratorArn { get { return this._acceleratorArn; } set { this._acceleratorArn = value; } } // Check to see if AcceleratorArn property is set internal bool IsSetAcceleratorArn() { return this._acceleratorArn != null; } /// <summary> /// Gets and sets the property CreatedTime. /// <para> /// The date and time that the accelerator was created. /// </para> /// </summary> public DateTime CreatedTime { get { return this._createdTime.GetValueOrDefault(); } set { this._createdTime = value; } } // Check to see if CreatedTime property is set internal bool IsSetCreatedTime() { return this._createdTime.HasValue; } /// <summary> /// Gets and sets the property DnsName. /// <para> /// The Domain Name System (DNS) name that Global Accelerator creates that points to your /// accelerator's static IP addresses. /// </para> /// /// <para> /// The naming convention for the DNS name is: a lower case letter a, followed by a 16-bit /// random hex string, followed by .awsglobalaccelerator.com. For example: a1234567890abcdef.awsglobalaccelerator.com. /// </para> /// /// <para> /// For more information about the default DNS name, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html#about-accelerators.dns-addressing">Support /// for DNS Addressing in Global Accelerator</a> in the <i>AWS Global Accelerator Developer /// Guide</i>. /// </para> /// </summary> [AWSProperty(Max=255)] public string DnsName { get { return this._dnsName; } set { this._dnsName = value; } } // Check to see if DnsName property is set internal bool IsSetDnsName() { return this._dnsName != null; } /// <summary> /// Gets and sets the property Enabled. /// <para> /// Indicates whether the accelerator is enabled. The value is true or false. The default /// value is true. /// </para> /// /// <para> /// If the value is set to true, the accelerator cannot be deleted. If set to false, accelerator /// can be deleted. /// </para> /// </summary> public bool Enabled { get { return this._enabled.GetValueOrDefault(); } set { this._enabled = value; } } // Check to see if Enabled property is set internal bool IsSetEnabled() { return this._enabled.HasValue; } /// <summary> /// Gets and sets the property IpAddressType. /// <para> /// The value for the address type must be IPv4. /// </para> /// </summary> public IpAddressType IpAddressType { get { return this._ipAddressType; } set { this._ipAddressType = value; } } // Check to see if IpAddressType property is set internal bool IsSetIpAddressType() { return this._ipAddressType != null; } /// <summary> /// Gets and sets the property IpSets. /// <para> /// The static IP addresses that Global Accelerator associates with the accelerator. /// </para> /// </summary> public List<IpSet> IpSets { get { return this._ipSets; } set { this._ipSets = value; } } // Check to see if IpSets property is set internal bool IsSetIpSets() { return this._ipSets != null && this._ipSets.Count > 0; } /// <summary> /// Gets and sets the property LastModifiedTime. /// <para> /// The date and time that the accelerator was last modified. /// </para> /// </summary> public DateTime LastModifiedTime { get { return this._lastModifiedTime.GetValueOrDefault(); } set { this._lastModifiedTime = value; } } // Check to see if LastModifiedTime property is set internal bool IsSetLastModifiedTime() { return this._lastModifiedTime.HasValue; } /// <summary> /// Gets and sets the property Name. /// <para> /// The name of the accelerator. The name must contain only alphanumeric characters or /// hyphens (-), and must not begin or end with a hyphen. /// </para> /// </summary> [AWSProperty(Max=255)] public string Name { get { return this._name; } set { this._name = value; } } // Check to see if Name property is set internal bool IsSetName() { return this._name != null; } /// <summary> /// Gets and sets the property Status. /// <para> /// Describes the deployment status of the accelerator. /// </para> /// </summary> public AcceleratorStatus Status { get { return this._status; } set { this._status = value; } } // Check to see if Status property is set internal bool IsSetStatus() { return this._status != null; } } }
32.077586
197
0.568664
[ "Apache-2.0" ]
TallyUpTeam/aws-sdk-net
sdk/src/Services/GlobalAccelerator/Generated/Model/Accelerator.cs
7,442
C#
using System; using System.Collections.Generic; using UnityEngine; using System.Runtime.Serialization; using Network; namespace Pluton { [Serializable] public class Player : Entity { [NonSerialized] private BasePlayer _basePlayer; public readonly ulong GameID; public readonly string SteamID; public Player(BasePlayer player) : base(player) { GameID = player.userID; SteamID = player.userID.ToString(); _basePlayer = player; try { Stats = new PlayerStats(SteamID); } catch (Exception ex) { Logger.LogDebug("[Player] Couldn't load stats!"); Logger.LogException(ex); } } [OnDeserialized] public void OnPlayerDeserialized(StreamingContext context) { Logger.LogWarning("Deserializing player with id: " + SteamID); _basePlayer = BasePlayer.FindByID(GameID); if (_basePlayer == null) Logger.LogWarning("_basePlayer is <null>, is the player offline?"); else Logger.LogWarning("basePlayer found: " + _basePlayer.displayName); } public static Player Find(string nameOrSteamidOrIP) { BasePlayer player = BasePlayer.Find(nameOrSteamidOrIP); if (player != null) return Server.GetPlayer(player); Logger.LogDebug("[Player] Couldn't find player!"); return null; } public static Player FindByGameID(ulong steamID) { BasePlayer player = BasePlayer.FindByID(steamID); if (player != null) return Server.GetPlayer(player); Logger.LogDebug("[Player] Couldn't find player!"); return null; } public static Player FindBySteamID(string steamID) { return FindByGameID(UInt64.Parse(steamID)); } public void Ban(string reason = "no reason") { ServerUsers.Set(GameID, ServerUsers.UserGroup.Banned, Name, reason); ServerUsers.Save(); Kick("[BAN] " + reason); } public void Kick(string reason = "no reason") { Network.Net.sv.Kick(basePlayer.net.connection, reason); } public void Reject(string reason = "no reason") { ConnectionAuth.Reject(basePlayer.net.connection, reason); } public Vector3 GetLookPoint(float maxDist = 500f) { return GetLookHit(maxDist).point; } public RaycastHit GetLookHit(float maxDist = 500f, int layers = Physics.AllLayers) { RaycastHit hit; Ray orig = basePlayer.eyes.HeadRay(); Physics.Raycast(orig, out hit, maxDist, layers); return hit; } public Player GetLookPlayer(float maxDist = 500f) { RaycastHit hit = GetLookHit(maxDist, LayerMask.GetMask("Player (Server)")); if (hit.collider != null) { BasePlayer basePlayer = hit.collider.GetComponentInParent<BasePlayer>(); if (basePlayer != null) { return Server.GetPlayer(basePlayer); } } return null; } public BuildingPart GetLookBuildingPart(float maxDist = 500f) { RaycastHit hit = GetLookHit(maxDist, LayerMask.GetMask("Construction", "Deployed")); if (hit.collider != null) { BuildingBlock buildingBlock = hit.collider.GetComponentInParent<BuildingBlock>(); if (buildingBlock != null) { return new BuildingPart(buildingBlock); } } return null; } public override void Kill() { var info = new HitInfo(); info.damageTypes.Add(Rust.DamageType.Suicide, Single.MaxValue); info.Initiator = baseEntity; basePlayer.Die(info); } public bool KnowsBlueprint(int itemID) { ProtoBuf.PersistantPlayer playerInfo = ServerMgr.Instance.persistance.GetPlayerInfo(GameID); return playerInfo.blueprints.complete.Contains(itemID); } public bool KnowsBlueprint(ItemBlueprint itembp) { ProtoBuf.PersistantPlayer playerInfo = ServerMgr.Instance.persistance.GetPlayerInfo(GameID); return playerInfo.blueprints.complete.Contains(itembp.targetItem.itemid); } public bool KnowsBlueprint(ItemDefinition itemdef) { ProtoBuf.PersistantPlayer playerInfo = ServerMgr.Instance.persistance.GetPlayerInfo(GameID); return playerInfo.blueprints.complete.Contains(itemdef.itemid); } public Dictionary<int, bool> KnowsBlueprints(IEnumerable<int> itemIDs) { ProtoBuf.PersistantPlayer playerInfo = ServerMgr.Instance.persistance.GetPlayerInfo(GameID); Dictionary<int, bool> result = new Dictionary<int, bool>(); foreach (int itemid in itemIDs) { if (!result.ContainsKey(itemid)) result[itemid] = playerInfo.blueprints.complete.Contains(itemid); } return result; } public Dictionary<ItemBlueprint, bool> KnowsBlueprints(IEnumerable<ItemBlueprint> itemBPs) { ProtoBuf.PersistantPlayer playerInfo = ServerMgr.Instance.persistance.GetPlayerInfo(GameID); Dictionary<ItemBlueprint, bool> result = new Dictionary<ItemBlueprint, bool>(); foreach (ItemBlueprint itembp in itemBPs) { int itemid = itembp.targetItem.itemid; if (!result.ContainsKey(itembp)) result[itembp] = playerInfo.blueprints.complete.Contains(itemid); } return result; } public Dictionary<ItemDefinition, bool> KnowsBlueprints(IEnumerable<ItemDefinition> itemdefs) { ProtoBuf.PersistantPlayer playerInfo = ServerMgr.Instance.persistance.GetPlayerInfo(GameID); Dictionary<ItemDefinition, bool> result = new Dictionary<ItemDefinition, bool>(); foreach (ItemDefinition itemdef in itemdefs) { int itemid = itemdef.itemid; if (!result.ContainsKey(itemdef)) result[itemdef] = playerInfo.blueprints.complete.Contains(itemid); } return result; } public List<int> KnownBlueprints() { ProtoBuf.PersistantPlayer playerInfo = ServerMgr.Instance.persistance.GetPlayerInfo(GameID); return playerInfo.blueprints.complete; } public bool LearnBlueprint(int itemID) { ProtoBuf.PersistantPlayer playerInfo = ServerMgr.Instance.persistance.GetPlayerInfo(GameID); if (!playerInfo.blueprints.complete.Contains(itemID)) { playerInfo.blueprints.complete.Add(itemID); ServerMgr.Instance.persistance.SetPlayerInfo(GameID, playerInfo); basePlayer.SendNetworkUpdate(BasePlayer.NetworkQueue.Update); basePlayer.ClientRPCPlayer(null, basePlayer, "UnlockedBlueprint", itemID); return true; } return false; } public bool LearnBlueprint(ItemBlueprint itembp) { ProtoBuf.PersistantPlayer playerInfo = ServerMgr.Instance.persistance.GetPlayerInfo(GameID); int itemID = itembp.targetItem.itemid; if (!playerInfo.blueprints.complete.Contains(itemID)) { playerInfo.blueprints.complete.Add(itemID); ServerMgr.Instance.persistance.SetPlayerInfo(GameID, playerInfo); basePlayer.SendNetworkUpdate(BasePlayer.NetworkQueue.Update); basePlayer.ClientRPCPlayer(null, basePlayer, "UnlockedBlueprint", itemID); return true; } return false; } public bool LearnBlueprint(ItemDefinition itemdef) { ProtoBuf.PersistantPlayer playerInfo = ServerMgr.Instance.persistance.GetPlayerInfo(GameID); int itemID = itemdef.itemid; if (!playerInfo.blueprints.complete.Contains(itemID)) { playerInfo.blueprints.complete.Add(itemID); ServerMgr.Instance.persistance.SetPlayerInfo(GameID, playerInfo); basePlayer.SendNetworkUpdate(BasePlayer.NetworkQueue.Update); basePlayer.ClientRPCPlayer(null, basePlayer, "UnlockedBlueprint", itemID); return true; } return false; } public void LearnBlueprints(IEnumerable<int> itemIDs) { ProtoBuf.PersistantPlayer playerInfo = ServerMgr.Instance.persistance.GetPlayerInfo(GameID); foreach (int itemid in itemIDs) { if (!playerInfo.blueprints.complete.Contains(itemid)) { playerInfo.blueprints.complete.Add(itemid); ServerMgr.Instance.persistance.SetPlayerInfo(GameID, playerInfo); basePlayer.SendNetworkUpdate(BasePlayer.NetworkQueue.Update); basePlayer.ClientRPCPlayer(null, basePlayer, "UnlockedBlueprint", itemid); } } } public void LearnBlueprints(IEnumerable<ItemBlueprint> itembps) { ProtoBuf.PersistantPlayer playerInfo = ServerMgr.Instance.persistance.GetPlayerInfo(GameID); foreach (ItemBlueprint itembp in itembps) { int itemid = itembp.targetItem.itemid; if (!playerInfo.blueprints.complete.Contains(itemid)) { playerInfo.blueprints.complete.Add(itemid); ServerMgr.Instance.persistance.SetPlayerInfo(GameID, playerInfo); basePlayer.SendNetworkUpdate(BasePlayer.NetworkQueue.Update); basePlayer.ClientRPCPlayer(null, basePlayer, "UnlockedBlueprint", itemid); } } } public void LearnBlueprints(IEnumerable<ItemDefinition> itemdefs) { ProtoBuf.PersistantPlayer playerInfo = ServerMgr.Instance.persistance.GetPlayerInfo(GameID); foreach (ItemDefinition itemdef in itemdefs) { int itemid = itemdef.itemid; if (!playerInfo.blueprints.complete.Contains(itemid)) { playerInfo.blueprints.complete.Add(itemid); ServerMgr.Instance.persistance.SetPlayerInfo(GameID, playerInfo); basePlayer.SendNetworkUpdate(BasePlayer.NetworkQueue.Update); basePlayer.ClientRPCPlayer(null, basePlayer, "UnlockedBlueprint", itemid); } } } public void MakeNone(string reason = "no reason") { ServerUsers.Set(GameID, ServerUsers.UserGroup.None, Name, reason); basePlayer.net.connection.authLevel = 0; ServerUsers.Save(); } public void MakeModerator(string reason = "no reason") { ServerUsers.Set(GameID, ServerUsers.UserGroup.Moderator, Name, reason); basePlayer.net.connection.authLevel = 1; ServerUsers.Save(); } public void MakeOwner(string reason = "no reason") { ServerUsers.Set(GameID, ServerUsers.UserGroup.Owner, Name, reason); basePlayer.net.connection.authLevel = 2; ServerUsers.Save(); } public void Message(string msg) { MessageFrom(Server.server_message_name, msg); } public void MessageFrom(string from, string msg) { basePlayer.SendConsoleCommand("chat.add", 0, from.ColorText("fa5") + ": " + msg); } public void ConsoleMessage(string msg) { basePlayer.SendConsoleCommand("echo", msg); } public override bool IsPlayer() { return true; } public void SendConsoleCommand(string cmd) { basePlayer.SendConsoleCommand(StringExtensions.QuoteSafe(cmd)); } public bool GroundTeleport(float x, float y, float z) { return Teleport(x, World.GetInstance().GetGround(x, z), z); } public bool GroundTeleport(Vector3 v3) { return Teleport(v3.x, World.GetInstance().GetGround(v3.x, v3.z), v3.z); } public bool Teleport(Vector3 v3) { return Teleport(v3.x, v3.y, v3.z); } public static float worldSizeHalf = (float)global::World.Size / 2; public static Vector3[] firstLocations = new Vector3[] { new Vector3(worldSizeHalf, 0, worldSizeHalf), new Vector3(-worldSizeHalf, 0, worldSizeHalf), new Vector3(worldSizeHalf, 0, -worldSizeHalf), new Vector3(-worldSizeHalf, 0, -worldSizeHalf) }; public bool Teleport(float x, float y, float z) { if (teleporting || basePlayer.IsDead()) return false; teleporting = true; Vector3 newPos = new Vector3(x, y + 0.05f, z); basePlayer.SetPlayerFlag(BasePlayer.PlayerFlags.Sleeping, true); if (!BasePlayer.sleepingPlayerList.Contains(basePlayer)) { BasePlayer.sleepingPlayerList.Add(basePlayer); } basePlayer.CancelInvoke("InventoryUpdate"); basePlayer.inventory.crafting.CancelAll(true); basePlayer.MovePosition(newPos); basePlayer.ClientRPCPlayer(null, basePlayer, "ForcePositionTo", newPos); basePlayer.TransformChanged(); basePlayer.SetPlayerFlag(BasePlayer.PlayerFlags.ReceivingSnapshot, true); basePlayer.UpdateNetworkGroup(); basePlayer.SendNetworkUpdateImmediate(false); basePlayer.ClientRPCPlayer(null, basePlayer, "StartLoading"); basePlayer.SendFullSnapshot(); teleporting = false; return true; } public bool Admin { get { return Moderator || Owner; } } public string AuthStatus { get { return basePlayer.net.connection.authStatus; } } public BasePlayer basePlayer { get { if (_basePlayer == null) return BasePlayer.FindByID(GameID); return _basePlayer; } private set { _basePlayer = value; } } public float Health { get { return basePlayer.health; } set { basePlayer.health = value; } } public Inv Inventory { get { return new Inv(basePlayer.inventory); } } public string IP { get { return basePlayer.net.connection.ipaddress; } } public bool IsWounded { get { return basePlayer.HasPlayerFlag(BasePlayer.PlayerFlags.Wounded); } } public override Vector3 Location { get { return basePlayer.transform.position; } set { Teleport(value.x, value.y, value.z); } } public bool Moderator { get { return ServerUsers.Is(GameID, ServerUsers.UserGroup.Moderator); } } public override string Name { get { return basePlayer.displayName; } } public bool Offline { get { return _basePlayer == null; } } public bool Owner { get { return ServerUsers.Is(GameID, ServerUsers.UserGroup.Owner); } } public string OS { get { return basePlayer.net.connection.os; } } public int Ping { get { return Net.sv.GetAveragePing(basePlayer.net.connection); } } public PlayerStats Stats { get { return Server.GetInstance().serverData.Get("PlayerStats", SteamID) as PlayerStats; } set { Server.GetInstance().serverData.Add("PlayerStats", SteamID, value); } } public float TimeOnline { get { return basePlayer.net.connection.connectionTime; } } private bool teleporting; public bool Teleporting { get { return teleporting; } } } }
35.942505
105
0.555416
[ "MIT" ]
Notulp/Pluton
Pluton/Objects/Player.cs
17,506
C#
using Microsoft.Xna.Framework; using Quaver.API.Helpers; using Quaver.Shared.Database.Maps; using Quaver.Shared.Helpers; using Quaver.Shared.Modifiers; using Wobble.Bindables; namespace Quaver.Shared.Screens.Selection.UI.FilterPanel.MapInformation.Metadata { public class FilterMetadataBpm : TextKeyValue { public FilterMetadataBpm() : base("BPM:", "000", 20, ColorHelper.HexToColor($"#ffe76b")) { if (MapManager.Selected.Value != null) Value.Text = $"{GetBpm()}"; ModManager.ModsChanged += OnModsChanged; MapManager.Selected.ValueChanged += OnMapChanged; } /// <inheritdoc /> /// <summary> /// </summary> public override void Destroy() { // ReSharper disable once DelegateSubtraction MapManager.Selected.ValueChanged -= OnMapChanged; ModManager.ModsChanged -= OnModsChanged; base.Destroy(); } private void OnMapChanged(object sender, BindableValueChangedEventArgs<Map> e) => ScheduleUpdate(SetText); private void OnModsChanged(object sender, ModsChangedEventArgs e) => ScheduleUpdate(SetText); private int GetBpm() { if (MapManager.Selected.Value == null) return 0; return (int) (MapManager.Selected.Value.Bpm * ModHelper.GetRateFromMods(ModManager.Mods)); } private void SetText() => Value.Text = GetBpm().ToString(); } }
32
114
0.630319
[ "MPL-2.0" ]
bweekz/Quaver
Quaver.Shared/Screens/Selection/UI/FilterPanel/MapInformation/Metadata/FilterMetadataBpm.cs
1,504
C#
using System.IO; using CP77.CR2W.Reflection; using FastMember; using static CP77.CR2W.Types.Enums; namespace CP77.CR2W.Types { [REDMeta] public class EntityAttachementData : CVariable { [Ordinal(0)] [RED("attachementComponentName")] public CName AttachementComponentName { get; set; } [Ordinal(1)] [RED("nodeRef")] public NodeRef NodeRef { get; set; } [Ordinal(2)] [RED("ownerID")] public entEntityID OwnerID { get; set; } [Ordinal(3)] [RED("slotComponentName")] public CName SlotComponentName { get; set; } [Ordinal(4)] [RED("slotName")] public CName SlotName { get; set; } public EntityAttachementData(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name) { } } }
36.35
108
0.696011
[ "MIT" ]
Eingin/CP77Tools
CP77.CR2W/Types/cp77/EntityAttachementData.cs
708
C#
#if (NET_4_6 || NET_STANDARD_2_0) using System; using System.Text; namespace Unity.Properties.Codegen.CSharp { public enum BraceLayout { EndOfLine, EndOfLineSpace, NextLine, NextLineIndent } public class CodeStyle { public string Indent { get; set; } public BraceLayout BraceLayout { get; set; } public string BeginBrace { get; set; } public string EndBrace { get; set; } public string NewLine { get; set; } public static CodeStyle CSharp => new CodeStyle() { Indent = " ", BraceLayout = BraceLayout.NextLine, BeginBrace = "{", EndBrace = "}", NewLine = "\n" }; } public interface IScope : IDisposable { } public class CodeWriter { private class ActionScope : IScope { private Action m_Disposed; public ActionScope(Action disposed) { m_Disposed = disposed; } public void Dispose() { if (null == m_Disposed) { return; } m_Disposed.Invoke(); m_Disposed = null; } } private readonly StringBuilder m_StringBuilder; private int m_Indent; public CodeStyle CodeStyle { get; set; } public int Length { get { return m_StringBuilder.Length; } set { m_StringBuilder.Length = value; } } public CodeWriter() : this(CodeStyle.CSharp) { } public CodeWriter(CodeStyle codeStyle) { m_StringBuilder = new StringBuilder(); CodeStyle = codeStyle; } public CodeWriter Write(string value) { m_StringBuilder.Append(value); return this; } public CodeWriter Line() { m_StringBuilder.Append(CodeStyle.NewLine); return this; } public CodeWriter Line(string content) { WriteIndent(); m_StringBuilder.Append(content); m_StringBuilder.Append(CodeStyle.NewLine); return this; } public IScope Scope(string content, bool endLine = true) { return Scope(content, CodeStyle.BraceLayout, endLine); } public IScope Scope(string content, BraceLayout layout, bool endLine = true) { WriteIndent(); m_StringBuilder.Append(content); WriteBeginScope(layout); return new ActionScope(() => { WriteEndScope(layout, endLine); }); } private void WriteBeginScope(BraceLayout layout) { switch (layout) { case BraceLayout.EndOfLine: m_StringBuilder.Append(CodeStyle.BeginBrace); m_StringBuilder.Append(CodeStyle.NewLine); break; case BraceLayout.EndOfLineSpace: m_StringBuilder.AppendFormat(" {0}", CodeStyle.BeginBrace); m_StringBuilder.Append(CodeStyle.NewLine); break; case BraceLayout.NextLine: m_StringBuilder.Append(CodeStyle.NewLine); WriteIndent(); m_StringBuilder.Append(CodeStyle.BeginBrace); m_StringBuilder.Append(CodeStyle.NewLine); break; case BraceLayout.NextLineIndent: m_StringBuilder.Append(CodeStyle.NewLine); IncrementIndent(); WriteIndent(); m_StringBuilder.Append(CodeStyle.BeginBrace); m_StringBuilder.Append(CodeStyle.NewLine); break; } IncrementIndent(); } private void WriteEndScope(BraceLayout layout, bool endLine) { switch (layout) { case BraceLayout.EndOfLine: case BraceLayout.EndOfLineSpace: case BraceLayout.NextLine: DecrementIndent(); WriteIndent(); Write(CodeStyle.EndBrace); break; case BraceLayout.NextLineIndent: DecrementIndent(); Write(CodeStyle.EndBrace); WriteIndent(); DecrementIndent(); break; } if (endLine) { Write(CodeStyle.NewLine); } } public void IncrementIndent() { m_Indent++; } public void DecrementIndent() { if (m_Indent > 0) { m_Indent--; } } public void Clear() { m_StringBuilder.Length = 0; } public void WriteIndent() { for (var i = 0; i < m_Indent; i++) { m_StringBuilder.Append(CodeStyle.Indent); } } public override string ToString() { return m_StringBuilder.ToString(); } } } #endif // (NET_4_6 || NET_STANDARD_2_0)
26.222222
84
0.487288
[ "Apache-2.0" ]
ArttyOM/TsarJam
TsarJam/Library/PackageCache/com.unity.properties@0.4.0-preview/Unity.Properties.Codegen/CSharp/CodeWriter.cs
5,430
C#
// This file is part of Silk.NET. // // You may modify and distribute Silk.NET under the terms // of the MIT license. See the LICENSE file for details. using System; #pragma warning disable 1591 namespace Silk.NET.Vulkan { [Flags()] public enum SurfaceCounterFlagsEXT { SurfaceCounterVblankExt = 1, } }
17.473684
57
0.686747
[ "MIT" ]
AzyIsCool/Silk.NET
src/Vulkan/Silk.NET.Vulkan/Enums/SurfaceCounterFlagsEXT.gen.cs
332
C#
using Serilog.Configuration; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Sample.Enricher { public static class LoggingExtensions { public static Serilog.LoggerConfiguration WithReleaseNumber( this LoggerEnrichmentConfiguration enrich) { if (enrich == null) throw new ArgumentNullException(nameof(enrich)); return enrich.With<ReleaseNumberEnricher>(); } } }
24.333333
68
0.677104
[ "Apache-2.0" ]
KeiranWDigital/serilog-aspnetcore
samples/Sample/Enricher/LoggingExtensions.cs
513
C#
namespace MyCalc { partial class Form1 { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.panel1 = new System.Windows.Forms.Panel(); this.panel4 = new System.Windows.Forms.Panel(); this.labelResult = new System.Windows.Forms.Label(); this.panel3 = new System.Windows.Forms.Panel(); this.textBox2 = new System.Windows.Forms.TextBox(); this.textBox1 = new System.Windows.Forms.TextBox(); this.buttonEqual = new System.Windows.Forms.Button(); this.button4 = new System.Windows.Forms.Button(); this.buttonMul = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.buttonAdd = new System.Windows.Forms.Button(); this.panel2 = new System.Windows.Forms.Panel(); this.textBoxOp1 = new System.Windows.Forms.TextBox(); this.textBoxOp2 = new System.Windows.Forms.TextBox(); this.panel1.SuspendLayout(); this.panel4.SuspendLayout(); this.panel3.SuspendLayout(); this.panel2.SuspendLayout(); this.SuspendLayout(); // // panel1 // this.panel1.Controls.Add(this.panel4); this.panel1.Controls.Add(this.panel3); this.panel1.Controls.Add(this.panel2); this.panel1.Location = new System.Drawing.Point(20, 32); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(733, 519); this.panel1.TabIndex = 0; // // panel4 // this.panel4.Controls.Add(this.labelResult); this.panel4.Location = new System.Drawing.Point(38, 13); this.panel4.Name = "panel4"; this.panel4.Size = new System.Drawing.Size(450, 54); this.panel4.TabIndex = 2; // // labelResult // this.labelResult.AutoSize = true; this.labelResult.BackColor = System.Drawing.SystemColors.Control; this.labelResult.Font = new System.Drawing.Font("Microsoft YaHei UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.labelResult.Location = new System.Drawing.Point(9, 9); this.labelResult.Name = "labelResult"; this.labelResult.Size = new System.Drawing.Size(85, 31); this.labelResult.TabIndex = 0; this.labelResult.Text = "Result"; // // panel3 // this.panel3.Controls.Add(this.textBox2); this.panel3.Controls.Add(this.textBox1); this.panel3.Controls.Add(this.buttonEqual); this.panel3.Controls.Add(this.button4); this.panel3.Controls.Add(this.buttonMul); this.panel3.Controls.Add(this.button2); this.panel3.Controls.Add(this.buttonAdd); this.panel3.Font = new System.Drawing.Font("Microsoft YaHei UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.panel3.Location = new System.Drawing.Point(511, 13); this.panel3.Name = "panel3"; this.panel3.Size = new System.Drawing.Size(150, 486); this.panel3.TabIndex = 1; this.panel3.Paint += new System.Windows.Forms.PaintEventHandler(this.panel3_Paint); // // textBox2 // this.textBox2.Location = new System.Drawing.Point(-444, 393); this.textBox2.Name = "textBox2"; this.textBox2.Size = new System.Drawing.Size(377, 38); this.textBox2.TabIndex = 6; this.textBox2.TextChanged += new System.EventHandler(this.textBox2_TextChanged); // // textBox1 // this.textBox1.Location = new System.Drawing.Point(-459, 385); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(394, 38); this.textBox1.TabIndex = 5; // // buttonEqual // this.buttonEqual.Font = new System.Drawing.Font("Microsoft YaHei UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.buttonEqual.Location = new System.Drawing.Point(21, 378); this.buttonEqual.Name = "buttonEqual"; this.buttonEqual.Size = new System.Drawing.Size(109, 51); this.buttonEqual.TabIndex = 4; this.buttonEqual.Text = "="; this.buttonEqual.UseVisualStyleBackColor = true; this.buttonEqual.Click += new System.EventHandler(this.button5_Click); // // button4 // this.button4.Font = new System.Drawing.Font("Microsoft YaHei UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.button4.Location = new System.Drawing.Point(21, 242); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(109, 53); this.button4.TabIndex = 3; this.button4.Text = "÷"; this.button4.UseVisualStyleBackColor = true; this.button4.Click += new System.EventHandler(this.button4_Click); // // buttonMul // this.buttonMul.Font = new System.Drawing.Font("Microsoft YaHei UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.buttonMul.Location = new System.Drawing.Point(21, 164); this.buttonMul.Name = "buttonMul"; this.buttonMul.Size = new System.Drawing.Size(109, 53); this.buttonMul.TabIndex = 2; this.buttonMul.Text = "×"; this.buttonMul.UseVisualStyleBackColor = true; this.buttonMul.Click += new System.EventHandler(this.button3_Click); // // button2 // this.button2.Font = new System.Drawing.Font("Microsoft YaHei UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.button2.Location = new System.Drawing.Point(21, 85); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(109, 57); this.button2.TabIndex = 1; this.button2.Text = "-"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // // buttonAdd // this.buttonAdd.Font = new System.Drawing.Font("Microsoft YaHei UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.buttonAdd.Location = new System.Drawing.Point(21, 9); this.buttonAdd.Name = "buttonAdd"; this.buttonAdd.Size = new System.Drawing.Size(109, 55); this.buttonAdd.TabIndex = 0; this.buttonAdd.Text = "+"; this.buttonAdd.UseVisualStyleBackColor = true; this.buttonAdd.Click += new System.EventHandler(this.button1_Click_1); // // panel2 // this.panel2.Controls.Add(this.textBoxOp1); this.panel2.Controls.Add(this.textBoxOp2); this.panel2.Location = new System.Drawing.Point(38, 145); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(450, 129); this.panel2.TabIndex = 0; // // textBoxOp1 // this.textBoxOp1.Font = new System.Drawing.Font("Microsoft YaHei UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.textBoxOp1.Location = new System.Drawing.Point(9, 16); this.textBoxOp1.Name = "textBoxOp1"; this.textBoxOp1.Size = new System.Drawing.Size(355, 38); this.textBoxOp1.TabIndex = 1; // // textBoxOp2 // this.textBoxOp2.Font = new System.Drawing.Font("Microsoft YaHei UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.textBoxOp2.Location = new System.Drawing.Point(9, 70); this.textBoxOp2.Name = "textBoxOp2"; this.textBoxOp2.Size = new System.Drawing.Size(355, 38); this.textBoxOp2.TabIndex = 0; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(778, 566); this.Controls.Add(this.panel1); this.Name = "Form1"; this.Text = "Form1"; this.Load += new System.EventHandler(this.Form1_Load); this.panel1.ResumeLayout(false); this.panel4.ResumeLayout(false); this.panel4.PerformLayout(); this.panel3.ResumeLayout(false); this.panel3.PerformLayout(); this.panel2.ResumeLayout(false); this.panel2.PerformLayout(); this.ResumeLayout(false); } #endregion private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Label labelResult; private System.Windows.Forms.Panel panel3; private System.Windows.Forms.Button buttonEqual; private System.Windows.Forms.Button button4; private System.Windows.Forms.Button buttonMul; private System.Windows.Forms.Button button2; private System.Windows.Forms.Button buttonAdd; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.TextBox textBoxOp1; private System.Windows.Forms.TextBox textBoxOp2; } }
47.147826
156
0.589543
[ "Apache-2.0" ]
tanyong000/MyCalc
MyCalc/MyCalc/Form1.Designer.cs
10,848
C#
using System; using System.Collections.Generic; using dotnetCampus.Ipc.Messages; namespace dotnetCampus.Ipc.Context { /// <summary> /// 包含多条信息的上下文 /// </summary> /// 不开放,因为我不认为上层能用对 readonly struct IpcBufferMessageContext { /// <summary> /// 创建包含多条信息的上下文 /// </summary> /// <param name="summary">表示写入的是什么内容,用于调试</param> /// <param name="ipcMessageCommandType">命令类型,用于分开框架内的消息和业务的</param> /// <param name="ipcBufferMessageList"></param> public IpcBufferMessageContext(string summary, IpcMessageCommandType ipcMessageCommandType, params IpcMessageBody[] ipcBufferMessageList) { Tag = summary; IpcMessageCommandType = ipcMessageCommandType; IpcBufferMessageList = ipcBufferMessageList; } /// <summary> /// 命令类型,用于分开框架内的消息和业务的 /// </summary> public IpcMessageCommandType IpcMessageCommandType { get; } public IpcMessageBody[] IpcBufferMessageList { get; } /// <summary> /// 表示内容是什么用于调试 /// </summary> public string Tag { get; } public int Length { get { var length = 0; foreach (var ipcBufferMessage in IpcBufferMessageList) { length += ipcBufferMessage.Length; } return length; } } /// <summary> /// 和其他的合并然后创建新的 /// </summary> /// <param name="ipcMessageCommandType"></param> /// <param name="mergeBefore">将加入的内容合并到新的消息前面,为 true 合并到前面,否则合并到后面</param> /// <param name="ipcBufferMessageList"></param> /// <returns></returns> public IpcBufferMessageContext BuildWithCombine(IpcMessageCommandType ipcMessageCommandType, bool mergeBefore, params IpcMessageBody[] ipcBufferMessageList) => BuildWithCombine(Tag, ipcMessageCommandType, mergeBefore, ipcBufferMessageList); /// <summary> /// 和其他的合并然后创建新的 /// </summary> /// <param name="summary">表示写入的是什么内容,用于调试</param> /// <param name="ipcMessageCommandType"></param> /// <param name="mergeBefore">将加入的内容合并到新的消息前面,为 true 合并到前面,否则合并到后面</param> /// <param name="ipcBufferMessageList"></param> /// <returns></returns> public IpcBufferMessageContext BuildWithCombine(string summary, IpcMessageCommandType ipcMessageCommandType, bool mergeBefore, params IpcMessageBody[] ipcBufferMessageList) { var newIpcBufferMessageList = new List<IpcMessageBody>(ipcBufferMessageList.Length + IpcBufferMessageList.Length); if (mergeBefore) { newIpcBufferMessageList.AddRange(ipcBufferMessageList); newIpcBufferMessageList.AddRange(IpcBufferMessageList); } else { newIpcBufferMessageList.AddRange(IpcBufferMessageList); newIpcBufferMessageList.AddRange(ipcBufferMessageList); } return new IpcBufferMessageContext(summary, ipcMessageCommandType, newIpcBufferMessageList.ToArray()); } } }
36.067416
180
0.613084
[ "MIT" ]
dotnet-campus/dotnetCampus.Ipc
src/dotnetCampus.Ipc/Context/IpcBufferMessageContext.cs
3,612
C#
using System; using System.Collections.Generic; using System.Globalization; using System.Text; using Xamarin.Forms; using XamF.Controls.DataGrid.DataGridControl.Core.Enums; namespace XamF.Controls.DataGrid.Converters { public class OrderTypeToIconConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { string iconSource = string.Empty; if (value is OrderType order) { switch (order) { case OrderType.Ascending: iconSource = "iconDownArrow.png"; break; case OrderType.Decscending: iconSource = "iconUpArrow.png"; break; } } return iconSource; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }
29.027027
103
0.564246
[ "MIT" ]
abdoemad/XamF.Controls.DataGrid
XamF.Controls/XamF.Controls.DataGrid/XamF.Controls.DataGrid/Converters/OrderTypeToIconConverter.cs
1,076
C#
// (c) 2019 Manabu Tonosaki // Licensed under the MIT license. using System.Collections.Generic; using System.Linq; namespace Tono.Logic { /// <summary> /// solver for Traveling salesman problem /// all nodes are shuffled to try minimim cost /// </summary> /// <typeparam name="TUnit">node type</typeparam> /// <example> /// USAGE ================================== /// var tsp = new TspResolver /// { /// List = NODELIST, /// CostCaluclator = ***, /// }; /// tsp.Start(); /// Result : update NODELIST /// </example> public class TspResolverShuffle<TUnit> : TspResolverBase<TUnit> { public override void Start() { var indexes = Collection.Seq(List.Count).ToArray(); var buf = indexes.ToArray(); var res = Optimize(buf); for (var i = 0; i < res.Length; i++) { indexes[i] = res[i]; } var tmp = new List<TUnit>(List); List.Clear(); for (var i = 0; i < indexes.Length; i++) { List.Add(tmp[indexes[i]]); } } protected override double CalcCost(int[] p) { var ret = 0.0; for (var i = 1; i < p.Length; ++i) { ret += CostCaluclator(List[p[i - 1]], List[p[i]], CaluclationStage.Normal); } return ret; } } }
27.660377
91
0.473397
[ "MIT" ]
mtonosaki/Tono
TonoLogic/TspResolverShuffle.cs
1,468
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("WebRole1")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("WebRole1")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("bb0dbea4-7f31-487f-9ba3-beab9659933e")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
37.333333
84
0.75
[ "MIT" ]
Azure-Samples/cloud-services-dotnet-multiple-websites-in-one-webrole
CSharp/MultiWebsitesOneWebRole/WebRole1/Properties/AssemblyInfo.cs
1,347
C#
using System.Collections.Generic; using System; using System.Linq; public class CosineScoringFunction : ScoringFunction { public override Scorer CreateScorer() { return new CosineScorer(); } private class CosineScorer : Scorer { private readonly Scorer InnerProductScorer = new InnerProductScoringFunction().CreateScorer(); private (double, double) GetNorms(EntityProperties entity, ClassFrequencies classFrequencies) { const double pow = 0.5; double eSum = entity.Properties.Count; double cSum = classFrequencies.Properties .Select(p => p*p) .Sum(); return (Math.Pow(eSum, pow), Math.Pow(cSum, pow)); } public override float Score(EntityProperties entity, ClassFrequencies classFrequencies) { var ip = InnerProductScorer.Score(entity, classFrequencies); (var a, var b) = GetNorms(entity, classFrequencies); return (float) (ip / a / b); } } }
31.6
102
0.594033
[ "MIT" ]
jag2j/capstone-wikidata-2021
tools/scores/functions/Cosine.cs
1,106
C#
using UnityEngine; namespace SimpleNodeEditor { public interface INode: IDrawer { Rect Rect { get; } } }
14
35
0.626984
[ "MIT" ]
jamcar23/SimpleNodeEditor
Assets/Simple Node Editor/Scripts/Interfaces/INode.cs
128
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNextGen.DocumentDB.V20210115.Inputs { /// <summary> /// Virtual Network ACL Rule object /// </summary> public sealed class VirtualNetworkRuleArgs : Pulumi.ResourceArgs { /// <summary> /// Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. /// </summary> [Input("id")] public Input<string>? Id { get; set; } /// <summary> /// Create firewall rule before the virtual network has vnet service endpoint enabled. /// </summary> [Input("ignoreMissingVNetServiceEndpoint")] public Input<bool>? IgnoreMissingVNetServiceEndpoint { get; set; } public VirtualNetworkRuleArgs() { } } }
33.114286
195
0.670406
[ "Apache-2.0" ]
pulumi/pulumi-azure-nextgen
sdk/dotnet/DocumentDB/V20210115/Inputs/VirtualNetworkRuleArgs.cs
1,159
C#
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; using UnityEngine.UI; namespace Simple_UI { /// <summary> /// Example Controller to illustrate how Simple_Login+Register works /// </summary> public class ExampleLoginRegisterController : Singleton<ExampleLoginRegisterController> { [Header("Users")] [SerializeField] private List<User> registerUsersList = new List<User>(); [SerializeField] private User currentUser = null; public User CurrentUser { get { return currentUser; } set //Not called if change property from editor { currentUser = value; SetDebugInformation(); } } [Header("Debug Info")] [SerializeField] private Text debugInformationText = null; private void Start() { UIController.s_Instance.StartUI(); } public void SetCurrentUser(string username, string password) { try { CurrentUser = registerUsersList.Single(u => (u.Username == username) && (u.Password == password)); } catch(InvalidOperationException) { CurrentUser = null; } } public void RegisterNewUser(User user) { registerUsersList.Add(user); } #region Login/Register Verify public bool VerifyIfUsernameMatchPassword(string username, string password) { return registerUsersList.Any(u => (u.Username == username) && (u.Password == password)); } public bool VerifyIfUsernameExists(string username) { return registerUsersList.Any(u => u.Username == username); } public bool VerifyIfEmailExists(string email) { return registerUsersList.Any(u => u.Email == email); } #endregion private void SetDebugInformation() { this.debugInformationText.text = "DEBUG INFORMATION \n"; if (this.currentUser != null) { this.debugInformationText.text += "Username: " + this.currentUser.Username + "\n" + "Password: " + this.currentUser.Password + "\n" + "Email: " + this.currentUser.Email; } } } }
30.6
114
0.563725
[ "MIT" ]
EricBatlle/SimpleUnityUtils
Assets/Simple_UI/Simple_Login+Register/ExampleLoginRegisterController.cs
2,450
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using RESTful_Testful.Controllers; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using RESTful_Testful.Models; using System.Net; using System.Net.Http; using System.Web.Http; using System.Web.Http.Routing; namespace RESTful_Testful.Controllers.Tests { [TestClass()] public class GameControllerTests { [TestMethod()] public void GetAllGamesTestIsCorrectType() { //arrange GameRepository gr = new GameRepository(); GameController gc = new GameController(gr); //act IEnumerable<Game> listOfAllGames = gc.databasePlaceholder.GetAll(); //assert Assert.IsInstanceOfType(listOfAllGames, typeof(IEnumerable<Game>)); } [TestMethod()] public void GetAllGamesTestIsNotNull() { //arrange GameRepository gr = new GameRepository(); GameController gc = new GameController(gr); //act IEnumerable<Game> listOfAllGames = gc.databasePlaceholder.GetAll(); //assert Assert.IsNotNull(listOfAllGames); } [TestMethod()] public void GetGameByIDTestForType() { //arrange GameRepository gr = new GameRepository(); GameController gc = new GameController(gr); Game game = new Game(); //act game = gc.GetGameByID(0); //assert Assert.IsInstanceOfType(game, typeof(Game)); } [TestMethod()] public void GetGameByIDTestForNotNull() { //arrange GameRepository gr = new GameRepository(); GameController gc = new GameController(gr); Game game = new Game(); //act // there exists no id=3, therefore, should return null game = gc.GetGameByID(1); //assert Assert.IsNotNull(game); } // TODO: fix, // this is correct idea, but an error exists [TestMethod()] [ExpectedException(typeof(HttpResponseException))] public void GetGameByIDTestForIfNullThrowException() { //arrange GameRepository gr = new GameRepository(); GameController gc = new GameController(gr); Game game = new Game(); //act // there exists no id=3, therefore, should return null game = gc.GetGameByID(3); //assert //if method passes -> code will not reach this line Assert.Fail(); } // //https://www.asp.net/web-api/overview/testing-and-debugging/unit-testing-controllers-in-web-api // [TestMethod()] // public void PostGameTestForReturnHttpResponseMessage() // { // //arrange // var mockIGameRepos = new Moq.Mock<IGameRepository>(); // Game game = null; // mockIGameRepos.Setup(g => g.Get(It.IsAny<int>())).Returns(game); // RESTful_Testful.Controllers.GameController gc = new GameController(mockIGameRepos.Object); // gc.Request = new HttpRequestMessage // { // RequestUri = new Uri("http://localhost/api/products"); // }; // gc.Configuration= new HttpConfiguration(); // gc.Configuration.Routes.MapHttpBatchRoute // ( // name: "DefaultApi", // routeTemplate: "api/{controller}/{id}", // defaults: new { id = RouteParameter.Optional } // ); // gc.RequestContext.RouteData = new HttpRouteData // ( // route: new HttpRoute(), // values: new HttpRouteValueDictionary{{"controller", "products"}} // ); // // Act //Product product = new Product() { Id = 42, Name = "Product1" }; //var response = controller.Post(product); //// Assert //Assert.AreEqual("http://localhost/api/products/42", response.Headers.Location.AbsoluteUri); // } [TestMethod()] public void PutGameTest() { //arrange GameRepository gr = new GameRepository(); GameController gc = new GameController(gr); Game game = gc.databasePlaceholder.gameList.ElementAt(0); //act bool gameWasPut = gc.PutGame(game); //assert Assert.IsTrue(gameWasPut); } [TestMethod()] [ExpectedException(typeof(ArgumentNullException))] public void PutGameTestExceptionHandling() { //arrange GameRepository gr = new GameRepository(); GameController gc = new GameController(gr); Game game = null; //act bool gameWasPut = gc.PutGame(game); //assert Assert.IsTrue(gameWasPut); } [TestMethod()] public void DeleteGameTest() { //arrange GameRepository gr = new GameRepository(); GameController gc = new GameController(gr); //act //attempts to delete a game taking id=0 gc.DeleteGame(1); int newGameCount = gc.databasePlaceholder.gameList.Count; //assert Assert.AreEqual(1, newGameCount); } } }
29.633508
110
0.54311
[ "MIT" ]
LightReborn/TeamROM-Web-Crawler
RESTful_Testful/RESTful_Testful.Tests/Controllers/GameControllerTests.cs
5,662
C#
namespace HealthCare020.Core.Models { public class PregledDtoEL:PregledDto { public string Doktor { get; set; } public PacijentDtoEL Pacijent { get; set; } } }
21
51
0.645503
[ "MIT" ]
fahirmdz/HealthCare020
HealthCare020.Core/Models/PregledDtoEL.cs
191
C#
using CatsListingDemo.Domain; using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; namespace CatsListingDemo.BusinessInterfaces { /// <summary> /// Defines the contract methods for the business layer in order to process a <see cref="Domain.PetOwner"/> object. /// </summary> public interface IPetOwnerService { /// <summary> /// Gets a collection of <see cref="PetOwner"/> where each person owns at least one pet of the type /// specified by <paramref name="petType"/>. /// </summary> /// <param name="petType">The type of pet to be used as a filter.</param> /// <returns>A filtered collection of <see cref="PetOwner"/>.</returns> Task <List<PetOwner>> GetAllByAsync(PetType petType); } }
35.434783
119
0.663804
[ "MIT" ]
mendezgabriel/cats-listing-demo-dotnet-core
CatsListingDemo.BusinessInterfaces/IPetOwnerService.cs
817
C#
// ReSharper disable InconsistentNaming // ReSharper disable ArrangeAccessorOwnerBody // ReSharper disable StringLiteralTypo using System; using Il2CppSystem.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using DataHelper; using UnhollowerBaseLib; using KeyNotFoundException = System.Collections.Generic.KeyNotFoundException; using StringDictionary = System.Collections.Generic.Dictionary<string, string>; using RStringDictionary = System.Collections.Generic.IReadOnlyDictionary<string, string>; namespace GunfireLib.Data.Extensions { public static partial class Extensions { public static string GetEnglishName(this levelconfigdataclass baseClass) => Classes.LevelConfigDataClass.GetEnglishName(baseClass.Name); public static string GetEnglishDevName(this levelconfigdataclass baseClass) => Classes.LevelConfigDataClass.GetEnglishDevName(baseClass.DevName); } } namespace GunfireLib.Data.Classes { public class LevelConfigDataClass { private readonly int key; private readonly Dictionary<int, levelconfigdataclass> levelList; public LevelConfigDataClass(int key, Dictionary<int, levelconfigdataclass> levelList) { this.key = key; this.levelList = levelList; } public int ID { get => levelList[key].ID; } public Dictionary<int, OneLevelInfo> Info { get => levelList[key].Info; } public int LevelID { get => levelList[key].LevelID; } public int ModelID { get => levelList[key].ModelID; } public string Name { get => levelList[key].Name; } public string EnglishName { get => GetEnglishName(levelList[key].Name); } public string DevName { get => levelList[key].DevName; } public string EnglishDevName { get => GetEnglishDevName(levelList[key].DevName); } internal static string GetEnglishName(string name) { if (string.IsNullOrWhiteSpace(name)) return ""; try { return LevelNames[name]; } catch (Exception ex) when (ex is Il2CppException || ex is KeyNotFoundException) { return name; } } internal static string GetEnglishDevName(string devName) { if (string.IsNullOrWhiteSpace(devName)) return ""; try { return DevLevelNames[devName]; } catch (Exception ex) when (ex is Il2CppException || ex is KeyNotFoundException) { devName = devName.Replace("(", "("); devName = devName.Replace(")", ")"); System.Collections.Generic.List<string> matches = Regex.Matches(devName, "[^\x00-\x7F]+") .OfType<Match>().Select(m => m.Groups[0].Value).ToList(); foreach (string match in matches) { try { devName = devName.Replace(match, DevLevelNames[match]); } catch (Exception exc) when (exc is Il2CppException || exc is KeyNotFoundException) { } } return devName; } } public static RStringDictionary LevelNames = new StringDictionary() { { "龙陵墓穴-入口", "Dragon Tomb-Entrance" }, { "幽山曲径", "Winding Path of the Tranquil Mountain" }, { "龙陵墓穴-第一关", "Dragon Tomb-Level 1" }, { "龙陵墓穴-第二关", "Dragon Tomb-Level 2" }, { "龙陵墓穴-第三关", "Dragon Tomb-Level 3" }, { "龙陵墓穴-第四关", "Dragon Tomb-Level 4" }, { "龙陵墓穴-长生殿", "Dragon Tomb-Hall of Eternal Life" }, { "安西大漠-入口", "Anxi Desert-Entrance" }, { "安西大漠-第一关", "Anxi Desert-First Pass" }, { "大漠遗址", "Desert ruins" }, { "安西大漠-第二关", "Anxi Desert-Second Level" }, { "安西大漠-第四关", "Anxi Desert-Fourth Level" }, { "安西大漠-行刺", "Anxi Desert-Assassination" }, { "安西大漠-第三关", "Anxi Desert-Third Level" }, { "安西大漠-流沙泊", "Anxi Desert-Quicksand" }, { "山海双屿—入口", "Shanhai Shuangyu—Entrance" }, { "山海双屿-第一关", "Shanhai Shuangyu-First Pass" }, { "山海双屿-第二关", "Shanhai Shuangyu-Second Pass" }, { "山海双屿-第三关", "Shanhai Shuangyu-Third Pass" }, { "第三幕首领-测试", "Act Three Boss-Test" }, { "山海双屿-定海湾", "" }, { "四幕-第一关", "Act Four-Level One" }, { "龙陵墓穴-第一层", "Dragon Tomb-First Floor" }, { "龙陵邃室", "" }, { "龙陵墓穴-第二层", "Dragon Tomb-Second Floor" }, { "npc隐藏美术测试", "npc hidden art test" }, { "汀洲小岸", "" }, { "测试关卡", "Test level" }, { "美术第二幕测试关卡", "Act Two art test level" }, { "组队BOSS", "Team BOSS" } }; public static RStringDictionary DevLevelNames = new StringDictionary() { { "关", "Level" }, { "一幕", "Act One" }, { "美术测试场景", "Art test scene" }, { "美术测试关卡", "Art test level" }, { "守护", "Guardian" }, { "时", "Time" }, { "测试", "test" }, { "防守战", "Defensive Battle" }, { "关护送", "Escort" }, { "手游", "Mobile game" }, { "试玩", "Demo" }, { "特效测试路线", "Special effects test route" }, { "石巨人", "Stone giant" }, { "二幕准备室", "Act Two Preparation Room" }, { "二幕精英关", "Act Two Elite Level" }, { "二幕", "Act Two" }, { "二幕生存关", "Act Two Survival" }, { "二幕美术测试场景", "Act Two art test scene" }, { "二幕马贼关", "Act Two Horsehead Level" }, { "二幕流寇关", "Act Two Rogue Level" }, { "二幕守护", "Act Two Guardian" }, { "风神", "Wind God" }, { "三幕—准备室", "Act Three-Preparation Room" }, { "三幕", "Act Three" }, { "测试场景", "Test Scene" }, { "第三幕", "Act Three" }, { "防守", "Defensive" }, { "首领", "Boss" }, { "虬蛇", "Horned Snake" }, { "四幕", "Act Four" }, { "组队一幕一关", "" }, { "精英独角金龟关卡", "Elite One-horned Beetle Level" }, { "精英马头关", "Elite Horse Head Pass" }, { "精英赵云关", "" }, { "精英甲虫关", "Elite Beetle" }, { "组队二关", "Team Two" }, { "二幕喷火跳跃关", "Act Two Spitfire Parkour" }, { "二幕跳跃关", "Act Two Parkour" }, { "二幕滚石关", "Act Two Rolling Stones" }, { "二幕跳跃关迭代", "Act Two Parkour Iteration" }, { "三幕战斗关", "" }, { "三幕跳跃关", "Act Three Parkour" }, { "迭代", "Iteration" }, { "守护关", "Guardian Pass" }, }; } }
24.241784
105
0.340757
[ "MIT" ]
ardittristan/GunfireMod
GunfireLib/Data/Classes/LevelConfigDataClass.cs
11,057
C#
/* This interfaces with the SteamVR input system, sending commands to the vehicle. Add this script to the main vehicle. */ using System.Collections; using System.Collections.Generic; using UnityEngine; using Valve.VR; public class ControllerVR : MonoBehaviour { // The main simulator private VehicleProperties vehicle; // Offset between VR play area and simulated ATV public GameObject VRAreaOffset; private bool setupVRArea=false; // Used for banking user's head as they make turns public GameObject BankingTurns; public float bank=0.0f; // VR copies of physical objects, that track with the user public GameObject rollcage; public GameObject handlebars; public SteamVR_Action_Single throttleAction=SteamVR_Input.GetAction<SteamVR_Action_Single>("default", "Squeeze"); public SteamVR_Input_Sources throttleSource=SteamVR_Input_Sources.RightHand; public SteamVR_Action_Single brakeAction=SteamVR_Input.GetAction<SteamVR_Action_Single>("default", "Squeeze"); public SteamVR_Input_Sources brakeSource=SteamVR_Input_Sources.LeftHand; public SteamVR_Action_Pose framePoser=SteamVR_Input.GetAction<SteamVR_Action_Pose>("default", "Pose"); public SteamVR_Input_Sources frameSource=SteamVR_Input_Sources.LeftHand; public SteamVR_Action_Pose steerPoser=SteamVR_Input.GetAction<SteamVR_Action_Pose>("default", "Pose"); public SteamVR_Input_Sources steerSource=SteamVR_Input_Sources.RightHand; public SteamVR_Action_Pose headPoser=SteamVR_Input.GetAction<SteamVR_Action_Pose>("default", "Pose"); public SteamVR_Input_Sources headSource=SteamVR_Input_Sources.Head; // Start is called before the first frame update void Start() { vehicle=GetComponent<VehicleProperties>(); vehicle.is_VR=true; } public float throttle=0.0f; public float brake=0.0f; public Quaternion steerQuat; public Vector3 steerAxis; public float steer; //<- handlebar rotation (only public for debugging) public Vector3 localHead; public Vector3 worldHead; // Update is called once per frame void FixedUpdate() { if (vehicle) { // Apply keyboard motor and steering controls throttle=throttleAction.GetAxis(throttleSource); brake=brakeAction.GetAxis(brakeSource); vehicle.complementary_filter(0.1f,ref vehicle.cur_motor_power,throttle-brake); Vector3 headPos=headPoser.GetLocalPosition(headSource); localHead=headPos; Quaternion headRot=headPoser.GetLocalRotation(headSource); // Slightly bank the user's head during turns, // so the real gravity vector lines up with apparent acceleration. // Disadvantage: mismatch in user's roll gyros. vehicle.complementary_filter(0.1f,ref bank,vehicle.centripital); if (BankingTurns) { // Apply the turn // Reset full transform BankingTurns.transform.localRotation=Quaternion.Euler(0.0f,0.0f,0.0f); BankingTurns.transform.localPosition=new Vector3(0.0f,0.0f,0.0f); // Rotate around the user's head position worldHead=BankingTurns.transform.TransformPoint(headPos); Vector3 axis=BankingTurns.transform.forward; // vehicle.last_velocity; axis.y=0.0f; BankingTurns.transform.RotateAround(worldHead,axis,-30.0f*bank); } Vector3 framePos=framePoser.GetLocalPosition(frameSource); //Quaternion frameRot=framePoser.GetLocalRotation(frameSource);7 if (VRAreaOffset && !setupVRArea && framePos.x!=0.0f) { // Locate VR camera relative to the physical frame: // SteamVR does wacky things with the initial camera position, // putting 0,0,0 as the center of the Steam VR room area. VRAreaOffset.transform.localPosition=new Vector3(-framePos.x,-framePos.y+1.05f-0.4f,-framePos.z+0.7f); setupVRArea=true; } // Plant rollcage relative to the physical frame //rollcage.transform.localPosition=framePos+new Vector3(0.0f,-0.5f,-1.0f); //rollcage.transform.localRotation=frameRot*Quaternion.Euler(-60.0f,180.0f,0.0f); //handlebars.transform.localPosition=framePos+new Vector3(0.0f,-0.2f,-0.10f); Vector3 steerPos = steerPoser.GetLocalPosition(steerSource); Quaternion steerRot = steerPoser.GetLocalRotation(steerSource); steer = steerRot.eulerAngles.y; //vehicle.complementary_filter(0.5f, ref vehicle.cur_steer, steer); vehicle.cur_steer = steer; handlebars.transform.localRotation = Quaternion.Slerp(handlebars.transform.localRotation, Quaternion.AngleAxis(steer, Vector3.up), Time.deltaTime*10); } } }
45.427273
162
0.68381
[ "Unlicense" ]
YaliWang2019/AK_ATV
AK_ATV_Simulator/Assets/Scripts/ControllerVR.cs
4,999
C#
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. using AuthJanitor.CryptographicImplementations; using AuthJanitor.Providers.Azure; using AuthJanitor.Providers.Capabilities; using Azure; using Azure.Security.KeyVault.Secrets; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace AuthJanitor.Providers.KeyVault { [Provider(Name = "Key Vault Secret", Description = "Regenerates a Key Vault Secret with a given length", SvgImage = ProviderImages.KEY_VAULT_SVG)] public class KeyVaultSecretRekeyableObjectProvider : AuthJanitorProvider<KeyVaultSecretConfiguration>, ICanRekey, ICanRunSanityTests, ICanGenerateTemporarySecretValue { private readonly ICryptographicImplementation _cryptographicImplementation; public KeyVaultSecretRekeyableObjectProvider( ILogger<KeyVaultSecretRekeyableObjectProvider> logger, ICryptographicImplementation cryptographicImplementation) : base(logger) { _cryptographicImplementation = cryptographicImplementation; } public async Task Test() { var secret = await GetSecretClient().GetSecretAsync(Configuration.SecretName); if (secret == null) throw new Exception("Could not access Key Vault Secret"); } public async Task<RegeneratedSecret> GenerateTemporarySecretValue() { Logger.LogInformation("Getting temporary secret based on current version..."); var client = GetSecretClient(); Response<KeyVaultSecret> currentSecret = await client.GetSecretAsync(Configuration.SecretName); Logger.LogInformation("Successfully retrieved temporary secret!"); return new RegeneratedSecret() { Expiry = currentSecret.Value.Properties.ExpiresOn.Value, UserHint = Configuration.UserHint, NewSecretValue = currentSecret.Value.Value.GetSecureString() }; } public async Task<RegeneratedSecret> Rekey(TimeSpan requestedValidPeriod) { Logger.LogInformation("Getting current Secret details from Secret name '{SecretName}'", Configuration.SecretName); var client = GetSecretClient(); Response<KeyVaultSecret> currentSecret = await client.GetSecretAsync(Configuration.SecretName); // Create a new version of the Secret KeyVaultSecret newSecret = new KeyVaultSecret( Configuration.SecretName, await _cryptographicImplementation.GenerateCryptographicallyRandomString(Configuration.SecretLength)); // Copy in metadata from the old Secret if it existed if (currentSecret != null && currentSecret.Value != null) { newSecret.Properties.ContentType = currentSecret.Value.Properties.ContentType; foreach (KeyValuePair<string, string> tag in currentSecret.Value.Properties.Tags) { newSecret.Properties.Tags.Add(tag.Key, tag.Value); } } newSecret.Properties.NotBefore = DateTimeOffset.UtcNow; newSecret.Properties.ExpiresOn = DateTimeOffset.UtcNow + requestedValidPeriod; Logger.LogInformation("Committing new Secret with name '{SecretName}'", newSecret.Name); Response<KeyVaultSecret> secretResponse = await client.SetSecretAsync(newSecret); Logger.LogInformation("Successfully committed '{SecretName}'", newSecret.Name); return new RegeneratedSecret() { Expiry = newSecret.Properties.ExpiresOn.Value, UserHint = Configuration.UserHint, NewSecretValue = secretResponse.Value.Value.GetSecureString() }; } public override IList<RiskyConfigurationItem> GetRisks() { List<RiskyConfigurationItem> issues = new List<RiskyConfigurationItem>(); if (Configuration.SecretLength < 16) { issues.Add(new RiskyConfigurationItem() { Score = 80, Risk = $"The specified secret length is extremely short ({Configuration.SecretLength} characters), making it easier to compromise through brute force attacks", Recommendation = "Increase the length of the secret to over 32 characters; prefer 64 or up." }); } else if (Configuration.SecretLength < 32) { issues.Add(new RiskyConfigurationItem() { Score = 40, Risk = $"The specified secret length is somewhat short ({Configuration.SecretLength} characters), making it easier to compromise through brute force attacks", Recommendation = "Increase the length of the secret to over 32 characters; prefer 64 or up." }); } return issues; } public override IList<RiskyConfigurationItem> GetRisks(TimeSpan requestedValidPeriod) { List<RiskyConfigurationItem> issues = new List<RiskyConfigurationItem>(); if (requestedValidPeriod == TimeSpan.MaxValue) { issues.Add(new RiskyConfigurationItem() { Score = 80, Risk = $"The specified Valid Period is TimeSpan.MaxValue, which is effectively Infinity; it is dangerous to allow infinite periods of validity because it allows an object's prior version to be available after the object has been rotated", Recommendation = "Specify a reasonable value for Valid Period" }); } else if (requestedValidPeriod == TimeSpan.Zero) { issues.Add(new RiskyConfigurationItem() { Score = 100, Risk = $"The specified Valid Period is zero, so this object will never be allowed to be used", Recommendation = "Specify a reasonable value for Valid Period" }); } return issues.Union(GetRisks()).ToList(); } public override string GetDescription() => $"Regenerates the secret called '{Configuration.SecretName}' from vault " + $"'{Configuration.VaultName}' with a length of {Configuration.SecretLength}."; private SecretClient GetSecretClient() => new SecretClient(new Uri($"https://{Configuration.VaultName}.vault.azure.net/"), Credential.CreateTokenCredential()); } }
46.664384
258
0.632467
[ "MIT" ]
ConnectionMaster/AuthJanitor
src/AuthJanitor.Providers.KeyVault/KeyVaultSecretRekeyableObjectProvider.cs
6,815
C#
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) Microsoft Corporation. All rights reserved. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////namespace System namespace System { using System; [Serializable()] public class SystemException : Exception { public SystemException() : base() { } public SystemException(String message) : base(message) { } public SystemException(String message, Exception innerException) : base(message, innerException) { } } }
30.3
216
0.315732
[ "Apache-2.0" ]
Sirokujira/MicroFrameworkPK_v4_3
Framework/Subset_of_CorLib/System/SystemException.cs
909
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; namespace WebPWrecover { public class Program { public static void Main(string[] args) { CreateHostBuilder(args).Build().Run(); } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }); } }
25.703704
70
0.645533
[ "MIT" ]
intrepion/microsoft-confirmation-password-recovery-tutorial
WebPWrecover/Program.cs
694
C#
using BeardedManStudios.Forge.Networking; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Collections.Generic; using System.Linq; namespace UnitTests.Source.UDP { [TestClass] public class MultiClientTests : BaseTest { private static ushort currentPort; private static UDPServer server = null; [TestInitialize] public void CreateServer() { currentPort = BaseUDPTests.GetPort(); server = new UDPServer(32); server.Connect(port: currentPort); Console.WriteLine("Using port number: " + currentPort); } [TestCleanup] public void DisposeServer() { server.Disconnect(false); WaitFor(() => { return !server.IsBound; }); } [TestMethod] public void Connect2ClientsTest() { UDPClient client1 = new UDPClient(); UDPClient client2 = new UDPClient(); Console.WriteLine("Using port number: " + currentPort); client1.Connect("127.0.0.1", currentPort); Assert.IsTrue(client1.IsBound); WaitFor(() => { return client1.IsConnected; }); client2.Connect("127.0.0.1", currentPort); Assert.IsTrue(client2.IsBound); WaitFor(() => { return client2.IsConnected; }); client1.Disconnect(false); client2.Disconnect(false); WaitFor(() => { return !client1.IsConnected; }); Assert.IsFalse(client1.IsBound); WaitFor(() => { return !client2.IsConnected; }); Assert.IsFalse(client2.IsBound); } [TestMethod] public void Connect3ClientsAtOnceTest() { int i, clientCount = 3; List<UDPClient> clients = new List<UDPClient>(clientCount); for (i = 0; i < clientCount; i++) clients.Add(new UDPClient()); for (i = 0; i < clients.Count; i++) { clients[i].Connect("127.0.0.1", currentPort); Assert.IsTrue(clients[i].IsBound); WaitFor(() => { return clients[i].IsConnected; }); } for (i = 0; i < clients.Count; i++) clients[i].Disconnect(false); WaitFor(() => { return clients.Count(c => c.IsConnected) == 0; }); for (i = 0; i < clients.Count; i++) Assert.IsFalse(clients[i].IsBound); } [TestMethod] public void MultipleReconnectTest() { UDPClient singleClient; int i, clientCount = 4; for (i = 0; i < clientCount; i++) { singleClient = new UDPClient(); singleClient.Connect("127.0.0.1", currentPort); Assert.IsTrue(singleClient.IsBound); WaitFor(() => { return singleClient.IsConnected; }); singleClient.Disconnect(false); WaitFor(() => { return !singleClient.IsConnected; }); Assert.IsFalse(singleClient.IsBound); singleClient = null; WaitFor(() => { return server.Players.Count == 1; }); } } } }
25.637255
69
0.662715
[ "Apache-2.0" ]
BeardedManStudios/ForgeNetworkingRemastered
UnitTests/Source/UDP/MultiClientTests.cs
2,617
C#
using System; using System.Collections.Generic; using Microsoft.Maui.Controls; using NUnit.Framework; namespace Microsoft.Maui.Controls.Xaml.UnitTests { public partial class Unreported003 : ContentPage { public Unreported003() { InitializeComponent(); } public Unreported003(bool useCompiledXaml) { //this stub will be replaced at compile time } [TestFixture] class Tests { [TestCase(true), TestCase(false)] public void AllowCtorArgsForValueTypes(bool useCompiledXaml) { var page = new Unreported003(useCompiledXaml); } } } }
19.1
63
0.732984
[ "MIT" ]
10088/maui
src/Controls/tests/Xaml.UnitTests/Issues/Unreported003.xaml.cs
573
C#
//------------------------------------------------------------ // Game Framework // Copyright © 2013-2020 Jiang Yin. All rights reserved. // Homepage: https://gameframework.cn/ // Feedback: mailto:ellan@gameframework.cn //------------------------------------------------------------ using GameFramework.Resource; using System.Collections; using UnityEngine; #if UNITY_5_4_OR_NEWER using UnityEngine.Networking; #endif using UnityEngine.SceneManagement; namespace UnityGameFramework.Runtime { /// <summary> /// 默认资源辅助器。 /// </summary> public class DefaultResourceHelper : ResourceHelperBase { /// <summary> /// 直接从指定文件路径读取数据流。 /// </summary> /// <param name="fileUri">文件路径。</param> /// <param name="loadBytesCallback">读取数据流回调函数。</param> public override void LoadBytes(string fileUri, LoadBytesCallback loadBytesCallback) { StartCoroutine(LoadBytesCo(fileUri, loadBytesCallback)); } /// <summary> /// 卸载场景。 /// </summary> /// <param name="sceneAssetName">场景资源名称。</param> /// <param name="unloadSceneCallbacks">卸载场景回调函数集。</param> /// <param name="userData">用户自定义数据。</param> public override void UnloadScene(string sceneAssetName, UnloadSceneCallbacks unloadSceneCallbacks, object userData) { #if UNITY_5_5_OR_NEWER if (gameObject.activeInHierarchy) { StartCoroutine(UnloadSceneCo(sceneAssetName, unloadSceneCallbacks, userData)); } else { SceneManager.UnloadSceneAsync(SceneComponent.GetSceneName(sceneAssetName)); } #else if (SceneManager.UnloadScene(SceneComponent.GetSceneName(sceneAssetName))) { if (unloadSceneCallbacks.UnloadSceneSuccessCallback != null) { unloadSceneCallbacks.UnloadSceneSuccessCallback(sceneAssetName, userData); } } else { if (unloadSceneCallbacks.UnloadSceneFailureCallback != null) { unloadSceneCallbacks.UnloadSceneFailureCallback(sceneAssetName, userData); } } #endif } /// <summary> /// 释放资源。 /// </summary> /// <param name="objectToRelease">要释放的资源。</param> public override void Release(object objectToRelease) { AssetBundle assetBundle = objectToRelease as AssetBundle; if (assetBundle != null) { assetBundle.Unload(true); return; } /* Unity 当前 Resources.UnloadAsset 在 iOS 设备上会导致一些诡异问题,先不用这部分 SceneAsset sceneAsset = objectToRelease as SceneAsset; if (sceneAsset != null) { return; } Object unityObject = objectToRelease as Object; if (unityObject == null) { Log.Warning("Asset is invalid."); return; } if (unityObject is GameObject || unityObject is MonoBehaviour) { // UnloadAsset may only be used on individual assets and can not be used on GameObject's / Components or AssetBundles. return; } Resources.UnloadAsset(unityObject); */ } private void Start() { } private IEnumerator LoadBytesCo(string fileUri, LoadBytesCallback loadBytesCallback) { byte[] bytes = null; string errorMessage = null; #if UNITY_5_4_OR_NEWER UnityWebRequest unityWebRequest = UnityWebRequest.Get(fileUri); #if UNITY_2017_2_OR_NEWER yield return unityWebRequest.SendWebRequest(); #else yield return unityWebRequest.Send(); #endif bool isError = false; #if UNITY_2017_1_OR_NEWER isError = unityWebRequest.isNetworkError || unityWebRequest.isHttpError; #else isError = unityWebRequest.isError; #endif bytes = unityWebRequest.downloadHandler.data; errorMessage = isError ? unityWebRequest.error : null; unityWebRequest.Dispose(); #else WWW www = new WWW(fileUri); yield return www; bytes = www.bytes; errorMessage = www.error; www.Dispose(); #endif if (loadBytesCallback != null) { loadBytesCallback(fileUri, bytes, errorMessage); } } #if UNITY_5_5_OR_NEWER private IEnumerator UnloadSceneCo(string sceneAssetName, UnloadSceneCallbacks unloadSceneCallbacks, object userData) { AsyncOperation asyncOperation = SceneManager.UnloadSceneAsync(SceneComponent.GetSceneName(sceneAssetName)); if (asyncOperation == null) { yield break; } yield return asyncOperation; if (asyncOperation.allowSceneActivation) { if (unloadSceneCallbacks.UnloadSceneSuccessCallback != null) { unloadSceneCallbacks.UnloadSceneSuccessCallback(sceneAssetName, userData); } } else { if (unloadSceneCallbacks.UnloadSceneFailureCallback != null) { unloadSceneCallbacks.UnloadSceneFailureCallback(sceneAssetName, userData); } } } #endif } }
31.982857
134
0.563874
[ "Unlicense" ]
HelloWindows/AccountBook
client/game/Assets/GameFramework/Scripts/Runtime/Resource/DefaultResourceHelper.cs
5,804
C#
/* * PDF * * The PDF conversion API 'conversion2pdf' converts image, office and PDF files to (searcheable) PDF files. The flow is generally as follows: 1. First create a job using the /conversion2pdf/jobs POST endpoint. You will get back a job response that contains a job with its associated settings. 2. Upload one or more images/files using the /conversion2pdf/jobs/{jobId}/streams/multipart POST endpoint. You can also add stream locations from the storage API . You will get back the update job response that contains a job with its associated settings. Currently you can only merge spreadsheets with spreadsheet, documents with documents and images/pdfs with images/pdfs 3. Start the job from a PUT request to the /conversion2pdf/jobs/{jobid} endpoint, with the Job and Settings JSON as request body. The conversion to PDF will now start. The OCR setting is only applicable to images, since other files will always be searchable. 4. Check the job status from the /conversion2pdf/jobs/{jobid} GET endpoint until the status has changed to DONE or ERROR. Messaging using a websocket will be available as an alternative in a future version 5. Retrieve the PDF file using the /conversion2pdf/jobs/{jobid}/streams/result GET endpoint. This will return the PDF file only when the status is DONE. In other cases it will return the Job Response JSON (with http code 202 instead of 200) Interactive testing: A web based test console is available in the <a href=\"https://store.sphereon.com\">Sphereon API Store</a> * * OpenAPI spec version: 1.1 * Contact: dev@sphereon.com * Generated by: https://github.com/swagger-api/swagger-codegen.git */ using NUnit.Framework; using System; using System.Linq; using System.IO; using System.Collections.Generic; using Sphereon.SDK.Pdf.Api; using Sphereon.SDK.Pdf.Model; using Sphereon.SDK.Pdf.Client; using System.Reflection; namespace Sphereon.SDK.Pdf.Test { /// <summary> /// Class for testing Error /// </summary> /// <remarks> /// This file is automatically generated by Swagger Codegen. /// Please update the test case below to test the model. /// </remarks> [TestFixture] public class ErrorTests { // TODO uncomment below to declare an instance variable for Error //private Error instance; /// <summary> /// Setup before each test /// </summary> [SetUp] public void Init() { // TODO uncomment below to create an instance of Error //instance = new Error(); } /// <summary> /// Clean up after each test /// </summary> [TearDown] public void Cleanup() { } /// <summary> /// Test an instance of Error /// </summary> [Test] public void ErrorInstanceTest() { // TODO uncomment below to test "IsInstanceOfType" Error //Assert.IsInstanceOfType<Error> (instance, "variable 'instance' is a Error"); } /// <summary> /// Test the property 'Code' /// </summary> [Test] public void CodeTest() { // TODO unit test for the property 'Code' } /// <summary> /// Test the property 'Level' /// </summary> [Test] public void LevelTest() { // TODO unit test for the property 'Level' } /// <summary> /// Test the property 'Cause' /// </summary> [Test] public void CauseTest() { // TODO unit test for the property 'Cause' } /// <summary> /// Test the property 'Message' /// </summary> [Test] public void MessageTest() { // TODO unit test for the property 'Message' } } }
37.553398
1,513
0.629783
[ "Apache-2.0" ]
Sphereon-SDK/pdf-sdk
csharp-net35/src/Sphereon.SDK.Pdf.Test/Model/ErrorTests.cs
3,868
C#
using System; using System.Collections.Generic; using UnityEngine; public interface IProcessingModuleDatabaseEntry { Ubii.Processing.ProcessingModule GetSpecifications(); ProcessingModule CreateInstance(Ubii.Processing.ProcessingModule specs); } public class ProcessingModuleDatabase { private Dictionary<string, IProcessingModuleDatabaseEntry> dictEntries = new Dictionary<string, IProcessingModuleDatabaseEntry>(); public bool AddEntry(IProcessingModuleDatabaseEntry entry) { if (dictEntries.ContainsKey(entry.GetSpecifications().Name)) { return false; } dictEntries.Add(entry.GetSpecifications().Name, entry); //Debug.Log("PMDatabase.AddEntry() - " + entry.GetSpecifications()); return true; } public bool HasEntry(string name) { return dictEntries.ContainsKey(name); } public IProcessingModuleDatabaseEntry GetEntry(string name) { return dictEntries[name]; } public List<IProcessingModuleDatabaseEntry> GetAllEntries() { return new List<IProcessingModuleDatabaseEntry>(dictEntries.Values); } public List<Ubii.Processing.ProcessingModule> GetAllSpecifications() { List<Ubii.Processing.ProcessingModule> list = new List<Ubii.Processing.ProcessingModule>(); foreach (var entry in dictEntries.Values) { list.Add(entry.GetSpecifications()); } return list; } public ProcessingModule CreateInstance(Ubii.Processing.ProcessingModule specs) { try { IProcessingModuleDatabaseEntry entry = GetEntry(specs.Name); return entry.CreateInstance(specs); } catch (Exception e) { Debug.LogError(e.ToString()); return null; } } }
27.073529
134
0.671917
[ "BSD-3-Clause" ]
SandroWeber/ubii-node-unity3D
Ubi-Interact-Client/Assets/ubii/scripts/pm/ProcessingModuleDatabase.cs
1,841
C#
using System; using System.Web.UI.HtmlControls; using Discuz.Control; using Discuz.Entity; using Discuz.Forum; namespace Discuz.Web.Admin { public class combinationuser : AdminPage { protected HtmlForm Form1; protected pageinfo info1; protected TextBox username1; protected TextBox username3; protected TextBox username2; protected TextBox targetusername; protected Hint Hint1; protected Button CombinationUserInfo; private void CombinationUserInfo_Click(object sender, EventArgs e) { if (base.CheckCookie()) { int userId = Users.GetUserId(this.targetusername.Text); string text = ""; if (userId > 0) { text = this.CombinationUser(this.username1.Text.Trim(), this.targetusername.Text.Trim(), userId); text += this.CombinationUser(this.username2.Text.Trim(), this.targetusername.Text.Trim(), userId); text += this.CombinationUser(this.username3.Text.Trim(), this.targetusername.Text.Trim(), userId); } else { text = text + "目标用户:" + this.targetusername.Text + "不存在!,"; } if (text == "") { base.RegisterStartupScript("PAGE", "window.location.href='global_usergrid.aspx';"); return; } base.RegisterStartupScript("", "<script>alert('" + text.Replace("'", "’") + "');</script>"); } } private string CombinationUser(string userName, string targetUserName, int targetUid) { string result = ""; if (userName != "" && targetUserName != userName) { int userId = Users.GetUserId(userName); if (userId > 0) { AdminUsers.CombinationUser(userId, targetUid); AdminUsers.UpdateForumsFieldModerators(userName); AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "合并用户", "把用户" + userName + " 合并到" + targetUserName); } else { result = "用户:" + userName + "不存在!,"; } } return result; } protected override void OnInit(EventArgs e) { this.InitializeComponent(); base.OnInit(e); } private void InitializeComponent() { this.CombinationUserInfo.Click += new EventHandler(this.CombinationUserInfo_Click); } } }
36.065789
168
0.529004
[ "MIT" ]
NewLifeX/BBX
BBX.Web.Admin/combinationuser.cs
2,787
C#
using Timetable.Common; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices.WindowsRuntime; using Windows.Foundation; using Windows.Foundation.Collections; using Windows.Graphics.Display; using Windows.UI.ViewManagement; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls.Primitives; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Navigation; using Windows.UI; using Windows.UI.Popups; // The Basic Page item template is documented at http://go.microsoft.com/fwlink/?LinkID=390556 namespace Timetable.Pages { /// <summary> /// An empty page that can be used on its own or navigated to within a Frame. /// </summary> public sealed partial class LoginPage : Page { private bool navigateToSettingsPage; private NavigationHelper navigationHelper; private ObservableDictionary defaultViewModel = new ObservableDictionary(); public LoginPage() { this.InitializeComponent(); this.navigationHelper = new NavigationHelper(this); this.navigationHelper.LoadState += this.NavigationHelper_LoadState; this.navigationHelper.SaveState += this.NavigationHelper_SaveState; } /// <summary> /// Gets the <see cref="NavigationHelper"/> associated with this <see cref="Page"/>. /// </summary> public NavigationHelper NavigationHelper { get { return this.navigationHelper; } } /// <summary> /// Gets the view model for this <see cref="Page"/>. /// This can be changed to a strongly typed view model. /// </summary> public ObservableDictionary DefaultViewModel { get { return this.defaultViewModel; } } /// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { if (User.Current != null) { this.ActualUserTextBox.Text = User.Current.FullName; } this.navigateToSettingsPage = (bool)e.NavigationParameter; } /// <summary> /// Preserves state associated with this page in case the application is suspended or the /// page is discarded from the navigation cache. Values must conform to the serialization /// requirements of <see cref="SuspensionManager.SessionState"/>. /// </summary> /// <param name="sender">The source of the event; typically <see cref="NavigationHelper"/></param> /// <param name="e">Event data that provides an empty dictionary to be populated with /// serializable state.</param> private void NavigationHelper_SaveState(object sender, SaveStateEventArgs e) { } #region NavigationHelper registration /// <summary> /// The methods provided in this section are simply used to allow /// NavigationHelper to respond to the page's navigation methods. /// <para> /// Page specific logic should be placed in event handlers for the /// <see cref="NavigationHelper.LoadState"/> /// and <see cref="NavigationHelper.SaveState"/>. /// The navigation parameter is available in the LoadState method /// in addition to page state preserved during an earlier session. /// </para> /// </summary> /// <param name="e">Provides data for navigation methods and event /// handlers that cannot cancel the navigation request.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { this.navigationHelper.OnNavigatedTo(e); } protected override void OnNavigatedFrom(NavigationEventArgs e) { this.navigationHelper.OnNavigatedFrom(e); } #endregion private void LoginButton_DragOver(object sender, DragEventArgs e) { (sender as Button).Background = App.Current.Resources["LogInButtonDragOverBackgroundBrush"] as SolidColorBrush; } private void LogIn(object sender, RoutedEventArgs e) { this.Frame.Navigate(typeof(Timetable.Pages.LoginPage), this.navigateToSettingsPage); } private void Navigate_InfoPage(object sender, RoutedEventArgs e) { this.Frame.Navigate(typeof(InfoPage)); } private void Navigate_Settings(object sender, RoutedEventArgs e) { if (User.Current == null) { this.Frame.Navigate(typeof(LoginPage), true); } else { this.Frame.Navigate(typeof(SettingsPage)); } } private void TextBox_GotFocus(object sender, RoutedEventArgs e) { (sender as TextBox).Text = ""; (sender as TextBox).Foreground = new SolidColorBrush(Colors.Black); (sender as TextBox).GotFocus -= TextBox_GotFocus; } private void PasswordBox_TextBox(object sender, RoutedEventArgs e) { (sender as PasswordBox).Password= ""; (sender as PasswordBox).Foreground = new SolidColorBrush(Colors.Black); //(sender as TextBox).GotFocus -= PasswordTextBox_GotFocus; } private void LogIn_Click(object sender, RoutedEventArgs e) { PathBuilder pb = new PathBuilder(SQLiteLoader.DbName); if (this.UsernameTextBox.Text == "admin" && this.PasswordTextBox.Password == "admin") { User.Current = UserData.Create(1, "admin", "admin", "Jakub Lichman"); if (navigateToSettingsPage) this.Frame.Navigate(typeof(SettingsPage)); else this.Frame.Navigate(typeof(MainPage)); } else if (pb.CheckLogIn(this.UsernameTextBox.Text, this.PasswordTextBox.Password)) { User.Current = pb.GetUser(this.UsernameTextBox.Text, this.PasswordTextBox.Password); if (navigateToSettingsPage) this.Frame.Navigate(typeof(SettingsPage)); else this.Frame.Navigate(typeof(MainPage)); } else { MessageDialog dialog = new MessageDialog("Incorrect password or username"); var result = dialog.ShowAsync(); } } } }
39.721925
124
0.605412
[ "MIT" ]
limo1996/WindowsPhone-8.1-Windows-8.1-Apps
Timetable/WindowsPhone 8.1/GUI(.xaml and .xaml.cs)/LoginPage.xaml.cs
7,430
C#
// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ---------------------------------------------------------------------------------- using Microsoft.Azure.Commands.EventHub.Models; using Microsoft.Azure.Commands.ResourceManager.Common.Tags; using System.Collections; using System.Collections.Generic; using System.Management.Automation; namespace Microsoft.Azure.Commands.EventHub.Commands.Namespace { /// <summary> /// 'Set-AzureRmEventHubNamespace' Cmdlet updates the specified Eventhub Namespace /// </summary> [Cmdlet(VerbsCommon.Set, EventHubNamespaceVerb, SupportsShouldProcess = true, DefaultParameterSetName = NamespaceParameterSet), OutputType(typeof(NamespaceAttributes))] public class SetAzureEventHubNamespace : AzureEventHubsCmdletBase { [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 0, HelpMessage = "Resource Group Name.", ParameterSetName = NamespaceParameterSet)] [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 0, HelpMessage = "Resource Group Name.", ParameterSetName = AutoInflateParameterSet)] [ValidateNotNullOrEmpty] public string ResourceGroupName { get; set; } [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 1, HelpMessage = "EventHub Namespace Name.", ParameterSetName = NamespaceParameterSet)] [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 1, HelpMessage = "EventHub Namespace Name.", ParameterSetName = AutoInflateParameterSet)] [ValidateNotNullOrEmpty] [Alias(AliasNamespaceName)] public string Name { get; set; } [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 2, HelpMessage = "EventHub Namespace Location.", ParameterSetName = NamespaceParameterSet)] [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 2, HelpMessage = "EventHub Namespace Location.", ParameterSetName = AutoInflateParameterSet)] [ValidateNotNullOrEmpty] public string Location { get; set; } [Parameter( Mandatory = false, Position = 3, ValueFromPipelineByPropertyName = true, HelpMessage = "Namespace Sku Name.", ParameterSetName = NamespaceParameterSet)] [Parameter( Mandatory = false, Position = 3, ValueFromPipelineByPropertyName = true, HelpMessage = "Namespace Sku Name.", ParameterSetName = AutoInflateParameterSet)] [ValidateSet(SKU.Basic, SKU.Standard, SKU.Premium, IgnoreCase = true)] public string SkuName { get; set; } [Parameter( Mandatory = false, Position = 4, ValueFromPipelineByPropertyName = true, HelpMessage = "The eventhub throughput units.", ParameterSetName = NamespaceParameterSet)] [Parameter( Mandatory = false, Position = 4, ValueFromPipelineByPropertyName = true, HelpMessage = "The eventhub throughput units.", ParameterSetName = AutoInflateParameterSet)] public int? SkuCapacity { get; set; } [Parameter(Mandatory = false, Position = 5, ValueFromPipelineByPropertyName = true, HelpMessage = "Disable/Enable Namespace.", ParameterSetName = NamespaceParameterSet)] [Parameter(Mandatory = false, Position = 5, ValueFromPipelineByPropertyName = true, HelpMessage = "Disable/Enable Namespace.", ParameterSetName = AutoInflateParameterSet)] public Models.NamespaceState? State { get; set; } [Parameter(Mandatory = false, Position = 6, ValueFromPipelineByPropertyName = true, HelpMessage = "Hashtables which represents resource Tag.", ParameterSetName = NamespaceParameterSet)] [Parameter(Mandatory = false, Position = 6, ValueFromPipelineByPropertyName = true, HelpMessage = "Hashtables which represents resource Tag.", ParameterSetName = AutoInflateParameterSet)] public Hashtable Tag { get; set; } /// <summary> /// Indicates whether AutoInflate is enabled. /// </summary> [Parameter( Mandatory = true, HelpMessage = "Indicates whether AutoInflate is enabled", ParameterSetName = AutoInflateParameterSet )] public SwitchParameter EnableAutoInflate { get; set; } /// <summary> /// Upper limit of throughput units when AutoInflate is enabled. /// </summary> [Parameter( Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 throughput units.", ParameterSetName = AutoInflateParameterSet )] [ValidateRange(0,20)] public int? MaximumThroughputUnits { get; set; } public override void ExecuteCmdlet() { // Update a EventHub namespace Dictionary<string, string> tagDictionary = TagsConversionHelper.CreateTagDictionary(Tag, validate: true); if (ShouldProcess(target: Name, action: string.Format(Resources.UpdateNamespace, Name, ResourceGroupName))) { if(EnableAutoInflate.IsPresent) WriteObject(Client.UpdateNamespace(ResourceGroupName, Name, Location, SkuName, SkuCapacity, State, tagDictionary, true, MaximumThroughputUnits)); else WriteObject(Client.UpdateNamespace(ResourceGroupName, Name, Location, SkuName, SkuCapacity, State, tagDictionary, false, MaximumThroughputUnits)); } } } }
43.720497
173
0.607331
[ "MIT" ]
SpillChek2/azure-powershell
src/ResourceManager/EventHub/Commands.EventHub/Cmdlets/Namespace/SetAzureEventHubNamespace.cs
6,881
C#