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 Seq2SeqSharp.Tools; using System; using System.Collections.Generic; using System.Text; namespace Seq2SeqSharp.Optimizer { public interface IOptimizer { void UpdateWeights(List<IWeightTensor> model, int batchSize, float step_size, float regc, int iter); } }
21.923077
108
0.747368
[ "BSD-3-Clause" ]
SciSharp/Seq2SeqSharp
Seq2SeqSharp/Optimizer/IOptimizer.cs
287
C#
using System; using System.Collections.Generic; using System.Reflection; using System.Linq; using UnityEditor.Sprites; using UnityEditorInternal; using UnityEngine; using UnityEngine.Networking; using UnityEngine.Tilemaps; using Object = UnityEngine.Object; namespace UnityEditor { [CustomEditor(typeof(RuleTile), true)] [CanEditMultipleObjects] internal class RuleTileEditor : Editor { private const string s_MirrorX = "iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwQAADsEBuJFr7QAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC41ZYUyZQAAAG1JREFUOE+lj9ENwCAIRB2IFdyRfRiuDSaXAF4MrR9P5eRhHGb2Gxp2oaEjIovTXSrAnPNx6hlgyCZ7o6omOdYOldGIZhAziEmOTSfigLV0RYAB9y9f/7kO8L3WUaQyhCgz0dmCL9CwCw172HgBeyG6oloC8fAAAAAASUVORK5CYII="; private const string s_MirrorY = "iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC41ZYUyZQAAAG9JREFUOE+djckNACEMAykoLdAjHbPyw1IOJ0L7mAejjFlm9hspyd77Kk+kBAjPOXcakJIh6QaKyOE0EB5dSPJAiUmOiL8PMVGxugsP/0OOib8vsY8yYwy6gRyC8CB5QIWgCMKBLgRSkikEUr5h6wOPWfMoCYILdgAAAABJRU5ErkJggg=="; private const string s_Rotated = "iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwQAADsEBuJFr7QAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC41ZYUyZQAAAHdJREFUOE+djssNwCAMQxmIFdgx+2S4Vj4YxWlQgcOT8nuG5u5C732Sd3lfLlmPMR4QhXgrTQaimUlA3EtD+CJlBuQ7aUAUMjEAv9gWCQNEPhHJUkYfZ1kEpcxDzioRzGIlr0Qwi0r+Q5rTgM+AAVcygHgt7+HtBZs/2QVWP8ahAAAAAElFTkSuQmCC"; private static Texture2D[] s_AutoTransforms; public static Texture2D[] autoTransforms { get { if (s_AutoTransforms == null) { s_AutoTransforms = new Texture2D[3]; s_AutoTransforms[0] = RuleTile.Base64ToTexture(s_Rotated); s_AutoTransforms[1] = RuleTile.Base64ToTexture(s_MirrorX); s_AutoTransforms[2] = RuleTile.Base64ToTexture(s_MirrorY); } return s_AutoTransforms; } } private ReorderableList m_ReorderableList; public RuleTile tile { get { return (target as RuleTile); } } private Rect m_ListRect; internal const float k_DefaultElementHeight = 48f; internal const float k_PaddingBetweenRules = 13f; internal const float k_SingleLineHeight = 16f; internal const float k_LabelWidth = 53f; public void OnEnable() { if (tile.m_TilingRules == null) tile.m_TilingRules = new List<RuleTile.TilingRule>(); m_ReorderableList = new ReorderableList(tile.m_TilingRules, typeof(RuleTile.TilingRule), true, true, true, true); m_ReorderableList.drawHeaderCallback = OnDrawHeader; m_ReorderableList.drawElementCallback = OnDrawElement; m_ReorderableList.elementHeightCallback = GetElementHeight; m_ReorderableList.onReorderCallback = ListUpdated; m_ReorderableList.onAddCallback = OnAddElement; } private void ListUpdated(ReorderableList list) { SaveTile(); } private float GetElementHeight(int index) { if (tile.m_TilingRules != null && tile.m_TilingRules.Count > 0) { switch (tile.m_TilingRules[index].m_Output) { case RuleTile.TilingRule.OutputSprite.Random: return k_DefaultElementHeight + k_SingleLineHeight*(tile.m_TilingRules[index].m_Sprites.Length + 3) + k_PaddingBetweenRules; case RuleTile.TilingRule.OutputSprite.Animation: return k_DefaultElementHeight + k_SingleLineHeight*(tile.m_TilingRules[index].m_Sprites.Length + 2) + k_PaddingBetweenRules; } } return k_DefaultElementHeight + k_PaddingBetweenRules; } private void OnDrawElement(Rect rect, int index, bool isactive, bool isfocused) { RuleTile.TilingRule rule = tile.m_TilingRules[index]; float yPos = rect.yMin + 2f; float height = rect.height - k_PaddingBetweenRules; float matrixWidth = k_DefaultElementHeight; Rect inspectorRect = new Rect(rect.xMin, yPos, rect.width - matrixWidth * 2f - 20f, height); Rect matrixRect = new Rect(rect.xMax - matrixWidth * 2f - 10f, yPos, matrixWidth, k_DefaultElementHeight); Rect spriteRect = new Rect(rect.xMax - matrixWidth - 5f, yPos, matrixWidth, k_DefaultElementHeight); EditorGUI.BeginChangeCheck(); RuleInspectorOnGUI(inspectorRect, rule); RuleMatrixOnGUI(tile, matrixRect, rule); SpriteOnGUI(spriteRect, rule); if (EditorGUI.EndChangeCheck()) SaveTile(); } private void OnAddElement(ReorderableList list) { RuleTile.TilingRule rule = new RuleTile.TilingRule(); rule.m_Output = RuleTile.TilingRule.OutputSprite.Single; rule.m_Sprites[0] = tile.m_DefaultSprite; rule.m_ColliderType = tile.m_DefaultColliderType; tile.m_TilingRules.Add(rule); } private void SaveTile() { EditorUtility.SetDirty(target); SceneView.RepaintAll(); } private void OnDrawHeader(Rect rect) { GUI.Label(rect, "Tiling Rules"); } public override void OnInspectorGUI() { tile.m_DefaultSprite = EditorGUILayout.ObjectField("Default Sprite", tile.m_DefaultSprite, typeof(Sprite), false) as Sprite; tile.m_DefaultColliderType = (Tile.ColliderType)EditorGUILayout.EnumPopup("Default Collider", tile.m_DefaultColliderType); var baseFields = typeof(RuleTile).GetFields().Select(field => field.Name); var fields = target.GetType().GetFields().Select(field => field.Name).Where(field => !baseFields.Contains(field)); foreach (var field in fields) EditorGUILayout.PropertyField(serializedObject.FindProperty(field), true); EditorGUILayout.Space(); if (m_ReorderableList != null && tile.m_TilingRules != null) m_ReorderableList.DoLayoutList(); } internal static void RuleMatrixOnGUI(RuleTile tile, Rect rect, RuleTile.TilingRule tilingRule) { Handles.color = EditorGUIUtility.isProSkin ? new Color(1f, 1f, 1f, 0.2f) : new Color(0f, 0f, 0f, 0.2f); int index = 0; float w = rect.width / 3f; float h = rect.height / 3f; for (int y = 0; y <= 3; y++) { float top = rect.yMin + y * h; Handles.DrawLine(new Vector3(rect.xMin, top), new Vector3(rect.xMax, top)); } for (int x = 0; x <= 3; x++) { float left = rect.xMin + x * w; Handles.DrawLine(new Vector3(left, rect.yMin), new Vector3(left, rect.yMax)); } Handles.color = Color.white; for (int y = 0; y <= 2; y++) { for (int x = 0; x <= 2; x++) { Rect r = new Rect(rect.xMin + x * w, rect.yMin + y * h, w - 1, h - 1); if (x != 1 || y != 1) { tile.RuleOnGUI(r, new Vector2Int(x, y), tilingRule.m_Neighbors[index]); if (Event.current.type == EventType.MouseDown && r.Contains(Event.current.mousePosition)) { int change = 1; if (Event.current.button == 1) change = -1; var allConsts = tile.m_NeighborType.GetFields(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy); var neighbors = allConsts.Select(c => (int)c.GetValue(null)).ToList(); neighbors.Sort(); int oldIndex = neighbors.IndexOf(tilingRule.m_Neighbors[index]); int newIndex = (int)Mathf.Repeat(oldIndex + change, neighbors.Count); tilingRule.m_Neighbors[index] = neighbors[newIndex]; GUI.changed = true; Event.current.Use(); } index++; } else { switch (tilingRule.m_RuleTransform) { case RuleTile.TilingRule.Transform.Rotated: GUI.DrawTexture(r, autoTransforms[0]); break; case RuleTile.TilingRule.Transform.MirrorX: GUI.DrawTexture(r, autoTransforms[1]); break; case RuleTile.TilingRule.Transform.MirrorY: GUI.DrawTexture(r, autoTransforms[2]); break; } if (Event.current.type == EventType.MouseDown && r.Contains(Event.current.mousePosition)) { tilingRule.m_RuleTransform = (RuleTile.TilingRule.Transform)(((int)tilingRule.m_RuleTransform + 1) % 4); GUI.changed = true; Event.current.Use(); } } } } } private static void OnSelect(object userdata) { MenuItemData data = (MenuItemData) userdata; data.m_Rule.m_RuleTransform = data.m_NewValue; } private class MenuItemData { public RuleTile.TilingRule m_Rule; public RuleTile.TilingRule.Transform m_NewValue; public MenuItemData(RuleTile.TilingRule mRule, RuleTile.TilingRule.Transform mNewValue) { this.m_Rule = mRule; this.m_NewValue = mNewValue; } } internal static void SpriteOnGUI(Rect rect, RuleTile.TilingRule tilingRule) { tilingRule.m_Sprites[0] = EditorGUI.ObjectField(new Rect(rect.xMax - rect.height, rect.yMin, rect.height, rect.height), tilingRule.m_Sprites[0], typeof (Sprite), false) as Sprite; } internal static void RuleInspectorOnGUI(Rect rect, RuleTile.TilingRule tilingRule) { float y = rect.yMin; EditorGUI.BeginChangeCheck(); GUI.Label(new Rect(rect.xMin, y, k_LabelWidth, k_SingleLineHeight), "Rule"); tilingRule.m_RuleTransform = (RuleTile.TilingRule.Transform)EditorGUI.EnumPopup(new Rect(rect.xMin + k_LabelWidth, y, rect.width - k_LabelWidth, k_SingleLineHeight), tilingRule.m_RuleTransform); y += k_SingleLineHeight; GUI.Label(new Rect(rect.xMin, y, k_LabelWidth, k_SingleLineHeight), "Collider"); tilingRule.m_ColliderType = (Tile.ColliderType)EditorGUI.EnumPopup(new Rect(rect.xMin + k_LabelWidth, y, rect.width - k_LabelWidth, k_SingleLineHeight), tilingRule.m_ColliderType); y += k_SingleLineHeight; GUI.Label(new Rect(rect.xMin, y, k_LabelWidth, k_SingleLineHeight), "Output"); tilingRule.m_Output = (RuleTile.TilingRule.OutputSprite)EditorGUI.EnumPopup(new Rect(rect.xMin + k_LabelWidth, y, rect.width - k_LabelWidth, k_SingleLineHeight), tilingRule.m_Output); y += k_SingleLineHeight; if (tilingRule.m_Output == RuleTile.TilingRule.OutputSprite.Animation) { GUI.Label(new Rect(rect.xMin, y, k_LabelWidth, k_SingleLineHeight), "Speed"); tilingRule.m_AnimationSpeed = EditorGUI.FloatField(new Rect(rect.xMin + k_LabelWidth, y, rect.width - k_LabelWidth, k_SingleLineHeight), tilingRule.m_AnimationSpeed); y += k_SingleLineHeight; } if (tilingRule.m_Output == RuleTile.TilingRule.OutputSprite.Random) { GUI.Label(new Rect(rect.xMin, y, k_LabelWidth, k_SingleLineHeight), "Noise"); tilingRule.m_PerlinScale = EditorGUI.Slider(new Rect(rect.xMin + k_LabelWidth, y, rect.width - k_LabelWidth, k_SingleLineHeight), tilingRule.m_PerlinScale, 0.001f, 0.999f); y += k_SingleLineHeight; GUI.Label(new Rect(rect.xMin, y, k_LabelWidth, k_SingleLineHeight), "Shuffle"); tilingRule.m_RandomTransform = (RuleTile.TilingRule.Transform)EditorGUI.EnumPopup(new Rect(rect.xMin + k_LabelWidth, y, rect.width - k_LabelWidth, k_SingleLineHeight), tilingRule.m_RandomTransform); y += k_SingleLineHeight; } if (tilingRule.m_Output != RuleTile.TilingRule.OutputSprite.Single) { GUI.Label(new Rect(rect.xMin, y, k_LabelWidth, k_SingleLineHeight), "Size"); EditorGUI.BeginChangeCheck(); int newLength = EditorGUI.DelayedIntField(new Rect(rect.xMin + k_LabelWidth, y, rect.width - k_LabelWidth, k_SingleLineHeight), tilingRule.m_Sprites.Length); if (EditorGUI.EndChangeCheck()) Array.Resize(ref tilingRule.m_Sprites, Math.Max(newLength, 1)); y += k_SingleLineHeight; for (int i = 0; i < tilingRule.m_Sprites.Length; i++) { tilingRule.m_Sprites[i] = EditorGUI.ObjectField(new Rect(rect.xMin + k_LabelWidth, y, rect.width - k_LabelWidth, k_SingleLineHeight), tilingRule.m_Sprites[i], typeof(Sprite), false) as Sprite; y += k_SingleLineHeight; } } } public override Texture2D RenderStaticPreview(string assetPath, Object[] subAssets, int width, int height) { if (tile.m_DefaultSprite != null) { Type t = GetType("UnityEditor.SpriteUtility"); if (t != null) { MethodInfo method = t.GetMethod("RenderStaticPreview", new Type[] {typeof (Sprite), typeof (Color), typeof (int), typeof (int)}); if (method != null) { object ret = method.Invoke("RenderStaticPreview", new object[] {tile.m_DefaultSprite, Color.white, width, height}); if (ret is Texture2D) return ret as Texture2D; } } } return base.RenderStaticPreview(assetPath, subAssets, width, height); } private static Type GetType(string TypeName) { var type = Type.GetType(TypeName); if (type != null) return type; if (TypeName.Contains(".")) { var assemblyName = TypeName.Substring(0, TypeName.IndexOf('.')); var assembly = Assembly.Load(assemblyName); if (assembly == null) return null; type = assembly.GetType(TypeName); if (type != null) return type; } var currentAssembly = Assembly.GetExecutingAssembly(); var referencedAssemblies = currentAssembly.GetReferencedAssemblies(); foreach (var assemblyName in referencedAssemblies) { var assembly = Assembly.Load(assemblyName); if (assembly != null) { type = assembly.GetType(TypeName); if (type != null) return type; } } return null; } [Serializable] class RuleTileRuleWrapper { [SerializeField] public List<RuleTile.TilingRule> rules = new List<RuleTile.TilingRule>(); } [MenuItem("CONTEXT/RuleTile/Copy All Rules")] private static void CopyAllRules(MenuCommand item) { RuleTile tile = item.context as RuleTile; if (tile == null) return; RuleTileRuleWrapper rulesWrapper = new RuleTileRuleWrapper(); rulesWrapper.rules = tile.m_TilingRules; var rulesJson = EditorJsonUtility.ToJson(rulesWrapper); EditorGUIUtility.systemCopyBuffer = rulesJson; } [MenuItem("CONTEXT/RuleTile/Paste Rules")] private static void PasteRules(MenuCommand item) { RuleTile tile = item.context as RuleTile; if (tile == null) return; try { RuleTileRuleWrapper rulesWrapper = new RuleTileRuleWrapper(); EditorJsonUtility.FromJsonOverwrite(EditorGUIUtility.systemCopyBuffer, rulesWrapper); tile.m_TilingRules.AddRange(rulesWrapper.rules); } catch (Exception e) { Debug.LogError("Unable to paste rules from system copy buffer"); } } } }
37.908108
370
0.725438
[ "MIT" ]
Bloodyaugust/ld42
Assets/UnityTilemapExtras/Tilemap/Tiles/Rule Tile/Scripts/Editor/RuleTileEditor.cs
14,026
C#
using Pluto.Domain.Commands.Common; using Pluto.Domain.Enums; using System; namespace Pluto.Domain.Commands.User { public class UpdateUserCommand : Command { public Guid Id { get; set; } public string Name { get; set; } public string Email { get; set; } public UserProfile Profile { get; set; } } }
23
48
0.643478
[ "MIT" ]
spaki/Pluto
Pluto.Domain/Commands/User/UpdateUserCommand.cs
347
C#
using System; namespace Cobalt.Common.Data { public class AppUsage : Entity { public App App { get; set; } public AppUsageType UsageType { get; set; } public DateTime StartTimestamp { get; set; } public DateTime EndTimestamp { get; set; } public AppUsageEndReason UsageEndReason { get; set; } public AppUsageStartReason UsageStartReason { get; set; } public TimeSpan Duration => EndTimestamp - StartTimestamp; } }
32.2
66
0.654244
[ "MIT" ]
Enigmatrix/Cobalt
Cobalt.Common.Data/AppUsage.cs
485
C#
// Copyright 2004-2011 Castle Project - http://www.castleproject.org/ // // 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. namespace Castle.Windsor.Diagnostics { #if !SILVERLIGHT using System; using System.ComponentModel; using System.Diagnostics; using System.Linq; public class PerformanceMetricsFactory : IPerformanceMetricsFactory { private const string CastleWindsorCategoryName = "Castle Windsor"; private const string InstanesTrackedByTheReleasePolicyCounterName = "Instances tracked by the release policy"; private Exception exception; public PerformanceMetricsFactory() { Initialize(); } public bool InitializedSuccessfully { get { return exception != null; } } public ITrackedComponentsPerformanceCounter CreateInstancesTrackedByReleasePolicyCounter(string name) { var counter = BuildInstancesTrackedByReleasePolicyCounter(name); if (counter == null) { return NullPerformanceCounter.Instance; } return new TrackedComponentsPerformanceCounterWrapper(counter); } private PerformanceCounter BuildInstancesTrackedByReleasePolicyCounter(string name) { if (InitializedSuccessfully == false) { return null; } try { return new PerformanceCounter(CastleWindsorCategoryName, InstanesTrackedByTheReleasePolicyCounterName, name, readOnly: false) { RawValue = 0L }; } // exception types we should expect according to http://msdn.microsoft.com/en-us/library/356cx381.aspx catch (Win32Exception) { } catch (PlatformNotSupportedException) { } catch (UnauthorizedAccessException) { } return null; } private void CreateWindsorCategoryAndCounters() { PerformanceCounterCategory.Create(CastleWindsorCategoryName, "Performance counters published by the Castle Windsor container", PerformanceCounterCategoryType.MultiInstance, new CounterCreationDataCollection { new CounterCreationData { CounterType = PerformanceCounterType.NumberOfItems32, CounterName = InstanesTrackedByTheReleasePolicyCounterName, CounterHelp = "List of instances tracked by the release policy in the container. " + "Notice that does not include all alive objects tracked by the container, just the ones tracked by the policy." } }); } private void Initialize() { try { if (PerformanceCounterCategory.Exists(CastleWindsorCategoryName)) { PerformanceCounterCategory.GetCategories() .Single(c => c.CategoryName == CastleWindsorCategoryName); } else { CreateWindsorCategoryAndCounters(); } } catch (Win32Exception e) { exception = e; } catch (UnauthorizedAccessException e) { exception = e; } } } #endif }
33.136752
165
0.617488
[ "Apache-2.0" ]
pil0t/Castle.Windsor
src/Castle.Windsor/Windsor/Diagnostics/PerformanceMetricsFactory.cs
3,877
C#
namespace Loon { public abstract class UnityActivity :UnityContext { private UnityGLSurfaceView m_view; public UnityActivity(int width, int height):base(width,height) { } public virtual void Finish() { } public virtual void OnCreate(UnityBundle state) { } protected virtual void OnDestroy() { } protected virtual void OnPause() { } protected virtual void OnRestart() { } protected virtual void OnResume() { } protected virtual void OnStart() { } protected virtual void OnStop() { } public void RequestRender() { this.m_view.RequestRender(); } public void SetContentView(UnityGLSurfaceView _view) { this.m_view = _view; this.m_view.Create(); } public UnityGLSurfaceView GetView() { return this.m_view; } } }
13.532258
64
0.643623
[ "Apache-2.0" ]
TheMadTitanSkid/LGame
C#/Loon2Unity/Loon/UnityActivity.cs
839
C#
#region License /* ********************************************************************************** * Copyright (c) Roman Ivantsov * This source code is subject to terms and conditions of the MIT License * for Irony. A copy of the license can be found in the License.txt file * at the root of this distribution. * By using this source code in any fashion, you are agreeing to be bound by the terms of the * MIT License. * You must not remove this notice from this software. * **********************************************************************************/ #endregion License // Aknowledgments // This module borrows code and ideas from TinyPG framework by Herre Kuijpers, // specifically TextMarker.cs and TextHighlighter.cs classes. // http://www.codeproject.com/KB/recipes/TinyPG.aspx // Written by Alexey Yakovlev <yallie@yandex.ru>, based on RichTextBoxHighlighter // using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Runtime.InteropServices; using System.Windows.Forms; using FastColoredTextBoxNS; using Irony.Parsing; namespace Irony.GrammarExplorer.Highlighter { /// <summary> /// Highlights text inside FastColoredTextBox control. /// </summary> public class FastColoredTextBoxHighlighter : NativeWindow, IDisposable, IUIThreadInvoker { public readonly EditorAdapter Adapter; public readonly LanguageData Language; public readonly EditorViewAdapter ViewAdapter; private readonly Style DefaultTokenStyle = new TextStyle(Brushes.Black, null, FontStyle.Regular); private readonly Style ErrorTokenStyle = new WavyLineStyle(240, Color.Red); private readonly Dictionary<TokenColor, Style> TokenStyles = new Dictionary<TokenColor, Style>(); public FastColoredTextBox TextBox; private bool colorizing; private bool disposed; private IntPtr savedEventMask = IntPtr.Zero; #region Constructor, initialization and disposing public FastColoredTextBoxHighlighter(FastColoredTextBox textBox, LanguageData language) { this.TextBox = textBox; this.Adapter = new EditorAdapter(language); this.ViewAdapter = new EditorViewAdapter(this.Adapter, this); this.Language = language; this.InitStyles(); this.InitBraces(); this.Connect(); this.UpdateViewRange(); this.ViewAdapter.SetNewText(this.TextBox.Text); } public void Dispose() { this.Adapter.Stop(); this.disposed = true; this.Disconnect(); this.ReleaseHandle(); GC.SuppressFinalize(this); } private void Connect() { this.TextBox.MouseMove += this.TextBox_MouseMove; this.TextBox.TextChanged += this.TextBox_TextChanged; this.TextBox.KeyDown += this.TextBox_KeyDown; this.TextBox.VisibleRangeChanged += this.TextBox_ScrollResize; this.TextBox.SizeChanged += this.TextBox_ScrollResize; this.TextBox.Disposed += this.TextBox_Disposed; this.ViewAdapter.ColorizeTokens += this.Adapter_ColorizeTokens; this.AssignHandle(this.TextBox.Handle); } private void Disconnect() { if (this.TextBox != null) { this.TextBox.MouseMove -= this.TextBox_MouseMove; this.TextBox.TextChanged -= this.TextBox_TextChanged; this.TextBox.KeyDown -= this.TextBox_KeyDown; this.TextBox.Disposed -= this.TextBox_Disposed; this.TextBox.VisibleRangeChanged -= this.TextBox_ScrollResize; this.TextBox.SizeChanged -= this.TextBox_ScrollResize; } this.TextBox = null; } private void InitBraces() { // Select the first two pair of braces with the length of exactly one char (FCTB restrictions) var braces = Language.Grammar.KeyTerms .Select(pair => pair.Value) .Where(term => term.Flags.IsSet(TermFlags.IsOpenBrace)) .Where(term => term.IsPairFor != null && term.IsPairFor is KeyTerm) .Where(term => term.Text.Length == 1) .Where(term => ((KeyTerm) term.IsPairFor).Text.Length == 1) .Take(2); if (braces.Any()) { // First pair var brace = braces.First(); this.TextBox.LeftBracket = brace.Text.First(); this.TextBox.RightBracket = ((KeyTerm) brace.IsPairFor).Text.First(); // Second pair if (braces.Count() > 1) { brace = braces.Last(); this.TextBox.LeftBracket2 = brace.Text.First(); this.TextBox.RightBracket2 = ((KeyTerm) brace.IsPairFor).Text.First(); } } } private void InitStyles() { var commentStyle = new TextStyle(Brushes.Green, null, FontStyle.Italic); var keywordStyle = new TextStyle(Brushes.Blue, null, FontStyle.Bold); var literalStyle = new TextStyle(Brushes.DarkRed, null, FontStyle.Regular); this.TokenStyles[TokenColor.Comment] = commentStyle; this.TokenStyles[TokenColor.Identifier] = DefaultTokenStyle; this.TokenStyles[TokenColor.Keyword] = keywordStyle; this.TokenStyles[TokenColor.Number] = literalStyle; this.TokenStyles[TokenColor.String] = literalStyle; this.TokenStyles[TokenColor.Text] = DefaultTokenStyle; this.TextBox.ClearStylesBuffer(); this.TextBox.AddStyle(this.DefaultTokenStyle); this.TextBox.AddStyle(this.ErrorTokenStyle); this.TextBox.AddStyle(commentStyle); this.TextBox.AddStyle(keywordStyle); this.TextBox.AddStyle(literalStyle); this.TextBox.BracketsStyle = new MarkerStyle(new SolidBrush(Color.FromArgb(50, Color.Blue))); this.TextBox.BracketsStyle2 = new MarkerStyle(new SolidBrush(Color.FromArgb(70, Color.Green))); } #endregion Constructor, initialization and disposing #region TextBox event handlers private void TextBox_Disposed(object sender, EventArgs e) { this.Dispose(); } private void TextBox_KeyDown(object sender, KeyEventArgs e) { // TODO: implement showing intellisense hints or drop-downs } private void TextBox_MouseMove(object sender, MouseEventArgs e) { // TODO: implement showing tip } private void TextBox_ScrollResize(object sender, EventArgs e) { this.UpdateViewRange(); } private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { // If we are here while colorizing, it means the "change" event is a result of our coloring action if (this.colorizing) return; this.ViewAdapter.SetNewText(this.TextBox.Text); } private void UpdateViewRange() { this.ViewAdapter.SetViewRange(0, this.TextBox.Text.Length); } #endregion TextBox event handlers #region WinAPI private const int EM_GETEVENTMASK = (WM_USER + 59); private const int EM_SETEVENTMASK = (WM_USER + 69); private const int SB_HORZ = 0x0; private const int SB_THUMBPOSITION = 4; private const int SB_VERT = 0x1; private const int WM_HSCROLL = 0x114; private const int WM_PAINT = 0x000F; private const int WM_SETREDRAW = 0x000B; private const int WM_USER = 0x400; private const int WM_VSCROLL = 0x115; private int HScrollPos { get { // Sometimes explodes with null reference exception return GetScrollPos((int) this.TextBox.Handle, SB_HORZ); } set { SetScrollPos((IntPtr) this.TextBox.Handle, SB_HORZ, value, true); PostMessageA((IntPtr) this.TextBox.Handle, WM_HSCROLL, SB_THUMBPOSITION + 0x10000 * value, 0); } } private int VScrollPos { get { return GetScrollPos((int) this.TextBox.Handle, SB_VERT); } set { SetScrollPos((IntPtr) this.TextBox.Handle, SB_VERT, value, true); PostMessageA((IntPtr) this.TextBox.Handle, WM_VSCROLL, SB_THUMBPOSITION + 0x10000 * value, 0); } } [DllImport("user32.dll", CharSet = CharSet.Auto)] private static extern int GetScrollPos(int hWnd, int nBar); [DllImport("user32.dll")] private static extern bool PostMessageA(IntPtr hWnd, int nBar, int wParam, int lParam); [DllImport("user32", CharSet = CharSet.Auto)] private extern static IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, IntPtr lParam); [DllImport("user32.dll")] private static extern int SetScrollPos(IntPtr hWnd, int nBar, int nPos, bool bRedraw); #endregion WinAPI #region Colorizing tokens public void LockTextBox() { // Stop redrawing: this.TextBox.BeginUpdate(); SendMessage(this.TextBox.Handle, WM_SETREDRAW, 0, IntPtr.Zero); // Stop sending of events: this.savedEventMask = SendMessage(this.TextBox.Handle, EM_GETEVENTMASK, 0, IntPtr.Zero); SendMessage(this.TextBox.Handle, EM_SETEVENTMASK, 0, IntPtr.Zero); } public void UnlockTextBox() { // Turn on events SendMessage(this.TextBox.Handle, EM_SETEVENTMASK, 0, this.savedEventMask); // Turn on redrawing SendMessage(this.TextBox.Handle, WM_SETREDRAW, 1, IntPtr.Zero); this.TextBox.EndUpdate(); } private void Adapter_ColorizeTokens(object sender, ColorizeEventArgs args) { if (this.disposed) return; this.colorizing = true; this.TextBox.BeginUpdate(); try { foreach (Token tkn in args.Tokens) { var tokenRange = this.TextBox.GetRange(tkn.Location.Position, tkn.Location.Position + tkn.Length); var tokenStyle = this.GetTokenStyle(tkn); tokenRange.ClearStyle(StyleIndex.All); tokenRange.SetStyle(tokenStyle); } } finally { this.TextBox.EndUpdate(); this.colorizing = false; } } private Style GetTokenStyle(Token token) { if (token.IsError()) return this.ErrorTokenStyle; if (token.EditorInfo == null) return this.DefaultTokenStyle; // Right now we scan source, not parse; initially all keywords are recognized as Identifiers; then they are "backpatched" // by parser when it detects that it is in fact keyword from Grammar. So now this backpatching does not happen, // so we have to detect keywords here var styleIndex = token.EditorInfo.Color; if (token.KeyTerm != null && token.KeyTerm.EditorInfo != null && token.KeyTerm.Flags.IsSet(TermFlags.IsKeyword)) { styleIndex = token.KeyTerm.EditorInfo.Color; } Style result; if (this.TokenStyles.TryGetValue(styleIndex, out result)) return result; return this.DefaultTokenStyle; } #endregion Colorizing tokens #region IUIThreadInvoker Members public void InvokeOnUIThread(ColorizeMethod colorize) { this.TextBox.BeginInvoke(new MethodInvoker(colorize)); } #endregion IUIThreadInvoker Members } }
29.701754
124
0.715101
[ "MIT" ]
Tyelpion/irony
Irony.GrammarExplorer/Highlighter/FastColoredTextBoxHighlighter.cs
10,158
C#
// Copyright (c) 2012-2021 VLINGO LABS. All rights reserved. // // 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 https://mozilla.org/MPL/2.0/. using Xunit; namespace Vlingo.Xoom.UUID.Tests { public class RandomBasedGeneratorTests { [Fact] public void GeneratedUUID_ShouldHaveProperVersion() { var generator = new RandomBasedGenerator(); var expectedVersion = 0x40; var guid = generator.GenerateGuid(); var array = guid.ToActuallyOrderedBytes(); Assert.Equal(expectedVersion, array[6] & 0xf0); } } }
27.222222
61
0.640816
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
Luteceo/vlingo-net-uuid
src/Vlingo.Xoom.UUID.Tests/RandomBasedGeneratorTests.cs
737
C#
using System; using System.Collections.Generic; using Grasshopper.Kernel; using Rhino.Geometry; namespace PTK.Components { public class PTK_GravityLoad : GH_Component { public PTK_GravityLoad() : base("GravityLoad", "GravityLoad", "Add load here", CommonProps.category, CommonProps.subcate5) { Message = CommonProps.initialMessage; } /// <summary> /// Overrides the exposure level in the components category /// </summary> public override GH_Exposure Exposure { get { return GH_Exposure.secondary; } } protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) { pManager.AddTextParameter("Tag", "T", "Tag", GH_ParamAccess.item, "GravityLoad"); pManager.AddIntegerParameter("Load Case", "LC", "Load case", GH_ParamAccess.item, 0); pManager.AddVectorParameter("Gravity Vector", "G", "in [kN]. Vector which describe the diretion and value in kN", GH_ParamAccess.item,new Vector3d(0,0,-1)); pManager[0].Optional = true; pManager[1].Optional = true; pManager[2].Optional = true; } protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager) { pManager.RegisterParam(new Param_Load(), "Gravity Load", "L", "Load data to be send to Assembler(PTK)", GH_ParamAccess.item); } protected override void SolveInstance(IGH_DataAccess DA) { // --- variables --- string Tag = null; int lcase = new int(); Vector3d gvector = new Vector3d(); // --- input --- if (!DA.GetData(0, ref Tag)) { return; } if (!DA.GetData(1, ref lcase)) { return; } if (!DA.GetData(2, ref gvector)) { return; } // --- solve --- GH_Load load = new GH_Load(new GravityLoad(Tag, lcase, gvector)); // --- output --- DA.SetData(0, load); } protected override System.Drawing.Bitmap Icon { get { return Properties.Resources.GravityLoad; } } public override Guid ComponentGuid { get { return new Guid("58181589-b98d-4cd4-850f-c0f38030bd1b"); } } } }
32.210526
168
0.564134
[ "MIT" ]
CSDG-DDL/PTK
PTK/Components/3_GravityLoad.cs
2,450
C#
// Copyright (c) Umbraco. // See LICENSE for more details. using System; using System.Linq; using NUnit.Framework; using Umbraco.Cms.Core.Configuration.Models; using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Notifications; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Services.Implement; using Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; using Umbraco.Extensions; namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services { [TestFixture] [UmbracoTest( Database = UmbracoTestOptions.Database.NewSchemaPerTest, PublishedRepositoryEvents = true, WithApplication = true, Logger = UmbracoTestOptions.Logger.Console)] public class ContentServiceNotificationTests : UmbracoIntegrationTest { private IContentTypeService ContentTypeService => GetRequiredService<IContentTypeService>(); private ContentService ContentService => (ContentService)GetRequiredService<IContentService>(); private ILocalizationService LocalizationService => GetRequiredService<ILocalizationService>(); private IFileService FileService => GetRequiredService<IFileService>(); private GlobalSettings _globalSettings; private IContentType _contentType; [SetUp] public void SetupTest() { ContentRepositoryBase.ThrowOnWarning = true; _globalSettings = new GlobalSettings(); CreateTestData(); } protected override void CustomTestSetup(IUmbracoBuilder builder) => builder .AddNotificationHandler<ContentSavingNotification, ContentNotificationHandler>() .AddNotificationHandler<ContentSavedNotification, ContentNotificationHandler>() .AddNotificationHandler<ContentPublishingNotification, ContentNotificationHandler>() .AddNotificationHandler<ContentPublishedNotification, ContentNotificationHandler>() .AddNotificationHandler<ContentUnpublishingNotification, ContentNotificationHandler>() .AddNotificationHandler<ContentUnpublishedNotification, ContentNotificationHandler>(); private void CreateTestData() { Template template = TemplateBuilder.CreateTextPageTemplate(); FileService.SaveTemplate(template); // else, FK violation on contentType! _contentType = ContentTypeBuilder.CreateTextPageContentType(defaultTemplateId: template.Id); ContentTypeService.Save(_contentType); } [TearDown] public void Teardown() => ContentRepositoryBase.ThrowOnWarning = false; [Test] public void Saving_Culture() { LocalizationService.Save(new Language("fr-FR", "French (France)")); _contentType.Variations = ContentVariation.Culture; foreach (IPropertyType propertyType in _contentType.PropertyTypes) { propertyType.Variations = ContentVariation.Culture; } ContentTypeService.Save(_contentType); IContent document = new Content("content", -1, _contentType); document.SetCultureName("hello", "en-US"); document.SetCultureName("bonjour", "fr-FR"); ContentService.Save(document); // re-get - dirty properties need resetting document = ContentService.GetById(document.Id); // properties: title, bodyText, keywords, description document.SetValue("title", "title-en", "en-US"); var savingWasCalled = false; var savedWasCalled = false; ContentNotificationHandler.SavingContent = notification => { IContent saved = notification.SavedEntities.First(); Assert.AreSame(document, saved); Assert.IsTrue(notification.IsSavingCulture(saved, "en-US")); Assert.IsFalse(notification.IsSavingCulture(saved, "fr-FR")); savingWasCalled = true; }; ContentNotificationHandler.SavedContent = notification => { IContent saved = notification.SavedEntities.First(); Assert.AreSame(document, saved); Assert.IsTrue(notification.HasSavedCulture(saved, "en-US")); Assert.IsFalse(notification.HasSavedCulture(saved, "fr-FR")); savedWasCalled = true; }; try { ContentService.Save(document); Assert.IsTrue(savingWasCalled); Assert.IsTrue(savedWasCalled); } finally { ContentNotificationHandler.SavingContent = null; ContentNotificationHandler.SavedContent = null; } } [Test] public void Saving_Set_Value() { IContent document = new Content("content", -1, _contentType); var savingWasCalled = false; var savedWasCalled = false; ContentNotificationHandler.SavingContent = notification => { IContent saved = notification.SavedEntities.First(); Assert.IsTrue(document.GetValue<string>("title").IsNullOrWhiteSpace()); saved.SetValue("title", "title"); savingWasCalled = true; }; ContentNotificationHandler.SavedContent = notification => { IContent saved = notification.SavedEntities.First(); Assert.AreSame("title", document.GetValue<string>("title")); // we're only dealing with invariant here IPropertyValue propValue = saved.Properties["title"].Values.First(x => x.Culture == null && x.Segment == null); Assert.AreEqual("title", propValue.EditedValue); Assert.IsNull(propValue.PublishedValue); savedWasCalled = true; }; try { ContentService.Save(document); Assert.IsTrue(savingWasCalled); Assert.IsTrue(savedWasCalled); } finally { ContentNotificationHandler.SavingContent = null; ContentNotificationHandler.SavedContent = null; } } [Test] public void Publishing_Culture() { LocalizationService.Save(new Language("fr-FR", "French (France)")); _contentType.Variations = ContentVariation.Culture; foreach (IPropertyType propertyType in _contentType.PropertyTypes) { propertyType.Variations = ContentVariation.Culture; } ContentTypeService.Save(_contentType); IContent document = new Content("content", -1, _contentType); document.SetCultureName("hello", "en-US"); document.SetCultureName("bonjour", "fr-FR"); ContentService.Save(document); Assert.IsFalse(document.IsCulturePublished("fr-FR")); Assert.IsFalse(document.IsCulturePublished("en-US")); // re-get - dirty properties need resetting document = ContentService.GetById(document.Id); var publishingWasCalled = false; var publishedWasCalled = false; ContentNotificationHandler.PublishingContent += notification => { IContent publishing = notification.PublishedEntities.First(); Assert.AreSame(document, publishing); Assert.IsFalse(notification.IsPublishingCulture(publishing, "en-US")); Assert.IsTrue(notification.IsPublishingCulture(publishing, "fr-FR")); publishingWasCalled = true; }; ContentNotificationHandler.PublishedContent += notification => { IContent published = notification.PublishedEntities.First(); Assert.AreSame(document, published); Assert.IsFalse(notification.HasPublishedCulture(published, "en-US")); Assert.IsTrue(notification.HasPublishedCulture(published, "fr-FR")); publishedWasCalled = true; }; try { ContentService.SaveAndPublish(document, "fr-FR"); Assert.IsTrue(publishingWasCalled); Assert.IsTrue(publishedWasCalled); } finally { ContentNotificationHandler.PublishingContent = null; ContentNotificationHandler.PublishedContent = null; } document = ContentService.GetById(document.Id); // ensure it works and does not throw Assert.IsTrue(document.IsCulturePublished("fr-FR")); Assert.IsFalse(document.IsCulturePublished("en-US")); } [Test] public void Publishing_Set_Value() { IContent document = new Content("content", -1, _contentType); var savingWasCalled = false; var savedWasCalled = false; ContentNotificationHandler.SavingContent = notification => { IContent saved = notification.SavedEntities.First(); Assert.IsTrue(document.GetValue<string>("title").IsNullOrWhiteSpace()); saved.SetValue("title", "title"); savingWasCalled = true; }; ContentNotificationHandler.SavedContent = notification => { IContent saved = notification.SavedEntities.First(); Assert.AreSame("title", document.GetValue<string>("title")); // We're only dealing with invariant here. IPropertyValue propValue = saved.Properties["title"].Values.First(x => x.Culture == null && x.Segment == null); Assert.AreEqual("title", propValue.EditedValue); Assert.AreEqual("title", propValue.PublishedValue); savedWasCalled = true; }; try { ContentService.SaveAndPublish(document); Assert.IsTrue(savingWasCalled); Assert.IsTrue(savedWasCalled); } finally { ContentNotificationHandler.SavingContent = null; ContentNotificationHandler.SavedContent = null; } } [Test] public void Publishing_Set_Mandatory_Value() { IPropertyType titleProperty = _contentType.PropertyTypes.First(x => x.Alias == "title"); titleProperty.Mandatory = true; // make this required! ContentTypeService.Save(_contentType); IContent document = new Content("content", -1, _contentType); PublishResult result = ContentService.SaveAndPublish(document); Assert.IsFalse(result.Success); Assert.AreEqual("title", result.InvalidProperties.First().Alias); // when a service operation fails, the object is dirty and should not be re-used, // re-create it document = new Content("content", -1, _contentType); var savingWasCalled = false; ContentNotificationHandler.SavingContent = notification => { IContent saved = notification.SavedEntities.First(); Assert.IsTrue(document.GetValue<string>("title").IsNullOrWhiteSpace()); saved.SetValue("title", "title"); savingWasCalled = true; }; try { result = ContentService.SaveAndPublish(document); Assert.IsTrue(result.Success); // will succeed now because we were able to specify the required value in the Saving event Assert.IsTrue(savingWasCalled); } finally { ContentNotificationHandler.SavingContent = null; } } [Test] public void Unpublishing_Culture() { LocalizationService.Save(new Language("fr-FR", "French (France)")); _contentType.Variations = ContentVariation.Culture; foreach (IPropertyType propertyType in _contentType.PropertyTypes) { propertyType.Variations = ContentVariation.Culture; } ContentTypeService.Save(_contentType); IContent document = new Content("content", -1, _contentType); document.SetCultureName("hello", "en-US"); document.SetCultureName("bonjour", "fr-FR"); ContentService.SaveAndPublish(document); Assert.IsTrue(document.IsCulturePublished("fr-FR")); Assert.IsTrue(document.IsCulturePublished("en-US")); // re-get - dirty properties need resetting document = ContentService.GetById(document.Id); document.UnpublishCulture("fr-FR"); var publishingWasCalled = false; var publishedWasCalled = false; // TODO: revisit this - it was migrated when removing static events, but the expected result seems illogic - why does this test bind to Published and not Unpublished? ContentNotificationHandler.PublishingContent += notification => { IContent published = notification.PublishedEntities.First(); Assert.AreSame(document, published); Assert.IsFalse(notification.IsPublishingCulture(published, "en-US")); Assert.IsFalse(notification.IsPublishingCulture(published, "fr-FR")); Assert.IsFalse(notification.IsUnpublishingCulture(published, "en-US")); Assert.IsTrue(notification.IsUnpublishingCulture(published, "fr-FR")); publishingWasCalled = true; }; ContentNotificationHandler.PublishedContent += notification => { IContent published = notification.PublishedEntities.First(); Assert.AreSame(document, published); Assert.IsFalse(notification.HasPublishedCulture(published, "en-US")); Assert.IsFalse(notification.HasPublishedCulture(published, "fr-FR")); Assert.IsFalse(notification.HasUnpublishedCulture(published, "en-US")); Assert.IsTrue(notification.HasUnpublishedCulture(published, "fr-FR")); publishedWasCalled = true; }; try { ContentService.CommitDocumentChanges(document); Assert.IsTrue(publishingWasCalled); Assert.IsTrue(publishedWasCalled); } finally { ContentNotificationHandler.PublishingContent = null; ContentNotificationHandler.PublishedContent = null; } document = ContentService.GetById(document.Id); Assert.IsFalse(document.IsCulturePublished("fr-FR")); Assert.IsTrue(document.IsCulturePublished("en-US")); } public class ContentNotificationHandler : INotificationHandler<ContentSavingNotification>, INotificationHandler<ContentSavedNotification>, INotificationHandler<ContentPublishingNotification>, INotificationHandler<ContentPublishedNotification>, INotificationHandler<ContentUnpublishingNotification>, INotificationHandler<ContentUnpublishedNotification> { public void Handle(ContentSavingNotification notification) => SavingContent?.Invoke(notification); public void Handle(ContentSavedNotification notification) => SavedContent?.Invoke(notification); public void Handle(ContentPublishingNotification notification) => PublishingContent?.Invoke(notification); public void Handle(ContentPublishedNotification notification) => PublishedContent?.Invoke(notification); public void Handle(ContentUnpublishingNotification notification) => UnpublishingContent?.Invoke(notification); public void Handle(ContentUnpublishedNotification notification) => UnpublishedContent?.Invoke(notification); public static Action<ContentSavingNotification> SavingContent { get; set; } public static Action<ContentSavedNotification> SavedContent { get; set; } public static Action<ContentPublishingNotification> PublishingContent { get; set; } public static Action<ContentPublishedNotification> PublishedContent { get; set; } public static Action<ContentUnpublishingNotification> UnpublishingContent { get; set; } public static Action<ContentUnpublishedNotification> UnpublishedContent { get; set; } } } }
37.772627
178
0.619309
[ "MIT" ]
Lantzify/Umbraco-CMS
tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceNotificationTests.cs
17,111
C#
using System; namespace _01.SimulatesExecutionOfNLoops { public class Startup { public static void Main() { int number = int.Parse(Console.ReadLine()); int[] arr = new int[number]; LoopMe(0, arr); } public static void LoopMe(int index, int[] arr) { if (index == arr.Length) { Console.WriteLine(String.Join("", arr)); return; } for (int i = 0; i < arr.Length; i++) { arr[index] = i + 1; LoopMe(index + 1, arr); } } } }
21.375
56
0.406433
[ "MIT" ]
primas23/Homewoks
Data-Structures-and-Algorithms/03.Recursion/01.SimulatesExecutionOfNLoops/Startup.cs
686
C#
using System; using System.ComponentModel; using System.ComponentModel.Composition; using System.Data.Entity; using System.Threading.Tasks; using ThingSpeak.Client; using zvs; using zvs.DataModel; using zvs.Processor; namespace ThingSpeak { [Export(typeof(ZvsPlugin))] public class ThingSpeakPlugin : ZvsPlugin { private ThingSpeakClient ThingSpeakClient { get; set; } public override Guid PluginGuid { get { return Guid.Parse("14539d4e-6ac3-42cb-a930-172a1ec73db8"); } } public override string Name { get { return "Thing Speak Plugin for ZVS"; } } public override string Description { get { return "This plug-in will upload device changes to https://thingspeak.com."; } } public string ApiKey { get; set; } public string Field1 { get; set; } public string Field2 { get; set; } public string Field3 { get; set; } public string Field4 { get; set; } public string Field5 { get; set; } public string Field6 { get; set; } public string Field7 { get; set; } public string Field8 { get; set; } public override async Task OnSettingsCreating(PluginSettingBuilder settingBuilder) { var apiKey = new PluginSetting { UniqueIdentifier = "APIWRITEKEY", Name = "Write API Key", Value = "", ValueType = DataType.STRING, Description = "Write API Key from your channel on https://thingspeak.com/" }; await settingBuilder.Plugin(this).RegisterPluginSettingAsync(apiKey, o => o.ApiKey); var feild1 = new PluginSetting { UniqueIdentifier = "FIELD1", Name = "Field1 Device", Value = "", ValueType = DataType.STRING, Description = "The Value will be which zVirtual Device name you want mapped to ThingSpeak's field" }; await settingBuilder.Plugin(this).RegisterPluginSettingAsync(feild1, o => o.Field1); var feild2 = new PluginSetting { UniqueIdentifier = "FIELD2", Name = "Field2 Device", Value = "", ValueType = DataType.STRING, Description = "The Value will be which zVirtual Device name you want mapped to ThingSpeak's field" }; await settingBuilder.Plugin(this).RegisterPluginSettingAsync(feild2, o => o.Field2); var feild3 = new PluginSetting { UniqueIdentifier = "FIELD3", Name = "Field3 Device", Value = "", ValueType = DataType.STRING, Description = "The Value will be which zVirtual Device name you want mapped to ThingSpeak's field" }; await settingBuilder.Plugin(this).RegisterPluginSettingAsync(feild3, o => o.Field3); var feild4 = new PluginSetting { UniqueIdentifier = "FIELD4", Name = "Field4 Device", Value = "", ValueType = DataType.STRING, Description = "The Value will be which zVirtual Device name you want mapped to ThingSpeak's field" }; await settingBuilder.Plugin(this).RegisterPluginSettingAsync(feild4, o => o.Field4); var feild5 = new PluginSetting { UniqueIdentifier = "FIELD5", Name = "Field5 Device", Value = "", ValueType = DataType.STRING, Description = "The Value will be which zVirtual Device name you want mapped to ThingSpeak's field" }; await settingBuilder.Plugin(this).RegisterPluginSettingAsync(feild5, o => o.Field5); var feild6 = new PluginSetting { UniqueIdentifier = "FIELD6", Name = "Field6 Device", Value = "", ValueType = DataType.STRING, Description = "The Value will be which zVirtual Device name you want mapped to ThingSpeak's field" }; await settingBuilder.Plugin(this).RegisterPluginSettingAsync(feild6, o => o.Field6); var feild7 = new PluginSetting { UniqueIdentifier = "FIELD7", Name = "Field7 Device", Value = "", ValueType = DataType.STRING, Description = "The Value will be which zVirtual Device name you want mapped to ThingSpeak's field" }; await settingBuilder.Plugin(this).RegisterPluginSettingAsync(feild7, o => o.Field7); var feild8 = new PluginSetting { UniqueIdentifier = "FIELD8", Name = "Field8 Device", Value = "", ValueType = DataType.STRING, Description = "The Value will be which zVirtual Device name you want mapped to ThingSpeak's field" }; await settingBuilder.Plugin(this).RegisterPluginSettingAsync(feild8, o => o.Field8); } public override async Task StartAsync() { if (string.IsNullOrWhiteSpace(ApiKey)) { await Log.ReportWarningFormatAsync(CancellationToken, "Could not start {0}, missing API key ", Name); return; } ThingSpeakClient = new ThingSpeakClient(ApiKey); NotifyEntityChangeContext.ChangeNotifications<DeviceValue>.OnEntityUpdated += ChangeNotificationsOnOnEntityUpdated; await Log.ReportInfoFormatAsync(CancellationToken, "{0} started", Name); } public override async Task StopAsync() { NotifyEntityChangeContext.ChangeNotifications<DeviceValue>.OnEntityUpdated -= ChangeNotificationsOnOnEntityUpdated; await Log.ReportInfoFormatAsync(CancellationToken, "{0} stopped", Name); } private void ChangeNotificationsOnOnEntityUpdated(object sender, NotifyEntityChangeContext.ChangeNotifications<DeviceValue>.EntityUpdatedArgs entityUpdatedArgs) { var bw = new BackgroundWorker(); bw.DoWork += async (s, a) => { try { await Log.ReportInfoFormatAsync(CancellationToken, "{0} working!", Name); using (var context = new ZvsContext(EntityContextConnection)) { var dv = await context.DeviceValues .FirstOrDefaultAsync(v => v.Id == entityUpdatedArgs.NewEntity.Id, CancellationToken); await Log.ReportInfoFormatAsync(CancellationToken, "DeviceValueId : {1}, new:{2}, old:{3}, dv.Value:{4}", (dv != null && dv.Value != null), entityUpdatedArgs.NewEntity.Id, entityUpdatedArgs.NewEntity.Value, entityUpdatedArgs.OldEntity.Value); if (dv == null || dv.Value == null) return; var name = dv.Device.Name; await Log.ReportInfoFormatAsync(CancellationToken, "[{0}] value name: [{1}], Value: [{2}]", Name, name, dv.Value); if (name == Field1) { await Log.ReportInfoFormatAsync(CancellationToken, "Sending {0} to ThingSpeak as Field1, Value={1}", name, dv.Value); short response; var success = ThingSpeakClient.SendDataToThingSpeak(out response, dv.Value); await Log.ReportInfoFormatAsync(CancellationToken, "ThingSpeak results ({0}): success:{1}, response:{2}", name, success, response); } if (name == Field2) { await Log.ReportInfoFormatAsync(CancellationToken, "Sending {0} to ThingSpeak as Field2, Value={1}", name, dv.Value); short response; var success = ThingSpeakClient.SendDataToThingSpeak(out response, null, dv.Value); await Log.ReportInfoFormatAsync(CancellationToken, "ThingSpeak results ({0}): success:{1}, response:{2}", name, success, response); } if (name == Field3) { await Log.ReportInfoFormatAsync(CancellationToken, "Sending {0} to ThingSpeak as Field3, Value={1}", name, dv.Value); short response; var success = ThingSpeakClient.SendDataToThingSpeak(out response, null, null, dv.Value); await Log.ReportInfoFormatAsync(CancellationToken, "ThingSpeak results ({0}): success:{1}, response:{2}", name, success, response); } if (name == Field4) { await Log.ReportInfoFormatAsync(CancellationToken, "Sending {0} to ThingSpeak as Field4, Value={1}", name, dv.Value); short response; var success = ThingSpeakClient.SendDataToThingSpeak(out response, null, null, null, dv.Value); await Log.ReportInfoFormatAsync(CancellationToken, "ThingSpeak results ({0}): success:{1}, response:{2}", name, success, response); } if (name == Field5) { await Log.ReportInfoFormatAsync(CancellationToken, "Sending {0} to ThingSpeak as Field5, Value={1}", name, dv.Value); short response; var success = ThingSpeakClient.SendDataToThingSpeak(out response, null, null, null, null, dv.Value); await Log.ReportInfoFormatAsync(CancellationToken, "ThingSpeak results ({0}): success:{1}, response:{2}", name, success, response); } if (name == Field6) { await Log.ReportInfoFormatAsync(CancellationToken, "Sending {0} to ThingSpeak as Field6, Value={1}", name, dv.Value); short response; var success = ThingSpeakClient.SendDataToThingSpeak(out response, null, null, null, null, null, dv.Value); await Log.ReportInfoFormatAsync(CancellationToken, "ThingSpeak results ({0}): success:{1}, response:{2}", name, success, response); } if (name == Field7) { await Log.ReportInfoFormatAsync(CancellationToken, "Sending {0} to ThingSpeak as Field7, Value={1}", name, dv.Value); short response; var success = ThingSpeakClient.SendDataToThingSpeak(out response, null, null, null, null, null, null, dv.Value); await Log.ReportInfoFormatAsync(CancellationToken, "ThingSpeak results ({0}): success:{1}, response:{2}", name, success, response); } if (name == Field8) { await Log.ReportInfoFormatAsync(CancellationToken, "Sending {0} to ThingSpeak as Field8, Value={1}", name, dv.Value); short response; var success = ThingSpeakClient.SendDataToThingSpeak(out response, null, null, null, null, null, null, null, dv.Value); await Log.ReportInfoFormatAsync(CancellationToken, "ThingSpeak results ({0}): success:{1}, response:{2}", name, success, response); } } } catch (Exception e) { Log.ReportErrorAsync(e.Message, CancellationToken).Wait(); } }; bw.RunWorkerAsync(); } } }
50.293388
266
0.54523
[ "MIT" ]
aarondrabeck/zVirtualScenes
Plugins/ThingSpeak/ThingSpeakPlugin.cs
12,173
C#
/* Copyright (c) Citrix Systems, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, * with or without modification, are permitted provided * that the following conditions are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ using System; using System.ComponentModel; using System.Windows.Forms; namespace XenAdmin.Controls { public partial class DiskSpinner : UserControl { private const long DEFAULT_MINIMUM = Util.BINARY_MEGA; //default minimum size for disks private const long DEFAULT_MAXIMUM = Util.BINARY_PETA; //default maximum size for disks private long _minDiskSize = DEFAULT_MINIMUM; private bool _updating; private bool _isSizeValid; public event Action SelectedSizeChanged; public DiskSpinner() { InitializeComponent(); DiskSizeNumericUpDown.TextChanged += DiskSizeNumericUpDown_TextChanged; } [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool CanResize { get => DiskSizeNumericUpDown.Enabled && comboBoxUnits.Enabled; set => DiskSizeNumericUpDown.Enabled = comboBoxUnits.Enabled = value; } public long SelectedSize { get; private set; } = Util.BINARY_GIGA; //default size for disks public bool IsSizeValid { get => _isSizeValid; private set { _isSizeValid = value; SelectedSizeChanged?.Invoke(); } } public void Populate(long selectedSize = Util.BINARY_GIGA, long minSize = DEFAULT_MINIMUM) { if (minSize < DEFAULT_MINIMUM) minSize = DEFAULT_MINIMUM; if (minSize > DEFAULT_MAXIMUM) minSize = DEFAULT_MAXIMUM; if (selectedSize < minSize) selectedSize = minSize; if (selectedSize > DEFAULT_MAXIMUM) selectedSize = DEFAULT_MAXIMUM; SelectedSize = selectedSize; _minDiskSize = minSize; comboBoxUnits.Items.Add(new DiskSizeWithUnits(3, 1, 0.001M, Util.BINARY_KILO, Util.BINARY_TERA, Messages.VAL_TERB, Util.ToTB)); comboBoxUnits.Items.Add(new DiskSizeWithUnits(3, 1, 0.001M, Util.BINARY_MEGA, Util.BINARY_GIGA, Messages.VAL_GIGB, Util.ToGB)); comboBoxUnits.Items.Add(new DiskSizeWithUnits(0, 256, 1, Util.BINARY_GIGA, Util.BINARY_MEGA, Messages.VAL_MEGB, Util.ToMB)); foreach (DiskSizeWithUnits item in comboBoxUnits.Items) { if (item.TryRoundOptimal(selectedSize, out _)) { comboBoxUnits.SelectedItem = item; break; } } } public void ValidateSize() { if (_updating || !(comboBoxUnits.SelectedItem is DiskSizeWithUnits dsk)) return; if (string.IsNullOrEmpty(DiskSizeNumericUpDown.Text.Trim())) //do not issue error here { SetError(null); IsSizeValid = false; return; } // Don't use DiskSizeNumericUpDown.Value here, as it will fire the NumericUpDown built-in validation. // Use Text property instead. (CA-46028) if (!decimal.TryParse(DiskSizeNumericUpDown.Text.Trim(), out decimal result) || result < 0) { SetError(Messages.INVALID_NUMBER); IsSizeValid = false; return; } try { SelectedSize = (long)(result * dsk.Multiplier); } catch (OverflowException) //CA-71312 { SelectedSize = long.MaxValue; } if (SelectedSize < _minDiskSize) { SetError(string.Format(Messages.DISK_TOO_SMALL, Util.DiskSizeString(_minDiskSize, dsk.DecimalPlaces))); IsSizeValid = false; return; } if (SelectedSize > DEFAULT_MAXIMUM) { SetError(Messages.INVALID_NUMBER); IsSizeValid = false; return; } SetError(null); IsSizeValid = true; } public void SetError(string error) { if (string.IsNullOrEmpty(error)) tableLayoutPanelError.Visible = false; else { tableLayoutPanelError.Visible = true; labelError.Text = error; } } private void DiskSizeNumericUpDown_ValueChanged(object sender, EventArgs e) { ValidateSize(); } private void DiskSizeNumericUpDown_TextChanged(object sender, EventArgs e) { ValidateSize(); } private void DiskSizeNumericUpDown_KeyUp(object sender, KeyEventArgs e) { ValidateSize(); } private void comboBoxUnits_SelectedIndexChanged(object sender, EventArgs e) { try { _updating = true; if (!(comboBoxUnits.SelectedItem is DiskSizeWithUnits dsk)) return; DiskSizeNumericUpDown.Increment = dsk.Increment; DiskSizeNumericUpDown.DecimalPlaces = dsk.DecimalPlaces; DiskSizeNumericUpDown.Minimum = dsk.Minimum; DiskSizeNumericUpDown.Maximum = dsk.Maximum; DiskSizeNumericUpDown.Value = dsk.RoundSize(SelectedSize); } finally { _updating = false; } ValidateSize(); } private struct DiskSizeWithUnits { public int DecimalPlaces { get; } public int Increment { get; } public decimal Minimum { get; } public decimal Maximum { get; } public long Multiplier { get; } public string Unit { get; } public Func<double, RoundingBehaviour, int, double> RoundingFunction { get; } public DiskSizeWithUnits(int decimalPlaces, int increment, decimal minimum, decimal maximum, long multiplier, string unit, Func<double, RoundingBehaviour, int, double> roundingFunction) { DecimalPlaces = decimalPlaces; Increment = increment; Minimum = minimum; Maximum = maximum; Multiplier = multiplier; Unit = unit; RoundingFunction = roundingFunction; } public override string ToString() { return Unit; } public decimal RoundSize(decimal size) { var rounded = (decimal)RoundingFunction((double)size, RoundingBehaviour.Up, DecimalPlaces); if (rounded < Minimum) return Minimum; if (rounded > Maximum) return Maximum; return rounded; } public bool TryRoundOptimal(decimal size, out decimal result) { if (size >= Multiplier) { result = (decimal)RoundingFunction((double)size, RoundingBehaviour.Up, DecimalPlaces); return true; } result = 0; return false; } } } }
35.431373
140
0.558827
[ "BSD-2-Clause" ]
DigitEgal/xenadmin
XenAdmin/Controls/DiskSpinner.cs
9,037
C#
using AGDevUnity.StdUtil; using AGDev; using System.Collections; using System.Collections.Generic; using UnityEngine; using AGBLang; public class ProcessControllPannel : MonoBehaviour { public StdMonoBGeneralPanel pannlPrefab; public StdMonoBGeneralPanel analysisProcessPannel; public StdMonoBGeneralPanel assetProcessPannel; public ObservedMonoBLProcessor syntactic; public RootAssetSupplier supplier; public MonoBObservedCSGiver csGiver; public RootAssetReferer referer; private void Awake() { analysisProcessPannel = Instantiate(pannlPrefab, transform); analysisProcessPannel.panel.title = "Analytic Processes"; analysisProcessPannel.panel.iconName = "AnalysisIcon.png"; assetProcessPannel = Instantiate(analysisProcessPannel, transform); assetProcessPannel.panel.title = "Asset Processes"; assetProcessPannel.panel.iconName = "AssetIcon.png"; analysisProcessPannel.panel.AddProcessObservePannel("Syntax", syntactic.observeHelper, "SProcessIcon.png"); analysisProcessPannel.panel.AddProcessObservePannel("Common Sense", csGiver.observeHelper, "CommonSenseIcon.png"); assetProcessPannel.panel.AddProcessObservePannel("Search", supplier.observeHelper, "SearchIcon.png"); assetProcessPannel.panel.AddProcessObservePannel("Download", referer.helper, "DownloadIcon.png"); } }
45
116
0.829119
[ "Unlicense" ]
iwaag/AGDevUnity
AdminUI/AdminUI/ProcessControllPannel.cs
1,307
C#
namespace KinderKulturServer.Providers { public class NewsGroup { public long Id { get; set; } public string Name { get; set; } } }
19.875
40
0.603774
[ "MIT" ]
DonCorleone/KinderKultur_Docker
Server/Providers/NewsGroup.cs
159
C#
/* * Copyright 2004-2010 Apple Computer, Inc., Mozilla Foundation, and Opera * Software ASA. * * You are granted a license to use, reproduce and create derivative works of * this document. */ #pragma warning disable 1591 // Missing XML comment #pragma warning disable 1570 // XML comment on 'construct' has badly formed XML — 'reason' #pragma warning disable 1587 // XML comment is not placed on a valid element namespace HtmlParserSharp.Core { public sealed class NamedCharacters { internal static readonly string[] NAMES = { "lig", "lig;", "P", "P;", "cute", "cute;", "reve;", "irc", "irc;", "y;", "r;", "rave", "rave;", "pha;", "acr;", "d;", "gon;", "pf;", "plyFunction;", "ing", "ing;", "cr;", "sign;", "ilde", "ilde;", "ml", "ml;", "ckslash;", "rv;", "rwed;", "y;", "cause;", "rnoullis;", "ta;", "r;", "pf;", "eve;", "cr;", "mpeq;", "cy;", "PY", "PY;", "cute;", "p;", "pitalDifferentialD;", "yleys;", "aron;", "edil", "edil;", "irc;", "onint;", "ot;", "dilla;", "nterDot;", "r;", "i;", "rcleDot;", "rcleMinus;", "rclePlus;", "rcleTimes;", "ockwiseContourIntegral;", "oseCurlyDoubleQuote;", "oseCurlyQuote;", "lon;", "lone;", "ngruent;", "nint;", "ntourIntegral;", "pf;", "product;", "unterClockwiseContourIntegral;", "oss;", "cr;", "p;", "pCap;", ";", "otrahd;", "cy;", "cy;", "cy;", "gger;", "rr;", "shv;", "aron;", "y;", "l;", "lta;", "r;", "acriticalAcute;", "acriticalDot;", "acriticalDoubleAcute;", "acriticalGrave;", "acriticalTilde;", "amond;", "fferentialD;", "pf;", "t;", "tDot;", "tEqual;", "ubleContourIntegral;", "ubleDot;", "ubleDownArrow;", "ubleLeftArrow;", "ubleLeftRightArrow;", "ubleLeftTee;", "ubleLongLeftArrow;", "ubleLongLeftRightArrow;", "ubleLongRightArrow;", "ubleRightArrow;", "ubleRightTee;", "ubleUpArrow;", "ubleUpDownArrow;", "ubleVerticalBar;", "wnArrow;", "wnArrowBar;", "wnArrowUpArrow;", "wnBreve;", "wnLeftRightVector;", "wnLeftTeeVector;", "wnLeftVector;", "wnLeftVectorBar;", "wnRightTeeVector;", "wnRightVector;", "wnRightVectorBar;", "wnTee;", "wnTeeArrow;", "wnarrow;", "cr;", "trok;", "G;", "H", "H;", "cute", "cute;", "aron;", "irc", "irc;", "y;", "ot;", "r;", "rave", "rave;", "ement;", "acr;", "ptySmallSquare;", "ptyVerySmallSquare;", "gon;", "pf;", "silon;", "ual;", "ualTilde;", "uilibrium;", "cr;", "im;", "a;", "ml", "ml;", "ists;", "ponentialE;", "y;", "r;", "lledSmallSquare;", "lledVerySmallSquare;", "pf;", "rAll;", "uriertrf;", "cr;", "cy;", "", ";", "mma;", "mmad;", "reve;", "edil;", "irc;", "y;", "ot;", "r;", ";", "pf;", "eaterEqual;", "eaterEqualLess;", "eaterFullEqual;", "eaterGreater;", "eaterLess;", "eaterSlantEqual;", "eaterTilde;", "cr;", ";", "RDcy;", "cek;", "t;", "irc;", "r;", "lbertSpace;", "pf;", "rizontalLine;", "cr;", "trok;", "mpDownHump;", "mpEqual;", "cy;", "lig;", "cy;", "cute", "cute;", "irc", "irc;", "y;", "ot;", "r;", "rave", "rave;", ";", "acr;", "aginaryI;", "plies;", "t;", "tegral;", "tersection;", "visibleComma;", "visibleTimes;", "gon;", "pf;", "ta;", "cr;", "ilde;", "kcy;", "ml", "ml;", "irc;", "y;", "r;", "pf;", "cr;", "ercy;", "kcy;", "cy;", "cy;", "ppa;", "edil;", "y;", "r;", "pf;", "cr;", "cy;", "", ";", "cute;", "mbda;", "ng;", "placetrf;", "rr;", "aron;", "edil;", "y;", "ftAngleBracket;", "ftArrow;", "ftArrowBar;", "ftArrowRightArrow;", "ftCeiling;", "ftDoubleBracket;", "ftDownTeeVector;", "ftDownVector;", "ftDownVectorBar;", "ftFloor;", "ftRightArrow;", "ftRightVector;", "ftTee;", "ftTeeArrow;", "ftTeeVector;", "ftTriangle;", "ftTriangleBar;", "ftTriangleEqual;", "ftUpDownVector;", "ftUpTeeVector;", "ftUpVector;", "ftUpVectorBar;", "ftVector;", "ftVectorBar;", "ftarrow;", "ftrightarrow;", "ssEqualGreater;", "ssFullEqual;", "ssGreater;", "ssLess;", "ssSlantEqual;", "ssTilde;", "r;", ";", "eftarrow;", "idot;", "ngLeftArrow;", "ngLeftRightArrow;", "ngRightArrow;", "ngleftarrow;", "ngleftrightarrow;", "ngrightarrow;", "pf;", "werLeftArrow;", "werRightArrow;", "cr;", "h;", "trok;", ";", "p;", "y;", "diumSpace;", "llintrf;", "r;", "nusPlus;", "pf;", "cr;", ";", "cy;", "cute;", "aron;", "edil;", "y;", "gativeMediumSpace;", "gativeThickSpace;", "gativeThinSpace;", "gativeVeryThinSpace;", "stedGreaterGreater;", "stedLessLess;", "wLine;", "r;", "Break;", "nBreakingSpace;", "pf;", "t;", "tCongruent;", "tCupCap;", "tDoubleVerticalBar;", "tElement;", "tEqual;", "tEqualTilde;", "tExists;", "tGreater;", "tGreaterEqual;", "tGreaterFullEqual;", "tGreaterGreater;", "tGreaterLess;", "tGreaterSlantEqual;", "tGreaterTilde;", "tHumpDownHump;", "tHumpEqual;", "tLeftTriangle;", "tLeftTriangleBar;", "tLeftTriangleEqual;", "tLess;", "tLessEqual;", "tLessGreater;", "tLessLess;", "tLessSlantEqual;", "tLessTilde;", "tNestedGreaterGreater;", "tNestedLessLess;", "tPrecedes;", "tPrecedesEqual;", "tPrecedesSlantEqual;", "tReverseElement;", "tRightTriangle;", "tRightTriangleBar;", "tRightTriangleEqual;", "tSquareSubset;", "tSquareSubsetEqual;", "tSquareSuperset;", "tSquareSupersetEqual;", "tSubset;", "tSubsetEqual;", "tSucceeds;", "tSucceedsEqual;", "tSucceedsSlantEqual;", "tSucceedsTilde;", "tSuperset;", "tSupersetEqual;", "tTilde;", "tTildeEqual;", "tTildeFullEqual;", "tTildeTilde;", "tVerticalBar;", "cr;", "ilde", "ilde;", ";", "lig;", "cute", "cute;", "irc", "irc;", "y;", "blac;", "r;", "rave", "rave;", "acr;", "ega;", "icron;", "pf;", "enCurlyDoubleQuote;", "enCurlyQuote;", ";", "cr;", "lash", "lash;", "ilde", "ilde;", "imes;", "ml", "ml;", "erBar;", "erBrace;", "erBracket;", "erParenthesis;", "rtialD;", "y;", "r;", "i;", ";", "usMinus;", "incareplane;", "pf;", ";", "ecedes;", "ecedesEqual;", "ecedesSlantEqual;", "ecedesTilde;", "ime;", "oduct;", "oportion;", "oportional;", "cr;", "i;", "OT", "OT;", "r;", "pf;", "cr;", "arr;", "G", "G;", "cute;", "ng;", "rr;", "rrtl;", "aron;", "edil;", "y;", ";", "verseElement;", "verseEquilibrium;", "verseUpEquilibrium;", "r;", "o;", "ghtAngleBracket;", "ghtArrow;", "ghtArrowBar;", "ghtArrowLeftArrow;", "ghtCeiling;", "ghtDoubleBracket;", "ghtDownTeeVector;", "ghtDownVector;", "ghtDownVectorBar;", "ghtFloor;", "ghtTee;", "ghtTeeArrow;", "ghtTeeVector;", "ghtTriangle;", "ghtTriangleBar;", "ghtTriangleEqual;", "ghtUpDownVector;", "ghtUpTeeVector;", "ghtUpVector;", "ghtUpVectorBar;", "ghtVector;", "ghtVectorBar;", "ghtarrow;", "pf;", "undImplies;", "ightarrow;", "cr;", "h;", "leDelayed;", "CHcy;", "cy;", "FTcy;", "cute;", ";", "aron;", "edil;", "irc;", "y;", "r;", "ortDownArrow;", "ortLeftArrow;", "ortRightArrow;", "ortUpArrow;", "gma;", "allCircle;", "pf;", "rt;", "uare;", "uareIntersection;", "uareSubset;", "uareSubsetEqual;", "uareSuperset;", "uareSupersetEqual;", "uareUnion;", "cr;", "ar;", "b;", "bset;", "bsetEqual;", "cceeds;", "cceedsEqual;", "cceedsSlantEqual;", "cceedsTilde;", "chThat;", "m;", "p;", "perset;", "persetEqual;", "pset;", "ORN", "ORN;", "ADE;", "Hcy;", "cy;", "b;", "u;", "aron;", "edil;", "y;", "r;", "erefore;", "eta;", "ickSpace;", "inSpace;", "lde;", "ldeEqual;", "ldeFullEqual;", "ldeTilde;", "pf;", "ipleDot;", "cr;", "trok;", "cute", "cute;", "rr;", "rrocir;", "rcy;", "reve;", "irc", "irc;", "y;", "blac;", "r;", "rave", "rave;", "acr;", "derBar;", "derBrace;", "derBracket;", "derParenthesis;", "ion;", "ionPlus;", "gon;", "pf;", "Arrow;", "ArrowBar;", "ArrowDownArrow;", "DownArrow;", "Equilibrium;", "Tee;", "TeeArrow;", "arrow;", "downarrow;", "perLeftArrow;", "perRightArrow;", "si;", "silon;", "ing;", "cr;", "ilde;", "ml", "ml;", "ash;", "ar;", "y;", "ash;", "ashl;", "e;", "rbar;", "rt;", "rticalBar;", "rticalLine;", "rticalSeparator;", "rticalTilde;", "ryThinSpace;", "r;", "pf;", "cr;", "dash;", "irc;", "dge;", "r;", "pf;", "cr;", "r;", ";", "pf;", "cr;", "cy;", "cy;", "cy;", "cute", "cute;", "irc;", "y;", "r;", "pf;", "cr;", "ml;", "cy;", "cute;", "aron;", "y;", "ot;", "roWidthSpace;", "ta;", "r;", "pf;", "cr;", "cute", "cute;", "reve;", ";", "E;", "d;", "irc", "irc;", "ute", "ute;", "y;", "lig", "lig;", ";", "r;", "rave", "rave;", "efsym;", "eph;", "pha;", "acr;", "alg;", "p", "p;", "d;", "dand;", "dd;", "dslope;", "dv;", "g;", "ge;", "gle;", "gmsd;", "gmsdaa;", "gmsdab;", "gmsdac;", "gmsdad;", "gmsdae;", "gmsdaf;", "gmsdag;", "gmsdah;", "grt;", "grtvb;", "grtvbd;", "gsph;", "gst;", "gzarr;", "gon;", "pf;", ";", "E;", "acir;", "e;", "id;", "os;", "prox;", "proxeq;", "ing", "ing;", "cr;", "t;", "ymp;", "ympeq;", "ilde", "ilde;", "ml", "ml;", "conint;", "int;", "ot;", "ckcong;", "ckepsilon;", "ckprime;", "cksim;", "cksimeq;", "rvee;", "rwed;", "rwedge;", "rk;", "rktbrk;", "ong;", "y;", "quo;", "caus;", "cause;", "mptyv;", "psi;", "rnou;", "ta;", "th;", "tween;", "r;", "gcap;", "gcirc;", "gcup;", "godot;", "goplus;", "gotimes;", "gsqcup;", "gstar;", "gtriangledown;", "gtriangleup;", "guplus;", "gvee;", "gwedge;", "arow;", "acklozenge;", "acksquare;", "acktriangle;", "acktriangledown;", "acktriangleleft;", "acktriangleright;", "ank;", "k12;", "k14;", "k34;", "ock;", "e;", "equiv;", "ot;", "pf;", "t;", "ttom;", "wtie;", "xDL;", "xDR;", "xDl;", "xDr;", "xH;", "xHD;", "xHU;", "xHd;", "xHu;", "xUL;", "xUR;", "xUl;", "xUr;", "xV;", "xVH;", "xVL;", "xVR;", "xVh;", "xVl;", "xVr;", "xbox;", "xdL;", "xdR;", "xdl;", "xdr;", "xh;", "xhD;", "xhU;", "xhd;", "xhu;", "xminus;", "xplus;", "xtimes;", "xuL;", "xuR;", "xul;", "xur;", "xv;", "xvH;", "xvL;", "xvR;", "xvh;", "xvl;", "xvr;", "rime;", "eve;", "vbar", "vbar;", "cr;", "emi;", "im;", "ime;", "ol;", "olb;", "olhsub;", "ll;", "llet;", "mp;", "mpE;", "mpe;", "mpeq;", "cute;", "p;", "pand;", "pbrcup;", "pcap;", "pcup;", "pdot;", "ps;", "ret;", "ron;", "aps;", "aron;", "edil", "edil;", "irc;", "ups;", "upssm;", "ot;", "dil", "dil;", "mptyv;", "nt", "nt;", "nterdot;", "r;", "cy;", "eck;", "eckmark;", "i;", "r;", "rE;", "rc;", "rceq;", "rclearrowleft;", "rclearrowright;", "rcledR;", "rcledS;", "rcledast;", "rcledcirc;", "rcleddash;", "re;", "rfnint;", "rmid;", "rscir;", "ubs;", "ubsuit;", "lon;", "lone;", "loneq;", "mma;", "mmat;", "mp;", "mpfn;", "mplement;", "mplexes;", "ng;", "ngdot;", "nint;", "pf;", "prod;", "py", "py;", "pysr;", "arr;", "oss;", "cr;", "ub;", "ube;", "up;", "upe;", "dot;", "darrl;", "darrr;", "epr;", "esc;", "larr;", "larrp;", "p;", "pbrcap;", "pcap;", "pcup;", "pdot;", "por;", "ps;", "rarr;", "rarrm;", "rlyeqprec;", "rlyeqsucc;", "rlyvee;", "rlywedge;", "rren", "rren;", "rvearrowleft;", "rvearrowright;", "vee;", "wed;", "conint;", "int;", "lcty;", "rr;", "ar;", "gger;", "leth;", "rr;", "sh;", "shv;", "karow;", "lac;", "aron;", "y;", ";", "agger;", "arr;", "otseq;", "g", "g;", "lta;", "mptyv;", "isht;", "r;", "arl;", "arr;", "am;", "amond;", "amondsuit;", "ams;", "e;", "gamma;", "sin;", "v;", "vide", "vide;", "videontimes;", "vonx;", "cy;", "corn;", "crop;", "llar;", "pf;", "t;", "teq;", "teqdot;", "tminus;", "tplus;", "tsquare;", "ublebarwedge;", "wnarrow;", "wndownarrows;", "wnharpoonleft;", "wnharpoonright;", "bkarow;", "corn;", "crop;", "cr;", "cy;", "ol;", "trok;", "dot;", "ri;", "rif;", "arr;", "har;", "angle;", "cy;", "igrarr;", "Dot;", "ot;", "cute", "cute;", "ster;", "aron;", "ir;", "irc", "irc;", "olon;", "y;", "ot;", ";", "Dot;", "r;", ";", "rave", "rave;", "s;", "sdot;", ";", "inters;", "l;", "s;", "sdot;", "acr;", "pty;", "ptyset;", "ptyv;", "sp13;", "sp14;", "sp;", "g;", "sp;", "gon;", "pf;", "ar;", "arsl;", "lus;", "si;", "silon;", "siv;", "circ;", "colon;", "sim;", "slantgtr;", "slantless;", "uals;", "uest;", "uiv;", "uivDD;", "vparsl;", "Dot;", "arr;", "cr;", "dot;", "im;", "a;", "h", "h;", "ml", "ml;", "ro;", "cl;", "ist;", "pectation;", "ponentiale;", "llingdotseq;", "y;", "male;", "ilig;", "lig;", "llig;", "r;", "lig;", "lig;", "at;", "lig;", "tns;", "of;", "pf;", "rall;", "rk;", "rkv;", "artint;", "ac12", "ac12;", "ac13;", "ac14", "ac14;", "ac15;", "ac16;", "ac18;", "ac23;", "ac25;", "ac34", "ac34;", "ac35;", "ac38;", "ac45;", "ac56;", "ac58;", "ac78;", "asl;", "own;", "cr;", ";", "l;", "cute;", "mma;", "mmad;", "p;", "reve;", "irc;", "y;", "ot;", ";", "l;", "q;", "qq;", "qslant;", "s;", "scc;", "sdot;", "sdoto;", "sdotol;", "sl;", "sles;", "r;", ";", "g;", "mel;", "cy;", ";", "E;", "a;", "j;", "E;", "ap;", "approx;", "e;", "eq;", "eqq;", "sim;", "pf;", "ave;", "cr;", "im;", "ime;", "iml;", "", ";", "cc;", "cir;", "dot;", "lPar;", "quest;", "rapprox;", "rarr;", "rdot;", "reqless;", "reqqless;", "rless;", "rsim;", "ertneqq;", "nE;", "rr;", "irsp;", "lf;", "milt;", "rdcy;", "rr;", "rrcir;", "rrw;", "ar;", "irc;", "arts;", "artsuit;", "llip;", "rcon;", "r;", "searow;", "swarow;", "arr;", "mtht;", "okleftarrow;", "okrightarrow;", "pf;", "rbar;", "cr;", "lash;", "trok;", "bull;", "phen;", "cute", "cute;", ";", "irc", "irc;", "y;", "cy;", "xcl", "xcl;", "f;", "r;", "rave", "rave;", ";", "iint;", "int;", "nfin;", "ota;", "lig;", "acr;", "age;", "agline;", "agpart;", "ath;", "of;", "ped;", ";", "care;", "fin;", "fintie;", "odot;", "t;", "tcal;", "tegers;", "tercal;", "tlarhk;", "tprod;", "cy;", "gon;", "pf;", "ta;", "rod;", "uest", "uest;", "cr;", "in;", "inE;", "indot;", "ins;", "insv;", "inv;", ";", "ilde;", "kcy;", "ml", "ml;", "irc;", "y;", "r;", "ath;", "pf;", "cr;", "ercy;", "kcy;", "ppa;", "ppav;", "edil;", "y;", "r;", "reen;", "cy;", "cy;", "pf;", "cr;", "arr;", "rr;", "tail;", "arr;", ";", "g;", "ar;", "cute;", "emptyv;", "gran;", "mbda;", "ng;", "ngd;", "ngle;", "p;", "quo", "quo;", "rr;", "rrb;", "rrbfs;", "rrfs;", "rrhk;", "rrlp;", "rrpl;", "rrsim;", "rrtl;", "t;", "tail;", "te;", "tes;", "arr;", "brk;", "race;", "rack;", "rke;", "rksld;", "rkslu;", "aron;", "edil;", "eil;", "ub;", "y;", "ca;", "quo;", "quor;", "rdhar;", "rushar;", "sh;", ";", "ftarrow;", "ftarrowtail;", "ftharpoondown;", "ftharpoonup;", "ftleftarrows;", "ftrightarrow;", "ftrightarrows;", "ftrightharpoons;", "ftrightsquigarrow;", "ftthreetimes;", "g;", "q;", "qq;", "qslant;", "s;", "scc;", "sdot;", "sdoto;", "sdotor;", "sg;", "sges;", "ssapprox;", "ssdot;", "sseqgtr;", "sseqqgtr;", "ssgtr;", "sssim;", "isht;", "loor;", "r;", ";", "E;", "ard;", "aru;", "arul;", "blk;", "cy;", ";", "arr;", "corner;", "hard;", "tri;", "idot;", "oust;", "oustache;", "E;", "ap;", "approx;", "e;", "eq;", "eqq;", "sim;", "ang;", "arr;", "brk;", "ngleftarrow;", "ngleftrightarrow;", "ngmapsto;", "ngrightarrow;", "oparrowleft;", "oparrowright;", "par;", "pf;", "plus;", "times;", "wast;", "wbar;", "z;", "zenge;", "zf;", "ar;", "arlt;", "arr;", "corner;", "har;", "hard;", "m;", "tri;", "aquo;", "cr;", "h;", "im;", "ime;", "img;", "qb;", "quo;", "quor;", "trok;", "", ";", "cc;", "cir;", "dot;", "hree;", "imes;", "larr;", "quest;", "rPar;", "ri;", "rie;", "rif;", "rdshar;", "ruhar;", "ertneqq;", "nE;", "Dot;", "cr", "cr;", "le;", "lt;", "ltese;", "p;", "psto;", "pstodown;", "pstoleft;", "pstoup;", "rker;", "omma;", "y;", "ash;", "asuredangle;", "r;", "o;", "cro", "cro;", "d;", "dast;", "dcir;", "ddot", "ddot;", "nus;", "nusb;", "nusd;", "nusdu;", "cp;", "dr;", "plus;", "dels;", "pf;", ";", "cr;", "tpos;", ";", "ltimap;", "map;", "g;", "t;", "tv;", "eftarrow;", "eftrightarrow;", "l;", "t;", "tv;", "ightarrow;", "Dash;", "dash;", "bla;", "cute;", "ng;", "p;", "pE;", "pid;", "pos;", "pprox;", "tur;", "tural;", "turals;", "sp", "sp;", "ump;", "umpe;", "ap;", "aron;", "edil;", "ong;", "ongdot;", "up;", "y;", "ash;", ";", "Arr;", "arhk;", "arr;", "arrow;", "dot;", "quiv;", "sear;", "sim;", "xist;", "xists;", "r;", "E;", "e;", "eq;", "eqq;", "eqslant;", "es;", "sim;", "t;", "tr;", "Arr;", "arr;", "par;", ";", "s;", "sd;", "v;", "cy;", "Arr;", "E;", "arr;", "dr;", "e;", "eftarrow;", "eftrightarrow;", "eq;", "eqq;", "eqslant;", "es;", "ess;", "sim;", "t;", "tri;", "trie;", "id;", "pf;", "t", "t;", "tin;", "tinE;", "tindot;", "tinva;", "tinvb;", "tinvc;", "tni;", "tniva;", "tnivb;", "tnivc;", "ar;", "arallel;", "arsl;", "art;", "olint;", "r;", "rcue;", "re;", "rec;", "receq;", "Arr;", "arr;", "arrc;", "arrw;", "ightarrow;", "tri;", "trie;", "c;", "ccue;", "ce;", "cr;", "hortmid;", "hortparallel;", "im;", "ime;", "imeq;", "mid;", "par;", "qsube;", "qsupe;", "ub;", "ubE;", "ube;", "ubset;", "ubseteq;", "ubseteqq;", "ucc;", "ucceq;", "up;", "upE;", "upe;", "upset;", "upseteq;", "upseteqq;", "gl;", "ilde", "ilde;", "lg;", "riangleleft;", "rianglelefteq;", "riangleright;", "rianglerighteq;", ";", "m;", "mero;", "msp;", "Dash;", "Harr;", "ap;", "dash;", "ge;", "gt;", "infin;", "lArr;", "le;", "lt;", "ltrie;", "rArr;", "rtrie;", "sim;", "Arr;", "arhk;", "arr;", "arrow;", "near;", ";", "cute", "cute;", "st;", "ir;", "irc", "irc;", "y;", "ash;", "blac;", "iv;", "ot;", "sold;", "lig;", "cir;", "r;", "on;", "rave", "rave;", "t;", "bar;", "m;", "nt;", "arr;", "cir;", "cross;", "ine;", "t;", "acr;", "ega;", "icron;", "id;", "inus;", "pf;", "ar;", "erp;", "lus;", ";", "arr;", "d;", "der;", "derof;", "df", "df;", "dm", "dm;", "igof;", "or;", "slope;", "v;", "cr;", "lash", "lash;", "ol;", "ilde", "ilde;", "imes;", "imesas;", "ml", "ml;", "bar;", "r;", "ra", "ra;", "rallel;", "rsim;", "rsl;", "rt;", "y;", "rcnt;", "riod;", "rmil;", "rp;", "rtenk;", "r;", "i;", "iv;", "mmat;", "one;", ";", "tchfork;", "v;", "anck;", "anckh;", "ankv;", "us;", "usacir;", "usb;", "uscir;", "usdo;", "usdu;", "use;", "usmn", "usmn;", "ussim;", "ustwo;", ";", "intint;", "pf;", "und", "und;", ";", "E;", "ap;", "cue;", "e;", "ec;", "ecapprox;", "eccurlyeq;", "eceq;", "ecnapprox;", "ecneqq;", "ecnsim;", "ecsim;", "ime;", "imes;", "nE;", "nap;", "nsim;", "od;", "ofalar;", "ofline;", "ofsurf;", "op;", "opto;", "sim;", "urel;", "cr;", "i;", "ncsp;", "r;", "nt;", "pf;", "rime;", "cr;", "aternions;", "atint;", "est;", "esteq;", "ot", "ot;", "arr;", "rr;", "tail;", "arr;", "ar;", "ce;", "cute;", "dic;", "emptyv;", "ng;", "ngd;", "nge;", "ngle;", "quo", "quo;", "rr;", "rrap;", "rrb;", "rrbfs;", "rrc;", "rrfs;", "rrhk;", "rrlp;", "rrpl;", "rrsim;", "rrtl;", "rrw;", "tail;", "tio;", "tionals;", "arr;", "brk;", "race;", "rack;", "rke;", "rksld;", "rkslu;", "aron;", "edil;", "eil;", "ub;", "y;", "ca;", "ldhar;", "quo;", "quor;", "sh;", "al;", "aline;", "alpart;", "als;", "ct;", "g", "g;", "isht;", "loor;", "r;", "ard;", "aru;", "arul;", "o;", "ov;", "ghtarrow;", "ghtarrowtail;", "ghtharpoondown;", "ghtharpoonup;", "ghtleftarrows;", "ghtleftharpoons;", "ghtrightarrows;", "ghtsquigarrow;", "ghtthreetimes;", "ng;", "singdotseq;", "arr;", "har;", "m;", "oust;", "oustache;", "mid;", "ang;", "arr;", "brk;", "par;", "pf;", "plus;", "times;", "ar;", "argt;", "polint;", "arr;", "aquo;", "cr;", "h;", "qb;", "quo;", "quor;", "hree;", "imes;", "ri;", "rie;", "rif;", "riltri;", "luhar;", ";", "cute;", "quo;", ";", "E;", "ap;", "aron;", "cue;", "e;", "edil;", "irc;", "nE;", "nap;", "nsim;", "polint;", "sim;", "y;", "ot;", "otb;", "ote;", "Arr;", "arhk;", "arr;", "arrow;", "ct", "ct;", "mi;", "swar;", "tminus;", "tmn;", "xt;", "r;", "rown;", "arp;", "chcy;", "cy;", "ortmid;", "ortparallel;", "y", "y;", "gma;", "gmaf;", "gmav;", "m;", "mdot;", "me;", "meq;", "mg;", "mgE;", "ml;", "mlE;", "mne;", "mplus;", "mrarr;", "arr;", "allsetminus;", "ashp;", "eparsl;", "id;", "ile;", "t;", "te;", "tes;", "ftcy;", "l;", "lb;", "lbar;", "pf;", "ades;", "adesuit;", "ar;", "cap;", "caps;", "cup;", "cups;", "sub;", "sube;", "subset;", "subseteq;", "sup;", "supe;", "supset;", "supseteq;", "u;", "uare;", "uarf;", "uf;", "arr;", "cr;", "etmn;", "mile;", "tarf;", "ar;", "arf;", "raightepsilon;", "raightphi;", "rns;", "b;", "bE;", "bdot;", "be;", "bedot;", "bmult;", "bnE;", "bne;", "bplus;", "brarr;", "bset;", "bseteq;", "bseteqq;", "bsetneq;", "bsetneqq;", "bsim;", "bsub;", "bsup;", "cc;", "ccapprox;", "cccurlyeq;", "cceq;", "ccnapprox;", "ccneqq;", "ccnsim;", "ccsim;", "m;", "ng;", "p1", "p1;", "p2", "p2;", "p3", "p3;", "p;", "pE;", "pdot;", "pdsub;", "pe;", "pedot;", "phsol;", "phsub;", "plarr;", "pmult;", "pnE;", "pne;", "pplus;", "pset;", "pseteq;", "pseteqq;", "psetneq;", "psetneqq;", "psim;", "psub;", "psup;", "Arr;", "arhk;", "arr;", "arrow;", "nwar;", "lig", "lig;", "rget;", "u;", "rk;", "aron;", "edil;", "y;", "ot;", "lrec;", "r;", "ere4;", "erefore;", "eta;", "etasym;", "etav;", "ickapprox;", "icksim;", "insp;", "kap;", "ksim;", "orn", "orn;", "lde;", "mes", "mes;", "mesb;", "mesbar;", "mesd;", "nt;", "ea;", "p;", "pbot;", "pcir;", "pf;", "pfork;", "sa;", "rime;", "ade;", "iangle;", "iangledown;", "iangleleft;", "ianglelefteq;", "iangleq;", "iangleright;", "ianglerighteq;", "idot;", "ie;", "iminus;", "iplus;", "isb;", "itime;", "pezium;", "cr;", "cy;", "hcy;", "trok;", "ixt;", "oheadleftarrow;", "oheadrightarrow;", "rr;", "ar;", "cute", "cute;", "rr;", "rcy;", "reve;", "irc", "irc;", "y;", "arr;", "blac;", "har;", "isht;", "r;", "rave", "rave;", "arl;", "arr;", "blk;", "corn;", "corner;", "crop;", "tri;", "acr;", "l", "l;", "gon;", "pf;", "arrow;", "downarrow;", "harpoonleft;", "harpoonright;", "lus;", "si;", "sih;", "silon;", "uparrows;", "corn;", "corner;", "crop;", "ing;", "tri;", "cr;", "dot;", "ilde;", "ri;", "rif;", "arr;", "ml", "ml;", "angle;", "rr;", "ar;", "arv;", "ash;", "ngrt;", "repsilon;", "rkappa;", "rnothing;", "rphi;", "rpi;", "rpropto;", "rr;", "rrho;", "rsigma;", "rsubsetneq;", "rsubsetneqq;", "rsupsetneq;", "rsupsetneqq;", "rtheta;", "rtriangleleft;", "rtriangleright;", "y;", "ash;", "e;", "ebar;", "eeq;", "llip;", "rbar;", "rt;", "r;", "tri;", "sub;", "sup;", "pf;", "rop;", "tri;", "cr;", "ubnE;", "ubne;", "upnE;", "upne;", "igzag;", "irc;", "dbar;", "dge;", "dgeq;", "ierp;", "r;", "pf;", ";", ";", "eath;", "cr;", "ap;", "irc;", "up;", "tri;", "r;", "Arr;", "arr;", ";", "Arr;", "arr;", "ap;", "is;", "dot;", "pf;", "plus;", "time;", "Arr;", "arr;", "cr;", "qcup;", "plus;", "tri;", "ee;", "edge;", "cute", "cute;", "cy;", "irc;", "y;", "n", "n;", "r;", "cy;", "pf;", "cr;", "cy;", "ml", "ml;", "cute;", "aron;", "y;", "ot;", "etrf;", "ta;", "r;", "cy;", "grarr;", "pf;", "cr;", "j;", "nj;", }; internal static readonly char[][] VALUES = new char[][] {new char[] { '\u00c6' }, new char[] { '\u00c6' }, new char[] { '\u0026' }, new char[] { '\u0026' }, new char[] { '\u00c1' }, new char[] { '\u00c1' }, new char[] { '\u0102' }, new char[] { '\u00c2' }, new char[] { '\u00c2' }, new char[] { '\u0410' }, new char[] { '\ud835', '\udd04' }, new char[] { '\u00c0' }, new char[] { '\u00c0' }, new char[] { '\u0391' }, new char[] { '\u0100' }, new char[] { '\u2a53' }, new char[] { '\u0104' }, new char[] { '\ud835', '\udd38' }, new char[] { '\u2061' }, new char[] { '\u00c5' }, new char[] { '\u00c5' }, new char[] { '\ud835', '\udc9c' }, new char[] { '\u2254' }, new char[] { '\u00c3' }, new char[] { '\u00c3' }, new char[] { '\u00c4' }, new char[] { '\u00c4' }, new char[] { '\u2216' }, new char[] { '\u2ae7' }, new char[] { '\u2306' }, new char[] { '\u0411' }, new char[] { '\u2235' }, new char[] { '\u212c' }, new char[] { '\u0392' }, new char[] { '\ud835', '\udd05' }, new char[] { '\ud835', '\udd39' }, new char[] { '\u02d8' }, new char[] { '\u212c' }, new char[] { '\u224e' }, new char[] { '\u0427' }, new char[] { '\u00a9' }, new char[] { '\u00a9' }, new char[] { '\u0106' }, new char[] { '\u22d2' }, new char[] { '\u2145' }, new char[] { '\u212d' }, new char[] { '\u010c' }, new char[] { '\u00c7' }, new char[] { '\u00c7' }, new char[] { '\u0108' }, new char[] { '\u2230' }, new char[] { '\u010a' }, new char[] { '\u00b8' }, new char[] { '\u00b7' }, new char[] { '\u212d' }, new char[] { '\u03a7' }, new char[] { '\u2299' }, new char[] { '\u2296' }, new char[] { '\u2295' }, new char[] { '\u2297' }, new char[] { '\u2232' }, new char[] { '\u201d' }, new char[] { '\u2019' }, new char[] { '\u2237' }, new char[] { '\u2a74' }, new char[] { '\u2261' }, new char[] { '\u222f' }, new char[] { '\u222e' }, new char[] { '\u2102' }, new char[] { '\u2210' }, new char[] { '\u2233' }, new char[] { '\u2a2f' }, new char[] { '\ud835', '\udc9e' }, new char[] { '\u22d3' }, new char[] { '\u224d' }, new char[] { '\u2145' }, new char[] { '\u2911' }, new char[] { '\u0402' }, new char[] { '\u0405' }, new char[] { '\u040f' }, new char[] { '\u2021' }, new char[] { '\u21a1' }, new char[] { '\u2ae4' }, new char[] { '\u010e' }, new char[] { '\u0414' }, new char[] { '\u2207' }, new char[] { '\u0394' }, new char[] { '\ud835', '\udd07' }, new char[] { '\u00b4' }, new char[] { '\u02d9' }, new char[] { '\u02dd' }, new char[] { '\u0060' }, new char[] { '\u02dc' }, new char[] { '\u22c4' }, new char[] { '\u2146' }, new char[] { '\ud835', '\udd3b' }, new char[] { '\u00a8' }, new char[] { '\u20dc' }, new char[] { '\u2250' }, new char[] { '\u222f' }, new char[] { '\u00a8' }, new char[] { '\u21d3' }, new char[] { '\u21d0' }, new char[] { '\u21d4' }, new char[] { '\u2ae4' }, new char[] { '\u27f8' }, new char[] { '\u27fa' }, new char[] { '\u27f9' }, new char[] { '\u21d2' }, new char[] { '\u22a8' }, new char[] { '\u21d1' }, new char[] { '\u21d5' }, new char[] { '\u2225' }, new char[] { '\u2193' }, new char[] { '\u2913' }, new char[] { '\u21f5' }, new char[] { '\u0311' }, new char[] { '\u2950' }, new char[] { '\u295e' }, new char[] { '\u21bd' }, new char[] { '\u2956' }, new char[] { '\u295f' }, new char[] { '\u21c1' }, new char[] { '\u2957' }, new char[] { '\u22a4' }, new char[] { '\u21a7' }, new char[] { '\u21d3' }, new char[] { '\ud835', '\udc9f' }, new char[] { '\u0110' }, new char[] { '\u014a' }, new char[] { '\u00d0' }, new char[] { '\u00d0' }, new char[] { '\u00c9' }, new char[] { '\u00c9' }, new char[] { '\u011a' }, new char[] { '\u00ca' }, new char[] { '\u00ca' }, new char[] { '\u042d' }, new char[] { '\u0116' }, new char[] { '\ud835', '\udd08' }, new char[] { '\u00c8' }, new char[] { '\u00c8' }, new char[] { '\u2208' }, new char[] { '\u0112' }, new char[] { '\u25fb' }, new char[] { '\u25ab' }, new char[] { '\u0118' }, new char[] { '\ud835', '\udd3c' }, new char[] { '\u0395' }, new char[] { '\u2a75' }, new char[] { '\u2242' }, new char[] { '\u21cc' }, new char[] { '\u2130' }, new char[] { '\u2a73' }, new char[] { '\u0397' }, new char[] { '\u00cb' }, new char[] { '\u00cb' }, new char[] { '\u2203' }, new char[] { '\u2147' }, new char[] { '\u0424' }, new char[] { '\ud835', '\udd09' }, new char[] { '\u25fc' }, new char[] { '\u25aa' }, new char[] { '\ud835', '\udd3d' }, new char[] { '\u2200' }, new char[] { '\u2131' }, new char[] { '\u2131' }, new char[] { '\u0403' }, new char[] { '\u003e' }, new char[] { '\u003e' }, new char[] { '\u0393' }, new char[] { '\u03dc' }, new char[] { '\u011e' }, new char[] { '\u0122' }, new char[] { '\u011c' }, new char[] { '\u0413' }, new char[] { '\u0120' }, new char[] { '\ud835', '\udd0a' }, new char[] { '\u22d9' }, new char[] { '\ud835', '\udd3e' }, new char[] { '\u2265' }, new char[] { '\u22db' }, new char[] { '\u2267' }, new char[] { '\u2aa2' }, new char[] { '\u2277' }, new char[] { '\u2a7e' }, new char[] { '\u2273' }, new char[] { '\ud835', '\udca2' }, new char[] { '\u226b' }, new char[] { '\u042a' }, new char[] { '\u02c7' }, new char[] { '\u005e' }, new char[] { '\u0124' }, new char[] { '\u210c' }, new char[] { '\u210b' }, new char[] { '\u210d' }, new char[] { '\u2500' }, new char[] { '\u210b' }, new char[] { '\u0126' }, new char[] { '\u224e' }, new char[] { '\u224f' }, new char[] { '\u0415' }, new char[] { '\u0132' }, new char[] { '\u0401' }, new char[] { '\u00cd' }, new char[] { '\u00cd' }, new char[] { '\u00ce' }, new char[] { '\u00ce' }, new char[] { '\u0418' }, new char[] { '\u0130' }, new char[] { '\u2111' }, new char[] { '\u00cc' }, new char[] { '\u00cc' }, new char[] { '\u2111' }, new char[] { '\u012a' }, new char[] { '\u2148' }, new char[] { '\u21d2' }, new char[] { '\u222c' }, new char[] { '\u222b' }, new char[] { '\u22c2' }, new char[] { '\u2063' }, new char[] { '\u2062' }, new char[] { '\u012e' }, new char[] { '\ud835', '\udd40' }, new char[] { '\u0399' }, new char[] { '\u2110' }, new char[] { '\u0128' }, new char[] { '\u0406' }, new char[] { '\u00cf' }, new char[] { '\u00cf' }, new char[] { '\u0134' }, new char[] { '\u0419' }, new char[] { '\ud835', '\udd0d' }, new char[] { '\ud835', '\udd41' }, new char[] { '\ud835', '\udca5' }, new char[] { '\u0408' }, new char[] { '\u0404' }, new char[] { '\u0425' }, new char[] { '\u040c' }, new char[] { '\u039a' }, new char[] { '\u0136' }, new char[] { '\u041a' }, new char[] { '\ud835', '\udd0e' }, new char[] { '\ud835', '\udd42' }, new char[] { '\ud835', '\udca6' }, new char[] { '\u0409' }, new char[] { '\u003c' }, new char[] { '\u003c' }, new char[] { '\u0139' }, new char[] { '\u039b' }, new char[] { '\u27ea' }, new char[] { '\u2112' }, new char[] { '\u219e' }, new char[] { '\u013d' }, new char[] { '\u013b' }, new char[] { '\u041b' }, new char[] { '\u27e8' }, new char[] { '\u2190' }, new char[] { '\u21e4' }, new char[] { '\u21c6' }, new char[] { '\u2308' }, new char[] { '\u27e6' }, new char[] { '\u2961' }, new char[] { '\u21c3' }, new char[] { '\u2959' }, new char[] { '\u230a' }, new char[] { '\u2194' }, new char[] { '\u294e' }, new char[] { '\u22a3' }, new char[] { '\u21a4' }, new char[] { '\u295a' }, new char[] { '\u22b2' }, new char[] { '\u29cf' }, new char[] { '\u22b4' }, new char[] { '\u2951' }, new char[] { '\u2960' }, new char[] { '\u21bf' }, new char[] { '\u2958' }, new char[] { '\u21bc' }, new char[] { '\u2952' }, new char[] { '\u21d0' }, new char[] { '\u21d4' }, new char[] { '\u22da' }, new char[] { '\u2266' }, new char[] { '\u2276' }, new char[] { '\u2aa1' }, new char[] { '\u2a7d' }, new char[] { '\u2272' }, new char[] { '\ud835', '\udd0f' }, new char[] { '\u22d8' }, new char[] { '\u21da' }, new char[] { '\u013f' }, new char[] { '\u27f5' }, new char[] { '\u27f7' }, new char[] { '\u27f6' }, new char[] { '\u27f8' }, new char[] { '\u27fa' }, new char[] { '\u27f9' }, new char[] { '\ud835', '\udd43' }, new char[] { '\u2199' }, new char[] { '\u2198' }, new char[] { '\u2112' }, new char[] { '\u21b0' }, new char[] { '\u0141' }, new char[] { '\u226a' }, new char[] { '\u2905' }, new char[] { '\u041c' }, new char[] { '\u205f' }, new char[] { '\u2133' }, new char[] { '\ud835', '\udd10' }, new char[] { '\u2213' }, new char[] { '\ud835', '\udd44' }, new char[] { '\u2133' }, new char[] { '\u039c' }, new char[] { '\u040a' }, new char[] { '\u0143' }, new char[] { '\u0147' }, new char[] { '\u0145' }, new char[] { '\u041d' }, new char[] { '\u200b' }, new char[] { '\u200b' }, new char[] { '\u200b' }, new char[] { '\u200b' }, new char[] { '\u226b' }, new char[] { '\u226a' }, new char[] { '\n' }, new char[] { '\ud835', '\udd11' }, new char[] { '\u2060' }, new char[] { '\u00a0' }, new char[] { '\u2115' }, new char[] { '\u2aec' }, new char[] { '\u2262' }, new char[] { '\u226d' }, new char[] { '\u2226' }, new char[] { '\u2209' }, new char[] { '\u2260' }, new char[] { '\u2242', '\u0338' }, new char[] { '\u2204' }, new char[] { '\u226f' }, new char[] { '\u2271' }, new char[] { '\u2267', '\u0338' }, new char[] { '\u226b', '\u0338' }, new char[] { '\u2279' }, new char[] { '\u2a7e', '\u0338' }, new char[] { '\u2275' }, new char[] { '\u224e', '\u0338' }, new char[] { '\u224f', '\u0338' }, new char[] { '\u22ea' }, new char[] { '\u29cf', '\u0338' }, new char[] { '\u22ec' }, new char[] { '\u226e' }, new char[] { '\u2270' }, new char[] { '\u2278' }, new char[] { '\u226a', '\u0338' }, new char[] { '\u2a7d', '\u0338' }, new char[] { '\u2274' }, new char[] { '\u2aa2', '\u0338' }, new char[] { '\u2aa1', '\u0338' }, new char[] { '\u2280' }, new char[] { '\u2aaf', '\u0338' }, new char[] { '\u22e0' }, new char[] { '\u220c' }, new char[] { '\u22eb' }, new char[] { '\u29d0', '\u0338' }, new char[] { '\u22ed' }, new char[] { '\u228f', '\u0338' }, new char[] { '\u22e2' }, new char[] { '\u2290', '\u0338' }, new char[] { '\u22e3' }, new char[] { '\u2282', '\u20d2' }, new char[] { '\u2288' }, new char[] { '\u2281' }, new char[] { '\u2ab0', '\u0338' }, new char[] { '\u22e1' }, new char[] { '\u227f', '\u0338' }, new char[] { '\u2283', '\u20d2' }, new char[] { '\u2289' }, new char[] { '\u2241' }, new char[] { '\u2244' }, new char[] { '\u2247' }, new char[] { '\u2249' }, new char[] { '\u2224' }, new char[] { '\ud835', '\udca9' }, new char[] { '\u00d1' }, new char[] { '\u00d1' }, new char[] { '\u039d' }, new char[] { '\u0152' }, new char[] { '\u00d3' }, new char[] { '\u00d3' }, new char[] { '\u00d4' }, new char[] { '\u00d4' }, new char[] { '\u041e' }, new char[] { '\u0150' }, new char[] { '\ud835', '\udd12' }, new char[] { '\u00d2' }, new char[] { '\u00d2' }, new char[] { '\u014c' }, new char[] { '\u03a9' }, new char[] { '\u039f' }, new char[] { '\ud835', '\udd46' }, new char[] { '\u201c' }, new char[] { '\u2018' }, new char[] { '\u2a54' }, new char[] { '\ud835', '\udcaa' }, new char[] { '\u00d8' }, new char[] { '\u00d8' }, new char[] { '\u00d5' }, new char[] { '\u00d5' }, new char[] { '\u2a37' }, new char[] { '\u00d6' }, new char[] { '\u00d6' }, new char[] { '\u203e' }, new char[] { '\u23de' }, new char[] { '\u23b4' }, new char[] { '\u23dc' }, new char[] { '\u2202' }, new char[] { '\u041f' }, new char[] { '\ud835', '\udd13' }, new char[] { '\u03a6' }, new char[] { '\u03a0' }, new char[] { '\u00b1' }, new char[] { '\u210c' }, new char[] { '\u2119' }, new char[] { '\u2abb' }, new char[] { '\u227a' }, new char[] { '\u2aaf' }, new char[] { '\u227c' }, new char[] { '\u227e' }, new char[] { '\u2033' }, new char[] { '\u220f' }, new char[] { '\u2237' }, new char[] { '\u221d' }, new char[] { '\ud835', '\udcab' }, new char[] { '\u03a8' }, new char[] { '\u0022' }, new char[] { '\u0022' }, new char[] { '\ud835', '\udd14' }, new char[] { '\u211a' }, new char[] { '\ud835', '\udcac' }, new char[] { '\u2910' }, new char[] { '\u00ae' }, new char[] { '\u00ae' }, new char[] { '\u0154' }, new char[] { '\u27eb' }, new char[] { '\u21a0' }, new char[] { '\u2916' }, new char[] { '\u0158' }, new char[] { '\u0156' }, new char[] { '\u0420' }, new char[] { '\u211c' }, new char[] { '\u220b' }, new char[] { '\u21cb' }, new char[] { '\u296f' }, new char[] { '\u211c' }, new char[] { '\u03a1' }, new char[] { '\u27e9' }, new char[] { '\u2192' }, new char[] { '\u21e5' }, new char[] { '\u21c4' }, new char[] { '\u2309' }, new char[] { '\u27e7' }, new char[] { '\u295d' }, new char[] { '\u21c2' }, new char[] { '\u2955' }, new char[] { '\u230b' }, new char[] { '\u22a2' }, new char[] { '\u21a6' }, new char[] { '\u295b' }, new char[] { '\u22b3' }, new char[] { '\u29d0' }, new char[] { '\u22b5' }, new char[] { '\u294f' }, new char[] { '\u295c' }, new char[] { '\u21be' }, new char[] { '\u2954' }, new char[] { '\u21c0' }, new char[] { '\u2953' }, new char[] { '\u21d2' }, new char[] { '\u211d' }, new char[] { '\u2970' }, new char[] { '\u21db' }, new char[] { '\u211b' }, new char[] { '\u21b1' }, new char[] { '\u29f4' }, new char[] { '\u0429' }, new char[] { '\u0428' }, new char[] { '\u042c' }, new char[] { '\u015a' }, new char[] { '\u2abc' }, new char[] { '\u0160' }, new char[] { '\u015e' }, new char[] { '\u015c' }, new char[] { '\u0421' }, new char[] { '\ud835', '\udd16' }, new char[] { '\u2193' }, new char[] { '\u2190' }, new char[] { '\u2192' }, new char[] { '\u2191' }, new char[] { '\u03a3' }, new char[] { '\u2218' }, new char[] { '\ud835', '\udd4a' }, new char[] { '\u221a' }, new char[] { '\u25a1' }, new char[] { '\u2293' }, new char[] { '\u228f' }, new char[] { '\u2291' }, new char[] { '\u2290' }, new char[] { '\u2292' }, new char[] { '\u2294' }, new char[] { '\ud835', '\udcae' }, new char[] { '\u22c6' }, new char[] { '\u22d0' }, new char[] { '\u22d0' }, new char[] { '\u2286' }, new char[] { '\u227b' }, new char[] { '\u2ab0' }, new char[] { '\u227d' }, new char[] { '\u227f' }, new char[] { '\u220b' }, new char[] { '\u2211' }, new char[] { '\u22d1' }, new char[] { '\u2283' }, new char[] { '\u2287' }, new char[] { '\u22d1' }, new char[] { '\u00de' }, new char[] { '\u00de' }, new char[] { '\u2122' }, new char[] { '\u040b' }, new char[] { '\u0426' }, new char[] { '\u0009' }, new char[] { '\u03a4' }, new char[] { '\u0164' }, new char[] { '\u0162' }, new char[] { '\u0422' }, new char[] { '\ud835', '\udd17' }, new char[] { '\u2234' }, new char[] { '\u0398' }, new char[] { '\u205f', '\u200a' }, new char[] { '\u2009' }, new char[] { '\u223c' }, new char[] { '\u2243' }, new char[] { '\u2245' }, new char[] { '\u2248' }, new char[] { '\ud835', '\udd4b' }, new char[] { '\u20db' }, new char[] { '\ud835', '\udcaf' }, new char[] { '\u0166' }, new char[] { '\u00da' }, new char[] { '\u00da' }, new char[] { '\u219f' }, new char[] { '\u2949' }, new char[] { '\u040e' }, new char[] { '\u016c' }, new char[] { '\u00db' }, new char[] { '\u00db' }, new char[] { '\u0423' }, new char[] { '\u0170' }, new char[] { '\ud835', '\udd18' }, new char[] { '\u00d9' }, new char[] { '\u00d9' }, new char[] { '\u016a' }, new char[] { '\u005f' }, new char[] { '\u23df' }, new char[] { '\u23b5' }, new char[] { '\u23dd' }, new char[] { '\u22c3' }, new char[] { '\u228e' }, new char[] { '\u0172' }, new char[] { '\ud835', '\udd4c' }, new char[] { '\u2191' }, new char[] { '\u2912' }, new char[] { '\u21c5' }, new char[] { '\u2195' }, new char[] { '\u296e' }, new char[] { '\u22a5' }, new char[] { '\u21a5' }, new char[] { '\u21d1' }, new char[] { '\u21d5' }, new char[] { '\u2196' }, new char[] { '\u2197' }, new char[] { '\u03d2' }, new char[] { '\u03a5' }, new char[] { '\u016e' }, new char[] { '\ud835', '\udcb0' }, new char[] { '\u0168' }, new char[] { '\u00dc' }, new char[] { '\u00dc' }, new char[] { '\u22ab' }, new char[] { '\u2aeb' }, new char[] { '\u0412' }, new char[] { '\u22a9' }, new char[] { '\u2ae6' }, new char[] { '\u22c1' }, new char[] { '\u2016' }, new char[] { '\u2016' }, new char[] { '\u2223' }, new char[] { '\u007c' }, new char[] { '\u2758' }, new char[] { '\u2240' }, new char[] { '\u200a' }, new char[] { '\ud835', '\udd19' }, new char[] { '\ud835', '\udd4d' }, new char[] { '\ud835', '\udcb1' }, new char[] { '\u22aa' }, new char[] { '\u0174' }, new char[] { '\u22c0' }, new char[] { '\ud835', '\udd1a' }, new char[] { '\ud835', '\udd4e' }, new char[] { '\ud835', '\udcb2' }, new char[] { '\ud835', '\udd1b' }, new char[] { '\u039e' }, new char[] { '\ud835', '\udd4f' }, new char[] { '\ud835', '\udcb3' }, new char[] { '\u042f' }, new char[] { '\u0407' }, new char[] { '\u042e' }, new char[] { '\u00dd' }, new char[] { '\u00dd' }, new char[] { '\u0176' }, new char[] { '\u042b' }, new char[] { '\ud835', '\udd1c' }, new char[] { '\ud835', '\udd50' }, new char[] { '\ud835', '\udcb4' }, new char[] { '\u0178' }, new char[] { '\u0416' }, new char[] { '\u0179' }, new char[] { '\u017d' }, new char[] { '\u0417' }, new char[] { '\u017b' }, new char[] { '\u200b' }, new char[] { '\u0396' }, new char[] { '\u2128' }, new char[] { '\u2124' }, new char[] { '\ud835', '\udcb5' }, new char[] { '\u00e1' }, new char[] { '\u00e1' }, new char[] { '\u0103' }, new char[] { '\u223e' }, new char[] { '\u223e', '\u0333' }, new char[] { '\u223f' }, new char[] { '\u00e2' }, new char[] { '\u00e2' }, new char[] { '\u00b4' }, new char[] { '\u00b4' }, new char[] { '\u0430' }, new char[] { '\u00e6' }, new char[] { '\u00e6' }, new char[] { '\u2061' }, new char[] { '\ud835', '\udd1e' }, new char[] { '\u00e0' }, new char[] { '\u00e0' }, new char[] { '\u2135' }, new char[] { '\u2135' }, new char[] { '\u03b1' }, new char[] { '\u0101' }, new char[] { '\u2a3f' }, new char[] { '\u0026' }, new char[] { '\u0026' }, new char[] { '\u2227' }, new char[] { '\u2a55' }, new char[] { '\u2a5c' }, new char[] { '\u2a58' }, new char[] { '\u2a5a' }, new char[] { '\u2220' }, new char[] { '\u29a4' }, new char[] { '\u2220' }, new char[] { '\u2221' }, new char[] { '\u29a8' }, new char[] { '\u29a9' }, new char[] { '\u29aa' }, new char[] { '\u29ab' }, new char[] { '\u29ac' }, new char[] { '\u29ad' }, new char[] { '\u29ae' }, new char[] { '\u29af' }, new char[] { '\u221f' }, new char[] { '\u22be' }, new char[] { '\u299d' }, new char[] { '\u2222' }, new char[] { '\u00c5' }, new char[] { '\u237c' }, new char[] { '\u0105' }, new char[] { '\ud835', '\udd52' }, new char[] { '\u2248' }, new char[] { '\u2a70' }, new char[] { '\u2a6f' }, new char[] { '\u224a' }, new char[] { '\u224b' }, new char[] { '\'' }, new char[] { '\u2248' }, new char[] { '\u224a' }, new char[] { '\u00e5' }, new char[] { '\u00e5' }, new char[] { '\ud835', '\udcb6' }, new char[] { '\u002a' }, new char[] { '\u2248' }, new char[] { '\u224d' }, new char[] { '\u00e3' }, new char[] { '\u00e3' }, new char[] { '\u00e4' }, new char[] { '\u00e4' }, new char[] { '\u2233' }, new char[] { '\u2a11' }, new char[] { '\u2aed' }, new char[] { '\u224c' }, new char[] { '\u03f6' }, new char[] { '\u2035' }, new char[] { '\u223d' }, new char[] { '\u22cd' }, new char[] { '\u22bd' }, new char[] { '\u2305' }, new char[] { '\u2305' }, new char[] { '\u23b5' }, new char[] { '\u23b6' }, new char[] { '\u224c' }, new char[] { '\u0431' }, new char[] { '\u201e' }, new char[] { '\u2235' }, new char[] { '\u2235' }, new char[] { '\u29b0' }, new char[] { '\u03f6' }, new char[] { '\u212c' }, new char[] { '\u03b2' }, new char[] { '\u2136' }, new char[] { '\u226c' }, new char[] { '\ud835', '\udd1f' }, new char[] { '\u22c2' }, new char[] { '\u25ef' }, new char[] { '\u22c3' }, new char[] { '\u2a00' }, new char[] { '\u2a01' }, new char[] { '\u2a02' }, new char[] { '\u2a06' }, new char[] { '\u2605' }, new char[] { '\u25bd' }, new char[] { '\u25b3' }, new char[] { '\u2a04' }, new char[] { '\u22c1' }, new char[] { '\u22c0' }, new char[] { '\u290d' }, new char[] { '\u29eb' }, new char[] { '\u25aa' }, new char[] { '\u25b4' }, new char[] { '\u25be' }, new char[] { '\u25c2' }, new char[] { '\u25b8' }, new char[] { '\u2423' }, new char[] { '\u2592' }, new char[] { '\u2591' }, new char[] { '\u2593' }, new char[] { '\u2588' }, new char[] { '\u003d', '\u20e5' }, new char[] { '\u2261', '\u20e5' }, new char[] { '\u2310' }, new char[] { '\ud835', '\udd53' }, new char[] { '\u22a5' }, new char[] { '\u22a5' }, new char[] { '\u22c8' }, new char[] { '\u2557' }, new char[] { '\u2554' }, new char[] { '\u2556' }, new char[] { '\u2553' }, new char[] { '\u2550' }, new char[] { '\u2566' }, new char[] { '\u2569' }, new char[] { '\u2564' }, new char[] { '\u2567' }, new char[] { '\u255d' }, new char[] { '\u255a' }, new char[] { '\u255c' }, new char[] { '\u2559' }, new char[] { '\u2551' }, new char[] { '\u256c' }, new char[] { '\u2563' }, new char[] { '\u2560' }, new char[] { '\u256b' }, new char[] { '\u2562' }, new char[] { '\u255f' }, new char[] { '\u29c9' }, new char[] { '\u2555' }, new char[] { '\u2552' }, new char[] { '\u2510' }, new char[] { '\u250c' }, new char[] { '\u2500' }, new char[] { '\u2565' }, new char[] { '\u2568' }, new char[] { '\u252c' }, new char[] { '\u2534' }, new char[] { '\u229f' }, new char[] { '\u229e' }, new char[] { '\u22a0' }, new char[] { '\u255b' }, new char[] { '\u2558' }, new char[] { '\u2518' }, new char[] { '\u2514' }, new char[] { '\u2502' }, new char[] { '\u256a' }, new char[] { '\u2561' }, new char[] { '\u255e' }, new char[] { '\u253c' }, new char[] { '\u2524' }, new char[] { '\u251c' }, new char[] { '\u2035' }, new char[] { '\u02d8' }, new char[] { '\u00a6' }, new char[] { '\u00a6' }, new char[] { '\ud835', '\udcb7' }, new char[] { '\u204f' }, new char[] { '\u223d' }, new char[] { '\u22cd' }, new char[] { '\\' }, new char[] { '\u29c5' }, new char[] { '\u27c8' }, new char[] { '\u2022' }, new char[] { '\u2022' }, new char[] { '\u224e' }, new char[] { '\u2aae' }, new char[] { '\u224f' }, new char[] { '\u224f' }, new char[] { '\u0107' }, new char[] { '\u2229' }, new char[] { '\u2a44' }, new char[] { '\u2a49' }, new char[] { '\u2a4b' }, new char[] { '\u2a47' }, new char[] { '\u2a40' }, new char[] { '\u2229', '\ufe00' }, new char[] { '\u2041' }, new char[] { '\u02c7' }, new char[] { '\u2a4d' }, new char[] { '\u010d' }, new char[] { '\u00e7' }, new char[] { '\u00e7' }, new char[] { '\u0109' }, new char[] { '\u2a4c' }, new char[] { '\u2a50' }, new char[] { '\u010b' }, new char[] { '\u00b8' }, new char[] { '\u00b8' }, new char[] { '\u29b2' }, new char[] { '\u00a2' }, new char[] { '\u00a2' }, new char[] { '\u00b7' }, new char[] { '\ud835', '\udd20' }, new char[] { '\u0447' }, new char[] { '\u2713' }, new char[] { '\u2713' }, new char[] { '\u03c7' }, new char[] { '\u25cb' }, new char[] { '\u29c3' }, new char[] { '\u02c6' }, new char[] { '\u2257' }, new char[] { '\u21ba' }, new char[] { '\u21bb' }, new char[] { '\u00ae' }, new char[] { '\u24c8' }, new char[] { '\u229b' }, new char[] { '\u229a' }, new char[] { '\u229d' }, new char[] { '\u2257' }, new char[] { '\u2a10' }, new char[] { '\u2aef' }, new char[] { '\u29c2' }, new char[] { '\u2663' }, new char[] { '\u2663' }, new char[] { '\u003a' }, new char[] { '\u2254' }, new char[] { '\u2254' }, new char[] { '\u002c' }, new char[] { '\u0040' }, new char[] { '\u2201' }, new char[] { '\u2218' }, new char[] { '\u2201' }, new char[] { '\u2102' }, new char[] { '\u2245' }, new char[] { '\u2a6d' }, new char[] { '\u222e' }, new char[] { '\ud835', '\udd54' }, new char[] { '\u2210' }, new char[] { '\u00a9' }, new char[] { '\u00a9' }, new char[] { '\u2117' }, new char[] { '\u21b5' }, new char[] { '\u2717' }, new char[] { '\ud835', '\udcb8' }, new char[] { '\u2acf' }, new char[] { '\u2ad1' }, new char[] { '\u2ad0' }, new char[] { '\u2ad2' }, new char[] { '\u22ef' }, new char[] { '\u2938' }, new char[] { '\u2935' }, new char[] { '\u22de' }, new char[] { '\u22df' }, new char[] { '\u21b6' }, new char[] { '\u293d' }, new char[] { '\u222a' }, new char[] { '\u2a48' }, new char[] { '\u2a46' }, new char[] { '\u2a4a' }, new char[] { '\u228d' }, new char[] { '\u2a45' }, new char[] { '\u222a', '\ufe00' }, new char[] { '\u21b7' }, new char[] { '\u293c' }, new char[] { '\u22de' }, new char[] { '\u22df' }, new char[] { '\u22ce' }, new char[] { '\u22cf' }, new char[] { '\u00a4' }, new char[] { '\u00a4' }, new char[] { '\u21b6' }, new char[] { '\u21b7' }, new char[] { '\u22ce' }, new char[] { '\u22cf' }, new char[] { '\u2232' }, new char[] { '\u2231' }, new char[] { '\u232d' }, new char[] { '\u21d3' }, new char[] { '\u2965' }, new char[] { '\u2020' }, new char[] { '\u2138' }, new char[] { '\u2193' }, new char[] { '\u2010' }, new char[] { '\u22a3' }, new char[] { '\u290f' }, new char[] { '\u02dd' }, new char[] { '\u010f' }, new char[] { '\u0434' }, new char[] { '\u2146' }, new char[] { '\u2021' }, new char[] { '\u21ca' }, new char[] { '\u2a77' }, new char[] { '\u00b0' }, new char[] { '\u00b0' }, new char[] { '\u03b4' }, new char[] { '\u29b1' }, new char[] { '\u297f' }, new char[] { '\ud835', '\udd21' }, new char[] { '\u21c3' }, new char[] { '\u21c2' }, new char[] { '\u22c4' }, new char[] { '\u22c4' }, new char[] { '\u2666' }, new char[] { '\u2666' }, new char[] { '\u00a8' }, new char[] { '\u03dd' }, new char[] { '\u22f2' }, new char[] { '\u00f7' }, new char[] { '\u00f7' }, new char[] { '\u00f7' }, new char[] { '\u22c7' }, new char[] { '\u22c7' }, new char[] { '\u0452' }, new char[] { '\u231e' }, new char[] { '\u230d' }, new char[] { '\u0024' }, new char[] { '\ud835', '\udd55' }, new char[] { '\u02d9' }, new char[] { '\u2250' }, new char[] { '\u2251' }, new char[] { '\u2238' }, new char[] { '\u2214' }, new char[] { '\u22a1' }, new char[] { '\u2306' }, new char[] { '\u2193' }, new char[] { '\u21ca' }, new char[] { '\u21c3' }, new char[] { '\u21c2' }, new char[] { '\u2910' }, new char[] { '\u231f' }, new char[] { '\u230c' }, new char[] { '\ud835', '\udcb9' }, new char[] { '\u0455' }, new char[] { '\u29f6' }, new char[] { '\u0111' }, new char[] { '\u22f1' }, new char[] { '\u25bf' }, new char[] { '\u25be' }, new char[] { '\u21f5' }, new char[] { '\u296f' }, new char[] { '\u29a6' }, new char[] { '\u045f' }, new char[] { '\u27ff' }, new char[] { '\u2a77' }, new char[] { '\u2251' }, new char[] { '\u00e9' }, new char[] { '\u00e9' }, new char[] { '\u2a6e' }, new char[] { '\u011b' }, new char[] { '\u2256' }, new char[] { '\u00ea' }, new char[] { '\u00ea' }, new char[] { '\u2255' }, new char[] { '\u044d' }, new char[] { '\u0117' }, new char[] { '\u2147' }, new char[] { '\u2252' }, new char[] { '\ud835', '\udd22' }, new char[] { '\u2a9a' }, new char[] { '\u00e8' }, new char[] { '\u00e8' }, new char[] { '\u2a96' }, new char[] { '\u2a98' }, new char[] { '\u2a99' }, new char[] { '\u23e7' }, new char[] { '\u2113' }, new char[] { '\u2a95' }, new char[] { '\u2a97' }, new char[] { '\u0113' }, new char[] { '\u2205' }, new char[] { '\u2205' }, new char[] { '\u2205' }, new char[] { '\u2004' }, new char[] { '\u2005' }, new char[] { '\u2003' }, new char[] { '\u014b' }, new char[] { '\u2002' }, new char[] { '\u0119' }, new char[] { '\ud835', '\udd56' }, new char[] { '\u22d5' }, new char[] { '\u29e3' }, new char[] { '\u2a71' }, new char[] { '\u03b5' }, new char[] { '\u03b5' }, new char[] { '\u03f5' }, new char[] { '\u2256' }, new char[] { '\u2255' }, new char[] { '\u2242' }, new char[] { '\u2a96' }, new char[] { '\u2a95' }, new char[] { '\u003d' }, new char[] { '\u225f' }, new char[] { '\u2261' }, new char[] { '\u2a78' }, new char[] { '\u29e5' }, new char[] { '\u2253' }, new char[] { '\u2971' }, new char[] { '\u212f' }, new char[] { '\u2250' }, new char[] { '\u2242' }, new char[] { '\u03b7' }, new char[] { '\u00f0' }, new char[] { '\u00f0' }, new char[] { '\u00eb' }, new char[] { '\u00eb' }, new char[] { '\u20ac' }, new char[] { '\u0021' }, new char[] { '\u2203' }, new char[] { '\u2130' }, new char[] { '\u2147' }, new char[] { '\u2252' }, new char[] { '\u0444' }, new char[] { '\u2640' }, new char[] { '\ufb03' }, new char[] { '\ufb00' }, new char[] { '\ufb04' }, new char[] { '\ud835', '\udd23' }, new char[] { '\ufb01' }, new char[] { '\u0066', '\u006a' }, new char[] { '\u266d' }, new char[] { '\ufb02' }, new char[] { '\u25b1' }, new char[] { '\u0192' }, new char[] { '\ud835', '\udd57' }, new char[] { '\u2200' }, new char[] { '\u22d4' }, new char[] { '\u2ad9' }, new char[] { '\u2a0d' }, new char[] { '\u00bd' }, new char[] { '\u00bd' }, new char[] { '\u2153' }, new char[] { '\u00bc' }, new char[] { '\u00bc' }, new char[] { '\u2155' }, new char[] { '\u2159' }, new char[] { '\u215b' }, new char[] { '\u2154' }, new char[] { '\u2156' }, new char[] { '\u00be' }, new char[] { '\u00be' }, new char[] { '\u2157' }, new char[] { '\u215c' }, new char[] { '\u2158' }, new char[] { '\u215a' }, new char[] { '\u215d' }, new char[] { '\u215e' }, new char[] { '\u2044' }, new char[] { '\u2322' }, new char[] { '\ud835', '\udcbb' }, new char[] { '\u2267' }, new char[] { '\u2a8c' }, new char[] { '\u01f5' }, new char[] { '\u03b3' }, new char[] { '\u03dd' }, new char[] { '\u2a86' }, new char[] { '\u011f' }, new char[] { '\u011d' }, new char[] { '\u0433' }, new char[] { '\u0121' }, new char[] { '\u2265' }, new char[] { '\u22db' }, new char[] { '\u2265' }, new char[] { '\u2267' }, new char[] { '\u2a7e' }, new char[] { '\u2a7e' }, new char[] { '\u2aa9' }, new char[] { '\u2a80' }, new char[] { '\u2a82' }, new char[] { '\u2a84' }, new char[] { '\u22db', '\ufe00' }, new char[] { '\u2a94' }, new char[] { '\ud835', '\udd24' }, new char[] { '\u226b' }, new char[] { '\u22d9' }, new char[] { '\u2137' }, new char[] { '\u0453' }, new char[] { '\u2277' }, new char[] { '\u2a92' }, new char[] { '\u2aa5' }, new char[] { '\u2aa4' }, new char[] { '\u2269' }, new char[] { '\u2a8a' }, new char[] { '\u2a8a' }, new char[] { '\u2a88' }, new char[] { '\u2a88' }, new char[] { '\u2269' }, new char[] { '\u22e7' }, new char[] { '\ud835', '\udd58' }, new char[] { '\u0060' }, new char[] { '\u210a' }, new char[] { '\u2273' }, new char[] { '\u2a8e' }, new char[] { '\u2a90' }, new char[] { '\u003e' }, new char[] { '\u003e' }, new char[] { '\u2aa7' }, new char[] { '\u2a7a' }, new char[] { '\u22d7' }, new char[] { '\u2995' }, new char[] { '\u2a7c' }, new char[] { '\u2a86' }, new char[] { '\u2978' }, new char[] { '\u22d7' }, new char[] { '\u22db' }, new char[] { '\u2a8c' }, new char[] { '\u2277' }, new char[] { '\u2273' }, new char[] { '\u2269', '\ufe00' }, new char[] { '\u2269', '\ufe00' }, new char[] { '\u21d4' }, new char[] { '\u200a' }, new char[] { '\u00bd' }, new char[] { '\u210b' }, new char[] { '\u044a' }, new char[] { '\u2194' }, new char[] { '\u2948' }, new char[] { '\u21ad' }, new char[] { '\u210f' }, new char[] { '\u0125' }, new char[] { '\u2665' }, new char[] { '\u2665' }, new char[] { '\u2026' }, new char[] { '\u22b9' }, new char[] { '\ud835', '\udd25' }, new char[] { '\u2925' }, new char[] { '\u2926' }, new char[] { '\u21ff' }, new char[] { '\u223b' }, new char[] { '\u21a9' }, new char[] { '\u21aa' }, new char[] { '\ud835', '\udd59' }, new char[] { '\u2015' }, new char[] { '\ud835', '\udcbd' }, new char[] { '\u210f' }, new char[] { '\u0127' }, new char[] { '\u2043' }, new char[] { '\u2010' }, new char[] { '\u00ed' }, new char[] { '\u00ed' }, new char[] { '\u2063' }, new char[] { '\u00ee' }, new char[] { '\u00ee' }, new char[] { '\u0438' }, new char[] { '\u0435' }, new char[] { '\u00a1' }, new char[] { '\u00a1' }, new char[] { '\u21d4' }, new char[] { '\ud835', '\udd26' }, new char[] { '\u00ec' }, new char[] { '\u00ec' }, new char[] { '\u2148' }, new char[] { '\u2a0c' }, new char[] { '\u222d' }, new char[] { '\u29dc' }, new char[] { '\u2129' }, new char[] { '\u0133' }, new char[] { '\u012b' }, new char[] { '\u2111' }, new char[] { '\u2110' }, new char[] { '\u2111' }, new char[] { '\u0131' }, new char[] { '\u22b7' }, new char[] { '\u01b5' }, new char[] { '\u2208' }, new char[] { '\u2105' }, new char[] { '\u221e' }, new char[] { '\u29dd' }, new char[] { '\u0131' }, new char[] { '\u222b' }, new char[] { '\u22ba' }, new char[] { '\u2124' }, new char[] { '\u22ba' }, new char[] { '\u2a17' }, new char[] { '\u2a3c' }, new char[] { '\u0451' }, new char[] { '\u012f' }, new char[] { '\ud835', '\udd5a' }, new char[] { '\u03b9' }, new char[] { '\u2a3c' }, new char[] { '\u00bf' }, new char[] { '\u00bf' }, new char[] { '\ud835', '\udcbe' }, new char[] { '\u2208' }, new char[] { '\u22f9' }, new char[] { '\u22f5' }, new char[] { '\u22f4' }, new char[] { '\u22f3' }, new char[] { '\u2208' }, new char[] { '\u2062' }, new char[] { '\u0129' }, new char[] { '\u0456' }, new char[] { '\u00ef' }, new char[] { '\u00ef' }, new char[] { '\u0135' }, new char[] { '\u0439' }, new char[] { '\ud835', '\udd27' }, new char[] { '\u0237' }, new char[] { '\ud835', '\udd5b' }, new char[] { '\ud835', '\udcbf' }, new char[] { '\u0458' }, new char[] { '\u0454' }, new char[] { '\u03ba' }, new char[] { '\u03f0' }, new char[] { '\u0137' }, new char[] { '\u043a' }, new char[] { '\ud835', '\udd28' }, new char[] { '\u0138' }, new char[] { '\u0445' }, new char[] { '\u045c' }, new char[] { '\ud835', '\udd5c' }, new char[] { '\ud835', '\udcc0' }, new char[] { '\u21da' }, new char[] { '\u21d0' }, new char[] { '\u291b' }, new char[] { '\u290e' }, new char[] { '\u2266' }, new char[] { '\u2a8b' }, new char[] { '\u2962' }, new char[] { '\u013a' }, new char[] { '\u29b4' }, new char[] { '\u2112' }, new char[] { '\u03bb' }, new char[] { '\u27e8' }, new char[] { '\u2991' }, new char[] { '\u27e8' }, new char[] { '\u2a85' }, new char[] { '\u00ab' }, new char[] { '\u00ab' }, new char[] { '\u2190' }, new char[] { '\u21e4' }, new char[] { '\u291f' }, new char[] { '\u291d' }, new char[] { '\u21a9' }, new char[] { '\u21ab' }, new char[] { '\u2939' }, new char[] { '\u2973' }, new char[] { '\u21a2' }, new char[] { '\u2aab' }, new char[] { '\u2919' }, new char[] { '\u2aad' }, new char[] { '\u2aad', '\ufe00' }, new char[] { '\u290c' }, new char[] { '\u2772' }, new char[] { '\u007b' }, new char[] { '\u005b' }, new char[] { '\u298b' }, new char[] { '\u298f' }, new char[] { '\u298d' }, new char[] { '\u013e' }, new char[] { '\u013c' }, new char[] { '\u2308' }, new char[] { '\u007b' }, new char[] { '\u043b' }, new char[] { '\u2936' }, new char[] { '\u201c' }, new char[] { '\u201e' }, new char[] { '\u2967' }, new char[] { '\u294b' }, new char[] { '\u21b2' }, new char[] { '\u2264' }, new char[] { '\u2190' }, new char[] { '\u21a2' }, new char[] { '\u21bd' }, new char[] { '\u21bc' }, new char[] { '\u21c7' }, new char[] { '\u2194' }, new char[] { '\u21c6' }, new char[] { '\u21cb' }, new char[] { '\u21ad' }, new char[] { '\u22cb' }, new char[] { '\u22da' }, new char[] { '\u2264' }, new char[] { '\u2266' }, new char[] { '\u2a7d' }, new char[] { '\u2a7d' }, new char[] { '\u2aa8' }, new char[] { '\u2a7f' }, new char[] { '\u2a81' }, new char[] { '\u2a83' }, new char[] { '\u22da', '\ufe00' }, new char[] { '\u2a93' }, new char[] { '\u2a85' }, new char[] { '\u22d6' }, new char[] { '\u22da' }, new char[] { '\u2a8b' }, new char[] { '\u2276' }, new char[] { '\u2272' }, new char[] { '\u297c' }, new char[] { '\u230a' }, new char[] { '\ud835', '\udd29' }, new char[] { '\u2276' }, new char[] { '\u2a91' }, new char[] { '\u21bd' }, new char[] { '\u21bc' }, new char[] { '\u296a' }, new char[] { '\u2584' }, new char[] { '\u0459' }, new char[] { '\u226a' }, new char[] { '\u21c7' }, new char[] { '\u231e' }, new char[] { '\u296b' }, new char[] { '\u25fa' }, new char[] { '\u0140' }, new char[] { '\u23b0' }, new char[] { '\u23b0' }, new char[] { '\u2268' }, new char[] { '\u2a89' }, new char[] { '\u2a89' }, new char[] { '\u2a87' }, new char[] { '\u2a87' }, new char[] { '\u2268' }, new char[] { '\u22e6' }, new char[] { '\u27ec' }, new char[] { '\u21fd' }, new char[] { '\u27e6' }, new char[] { '\u27f5' }, new char[] { '\u27f7' }, new char[] { '\u27fc' }, new char[] { '\u27f6' }, new char[] { '\u21ab' }, new char[] { '\u21ac' }, new char[] { '\u2985' }, new char[] { '\ud835', '\udd5d' }, new char[] { '\u2a2d' }, new char[] { '\u2a34' }, new char[] { '\u2217' }, new char[] { '\u005f' }, new char[] { '\u25ca' }, new char[] { '\u25ca' }, new char[] { '\u29eb' }, new char[] { '\u0028' }, new char[] { '\u2993' }, new char[] { '\u21c6' }, new char[] { '\u231f' }, new char[] { '\u21cb' }, new char[] { '\u296d' }, new char[] { '\u200e' }, new char[] { '\u22bf' }, new char[] { '\u2039' }, new char[] { '\ud835', '\udcc1' }, new char[] { '\u21b0' }, new char[] { '\u2272' }, new char[] { '\u2a8d' }, new char[] { '\u2a8f' }, new char[] { '\u005b' }, new char[] { '\u2018' }, new char[] { '\u201a' }, new char[] { '\u0142' }, new char[] { '\u003c' }, new char[] { '\u003c' }, new char[] { '\u2aa6' }, new char[] { '\u2a79' }, new char[] { '\u22d6' }, new char[] { '\u22cb' }, new char[] { '\u22c9' }, new char[] { '\u2976' }, new char[] { '\u2a7b' }, new char[] { '\u2996' }, new char[] { '\u25c3' }, new char[] { '\u22b4' }, new char[] { '\u25c2' }, new char[] { '\u294a' }, new char[] { '\u2966' }, new char[] { '\u2268', '\ufe00' }, new char[] { '\u2268', '\ufe00' }, new char[] { '\u223a' }, new char[] { '\u00af' }, new char[] { '\u00af' }, new char[] { '\u2642' }, new char[] { '\u2720' }, new char[] { '\u2720' }, new char[] { '\u21a6' }, new char[] { '\u21a6' }, new char[] { '\u21a7' }, new char[] { '\u21a4' }, new char[] { '\u21a5' }, new char[] { '\u25ae' }, new char[] { '\u2a29' }, new char[] { '\u043c' }, new char[] { '\u2014' }, new char[] { '\u2221' }, new char[] { '\ud835', '\udd2a' }, new char[] { '\u2127' }, new char[] { '\u00b5' }, new char[] { '\u00b5' }, new char[] { '\u2223' }, new char[] { '\u002a' }, new char[] { '\u2af0' }, new char[] { '\u00b7' }, new char[] { '\u00b7' }, new char[] { '\u2212' }, new char[] { '\u229f' }, new char[] { '\u2238' }, new char[] { '\u2a2a' }, new char[] { '\u2adb' }, new char[] { '\u2026' }, new char[] { '\u2213' }, new char[] { '\u22a7' }, new char[] { '\ud835', '\udd5e' }, new char[] { '\u2213' }, new char[] { '\ud835', '\udcc2' }, new char[] { '\u223e' }, new char[] { '\u03bc' }, new char[] { '\u22b8' }, new char[] { '\u22b8' }, new char[] { '\u22d9', '\u0338' }, new char[] { '\u226b', '\u20d2' }, new char[] { '\u226b', '\u0338' }, new char[] { '\u21cd' }, new char[] { '\u21ce' }, new char[] { '\u22d8', '\u0338' }, new char[] { '\u226a', '\u20d2' }, new char[] { '\u226a', '\u0338' }, new char[] { '\u21cf' }, new char[] { '\u22af' }, new char[] { '\u22ae' }, new char[] { '\u2207' }, new char[] { '\u0144' }, new char[] { '\u2220', '\u20d2' }, new char[] { '\u2249' }, new char[] { '\u2a70', '\u0338' }, new char[] { '\u224b', '\u0338' }, new char[] { '\u0149' }, new char[] { '\u2249' }, new char[] { '\u266e' }, new char[] { '\u266e' }, new char[] { '\u2115' }, new char[] { '\u00a0' }, new char[] { '\u00a0' }, new char[] { '\u224e', '\u0338' }, new char[] { '\u224f', '\u0338' }, new char[] { '\u2a43' }, new char[] { '\u0148' }, new char[] { '\u0146' }, new char[] { '\u2247' }, new char[] { '\u2a6d', '\u0338' }, new char[] { '\u2a42' }, new char[] { '\u043d' }, new char[] { '\u2013' }, new char[] { '\u2260' }, new char[] { '\u21d7' }, new char[] { '\u2924' }, new char[] { '\u2197' }, new char[] { '\u2197' }, new char[] { '\u2250', '\u0338' }, new char[] { '\u2262' }, new char[] { '\u2928' }, new char[] { '\u2242', '\u0338' }, new char[] { '\u2204' }, new char[] { '\u2204' }, new char[] { '\ud835', '\udd2b' }, new char[] { '\u2267', '\u0338' }, new char[] { '\u2271' }, new char[] { '\u2271' }, new char[] { '\u2267', '\u0338' }, new char[] { '\u2a7e', '\u0338' }, new char[] { '\u2a7e', '\u0338' }, new char[] { '\u2275' }, new char[] { '\u226f' }, new char[] { '\u226f' }, new char[] { '\u21ce' }, new char[] { '\u21ae' }, new char[] { '\u2af2' }, new char[] { '\u220b' }, new char[] { '\u22fc' }, new char[] { '\u22fa' }, new char[] { '\u220b' }, new char[] { '\u045a' }, new char[] { '\u21cd' }, new char[] { '\u2266', '\u0338' }, new char[] { '\u219a' }, new char[] { '\u2025' }, new char[] { '\u2270' }, new char[] { '\u219a' }, new char[] { '\u21ae' }, new char[] { '\u2270' }, new char[] { '\u2266', '\u0338' }, new char[] { '\u2a7d', '\u0338' }, new char[] { '\u2a7d', '\u0338' }, new char[] { '\u226e' }, new char[] { '\u2274' }, new char[] { '\u226e' }, new char[] { '\u22ea' }, new char[] { '\u22ec' }, new char[] { '\u2224' }, new char[] { '\ud835', '\udd5f' }, new char[] { '\u00ac' }, new char[] { '\u00ac' }, new char[] { '\u2209' }, new char[] { '\u22f9', '\u0338' }, new char[] { '\u22f5', '\u0338' }, new char[] { '\u2209' }, new char[] { '\u22f7' }, new char[] { '\u22f6' }, new char[] { '\u220c' }, new char[] { '\u220c' }, new char[] { '\u22fe' }, new char[] { '\u22fd' }, new char[] { '\u2226' }, new char[] { '\u2226' }, new char[] { '\u2afd', '\u20e5' }, new char[] { '\u2202', '\u0338' }, new char[] { '\u2a14' }, new char[] { '\u2280' }, new char[] { '\u22e0' }, new char[] { '\u2aaf', '\u0338' }, new char[] { '\u2280' }, new char[] { '\u2aaf', '\u0338' }, new char[] { '\u21cf' }, new char[] { '\u219b' }, new char[] { '\u2933', '\u0338' }, new char[] { '\u219d', '\u0338' }, new char[] { '\u219b' }, new char[] { '\u22eb' }, new char[] { '\u22ed' }, new char[] { '\u2281' }, new char[] { '\u22e1' }, new char[] { '\u2ab0', '\u0338' }, new char[] { '\ud835', '\udcc3' }, new char[] { '\u2224' }, new char[] { '\u2226' }, new char[] { '\u2241' }, new char[] { '\u2244' }, new char[] { '\u2244' }, new char[] { '\u2224' }, new char[] { '\u2226' }, new char[] { '\u22e2' }, new char[] { '\u22e3' }, new char[] { '\u2284' }, new char[] { '\u2ac5', '\u0338' }, new char[] { '\u2288' }, new char[] { '\u2282', '\u20d2' }, new char[] { '\u2288' }, new char[] { '\u2ac5', '\u0338' }, new char[] { '\u2281' }, new char[] { '\u2ab0', '\u0338' }, new char[] { '\u2285' }, new char[] { '\u2ac6', '\u0338' }, new char[] { '\u2289' }, new char[] { '\u2283', '\u20d2' }, new char[] { '\u2289' }, new char[] { '\u2ac6', '\u0338' }, new char[] { '\u2279' }, new char[] { '\u00f1' }, new char[] { '\u00f1' }, new char[] { '\u2278' }, new char[] { '\u22ea' }, new char[] { '\u22ec' }, new char[] { '\u22eb' }, new char[] { '\u22ed' }, new char[] { '\u03bd' }, new char[] { '\u0023' }, new char[] { '\u2116' }, new char[] { '\u2007' }, new char[] { '\u22ad' }, new char[] { '\u2904' }, new char[] { '\u224d', '\u20d2' }, new char[] { '\u22ac' }, new char[] { '\u2265', '\u20d2' }, new char[] { '\u003e', '\u20d2' }, new char[] { '\u29de' }, new char[] { '\u2902' }, new char[] { '\u2264', '\u20d2' }, new char[] { '\u003c', '\u20d2' }, new char[] { '\u22b4', '\u20d2' }, new char[] { '\u2903' }, new char[] { '\u22b5', '\u20d2' }, new char[] { '\u223c', '\u20d2' }, new char[] { '\u21d6' }, new char[] { '\u2923' }, new char[] { '\u2196' }, new char[] { '\u2196' }, new char[] { '\u2927' }, new char[] { '\u24c8' }, new char[] { '\u00f3' }, new char[] { '\u00f3' }, new char[] { '\u229b' }, new char[] { '\u229a' }, new char[] { '\u00f4' }, new char[] { '\u00f4' }, new char[] { '\u043e' }, new char[] { '\u229d' }, new char[] { '\u0151' }, new char[] { '\u2a38' }, new char[] { '\u2299' }, new char[] { '\u29bc' }, new char[] { '\u0153' }, new char[] { '\u29bf' }, new char[] { '\ud835', '\udd2c' }, new char[] { '\u02db' }, new char[] { '\u00f2' }, new char[] { '\u00f2' }, new char[] { '\u29c1' }, new char[] { '\u29b5' }, new char[] { '\u03a9' }, new char[] { '\u222e' }, new char[] { '\u21ba' }, new char[] { '\u29be' }, new char[] { '\u29bb' }, new char[] { '\u203e' }, new char[] { '\u29c0' }, new char[] { '\u014d' }, new char[] { '\u03c9' }, new char[] { '\u03bf' }, new char[] { '\u29b6' }, new char[] { '\u2296' }, new char[] { '\ud835', '\udd60' }, new char[] { '\u29b7' }, new char[] { '\u29b9' }, new char[] { '\u2295' }, new char[] { '\u2228' }, new char[] { '\u21bb' }, new char[] { '\u2a5d' }, new char[] { '\u2134' }, new char[] { '\u2134' }, new char[] { '\u00aa' }, new char[] { '\u00aa' }, new char[] { '\u00ba' }, new char[] { '\u00ba' }, new char[] { '\u22b6' }, new char[] { '\u2a56' }, new char[] { '\u2a57' }, new char[] { '\u2a5b' }, new char[] { '\u2134' }, new char[] { '\u00f8' }, new char[] { '\u00f8' }, new char[] { '\u2298' }, new char[] { '\u00f5' }, new char[] { '\u00f5' }, new char[] { '\u2297' }, new char[] { '\u2a36' }, new char[] { '\u00f6' }, new char[] { '\u00f6' }, new char[] { '\u233d' }, new char[] { '\u2225' }, new char[] { '\u00b6' }, new char[] { '\u00b6' }, new char[] { '\u2225' }, new char[] { '\u2af3' }, new char[] { '\u2afd' }, new char[] { '\u2202' }, new char[] { '\u043f' }, new char[] { '\u0025' }, new char[] { '\u002e' }, new char[] { '\u2030' }, new char[] { '\u22a5' }, new char[] { '\u2031' }, new char[] { '\ud835', '\udd2d' }, new char[] { '\u03c6' }, new char[] { '\u03d5' }, new char[] { '\u2133' }, new char[] { '\u260e' }, new char[] { '\u03c0' }, new char[] { '\u22d4' }, new char[] { '\u03d6' }, new char[] { '\u210f' }, new char[] { '\u210e' }, new char[] { '\u210f' }, new char[] { '\u002b' }, new char[] { '\u2a23' }, new char[] { '\u229e' }, new char[] { '\u2a22' }, new char[] { '\u2214' }, new char[] { '\u2a25' }, new char[] { '\u2a72' }, new char[] { '\u00b1' }, new char[] { '\u00b1' }, new char[] { '\u2a26' }, new char[] { '\u2a27' }, new char[] { '\u00b1' }, new char[] { '\u2a15' }, new char[] { '\ud835', '\udd61' }, new char[] { '\u00a3' }, new char[] { '\u00a3' }, new char[] { '\u227a' }, new char[] { '\u2ab3' }, new char[] { '\u2ab7' }, new char[] { '\u227c' }, new char[] { '\u2aaf' }, new char[] { '\u227a' }, new char[] { '\u2ab7' }, new char[] { '\u227c' }, new char[] { '\u2aaf' }, new char[] { '\u2ab9' }, new char[] { '\u2ab5' }, new char[] { '\u22e8' }, new char[] { '\u227e' }, new char[] { '\u2032' }, new char[] { '\u2119' }, new char[] { '\u2ab5' }, new char[] { '\u2ab9' }, new char[] { '\u22e8' }, new char[] { '\u220f' }, new char[] { '\u232e' }, new char[] { '\u2312' }, new char[] { '\u2313' }, new char[] { '\u221d' }, new char[] { '\u221d' }, new char[] { '\u227e' }, new char[] { '\u22b0' }, new char[] { '\ud835', '\udcc5' }, new char[] { '\u03c8' }, new char[] { '\u2008' }, new char[] { '\ud835', '\udd2e' }, new char[] { '\u2a0c' }, new char[] { '\ud835', '\udd62' }, new char[] { '\u2057' }, new char[] { '\ud835', '\udcc6' }, new char[] { '\u210d' }, new char[] { '\u2a16' }, new char[] { '\u003f' }, new char[] { '\u225f' }, new char[] { '\u0022' }, new char[] { '\u0022' }, new char[] { '\u21db' }, new char[] { '\u21d2' }, new char[] { '\u291c' }, new char[] { '\u290f' }, new char[] { '\u2964' }, new char[] { '\u223d', '\u0331' }, new char[] { '\u0155' }, new char[] { '\u221a' }, new char[] { '\u29b3' }, new char[] { '\u27e9' }, new char[] { '\u2992' }, new char[] { '\u29a5' }, new char[] { '\u27e9' }, new char[] { '\u00bb' }, new char[] { '\u00bb' }, new char[] { '\u2192' }, new char[] { '\u2975' }, new char[] { '\u21e5' }, new char[] { '\u2920' }, new char[] { '\u2933' }, new char[] { '\u291e' }, new char[] { '\u21aa' }, new char[] { '\u21ac' }, new char[] { '\u2945' }, new char[] { '\u2974' }, new char[] { '\u21a3' }, new char[] { '\u219d' }, new char[] { '\u291a' }, new char[] { '\u2236' }, new char[] { '\u211a' }, new char[] { '\u290d' }, new char[] { '\u2773' }, new char[] { '\u007d' }, new char[] { '\u005d' }, new char[] { '\u298c' }, new char[] { '\u298e' }, new char[] { '\u2990' }, new char[] { '\u0159' }, new char[] { '\u0157' }, new char[] { '\u2309' }, new char[] { '\u007d' }, new char[] { '\u0440' }, new char[] { '\u2937' }, new char[] { '\u2969' }, new char[] { '\u201d' }, new char[] { '\u201d' }, new char[] { '\u21b3' }, new char[] { '\u211c' }, new char[] { '\u211b' }, new char[] { '\u211c' }, new char[] { '\u211d' }, new char[] { '\u25ad' }, new char[] { '\u00ae' }, new char[] { '\u00ae' }, new char[] { '\u297d' }, new char[] { '\u230b' }, new char[] { '\ud835', '\udd2f' }, new char[] { '\u21c1' }, new char[] { '\u21c0' }, new char[] { '\u296c' }, new char[] { '\u03c1' }, new char[] { '\u03f1' }, new char[] { '\u2192' }, new char[] { '\u21a3' }, new char[] { '\u21c1' }, new char[] { '\u21c0' }, new char[] { '\u21c4' }, new char[] { '\u21cc' }, new char[] { '\u21c9' }, new char[] { '\u219d' }, new char[] { '\u22cc' }, new char[] { '\u02da' }, new char[] { '\u2253' }, new char[] { '\u21c4' }, new char[] { '\u21cc' }, new char[] { '\u200f' }, new char[] { '\u23b1' }, new char[] { '\u23b1' }, new char[] { '\u2aee' }, new char[] { '\u27ed' }, new char[] { '\u21fe' }, new char[] { '\u27e7' }, new char[] { '\u2986' }, new char[] { '\ud835', '\udd63' }, new char[] { '\u2a2e' }, new char[] { '\u2a35' }, new char[] { '\u0029' }, new char[] { '\u2994' }, new char[] { '\u2a12' }, new char[] { '\u21c9' }, new char[] { '\u203a' }, new char[] { '\ud835', '\udcc7' }, new char[] { '\u21b1' }, new char[] { '\u005d' }, new char[] { '\u2019' }, new char[] { '\u2019' }, new char[] { '\u22cc' }, new char[] { '\u22ca' }, new char[] { '\u25b9' }, new char[] { '\u22b5' }, new char[] { '\u25b8' }, new char[] { '\u29ce' }, new char[] { '\u2968' }, new char[] { '\u211e' }, new char[] { '\u015b' }, new char[] { '\u201a' }, new char[] { '\u227b' }, new char[] { '\u2ab4' }, new char[] { '\u2ab8' }, new char[] { '\u0161' }, new char[] { '\u227d' }, new char[] { '\u2ab0' }, new char[] { '\u015f' }, new char[] { '\u015d' }, new char[] { '\u2ab6' }, new char[] { '\u2aba' }, new char[] { '\u22e9' }, new char[] { '\u2a13' }, new char[] { '\u227f' }, new char[] { '\u0441' }, new char[] { '\u22c5' }, new char[] { '\u22a1' }, new char[] { '\u2a66' }, new char[] { '\u21d8' }, new char[] { '\u2925' }, new char[] { '\u2198' }, new char[] { '\u2198' }, new char[] { '\u00a7' }, new char[] { '\u00a7' }, new char[] { '\u003b' }, new char[] { '\u2929' }, new char[] { '\u2216' }, new char[] { '\u2216' }, new char[] { '\u2736' }, new char[] { '\ud835', '\udd30' }, new char[] { '\u2322' }, new char[] { '\u266f' }, new char[] { '\u0449' }, new char[] { '\u0448' }, new char[] { '\u2223' }, new char[] { '\u2225' }, new char[] { '\u00ad' }, new char[] { '\u00ad' }, new char[] { '\u03c3' }, new char[] { '\u03c2' }, new char[] { '\u03c2' }, new char[] { '\u223c' }, new char[] { '\u2a6a' }, new char[] { '\u2243' }, new char[] { '\u2243' }, new char[] { '\u2a9e' }, new char[] { '\u2aa0' }, new char[] { '\u2a9d' }, new char[] { '\u2a9f' }, new char[] { '\u2246' }, new char[] { '\u2a24' }, new char[] { '\u2972' }, new char[] { '\u2190' }, new char[] { '\u2216' }, new char[] { '\u2a33' }, new char[] { '\u29e4' }, new char[] { '\u2223' }, new char[] { '\u2323' }, new char[] { '\u2aaa' }, new char[] { '\u2aac' }, new char[] { '\u2aac', '\ufe00' }, new char[] { '\u044c' }, new char[] { '\u002f' }, new char[] { '\u29c4' }, new char[] { '\u233f' }, new char[] { '\ud835', '\udd64' }, new char[] { '\u2660' }, new char[] { '\u2660' }, new char[] { '\u2225' }, new char[] { '\u2293' }, new char[] { '\u2293', '\ufe00' }, new char[] { '\u2294' }, new char[] { '\u2294', '\ufe00' }, new char[] { '\u228f' }, new char[] { '\u2291' }, new char[] { '\u228f' }, new char[] { '\u2291' }, new char[] { '\u2290' }, new char[] { '\u2292' }, new char[] { '\u2290' }, new char[] { '\u2292' }, new char[] { '\u25a1' }, new char[] { '\u25a1' }, new char[] { '\u25aa' }, new char[] { '\u25aa' }, new char[] { '\u2192' }, new char[] { '\ud835', '\udcc8' }, new char[] { '\u2216' }, new char[] { '\u2323' }, new char[] { '\u22c6' }, new char[] { '\u2606' }, new char[] { '\u2605' }, new char[] { '\u03f5' }, new char[] { '\u03d5' }, new char[] { '\u00af' }, new char[] { '\u2282' }, new char[] { '\u2ac5' }, new char[] { '\u2abd' }, new char[] { '\u2286' }, new char[] { '\u2ac3' }, new char[] { '\u2ac1' }, new char[] { '\u2acb' }, new char[] { '\u228a' }, new char[] { '\u2abf' }, new char[] { '\u2979' }, new char[] { '\u2282' }, new char[] { '\u2286' }, new char[] { '\u2ac5' }, new char[] { '\u228a' }, new char[] { '\u2acb' }, new char[] { '\u2ac7' }, new char[] { '\u2ad5' }, new char[] { '\u2ad3' }, new char[] { '\u227b' }, new char[] { '\u2ab8' }, new char[] { '\u227d' }, new char[] { '\u2ab0' }, new char[] { '\u2aba' }, new char[] { '\u2ab6' }, new char[] { '\u22e9' }, new char[] { '\u227f' }, new char[] { '\u2211' }, new char[] { '\u266a' }, new char[] { '\u00b9' }, new char[] { '\u00b9' }, new char[] { '\u00b2' }, new char[] { '\u00b2' }, new char[] { '\u00b3' }, new char[] { '\u00b3' }, new char[] { '\u2283' }, new char[] { '\u2ac6' }, new char[] { '\u2abe' }, new char[] { '\u2ad8' }, new char[] { '\u2287' }, new char[] { '\u2ac4' }, new char[] { '\u27c9' }, new char[] { '\u2ad7' }, new char[] { '\u297b' }, new char[] { '\u2ac2' }, new char[] { '\u2acc' }, new char[] { '\u228b' }, new char[] { '\u2ac0' }, new char[] { '\u2283' }, new char[] { '\u2287' }, new char[] { '\u2ac6' }, new char[] { '\u228b' }, new char[] { '\u2acc' }, new char[] { '\u2ac8' }, new char[] { '\u2ad4' }, new char[] { '\u2ad6' }, new char[] { '\u21d9' }, new char[] { '\u2926' }, new char[] { '\u2199' }, new char[] { '\u2199' }, new char[] { '\u292a' }, new char[] { '\u00df' }, new char[] { '\u00df' }, new char[] { '\u2316' }, new char[] { '\u03c4' }, new char[] { '\u23b4' }, new char[] { '\u0165' }, new char[] { '\u0163' }, new char[] { '\u0442' }, new char[] { '\u20db' }, new char[] { '\u2315' }, new char[] { '\ud835', '\udd31' }, new char[] { '\u2234' }, new char[] { '\u2234' }, new char[] { '\u03b8' }, new char[] { '\u03d1' }, new char[] { '\u03d1' }, new char[] { '\u2248' }, new char[] { '\u223c' }, new char[] { '\u2009' }, new char[] { '\u2248' }, new char[] { '\u223c' }, new char[] { '\u00fe' }, new char[] { '\u00fe' }, new char[] { '\u02dc' }, new char[] { '\u00d7' }, new char[] { '\u00d7' }, new char[] { '\u22a0' }, new char[] { '\u2a31' }, new char[] { '\u2a30' }, new char[] { '\u222d' }, new char[] { '\u2928' }, new char[] { '\u22a4' }, new char[] { '\u2336' }, new char[] { '\u2af1' }, new char[] { '\ud835', '\udd65' }, new char[] { '\u2ada' }, new char[] { '\u2929' }, new char[] { '\u2034' }, new char[] { '\u2122' }, new char[] { '\u25b5' }, new char[] { '\u25bf' }, new char[] { '\u25c3' }, new char[] { '\u22b4' }, new char[] { '\u225c' }, new char[] { '\u25b9' }, new char[] { '\u22b5' }, new char[] { '\u25ec' }, new char[] { '\u225c' }, new char[] { '\u2a3a' }, new char[] { '\u2a39' }, new char[] { '\u29cd' }, new char[] { '\u2a3b' }, new char[] { '\u23e2' }, new char[] { '\ud835', '\udcc9' }, new char[] { '\u0446' }, new char[] { '\u045b' }, new char[] { '\u0167' }, new char[] { '\u226c' }, new char[] { '\u219e' }, new char[] { '\u21a0' }, new char[] { '\u21d1' }, new char[] { '\u2963' }, new char[] { '\u00fa' }, new char[] { '\u00fa' }, new char[] { '\u2191' }, new char[] { '\u045e' }, new char[] { '\u016d' }, new char[] { '\u00fb' }, new char[] { '\u00fb' }, new char[] { '\u0443' }, new char[] { '\u21c5' }, new char[] { '\u0171' }, new char[] { '\u296e' }, new char[] { '\u297e' }, new char[] { '\ud835', '\udd32' }, new char[] { '\u00f9' }, new char[] { '\u00f9' }, new char[] { '\u21bf' }, new char[] { '\u21be' }, new char[] { '\u2580' }, new char[] { '\u231c' }, new char[] { '\u231c' }, new char[] { '\u230f' }, new char[] { '\u25f8' }, new char[] { '\u016b' }, new char[] { '\u00a8' }, new char[] { '\u00a8' }, new char[] { '\u0173' }, new char[] { '\ud835', '\udd66' }, new char[] { '\u2191' }, new char[] { '\u2195' }, new char[] { '\u21bf' }, new char[] { '\u21be' }, new char[] { '\u228e' }, new char[] { '\u03c5' }, new char[] { '\u03d2' }, new char[] { '\u03c5' }, new char[] { '\u21c8' }, new char[] { '\u231d' }, new char[] { '\u231d' }, new char[] { '\u230e' }, new char[] { '\u016f' }, new char[] { '\u25f9' }, new char[] { '\ud835', '\udcca' }, new char[] { '\u22f0' }, new char[] { '\u0169' }, new char[] { '\u25b5' }, new char[] { '\u25b4' }, new char[] { '\u21c8' }, new char[] { '\u00fc' }, new char[] { '\u00fc' }, new char[] { '\u29a7' }, new char[] { '\u21d5' }, new char[] { '\u2ae8' }, new char[] { '\u2ae9' }, new char[] { '\u22a8' }, new char[] { '\u299c' }, new char[] { '\u03f5' }, new char[] { '\u03f0' }, new char[] { '\u2205' }, new char[] { '\u03d5' }, new char[] { '\u03d6' }, new char[] { '\u221d' }, new char[] { '\u2195' }, new char[] { '\u03f1' }, new char[] { '\u03c2' }, new char[] { '\u228a', '\ufe00' }, new char[] { '\u2acb', '\ufe00' }, new char[] { '\u228b', '\ufe00' }, new char[] { '\u2acc', '\ufe00' }, new char[] { '\u03d1' }, new char[] { '\u22b2' }, new char[] { '\u22b3' }, new char[] { '\u0432' }, new char[] { '\u22a2' }, new char[] { '\u2228' }, new char[] { '\u22bb' }, new char[] { '\u225a' }, new char[] { '\u22ee' }, new char[] { '\u007c' }, new char[] { '\u007c' }, new char[] { '\ud835', '\udd33' }, new char[] { '\u22b2' }, new char[] { '\u2282', '\u20d2' }, new char[] { '\u2283', '\u20d2' }, new char[] { '\ud835', '\udd67' }, new char[] { '\u221d' }, new char[] { '\u22b3' }, new char[] { '\ud835', '\udccb' }, new char[] { '\u2acb', '\ufe00' }, new char[] { '\u228a', '\ufe00' }, new char[] { '\u2acc', '\ufe00' }, new char[] { '\u228b', '\ufe00' }, new char[] { '\u299a' }, new char[] { '\u0175' }, new char[] { '\u2a5f' }, new char[] { '\u2227' }, new char[] { '\u2259' }, new char[] { '\u2118' }, new char[] { '\ud835', '\udd34' }, new char[] { '\ud835', '\udd68' }, new char[] { '\u2118' }, new char[] { '\u2240' }, new char[] { '\u2240' }, new char[] { '\ud835', '\udccc' }, new char[] { '\u22c2' }, new char[] { '\u25ef' }, new char[] { '\u22c3' }, new char[] { '\u25bd' }, new char[] { '\ud835', '\udd35' }, new char[] { '\u27fa' }, new char[] { '\u27f7' }, new char[] { '\u03be' }, new char[] { '\u27f8' }, new char[] { '\u27f5' }, new char[] { '\u27fc' }, new char[] { '\u22fb' }, new char[] { '\u2a00' }, new char[] { '\ud835', '\udd69' }, new char[] { '\u2a01' }, new char[] { '\u2a02' }, new char[] { '\u27f9' }, new char[] { '\u27f6' }, new char[] { '\ud835', '\udccd' }, new char[] { '\u2a06' }, new char[] { '\u2a04' }, new char[] { '\u25b3' }, new char[] { '\u22c1' }, new char[] { '\u22c0' }, new char[] { '\u00fd' }, new char[] { '\u00fd' }, new char[] { '\u044f' }, new char[] { '\u0177' }, new char[] { '\u044b' }, new char[] { '\u00a5' }, new char[] { '\u00a5' }, new char[] { '\ud835', '\udd36' }, new char[] { '\u0457' }, new char[] { '\ud835', '\udd6a' }, new char[] { '\ud835', '\udcce' }, new char[] { '\u044e' }, new char[] { '\u00ff' }, new char[] { '\u00ff' }, new char[] { '\u017a' }, new char[] { '\u017e' }, new char[] { '\u0437' }, new char[] { '\u017c' }, new char[] { '\u2128' }, new char[] { '\u03b6' }, new char[] { '\ud835', '\udd37' }, new char[] { '\u0436' }, new char[] { '\u21dd' }, new char[] { '\ud835', '\udd6b' }, new char[] { '\ud835', '\udccf' }, new char[] { '\u200d' }, new char[] { '\u200c' }, }; internal static readonly char[][] WINDOWS_1252 = { new char[] { '\u20AC' }, new char[] { '\u0081' }, new char[] { '\u201A' }, new char[] { '\u0192' }, new char[] { '\u201E' }, new char[] { '\u2026' }, new char[] { '\u2020' }, new char[] { '\u2021' }, new char[] { '\u02C6' }, new char[] { '\u2030' }, new char[] { '\u0160' }, new char[] { '\u2039' }, new char[] { '\u0152' }, new char[] { '\u008D' }, new char[] { '\u017D' }, new char[] { '\u008F' }, new char[] { '\u0090' }, new char[] { '\u2018' }, new char[] { '\u2019' }, new char[] { '\u201C' }, new char[] { '\u201D' }, new char[] { '\u2022' }, new char[] { '\u2013' }, new char[] { '\u2014' }, new char[] { '\u02DC' }, new char[] { '\u2122' }, new char[] { '\u0161' }, new char[] { '\u203A' }, new char[] { '\u0153' }, new char[] { '\u009D' }, new char[] { '\u017E' }, new char[] { '\u0178' } }; } }
88.292373
123
0.465602
[ "MIT" ]
prepare/DomQuery
source/a_mini/HtmlParserSharp2/Core/NamedCharacters.cs
83,352
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.EventGrid.V20200101Preview.Inputs { /// <summary> /// StringNotIn Advanced Filter. /// </summary> public sealed class StringNotInAdvancedFilterArgs : Pulumi.ResourceArgs { /// <summary> /// The field/property in the event based on which you want to filter. /// </summary> [Input("key")] public Input<string>? Key { get; set; } /// <summary> /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. /// Expected value is 'StringNotIn'. /// </summary> [Input("operatorType", required: true)] public Input<string> OperatorType { get; set; } = null!; [Input("values")] private InputList<string>? _values; /// <summary> /// The set of filter values. /// </summary> public InputList<string> Values { get => _values ?? (_values = new InputList<string>()); set => _values = value; } public StringNotInAdvancedFilterArgs() { } } }
29.5625
104
0.601832
[ "Apache-2.0" ]
polivbr/pulumi-azure-native
sdk/dotnet/EventGrid/V20200101Preview/Inputs/StringNotInAdvancedFilterArgs.cs
1,419
C#
 namespace cn.bmob.io { /// <summary> /// 实现该接口的类直接进行赋值 /// /// Visible For API! 暂时仅支持API自带的值类型. 由于泛型T,导致在JSON解析注册时很麻烦,不推荐用户实现值类型! /// </summary> public interface IBmobValue<T> : IBmobValue { T Get(); } public interface IBmobValue { void Set(object data); } }
17
74
0.566563
[ "Apache-2.0" ]
bmob/BmobSharp
core/src/io/IBmobValue.cs
429
C#
// Accord Statistics Library // The Accord.NET Framework // http://accord-framework.net // // Copyright © César Souza, 2009-2015 // cesarsouza at gmail.com // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // namespace Accord.Statistics.Kernels { using System; using AForge; using Accord.Math.Distances; /// <summary> /// Laplacian Kernel. /// </summary> /// [Serializable] public sealed class Laplacian : KernelBase, IKernel, IRadialBasisKernel, IDistance, ICloneable, IEstimable, IReverseDistance { private double sigma; private double gamma; /// <summary> /// Constructs a new Laplacian Kernel /// </summary> /// public Laplacian() : this(1) { } /// <summary> /// Constructs a new Laplacian Kernel /// </summary> /// /// <param name="sigma">The sigma slope value.</param> /// public Laplacian(double sigma) { this.Sigma = sigma; } /// <summary> /// Gets or sets the sigma value for the kernel. When setting /// sigma, gamma gets updated accordingly (gamma = 0.5*/sigma^2). /// </summary> /// public double Sigma { get { return sigma; } set { sigma = value; gamma = 1.0 / sigma; } } /// <summary> /// Gets or sets the gamma value for the kernel. When setting /// gamma, sigma gets updated accordingly (gamma = 0.5*/sigma^2). /// </summary> /// public double Gamma { get { return gamma; } set { gamma = value; sigma = 1.0 / gamma; } } /// <summary> /// Laplacian Kernel function. /// </summary> /// /// <param name="x">Vector <c>x</c> in input space.</param> /// <param name="y">Vector <c>y</c> in input space.</param> /// /// <returns>Dot product in feature (kernel) space.</returns> /// public override double Function(double[] x, double[] y) { // Optimization in case x and y are // exactly the same object reference. if (x == y) return 1.0; double norm = 0.0; for (int i = 0; i < x.Length; i++) { double d = x[i] - y[i]; norm += d * d; } norm = Math.Sqrt(norm); return Math.Exp(-gamma * norm); } /// <summary> /// Laplacian Kernel function. /// </summary> /// /// <param name="z">Distance <c>z</c> in input space.</param> /// /// <returns>Dot product in feature (kernel) space.</returns> /// public double Function(double z) { return Math.Exp(-gamma * z); } /// <summary> /// Computes the squared distance in input space /// between two points given in feature space. /// </summary> /// /// <param name="x">Vector <c>x</c> in feature (kernel) space.</param> /// <param name="y">Vector <c>y</c> in feature (kernel) space.</param> /// /// <returns>Squared distance between <c>x</c> and <c>y</c> in input space.</returns> /// public override double Distance(double[] x, double[] y) { if (x == y) return 0.0; double norm = 0.0; for (int i = 0; i < x.Length; i++) { double d = x[i] - y[i]; norm += d * d; } norm = Math.Sqrt(norm); return 2 - 2 * Math.Exp(-gamma * norm); } /// <summary> /// Computes the squared distance in input space /// between two points given in feature space. /// </summary> /// /// <param name="x">Vector <c>x</c> in feature (kernel) space.</param> /// <param name="y">Vector <c>y</c> in feature (kernel) space.</param> /// /// <returns> /// Squared distance between <c>x</c> and <c>y</c> in input space. /// </returns> /// public double ReverseDistance(double[] x, double[] y) { if (x == y) return 0.0; double norm = 0.0; for (int i = 0; i < x.Length; i++) { double d = x[i] - y[i]; norm += d * d; } return (1.0 / -gamma) * Math.Log(1.0 - 0.5 * norm); } /// <summary> /// Computes the distance in input space given /// a distance computed in feature space. /// </summary> /// /// <param name="df">Distance in feature space.</param> /// <returns>Distance in input space.</returns> /// public double ReverseDistance(double df) { return (1.0 / -gamma) * Math.Log(1.0 - 0.5 * df); } /// <summary> /// Estimate appropriate values for sigma given a data set. /// </summary> /// /// <remarks> /// This method uses a simple heuristic to obtain appropriate values /// for sigma in a radial basis function kernel. The heuristic is shown /// by Caputo, Sim, Furesjo and Smola, "Appearance-based object /// recognition using SVMs: which kernel should I use?", 2002. /// </remarks> /// /// <param name="inputs">The data set.</param> /// /// <returns>A Laplacian kernel initialized with an appropriate sigma value.</returns> /// public static Laplacian Estimate(double[][] inputs) { DoubleRange range; return Estimate(inputs, inputs.Length, out range); } /// <summary> /// Estimate appropriate values for sigma given a data set. /// </summary> /// /// <remarks> /// This method uses a simple heuristic to obtain appropriate values /// for sigma in a radial basis function kernel. The heuristic is shown /// by Caputo, Sim, Furesjo and Smola, "Appearance-based object /// recognition using SVMs: which kernel should I use?", 2002. /// </remarks> /// /// <param name="inputs">The data set.</param> /// <param name="samples">The number of random samples to analyze.</param> /// <param name="range">The range of suitable values for sigma.</param> /// /// <returns>A Laplacian kernel initialized with an appropriate sigma value.</returns> /// public static Laplacian Estimate(double[][] inputs, int samples, out DoubleRange range) { if (samples > inputs.Length) throw new ArgumentOutOfRangeException("samples"); double[] distances = Gaussian.Distances(inputs, samples); double q1 = distances[(int)Math.Ceiling(0.15 * distances.Length)]; double q9 = distances[(int)Math.Ceiling(0.85 * distances.Length)]; double qm = Measures.Median(distances, alreadySorted: true); range = new DoubleRange(q1, q9); return new Laplacian(sigma: qm); } /// <summary> /// Creates a new object that is a copy of the current instance. /// </summary> /// /// <returns> /// A new object that is a copy of this instance. /// </returns> /// public object Clone() { return MemberwiseClone(); } void IEstimable.Estimate(double[][] inputs) { var l = Estimate(inputs); this.Sigma = l.Sigma; } } }
31.532609
95
0.509135
[ "MIT" ]
mastercs999/fn-trading
src/Accord/Accord.Statistics/Kernels/Laplacian.cs
8,707
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DAModels { public abstract class IntelligentModel<T> { public T[] Data { get; set; } public abstract void Run(); public abstract void Initialize(); public abstract ModelTestResult Test(); public abstract void Save(); public abstract void Load(); } }
20.714286
46
0.668966
[ "MIT" ]
two-legs/DAModels
DAModels/IntelligentModel.cs
437
C#
using System; namespace TrueCraft.Core.TerrainGen.Biomes { public class ShrublandBiome : BiomeProvider { public override byte ID { get { return (byte)Biome.Shrubland; } } public override double Temperature { get { return 0.8f; } } public override double Rainfall { get { return 0.4f; } } public override TreeSpecies[] Trees { get { return new[] { TreeSpecies.Oak }; } } public override PlantSpecies[] Plants { get { return new PlantSpecies[0]; } } } }
19.184211
49
0.452675
[ "MIT" ]
mrj001/TrueCraft
TrueCraft.Core/TerrainGen/Biomes/ShrublandBiome.cs
731
C#
namespace ODataFilterPropertiesByRole.Areas.HelpPage.ModelDescriptions { public class SimpleTypeModelDescription : ModelDescription { } }
24.833333
70
0.798658
[ "MIT" ]
jlkalberer/ODataFilterProperties
ODataFilterPropertiesByRole/Areas/HelpPage/ModelDescriptions/SimpleTypeModelDescription.cs
149
C#
// // Copyright (c) 2004-2021 Jaroslaw Kowalski <jaak@jkowalski.net>, Kim Christensen, Julian Verdurmen // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // * Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // // * Neither the name of Jaroslaw Kowalski nor the names of its // contributors may be used to endorse or promote products derived from this // software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF // THE POSSIBILITY OF SUCH DAMAGE. // namespace NLog.LayoutRenderers { using System; using System.ComponentModel; using System.Globalization; using System.Text; using NLog.Config; using NLog.Internal; /// <summary> /// The process time in format HH:mm:ss.mmm. /// </summary> [LayoutRenderer("processtime")] [ThreadAgnostic] [ThreadSafe] public class ProcessTimeLayoutRenderer : LayoutRenderer, IRawValue { /// <summary> /// Gets or sets a value indicating whether to output in culture invariant format /// </summary> /// <docgen category='Rendering Options' order='10' /> [DefaultValue(false)] public bool Invariant { get; set; } /// <inheritdoc /> protected override void Append(StringBuilder builder, LogEventInfo logEvent) { var ts = GetValue(logEvent); var culture = Invariant ? null : GetCulture(logEvent); WritetTimestamp(builder, ts, culture); } /// <inheritdoc /> bool IRawValue.TryGetRawValue(LogEventInfo logEvent, out object value) { value = GetValue(logEvent); return true; } /// <summary> /// Write timestamp to builder with format hh:mm:ss:fff /// </summary> internal static void WritetTimestamp(StringBuilder builder, TimeSpan ts, CultureInfo culture) { string timeSeparator = ":"; string ticksSeparator = "."; if (culture != null) { #if !NETSTANDARD1_3 && !NETSTANDARD1_5 timeSeparator = culture.DateTimeFormat.TimeSeparator; #endif ticksSeparator = culture.NumberFormat.NumberDecimalSeparator; } builder.Append2DigitsZeroPadded(ts.Hours); builder.Append(timeSeparator); builder.Append2DigitsZeroPadded(ts.Minutes); builder.Append(timeSeparator); builder.Append2DigitsZeroPadded(ts.Seconds); builder.Append(ticksSeparator); int milliseconds = ts.Milliseconds; if (milliseconds < 100) { builder.Append('0'); if (milliseconds < 10) { builder.Append('0'); if (milliseconds < 0) { //don't write negative times. This is probably an accuracy problem (accuracy is by default 16ms, see https://github.com/NLog/NLog/wiki/Time-Source) builder.Append('0'); return; } } } builder.AppendInvariant(milliseconds); } private static TimeSpan GetValue(LogEventInfo logEvent) { TimeSpan ts = logEvent.TimeStamp.ToUniversalTime() - LogEventInfo.ZeroDate; return ts; } } }
37.483607
171
0.632189
[ "BSD-3-Clause" ]
Fr33dan/NLog
src/NLog/LayoutRenderers/DateTime/ProcessTimeLayoutRenderer.cs
4,573
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("07. FruitShop")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("07. FruitShop")] [assembly: AssemblyCopyright("Copyright © Microsoft 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("f06d9ab5-a784-470d-8461-9f5d8a5f82af")] // 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")]
38.297297
84
0.745942
[ "MIT" ]
vasilivanov93/SOFTUNI
C#/01. Programing Basic C#/Project/04. Complex Conditional Statements/07. FruitShop/Properties/AssemblyInfo.cs
1,420
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("Microsoft.Extensions.Configuration.FileExtensions.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
83.25
421
0.894895
[ "MIT" ]
06needhamt/runtime
src/libraries/Microsoft.Extensions.Configuration.FileExtensions/src/Properties/InternalsVisibleTo.cs
666
C#
using Newtonsoft.Json; namespace HitBTC.Net.Models.RequestsParameters { internal class HitSubscribeCandlesParameters : HitGetSymbolParameters { public override HitRequestMethod HitRequestMethod => HitRequestMethod.SubscribeCandles; [JsonProperty("period")] public HitPeriod Period { get; set; } [JsonProperty("limit")] public int limit { get; set; } } }
27.266667
95
0.696822
[ "MIT" ]
masoodafar-web/HitBTC.Net
HitBTC.Net/Models/RequestsParameters/HitSubscribeCandlesParameters.cs
411
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Dawnfall.Helper { public abstract class AMonoSingleton<T> : MonoBehaviour where T : MonoBehaviour { private static T m_instance; public static T Instance { get { if (m_instance == null) m_instance = GameObject.FindObjectOfType<T>(); return m_instance; } } private void Awake() { if (Instance != this) { #if UNITY_EDITOR DestroyImmediate(this); #else Destroy(this); #endif return; } OnAfterAwake(); } private void OnDestroy() { if (Instance == this) { OnBeforeDestroy(); m_instance = null; } } protected virtual void OnAfterAwake() { } protected virtual void OnBeforeDestroy() { } } }
22
83
0.488395
[ "MIT" ]
Dawnfall/UnityHelpers
Assets/Helpers/Singletons/AMonoSingleton.cs
1,036
C#
using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using SFA.DAS.Roatp.Domain.Entities; using SFA.DAS.Roatp.Domain.Interfaces; namespace SFA.DAS.Roatp.Data.Repositories { internal class StandardReadRepository : IStandardReadRepository { private readonly RoatpDataContext _roatpDataContext; public StandardReadRepository(RoatpDataContext roatpDataContext) { _roatpDataContext = roatpDataContext; } public async Task<List<Standard>> GetAllStandards() { return await _roatpDataContext .Standards .AsNoTracking() .ToListAsync(); } public async Task<Standard> GetStandard(int larsCode) { return await _roatpDataContext .Standards .AsNoTracking() .SingleOrDefaultAsync(c => c.LarsCode == larsCode); } } }
29.264706
72
0.636181
[ "MIT" ]
SkillsFundingAgency/das-roatp-api
src/SFA.DAS.Roatp.Data/Repositories/StandardReadRepository.cs
997
C#
using Orchard.ContentManagement.MetaData; using Orchard.Core.Contents.Extensions; using Orchard.Data.Migration; using Orchard.Environment.Extensions; using Piedone.Facebook.Suite.Models; namespace Piedone.Facebook.Suite.Migrations { [OrchardFeature("Piedone.Facebook.Suite.LikeBox")] public class FacebookLikeBoxMigrations : DataMigrationImpl { public int Create() { // Creating table FacebookLikeBoxPartRecord SchemaBuilder.CreateTable(typeof(FacebookLikeBoxPartRecord).Name, table => table .SocialPluginWithHeightPartRecord() .Column<string>("PageUrl") .Column<bool>("ShowFaces") .Column<string>("BorderColor") .Column<bool>("ShowStream") .Column<bool>("ShowHeader") ); ContentDefinitionManager.AlterTypeDefinition("FacebookLikeBoxWidget", cfg => cfg .WithPart(typeof(FacebookLikeBoxPart).Name) .WithPart("WidgetPart") .WithPart("CommonPart") .WithSetting("Stereotype", "Widget") ); return 3; } public int UpdateFrom1() { SchemaBuilder.AlterTable(typeof(FacebookLikeBoxPartRecord).Name, table => table .AddColumn<int>("Height")); return 2; } public int UpdateFrom2() { ContentDefinitionManager.AlterPartDefinition(typeof(FacebookLikeBoxPart).Name, builder => builder.Attachable(false)); return 3; } } }
32.722222
91
0.546689
[ "BSD-3-Clause" ]
Lombiq/Dojo-Course-Orchard-demo
src/Orchard.Web/Modules/Piedone.Facebook.Suite/Migrations/FacebookLikeBoxMigrations.cs
1,767
C#
// ***************************************************************************** // BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE) // © Component Factory Pty Ltd, 2006 - 2016, All rights reserved. // The software and associated documentation supplied hereunder are the // proprietary information of Component Factory Pty Ltd, 13 Swallows Close, // Mornington, Vic 3931, Australia and are supplied subject to license terms. // // Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV) 2017 - 2020. All rights reserved. (https://github.com/Wagnerp/Krypton-Toolkit-Suite-NET-Core) // Version 5.500.0.0 www.ComponentFactory.com // ***************************************************************************** using System; using System.ComponentModel; using System.ComponentModel.Design; using System.Windows.Forms; using System.Windows.Forms.Design; using System.Diagnostics; namespace ComponentFactory.Krypton.Toolkit { internal class KryptonGroupBoxDesigner : ParentControlDesigner { #region Instance Fields private KryptonGroupBox _groupBox; private IDesignerHost _designerHost; #endregion #region Public /// <summary> /// Initializes the designer with the specified component. /// </summary> /// <param name="component">The IComponent to associate the designer with.</param> public override void Initialize(IComponent component) { Debug.Assert(component != null); // Validate the parameter reference if (component == null) { throw new ArgumentNullException(nameof(component)); } // Let base class do standard stuff base.Initialize(component); // Cast to correct type _groupBox = component as KryptonGroupBox; // The resizing handles around the control need to change depending on the // value of the AutoSize and AutoSizeMode properties. When in AutoSize you // do not get the resizing handles, otherwise you do. AutoResizeHandles = true; // Acquire service interfaces _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost)); // Let the internal panel in the container be designable if (_groupBox != null) { EnableDesignMode(_groupBox.Panel, "Panel"); } } /// <summary> /// Indicates whether the specified control can be a child of the control managed by a designer. /// </summary> /// <param name="control">The Control to test.</param> /// <returns>true if the specified control can be a child of the control managed by this designer; otherwise, false.</returns> public override bool CanParent(Control control) { // We never allow anything to be added to the header group return false; } /// <summary> /// Returns the internal control designer with the specified index in the ControlDesigner. /// </summary> /// <param name="internalControlIndex">A specified index to select the internal control designer. This index is zero-based.</param> /// <returns>A ControlDesigner at the specified index.</returns> public override ControlDesigner InternalControlDesigner(int internalControlIndex) { // Get the control designer for the requested indexed child control if ((_groupBox != null) && (internalControlIndex == 0)) { return (ControlDesigner)_designerHost.GetDesigner(_groupBox.Panel); } else { return null; } } /// <summary> /// Returns the number of internal control designers in the ControlDesigner. /// </summary> /// <returns>The number of internal control designers in the ControlDesigner.</returns> public override int NumberOfInternalControlDesigners() => _groupBox != null ? 1 : 0; /// <summary> /// Gets the design-time action lists supported by the component associated with the designer. /// </summary> public override DesignerActionListCollection ActionLists { get { // Create a collection of action lists DesignerActionListCollection actionLists = new DesignerActionListCollection { // Add the group box specific list new KryptonGroupBoxActionList(this) }; return actionLists; } } #endregion } }
39.916667
170
0.602296
[ "BSD-3-Clause" ]
Krypton-Suite-Legacy-Archive/Krypton-Toolkit-Suite-NET-Core
Source/Krypton Components/ComponentFactory.Krypton.Toolkit/Designers/KryptonGroupBoxDesigner.cs
4,793
C#
using Newtonsoft.Json; namespace BringApi.Net { public class BringPickupPoint { [JsonProperty("id")] public string Id { get; set; } [JsonProperty("unitId")] public string UnitId { get; set; } [JsonProperty("name")] public string Name { get; set; } [JsonProperty("address")] public string Address { get; set; } [JsonProperty("postalCode")] public string PostalCode { get; set; } [JsonProperty("city")] public string City { get; set; } [JsonProperty("countryCode")] public string CountryCode { get; set; } [JsonProperty("municipality")] public string Municipality { get; set; } [JsonProperty("county")] public string County { get; set; } [JsonProperty("visitingAddress")] public string VisitingAddress { get; set; } [JsonProperty("visitingPostalCode")] public string VisitingPostalCode { get; set; } [JsonProperty("visitingCity")] public string VisitingCity { get; set; } [JsonProperty("openingHoursNorwegian")] public string OpeningHoursNorwegian { get; set; } [JsonProperty("openingHoursEnglish")] public string OpeningHoursEnglish { get; set; } [JsonProperty("openingHoursFinnish")] public string OpeningHoursFinnish { get; set; } [JsonProperty("openingHoursDanish")] public string OpeningHoursDanish { get; set; } [JsonProperty("openingHoursSwedish")] public string OpeningHoursSwedish { get; set; } [JsonProperty("latitude")] public decimal Latitude { get; set; } [JsonProperty("longitude")] public decimal Longitude { get; set; } [JsonProperty("utmX")] public string UtmX { get; set; } [JsonProperty("utmY")] public string UtmY { get; set; } [JsonProperty("postenMapsLink")] public string PostenMapsLink { get; set; } [JsonProperty("googleMapsLink")] public string GoogleMapsLink { get; set; } [JsonProperty("distanceInKm")] public string DistanceInKm { get; set; } [JsonProperty("distanceType")] public string DistanceType { get; set; } [JsonProperty("type")] public string Type { get; set; } [JsonProperty("additionalServiceCode")] public string AdditionalServiceCode { get; set; } [JsonProperty("routeMapsLink")] public string RouteMapsLink { get; set; } } }
27.858696
57
0.602419
[ "MIT" ]
christianz/bringapi-net
BringApi.Net/BringPickupPoint.cs
2,565
C#
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections.Generic; using System.IO; using System.Linq; using Microsoft.Performance.SDK.Processing; namespace Microsoft.Performance.Testing.SDK { [ProcessingSource("{0B48CF41-45DB-42C1-8B23-E568EF5F560E}", "Fake", "This is a test class.")] public sealed class FakeProcessingSource : IProcessingSource { public IEnumerable<TableDescriptor> DataTables => Enumerable.Empty<TableDescriptor>(); public IEnumerable<TableDescriptor> MetadataTables => Enumerable.Empty<TableDescriptor>(); public IEnumerable<Option> CommandLineOptions => Enumerable.Empty<Option>(); public ICustomDataProcessor CreateProcessorReturnValue { get; set; } public ICustomDataProcessor CreateProcessor(IDataSource dataSource, IProcessorEnvironment processorEnvironment, ProcessorOptions options) { return this.CreateProcessorReturnValue; } public ICustomDataProcessor CreateProcessor(IEnumerable<IDataSource> dataSources, IProcessorEnvironment processorEnvironment, ProcessorOptions options) { return this.CreateProcessorReturnValue; } public void DisposeProcessor(ICustomDataProcessor processor) { } public ProcessingSourceInfo GetAboutInfo() { throw new NotImplementedException(); } public Stream GetSerializationStream(SerializationSource source) { throw new NotImplementedException(); } public List<IDataSource> IsDataSourceSupportedCalls { get; } = new List<IDataSource>(); public Exception IsDataSourceSupportedError { get; set; } public Dictionary<IDataSource, bool> IsDataSourceSupportedReturnValue { get; } = new Dictionary<IDataSource, bool>(); public bool IsDataSourceSupported(IDataSource dataSource) { this.IsDataSourceSupportedCalls.Add(dataSource); if (this.IsDataSourceSupportedError != null) { throw this.IsDataSourceSupportedError; } if (!this.IsDataSourceSupportedReturnValue.TryGetValue(dataSource, out var r)) { return false; } return r; } public void SetApplicationEnvironment(IApplicationEnvironment applicationEnvironment) { throw new NotImplementedException(); } public void SetLogger(ILogger logger) { throw new NotImplementedException(); } } }
33.468354
159
0.670953
[ "MIT" ]
DanPear/microsoft-performance-toolkit-sdk
src/Microsoft.Performance.Testing.SDK/FakeProcessingSource.cs
2,646
C#
#pragma warning disable 0649 //------------------------------------------------------------------------------ // <auto-generated>This code was generated by LLBLGen Pro v4.1.</auto-generated> //------------------------------------------------------------------------------ using System; using System.Data.Linq; using System.Data.Linq.Mapping; using System.ComponentModel; namespace L2S.Bencher.EntityClasses { /// <summary>Class which represents the entity 'Location', mapped on table 'AdventureWorks.Production.Location'.</summary> [Table(Name="[Production].[Location]")] public partial class Location : INotifyPropertyChanging, INotifyPropertyChanged { #region Events /// <summary>Event which is raised when a property value is changing.</summary> public event PropertyChangingEventHandler PropertyChanging; /// <summary>Event which is raised when a property value changes.</summary> public event PropertyChangedEventHandler PropertyChanged; #endregion #region Class Member Declarations private System.Decimal _availability; private System.Decimal _costRate; private System.Int16 _locationId; private System.DateTime _modifiedDate; private System.String _name; private EntitySet <ProductInventory> _productInventories; private EntitySet <WorkOrderRouting> _workOrderRoutings; #endregion #region Extensibility Method Definitions partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); partial void OnCreated(); partial void OnAvailabilityChanging(System.Decimal value); partial void OnAvailabilityChanged(); partial void OnCostRateChanging(System.Decimal value); partial void OnCostRateChanged(); partial void OnLocationIdChanging(System.Int16 value); partial void OnLocationIdChanged(); partial void OnModifiedDateChanging(System.DateTime value); partial void OnModifiedDateChanged(); partial void OnNameChanging(System.String value); partial void OnNameChanged(); #endregion /// <summary>Initializes a new instance of the <see cref="Location"/> class.</summary> public Location() { _productInventories = new EntitySet<ProductInventory>(new Action<ProductInventory>(this.Attach_ProductInventories), new Action<ProductInventory>(this.Detach_ProductInventories) ); _workOrderRoutings = new EntitySet<WorkOrderRouting>(new Action<WorkOrderRouting>(this.Attach_WorkOrderRoutings), new Action<WorkOrderRouting>(this.Detach_WorkOrderRoutings) ); OnCreated(); } /// <summary>Raises the PropertyChanging event</summary> /// <param name="propertyName">name of the property which is changing</param> protected virtual void SendPropertyChanging(string propertyName) { if((this.PropertyChanging != null)) { this.PropertyChanging(this, new PropertyChangingEventArgs(propertyName)); } } /// <summary>Raises the PropertyChanged event for the property specified</summary> /// <param name="propertyName">name of the property which was changed</param> protected virtual void SendPropertyChanged(string propertyName) { if((this.PropertyChanged != null)) { this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } /// <summary>Attaches this instance to the entity specified as an associated entity</summary> /// <param name="entity">The related entity to attach to</param> private void Attach_ProductInventories(ProductInventory entity) { this.SendPropertyChanging("ProductInventories"); entity.Location = this; } /// <summary>Detaches this instance from the entity specified so it's no longer an associated entity</summary> /// <param name="entity">The related entity to detach from</param> private void Detach_ProductInventories(ProductInventory entity) { this.SendPropertyChanging("ProductInventories"); entity.Location = null; } /// <summary>Attaches this instance to the entity specified as an associated entity</summary> /// <param name="entity">The related entity to attach to</param> private void Attach_WorkOrderRoutings(WorkOrderRouting entity) { this.SendPropertyChanging("WorkOrderRoutings"); entity.Location = this; } /// <summary>Detaches this instance from the entity specified so it's no longer an associated entity</summary> /// <param name="entity">The related entity to detach from</param> private void Detach_WorkOrderRoutings(WorkOrderRouting entity) { this.SendPropertyChanging("WorkOrderRoutings"); entity.Location = null; } #region Class Property Declarations /// <summary>Gets or sets the Availability field. Mapped on target field 'Availability'. </summary> [Column(Name="Availability", Storage="_availability", CanBeNull=false, DbType="decimal(8,2) NOT NULL")] public System.Decimal Availability { get { return _availability; } set { if((_availability != value)) { OnAvailabilityChanging(value); SendPropertyChanging("Availability"); _availability = value; SendPropertyChanged("Availability"); OnAvailabilityChanged(); } } } /// <summary>Gets or sets the CostRate field. Mapped on target field 'CostRate'. </summary> [Column(Name="CostRate", Storage="_costRate", CanBeNull=false, DbType="smallmoney NOT NULL")] public System.Decimal CostRate { get { return _costRate; } set { if((_costRate != value)) { OnCostRateChanging(value); SendPropertyChanging("CostRate"); _costRate = value; SendPropertyChanged("CostRate"); OnCostRateChanged(); } } } /// <summary>Gets or sets the LocationId field. Mapped on target field 'LocationID'. </summary> [Column(Name="LocationID", Storage="_locationId", AutoSync=AutoSync.OnInsert, CanBeNull=false, DbType="smallint NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)] public System.Int16 LocationId { get { return _locationId; } set { if((_locationId != value)) { OnLocationIdChanging(value); SendPropertyChanging("LocationId"); _locationId = value; SendPropertyChanged("LocationId"); OnLocationIdChanged(); } } } /// <summary>Gets or sets the ModifiedDate field. Mapped on target field 'ModifiedDate'. </summary> [Column(Name="ModifiedDate", Storage="_modifiedDate", CanBeNull=false, DbType="datetime NOT NULL")] public System.DateTime ModifiedDate { get { return _modifiedDate; } set { if((_modifiedDate != value)) { OnModifiedDateChanging(value); SendPropertyChanging("ModifiedDate"); _modifiedDate = value; SendPropertyChanged("ModifiedDate"); OnModifiedDateChanged(); } } } /// <summary>Gets or sets the Name field. Mapped on target field 'Name'. </summary> [Column(Name="Name", Storage="_name", CanBeNull=false, DbType="nvarchar(50) NOT NULL")] public System.String Name { get { return _name; } set { if((_name != value)) { OnNameChanging(value); SendPropertyChanging("Name"); _name = value; SendPropertyChanged("Name"); OnNameChanged(); } } } /// <summary>Represents the navigator which is mapped onto the association 'ProductInventory.Location - Location.ProductInventories (m:1)'</summary> [Association(Name="ProductInventory_Location1bf37855d80e4df3a35fea08034a9603", Storage="_productInventories", OtherKey="LocationId")] public EntitySet<ProductInventory> ProductInventories { get { return this._productInventories; } set { this._productInventories.Assign(value); } } /// <summary>Represents the navigator which is mapped onto the association 'WorkOrderRouting.Location - Location.WorkOrderRoutings (m:1)'</summary> [Association(Name="WorkOrderRouting_Location5ed5815792214945a02be8f88a1b7223", Storage="_workOrderRoutings", OtherKey="LocationId")] public EntitySet<WorkOrderRouting> WorkOrderRoutings { get { return this._workOrderRoutings; } set { this._workOrderRoutings.Assign(value); } } #endregion } } #pragma warning restore 0649
36.554545
204
0.72283
[ "MIT" ]
FransBouma/RawDataAccessBencher
L2S/DAL/EntityClasses/Location.cs
8,044
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 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 System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.GlobalAccelerator.Model { /// <summary> /// This is the response object from the DescribeCustomRoutingAccelerator operation. /// </summary> public partial class DescribeCustomRoutingAcceleratorResponse : AmazonWebServiceResponse { private CustomRoutingAccelerator _accelerator; /// <summary> /// Gets and sets the property Accelerator. /// <para> /// The description of the custom routing accelerator. /// </para> /// </summary> public CustomRoutingAccelerator Accelerator { get { return this._accelerator; } set { this._accelerator = value; } } // Check to see if Accelerator property is set internal bool IsSetAccelerator() { return this._accelerator != null; } } }
31.701754
116
0.659103
[ "Apache-2.0" ]
philasmar/aws-sdk-net
sdk/src/Services/GlobalAccelerator/Generated/Model/DescribeCustomRoutingAcceleratorResponse.cs
1,807
C#
using System; using System.Linq; using System.Text; using EventStore.Core.Data; using EventStore.Projections.Core.Messages; using EventStore.Projections.Core.Services.Processing; using NUnit.Framework; using ResolvedEvent = EventStore.Projections.Core.Services.Processing.ResolvedEvent; using EventStore.Projections.Core.Services; namespace EventStore.Projections.Core.Tests.Services.core_projection { [TestFixture] public class when_killing_a_projection_and_an_event_is_received : TestFixtureWithCoreProjectionStarted { private Guid _lastEventIdBeforeKill; protected override void Given() { AllWritesSucceed(); NoOtherStreams(); } protected override void When() { //receive first event _bus.Publish( EventReaderSubscriptionMessage.CommittedEventReceived.Sample( new ResolvedEvent( "/event_category/1", -1, "/event_category/1", -1, false, new TFPos(120, 110), Guid.NewGuid(), "handle_this_type", false, "data1", "metadata"), _subscriptionId, 0)); //receive second event _lastEventIdBeforeKill = Guid.NewGuid(); _bus.Publish( EventReaderSubscriptionMessage.CommittedEventReceived.Sample( new ResolvedEvent( "/event_category/1", -1, "/event_category/1", -1, false, new TFPos(140, 130), _lastEventIdBeforeKill, "handle_this_type", false, "data2", "metadata"), _subscriptionId, 1)); //kill the projection _coreProjection.Kill(); //receive third event _bus.Publish( EventReaderSubscriptionMessage.CommittedEventReceived.Sample( new ResolvedEvent( "/event_category/1", -1, "/event_category/1", -1, false, new TFPos(160, 150), Guid.NewGuid(), "handle_this_type", false, "data3", "metadata"), _subscriptionId, 2)); } [Test] public void event_received_after_kill_is_not_processed() { Assert.AreEqual(2, _stateHandler._eventsProcessed); Assert.AreEqual(_lastEventIdBeforeKill, _stateHandler._lastProcessedEventId); Assert.AreEqual("data2", _stateHandler._lastProcessedData); } } }
38.52459
123
0.641702
[ "Apache-2.0", "CC0-1.0" ]
BertschiAG/EventStore
src/EventStore.Projections.Core.Tests/Services/core_projection/when_killing_a_projection_and_an_event_is_received.cs
2,350
C#
using Atelie.Cadastro.Unidades; using System; using System.Threading.Tasks; using System.Transactions; namespace Atelie.Cadastro.Materiais.Componentes { public class ServicoDeCadastroDeComponentes : ICadastroDeComponentes { private readonly IUnitOfWork unitOfWork; private readonly IRepositorioDeComponentes repositorioDeComponentes; private readonly RepositorioDeUnidadesDeMedidas repositorioDeUnidadesDeMedidas; public ServicoDeCadastroDeComponentes( IUnitOfWork unitOfWork, IRepositorioDeComponentes repositorioDeComponentes, RepositorioDeUnidadesDeMedidas repositorioDeUnidadesDeMedidas ) { this.unitOfWork = unitOfWork; this.repositorioDeComponentes = repositorioDeComponentes; this.repositorioDeUnidadesDeMedidas = repositorioDeUnidadesDeMedidas; } public async Task<IRespostaDeCadastroDeComponente> CadastraComponente(ISolicitacaoDeCadastroDeComponente solicitacao) { await unitOfWork.BeginTransaction(); try { Componente componentePai; if (solicitacao.ComponentePaiId.HasValue) { componentePai = await repositorioDeComponentes.ObtemComponente(solicitacao.ComponentePaiId.Value); } else { componentePai = null; } var unidadeDeMedida = await repositorioDeUnidadesDeMedidas.ObtemUnidadeDeMedida(solicitacao.UnidadePadraoSigla); var componente = new Componente( solicitacao.Id, solicitacao.Nome, componentePai, unidadeDeMedida ); // await repositorioDeComponentes.Add(componente); // await unitOfWork.Commit(); // return new RespostaDeCadastroDeComponente { Id = solicitacao.Id, }; } catch (Exception e) { await unitOfWork.Rollback(); throw; } } public async Task<IRespostaDeCadastroDeComponente> AtualizaComponente(int componenteId, ISolicitacaoDeCadastroDeComponente solicitacao) { await unitOfWork.BeginTransaction(); try { var componente = await repositorioDeComponentes.ObtemComponente(componenteId); // Componente componentePai; if (solicitacao.ComponentePaiId.HasValue) { componentePai = await repositorioDeComponentes.ObtemComponente(solicitacao.ComponentePaiId.Value); } else { componentePai = null; } var unidadeDeMedida = await repositorioDeUnidadesDeMedidas.ObtemUnidadeDeMedida(solicitacao.UnidadePadraoSigla); // componente.Id = solicitacao.Id; componente.Nome = solicitacao.Nome; componente.ComponentePai = componentePai; componente.UnidadePadrao = unidadeDeMedida; // await repositorioDeComponentes.Update(componente); // await unitOfWork.Commit(); // return new RespostaDeCadastroDeComponente { Id = componenteId, }; } catch (Exception e) { await unitOfWork.Rollback(); throw; } } public async Task ExcluiComponente(int componenteId) { await unitOfWork.BeginTransaction(); try { var componente = await repositorioDeComponentes.ObtemComponente(componenteId); // await repositorioDeComponentes.Remove(componente); // await unitOfWork.Commit(); } catch (Exception e) { await unitOfWork.Rollback(); throw; } } } }
27.490566
143
0.542896
[ "MIT" ]
mardsystems/atelie
src/Atelie.ApplicationModel/Cadastro/Materiais/Componentes/ServicoDeCadastroDeComponentes.cs
4,373
C#
#region Fireball License // Copyright (C) 2005 Sebastian Faltoni sebastian{at}dotnetfireball{dot}net // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #endregion #region Original License // ***************************************************************************** // // Copyright 2004, Weifen Luo // All rights reserved. The software and associated documentation // supplied hereunder are the proprietary information of Weifen Luo // and are supplied subject to licence terms. // // WinFormsUI Library Version 1.0 // ***************************************************************************** #endregion using System; using System.Drawing; using System.Windows.Forms; using System.ComponentModel; using System.ComponentModel.Design; using System.Runtime.InteropServices; namespace Fireball.Docking { // This class comes from Jacob Slusser's MdiClientController class. // It has been modified to the coding standards. [ToolboxBitmap(typeof(MdiClientController), "Resources.MdiClientController.bmp")] internal class MdiClientController : NativeWindow, IComponent, IDisposable { private bool m_autoScroll = true; private Color m_backColor = SystemColors.AppWorkspace; private BorderStyle m_borderStyle = BorderStyle.Fixed3D; private MdiClient m_mdiClient = null; private Image m_image = null; private ContentAlignment m_imageAlign = ContentAlignment.MiddleCenter; private Form m_parentForm = null; private ISite m_site = null; private bool m_stretchImage = false; public MdiClientController() : this(null) { } public MdiClientController(Form parentForm) { ParentForm = parentForm; } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if(disposing) { lock(this) { if(Site != null && Site.Container != null) Site.Container.Remove(this); if(Disposed != null) Disposed(this, EventArgs.Empty); } } } [DefaultValue(true), Category("Layout")] [LocalizedDescription("MdiClientController.AutoScroll.Description")] public bool AutoScroll { get { return m_autoScroll; } set { // By default the MdiClient control scrolls. It can appear though that // there are no scrollbars by turning them off when the non-client // area is calculated. I decided to expose this method following // the .NET vernacular of an AutoScroll property. m_autoScroll = value; if(MdiClient != null) UpdateStyles(); } } [DefaultValue(typeof(Color), "AppWorkspace")] [Category("Appearance")] [LocalizedDescription("MdiClientController.BackColor.Description")] public Color BackColor { // Use the BackColor property of the MdiClient control. This is one of // the few properties in the MdiClient class that actually works. get { if(MdiClient != null) return MdiClient.BackColor; return m_backColor; } set { m_backColor = value; if(MdiClient != null) MdiClient.BackColor = value; } } [DefaultValue(BorderStyle.Fixed3D)] [Category("Appearance")] [LocalizedDescription("MdiClientController.BorderStyle.Description")] public BorderStyle BorderStyle { get { return m_borderStyle; } set { // Error-check the enum. if(!Enum.IsDefined(typeof(BorderStyle), value)) throw new InvalidEnumArgumentException(); m_borderStyle = value; if(MdiClient == null) return; // This property can actually be visible in design-mode, // but to keep it consistent with the others, // prevent this from being show at design-time. if(Site != null && Site.DesignMode) return; // There is no BorderStyle property exposed by the MdiClient class, // but this can be controlled by Win32 functions. A Win32 ExStyle // of WS_EX_CLIENTEDGE is equivalent to a Fixed3D border and a // Style of WS_BORDER is equivalent to a FixedSingle border. // This code is inspired Jason Dori's article: // "Adding designable borders to user controls". // http://www.codeproject.com/cs/miscctrl/CsAddingBorders.asp // Get styles using Win32 calls int style = User32.GetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_STYLE); int exStyle = User32.GetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_EXSTYLE); // Add or remove style flags as necessary. switch(m_borderStyle) { case BorderStyle.Fixed3D: exStyle |= (int)Win32.WindowExStyles.WS_EX_CLIENTEDGE; style &= ~((int)Win32.WindowStyles.WS_BORDER); break; case BorderStyle.FixedSingle: exStyle &= ~((int)Win32.WindowExStyles.WS_EX_CLIENTEDGE); style |= (int)Win32.WindowStyles.WS_BORDER; break; case BorderStyle.None: style &= ~((int)Win32.WindowStyles.WS_BORDER); exStyle &= ~((int)Win32.WindowExStyles.WS_EX_CLIENTEDGE); break; } // Set the styles using Win32 calls User32.SetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_STYLE, style); User32.SetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_EXSTYLE, exStyle); // Cause an update of the non-client area. UpdateStyles(); } } [Browsable(false)] public MdiClient MdiClient { get { return m_mdiClient; } } [Browsable(false)] public new IntPtr Handle { // Hide this property during design-time. get { return base.Handle; } } [DefaultValue(null)] [Category("Appearance")] [LocalizedDescription("MdiClientController.Image.Description")] public Image Image { get { return m_image; } set { m_image = value; if(MdiClient != null) MdiClient.Invalidate(); } } [DefaultValue(ContentAlignment.MiddleCenter)] [Category("Appearance")] [LocalizedDescription("MdiClientController.ImageAlign.Description")] public ContentAlignment ImageAlign { get { return m_imageAlign; } set { // Error-check the enum. if(!Enum.IsDefined(typeof(ContentAlignment), value)) throw new InvalidEnumArgumentException(); m_imageAlign = value; if(MdiClient != null) MdiClient.Invalidate(); } } [Browsable(false)] public Form ParentForm { get { return m_parentForm; } set { // If the ParentForm has previously been set, // unwire events connected to the old parent. if(m_parentForm != null) { m_parentForm.HandleCreated -= new EventHandler(ParentFormHandleCreated); m_parentForm.MdiChildActivate -= new EventHandler(ParentFormMdiChildActivate); } m_parentForm = value; if(m_parentForm == null) return; // If the parent form has not been created yet, // wait to initialize the MDI client until it is. if(m_parentForm.IsHandleCreated) { InitializeMdiClient(); RefreshProperties(); } else m_parentForm.HandleCreated += new EventHandler(ParentFormHandleCreated); m_parentForm.MdiChildActivate += new EventHandler(ParentFormMdiChildActivate); } } [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ISite Site { get { return m_site; } set { m_site = value; if(m_site == null) return; // If the component is dropped onto a form during design-time, // set the ParentForm property. IDesignerHost host = (value.GetService(typeof(IDesignerHost)) as IDesignerHost); if(host != null) { Form parent = host.RootComponent as Form; if(parent != null) ParentForm = parent; } } } [Category("Appearance"), DefaultValue(false)] [LocalizedDescription("MdiClientController.StretchImage.Description")] public bool StretchImage { get { return m_stretchImage; } set { m_stretchImage = value; if(MdiClient != null) MdiClient.Invalidate(); } } public void RenewMdiClient() { // Reinitialize the MdiClient and its properties. InitializeMdiClient(); RefreshProperties(); } [Browsable(false)] public event EventHandler Disposed; [Browsable(false)] public event EventHandler HandleAssigned; [Browsable(false)] public event EventHandler MdiChildActivate; [Browsable(false)] public event LayoutEventHandler Layout; protected virtual void OnHandleAssigned(EventArgs e) { // Raise the HandleAssigned event. if(HandleAssigned != null) HandleAssigned(this, e); } protected virtual void OnMdiChildActivate(EventArgs e) { // Raise the MdiChildActivate event if (MdiChildActivate != null) MdiChildActivate(this, e); } protected virtual void OnLayout(LayoutEventArgs e) { // Raise the Layout event if (Layout != null) Layout(this, e); } [Category("Appearance")] [LocalizedDescription("MdiClientController.Paint.Description")] public event PaintEventHandler Paint; protected virtual void OnPaint(PaintEventArgs e) { // Raise the Paint event. if(Paint != null) Paint(this, e); } protected override void WndProc(ref Message m) { switch(m.Msg) { //Do all painting in WM_PAINT to reduce flicker. case (int)Win32.Msgs.WM_ERASEBKGND: return; case (int)Win32.Msgs.WM_PAINT: // This code is influenced by Steve McMahon's article: // "Painting in the MDI Client Area". // http://vbaccelerator.com/article.asp?id=4306 // Use Win32 to get a Graphics object. Win32.PAINTSTRUCT paintStruct = new Win32.PAINTSTRUCT(); IntPtr screenHdc = User32.BeginPaint(m.HWnd, ref paintStruct); using(Graphics screenGraphics = Graphics.FromHdc(screenHdc)) { // Get the area to be updated. Rectangle clipRect = paintStruct.rcPaint; // Double-buffer by painting everything to an image and // then drawing the image. int width = (MdiClient.ClientRectangle.Width > 0 ? MdiClient.ClientRectangle.Width : 0); int height = (MdiClient.ClientRectangle.Height > 0 ? MdiClient.ClientRectangle.Height : 0); if (width > 0 && height > 0) { using(Image i = new Bitmap(width, height)) { using(Graphics g = Graphics.FromImage(i)) { // This code comes from J Young's article: // "Generating missing Paint event for TreeView and ListView". // http://www.codeproject.com/cs/miscctrl/genmissingpaintevent.asp // Draw base graphics and raise the base Paint event. IntPtr hdc = g.GetHdc(); Message printClientMessage = Message.Create(m.HWnd, (int)Win32.Msgs.WM_PRINTCLIENT, hdc, IntPtr.Zero); DefWndProc(ref printClientMessage); g.ReleaseHdc(hdc); // Draw the image here. if(Image != null) DrawImage(g, clipRect); // Call our OnPaint here to draw graphics over the // original and raise our Paint event. OnPaint(new PaintEventArgs(g, clipRect)); } // Now draw all the graphics at once. screenGraphics.DrawImage(i, MdiClient.ClientRectangle); } } } User32.EndPaint(m.HWnd, ref paintStruct); return; case (int)Win32.Msgs.WM_SIZE: // Repaint on every resize. MdiClient.Invalidate(); break; case (int)Win32.Msgs.WM_NCCALCSIZE: // If AutoScroll is set to false, hide the scrollbars when the control // calculates its non-client area. if(!AutoScroll) User32.ShowScrollBar(m.HWnd, (int)Win32.ScrollBars.SB_BOTH, 0 /*false*/); break; } base.WndProc(ref m); } private void ParentFormHandleCreated(object sender, EventArgs e) { // The form has been created, unwire the event, and initialize the MdiClient. this.m_parentForm.HandleCreated -= new EventHandler(ParentFormHandleCreated); InitializeMdiClient(); RefreshProperties(); } private void ParentFormMdiChildActivate(object sender, EventArgs e) { OnMdiChildActivate(e); } private void MdiClientLayout(object sender, LayoutEventArgs e) { OnLayout(e); } private void MdiClientHandleDestroyed(object sender, EventArgs e) { // If the MdiClient handle has been released, drop the reference and // release the handle. if(m_mdiClient != null) { m_mdiClient.HandleDestroyed -= new EventHandler(MdiClientHandleDestroyed); m_mdiClient = null; } ReleaseHandle(); } private void InitializeMdiClient() { // If the mdiClient has previously been set, unwire events connected // to the old MDI. if(MdiClient != null) { MdiClient.HandleDestroyed -= new EventHandler(MdiClientHandleDestroyed); MdiClient.Layout -= new LayoutEventHandler(MdiClientLayout); } if(ParentForm == null) return; // Get the MdiClient from the parent form. foreach (Control control in ParentForm.Controls) { // If the form is an MDI container, it will contain an MdiClient control // just as it would any other control. m_mdiClient = control as MdiClient; if(m_mdiClient == null) continue; // Assign the MdiClient Handle to the NativeWindow. ReleaseHandle(); AssignHandle(MdiClient.Handle); // Raise the HandleAssigned event. OnHandleAssigned(EventArgs.Empty); // Monitor the MdiClient for when its handle is destroyed. MdiClient.HandleDestroyed += new EventHandler(MdiClientHandleDestroyed); MdiClient.Layout += new LayoutEventHandler(MdiClientLayout); break; } } private void RefreshProperties() { // Refresh all the properties BackColor = m_backColor; BorderStyle = m_borderStyle; AutoScroll = m_autoScroll; Image = m_image; ImageAlign = m_imageAlign; StretchImage = m_stretchImage; } private void DrawImage(Graphics g, Rectangle clipRect) { // Paint the background image. if(StretchImage) g.DrawImage(this.Image, MdiClient.ClientRectangle); else { // Calculate the location of the image. (Note: this logic could be calculated during sizing // instead of during painting to improve performance.) Point pt = Point.Empty; switch(ImageAlign) { case ContentAlignment.TopLeft: pt = new Point(0, 0); break; case ContentAlignment.TopCenter: pt = new Point((MdiClient.ClientRectangle.Width / 2) - (Image.Width / 2), 0); break; case ContentAlignment.TopRight: pt = new Point(MdiClient.ClientRectangle.Width - Image.Width, 0); break; case ContentAlignment.MiddleLeft: pt = new Point(0, (MdiClient.ClientRectangle.Height / 2) - (Image.Height / 2)); break; case ContentAlignment.MiddleCenter: pt = new Point((MdiClient.ClientRectangle.Width / 2) - (Image.Width / 2), (MdiClient.ClientRectangle.Height / 2) - (Image.Height / 2)); break; case ContentAlignment.MiddleRight: pt = new Point(MdiClient.ClientRectangle.Width - Image.Width, (MdiClient.ClientRectangle.Height / 2) - (Image.Height / 2)); break; case ContentAlignment.BottomLeft: pt = new Point(0, MdiClient.ClientRectangle.Height - Image.Height); break; case ContentAlignment.BottomCenter: pt = new Point((MdiClient.ClientRectangle.Width / 2) - (Image.Width / 2), MdiClient.ClientRectangle.Height - Image.Height); break; case ContentAlignment.BottomRight: pt = new Point(MdiClient.ClientRectangle.Width - Image.Width, MdiClient.ClientRectangle.Height - Image.Height); break; } // Paint the image with the calculated coordinates and image size. g.DrawImage(Image, new Rectangle(pt, Image.Size)); } } private void UpdateStyles() { // To show style changes, the non-client area must be repainted. Using the // control's Invalidate method does not affect the non-client area. // Instead use a Win32 call to signal the style has changed. User32.SetWindowPos(MdiClient.Handle, IntPtr.Zero, 0, 0, 0, 0, Win32.FlagsSetWindowPos.SWP_NOACTIVATE | Win32.FlagsSetWindowPos.SWP_NOMOVE | Win32.FlagsSetWindowPos.SWP_NOSIZE | Win32.FlagsSetWindowPos.SWP_NOZORDER | Win32.FlagsSetWindowPos.SWP_NOOWNERZORDER | Win32.FlagsSetWindowPos.SWP_FRAMECHANGED); } } }
29.247405
113
0.68394
[ "MIT" ]
RivenZoo/FullSource
Jx3Full/Source/Source/Tools/GameDesignerEditor/Controls/luaEditor/fireball_src/Fireball.Docking/Fireball.Docking/Components/MdiClientController.cs
16,905
C#
using Xunit; using Hiarc.Core.Models.Requests; using System; using Hiarc.Core.Models; using System.Collections.Generic; using System.Text.Json; namespace HiarcIntegrationTest.Tests { public class UserTests : HiarcTestBase { [Fact] public async void UserCRUD() { var u1 = await _hiarc.CreateUser(); var fetchedUser = await _hiarc.GetUser(u1.Key); Assert.Equal(u1, fetchedUser, new EntityComparer()); var newName = "New Name"; var newDescription = "New description"; var updateRequest = new UpdateUserRequest { Name=newName, Description=newDescription }; var updatedUser = await _hiarc.UpdateUser(u1.Key, updateRequest); Assert.Equal(newName, updatedUser.Name); Assert.Equal(newDescription, updatedUser.Description); Assert.True(updatedUser.ModifiedAt > updatedUser.CreatedAt); updateRequest = new UpdateUserRequest { Key="new key", Name=newName, Description=newDescription }; await Assert.ThrowsAnyAsync<Exception>(async () => await _hiarc.UpdateUser(u1.Key, updateRequest)); await _hiarc.DeleteUser(u1.Key); await Assert.ThrowsAnyAsync<Exception>(async () => await _hiarc.GetUser(u1.Key)); } [Fact] public async void GetAllUsers() { var count = LARGE_ENTITY_COUNT; for(var i=0; i<count; i++) { await _hiarc.CreateUser(); } var allUsers = await _hiarc.GetAllUsers(); Assert.Equal(count, allUsers.Count); } [Fact] public async void GetCurrentUser() { var u1 = await _hiarc.CreateUser(); var fetchedUser = await _hiarc.GetCurrentUser(asUserKey: u1.Key); Assert.Equal(u1.Key, fetchedUser.Key); var userCredentials = await _hiarc.CreateUserCredentials(u1.Key); fetchedUser = await _hiarc.GetCurrentUser(u1.Key, bearerToken: userCredentials.BearerToken); Assert.Equal(u1, fetchedUser, new EntityComparer()); } [Fact] public async void GetGroupsForUser() { var u1 = await _hiarc.CreateUser(); var g1 = await _hiarc.CreateGroup(); var g2 = await _hiarc.CreateGroup(); var g3 = await _hiarc.CreateGroup(); await _hiarc.AddUserToGroup(g1.Key, u1.Key); await _hiarc.AddUserToGroup(g2.Key, u1.Key); var groups = await _hiarc.GetGroupsForUser(u1.Key); Assert.Equal(2, groups.Count); Assert.Contains(g1, groups, new EntityComparer()); Assert.Contains(g2, groups, new EntityComparer()); Assert.DoesNotContain(g3, groups, new EntityComparer()); } [Fact] public async void GetGroupsForCurrentUser() { var u1 = await _hiarc.CreateUser(); var g1 = await _hiarc.CreateGroup(); var g2 = await _hiarc.CreateGroup(); var g3 = await _hiarc.CreateGroup(); await _hiarc.AddUserToGroup(g1.Key, u1.Key); await _hiarc.AddUserToGroup(g2.Key, u1.Key); var userCredentials = await _hiarc.CreateUserCredentials(u1.Key); var groups = await _hiarc.GetGroupsForCurrentUser(bearerToken: userCredentials.BearerToken); Assert.Equal(2, groups.Count); Assert.Contains(g1, groups, new EntityComparer()); Assert.Contains(g2, groups, new EntityComparer()); Assert.DoesNotContain(g3, groups, new EntityComparer()); groups = await _hiarc.GetGroupsForCurrentUser(asUserKey: u1.Key); Assert.Equal(2, groups.Count); Assert.Contains(g1, groups, new EntityComparer()); Assert.Contains(g2, groups, new EntityComparer()); Assert.DoesNotContain(g3, groups, new EntityComparer()); } [Fact] public async void CreateUserWithMetadata() { var md = TestMetadata; var u1 = await _hiarc.CreateUser(md); var fetchedUser = await _hiarc.GetUser(u1.Key); Assert.Equal(u1, fetchedUser, new EntityComparer()); AssertMetadata(md, fetchedUser.Metadata); } [Fact] public async void UpdateMetadata() { var md = TestMetadata; var u1 = await _hiarc.CreateUser(md); var updatedMD = new Dictionary<string, object> { { "department", "support" }, { "quotaCarrying", false }, { "targetRate", 7.271 }, { "level", 2 }, { "startDate", DateTime.Parse("2020-02-25T22:33:50.134Z").ToUniversalTime() } }; var request = new UpdateUserRequest { Metadata = updatedMD }; var updatedUser = await _hiarc.UpdateUser(u1.Key, request); AssertMetadata(updatedMD, updatedUser.Metadata); } [Fact] public async void NullOutMetadata() { var md = TestMetadata; var u1 = await _hiarc.CreateUser(md); var updatedMD = new Dictionary<string, object> { { "department", null }, { "quotaCarrying", null } }; var request = new UpdateUserRequest { Metadata = updatedMD }; var updatedUser = await _hiarc.UpdateUser(u1.Key, request); Assert.Equal(3, updatedUser.Metadata.Keys.Count); updatedMD = new Dictionary<string, object> { { "targetRate", null }, { "level", null }, { "startDate", null } }; request = new UpdateUserRequest { Metadata = updatedMD }; updatedUser = await _hiarc.UpdateUser(u1.Key, request); Assert.Null(updatedUser.Metadata); } [Fact] public async void FindUsers() { var md = TestMetadata; var u1 = await _hiarc.CreateUser(md); md["quotaCarrying"] = false; await _hiarc.CreateUser(md); await _hiarc.CreateUser(); var query = new List<Dictionary<string, object>> { new Dictionary<string, object> { { "prop", "department" }, { "op", "starts with" }, { "value", "sal" } }, new Dictionary<string, object> { { "bool", "and" } }, new Dictionary<string, object> { { "parens", "(" } }, new Dictionary<string, object> { { "prop", "targetRate" }, { "op", ">=" }, { "value", 4.22 } }, new Dictionary<string, object> { { "bool", "and" } }, new Dictionary<string, object> { { "prop", "quotaCarrying" }, { "op", "=" }, { "value", true } }, new Dictionary<string, object> { { "parens", ")" } } }; var request = new FindUsersRequest { Query = query }; var foundUsers = await _hiarc.FindUsers(request); Assert.Single(foundUsers); Assert.Equal(u1, foundUsers[0], new EntityComparer()); } } }
35.090517
112
0.499202
[ "MIT" ]
cburnette/hiarc
HiarcIntegrationTests/Tests/UserTests.cs
8,141
C#
using System; using System.Collections.Generic; using System.Linq; namespace AdventOfCode2018.Day15 { internal class Unit { private List<Unit> units; public char Type { get; set; } public int X { get; set; } public int Y { get; set; } public int Hitpoints { get; set; } public int Attackpower { get; set; } public bool Dead { get; internal set; } public Unit(int x, int y, char t, ref System.Collections.Generic.List<Unit> units, int attackPower) { this.units = units; X = x; Y = y; Type= t; Hitpoints = 200; Attackpower = attackPower; } internal int Distance(Unit otherUnit) { return Math.Abs(otherUnit.X - X) + Math.Abs(otherUnit.Y - Y); } internal Coordinates GetCoordinates() { return new Coordinates() { X = this.X, Y = this.Y }; } internal void Step(Coordinates newPosition) { X = newPosition.X; Y = newPosition.Y; } internal bool IsInAttachRange() { return units.Any(e => !e.Type.Equals(this.Type) && !e.Dead && e.Distance(this) <= 1); } internal IEnumerable<Unit> GetEnemies() { return units.Where(u => !u.Dead).Where(u => !u.Type.Equals(this.Type)); } internal IEnumerable<Unit> GetEnemiesInRange() { return GetEnemies().Where(e => e.Distance(this) == 1); } } }
27.086207
107
0.525143
[ "MIT" ]
retos/Advent-of-Code
AdventOfCode2018/Day15/Unit.cs
1,573
C#
#region Licenses /*MIT License Copyright(c) 2020 Robert Garrison 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.*/ #endregion #region Using Statements using System; using System.Collections.Generic; using System.Data; using System.Data.Common; #endregion namespace ADONetHelper.Core { /// <summary> /// /Contract class that defines syncrhonous operations against a database /// </summary> public interface ISqlExecutorSync { #region Data Retrieval /// <summary> /// Gets an instance of <see cref="DataSet"/> /// </summary> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="connection">An instance of <see cref="DbConnection"/></param> /// <param name="query">SQL query to use to build a <see cref="DataSet"/></param> /// <returns>Returns an instance of <see cref="DataSet"/> based on the <paramref name="query"/> passed into the routine</returns> DataSet GetDataSet(CommandType queryCommandType, string query, DbConnection connection); /// <summary> /// Gets an instance of <see cref="DataSet"/> /// </summary> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="query">SQL query to use to build a <see cref="DataSet"/></param> /// <returns>Returns an instance of <see cref="DataSet"/> based on the <paramref name="query"/> passed into the routine</returns> DataSet GetDataSet(CommandType queryCommandType, string query); /// <summary> /// Gets an instance of <see cref="DataTable"/> /// </summary> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="query">SQL query to use to build a result set</param> /// <returns>Returns an instance of <see cref="DataTable"/></returns> DataTable GetDataTable(CommandType queryCommandType, string query); /// <summary> /// Gets an instance of <see cref="DataTable"/> /// </summary> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="connection">An instance of <see cref="DbConnection"/></param> /// <param name="query">SQL query to use to build a result set</param> /// <returns>Returns an instance of <see cref="DataTable"/></returns> DataTable GetDataTable(CommandType queryCommandType, string query, DbConnection connection); /// <summary> /// Gets a single instance of <typeparamref name="T"/> based on the <paramref name="query"/> passed into the routine /// </summary> /// <typeparam name="T">An instance of the type caller wants create from the query passed into procedure</typeparam> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <returns>Returns an instance of the <typeparamref name="T"/> based on the fields in the passed in query. Returns the default value for the type if a record is not found</returns> T GetDataObject<T>(CommandType queryCommandType, string query) where T : class; /// <summary> /// Gets a single instance of <typeparamref name="T"/> based on the <paramref name="query"/> passed into the routine /// </summary> /// <typeparam name="T">An instance of the type caller wants create from the query passed into procedure</typeparam> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="connectionString">The connection string used to query a data store</param> /// <returns>Returns an instance of the <typeparamref name="T"/> based on the fields in the passed in query. Returns the default value for the type if a record is not found</returns> T GetDataObject<T>(CommandType queryCommandType, string query, string connectionString) where T : class; /// <summary> /// Gets a single instance of <typeparamref name="T"/> based on the <paramref name="query"/> passed into the routine /// </summary> /// <typeparam name="T">An instance of the type caller wants create from the query passed into procedure</typeparam> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="connection">An instance of a DbConnection object to use to query a datastore</param> /// <returns>Returns an instance of the <typeparamref name="T"/> based on the fields in the passed in query. Returns the default value for the type if a record is not found</returns> T GetDataObject<T>(CommandType queryCommandType, string query, DbConnection connection) where T : class; /// <summary> /// Gets a <see cref="List{T}"/> of the type parameter object that creates an object based on the query passed into the routine /// </summary> /// <typeparam name="T">An instance of the type caller wants created from the query passed into procedure</typeparam> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <returns>Returns a <see cref="List{T}"/> based on the results of the passed in <paramref name="query"/></returns> List<T> GetDataObjectList<T>(CommandType queryCommandType, string query); /// <summary> /// Gets a <see cref="List{T}"/> of the type parameter object that creates an object based on the query passed into the routine /// </summary> /// <typeparam name="T">An instance of the type caller wants created from the query passed into procedure</typeparam> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="connectionString">The connection string used to query a data store</param> /// <returns>Returns a <see cref="List{T}"/> based on the results of the passed in <paramref name="query"/></returns> List<T> GetDataObjectList<T>(CommandType queryCommandType, string query, string connectionString); /// <summary> /// Gets a <see cref="List{T}"/> of the type parameter object that creates an object based on the query passed into the routine /// </summary> /// <typeparam name="T">An instance of the type caller wants created from the query passed into procedure</typeparam> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="connection">An instance of a <see cref="DbConnection"/> object to use to query a datastore</param> /// <returns>Returns a <see cref="List{T}"/> based on the results of the passed in <paramref name="query"/></returns> List<T> GetDataObjectList<T>(CommandType queryCommandType, string query, DbConnection connection); /// <summary> /// Gets a <see cref="IEnumerable{T}"/> of the type parameter object that creates an object based on the query passed into the routine /// </summary> /// <typeparam name="T">An instance of the type caller wants create from the query passed into procedure</typeparam> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <returns>Returns a <see cref="IEnumerable{T}"/> based on the results of the passedin <paramref name="query"/></returns> IEnumerable<T> GetDataObjectEnumerable<T>(CommandType queryCommandType, string query); /// <summary> /// Gets a <see cref="IEnumerable{T}"/> of the type parameter object that creates an object based on the query passed into the routine /// </summary> /// <typeparam name="T">An instance of the type caller wants create from the query passed into procedure</typeparam> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="connectionString">The connection string used to query a data store</param> /// <returns>Returns a <see cref="IEnumerable{T}"/> based on the results of the passed in <paramref name="query"/></returns> IEnumerable<T> GetDataObjectEnumerable<T>(CommandType queryCommandType, string query, string connectionString); /// <summary> /// Gets a <see cref="IEnumerable{T}"/> of the type parameter object that creates an object based on the query passed into the routine /// </summary> /// <typeparam name="T">An instance of the type caller wants create from the query passed into procedure</typeparam> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="connection">An instance of a DbConnection object to use to query a datastore</param> /// <returns>Returns a <see cref="IEnumerable{T}"/> based on the results of the passed in <paramref name="query"/></returns> IEnumerable<T> GetDataObjectEnumerable<T>(CommandType queryCommandType, string query, DbConnection connection); /// <summary> /// Utility method for returning a <see cref="DbDataReader"/> /// </summary> /// <param name="transact">An instance of <see cref="DbTransaction"/></param> /// <param name="behavior">Provides a description of the results of the query and its effect on the database. Defaults to <see cref="CommandBehavior.Default"/></param> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <returns>An instance of <see cref="DbDataReader"/></returns> DbDataReader GetDbDataReader(CommandType queryCommandType, string query, CommandBehavior behavior = CommandBehavior.Default, DbTransaction transact = null); /// <summary> /// Utility method for returning a <see cref="DbDataReader"/> /// </summary> /// <param name="transact">An instance of <see cref="DbTransaction"/></param> /// <param name="behavior">Provides a description of the results of the query and its effect on the database. Defaults to <see cref="CommandBehavior.Default"/></param> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="connection">An instance of the DbConnection class</param> /// <returns>An instance of <see cref="DbDataReader"/></returns> DbDataReader GetDbDataReader(CommandType queryCommandType, string query, DbConnection connection, CommandBehavior behavior = CommandBehavior.Default, DbTransaction transact = null); /// <summary> /// Utility method for returning a DataReader object /// </summary> /// <param name="behavior">Provides a description of the results of the query and its effect on the database. Defaults to <see cref="CommandBehavior.Default"/></param> /// <param name="connectionString">The connection string used to query a data store</param> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <returns>An instance of <see cref="DbDataReader"/> object</returns> DbDataReader GetDbDataReader(CommandType queryCommandType, string connectionString, string query, CommandBehavior behavior = CommandBehavior.Default); /// <summary> /// Utility method for acting on a <see cref="DbDataReader"/> /// </summary> /// <param name="act">Action methods that takes in a <see cref="DbDataReader"/></param> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <returns>A <see cref="DbDataReader"/> object, the caller is responsible for handling closing the <see cref="DbDataReader"/>. Once the data reader is closed, the database connection will be closed as well</returns> void GetDbDataReader(CommandType queryCommandType, string query, Action<DbDataReader> act); /// <summary> /// Utility method for returning a scalar value from the database /// </summary> /// <param name="transact">An instance of <see cref="DbTransaction"/></param> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <returns>Returns the value of the first column in the first row returned from the passed in query as an object</returns> object GetScalarValue(CommandType queryCommandType, string query, DbTransaction transact = null); /// <summary> /// Utility method for returning a scalar value from the database /// </summary> /// <param name="connectionString">The connection string used to query a data store</param> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <returns>Returns the value of the first column in the first row as an object</returns> object GetScalarValue(CommandType queryCommandType, string query, string connectionString); /// <summary> /// Utility method for returning a scalar value from the database /// </summary> /// <param name="transact">An instance of <see cref="DbTransaction"/></param> /// <param name="connection">An instanace of the DbConnection object used to query a data store</param> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <returns>Returns the value of the first column in the first row as an object</returns> object GetScalarValue(CommandType queryCommandType, string query, DbConnection connection, DbTransaction transact = null); #endregion #region Data Modification /// <summary> /// Utility method for executing an Ad-Hoc query or stored procedure without a transaction /// </summary> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <returns>Returns the number of rows affected by this query</returns> int ExecuteNonQuery(CommandType queryCommandType, string query); /// <summary> /// Utility method for executing an Ad-Hoc query or stored procedure without a transaction /// </summary> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="connectionString">The connection string used to query a data store</param> /// <returns>Returns the number of rows affected by this query</returns> int ExecuteNonQuery(CommandType queryCommandType, string query, string connectionString); /// <summary> /// Utility method for executing an Ad-Hoc query or stored procedure without a transaction /// </summary> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="connection">An instance of the DbConnection object to use to query a data store</param> /// <returns>Returns the number of rows affected by this query</returns> int ExecuteNonQuery(CommandType queryCommandType, string query, DbConnection connection); /// <summary> /// Utility method for executing batches of queries or stored procedures in a SQL transaction /// </summary> /// <param name="commands">The list of query database parameters that are associated with a query</param> /// <param name="connectionString">The connection string used to query a data store</param> /// <returns>Returns the number of rows affected by all queries passed in</returns> List<int> ExecuteBatchedNonQuery(string connectionString, IEnumerable<SQLQuery> commands); /// <summary> /// Utility method for executing batches of queries or stored procedures in a SQL transaction /// </summary> /// <param name="commands">The list of query database parameters that are associated with a query</param> /// <returns>Returns the number of rows affected by all queries passed in, assuming all are succesful</returns> List<int> ExecuteBatchedNonQuery(IEnumerable<SQLQuery> commands); /// <summary> /// Utility method for executing batches of queries or stored procedures in a SQL transaction /// </summary> /// <param name="commands">The list of query database parameters that are associated with a query</param> /// <param name="connection">An instance of a DbConnection object to use to query a datastore</param> /// <returns>Returns the number of rows affected by all queries passed in, assuming all are succesful</returns> List<int> ExecuteBatchedNonQuery(IEnumerable<SQLQuery> commands, DbConnection connection); /// <summary> /// Utility method for executing batches of queries or stored procedures in a SQL transaction /// </summary> /// <param name="commands">The list of query database parameters that are associated with a query</param> /// <returns>Returns the number of rows affected by all queries passed in, assuming all are succesful</returns> List<int> ExecuteTransactedBatchedNonQuery(IEnumerable<SQLQuery> commands); /// <summary> /// Utility method for executing batches of queries or stored procedures in a SQL transaction /// </summary> /// <param name="connectionString">The connection string used to query a data store</param> /// <param name="commands">The list of query database parameters that are associated with a query</param> /// <returns>Returns the number of rows affected by all queries passed in, assuming all are succesful</returns> List<int> ExecuteTransactedBatchedNonQuery(string connectionString, IEnumerable<SQLQuery> commands); /// <summary> /// Utility method for executing batches of queries or stored procedures in a SQL transaction /// </summary> /// <param name="connection">An instance of a DbConnection object to use to query a datastore</param> /// <param name="commands">The list of query database parameters that are associated with a query</param> /// <returns>Returns the number of rows affected by all queries passed in, assuming all are succesful</returns> List<int> ExecuteTransactedBatchedNonQuery(IEnumerable<SQLQuery> commands, DbConnection connection); /// <summary> /// Utility method for executing batches of queries or stored procedures in a SQL transaction /// </summary> /// <param name="commands">The list of query database parameters that are associated with a query</param> /// <param name="transact">An instance of a DbTransaction class</param> /// <returns>Returns the number of rows affected by all queries passed in, assuming all are succesful</returns> List<int> ExecuteTransactedBatchedNonQuery(IEnumerable<SQLQuery> commands, DbTransaction transact); /// <summary> /// Utility method for executing batches of queries or stored procedures in a SQL transaction /// </summary> /// <param name="commands">The list of query database parameters that are associated with a query</param> /// <param name="connection">An instance of the DbConnection object to use to query a data store</param> /// <param name="transact">An instance of a DbTransaction class</param> /// <returns>Returns the number of rows affected by all queries passed in, assuming all are succesful</returns> List<int> ExecuteTransactedBatchedNonQuery(IEnumerable<SQLQuery> commands, DbConnection connection, DbTransaction transact); /// <summary> /// Utility method for executing a query or stored procedure in a SQL transaction /// </summary> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <returns>Returns the number of rows affected by this query</returns> int ExecuteTransactedNonQuery(CommandType queryCommandType, string query); /// <summary> /// Utility method for executing a query or stored procedure in a SQL transaction /// </summary> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="connectionString">The connection string used to query a data store</param> /// <returns>Returns the number of rows affected by this query</returns> int ExecuteTransactedNonQuery(CommandType queryCommandType, string query, string connectionString); /// <summary> /// Utility method for executing a query or stored procedure in a SQL transaction /// </summary> /// <param name="connection">An instance of a DbConnection object to use to query a datastore</param> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <returns>Returns the number of rows affected by this query</returns> int ExecuteTransactedNonQuery(CommandType queryCommandType, string query, DbConnection connection); /// <summary> /// Utility method for executing a query or stored procedure in a SQL transaction /// </summary> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="transact">An instance of a DbTransaction class</param> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="commitTransaction">Whether or not to commit the transaction that is passed in if succesful</param> /// <returns>Returns the number of rows affected by this query</returns> int ExecuteTransactedNonQuery(CommandType queryCommandType, DbTransaction transact, string query, bool commitTransaction); /// <summary> /// Utility method for executing a query or stored procedure in a SQL transaction /// </summary> /// <param name="queryCommandType">Represents how a command should be interpreted by the data provider</param> /// <param name="transact">An instance of a DbTransaction class</param> /// <param name="connection">An instance of a DbConnection object to use to query a datastore</param> /// <param name="query">The query command text or name of stored procedure to execute against the data store</param> /// <param name="commitTransaction">Whether or not to commit the transaction that is passed in if succesful</param> /// <returns>Returns the number of rows affected by this query</returns> int ExecuteTransactedNonQuery(CommandType queryCommandType, DbConnection connection, DbTransaction transact, string query, bool commitTransaction); #endregion } }
82.01506
226
0.697198
[ "MIT" ]
rgarrison12345/ADONetHelper
ADONetHelper.Core/ISqlExecutorSync.cs
27,231
C#
// *** WARNING: this file was generated by pulumigen. *** // *** 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.Kubernetes.Types.Outputs.Core.V1 { [OutputType] public sealed class TypedLocalObjectReference { /// <summary> /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. /// </summary> public readonly string ApiGroup; /// <summary> /// Kind is the type of resource being referenced /// </summary> public readonly string Kind; /// <summary> /// Name is the name of resource being referenced /// </summary> public readonly string Name; [OutputConstructor] private TypedLocalObjectReference( string apiGroup, string kind, string name) { ApiGroup = apiGroup; Kind = kind; Name = name; } } }
28.930233
203
0.619775
[ "Apache-2.0" ]
Teshel/pulumi-kubernetes
sdk/dotnet/Core/V1/Outputs/TypedLocalObjectReference.cs
1,244
C#
using Umbraco.Web.Mvc; namespace UmbracoUrlHandling.RouteHandler { /// <summary> /// BlogPostRepositoryrouteHandler to handle routes to BlogPostRepository /// </summary> /// <seealso cref="Umbraco.Web.Mvc.UmbracoVirtualNodeByIdRouteHandler" /> public class BlogRepositoryRouteHandler : UmbracoVirtualNodeByIdRouteHandler { /// <summary> /// Initializes a new instance of the <see cref="BlogRepositoryRouteHandler"/> class. /// </summary> /// <param name="realNodeId">The real node identifier.</param> public BlogRepositoryRouteHandler(int realNodeId) : base(realNodeId) { } } }
34.894737
93
0.675716
[ "MIT" ]
Mantus667/UmbracoUrlHandling
src/UmbracoUrlHandling/RouteHandler/BlogRepositoryRouteHandler.cs
665
C#
// <auto-generated> // ReSharper disable ConvertPropertyToExpressionBody // ReSharper disable DoNotCallOverridableMethodsInConstructor // ReSharper disable InconsistentNaming // ReSharper disable PartialMethodWithSinglePart // ReSharper disable PartialTypeWithSinglePart // ReSharper disable RedundantNameQualifier // ReSharper disable RedundantOverridenMember // ReSharper disable UseNameofExpression // TargetFrameworkVersion = 4.7 #pragma warning disable 1591 // Ignore "Missing XML Comment" warning namespace Ed_Fi.Credential.Domain.Ods { // AgencySchool [System.CodeDom.Compiler.GeneratedCode("EF.Reverse.POCO.Generator", "2.32.0.0")] public partial class AgencySchool { public int EducationOrganizationId { get; set; } // EducationOrganizationId (Primary key) public int LocalEducationAgencyId { get; set; } // LocalEducationAgencyId (Primary key) public string NameOfInstitution { get; set; } // NameOfInstitution (Primary key) (length: 75) public bool IsChoice { get; set; } // IsChoice (Primary key) public string SchoolCode { get; set; } // SchoolCode (length: 60) public string City { get; set; } // City (length: 30) public short SchoolYear { get; set; } // SchoolYear (Primary key) public string SchoolAgencyType { get; set; } // SchoolAgencyType (length: 50) public int SchoolType { get; set; } // SchoolType (Primary key) public string SchoolTypeDescription { get; set; } // SchoolTypeDescription (Primary key) (length: 1024) public string SchoolTypeCode { get; set; } // SchoolTypeCode (Primary key) (length: 50) public AgencySchool() { InitializePartial(); } partial void InitializePartial(); } } // </auto-generated>
41.790698
111
0.702838
[ "Apache-2.0" ]
Ed-Fi-Exchange-OSS/Credential-Manager
Ed-Fi.Credential.Domain.Ods/AgencySchool.cs
1,797
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("YouNoob.Models")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("YouNoob.Models")] [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("3f16043c-3c75-4e6f-9a84-4cfbd485f16a")] // 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")]
38.837838
85
0.725818
[ "MIT" ]
ASP-MVC/Video-System
YouNoob/YouNoob.Models/Properties/AssemblyInfo.cs
1,440
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Duality; using Duality.Drawing; namespace Soulstone.Duality.Plugins.Cupboard.Resources { public class ChineseCheckersBoard : GridBoardDesign { public override void RestoreClassic() { base.RestoreClassic(); Size = new Point2(15, 15); DefaultTerrain = 0; for (int j = 0; j < 5; j++) for (int i = -4 + j; i < 5; i++) Terrain.Add(new Point2(i, j), 1); for (int j = 0; j < 4; j++) for (int i = 0; i < 8 - j; i++) Terrain.Add(new Point2(-4 + i, -1 - j), 1); for (int j = 0; j < 4; j++) for (int i = 0; i < j + 1; i++) { var a = new Point2(i - 4, -8 + j); var b = new Point2(4 - i, -1 - j); var c = new Point2(5 + i, 1 + j); var d = new Point2(4 - i, 8 - j); var e = new Point2(-4 + i, 1 + j); var f = new Point2(-5 - i, -1 - j); AddStartLocation(a, 0); AddStartLocation(b, 1); AddStartLocation(c, 2); AddStartLocation(d, 3); AddStartLocation(e, 4); AddStartLocation(f, 5); Terrain.Add(a, 1); Terrain.Add(b, 1); Terrain.Add(c, 1); Terrain.Add(d, 1); Terrain.Add(e, 1); Terrain.Add(f, 1); } } private void AddStartLocation(Point2 pos, int pawnType) { StartingGridLocations.Add(new GridStartingLocation { PawnType = pawnType, Pos = pos }); } } }
29.984615
63
0.418676
[ "MIT" ]
Seti-0/games-cupboard
GamesCupboard/Source/Code/CorePlugin/Resources/ChineseCheckersBoard.cs
1,951
C#
using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Windows.Forms; using Sledge.Common; using Sledge.DataStructures.MapObjects; using Sledge.Editor.Documents; namespace Sledge.Editor.Visgroups { public partial class VisgroupEditForm : Form { private readonly List<Visgroup> _visgroups; private readonly List<Visgroup> _deleted; public VisgroupEditForm(Document doc) { InitializeComponent(); _visgroups = new List<Visgroup>(doc.Map.Visgroups.Where(x => !x.IsAutomatic).Select(x => x.Clone())); _deleted = new List<Visgroup>(); UpdateVisgroups(); } public void PopulateChangeLists(Document doc, List<Visgroup> newVisgroups, List<Visgroup> changedVisgroups, List<Visgroup> deletedVisgroups) { foreach (var g in _visgroups) { var dg = doc.Map.Visgroups.FirstOrDefault(x => x.ID == g.ID); if (dg == null) newVisgroups.Add(g); else if (dg.Name != g.Name || dg.Colour != g.Colour) changedVisgroups.Add(g); } deletedVisgroups.AddRange(_deleted.Where(x => doc.Map.Visgroups.Any(y => y.ID == x.ID))); } private void UpdateVisgroups() { VisgroupPanel.Update(_visgroups); } private void SelectionChanged(object sender, int? visgroupId) { ColourPanel.Enabled = RemoveButton.Enabled = GroupName.Enabled = visgroupId.HasValue; ColourPanel.BackColor = SystemColors.Control; if (visgroupId.HasValue) { var visgroup = _visgroups.First(x => x.ID == visgroupId.Value); GroupName.Text = visgroup.Name; ColourPanel.BackColor = visgroup.Colour; } else { GroupName.Text = ""; } } private int GetNewID() { var ids = _visgroups.Select(x => x.ID).Union(_deleted.Select(x => x.ID)).ToList(); return Math.Max(1, ids.Any() ? ids.Max() + 1 : 1); } private void AddGroup(object sender, EventArgs e) { var newGroup = new Visgroup { ID = GetNewID(), Colour = Colour.GetRandomLightColour(), Name = "New Group", Visible = true }; _visgroups.Add(newGroup); UpdateVisgroups(); VisgroupPanel.SetSelectedVisgroup(newGroup.ID); GroupName.SelectAll(); GroupName.Focus(); } private void RemoveGroup(object sender, EventArgs e) { var id = VisgroupPanel.GetSelectedVisgroup(); if (!id.HasValue) return; var vg = _visgroups.First(x => x.ID == id.Value); _visgroups.Remove(vg); _deleted.Add(vg); UpdateVisgroups(); } private void GroupNameChanged(object sender, EventArgs e) { var id = VisgroupPanel.GetSelectedVisgroup(); if (!id.HasValue) return; var vg = _visgroups.First(x => x.ID == id.Value); if (vg.Name == GroupName.Text) return; vg.Name = GroupName.Text; VisgroupPanel.UpdateVisgroupName(id.Value, GroupName.Text); } private void ColourClicked(object sender, EventArgs e) { var id = VisgroupPanel.GetSelectedVisgroup(); if (!id.HasValue) return; var vg = _visgroups.First(x => x.ID == id.Value); using (var cp = new ColorDialog {Color = vg.Colour}) { if (cp.ShowDialog() == DialogResult.OK) { vg.Colour = cp.Color; VisgroupPanel.UpdateVisgroupColour(id.Value, cp.Color); } } } private void CloseButtonClicked(object sender, EventArgs e) { Close(); } } }
34.808333
148
0.531003
[ "Apache-2.0" ]
tohateam/SledgeEditorRu
Sledge.Editor/Visgroups/VisgroupEditForm.cs
4,179
C#
namespace UniModules.UniCore.Runtime.Math { using System.Collections.Generic; using UnityEngine; public static class ValueComparator { public static bool Compare<T>(T x, T y,Comparer<T> comparer, CompareTypes options) { if ((options & CompareTypes.Any) > 0) return true; var compareResult = comparer.Compare(x, y); if ((options & CompareTypes.Equal) > 0 && compareResult==0) return true; if ((options & CompareTypes.More) > 0 && compareResult>0) return true; if ((options & CompareTypes.Less) > 0 && compareResult<0) return true; return false; } public static bool Compare<T>(T x, T y, CompareTypes options) where T : struct { var comparer = Comparer<T>.Default; if ((options & CompareTypes.Any) > 0) return true; var compareResult = comparer.Compare(x, y); if ((options & CompareTypes.Equal) > 0 && compareResult==0) return true; if ((options & CompareTypes.More) > 0 && compareResult>0) return true; if ((options & CompareTypes.Less) > 0 && compareResult<0) return true; return false; } public static bool IsInRange(float value, float from, float to) { if (value >= from && value <= to) return true; if (value >= to && value <= from) return true; return false; } public static bool IsInRange(int value, int from, int to) { if (value >= from && value <= to) return true; if (value >= to && value <= from) return true; return false; } public static bool IsInIndexRange(int value, int from, int to) { if (value < 0) return false; if (value >= from && value < to) return true; if (value >= to && value < from) return true; return false; } public static bool IsInRange(this float value, Vector2 range) { return IsInRange(value, range.x, range.y); } public static bool IsInIndexRange(this int value, Vector2Int range) { return IsInIndexRange(value, range.x, range.y); } public static bool IsInRange(this int value, Vector2Int range) { return IsInRange(value, range.x, range.y); } public static bool IsAbsInRange(this float value, Vector2 range) { return IsInRange(Mathf.Abs(value), range.x, range.y); } public static bool ValidateMask(this int mask, int value) { var result = (mask & value) > 0; return result; } public static bool ValidateLayerMask(this int mask, int layer) { var result = (mask & (1 << layer)) > 0; return result; } } }
21.260504
69
0.635178
[ "MIT" ]
UniGameTeam/UniGame.Core
Runtime/Math/ValueComparator.cs
2,532
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.ResourceMover.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Extensions; using System; /// <summary> /// Moves the set of resources included in the request body. The move operation is triggered after the moveResources are in /// the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a transition to /// CommitPending. To aid the user to prerequisite the operation the client can call operation with validateOnly property /// set to true. /// </summary> /// <remarks> /// [OpenAPI] InitiateMove=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/initiateMove" /// </remarks> [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzResourceMoverInitiateMove_InitiateExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20210801.IOperationStatus))] [global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Description(@"Moves the set of resources included in the request body. The move operation is triggered after the moveResources are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with validateOnly property set to true.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Generated] public partial class InvokeAzResourceMoverInitiateMove_InitiateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.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>when specified, runs this cmdlet as a PowerShell job</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } /// <summary>Backing field for <see cref="Body" /> property.</summary> private Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20210801.IResourceMoveRequest _body= new Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20210801.ResourceMoveRequest(); /// <summary>Defines the request body for resource move operation.</summary> private Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20210801.IResourceMoveRequest Body { get => this._body; set => this._body = value; } /// <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.ResourceMover.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.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.ResourceMover.ResourceMover Client => Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.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.ResourceMover.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } /// <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.ResourceMover.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.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.ResourceMover.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.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="IEventListener" /> cancellation delegate. Stops the cmdlet when called. /// </summary> global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; /// <summary><see cref="IEventListener" /> cancellation token.</summary> global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// <summary>Backing field for <see cref="MoveCollectionName" /> property.</summary> private string _moveCollectionName; /// <summary>The Move Collection Name.</summary> [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Move Collection Name.")] [Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Info( Required = true, ReadOnly = false, Description = @"The Move Collection Name.", SerializedName = @"moveCollectionName", PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.ParameterCategory.Path)] public string MoveCollectionName { get => this._moveCollectionName; set => this._moveCollectionName = value; } /// <summary> /// Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via /// moveResourceInputType property. /// </summary> [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Info( Required = true, ReadOnly = false, Description = @"Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property.", SerializedName = @"moveResources", PossibleTypes = new [] { typeof(string) })] public string[] MoveResource { get => Body.MoveResource ?? null /* arrayOf */; set => Body.MoveResource = value; } /// <summary>Defines the move resource input type.</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Defines the move resource input type.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Info( Required = false, ReadOnly = false, Description = @"Defines the move resource input type.", SerializedName = @"moveResourceInputType", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Support.MoveResourceInputType) })] [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Support.MoveResourceInputType))] public Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Support.MoveResourceInputType MoveResourceInputType { get => Body.MoveResourceInputType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Support.MoveResourceInputType)""); set => Body.MoveResourceInputType = value; } /// <summary> /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue /// asynchronously. /// </summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] [global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter NoWait { get; set; } /// <summary> /// The instance of the <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.HttpPipeline" /> that the remote call will use. /// </summary> private Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.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.ResourceMover.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.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.ResourceMover.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.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.ResourceMover.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.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 Resource Group Name.</summary> [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Resource Group Name.")] [Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Info( Required = true, ReadOnly = false, Description = @"The Resource Group Name.", SerializedName = @"resourceGroupName", PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.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 Subscription ID.</summary> [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Subscription ID.")] [Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Info( Required = true, ReadOnly = false, Description = @"The Subscription ID.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] [Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.DefaultInfo( Name = @"", Description =@"", Script = @"(Get-AzContext).Subscription.Id")] [global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } /// <summary> /// Gets or sets a value indicating whether the operation needs to only run pre-requisite. /// </summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gets or sets a value indicating whether the operation needs to only run pre-requisite.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Info( Required = false, ReadOnly = false, Description = @"Gets or sets a value indicating whether the operation needs to only run pre-requisite.", SerializedName = @"validateOnly", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter ValidateOnly { get => Body.ValidateOnly ?? default(global::System.Management.Automation.SwitchParameter); set => Body.ValidateOnly = value; } /// <summary> /// <c>overrideOnDefault</c> will be called before the regular onDefault 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.ResourceMover.Models.Api20210801.ICloudError" /// /> from the remote call</param> /// <param name="returnNow">/// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing )</param> partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20210801.ICloudError> response, ref global::System.Threading.Tasks.Task<bool> returnNow); /// <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.ResourceMover.Models.Api20210801.IOperationStatus" /// /> 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.ResourceMover.Models.Api20210801.IOperationStatus> 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() { Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.AttachDebugger.Break(); } ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } /// <summary>Creates a duplicate instance of this cmdlet (via JSON serialization).</summary> /// <returns>a duplicate instance of InvokeAzResourceMoverInitiateMove_InitiateExpanded</returns> public Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Cmdlets.InvokeAzResourceMoverInitiateMove_InitiateExpanded Clone() { var clone = new InvokeAzResourceMoverInitiateMove_InitiateExpanded(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; clone.InvocationInformation = this.InvocationInformation; clone.Proxy = this.Proxy; clone.Pipeline = this.Pipeline; clone.AsJob = this.AsJob; clone.Break = this.Break; clone.ProxyCredential = this.ProxyCredential; clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; clone.Body = this.Body; clone.SubscriptionId = this.SubscriptionId; clone.ResourceGroupName = this.ResourceGroupName; clone.MoveCollectionName = this.MoveCollectionName; return clone; } /// <summary>Performs clean-up after the command execution</summary> protected override void EndProcessing() { ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } /// <summary> /// Intializes a new instance of the <see cref="InvokeAzResourceMoverInitiateMove_InitiateExpanded" /> cmdlet class. /// </summary> public InvokeAzResourceMoverInitiateMove_InitiateExpanded() { } /// <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.ResourceMover.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func<Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.EventData> messageData) { using( NoSynchronizationContext ) { if (token.IsCancellationRequested) { return ; } switch ( id ) { case Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Events.Verbose: { WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); return ; } case Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Events.Warning: { WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); return ; } case Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Events.Information: { // When an operation supports asjob, Information messages must go thru verbose. WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); return ; } case Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Events.Debug: { WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); return ; } case Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.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 ; } case Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Events.DelayBeforePolling: { if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); var location = response.GetFirstHeader(@"Location"); var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); // do nothing more. data.Cancel(); return; } } break; } } await Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.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.ResourceMover.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } __processRecordId = System.Guid.NewGuid().ToString(); try { // work if (ShouldProcess($"Call remote 'MoveCollectionsInitiateMove' operation")) { if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { var instance = this.Clone(); var job = new Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); JobRepository.Add(job); var task = instance.ProcessRecordAsync(); job.Monitor(task); WriteObject(job); } else { using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.IEventListener)this).Token) ) { asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.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.ResourceMover.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.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.ResourceMover.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.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.ResourceMover.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.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.ResourceMover.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); } if (null != HttpPipelineAppend) { Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); } // get the client instance try { await ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await this.Client.MoveCollectionsInitiateMove(SubscriptionId, ResourceGroupName, MoveCollectionName, Body, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.UndeclaredResponseException urexception) { WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MoveCollectionName=MoveCollectionName,body=Body}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); } finally { await ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.Events.CmdletProcessRecordAsyncEnd); } } } /// <summary>Interrupts currently running code within the command.</summary> protected override void StopProcessing() { ((Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.IEventListener)this).Cancel(); base.StopProcessing(); } /// <summary> /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// </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.ResourceMover.Models.Api20210801.ICloudError" /// /> 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 onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20210801.ICloudError> response) { using( NoSynchronizationContext ) { var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false); overrideOnDefault(responseMessage, response, ref _returnNow); // if overrideOnDefault has returned true, then return right away. if ((null != _returnNow && await _returnNow)) { return ; } // Error Response : default var code = (await response)?.Code; var message = (await response)?.Message; if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Runtime.RestException<Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20210801.ICloudError>(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, MoveCollectionName=MoveCollectionName, body=Body }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, MoveCollectionName=MoveCollectionName, body=Body }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); } } } /// <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.ResourceMover.Models.Api20210801.IOperationStatus" /// /> 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.ResourceMover.Models.Api20210801.IOperationStatus> 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.ResourceMover.Models.Api20210801.IOperationStatus WriteObject((await response)); } } } }
75.230174
483
0.6754
[ "MIT" ]
Agazoth/azure-powershell
src/ResourceMover/generated/cmdlets/InvokeAzResourceMoverInitiateMove_InitiateExpanded.cs
38,378
C#
using MasterDevs.ChromeDevTools; using Newtonsoft.Json; using System.Collections.Generic; namespace MasterDevs.ChromeDevTools.Protocol.Chrome.DOM { /// <summary> /// Returns node id at given location. /// </summary> [CommandResponse(ProtocolName.DOM.GetNodeForLocation)] [SupportedBy("Chrome")] public class GetNodeForLocationCommandResponse { /// <summary> /// Gets or sets Id of the node at given coordinates. /// </summary> public long NodeId { get; set; } } }
24.05
55
0.733888
[ "MIT" ]
vadik007/ChromeDevTools
source/ChromeDevTools/Protocol/Chrome/DOM/GetNodeForLocationCommandResponse.cs
481
C#
using UnityEngine; public class UIWindowButton : MonoBehaviour { public enum Action { Show, Hide, GoBack, } public UIPanel window; public Action action = Action.Hide; public bool requiresFullVersion = false; public bool eraseHistory = false; void Start () { UIPanel panel = NGUITools.FindInParents<UIPanel>(gameObject); if (panel != null) { UIWindow.Add(panel); } } void OnClick () { if (requiresFullVersion ) { UIUpgradeWindow.Show(); return; } switch (action) { case Action.Show: { if (window != null) { if (eraseHistory) UIWindow.Close(); UIWindow.Show(window); } } break; case Action.Hide: UIWindow.Close(); break; case Action.GoBack: UIWindow.GoBack(); break; } } }
13.666667
63
0.630295
[ "MIT" ]
djock/air-traffic-control
Assets/Scripts/Utils/UIWindowButton.cs
779
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Http; using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; using System.Web.Security; using System.Web.SessionState; using System.Data.Sql; using System.Data.SqlClient; using JSBase.App_Start; using System.Configuration; using System.Data; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace JSBase { // 注意: 有关启用 IIS6 或 IIS7 经典模式的说明, // 请访问 http://go.microsoft.com/?LinkId=9394801 public class MvcApplication : System.Web.HttpApplication { System.Timers.Timer t = new System.Timers.Timer(1000 * 60 ); //设置时间间隔为5秒 JSBase.Controllers.WeChatController w = new JSBase.Controllers.WeChatController(); protected void Application_Start() { AreaRegistration.RegisterAllAreas(); //GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); // BaseController bc = new BaseController(); // string p = Server.MapPath("/"); // bc.ListActionFromDB(); // bc.WriteActionToFile(p); // bc.ListActionFromFile(p); // ListAction(); //注册框架配置 FrameworkConfig.Register(); t.Elapsed += new System.Timers.ElapsedEventHandler(Timer_TimesUp); t.AutoReset = true; //每到指定时间Elapsed事件是触发一次(false),还是一直触发(true) t.Start(); } private void Timer_TimesUp(object sender, System.Timers.ElapsedEventArgs e) { //w.MyServer = Server; ProcInfo pi = new ProcInfo(); JObject data= new JObject(); pi.ProcedureName = "vdp_get_unsent_message"; pi.Type = "proc"; pi.ConnStr = "app"; DataSet ds = w.RunProcedureDataSet(data, pi); foreach (DataRow dr in ds.Tables[0].Rows) { w.PostTextMessageToUser(dr["open_id"].ToString(), dr["message"].ToString()); //tmpestr += string.Format(ReplyType.Message_News_Item, dr["Title"], dr["Description"], // dr["PicUrl"], // dr["Url"]); } // WeChatController w = new WeChatController(); // w.PostTextMessageToUser("ojbqdwKTA8VqKpEKoMql01gSK56Y", "test222"); //到达指定时间5秒触发该事件输出 Hello World!!!! // System.Diagnostics.Debug.WriteLine("Hello World!!!!"); } public static object GetCache(string CacheKey) { System.Web.Caching.Cache objCache = HttpRuntime.Cache; return objCache[CacheKey]; } public static void SetCache(string cacheKey, object objObject) { if (objObject == null) return; System.Web.Caching.Cache objCache = HttpRuntime.Cache; objCache.Insert(cacheKey, objObject); } //public DataTable ListAction() //{ // //if (HttpContext.Application) // //Application.Add("UserOnlineCount", UserCount); // DataSet tmpds = (DataSet)GetCache("ActionList"); // if (tmpds != null) // return tmpds.Tables[0]; // SqlConnection sqlCon = new SqlConnection(ConfigurationManager.ConnectionStrings["Sys"].ConnectionString); // SqlCommand sqlCmd = new SqlCommand("vdp_list_action", sqlCon); // sqlCmd.CommandType = CommandType.StoredProcedure;//设置调用的类型为存储过程 // SqlDataAdapter dp = new SqlDataAdapter(sqlCmd); // DataSet ds = new DataSet(); // // 填充dataset // sqlCon.Open(); // dp.Fill(ds); // sqlCon.Close(); // if (ds.Tables[0].Rows.Count > 0) // SetCache("ActionList", ds); // return ds.Tables[0]; //} protected void Application_Error(object sender, EventArgs e) { Exception exception = Server.GetLastError(); Response.Clear(); HttpException httpException = exception as HttpException; RouteData routeData = new RouteData(); routeData.Values.Add("controller", "Error"); if (httpException == null) { routeData.Values.Add("action", "Index"); } else //It's an Http Exception, Let's handle it. { switch (httpException.GetHttpCode()) { case 404: // Page not found. routeData.Values.Add("action", "HttpError404"); break; case 500: // Server error. routeData.Values.Add("action", "HttpError500"); break; // Here you can handle Views to other error codes. // I choose a General error template default: routeData.Values.Add("action", "General"); break; } // Pass exception details to the target error View. routeData.Values.Add("error", exception.Message + "位置:" + exception.StackTrace.ToString()); JTS.Utils.LogHelper.Error("全局错误:" + exception.Message, exception); } // Clear the error on server. Server.ClearError(); // Call target Controller and pass the routeData. IController errorController = new JSBase.Controllers.ErrorController(); errorController.Execute(new RequestContext( new HttpContextWrapper(Context), routeData)); } //protected static void SetOndDayTimer() //{ // //第一次开始的时间 // DateTime startTime = new DateTime( // DateTime.Now.Year, // DateTime.Now.Month, // DateTime.Now.Day, // 23, 58, 0); // if (startTime < DateTime.Now) // startTime = startTime.AddDays(1.0); // TimeSpan delayTime = (startTime - DateTime.Now); // TimeSpan intervalTime = new TimeSpan(1, 0, 0, 0); // 1 天 // // OnOndDayTimer为你每天需要调用的方法 // TimerCallback timerDelegate = new TimerCallback(OnOndDayTimer); // // Create a timer that signals the delegate to invoke // oneDayTimer = new System.Threading.Timer(timerDelegate, null, delayTime, intervalTime); //} } }
40.277778
123
0.517793
[ "MIT" ]
vdcan/-
Store/NewJSV3/Global.asax.cs
7,476
C#
using Adnc.Infra.Entities; using Adnc.Infra.Mongo.Configuration; using Adnc.Infra.Mongo.Extensions; using Adnc.Infra.Mongo.Interfaces; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using MongoDB.Driver; using System.Collections.Concurrent; namespace Adnc.Infra.Mongo { /// <summary> /// Context used to maintain a single MongoDB connection. /// </summary> /// <seealso cref="IMongoContext" /> /// <seealso cref="System.IDisposable" /> public class MongoContext : IMongoContext, IDisposable { private readonly SemaphoreSlim _semaphore; private readonly IOptions<MongoRepositoryOptions> _options; private readonly IServiceProvider _serviceProvider; private readonly IMongoDatabase _database; private readonly ConcurrentBag<Type> _bootstrappedCollections = new ConcurrentBag<Type>(); private bool _disposed; /// <summary> /// Initializes a new instance of the <see cref="MongoContext" /> class. /// </summary> /// <param name="options">The options.</param> /// <param name="serviceProvider">The service provider.</param> public MongoContext(IOptions<MongoRepositoryOptions> options, IServiceProvider serviceProvider) { _options = options; _serviceProvider = serviceProvider; var connectionString = options.Value.ConnectionString; if (string.IsNullOrEmpty(connectionString)) { throw new ArgumentNullException(nameof(connectionString), "Must provide a mongo connection string"); } var url = new MongoUrl(connectionString); if (string.IsNullOrEmpty(url.DatabaseName)) { throw new ArgumentNullException(nameof(connectionString), "Must provide a database name with the mongo connection string"); } var clientSettings = MongoClientSettings.FromUrl(url); //clientSettings.ClusterConfigurator = cb => cb.Subscribe(new DiagnosticsActivityEventSubscriber()); _semaphore = new SemaphoreSlim(1, 1); _database = new MongoClient(clientSettings).GetDatabase(url.DatabaseName); } /// <summary> /// Gets the MongoDB collection for the specified type. /// </summary> /// <typeparam name="TEntity">The type of the entity.</typeparam> /// <param name="cancellationToken">The cancellation token.</param> /// <returns></returns> public async Task<IMongoCollection<TEntity>> GetCollectionAsync<TEntity>(CancellationToken cancellationToken = default) where TEntity : MongoEntity { if (_disposed) { throw new ObjectDisposedException(nameof(MongoContext)); } var collectionName = _options.Value.GetCollectionName<TEntity>(); var collection = _database.GetCollection<TEntity>(collectionName); if (_bootstrappedCollections.Contains(typeof(TEntity))) { return collection; } try { await _semaphore.WaitAsync(cancellationToken); if (_bootstrappedCollections.Contains(typeof(TEntity))) { return collection; } var configurations = _serviceProvider.GetServices<IMongoEntityConfiguration<TEntity>>(); var builder = new MongoEntityBuilder<TEntity>(); foreach (var configuration in configurations) { configuration.Configure(builder); } // Indexes. var indexTasks = builder.Indexes.Select(index => collection.Indexes.CreateOneAsync(index, null, cancellationToken)); await Task.WhenAll(indexTasks); // Seeds. var seedTasks = builder.Seed.Select(async seed => { var cursor = await collection.FindAsync( Builders<TEntity>.Filter.IdEq(seed.Id), cancellationToken: cancellationToken); if (await cursor.AnyAsync(cancellationToken)) { return; } await collection.InsertOneAsync(seed, cancellationToken: cancellationToken); }); await Task.WhenAll(seedTasks); _bootstrappedCollections.Add(typeof(TEntity)); return collection; } finally { _semaphore.Release(); } } /// <summary> /// Drops the collection for the specified entity type. /// </summary> /// <typeparam name="TEntity">The type of the entity.</typeparam> /// <param name="cancellationToken">The cancellation token.</param> /// <returns></returns> public async Task DropCollectionAsync<TEntity>(CancellationToken cancellationToken = default) { var collectionName = _options.Value.GetCollectionName<TEntity>(); await _database.DropCollectionAsync(collectionName, cancellationToken); } /// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> public void Dispose() { if (_disposed) { return; } _disposed = true; _semaphore.Dispose(); } } }
37.344371
139
0.588934
[ "MIT" ]
Jiayg/Adnc
src/ServerApi/Infrastructures/Adnc.Infra.Mongo/MongoContext.cs
5,641
C#
namespace ClueBoardGameBlazor; public class Bootstrapper : MultiplayerBasicBootstrapper<ClueBoardGameShellViewModel> { public Bootstrapper(IStartUp starts, EnumGamePackageMode mode) : base(starts, mode) { } protected override Task ConfigureAsync(IGamePackageRegister register) { IBasicDiceGamesData<SimpleDice>.NeedsRollIncrement = true; //default to true. ClueBoardGameCP.DIFinishProcesses.GlobalDIAutoRegisterClass.RegisterNonSavedClasses(GetDIContainer); ClueBoardGameCP.DIFinishProcesses.SpecializedRegistrationHelpers.RegisterCommonMultplayerClasses(GetDIContainer); ClueBoardGameCP.DIFinishProcesses.SpecializedRegistrationHelpers.RegisterStandardDice(GetDIContainer); ClueBoardGameCP.DIFinishProcesses.AutoResetClass.RegisterAutoResets(); return Task.CompletedTask; } //this part should not change protected override void FinishRegistrations(IGamePackageRegister register) { register.RegisterType<ClueBoardGameShellViewModel>(); //has to use interface part to make it work with source generators. ClueBoardGameCP.DIFinishProcesses.GlobalDIFinishClass.FinishDIRegistrations(GetDIContainer); DIFinishProcesses.GlobalDIFinishClass.FinishDIRegistrations(GetDIContainer); ClueBoardGameCP.AutoResumeContexts.GlobalRegistrations.Register(); } }
54.36
129
0.805004
[ "MIT" ]
musictopia2/GamingPackXV3
Blazor/Games/ClueBoardGameBlazor/Bootstrapper.cs
1,359
C#
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace jogo_da_velha { public partial class Form1 : Form { public Form1() { InitializeComponent(); } public class global { public static bool turn, button_disable; public static int player1_wins = 0, player2_wins = 0, tie = 0, ronud = 0, A = 0, B = 0, C = 0, D = 0, E = 0, F = 0, G = 0, H = 0, I = 0, p1, rounds; } private void checkingWinner() { // Verificações de vitórias do jogador 1(X) nas horizontais: if (global.A == 1 && global.B == 1 && global.C == 1) { global.player1_wins++; label4.Text = Convert.ToString(global.player1_wins); MessageBox.Show("Jogador 1 venceu!"); global.button_disable = true; } if (global.D == 1 && global.E == 1 && global.F == 1) { global.player1_wins++; label4.Text = Convert.ToString(global.player1_wins); MessageBox.Show("Jogador 1 venceu!"); global.button_disable = true; } if (global.G == 1 && global.H == 1 && global.I == 1) { global.player1_wins++; label4.Text = Convert.ToString(global.player1_wins); MessageBox.Show("Jogador 1 venceu!"); global.button_disable = true; } // Verificações de vitórias do jogador 1(X) nas verticais: if (global.A == 1 && global.B == 1 && global.C == 1) { global.p1 = 1; wins(); } if (global.D == 1 && global.E == 1 && global.F == 1) { global.p1 = 1; wins(); } if (global.G == 1 && global.H == 1 && global.I == 1) { global.p1 = 1; wins(); } // Verificações de vitórias do jogador 1(X) nas diagonais: if (global.A == 1 && global.D == 1 && global.G == 1) { global.p1 = 1; wins(); } if (global.B == 1 && global.E == 1 && global.H == 1) { global.p1 = 1; wins(); } if (global.C == 1 && global.F == 1 && global.I == 1) { global.p1 = 1; wins(); } // Verificações de vitórias do jogador 1(X) nas hori: if (global.A == 1 && global.E == 1 && global.I == 1) { global.p1 = 1; wins(); } if (global.C == 1 && global.E == 1 && global.G == 1) { global.p1 = 1; wins(); } // Verificações de vitórias do jogador 2(O) nas horizontais: if (global.A == 2 && global.B == 2 && global.C == 2) { global.p1 = 2; wins(); } if (global.D == 2 && global.E == 2 && global.F == 2) { global.p1 = 2; wins(); } if (global.G == 2 && global.H == 2 && global.I == 2) { global.p1 = 2; wins(); } // Verificações de vitórias do jogador 2(O) nas verticais: if (global.A == 2 && global.D == 2 && global.G == 2) { global.p1 = 2; wins(); } if (global.B == 2 && global.E == 2 && global.H == 2) { global.p1 = 2; wins(); } if (global.C == 2 && global.F == 2 && global.I == 2) { global.p1 = 2; wins(); } // Verificações de vitórias do jogador 2(O) nas diagonais: if (global.A == 2 && global.E == 2 && global.I == 2) { global.p1 = 2; wins(); } if (global.C == 2 && global.E == 2 && global.G == 2) { global.p1 = 2; wins(); } if (global.p1 == 0 && global.rounds == 9) { global.tie++; label6.Text = Convert.ToString(global.tie); MessageBox.Show("Empate"); global.button_disable = true; } } private void wins() { if (global.p1 == 1) { global.player1_wins++; label4.Text = Convert.ToString(global.player1_wins); MessageBox.Show("Jogador 1 venceu!"); global.button_disable = true; } else if (global.p1 == 2) { global.player2_wins++; label5.Text = Convert.ToString(global.player2_wins); MessageBox.Show("Jogador 2 venceu!"); global.button_disable = true; } } private void button1_Click(object sender, EventArgs e) { if (global.turn == false && global.button_disable == false && global.A == 0) { button1.Text = "X"; global.A = 1; global.ronud++; checkingWinner(); global.turn = true; } if (global.turn == false && global.button_disable == false && global.A == 0) { button1.Text = "O"; global.A = 2; global.ronud++; checkingWinner(); global.turn = false; } } private void button2_Click(object sender, EventArgs e) { // Verificação da jogada do player 1(X): if (global.turn == false && global.button_disable == false && global.B == 0) { button2.Text = "X"; global.B = 1; global.ronud++; checkingWinner(); global.turn = true; } // Verificação da jogada do player 2(O): if (global.turn == true && global.button_disable == false && global.B == 0) { button2.Text = "O"; global.B = 2; global.ronud++; checkingWinner(); global.turn = false; } } private void button3_Click(object sender, EventArgs e) { if (global.turn == false && global.button_disable == false && global.C == 0) { button3.Text = "X"; global.C = 1; global.ronud++; checkingWinner(); global.turn = true; } if (global.turn == true && global.button_disable == false && global.C == 0) { button3.Text = "O"; global.C = 2; global.ronud++; checkingWinner(); global.turn = false; } } private void button6_Click(object sender, EventArgs e) { if (global.turn == false && global.button_disable == false && global.D == 0) { button6.Text = "X"; global.D = 1; global.ronud++; checkingWinner(); global.turn = true; } if (global.turn == true && global.button_disable == false && global.D == 0) { button6.Text = "O"; global.D = 2; global.ronud++; checkingWinner(); global.turn = false; } } private void button5_Click(object sender, EventArgs e) { if (global.turn == false && global.button_disable == false && global.E == 0) { button5.Text = "X"; global.E = 1; global.ronud++; checkingWinner(); global.turn = true; } if (global.turn == true && global.button_disable == false && global.E == 0) { button5.Text = "O"; global.E = 2; global.ronud++; checkingWinner(); global.turn = false; } } private void button4_Click(object sender, EventArgs e) { if (global.turn == false && global.button_disable == false && global.F == 0) { button4.Text = "X"; global.F = 1; global.ronud++; checkingWinner(); global.turn = true; } if (global.turn == true && global.button_disable == false && global.F == 0) { button4.Text = "O"; global.F = 2; global.ronud++; checkingWinner(); global.turn = false; } } private void button7_Click(object sender, EventArgs e) { if (global.turn == false && global.button_disable == false && global.G == 0) { button7.Text = "X"; global.G = 1; global.ronud++; checkingWinner(); global.turn = true; } if (global.turn == true && global.button_disable == false && global.G == 0) { button7.Text = "O"; global.G = 2; global.ronud++; checkingWinner(); global.turn = false; } } private void button8_Click(object sender, EventArgs e) { if (global.turn == false && global.button_disable == false && global.H == 0) { button8.Text = "X"; global.H = 1; global.ronud++; checkingWinner(); global.turn = true; } if (global.turn ==true && global.button_disable == false && global.H == 0) { button8.Text = "O"; global.H = 2; global.ronud++; checkingWinner(); global.turn = false; } } private void button9_Click(object sender, EventArgs e) { if (global.turn == false && global.button_disable == false && global.I == 0) { button9.Text = "X"; global.I = 1; global.ronud++; checkingWinner(); global.turn = true; } if (global.turn == true && global.button_disable == false && global.I == 0) { button9.Text = "O"; global.I = 2; global.ronud++; checkingWinner(); global.turn = false; } } private void button10_Click(object sender, EventArgs e) { global.A = 0; global.B = 0; global.C = 0; global.D = 0; global.E = 0; global.F = 0; global.G = 0; global.H = 0; global.I = 0; global.rounds = 0; button1.Text = " "; button2.Text = " "; button3.Text = " "; button4.Text = " "; button4.Text = " "; button5.Text = " "; button6.Text = " "; button7.Text = " "; button8.Text = " "; button9.Text = " "; global.button_disable = false; if (global.p1 == 1 || global.p1 == 0) { global.turn = false; global.p1 = 0; } else if (global.p1 == 2) { global.turn = true; global.p1 = 0; } } private void label4_Click(object sender, EventArgs e) { } } }
31.162621
121
0.387102
[ "Apache-2.0" ]
jilsi/AV1
jogo c#/jogo da velha/jogo da velha/Form1.cs
12,866
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.Elastic.V20200701.Outputs { /// <summary> /// Definition of the properties for a TagRules resource. /// </summary> [OutputType] public sealed class MonitoringTagRulesPropertiesResponse { /// <summary> /// Rules for sending logs. /// </summary> public readonly Outputs.LogRulesResponse? LogRules; /// <summary> /// Provisioning state of the monitoring tag rules. /// </summary> public readonly string? ProvisioningState; [OutputConstructor] private MonitoringTagRulesPropertiesResponse( Outputs.LogRulesResponse? logRules, string? provisioningState) { LogRules = logRules; ProvisioningState = provisioningState; } } }
28.717949
81
0.650893
[ "Apache-2.0" ]
polivbr/pulumi-azure-native
sdk/dotnet/Elastic/V20200701/Outputs/MonitoringTagRulesPropertiesResponse.cs
1,120
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace NeuralReplicantBot.PerceptronHandler { [RequireComponent(typeof(Brain))] public class BotHandler : MonoBehaviour { public bool isTraining; protected Brain brain; virtual protected void Awake () { brain = GetComponent<Brain>(); brain.load = !isTraining; brain.Begin(); } } }
17.086957
46
0.73028
[ "MIT" ]
HectorPulido/Imitation-learning-in-unity
NeuralReplicantBots/Assets/NeuralReplicantBots/BotHandler.cs
395
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Aurora.Framework { public interface IGridInfo { string GridName { get; } string GridNick { get; } string GridLoginURI { get; } string GridWelcomeURI { get; } string GridEconomyURI { get; } string GridAboutURI { get; } string GridHelpURI { get; } string GridRegisterURI { get; } string GridForgotPasswordURI { get; } string GridMapTileURI { get; } string GridWebProfileURI { get; } string GridSearchURI { get; } string GridDestinationURI { get; } string GridMarketplaceURI { get; } string GridTutorialURI { get; } string GridSnapshotConfigURI { get; } } }
29.285714
46
0.60122
[ "BSD-3-Clause" ]
BillyWarrhol/Aurora-Sim
Aurora/Framework/Services/IGridInfo.cs
822
C#
using System.Data; public static class NullSafeGetter { public static T GetValueOrDefault<T> (this IDataRecord row, string fieldName) where T : struct { int ordinal = row.GetOrdinal (fieldName); T value = row.GetValueOrDefault<T> (ordinal); return value; } #nullable enable public static T? GetValueOrNull<T> (this IDataRecord row, string fieldName) where T : class { int ordinal = row.GetOrdinal (fieldName); return row.GetValueOrNull<T> (ordinal); } public static T GetValueOrDefault<T> (this IDataRecord row, int ordinal) where T : struct { return (T) (row.IsDBNull (ordinal) ? default (T) : row.GetValue (ordinal)); } public static T? GetValueOrNull<T> (this IDataRecord row, int ordinal) where T : class { return (T?) (row.IsDBNull (ordinal) ? null : row.GetValue (ordinal)); } }
38.26087
100
0.663636
[ "MIT" ]
Eibx/Rebronx
server/Helpers/NullSafeGetter.cs
880
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Xml; using System.Globalization; using System.Management.Automation; using System.Management.Automation.Host; using System.Management.Automation.Internal; using System.Management.Automation.Security; using System.Threading; namespace Microsoft.PowerShell.Commands.Internal.Format { internal sealed class XmlFileLoadInfo { internal XmlFileLoadInfo() { } internal XmlFileLoadInfo(string dir, string path, ConcurrentBag<string> errors, string psSnapinName) { fileDirectory = dir; filePath = path; this.errors = errors; this.psSnapinName = psSnapinName; } internal string fileDirectory = null; internal string filePath = null; internal ConcurrentBag<string> errors; internal string psSnapinName; } /// <summary> /// class to load the XML document into data structures. /// It encapsulates the file format specific code /// </summary> internal sealed partial class TypeInfoDataBaseLoader : XmlLoaderBase { private const string resBaseName = "TypeInfoDataBaseLoaderStrings"; #region tracer [TraceSource("TypeInfoDataBaseLoader", "TypeInfoDataBaseLoader")] private static PSTraceSource s_tracer = PSTraceSource.GetTracer("TypeInfoDataBaseLoader", "TypeInfoDataBaseLoader"); #endregion tracer /// <summary> /// table of XML node tags used in the file format /// </summary> private static class XmlTags { // top level entries in the XML document internal const string DefaultSettingsNode = "DefaultSettings"; internal const string ConfigurationNode = "Configuration"; internal const string SelectionSetsNode = "SelectionSets"; internal const string ViewDefinitionsNode = "ViewDefinitions"; internal const string ControlsNode = "Controls"; // default settings entries internal const string MultilineTablesNode = "WrapTables"; internal const string PropertyCountForTableNode = "PropertyCountForTable"; internal const string ShowErrorsAsMessagesNode = "ShowError"; internal const string ShowErrorsInFormattedOutputNode = "DisplayError"; internal const string EnumerableExpansionsNode = "EnumerableExpansions"; internal const string EnumerableExpansionNode = "EnumerableExpansion"; internal const string ExpandNode = "Expand"; // entries identifying the various control types definitions internal const string ControlNode = "Control"; internal const string ComplexControlNameNode = "CustomControlName"; // selection sets (a.k.a. Type Groups) internal const string SelectionSetNode = "SelectionSet"; internal const string SelectionSetNameNode = "SelectionSetName"; internal const string SelectionConditionNode = "SelectionCondition"; internal const string NameNode = "Name"; internal const string TypesNode = "Types"; internal const string TypeNameNode = "TypeName"; internal const string ViewNode = "View"; // entries identifying the various control types internal const string TableControlNode = "TableControl"; internal const string ListControlNode = "ListControl"; internal const string WideControlNode = "WideControl"; internal const string ComplexControlNode = "CustomControl"; internal const string FieldControlNode = "FieldControl"; // view specific tags internal const string ViewSelectedByNode = "ViewSelectedBy"; internal const string GroupByNode = "GroupBy"; internal const string OutOfBandNode = "OutOfBand"; // table specific tags internal const string HideTableHeadersNode = "HideTableHeaders"; internal const string TableHeadersNode = "TableHeaders"; internal const string TableColumnHeaderNode = "TableColumnHeader"; internal const string TableRowEntriesNode = "TableRowEntries"; internal const string TableRowEntryNode = "TableRowEntry"; internal const string MultiLineNode = "Wrap"; internal const string TableColumnItemsNode = "TableColumnItems"; internal const string TableColumnItemNode = "TableColumnItem"; internal const string WidthNode = "Width"; // list specific tags internal const string ListEntriesNode = "ListEntries"; internal const string ListEntryNode = "ListEntry"; internal const string ListItemsNode = "ListItems"; internal const string ListItemNode = "ListItem"; // wide specific tags internal const string ColumnNumberNode = "ColumnNumber"; internal const string WideEntriesNode = "WideEntries"; internal const string WideEntryNode = "WideEntry"; internal const string WideItemNode = "WideItem"; // complex specific tags internal const string ComplexEntriesNode = "CustomEntries"; internal const string ComplexEntryNode = "CustomEntry"; internal const string ComplexItemNode = "CustomItem"; internal const string ExpressionBindingNode = "ExpressionBinding"; internal const string NewLineNode = "NewLine"; internal const string TextNode = "Text"; internal const string FrameNode = "Frame"; internal const string LeftIndentNode = "LeftIndent"; internal const string RightIndentNode = "RightIndent"; internal const string FirstLineIndentNode = "FirstLineIndent"; internal const string FirstLineHangingNode = "FirstLineHanging"; internal const string EnumerateCollectionNode = "EnumerateCollection"; // general purpose tags internal const string AutoSizeNode = "AutoSize"; // valid only for table and wide internal const string AlignmentNode = "Alignment"; internal const string PropertyNameNode = "PropertyName"; internal const string ScriptBlockNode = "ScriptBlock"; internal const string FormatStringNode = "FormatString"; internal const string LabelNode = "Label"; internal const string EntrySelectedByNode = "EntrySelectedBy"; internal const string ItemSelectionConditionNode = "ItemSelectionCondition"; // attribute tags for resource strings internal const string AssemblyNameAttribute = "AssemblyName"; internal const string BaseNameAttribute = "BaseName"; internal const string ResourceIdAttribute = "ResourceId"; } /// <summary> /// table of miscellanea string constant values for XML nodes /// </summary> private static class XMLStringValues { internal const string True = "TRUE"; internal const string False = "FALSE"; internal const string AlignmentLeft = "left"; internal const string AlignmentCenter = "center"; internal const string AlignmentRight = "right"; } // Flag that determines whether validation should be suppressed while // processing pre-validated type / formatting information. private bool _suppressValidation = false; /// <summary> /// entry point for the loader algorithm /// </summary> /// <param name="info">information needed to load the file</param> /// <param name="db">database instance to load the file into</param> /// <param name="expressionFactory">expression factory to validate script blocks</param> /// <param name="authorizationManager"> /// Authorization manager to perform signature checks before reading ps1xml files (or null of no checks are needed) /// </param> /// <param name="host"> /// Host passed to <paramref name="authorizationManager"/>. Can be null if no interactive questions should be asked. /// </param> /// <param name="preValidated"> /// True if the format data has been pre-validated (build time, manual testing, etc) so that validation can be /// skipped at runtime. /// </param> /// <returns>true if successful</returns> internal bool LoadXmlFile( XmlFileLoadInfo info, TypeInfoDataBase db, PSPropertyExpressionFactory expressionFactory, AuthorizationManager authorizationManager, PSHost host, bool preValidated) { if (info == null) throw PSTraceSource.NewArgumentNullException("info"); if (info.filePath == null) throw PSTraceSource.NewArgumentNullException("info.filePath"); if (db == null) throw PSTraceSource.NewArgumentNullException("db"); if (expressionFactory == null) throw PSTraceSource.NewArgumentNullException("expressionFactory"); if (SecuritySupport.IsProductBinary(info.filePath)) { this.SetLoadingInfoIsProductCode(true); } this.displayResourceManagerCache = db.displayResourceManagerCache; this.expressionFactory = expressionFactory; this.SetDatabaseLoadingInfo(info); this.ReportTrace("loading file started"); // load file into XML document XmlDocument newDocument = null; bool isFullyTrusted = false; newDocument = LoadXmlDocumentFromFileLoadingInfo(authorizationManager, host, out isFullyTrusted); // If we're not in a locked-down environment, types and formatting are allowed based just on the authorization // manager. If we are in a locked-down environment, additionally check the system policy. if (SystemPolicy.GetSystemLockdownPolicy() == SystemEnforcementMode.Enforce) { SetLoadingInfoIsFullyTrusted(isFullyTrusted); } if (newDocument == null) { return false; } // load the XML document into a copy of the // in memory database bool previousSuppressValidation = _suppressValidation; try { _suppressValidation = preValidated; try { this.LoadData(newDocument, db); } catch (TooManyErrorsException) { // already logged an error before throwing return false; } catch (Exception e) // will rethrow { //Error in file {0}: {1} this.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.ErrorInFile, FilePath, e.Message)); throw; } if (this.HasErrors) { return false; } } finally { _suppressValidation = previousSuppressValidation; } this.ReportTrace("file loaded with no errors"); return true; } /// <summary> /// entry point for the loader algorithm to load formatting data from ExtendedTypeDefinition /// </summary> /// <param name="typeDefinition">the ExtendedTypeDefinition instance to load formatting data from</param> /// <param name="db">database instance to load the formatting data into</param> /// <param name="expressionFactory">expression factory to validate the script block</param> /// <param name="isBuiltInFormatData">do we implicitly trust the script blocks (so they should run in full langauge mode)?</param> /// <param name="isForHelp">true when the view is for help output</param> /// <returns></returns> internal bool LoadFormattingData( ExtendedTypeDefinition typeDefinition, TypeInfoDataBase db, PSPropertyExpressionFactory expressionFactory, bool isBuiltInFormatData, bool isForHelp) { if (typeDefinition == null) throw PSTraceSource.NewArgumentNullException("typeDefinition"); if (typeDefinition.TypeName == null) throw PSTraceSource.NewArgumentNullException("typeDefinition.TypeName"); if (db == null) throw PSTraceSource.NewArgumentNullException("db"); if (expressionFactory == null) throw PSTraceSource.NewArgumentNullException("expressionFactory"); this.expressionFactory = expressionFactory; this.ReportTrace("loading ExtendedTypeDefinition started"); try { this.SetLoadingInfoIsFullyTrusted(isBuiltInFormatData); this.SetLoadingInfoIsProductCode(isBuiltInFormatData); this.LoadData(typeDefinition, db, isForHelp); } catch (TooManyErrorsException) { // already logged an error before throwing return false; } catch (Exception e) // will rethrow { //Error in formatting data "{0}": {1} this.ReportErrorForLoadingFromObjectModel( StringUtil.Format(FormatAndOutXmlLoadingStrings.ErrorInFormattingData, typeDefinition.TypeName, e.Message), typeDefinition.TypeName); throw; } if (this.HasErrors) { return false; } this.ReportTrace("ExtendedTypeDefinition loaded with no errors"); return true; } /// <summary> /// load the content of the XML document into the data instance. /// It assumes that the XML document has been successfully loaded /// </summary> /// <param name="doc">XML document to load from, cannot be null</param> /// <param name="db"> instance of the databaseto load into</param> private void LoadData(XmlDocument doc, TypeInfoDataBase db) { if (doc == null) throw PSTraceSource.NewArgumentNullException("doc"); if (db == null) throw PSTraceSource.NewArgumentNullException("db"); // create a new instance of the database to be loaded XmlElement documentElement = doc.DocumentElement; bool defaultSettingsNodeFound = false; bool typeGroupsFound = false; bool viewDefinitionsFound = false; bool controlDefinitionsFound = false; if (MatchNodeName(documentElement, XmlTags.ConfigurationNode)) { // load the various sections using (this.StackFrame(documentElement)) { foreach (XmlNode n in documentElement.ChildNodes) { if (MatchNodeName(n, XmlTags.DefaultSettingsNode)) { if (defaultSettingsNodeFound) { ProcessDuplicateNode(n); } defaultSettingsNodeFound = true; LoadDefaultSettings(db, n); } else if (MatchNodeName(n, XmlTags.SelectionSetsNode)) { if (typeGroupsFound) { ProcessDuplicateNode(n); } typeGroupsFound = true; LoadTypeGroups(db, n); } else if (MatchNodeName(n, XmlTags.ViewDefinitionsNode)) { if (viewDefinitionsFound) { ProcessDuplicateNode(n); } viewDefinitionsFound = true; LoadViewDefinitions(db, n); } else if (MatchNodeName(n, XmlTags.ControlsNode)) { if (controlDefinitionsFound) { ProcessDuplicateNode(n); } controlDefinitionsFound = true; LoadControlDefinitions(n, db.formatControlDefinitionHolder.controlDefinitionList); } else { ProcessUnknownNode(n); } } // foreach } // using } else { ProcessUnknownNode(documentElement); } } #region load formatting data from FormatViewDefinition /// <summary> /// load the content of the ExtendedTypeDefinition instance into the db. /// Only support following view controls: /// TableControl /// ListControl /// WideControl /// CustomControl /// </summary> /// <param name="typeDefinition">ExtendedTypeDefinition instances to load from, cannot be null</param> /// <param name="db">instance of the database to load into</param> /// <param name="isForHelpOutput">true if the formatter is used for formatting help objects</param> private void LoadData(ExtendedTypeDefinition typeDefinition, TypeInfoDataBase db, bool isForHelpOutput) { if (typeDefinition == null) throw PSTraceSource.NewArgumentNullException("viewDefinition"); if (db == null) throw PSTraceSource.NewArgumentNullException("db"); int viewIndex = 0; foreach (FormatViewDefinition formatView in typeDefinition.FormatViewDefinition) { ViewDefinition view = LoadViewFromObjectModel(typeDefinition.TypeNames, formatView, viewIndex++); if (view != null) { ReportTrace(string.Format(CultureInfo.InvariantCulture, "{0} view {1} is loaded from the 'FormatViewDefinition' at index {2} in 'ExtendedTypeDefinition' with type name {3}", ControlBase.GetControlShapeName(view.mainControl), view.name, viewIndex - 1, typeDefinition.TypeName)); // we are fine, add the view to the list db.viewDefinitionsSection.viewDefinitionList.Add(view); view.loadingInfo = this.LoadingInfo; view.isHelpFormatter = isForHelpOutput; } } } /// <summary> /// Load the view into a ViewDefinition /// </summary> /// <param name="typeNames">the TypeName tag under SelectedBy tag</param> /// <param name="formatView"></param> /// <param name="viewIndex"></param> /// <returns></returns> private ViewDefinition LoadViewFromObjectModel(List<string> typeNames, FormatViewDefinition formatView, int viewIndex) { // Get AppliesTo information AppliesTo appliesTo = new AppliesTo(); foreach (var typename in typeNames) { TypeReference tr = new TypeReference { name = typename }; appliesTo.referenceList.Add(tr); } // Set AppliesTo and Name in the view ViewDefinition view = new ViewDefinition(); view.appliesTo = appliesTo; view.name = formatView.Name; var firstTypeName = typeNames[0]; PSControl control = formatView.Control; if (control is TableControl) { var tableControl = control as TableControl; view.mainControl = LoadTableControlFromObjectModel(tableControl, viewIndex, firstTypeName); } else if (control is ListControl) { var listControl = control as ListControl; view.mainControl = LoadListControlFromObjectModel(listControl, viewIndex, firstTypeName); } else if (control is WideControl) { var wideControl = control as WideControl; view.mainControl = LoadWideControlFromObjectModel(wideControl, viewIndex, firstTypeName); } else { view.mainControl = LoadCustomControlFromObjectModel((CustomControl)control, viewIndex, firstTypeName); } // Check if the PSControl is successfully loaded if (view.mainControl == null) { return null; } view.outOfBand = control.OutOfBand; if (control.GroupBy != null) { view.groupBy = new GroupBy { startGroup = new StartGroup { expression = LoadExpressionFromObjectModel(control.GroupBy.Expression, viewIndex, firstTypeName) } }; if (control.GroupBy.Label != null) { view.groupBy.startGroup.labelTextToken = new TextToken { text = control.GroupBy.Label }; } if (control.GroupBy.CustomControl != null) { view.groupBy.startGroup.control = LoadCustomControlFromObjectModel(control.GroupBy.CustomControl, viewIndex, firstTypeName); } } return view; } #region Load TableControl /// <summary> /// Load the TableControl to ControlBase. /// </summary> /// <param name="table"></param> /// <param name="viewIndex"></param> /// <param name="typeName"></param> /// <returns></returns> private ControlBase LoadTableControlFromObjectModel(TableControl table, int viewIndex, string typeName) { TableControlBody tableBody = new TableControlBody { autosize = table.AutoSize }; LoadHeadersSectionFromObjectModel(tableBody, table.Headers); // No 'SelectedBy' data supplied, so the rowEntry will only be set to // tableBody.defaultDefinition. There cannot be more than one 'defaultDefinition' // defined for the tableBody. if (table.Rows.Count > 1) { this.ReportErrorForLoadingFromObjectModel( StringUtil.Format(FormatAndOutXmlLoadingStrings.MultipleRowEntriesFoundInFormattingData, typeName, viewIndex, XmlTags.TableRowEntryNode), typeName); return null; } LoadRowEntriesSectionFromObjectModel(tableBody, table.Rows, viewIndex, typeName); // When error occurs while loading rowEntry, the tableBody.defaultDefinition would be null if (tableBody.defaultDefinition == null) { return null; } // CHECK: verify consistency of headers and row entries if (tableBody.header.columnHeaderDefinitionList.Count != 0) { // CHECK: if there are headers in the list, their number has to match // the default row definition item count if (tableBody.header.columnHeaderDefinitionList.Count != tableBody.defaultDefinition.rowItemDefinitionList.Count) { //Error at XPath {0} in file {1}: Header item count = {2} does not match default row item count = {3}. this.ReportErrorForLoadingFromObjectModel( StringUtil.Format(FormatAndOutXmlLoadingStrings.IncorrectHeaderItemCountInFormattingData, typeName, viewIndex, tableBody.header.columnHeaderDefinitionList.Count, tableBody.defaultDefinition.rowItemDefinitionList.Count), typeName); return null; // fatal error } } // CHECK: if there are alternative row definitions. There should be no alternative row definitions here. Diagnostics.Assert(tableBody.optionalDefinitionList.Count == 0, "there should be no alternative row definitions because no SelectedBy is defined for TableControlRow"); return tableBody; } /// <summary> /// Load the headers defined for columns /// </summary> /// <param name="tableBody"></param> /// <param name="headers"></param> private void LoadHeadersSectionFromObjectModel(TableControlBody tableBody, List<TableControlColumnHeader> headers) { foreach (TableControlColumnHeader header in headers) { TableColumnHeaderDefinition chd = new TableColumnHeaderDefinition(); // Contains: // Label --- Label cardinality 0..1 // Width --- Width cardinality 0..1 // Alignment --- Alignment cardinality 0..1 if (!String.IsNullOrEmpty(header.Label)) { TextToken tt = new TextToken(); tt.text = header.Label; chd.label = tt; } chd.width = header.Width; chd.alignment = (int)header.Alignment; tableBody.header.columnHeaderDefinitionList.Add(chd); } } /// <summary> /// Load row enties, set the defaultDefinition of the TableControlBody. /// </summary> /// <param name="tableBody"></param> /// <param name="rowEntries"></param> /// <param name="viewIndex"></param> /// <param name="typeName"></param> private void LoadRowEntriesSectionFromObjectModel(TableControlBody tableBody, List<TableControlRow> rowEntries, int viewIndex, string typeName) { foreach (TableControlRow row in rowEntries) { TableRowDefinition trd = new TableRowDefinition { multiLine = row.Wrap }; // Contains: // Columns --- TableColumnItems cardinality: 0..1 // No SelectedBy is supplied in the TableControlRow if (row.Columns.Count > 0) { LoadColumnEntriesFromObjectModel(trd, row.Columns, viewIndex, typeName); // trd.rowItemDefinitionList is null, it means there was a failure if (trd.rowItemDefinitionList == null) { tableBody.defaultDefinition = null; return; } } if (row.SelectedBy != null) { trd.appliesTo = LoadAppliesToSectionFromObjectModel(row.SelectedBy.TypeNames, row.SelectedBy.SelectionCondition); tableBody.optionalDefinitionList.Add(trd); } else { tableBody.defaultDefinition = trd; } } // rowEntries must not be empty if (tableBody.defaultDefinition == null) { this.ReportErrorForLoadingFromObjectModel( StringUtil.Format(FormatAndOutXmlLoadingStrings.NoDefaultShapeEntryInFormattingData, typeName, viewIndex, XmlTags.TableRowEntryNode), typeName); return; } } /// <summary> /// Load the column items into the TableRowDefinition /// </summary> /// <param name="trd"></param> /// <param name="columns"></param> /// <param name="viewIndex"></param> /// <param name="typeName"></param> private void LoadColumnEntriesFromObjectModel(TableRowDefinition trd, List<TableControlColumn> columns, int viewIndex, string typeName) { foreach (TableControlColumn column in columns) { TableRowItemDefinition rid = new TableRowItemDefinition(); // Contain: // DisplayEntry --- Expression cardinality: 0..1 // Alignment --- Alignment cardinality: 0..1 if (column.DisplayEntry != null) { ExpressionToken expression = LoadExpressionFromObjectModel(column.DisplayEntry, viewIndex, typeName); if (expression == null) { trd.rowItemDefinitionList = null; return; } FieldPropertyToken fpt = new FieldPropertyToken(); fpt.expression = expression; fpt.fieldFormattingDirective.formatString = column.FormatString; rid.formatTokenList.Add(fpt); } rid.alignment = (int)column.Alignment; trd.rowItemDefinitionList.Add(rid); } } #endregion Load TableControl /// <summary> /// Load the expression information from DisplayEntry /// </summary> /// <param name="displayEntry"></param> /// <param name="viewIndex"></param> /// <param name="typeName"></param> /// <returns></returns> private ExpressionToken LoadExpressionFromObjectModel(DisplayEntry displayEntry, int viewIndex, string typeName) { ExpressionToken token = new ExpressionToken(); if (displayEntry.ValueType == DisplayEntryValueType.Property) { token.expressionValue = displayEntry.Value; return token; } else if (displayEntry.ValueType == DisplayEntryValueType.ScriptBlock) { token.isScriptBlock = true; token.expressionValue = displayEntry.Value; try { // For faster startup, we don't validate any of the built-in formatting script blocks, where isFullyTrusted == built-in. if (!LoadingInfo.isFullyTrusted) { this.expressionFactory.VerifyScriptBlockText(token.expressionValue); } } catch (ParseException e) { // Error at this.ReportErrorForLoadingFromObjectModel( StringUtil.Format(FormatAndOutXmlLoadingStrings.InvalidScriptBlockInFormattingData, typeName, viewIndex, e.Message), typeName); return null; } catch (Exception e) // will rethrow { Diagnostics.Assert(false, "TypeInfoBaseLoader.VerifyScriptBlock unexpected exception " + e.GetType().FullName); throw; } return token; } // this should never happen if the API is used correctly PSTraceSource.NewInvalidOperationException(); return null; } /// <summary> /// Load EntrySelectedBy (TypeName) into AppliesTo /// </summary> /// <returns></returns> private AppliesTo LoadAppliesToSectionFromObjectModel(List<string> selectedBy, List<DisplayEntry> condition) { AppliesTo appliesTo = new AppliesTo(); if (selectedBy != null) { foreach (string type in selectedBy) { if (String.IsNullOrEmpty(type)) return null; TypeReference tr = new TypeReference { name = type }; appliesTo.referenceList.Add(tr); } } if (condition != null) { foreach (var cond in condition) { // TODO } } return appliesTo; } #region Load ListControl /// <summary> /// Load LoisControl into the ListControlBody /// </summary> /// <param name="list"></param> /// <param name="viewIndex"></param> /// <param name="typeName"></param> /// <returns></returns> private ListControlBody LoadListControlFromObjectModel(ListControl list, int viewIndex, string typeName) { ListControlBody listBody = new ListControlBody(); // load the list entries section LoadListControlEntriesFromObjectModel(listBody, list.Entries, viewIndex, typeName); if (listBody.defaultEntryDefinition == null) { return null; // fatal error } return listBody; } private void LoadListControlEntriesFromObjectModel(ListControlBody listBody, List<ListControlEntry> entries, int viewIndex, string typeName) { // Contains: // Entries --- ListEntries cardinality 1 foreach (ListControlEntry listEntry in entries) { ListControlEntryDefinition lved = LoadListControlEntryDefinitionFromObjectModel(listEntry, viewIndex, typeName); if (lved == null) { this.ReportErrorForLoadingFromObjectModel( StringUtil.Format(FormatAndOutXmlLoadingStrings.LoadTagFailedInFormattingData, typeName, viewIndex, XmlTags.ListEntryNode), typeName); listBody.defaultEntryDefinition = null; return; } // determine if we have a default entry and if it's already set if (lved.appliesTo == null) { if (listBody.defaultEntryDefinition == null) { listBody.defaultEntryDefinition = lved; } else { //Error at XPath {0} in file {1}: There cannot be more than one default {2}. this.ReportErrorForLoadingFromObjectModel( StringUtil.Format(FormatAndOutXmlLoadingStrings.TooManyDefaultShapeEntryInFormattingData, typeName, viewIndex, XmlTags.ListEntryNode), typeName); listBody.defaultEntryDefinition = null; return; // fatal error } } else { listBody.optionalEntryList.Add(lved); } } // list entries is empty if (listBody.defaultEntryDefinition == null) { // Error: there must be at least one default this.ReportErrorForLoadingFromObjectModel( StringUtil.Format(FormatAndOutXmlLoadingStrings.NoDefaultShapeEntryInFormattingData, typeName, viewIndex, XmlTags.ListEntryNode), typeName); } } /// <summary> /// Load ListEntry into ListControlEntryDefinition /// </summary> /// <param name="listEntry"></param> /// <param name="viewIndex"></param> /// <param name="typeName"></param> /// <returns></returns> private ListControlEntryDefinition LoadListControlEntryDefinitionFromObjectModel(ListControlEntry listEntry, int viewIndex, string typeName) { ListControlEntryDefinition lved = new ListControlEntryDefinition(); // Contains: // SelectedBy --- EntrySelectedBy(TypeName) cardinality 0..1 // Items --- ListItems cardinality 1 if (listEntry.EntrySelectedBy != null) { lved.appliesTo = LoadAppliesToSectionFromObjectModel(listEntry.EntrySelectedBy.TypeNames, listEntry.EntrySelectedBy.SelectionCondition); } LoadListControlItemDefinitionsFromObjectModel(lved, listEntry.Items, viewIndex, typeName); if (lved.itemDefinitionList == null) { return null; } return lved; } /// <summary> /// Load ListItems into ListControlItemDefinition /// </summary> /// <param name="lved"></param> /// <param name="listItems"></param> /// <param name="viewIndex"></param> /// <param name="typeName"></param> private void LoadListControlItemDefinitionsFromObjectModel(ListControlEntryDefinition lved, List<ListControlEntryItem> listItems, int viewIndex, string typeName) { foreach (ListControlEntryItem listItem in listItems) { ListControlItemDefinition lvid = new ListControlItemDefinition(); // Contains: // DisplayEntry --- Expression cardinality 0..1 // Label --- Label cardinality 0..1 if (listItem.DisplayEntry != null) { ExpressionToken expression = LoadExpressionFromObjectModel(listItem.DisplayEntry, viewIndex, typeName); if (expression == null) { lved.itemDefinitionList = null; return; // fatal } FieldPropertyToken fpt = new FieldPropertyToken(); fpt.expression = expression; fpt.fieldFormattingDirective.formatString = listItem.FormatString; lvid.formatTokenList.Add(fpt); if (listItem.ItemSelectionCondition != null) { var conditionToken = LoadExpressionFromObjectModel(listItem.ItemSelectionCondition, viewIndex, typeName); lvid.conditionToken = conditionToken; } } if (!String.IsNullOrEmpty(listItem.Label)) { TextToken tt = new TextToken(); tt.text = listItem.Label; lvid.label = tt; } lved.itemDefinitionList.Add(lvid); } // we must have at least a definition in th elist if (lved.itemDefinitionList.Count == 0) { //Error: At least one list view item must be specified. this.ReportErrorForLoadingFromObjectModel( StringUtil.Format(FormatAndOutXmlLoadingStrings.NoListViewItemInFormattingData, typeName, viewIndex), typeName); lved.itemDefinitionList = null; return; //fatal } } #endregion Load ListControl #region Load WideControl /// <summary> /// Load the WideControl into the WideControlBody /// </summary> /// <param name="wide"></param> /// <param name="viewIndex"></param> /// <param name="typeName"></param> /// <returns></returns> private WideControlBody LoadWideControlFromObjectModel(WideControl wide, int viewIndex, string typeName) { WideControlBody wideBody = new WideControlBody(); // Contains: // Columns --- ColumnNumbers cardinality 0..1 // Entries --- WideEntries cardinality 1 wideBody.columns = (int)wide.Columns; if (wide.AutoSize) wideBody.autosize = true; LoadWideControlEntriesFromObjectModel(wideBody, wide.Entries, viewIndex, typeName); if (wideBody.defaultEntryDefinition == null) { // if we have no default entry definition, it means there was a failure return null; } return wideBody; } /// <summary> /// Load WideEntries /// </summary> /// <param name="wideBody"></param> /// <param name="wideEntries"></param> /// <param name="viewIndex"></param> /// <param name="typeName"></param> private void LoadWideControlEntriesFromObjectModel(WideControlBody wideBody, List<WideControlEntryItem> wideEntries, int viewIndex, string typeName) { foreach (WideControlEntryItem wideItem in wideEntries) { WideControlEntryDefinition wved = LoadWideControlEntryFromObjectModel(wideItem, viewIndex, typeName); if (wved == null) { this.ReportErrorForLoadingFromObjectModel( StringUtil.Format(FormatAndOutXmlLoadingStrings.InvalidFormattingData, typeName, viewIndex, XmlTags.WideEntryNode), typeName); wideBody.defaultEntryDefinition = null; return; } // determine if we have a default entry and if it's already set if (wved.appliesTo == null) { if (wideBody.defaultEntryDefinition == null) { wideBody.defaultEntryDefinition = wved; } else { //Error at XPath {0} in file {1}: There cannot be more than one default {2}. this.ReportErrorForLoadingFromObjectModel( StringUtil.Format(FormatAndOutXmlLoadingStrings.TooManyDefaultShapeEntryInFormattingData, typeName, viewIndex, XmlTags.WideEntryNode), typeName); wideBody.defaultEntryDefinition = null; return; // fatal error } } else { wideBody.optionalEntryList.Add(wved); } } if (wideBody.defaultEntryDefinition == null) { this.ReportErrorForLoadingFromObjectModel( StringUtil.Format(FormatAndOutXmlLoadingStrings.NoDefaultShapeEntryInFormattingData, typeName, viewIndex, XmlTags.WideEntryNode), typeName); } } /// <summary> /// Load WideEntry into WieControlEntryDefinition /// </summary> /// <param name="wideItem"></param> /// <param name="viewIndex"></param> /// <param name="typeName"></param> /// <returns></returns> private WideControlEntryDefinition LoadWideControlEntryFromObjectModel(WideControlEntryItem wideItem, int viewIndex, string typeName) { WideControlEntryDefinition wved = new WideControlEntryDefinition(); // Contains: // SelectedBy --- EntrySelectedBy (TypeName) cardinality 0..1 // DisplayEntry --- WideItem (Expression) cardinality 1 // process selectedBy property if (wideItem.EntrySelectedBy != null) { wved.appliesTo = LoadAppliesToSectionFromObjectModel(wideItem.EntrySelectedBy.TypeNames, wideItem.EntrySelectedBy.SelectionCondition); } // process displayEntry property ExpressionToken expression = LoadExpressionFromObjectModel(wideItem.DisplayEntry, viewIndex, typeName); if (expression == null) { return null; // fatal } FieldPropertyToken fpt = new FieldPropertyToken(); fpt.expression = expression; fpt.fieldFormattingDirective.formatString = wideItem.FormatString; wved.formatTokenList.Add(fpt); return wved; } #endregion Load WideControl #region Load CustomControl private ComplexControlBody LoadCustomControlFromObjectModel(CustomControl custom, int viewIndex, string typeName) { if (custom._cachedBody != null) return custom._cachedBody; var ccb = new ComplexControlBody(); foreach (var entry in custom.Entries) { var cced = LoadComplexControlEntryDefinitionFromObjectModel(entry, viewIndex, typeName); if (cced.appliesTo == null) { ccb.defaultEntry = cced; } else { ccb.optionalEntryList.Add(cced); } } Interlocked.CompareExchange(ref custom._cachedBody, ccb, null); return ccb; } private ComplexControlEntryDefinition LoadComplexControlEntryDefinitionFromObjectModel(CustomControlEntry entry, int viewIndex, string typeName) { var cced = new ComplexControlEntryDefinition(); if (entry.SelectedBy != null) { cced.appliesTo = LoadAppliesToSectionFromObjectModel(entry.SelectedBy.TypeNames, entry.SelectedBy.SelectionCondition); } foreach (var item in entry.CustomItems) { cced.itemDefinition.formatTokenList.Add(LoadFormatTokenFromObjectModel(item, viewIndex, typeName)); } return cced; } private FormatToken LoadFormatTokenFromObjectModel(CustomItemBase item, int viewIndex, string typeName) { var newline = item as CustomItemNewline; if (newline != null) { return new NewLineToken { count = newline.Count }; } var text = item as CustomItemText; if (text != null) { return new TextToken { text = text.Text }; } var expr = item as CustomItemExpression; if (expr != null) { var cpt = new CompoundPropertyToken { enumerateCollection = expr.EnumerateCollection }; if (expr.ItemSelectionCondition != null) { cpt.conditionToken = LoadExpressionFromObjectModel(expr.ItemSelectionCondition, viewIndex, typeName); } if (expr.Expression != null) { cpt.expression = LoadExpressionFromObjectModel(expr.Expression, viewIndex, typeName); } if (expr.CustomControl != null) { cpt.control = LoadCustomControlFromObjectModel(expr.CustomControl, viewIndex, typeName); } return cpt; } var frame = (CustomItemFrame)item; var frameToken = new FrameToken { frameInfoDefinition = { leftIndentation = (int) frame.LeftIndent, rightIndentation = (int) frame.RightIndent, firstLine = frame.FirstLineHanging != 0 ? -(int) frame.FirstLineHanging : (int) frame.FirstLineIndent } }; foreach (var i in frame.CustomItems) { frameToken.itemDefinition.formatTokenList.Add(LoadFormatTokenFromObjectModel(i, viewIndex, typeName)); } return frameToken; } #endregion Load Custom Control #endregion load formatting data from FormatViewDefinition #region Default Settings Loading private void LoadDefaultSettings(TypeInfoDataBase db, XmlNode defaultSettingsNode) { // all these nodes are of [0..1] cardinality bool propertyCountForTableFound = false; bool showErrorsAsMessagesFound = false; bool showErrorsInFormattedOutputFound = false; bool enumerableExpansionsFound = false; bool multilineTablesFound = false; bool tempVal; using (this.StackFrame(defaultSettingsNode)) { foreach (XmlNode n in defaultSettingsNode.ChildNodes) { if (MatchNodeName(n, XmlTags.ShowErrorsAsMessagesNode)) { if (showErrorsAsMessagesFound) { ProcessDuplicateNode(n); } showErrorsAsMessagesFound = true; if (ReadBooleanNode(n, out tempVal)) db.defaultSettingsSection.formatErrorPolicy.ShowErrorsAsMessages = tempVal; } else if (MatchNodeName(n, XmlTags.ShowErrorsInFormattedOutputNode)) { if (showErrorsInFormattedOutputFound) { ProcessDuplicateNode(n); } showErrorsInFormattedOutputFound = true; if (ReadBooleanNode(n, out tempVal)) db.defaultSettingsSection.formatErrorPolicy.ShowErrorsInFormattedOutput = tempVal; } else if (MatchNodeName(n, XmlTags.PropertyCountForTableNode)) { if (propertyCountForTableFound) { ProcessDuplicateNode(n); } propertyCountForTableFound = true; int val; if (ReadPositiveIntegerValue(n, out val)) { db.defaultSettingsSection.shapeSelectionDirectives.PropertyCountForTable = val; } else { //Error at XPath {0} in file {1}: Invalid {2} value. this.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.InvalidNodeValue, ComputeCurrentXPath(), FilePath, XmlTags.PropertyCountForTableNode)); } } else if (MatchNodeName(n, XmlTags.MultilineTablesNode)) { if (multilineTablesFound) { ProcessDuplicateNode(n); } multilineTablesFound = true; if (ReadBooleanNode(n, out tempVal)) { db.defaultSettingsSection.MultilineTables = tempVal; } else { //Error at XPath {0} in file {1}: Invalid {2} value. this.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.InvalidNodeValue, ComputeCurrentXPath(), FilePath, XmlTags.MultilineTablesNode)); } } else if (MatchNodeName(n, XmlTags.EnumerableExpansionsNode)) { if (enumerableExpansionsFound) { ProcessDuplicateNode(n); } enumerableExpansionsFound = true; db.defaultSettingsSection.enumerableExpansionDirectiveList = LoadEnumerableExpansionDirectiveList(n); } else { this.ProcessUnknownNode(n); } } } } private List<EnumerableExpansionDirective> LoadEnumerableExpansionDirectiveList(XmlNode expansionListNode) { List<EnumerableExpansionDirective> retVal = new List<EnumerableExpansionDirective>(); using (this.StackFrame(expansionListNode)) { int k = 0; foreach (XmlNode n in expansionListNode.ChildNodes) { if (MatchNodeName(n, XmlTags.EnumerableExpansionNode)) { EnumerableExpansionDirective eed = LoadEnumerableExpansionDirective(n, k++); if (eed == null) { //Error at XPath {0} in file {1}: {2} failed to load. this.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.LoadTagFailed, ComputeCurrentXPath(), FilePath, XmlTags.EnumerableExpansionNode)); return null; // fatal error } retVal.Add(eed); } else { this.ProcessUnknownNode(n); } } } return retVal; } private EnumerableExpansionDirective LoadEnumerableExpansionDirective(XmlNode directive, int index) { using (this.StackFrame(directive, index)) { EnumerableExpansionDirective eed = new EnumerableExpansionDirective(); bool appliesToNodeFound = false; // cardinality 1 bool expandNodeFound = false; // cardinality 1 foreach (XmlNode n in directive.ChildNodes) { if (MatchNodeName(n, XmlTags.EntrySelectedByNode)) { if (appliesToNodeFound) { this.ProcessDuplicateNode(n); return null; //fatal } appliesToNodeFound = true; eed.appliesTo = LoadAppliesToSection(n, true); } else if (MatchNodeName(n, XmlTags.ExpandNode)) { if (expandNodeFound) { this.ProcessDuplicateNode(n); return null; //fatal } expandNodeFound = true; string s = GetMandatoryInnerText(n); if (s == null) { return null; //fatal } bool success = EnumerableExpansionConversion.Convert(s, out eed.enumerableExpansion); if (!success) { //Error at XPath {0} in file {1}: Invalid {2} value. this.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.InvalidNodeValue, ComputeCurrentXPath(), FilePath, XmlTags.ExpandNode)); return null; //fatal } } else { this.ProcessUnknownNode(n); } } return eed; } } #endregion #region Type Groups Loading private void LoadTypeGroups(TypeInfoDataBase db, XmlNode typeGroupsNode) { using (this.StackFrame(typeGroupsNode)) { int typeGroupCount = 0; foreach (XmlNode n in typeGroupsNode.ChildNodes) { if (MatchNodeName(n, XmlTags.SelectionSetNode)) { LoadTypeGroup(db, n, typeGroupCount++); } else { ProcessUnknownNode(n); } } // for each } //using } private void LoadTypeGroup(TypeInfoDataBase db, XmlNode typeGroupNode, int index) { using (this.StackFrame(typeGroupNode, index)) { // create data structure TypeGroupDefinition typeGroupDefinition = new TypeGroupDefinition(); bool nameNodeFound = false; foreach (XmlNode n in typeGroupNode.ChildNodes) { if (MatchNodeName(n, XmlTags.NameNode)) { if (nameNodeFound) { this.ProcessDuplicateNode(n); continue; } nameNodeFound = true; typeGroupDefinition.name = GetMandatoryInnerText(n); } else if (MatchNodeName(n, XmlTags.TypesNode)) { LoadTypeGroupTypeRefs(n, typeGroupDefinition); } else { this.ProcessUnknownNode(n); } } if (!nameNodeFound) { this.ReportMissingNode(XmlTags.NameNode); } // finally add to the list db.typeGroupSection.typeGroupDefinitionList.Add(typeGroupDefinition); } // using } private void LoadTypeGroupTypeRefs(XmlNode typesNode, TypeGroupDefinition typeGroupDefinition) { using (this.StackFrame(typesNode)) { int typeRefCount = 0; foreach (XmlNode n in typesNode.ChildNodes) { if (MatchNodeName(n, XmlTags.TypeNameNode)) { using (this.StackFrame(n, typeRefCount++)) { TypeReference tr = new TypeReference(); tr.name = GetMandatoryInnerText(n); typeGroupDefinition.typeReferenceList.Add(tr); } // using } else { ProcessUnknownNode(n); } } } } #endregion #region AppliesTo Loading private AppliesTo LoadAppliesToSection(XmlNode appliesToNode, bool allowSelectionCondition) { using (this.StackFrame(appliesToNode)) { AppliesTo appliesTo = new AppliesTo(); // expect: type ref, group ref, or nothing foreach (XmlNode n in appliesToNode.ChildNodes) { using (this.StackFrame(n)) { if (MatchNodeName(n, XmlTags.SelectionSetNameNode)) { TypeGroupReference tgr = LoadTypeGroupReference(n); if (tgr != null) { appliesTo.referenceList.Add(tgr); } else { return null; } } else if (MatchNodeName(n, XmlTags.TypeNameNode)) { TypeReference tr = LoadTypeReference(n); if (tr != null) { appliesTo.referenceList.Add(tr); } else { return null; } } else if (allowSelectionCondition && MatchNodeName(n, XmlTags.SelectionConditionNode)) { TypeOrGroupReference tgr = LoadSelectionConditionNode(n); if (tgr != null) { appliesTo.referenceList.Add(tgr); } else { return null; } } else { this.ProcessUnknownNode(n); } } // using } if (appliesTo.referenceList.Count == 0) { // we do not accept an empty list //Error at XPath {0} in file {1}: No type or condition is specified for applying the view. this.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.EmptyAppliesTo, ComputeCurrentXPath(), FilePath)); return null; } return appliesTo; } } private TypeReference LoadTypeReference(XmlNode n) { string val = GetMandatoryInnerText(n); if (val != null) { TypeReference tr = new TypeReference(); tr.name = val; return tr; } return null; } private TypeGroupReference LoadTypeGroupReference(XmlNode n) { string val = GetMandatoryInnerText(n); if (val != null) { TypeGroupReference tgr = new TypeGroupReference(); tgr.name = val; return tgr; } return null; } private TypeOrGroupReference LoadSelectionConditionNode(XmlNode selectionConditionNode) { using (this.StackFrame(selectionConditionNode)) { TypeOrGroupReference retVal = null; bool expressionNodeFound = false; // cardinality 1 // these two nodes are mutually exclusive bool typeFound = false; // cardinality 0..1 bool typeGroupFound = false; // cardinality 0..1 ExpressionNodeMatch expressionMatch = new ExpressionNodeMatch(this); foreach (XmlNode n in selectionConditionNode.ChildNodes) { if (MatchNodeName(n, XmlTags.SelectionSetNameNode)) { if (typeGroupFound) { this.ProcessDuplicateAlternateNode(n, XmlTags.SelectionSetNameNode, XmlTags.TypeNameNode); return null; } typeGroupFound = true; TypeGroupReference tgr = LoadTypeGroupReference(n); if (tgr != null) { retVal = tgr; } else { return null; } } else if (MatchNodeName(n, XmlTags.TypeNameNode)) { if (typeFound) { this.ProcessDuplicateAlternateNode(n, XmlTags.SelectionSetNameNode, XmlTags.TypeNameNode); return null; } typeFound = true; TypeReference tr = LoadTypeReference(n); if (tr != null) { retVal = tr; } else { return null; } } else if (expressionMatch.MatchNode(n)) { if (expressionNodeFound) { this.ProcessDuplicateNode(n); return null; // fatal error } expressionNodeFound = true; if (!expressionMatch.ProcessNode(n)) return null; // fatal error } else { this.ProcessUnknownNode(n); } } if (typeFound && typeGroupFound) { //Error at XPath {0} in file {1}: Cannot have SelectionSetName and TypeName at the same time. this.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.SelectionSetNameAndTypeName, ComputeCurrentXPath(), FilePath)); return null; // fatal error } if (retVal == null) { // missing mandatory node this.ReportMissingNodes(new string[] { XmlTags.SelectionSetNameNode, XmlTags.TypeNameNode }); return null; } if (expressionNodeFound) { // mandatory node retVal.conditionToken = expressionMatch.GenerateExpressionToken(); if (retVal.conditionToken == null) { return null; // fatal error } return retVal; } // failure: expression is mandatory //Error at XPath {0} in file {1}: An expression is expected. this.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.ExpectExpression, ComputeCurrentXPath(), FilePath)); return null; } } #endregion #region GroupBy Loading private GroupBy LoadGroupBySection(XmlNode groupByNode) { using (this.StackFrame(groupByNode)) { ExpressionNodeMatch expressionMatch = new ExpressionNodeMatch(this); ComplexControlMatch controlMatch = new ComplexControlMatch(this); bool expressionNodeFound = false; // cardinality 0..1 // these two nodes are mutually exclusive bool controlFound = false; // cardinality 0..1 bool labelFound = false; // cardinality 0..1 GroupBy groupBy = new GroupBy(); TextToken labelTextToken = null; foreach (XmlNode n in groupByNode) { if (expressionMatch.MatchNode(n)) { if (expressionNodeFound) { this.ProcessDuplicateNode(n); return null; // fatal error } expressionNodeFound = true; if (!expressionMatch.ProcessNode(n)) return null; // fatal error } else if (controlMatch.MatchNode(n)) { if (controlFound) { this.ProcessDuplicateAlternateNode(n, XmlTags.ComplexControlNode, XmlTags.ComplexControlNameNode); return null; } controlFound = true; if (!controlMatch.ProcessNode(n)) return null; // fatal error } else if (MatchNodeNameWithAttributes(n, XmlTags.LabelNode)) { if (labelFound) { this.ProcessDuplicateAlternateNode(n, XmlTags.ComplexControlNode, XmlTags.ComplexControlNameNode); return null; } labelFound = true; labelTextToken = LoadLabel(n); if (labelTextToken == null) { return null; // fatal error } } else { this.ProcessUnknownNode(n); } } if (controlFound && labelFound) { //Error at XPath {0} in file {1}: Cannot have control and label at the same time. this.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.ControlAndLabel, ComputeCurrentXPath(), FilePath)); return null; // fatal error } if (controlFound || labelFound) { if (!expressionNodeFound) { //Error at XPath {0} in file {1}: Cannot have control or label without an expression. this.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.ControlLabelWithoutExpression, ComputeCurrentXPath(), FilePath)); return null; // fatal error } if (controlFound) { groupBy.startGroup.control = controlMatch.Control; } else if (labelFound) { groupBy.startGroup.labelTextToken = labelTextToken; } } if (expressionNodeFound) { // we add only if we encountered one, since it's not mandatory ExpressionToken expression = expressionMatch.GenerateExpressionToken(); if (expression == null) { return null; // fatal error } groupBy.startGroup.expression = expression; return groupBy; } // failure: expression is mandatory //Error at XPath {0} in file {1}: An expression is expected. this.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.ExpectExpression, ComputeCurrentXPath(), FilePath)); return null; } } private TextToken LoadLabel(XmlNode textNode) { using (this.StackFrame(textNode)) { return LoadTextToken(textNode); } } private TextToken LoadTextToken(XmlNode n) { TextToken tt = new TextToken(); if (!LoadStringResourceReference(n, out tt.resource)) { return null; } if (tt.resource != null) { // inner text is optional tt.text = n.InnerText; return tt; } // inner text is mandatory tt.text = this.GetMandatoryInnerText(n); if (tt.text == null) return null; return tt; } private bool LoadStringResourceReference(XmlNode n, out StringResourceReference resource) { resource = null; XmlElement e = n as XmlElement; if (e == null) { //Error at XPath {0} in file {1}: Node should be an XmlElement. this.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.NonXmlElementNode, ComputeCurrentXPath(), FilePath)); return false; } if (e.Attributes.Count <= 0) { // no resources to load return true; } // need to find mandatory attributes resource = LoadResourceAttributes(e.Attributes); // we committed to having resources, if not obtained, it's an error return resource != null; } private StringResourceReference LoadResourceAttributes(XmlAttributeCollection attributes) { StringResourceReference resource = new StringResourceReference(); foreach (XmlAttribute a in attributes) { if (MatchAttributeName(a, XmlTags.AssemblyNameAttribute)) { resource.assemblyName = GetMandatoryAttributeValue(a); if (resource.assemblyName == null) return null; } else if (MatchAttributeName(a, XmlTags.BaseNameAttribute)) { resource.baseName = GetMandatoryAttributeValue(a); if (resource.baseName == null) return null; } else if (MatchAttributeName(a, XmlTags.ResourceIdAttribute)) { resource.resourceId = GetMandatoryAttributeValue(a); if (resource.resourceId == null) return null; } else { ProcessUnknownAttribute(a); return null; } } // make sure we got all the attributes, since allof them are mandatory if (resource.assemblyName == null) { ReportMissingAttribute(XmlTags.AssemblyNameAttribute); return null; } if (resource.baseName == null) { ReportMissingAttribute(XmlTags.BaseNameAttribute); return null; } if (resource.resourceId == null) { ReportMissingAttribute(XmlTags.ResourceIdAttribute); return null; } // success in loading resource.loadingInfo = this.LoadingInfo; // optional pre-load and binding verification if (this.VerifyStringResources) { DisplayResourceManagerCache.LoadingResult result; DisplayResourceManagerCache.AssemblyBindingStatus bindingStatus; this.displayResourceManagerCache.VerifyResource(resource, out result, out bindingStatus); if (result != DisplayResourceManagerCache.LoadingResult.NoError) { ReportStringResourceFailure(resource, result, bindingStatus); return null; } } return resource; } private void ReportStringResourceFailure(StringResourceReference resource, DisplayResourceManagerCache.LoadingResult result, DisplayResourceManagerCache.AssemblyBindingStatus bindingStatus) { string assemblyDisplayName; switch (bindingStatus) { case DisplayResourceManagerCache.AssemblyBindingStatus.FoundInPath: { assemblyDisplayName = resource.assemblyLocation; } break; case DisplayResourceManagerCache.AssemblyBindingStatus.FoundInGac: { //"(Global Assembly Cache) {0}" assemblyDisplayName = StringUtil.Format(FormatAndOutXmlLoadingStrings.AssemblyInGAC, resource.assemblyName); } break; default: { assemblyDisplayName = resource.assemblyName; } break; } string msg = null; switch (result) { case DisplayResourceManagerCache.LoadingResult.AssemblyNotFound: { //Error at XPath {0} in file {1}: Assembly {2} is not found. msg = StringUtil.Format(FormatAndOutXmlLoadingStrings.AssemblyNotFound, ComputeCurrentXPath(), FilePath, assemblyDisplayName); } break; case DisplayResourceManagerCache.LoadingResult.ResourceNotFound: { //Error at XPath {0} in file {1}: Resource {2} in assembly {3} is not found. msg = StringUtil.Format(FormatAndOutXmlLoadingStrings.ResourceNotFound, ComputeCurrentXPath(), FilePath, resource.baseName, assemblyDisplayName); } break; case DisplayResourceManagerCache.LoadingResult.StringNotFound: { //Error at XPath {0} in file {1}: String {2} from resource {3} in assembly {4} is not found. msg = StringUtil.Format(FormatAndOutXmlLoadingStrings.StringResourceNotFound, ComputeCurrentXPath(), FilePath, resource.resourceId, resource.baseName, assemblyDisplayName); } break; } this.ReportError(msg); } #endregion #region Expression Loading /// <summary> /// helper to verify the text of a string block and /// log an error if an exception is thrown /// </summary> /// <param name="scriptBlockText">script block string to verify</param> /// <returns>true if parsed correctly, false if failed</returns> internal bool VerifyScriptBlock(string scriptBlockText) { try { this.expressionFactory.VerifyScriptBlockText(scriptBlockText); } catch (ParseException e) { //Error at XPath {0} in file {1}: Invalid script block "{2}". this.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.InvalidScriptBlock, ComputeCurrentXPath(), FilePath, e.Message)); return false; } catch (Exception e) // will rethrow { Diagnostics.Assert(false, "TypeInfoBaseLoader.VerifyScriptBlock unexpected exception " + e.GetType().FullName); throw; } return true; } /// <summary> /// helper class to wrap the loading of a script block/property name alternative tag /// </summary> private sealed class ExpressionNodeMatch { internal ExpressionNodeMatch(TypeInfoDataBaseLoader loader) { _loader = loader; } internal bool MatchNode(XmlNode n) { return _loader.MatchNodeName(n, XmlTags.PropertyNameNode) || _loader.MatchNodeName(n, XmlTags.ScriptBlockNode); } internal bool ProcessNode(XmlNode n) { if (_loader.MatchNodeName(n, XmlTags.PropertyNameNode)) { if (_token != null) { if (_token.isScriptBlock) _loader.ProcessDuplicateAlternateNode(n, XmlTags.PropertyNameNode, XmlTags.ScriptBlockNode); else _loader.ProcessDuplicateNode(n); return false; // fatal error } _token = new ExpressionToken(); _token.expressionValue = _loader.GetMandatoryInnerText(n); if (_token.expressionValue == null) { //Error at XPath {0} in file {1}: Missing property. _loader.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.NoProperty, _loader.ComputeCurrentXPath(), _loader.FilePath)); _fatalError = true; return false; // fatal error } return true; } else if (_loader.MatchNodeName(n, XmlTags.ScriptBlockNode)) { if (_token != null) { if (!_token.isScriptBlock) _loader.ProcessDuplicateAlternateNode(n, XmlTags.PropertyNameNode, XmlTags.ScriptBlockNode); else _loader.ProcessDuplicateNode(n); return false; // fatal error } _token = new ExpressionToken(); _token.isScriptBlock = true; _token.expressionValue = _loader.GetMandatoryInnerText(n); if (_token.expressionValue == null) { //Error at XPath {0} in file {1}: Missing script block text. _loader.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.NoScriptBlockText, _loader.ComputeCurrentXPath(), _loader.FilePath)); _fatalError = true; return false; // fatal error } if ((!_loader._suppressValidation) && (!_loader.VerifyScriptBlock(_token.expressionValue))) { _fatalError = true; return false; // fatal error } return true; } // this should never happen if the API is used correctly PSTraceSource.NewInvalidOperationException(); return false; } internal ExpressionToken GenerateExpressionToken() { if (_fatalError) { // we failed the loading already, just return return null; } if (_token == null) { // we do not have a token: we never got one // the user should have specified either a property or a script block _loader.ReportMissingNodes(new string[] { XmlTags.PropertyNameNode, XmlTags.ScriptBlockNode }); return null; } return _token; } private TypeInfoDataBaseLoader _loader; private ExpressionToken _token; private bool _fatalError = false; } /// <summary> /// helper class to wrap the loading of an expression (using ExpressionNodeMatch) /// plus the formatting string and an alternative text node /// </summary> private sealed class ViewEntryNodeMatch { internal ViewEntryNodeMatch(TypeInfoDataBaseLoader loader) { _loader = loader; } internal bool ProcessExpressionDirectives(XmlNode containerNode, List<XmlNode> unprocessedNodes) { if (containerNode == null) throw PSTraceSource.NewArgumentNullException("containerNode"); string formatString = null; TextToken textToken = null; ExpressionNodeMatch expressionMatch = new ExpressionNodeMatch(_loader); bool formatStringNodeFound = false; // cardinality 0..1 bool expressionNodeFound = false; // cardinality 0..1 bool textNodeFound = false; // cardinality 0..1 foreach (XmlNode n in containerNode.ChildNodes) { if (expressionMatch.MatchNode(n)) { if (expressionNodeFound) { _loader.ProcessDuplicateNode(n); return false; // fatal error } expressionNodeFound = true; if (!expressionMatch.ProcessNode(n)) return false; // fatal error } else if (_loader.MatchNodeName(n, XmlTags.FormatStringNode)) { if (formatStringNodeFound) { _loader.ProcessDuplicateNode(n); return false; // fatal error } formatStringNodeFound = true; formatString = _loader.GetMandatoryInnerText(n); if (formatString == null) { //Error at XPath {0} in file {1}: Missing a format string. _loader.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.NoFormatString, _loader.ComputeCurrentXPath(), _loader.FilePath)); return false; // fatal error } } else if (_loader.MatchNodeNameWithAttributes(n, XmlTags.TextNode)) { if (textNodeFound) { _loader.ProcessDuplicateNode(n); return false; // fatal error } textNodeFound = true; textToken = _loader.LoadText(n); if (textToken == null) { //Error at XPath {0} in file {1}: Invalid {2}. _loader.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.InvalidNode, _loader.ComputeCurrentXPath(), _loader.FilePath, XmlTags.TextNode)); return false; // fatal error } } else { // for further processing by calling context unprocessedNodes.Add(n); } } // foreach if (expressionNodeFound) { // RULE: cannot have a text node and an expression at the same time if (textNodeFound) { //Error at XPath {0} in file {1}: {2} cannot be specified with an expression. _loader.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.NodeWithExpression, _loader.ComputeCurrentXPath(), _loader.FilePath, XmlTags.TextNode)); return false; // fatal error } ExpressionToken expression = expressionMatch.GenerateExpressionToken(); if (expression == null) { return false; // fatal error } // set the output data if (!string.IsNullOrEmpty(formatString)) { _formatString = formatString; } _expression = expression; } else { // RULE: we cannot have a format string without an expression node if (formatStringNodeFound) { //Error at XPath {0} in file {1}: {2} cannot be specified without an expression. _loader.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.NodeWithoutExpression, _loader.ComputeCurrentXPath(), _loader.FilePath, XmlTags.FormatStringNode)); return false; // fatal error } // we might have a text node if (textNodeFound) { _textToken = textToken; } } return true; } internal string FormatString { get { return _formatString; } } internal TextToken TextToken { get { return _textToken; } } internal ExpressionToken Expression { get { return _expression; } } private string _formatString; private TextToken _textToken; private ExpressionToken _expression; private TypeInfoDataBaseLoader _loader; } #endregion #region Complex Control Loading private sealed class ComplexControlMatch { internal ComplexControlMatch(TypeInfoDataBaseLoader loader) { _loader = loader; } internal bool MatchNode(XmlNode n) { return _loader.MatchNodeName(n, XmlTags.ComplexControlNode) || _loader.MatchNodeName(n, XmlTags.ComplexControlNameNode); } internal bool ProcessNode(XmlNode n) { if (_loader.MatchNodeName(n, XmlTags.ComplexControlNode)) { // load an embedded complex control _control = _loader.LoadComplexControl(n); return true; } else if (_loader.MatchNodeName(n, XmlTags.ComplexControlNameNode)) { string name = _loader.GetMandatoryInnerText(n); if (name == null) { return false; } ControlReference controlRef = new ControlReference(); controlRef.name = name; controlRef.controlType = typeof(ComplexControlBody); _control = controlRef; return true; } // this should never happen if the API is used correctly PSTraceSource.NewInvalidOperationException(); return false; } internal ControlBase Control { get { return _control; } } private ControlBase _control; private TypeInfoDataBaseLoader _loader; } #endregion } }
41.560641
180
0.514701
[ "MIT" ]
Jellyfrog/PowerShell
src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader.cs
90,810
C#
#if NETCORE namespace System.Extensions.RazorCompilation { using System.IO; using System.Diagnostics; using System.Reflection; using System.Collections.Generic; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language.Extensions; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using System.Runtime.Loader; public static class RazorDebugger { public static List<KeyValuePair<string, Func<object>>> Execute(object debugObj) { if (debugObj == null) return null; var @namespace = (string)debugObj.GetType().GetProperty("Namespace").GetValue(debugObj); var baseType = (string)debugObj.GetType().GetProperty("BaseType").GetValue(debugObj); var razorPath = (string)debugObj.GetType().GetProperty("RazorPath").GetValue(debugObj); var cSharpIdentifier = typeof(RazorProjectEngine).Assembly.GetType("Microsoft.AspNetCore.Razor.Language.CSharpIdentifier"); var sanitizeIdentifier = cSharpIdentifier.GetMethod("SanitizeIdentifier", BindingFlags.Public | BindingFlags.Static); var engine = RazorProjectEngine.Create( RazorConfiguration.Default, RazorProjectFileSystem.Create(razorPath), (builder) => { SectionDirective.Register(builder); builder.SetNamespace(@namespace) .AddDefaultImports(@" @using System @using System.Collections.Generic @using System.Threading.Tasks @using Microsoft.AspNetCore.Mvc "); builder.ConfigureClass( (document, @class) => { @class.BaseType = baseType; var relativePath = document.Source.RelativePath; @class.ClassName = (string)sanitizeIdentifier.Invoke(null, new[] { relativePath.Substring(0, relativePath.Length - ".cshtml".Length) }); }); }); var debugItems = new List<KeyValuePair<string, Func<object>>>(); foreach (var projectItem in engine.FileSystem.EnumerateItems("/")) { debugItems.Add(new KeyValuePair<string, Func<object>>( projectItem.FilePath, () => { var code = engine.Process(projectItem).GetCSharpDocument().GeneratedCode; var references = new List<MetadataReference>(); foreach (var reference in AssemblyLoadContext.Default.Assemblies) { if (reference.IsDynamic || string.IsNullOrEmpty(reference.Location) || !File.Exists(reference.Location)) continue; references.Add(MetadataReference.CreateFromFile(reference.Location)); } var syntaxTree = CSharpSyntaxTree.ParseText(code); var compilation = CSharpCompilation.Create( $"Razor_{Guid.NewGuid().ToString("N")}", new[] { syntaxTree }, references, new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); var assemblyStream = new MemoryStream(); var pdbStream = new MemoryStream(); var result = compilation.Emit(assemblyStream, pdbStream); if (!result.Success) { string error = null; foreach (var diagnostic in result.Diagnostics) { if (diagnostic.IsWarningAsError || diagnostic.Severity == DiagnosticSeverity.Error) { error += diagnostic.ToString(); } } throw new Exception(error); } assemblyStream.Seek(0, SeekOrigin.Begin); pdbStream.Seek(0, SeekOrigin.Begin); var assembly = AssemblyLoadContext.Default.LoadFromStream(assemblyStream, pdbStream); return Activator.CreateInstance(assembly.GetTypes()[0]); })); } return debugItems; } } } #endif
52.197802
168
0.516421
[ "MIT" ]
SystemExtensions/System.Extensions
System.Extensions.RazorCompilation/RazorDebugger.cs
4,752
C#
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** 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.Aws.WafV2.Outputs { [OutputType] public sealed class WebAclRuleStatementAndStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatch { /// <summary> /// Inspect all query arguments. /// </summary> public readonly Outputs.WebAclRuleStatementAndStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchAllQueryArguments? AllQueryArguments; /// <summary> /// Inspect the request body, which immediately follows the request headers. /// </summary> public readonly Outputs.WebAclRuleStatementAndStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchBody? Body; /// <summary> /// Inspect the HTTP method. The method indicates the type of operation that the request is asking the origin to perform. /// </summary> public readonly Outputs.WebAclRuleStatementAndStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchMethod? Method; /// <summary> /// Inspect the query string. This is the part of a URL that appears after a `?` character, if any. /// </summary> public readonly Outputs.WebAclRuleStatementAndStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchQueryString? QueryString; /// <summary> /// Inspect a single header. See Single Header below for details. /// </summary> public readonly Outputs.WebAclRuleStatementAndStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchSingleHeader? SingleHeader; /// <summary> /// Inspect a single query argument. See Single Query Argument below for details. /// </summary> public readonly Outputs.WebAclRuleStatementAndStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchSingleQueryArgument? SingleQueryArgument; /// <summary> /// Inspect the request URI path. This is the part of a web request that identifies a resource, for example, `/images/daily-ad.jpg`. /// </summary> public readonly Outputs.WebAclRuleStatementAndStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchUriPath? UriPath; [OutputConstructor] private WebAclRuleStatementAndStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatch( Outputs.WebAclRuleStatementAndStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchAllQueryArguments? allQueryArguments, Outputs.WebAclRuleStatementAndStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchBody? body, Outputs.WebAclRuleStatementAndStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchMethod? method, Outputs.WebAclRuleStatementAndStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchQueryString? queryString, Outputs.WebAclRuleStatementAndStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchSingleHeader? singleHeader, Outputs.WebAclRuleStatementAndStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchSingleQueryArgument? singleQueryArgument, Outputs.WebAclRuleStatementAndStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatchUriPath? uriPath) { AllQueryArguments = allQueryArguments; Body = body; Method = method; QueryString = queryString; SingleHeader = singleHeader; SingleQueryArgument = singleQueryArgument; UriPath = uriPath; } } }
60.802817
189
0.785036
[ "ECL-2.0", "Apache-2.0" ]
Otanikotani/pulumi-aws
sdk/dotnet/WafV2/Outputs/WebAclRuleStatementAndStatementStatementOrStatementStatementNotStatementStatementSizeConstraintStatementFieldToMatch.cs
4,317
C#
using System; using System.Collections.Generic; using System.IO; using System.Linq; namespace Day10 { public class Solver { static List<int> _adapters; public Solver() { GetInputs(); } public int Solve1() { var distribution = new Dictionary<int, int>{{1, 0}, {2, 0 }, {3, 0}}; // The first and last adapter gaps are fairly fixed distribution[_adapters[1]]++; distribution[3]++; for (var i = 0; i < _adapters.Count - 1; i++) { var diff = _adapters[i + 1] - _adapters[i]; distribution[diff]++; } return distribution[1] * distribution[3]; } public long Solve2() { var potentialRemovables = CalculatePotentialRemovables(_adapters); var (permutationsSoFar, refinedRemovables) = CalculateWithIsolatedRemovables(potentialRemovables); var groups = BuildGroups(_adapters, refinedRemovables); foreach (var group in groups) { permutationsSoFar *= group.CountValidPermutations(); } return permutationsSoFar; } static List<int> CalculatePotentialRemovables(List<int> adapters) { var potentialRemovables = new List<int>(); for (var i = 1; i < adapters.Count - 1; i++) { // an element is a candidate for removal if the sum of the gap to its left and right is less than 3 var leftGap = adapters[i] - adapters[i-1]; var rightGap = adapters[i+1] - adapters[i]; if (leftGap + rightGap >= 3) continue; potentialRemovables.Add(adapters[i]); } return potentialRemovables; } static (long, List<int>) CalculateWithIsolatedRemovables(List<int> potentialRemovables) { var permutationCount = 1L; var removablesInAGroup = new List<int>(); foreach (var index in potentialRemovables) { var isPartOfGroup = potentialRemovables.Any(x => x == index - 1 || x == index + 1); if (isPartOfGroup) { removablesInAGroup.Add(index); // needs to be simulated } else { permutationCount *= 2; //we know it can be removed } } Console.WriteLine($"The refinement process removed {potentialRemovables.Count - removablesInAGroup.Count} elements, and the current permutation count is {permutationCount}"); return (permutationCount, removablesInAGroup); } static List<Group> BuildGroups(List<int> adapters, List<int> removables) { var groups = new List<Group>(); foreach (var currentElement in removables) { var element = currentElement; var groupWithContiguousElements = groups.FirstOrDefault(g => g.Elements.Any(e => e == element - 1 || e == element + 1)); if (groupWithContiguousElements != null) { groupWithContiguousElements.Elements.Add(currentElement); } else { groups.Add(new Group(adapters) {Elements = new List<int>{currentElement}}); } } return groups; } static long CountPermutations(List<int> adapters, List<int> potentialRemovables, long permutationsSoFar) { var permutationsToTest = Math.Pow(2, potentialRemovables.Count); Console.WriteLine($"There are {permutationsToTest:n0} permutations to test."); for (var i = 0L; i < permutationsToTest; i++) { if (i % 10000 == 0) { Console.WriteLine($"On permutation {i} - {(i/permutationsToTest) * 100:P}"); } var permutationKey = Convert.ToString(i, 2).PadLeft(potentialRemovables.Count, '0'); var permutation = GeneratePermutation(permutationKey, adapters, potentialRemovables); if (permutation.IsValid()) permutationsSoFar++; } return permutationsSoFar; } static Permutation GeneratePermutation(string permutationKey, List<int> adapters, List<int> potentialRemovables) { // use permutation key to build a list of element indexes to remove from adapters var elementsToRemove = new List<int>(); for (var i = 0; i < potentialRemovables.Count; i++) { if (permutationKey[i] == '1') { elementsToRemove.Add(potentialRemovables[i]); } } var permutation = new Permutation { AdapterChain = adapters.Where((t, i) => !elementsToRemove.Contains(i)).ToList() }; return permutation; } static void GetInputs() { var lines = File.ReadAllLines("input.txt"); Console.WriteLine($"Read {lines.Length} inputs"); _adapters = lines.Select(int.Parse).ToList(); _adapters.Add(0); _adapters.Add(_adapters.Max() + 3); _adapters.Sort(); } } }
33.779141
186
0.532328
[ "MIT" ]
ncsmikewoods/AdventOfCode2020
Day10/Solver.cs
5,508
C#
using Limbo.Umbraco.Video.Models.Videos; using Limbo.Umbraco.YouTube.Options; using Microsoft.AspNetCore.Html; using Newtonsoft.Json; using Skybrud.Essentials.Json.Converters; namespace Limbo.Umbraco.YouTube.Models.Videos { /// <summary> /// Class representing the embed options of the video. /// </summary> public class YouTubeEmbed : IVideoEmbed { #region Properties /// <summary> /// Gets the embed URL. /// </summary> [JsonProperty("url")] public string Url { get; } /// <summary> /// Gets the HTML embed code. /// </summary> [JsonProperty("html")] [JsonConverter(typeof(StringJsonConverter))] public HtmlString Html { get; } /// <summary> /// Gets the player options. /// </summary> [JsonProperty("options", NullValueHandling = NullValueHandling.Ignore)] public YouTubeEmbedPlayerOptions Options { get; } #endregion #region Constructors internal YouTubeEmbed(YouTubeVideoDetails video) { YouTubeEmbedOptions o = new(video, Options ?? new YouTubeEmbedPlayerOptions()); Url = o.GetEmbedUrl(); Html = o.GetEmbedCode(); } #endregion } }
26.326531
91
0.60155
[ "MIT" ]
limbo-works/Limbo.Umbraco.YouTube
src/Limbo.Umbraco.YouTube/Models/Videos/YouTubeEmbed.cs
1,292
C#
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. // // MIT License // 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 CrossVertical.Announcement.Models; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Threading.Tasks; namespace CrossVertical.Announcement.Repository { public static class Cache { public static DBCache<Tenant> Tenants { get; set; } = new DBCache<Tenant>(); public static DBCache<Group> Groups { get; set; } = new DBCache<Group>(); public static DBCache<Team> Teams { get; set; } = new DBCache<Team>(); public static DBCache<User> Users { get; set; } = new DBCache<User>(); public static DBCache<Campaign> Announcements { get; set; } = new DBCache<Campaign>(); public static void Clear() { Tenants = new DBCache<Tenant>(); Groups = new DBCache<Group>(); Teams = new DBCache<Team>(); Users = new DBCache<User>(); Announcements = new DBCache<Campaign>(); } } public class DBCache<T> where T : DatabaseItem { private Dictionary<string, T> CachedItems { get; set; } = new Dictionary<string, T>(); public async Task<List<T>> GetAllItemsAsync() { if (CachedItems.Count == 0) // Try to fetch from DB. { var items = await DocumentDBRepository.GetItemsAsync<T>(u => u.Type == typeof(T).Name); foreach (T item in items) { CachedItems.Add(item.Id, item); } } return CachedItems.Values.ToList(); } public async Task<List<T>> GetAllItemsAsync(Expression<Func<T, bool>> predicate) { var items = await DocumentDBRepository.GetItemsAsync<T>(predicate); foreach (T item in items) { if (!CachedItems.ContainsKey(item.Id)) CachedItems.Add(item.Id, item); } return items.ToList(); } public async Task<T> GetItemAsync(string id) { if (string.IsNullOrEmpty(id)) return null; if (CachedItems.ContainsKey(id)) return CachedItems[id]; else { var tenant = await DocumentDBRepository.GetItemAsync<T>(id); if (tenant != null) { try { CachedItems.Add(id, tenant); } catch (System.Exception ex) { Helpers.ErrorLogService.LogError(ex); } return tenant; } return null; // Not found in DB. } } public async Task AddOrUpdateItemAsync(string id, T item) { var existingItem = await GetItemAsync(id); if (existingItem != null) { // Update Existing await DocumentDBRepository.UpdateItemAsync(id, item); CachedItems[id] = item; } else { try { await DocumentDBRepository.CreateItemAsync(item); CachedItems.Add(id, item); } catch (System.Exception ex) { Helpers.ErrorLogService.LogError(ex); } } } public async Task DeleteItemAsync(string id) { if (CachedItems.ContainsKey(id)) { // Update Existing await DocumentDBRepository.DeleteItemAsync(id); CachedItems.Remove(id); } else { await DocumentDBRepository.DeleteItemAsync(id); } } } }
35.730496
103
0.555578
[ "MIT" ]
OfficeDev/msteams-sample-line-of-business-apps-csharp
Cross Vertical/CompanyCommunicator/Repository/DBCache.cs
5,040
C#
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class ColorThemeSetter: MonoBehaviour { //dynamic component; //using dynamic in this scrip results in an error in RuntimeBinder //searching for solution showed that the error is related to the use of the framework version 4. //framework version 4.5 must resolve this issue //for more versatility, I decided to abandon dynamic private enum ComponentType { BUTTON, SLIDER, DROPDOWN, IMAGE } ComponentType componentType; Button buttonComponent; Slider sliderComponent; Dropdown dropdownComponent; Image imageComponent; void Awake() { FindThemeComponent(); } private void OnEnable() { SetColorByTheme(SettingsController.Instance.ActiveOptionsSet.colorTheme); SettingsController.Instance.ColorThemeChange.AddListener(SetColorByTheme); } private void Start() { //SettingsController.Instance.ColorThemeChange.AddListener(SetColorByTheme); } /* private void FindThemeComponent() { if (gameObject.GetComponent<Button>() != null) { component = gameObject.GetComponent<Button>(); return; } if (gameObject.GetComponent<Slider>() != null) { component = gameObject.GetComponent<Slider>(); return; } if (gameObject.GetComponent<Dropdown>() != null) { component = gameObject.GetComponent<Dropdown>(); return; } if (gameObject.GetComponent<Image>() != null) { component = gameObject.GetComponent<Image>(); return; }*/ /* public void SetColorByTheme(ColorTheme_SO colorTheme) { Type type = component.GetType(); if (type.Equals(typeof(Button))) { Button button = component; ColorBlock cb = button.colors; cb.normalColor = colorTheme.buttonColor; button.colors = cb; return; } if (type.Equals(typeof(Slider))) { Slider clider = component; ColorBlock cb = clider.colors; cb.normalColor = colorTheme.buttonColor; clider.colors = cb; return; } if (type.Equals(typeof(Dropdown))) { Dropdown dropdown = component; ColorBlock cb = dropdown.colors; cb.normalColor = colorTheme.buttonColor; dropdown.colors = cb; return; } if (type.Equals(typeof(Image))) { Image image = component; image.color = colorTheme.imageColor; return; } }*/ private void FindThemeComponent() { if (gameObject.GetComponent<Button>() != null) { buttonComponent = gameObject.GetComponent<Button>(); componentType = ComponentType.BUTTON; return; } if (gameObject.GetComponent<Slider>() != null) { sliderComponent = gameObject.GetComponent<Slider>(); componentType = ComponentType.SLIDER; return; } if (gameObject.GetComponent<Dropdown>() != null) { dropdownComponent = gameObject.GetComponent<Dropdown>(); componentType = ComponentType.DROPDOWN; return; } if (gameObject.GetComponent<Image>() != null) { imageComponent = gameObject.GetComponent<Image>(); componentType = ComponentType.IMAGE; return; } } public void SetColorByTheme(ColorTheme_SO colorTheme) { switch (componentType) { case (ComponentType.BUTTON): if (buttonComponent == null) { Debug.LogWarningFormat("Component type {0} not set in UI object {1} ", componentType.ToString(), gameObject.name.ToString()); return; } ColorBlock bc = buttonComponent.colors; bc.normalColor = colorTheme.buttonColor; buttonComponent.colors = bc; break; case (ComponentType.SLIDER): if (sliderComponent == null) { Debug.LogWarningFormat("Component type {0} not set in UI object {1} ", componentType.ToString(), gameObject.name.ToString()); return; } ColorBlock sc = sliderComponent.colors; sc.normalColor = colorTheme.sliderColor; sliderComponent.colors = sc; break; case (ComponentType.DROPDOWN): if (dropdownComponent == null) { Debug.LogWarningFormat("Component type {0} not set in UI object {1} ", componentType.ToString(), gameObject.name.ToString()); return; } ColorBlock dc = dropdownComponent.colors; dc.normalColor = colorTheme.dropdownColor; dropdownComponent.colors = dc; break; case (ComponentType.IMAGE): if (imageComponent == null) { Debug.LogWarningFormat("Component type {0} not set in UI object {1} ", componentType.ToString(), gameObject.name.ToString()); return; } imageComponent.color = colorTheme.imageColor; break; } } private void OnDisable() { SettingsController.Instance.ColorThemeChange.RemoveListener(SetColorByTheme); } }
31.4
100
0.526703
[ "MIT" ]
EliasFIVE/SpaceShooter
Assets/Scripts/UI/ColorThemeSetter.cs
6,123
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. #nullable enable using Microsoft.TemplateEngine.Abstractions; using Microsoft.TemplateEngine.Edge; namespace Microsoft.TemplateSearch.TemplateDiscovery { internal static class TemplateEngineHostHelper { private const string DefaultHostVersion = "1.0.0"; private static readonly Dictionary<string, string> DefaultPreferences = new Dictionary<string, string> { { "prefs:language", "C#" } }; internal static DefaultTemplateEngineHost CreateHost(string hostIdentifier, string? hostVersion = null, Dictionary<string, string>? preferences = null) { if (string.IsNullOrEmpty(hostIdentifier)) { throw new ArgumentException("hostIdentifier cannot be null"); } if (string.IsNullOrEmpty(hostVersion)) { hostVersion = DefaultHostVersion; } if (preferences == null) { preferences = DefaultPreferences; } var builtIns = new List<(Type, IIdentifiedComponent)>(); builtIns.AddRange(TemplateEngine.Edge.Components.AllComponents); builtIns.AddRange(TemplateEngine.Orchestrator.RunnableProjects.Components.AllComponents); // use "dotnetcli" as a fallback host so the correct host specific files are read. DefaultTemplateEngineHost host = new DefaultTemplateEngineHost(hostIdentifier, hostVersion, preferences, builtIns, new[] { "dotnetcli" }); return host; } } }
36.12766
159
0.652532
[ "MIT" ]
AR-May/templating
src/Microsoft.TemplateSearch.TemplateDiscovery/TemplateEngineHostHelper.cs
1,698
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Threading.Tasks; namespace backend_asp_dotnet.Models { [Table("Token", Schema = "NotesUsers")] public class Token { [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Key] public Guid Id { get; set; } [Column("token", TypeName = "NVARCHAR(500)")] [Required] public string TokenValue { get; set; } [Column("createdAt", TypeName = "DATE")] [Required] public DateTime CreatedAt { get; set; } [Column("userId", TypeName = "uniqueidentifier")] [Required] public Guid UserId { get; set; } public User User { get; set; } } }
30.296296
61
0.643032
[ "CC0-1.0" ]
AlazzR/Notes-Taking_App
backend-asp-dotnet/Models/Token.cs
820
C#
// ------------------------------------------------------------------------------ // <auto-generated> // Generated by Xsd2Code. Version 3.4.0.18239 Microsoft Reciprocal License (Ms-RL) // <NameSpace>Mim.V3109</NameSpace><Collection>Array</Collection><codeType>CSharp</codeType><EnableDataBinding>False</EnableDataBinding><EnableLazyLoading>False</EnableLazyLoading><TrackingChangesEnable>False</TrackingChangesEnable><GenTrackingClasses>False</GenTrackingClasses><HidePrivateFieldInIDE>False</HidePrivateFieldInIDE><EnableSummaryComment>True</EnableSummaryComment><VirtualProp>False</VirtualProp><IncludeSerializeMethod>True</IncludeSerializeMethod><UseBaseClass>False</UseBaseClass><GenBaseClass>False</GenBaseClass><GenerateCloneMethod>True</GenerateCloneMethod><GenerateDataContracts>False</GenerateDataContracts><CodeBaseTag>Net35</CodeBaseTag><SerializeMethodName>Serialize</SerializeMethodName><DeserializeMethodName>Deserialize</DeserializeMethodName><SaveToFileMethodName>SaveToFile</SaveToFileMethodName><LoadFromFileMethodName>LoadFromFile</LoadFromFileMethodName><GenerateXMLAttributes>True</GenerateXMLAttributes><OrderXMLAttrib>False</OrderXMLAttrib><EnableEncoding>False</EnableEncoding><AutomaticProperties>False</AutomaticProperties><GenerateShouldSerialize>False</GenerateShouldSerialize><DisableDebug>False</DisableDebug><PropNameSpecified>Default</PropNameSpecified><Encoder>UTF8</Encoder><CustomUsings></CustomUsings><ExcludeIncludedTypes>True</ExcludeIncludedTypes><EnableInitializeFields>False</EnableInitializeFields> // </auto-generated> // ------------------------------------------------------------------------------ namespace Mim.V3109 { using System; using System.Diagnostics; using System.Xml.Serialization; using System.Collections; using System.Xml.Schema; using System.ComponentModel; using System.IO; using System.Text; [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.18239")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="urn:hl7-org:v3")] public enum PORX_MT132004UK06PertinentInformation3TemplateIdExtension { /// <remarks/> [System.Xml.Serialization.XmlEnumAttribute("CSAB_RM-NPfITUK10.sourceOf2")] CSAB_RMNPfITUK10sourceOf2, } }
84
1,358
0.757228
[ "MIT" ]
Kusnaditjung/MimDms
src/Mim.V3109/Generated/PORX_MT132004UK06PertinentInformation3TemplateIdExtension.cs
2,352
C#
/* Project Orleans Cloud Service SDK ver. 1.0 Copyright (c) Microsoft Corporation All rights reserved. MIT License 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.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("Host")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Host")] [assembly: AssemblyCopyright("Copyright © 2015")] [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("c00d16fc-d011-416f-8a32-80d0d307eea4")] // 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")]
42.2
126
0.766983
[ "MIT" ]
rikace/orleans
Samples/TwitterSentiment/Host/Properties/AssemblyInfo.cs
2,533
C#
using System; using System.Globalization; using System.Reflection; using System.Resources; using Xamarin.Forms; using Xamarin.Forms.Xaml; namespace XamarinFormsClase12_01 { // You exclude the 'Extension' suffix when using in Xaml markup [ContentProperty ("Text")] public class TranslateExt : IMarkupExtension { readonly CultureInfo ci; const string ResourceId = "XamarinFormsClase12_01.RESX.Clase12Resource"; public TranslateExt () { if (Device.OS == TargetPlatform.iOS || Device.OS == TargetPlatform.Android) { ci = DependencyService.Get<iLocalize> ().GetCurrentCultureInfo (); } } public string Text { get; set; } public object ProvideValue (IServiceProvider serviceProvider) { if (Text == null) return ""; ResourceManager resmgr = new ResourceManager (ResourceId , typeof (TranslateExt).GetTypeInfo ().Assembly); var translation = resmgr.GetString (Text, ci); if (translation == null) { #if DEBUG throw new ArgumentException ( String.Format ("Key '{0}' was not found in resources '{1}' for culture '{2}'.", Text, ResourceId, ci.Name), "Text"); #else translation = Text; // HACK: returns the key, which GETS DISPLAYED TO THE USER #endif } return translation; } } }
26.34
128
0.670463
[ "MIT" ]
starl1n/Xamarin.Forms-Samples-of-Clases
Clase 12/Proyectos/XamarinFormsClase12_01/XamarinFormsClase12_01/Helper/TranslateExtension.cs
1,319
C#
using Newtonsoft.Json; using System; using static Sharp_osuApi.Enums; namespace Sharp_osuApi.Utils { public class GameModeConverter : JsonConverter { public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { GameMode gameMode = (GameMode)value; switch (gameMode) { case GameMode.osu: writer.WriteValue("0"); break; case GameMode.Taiko: writer.WriteValue("1"); break; case GameMode.CtB: writer.WriteValue("2"); break; case GameMode.Mania: writer.WriteValue("3"); break; default: writer.WriteValue("0"); break; } } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { var enumString = (string)reader.Value; GameMode? gameMode = null; switch (enumString) { case "0": gameMode = GameMode.osu; break; case "1": gameMode = GameMode.Taiko; break; case "2": gameMode = GameMode.CtB; break; case "3": gameMode = GameMode.Mania; break; default: gameMode = GameMode.osu; break; } return gameMode; } public override bool CanConvert(Type objectType) { return objectType == typeof(string); } } }
29.676923
125
0.429756
[ "MIT" ]
thedarklort/osuApi
Sharp-osuApi/Utils/GameModeConverter.cs
1,931
C#
using BuckarooSdk.Transaction; namespace BuckarooSdk.Services.Giftcards.VVVGiftcard { /// <summary> /// The Transaction class of payment method type: VVV giftcards. /// </summary> public class VVVGiftcardTransaction { private ConfiguredTransaction ConfiguredTransaction { get; } internal VVVGiftcardTransaction(ConfiguredTransaction configuredTransaction) { this.ConfiguredTransaction = configuredTransaction; } /// <summary> /// The pay function creates a configured transaction with an VVV Giftcards PayRequest, /// that is ready to be executed. /// </summary> /// <param name="request">An VVV Giftcards PayRequest</param> /// <returns></returns> public ConfiguredServiceTransaction Pay(VVVGiftcardPayRequest request) { var parameters = ServiceHelper.CreateServiceParameters(request); var configuredServiceTransaction = new ConfiguredServiceTransaction(this.ConfiguredTransaction.BaseTransaction); configuredServiceTransaction.BaseTransaction.AddService("vvvgiftcard", parameters, "pay"); return configuredServiceTransaction; } /// <summary> /// The refund function creates a configured transaction with an VVV Giftcards RefundRequest, /// that is ready to be executed. /// </summary> /// <param name="request">An VVV Giftcards RefundRequest</param> /// <returns></returns> public ConfiguredServiceTransaction Refund(VVVGiftcardRefundRequest request) { var parameters = ServiceHelper.CreateServiceParameters(request); var configuredServiceTransaction = new ConfiguredServiceTransaction(this.ConfiguredTransaction.BaseTransaction); configuredServiceTransaction.BaseTransaction.AddService("vvvgiftcard", parameters, "refund"); return configuredServiceTransaction; } } }
36.583333
115
0.775626
[ "MIT" ]
buckaroo-it/BuckarooSdk_DotNet
BuckarooSdk/Services/Giftcards/VVVGiftcard/VVVGiftcardTransaction.cs
1,758
C#
using System.Threading; using System.Threading.Tasks; using EcommerceDDD.Domain.Customers; using FluentValidation.Results; using Microsoft.AspNetCore.Identity; using EcommerceDDD.Infrastructure.Identity.Services; using EcommerceDDD.Infrastructure.Identity.Users; using EcommerceDDD.Application.Core.CQRS.QueryHandling; using EcommerceDDD.Application.Core.ExceptionHandling; namespace EcommerceDDD.Application.Customers.AuthenticateCustomer; public class AuthenticateCustomerQueryHandler : QueryHandler<AuthenticateCustomerQuery, CustomerViewModel> { private readonly SignInManager<ApplicationUser> _signInManager; private readonly UserManager<ApplicationUser> _userManager; private readonly ICustomers _customers; private readonly IJwtService _jwtService; public AuthenticateCustomerQueryHandler( SignInManager<ApplicationUser> signInManager, UserManager<ApplicationUser> userManager, ICustomers customers, IJwtService jwtService) { _signInManager = signInManager; _userManager = userManager; _customers = customers; _jwtService = jwtService; } public async override Task<CustomerViewModel> ExecuteQuery(AuthenticateCustomerQuery request, CancellationToken cancellationToken) { CustomerViewModel customerViewModel = new CustomerViewModel(); var signIn = await _signInManager .PasswordSignInAsync(request.Email, request.Password, false, true); if (signIn.Succeeded) { var user = await _userManager .FindByEmailAsync(request.Email); if (user == null) throw new ApplicationDataException("User not found."); var token = await _jwtService .GenerateJwt(user.Email); //Customer data var customer = await _customers .GetByEmail(user.Email, cancellationToken); customerViewModel.Id = customer.Id.Value; customerViewModel.Name = customer.Name; customerViewModel.Email = user.Email; customerViewModel.Token = token; customerViewModel.LoginSucceeded = signIn.Succeeded; } else customerViewModel.ValidationResult.Errors.Add(new ValidationFailure(string.Empty, "Usename or password invalid")); return customerViewModel; } }
36.641791
107
0.693686
[ "MIT" ]
CurlyBytes/EcommerceDDD
src/EcommerceDDD.Application/Customers/AuthenticateCustomer/AuthenticateCustomerQueryHandler.cs
2,457
C#
// Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Collections.Generic; namespace ColorSyntax.Common { public static class ExtensionMethods { public static void SortStable<T>(this IList<T> list, Comparison<T> comparison) { Guard.ArgNotNull(list, "list"); int count = list.Count; for (int j = 1; j < count; j++) { T key = list[j]; int i = j - 1; for (; i >= 0 && comparison(list[i], key) > 0; i--) { list[i + 1] = list[i]; } list[i + 1] = key; } } } }
24.129032
67
0.431818
[ "Apache-2.0" ]
UWPCommunity/Quarrel
old/Discord UWP/Markdown/ColorCode/ColorCode.Core/Common/ExtensionMethods.cs
750
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Runtime.InteropServices; namespace Microsoft.VisualStudio.LanguageServices.CSharp.ProjectSystemShim.Interop { [ComImport] [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] [Guid("4D5D4C22-EE19-11d2-B556-00C04F68D4DB")] internal interface ICSInputSet { ICSCompiler GetCompiler(); void AddSourceFile([MarshalAs(UnmanagedType.LPWStr)] string filename); void RemoveSourceFile([MarshalAs(UnmanagedType.LPWStr)] string filename); void RemoveAllSourceFiles(); void AddResourceFile([MarshalAs(UnmanagedType.LPWStr)] string filename, [MarshalAs(UnmanagedType.LPWStr)] string ident, bool embed, bool vis); void RemoveResourceFile([MarshalAs(UnmanagedType.LPWStr)] string filename, [MarshalAs(UnmanagedType.LPWStr)] string ident, bool embed, bool vis); void SetWin32Resource([MarshalAs(UnmanagedType.LPWStr)] string filename); void SetOutputFileName([MarshalAs(UnmanagedType.LPWStr)] string filename); void SetOutputFileType(OutputFileType fileType); void SetImageBase(uint imageBase); void SetMainClass([MarshalAs(UnmanagedType.LPWStr)] string fullyQualifiedClassName); void SetWin32Icon([MarshalAs(UnmanagedType.LPWStr)] string iconFileName); void SetFileAlignment(uint align); void SetImageBase2(ulong imageBase); void SetPdbFileName([MarshalAs(UnmanagedType.LPWStr)] string filename); string GetWin32Resource(); void SetWin32Manifest([MarshalAs(UnmanagedType.LPWStr)] string manifestFileName); } }
37.061224
153
0.746696
[ "MIT" ]
333fred/roslyn
src/VisualStudio/CSharp/Impl/ProjectSystemShim/Interop/ICSInputSet.cs
1,818
C#
using Microsoft.AspNetCore.Mvc; using RPG.Data.Repository.AuthRepository; using RPG.Domain.DTO.User; using RPG.Domain.Entities; using RPG.Domain.Response; using System.Threading.Tasks; namespace RPG.API.Controllers { [ApiController] [Route("[controller]")] public class AuthControler : ControllerBase { private readonly IAuthRepository _authRepository; public AuthControler(IAuthRepository authRepository) { _authRepository = authRepository; } public async Task<IActionResult> Register([FromBody] UserRegisterDto requist) { ServiceResponse<int> response = new(); User user = new User(); return null; } } }
24.5
85
0.662585
[ "MIT" ]
HusseinShukri/DotNET-RPG
RPG/RPG.API/Controllers/.vshistory/AuthController.cs/2021-08-14_11_10_08_658.cs
737
C#
// Copyright (C) 2007 Jesse Jones // // 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; namespace Cased { namespace Inner { public class SomeType { } } namespace INNER { public class SomeType { } } } // D1000/LargeNamespace namespace Big { public class Type00 { public readonly int foo = 10; } public class Type01 { public readonly int foo = 10; } public class Type02 { public readonly int foo = 10; } public class Type03 { public readonly int foo = 10; } public class Type04 { public readonly int foo = 10; } public class Type05 { public readonly int foo = 10; } public class Type06 { public readonly int foo = 10; } public class Type07 { public readonly int foo = 10; } public class Type08 { public readonly int foo = 10; } public class Type09 { public readonly int foo = 10; } public class Type10 { public readonly int foo = 10; } public class Type11 { public readonly int foo = 10; } public class Type12 { public readonly int foo = 10; } public class Type13 { public readonly int foo = 10; } public class Type14 { public readonly int foo = 10; } public class Type15 { public readonly int foo = 10; } public class Type16 { public readonly int foo = 10; } public class Type17 { public readonly int foo = 10; } public class Type18 { public readonly int foo = 10; } public class Type19 { public readonly int foo = 10; } public class Type20 { public readonly int foo = 10; } public class Type21 { public readonly int foo = 10; } public class Type22 { public readonly int foo = 10; } public class Type23 { public readonly int foo = 10; } public class Type24 { public readonly int foo = 10; } public class Type25 { public readonly int foo = 10; } public class Type26 { public readonly int foo = 10; } public class Type27 { public readonly int foo = 10; } public class Type28 { public readonly int foo = 10; } public class Type29 { public readonly int foo = 10; } public class Type30 { public readonly int foo = 10; } public class Type31 { public readonly int foo = 10; } public class Type32 { public readonly int foo = 10; } public class Type33 { public readonly int foo = 10; } public class Type34 { public readonly int foo = 10; } public class Type35 { public readonly int foo = 10; } public class Type36 { public readonly int foo = 10; } public class Type37 { public readonly int foo = 10; } public class Type38 { public readonly int foo = 10; } public class Type39 { public readonly int foo = 10; } public class Type40 { public readonly int foo = 10; } public class Type41 { public readonly int foo = 10; } }
15.268775
73
0.675641
[ "MIT" ]
dbremner/smokey
extras/evildoer/BigNamespace.cs
3,863
C#
//------------------------------------------------------------------------------ // <copyright file="AbsoluteQuery.cs" company="Microsoft"> // Copyright (c) Microsoft Corporation. All rights reserved. // </copyright> //------------------------------------------------------------------------------ namespace System.Xml.XPath { using System.Xml; using System.Diagnostics; internal sealed class AbsoluteQuery : XPathSelfQuery { internal AbsoluteQuery() : base() { } internal override void setContext( XPathNavigator e) { Debug.Assert(e != null); e = e.Clone(); e.MoveToRoot(); base.setContext( e); } internal override XPathNavigator advance() { if (_e != null) { if (first) { first = false; return _e; } else return null; } return null; } private AbsoluteQuery(IQuery qyInput) { m_qyInput = qyInput; } internal override XPathNavigator MatchNode(XPathNavigator context) { if (context != null && context.NodeType == XPathNodeType.Root) return context; return null; } internal override IQuery Clone() { IQuery query = new AbsoluteQuery(CloneInput()); if ( _e != null ) { query.setContext(_e); } return query; } internal override Querytype getName() { return Querytype.Root; } } }
31.087719
81
0.420993
[ "Unlicense" ]
bestbat/Windows-Server
com/netfx/src/framework/xml/system/newxml/xpath/absolutequery.cs
1,772
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class CSMasters : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (Session["UserID"] != null) { lblUserID.Text = Convert.ToString(Session["UserID"]); } else { Response.Redirect("AssetC.aspx"); } } protected void CuStV_ItemCommand(object sender, ListViewCommandEventArgs e) { if (e.CommandName == "Deactivate") { //int index = Convert.ToInt32(e.CommandArgument); it identifies item itself ListViewItem item = e.Item; // MCuStV.Items[index]; int CSID = Convert.ToInt32(((Label)item.FindControl("CSIDLabel")).Text); AssetTaggingEntities context = new AssetTaggingEntities(); //LUT_Current_Status st = new LUT_Current_Status(); var result = (from st in context.LUT_Current_Status where st.CSID == CSID select st).FirstOrDefault(); if (result != null) { if (((Button)e.CommandSource).Text == "Deactivate") { result.IsDeleted = true; ((Button)e.CommandSource).Text = "Activate"; foreach (Control ctrl in item.Controls) { if (ctrl is Label) { ((Label)ctrl).ForeColor = System.Drawing.Color.Gray; } } } else { result.IsDeleted = false; ((Button)e.CommandSource).Text = "Deactivate"; foreach (Control ctrl in item.Controls) { if (ctrl is Label) { ((Label)ctrl).ForeColor = System.Drawing.Color.Black; } } } context.SaveChanges(); } else { Response.Write("Record Not Found"); } } } protected void CuStV_ItemDataBound(object sender, ListViewItemEventArgs e) { ListViewItem item = e.Item; // CuStV.Items[index]; if (item.FindControl("IsDeleted") == null) { return; } bool isDeleted = Convert.ToBoolean(((HiddenField)item.FindControl("IsDeleted")).Value); AssetTaggingEntities context = new AssetTaggingEntities(); if (isDeleted) { ((Button)item.FindControl("Deactivate")).Text = "Activate"; foreach (Control ctrl in item.Controls) { if (ctrl is Label) { ((Label)ctrl).ForeColor = System.Drawing.Color.Gray; } } } else { ((Button)item.FindControl("Deactivate")).Text = "Deactivate"; foreach (Control ctrl in item.Controls) { if (ctrl is Label) { ((Label)ctrl).ForeColor = System.Drawing.Color.Black; } } } } }
33.3
114
0.482883
[ "MIT" ]
adithirgis/AssetConnect
CSMasters.aspx.cs
3,332
C#
// Copyright (C) 2003-2010 Xtensive LLC. // All rights reserved. // For conditions of distribution and use, see license. using System; using System.Collections.Generic; using Xtensive.Core; using Xtensive.Collections; namespace Xtensive.Sql.Model { /// <summary> /// Represents unique table constraint. /// </summary> [Serializable] public class UniqueConstraint : TableConstraint { private NodeCollection<TableColumn> columns; private bool isClustered; public bool IsClustered { get { return isClustered; } set { this.EnsureNotLocked(); isClustered = value; } } /// <summary> /// Gets the columns. /// </summary> /// <value>The columns.</value> public NodeCollection<TableColumn> Columns { get { return columns; } } /// <summary> /// Locks the instance and (possible) all dependent objects. /// </summary> /// <param name="recursive"><see langword="True"/> if all dependent objects should be locked too.</param> public override void Lock(bool recursive) { base.Lock(recursive); columns.Lock(recursive); } #region Constructors internal UniqueConstraint(Table table, string name, params TableColumn[] columns) : base(table, name, null, null, null) { this.columns = new NodeCollection<TableColumn>(columns.Length); for (int i = 0, count = columns.Length; i<count; i++) this.columns.Add(columns[i]); } #endregion } }
25.542373
123
0.644326
[ "MIT" ]
DataObjects-NET/dataobjects-net
Orm/Xtensive.Orm/Sql/Model/Constraints/UniqueConstraint.cs
1,507
C#
// Copyright (c) Avanade. Licensed under the MIT License. See https://github.com/Avanade/Beef using Beef.Diagnostics; using Microsoft.Extensions.Logging; using System; using System.Linq; using System.Threading.Tasks; namespace Beef.Events.Subscribe { /// <summary> /// Provides the base <see cref="EventData"/> subscriber capabilities. /// </summary> public abstract class EventSubscriberHost { /// <summary> /// Gets or sets the <see cref="RunAsUser.System"/> username (this defaults to <see cref="ExecutionContext"/> <see cref="ExecutionContext.EnvironmentUsername"/>). /// </summary> public static string SystemUsername { get; set; } = ExecutionContext.EnvironmentUsername; /// <summary> /// Initializes a new instance of the <see cref="EventSubscriberHost"/>. /// </summary> /// <param name="args">The <see cref="EventSubscriberHostArgs"/>.</param> protected EventSubscriberHost(EventSubscriberHostArgs? args = null) => Args = Check.NotNull(args, nameof(args))!; /// <summary> /// Gets the <see cref="EventSubscriberHostArgs"/>. /// </summary> public EventSubscriberHostArgs Args { get; private set; } /// <summary> /// Indicates whether multiple messages (<see cref="EventData"/>) can be processed; default is <c>false</c>. /// </summary> public bool AreMultipleMessagesSupported { get; set; } /// <summary> /// Receives the message and processes when the <paramref name="subject"/> and <paramref name="action"/> has been subscribed. /// </summary> /// <param name="subject">The event subject.</param> /// <param name="action">The event action.</param> /// <param name="getEventData">The function to get the corresponding <see cref="EventData"/> or <see cref="EventData{T}"/> only performed where subscribed for processing.</param> /// <returns>The <see cref="Task"/>.</returns> protected async Task ReceiveAsync(string subject, string? action, Func<IEventSubscriber, EventData> getEventData) { Check.NotEmpty(subject, nameof(subject)); if (getEventData == null) throw new ArgumentNullException(nameof(getEventData)); // Match a subscriber to the subject + template supplied. var subscribers = Args.EventSubscribers.Where(r => Event.Match(r.SubjectTemplate, subject) && (r.Actions == null || r.Actions.Count == 0 || r.Actions.Contains(action, StringComparer.InvariantCultureIgnoreCase))).ToArray(); var subscriber = subscribers.Length == 1 ? subscribers[0] : subscribers.Length == 0 ? (IEventSubscriber?)null : throw new EventSubscriberException($"There are {subscribers.Length} {nameof(IEventSubscriber)} instances subscribing to Subject '{subject}' and Action '{action}'; there must be only a single subscriber."); if (subscriber == null) return; // Where matched get the EventData and execute the subscriber receive. var @event = getEventData(subscriber) ?? throw new EventSubscriberException($"An EventData instance must not be null (Subject `{subject}` and Action '{action}')."); try { ExecutionContext.Reset(false); ExecutionContext.SetCurrent(BindLogger(CreateExecutionContext(subscriber, @event))); await subscriber.ReceiveAsync(@event).ConfigureAwait(false); } catch (Exception ex) { // Handle the exception as per the subscriber configuration. if (subscriber.UnhandledExceptionHandling == UnhandledExceptionHandling.Continue) { Logger.Default.Warning($"An unhandled exception was encountered and ignored as the EventSubscriberHost is configured to continue: {ex.ToString()}"); return; } throw; } } /// <summary> /// Creates the <see cref="ExecutionContext"/> for processing the <paramref name="event"/> setting the username based on the <see cref="IEventSubscriber"/> <see cref="IEventSubscriber.RunAsUser"/>. /// </summary> /// <param name="subscriber">The <see cref="IEventSubscriber"/> that will process the message.</param> /// <param name="event">The <see cref="EventData"/>.</param> /// <returns>The <see cref="ExecutionContext"/>.</returns> /// <remarks>When overridding it is the responsibility of the overridder to honour the <see cref="IEventSubscriber.RunAsUser"/> selection.</remarks> #pragma warning disable CA1716 // Identifiers should not match keywords; by-design, is the best name. protected virtual ExecutionContext CreateExecutionContext(IEventSubscriber subscriber, EventData @event) #pragma warning restore CA1716 { if (subscriber == null) throw new ArgumentNullException(nameof(subscriber)); if (@event == null) throw new ArgumentNullException(nameof(@event)); return new ExecutionContext { Username = subscriber.RunAsUser == RunAsUser.Originating ? @event.Username ?? SystemUsername : SystemUsername, TenantId = @event.TenantId }; } /// <summary> /// Bind the logger to the execution context. /// </summary> private ExecutionContext BindLogger(ExecutionContext ec) { if (ec == null) throw new EventSubscriberException("An ExecutionContext instance must be returned from CreateExecutionContext."); ec.RegisterLogger((largs) => BindLogger(Args.Logger, largs)); return ec; } /// <summary> /// Binds (redirects) Beef <see cref="Beef.Diagnostics.Logger"/> to the ASP.NET Core <see cref="Microsoft.Extensions.Logging.ILogger"/>. /// </summary> /// <param name="logger">The ASP.NET Core <see cref="Microsoft.Extensions.Logging.ILogger"/>.</param> /// <param name="args">The Beef <see cref="LoggerArgs"/>.</param> /// <remarks>Redirects (binds) the Beef logger to the ASP.NET logger.</remarks> private static void BindLogger(ILogger logger, LoggerArgs args) { Check.NotNull(logger, nameof(logger)); Check.NotNull(args, nameof(args)); switch (args.Type) { case LogMessageType.Critical: logger.LogCritical(args.ToString()); break; case LogMessageType.Info: logger.LogInformation(args.ToString()); break; case LogMessageType.Warning: logger.LogWarning(args.ToString()); break; case LogMessageType.Error: logger.LogError(args.ToString()); break; case LogMessageType.Debug: logger.LogDebug(args.ToString()); break; case LogMessageType.Trace: logger.LogTrace(args.ToString()); break; } } } }
48.744966
329
0.613658
[ "MIT" ]
edjo23/Beef
src/Beef.Events/Subscribe/EventSubscriberHost.cs
7,265
C#
using Microsoft.EntityFrameworkCore; using System; using Xunit; namespace AsyncInnTests { public class UnitTest1 { } }
12
36
0.727273
[ "MIT" ]
joshhaddock88/Async-Inn
AsyncInn/AsyncInnTests/UnitTest1.cs
132
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerMovement : MonoBehaviour { public float moveSpeed; private float moveVelocity; public float jumpHeight; public Transform groundCheck; public float groundChckRadius; public LayerMask whatIsGround; private bool grounded; private bool facingRight = true; private bool doubleJumped; // Use this for initialization void Start() { } void FixedUpdate() { grounded = Physics2D.OverlapCircle(groundCheck.position, groundChckRadius, whatIsGround); float h = Input.GetAxis("Horizontal"); if (h > 0 && !facingRight) { Flip(); } else if (h < 0 && facingRight) { Flip(); } } // Update is called once per frame void Update() { if (grounded) doubleJumped = false; if (Input.GetKeyDown(KeyCode.Space) && grounded) { //GetComponent<Rigidbody2D>().velocity = new Vector2(GetComponent<Rigidbody2D>().velocity.x, jumpHeight); Jump(); grounded = false; } if (Input.GetKeyDown(KeyCode.Space) && !doubleJumped && !grounded) { //GetComponent<Rigidbody2D>().velocity = new Vector2(GetComponent<Rigidbody2D>().velocity.x, jumpHeight); Jump(); doubleJumped = true; } moveVelocity = 0f; if (Input.GetKey(KeyCode.D)) { //GetComponent<Rigidbody2D>().velocity = new Vector2(moveSpeed, GetComponent<Rigidbody2D>().velocity.y); moveVelocity = moveSpeed; } if (Input.GetKey(KeyCode.A)) { //GetComponent<Rigidbody2D>().velocity = new Vector2(-moveSpeed, GetComponent<Rigidbody2D>().velocity.y); moveVelocity = -moveSpeed; } GetComponent<Rigidbody2D>().velocity = new Vector2(moveVelocity, GetComponent<Rigidbody2D>().velocity.y); } public void Jump() { GetComponent<Rigidbody2D>().velocity = new Vector2(GetComponent<Rigidbody2D>().velocity.x, jumpHeight); } void Flip() { facingRight = !facingRight; Vector3 theScale = transform.localScale; theScale.x *= -1; transform.localScale = theScale; } }
25.673913
117
0.596952
[ "MIT" ]
kmikus/team2-ist440
Project-CandleLIT/Assets/Junk/PlayerMovement.cs
2,364
C#
using NHapi.Base.Parser; using NHapi.Base; using NHapi.Base.Log; using System; using System.Collections.Generic; using NHapi.Model.V281.Segment; using NHapi.Model.V281.Datatype; using NHapi.Base.Model; namespace NHapi.Model.V281.Group { ///<summary> ///Represents the OPL_O37_PATIENT_PRIOR Group. A Group is an ordered collection of message /// segments that can repeat together or be optionally in/excluded together. /// This Group contains the following elements: ///<ol> ///<li>0: PID (Patient Identification) </li> ///<li>1: PD1 (Patient Additional Demographic) optional </li> ///<li>2: PRT (Participation Information) optional repeating</li> ///<li>3: ARV (Access Restriction) optional repeating</li> ///</ol> ///</summary> [Serializable] public class OPL_O37_PATIENT_PRIOR : AbstractGroup { ///<summary> /// Creates a new OPL_O37_PATIENT_PRIOR Group. ///</summary> public OPL_O37_PATIENT_PRIOR(IGroup parent, IModelClassFactory factory) : base(parent, factory){ try { this.add(typeof(PID), true, false); this.add(typeof(PD1), false, false); this.add(typeof(PRT), false, true); this.add(typeof(ARV), false, true); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error creating OPL_O37_PATIENT_PRIOR - this is probably a bug in the source code generator.", e); } } ///<summary> /// Returns PID (Patient Identification) - creates it if necessary ///</summary> public PID PID { get{ PID ret = null; try { ret = (PID)this.GetStructure("PID"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } } ///<summary> /// Returns PD1 (Patient Additional Demographic) - creates it if necessary ///</summary> public PD1 PD1 { get{ PD1 ret = null; try { ret = (PD1)this.GetStructure("PD1"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } } ///<summary> /// Returns first repetition of PRT (Participation Information) - creates it if necessary ///</summary> public PRT GetPRT() { PRT ret = null; try { ret = (PRT)this.GetStructure("PRT"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } ///<summary> ///Returns a specific repetition of PRT /// * (Participation Information) - creates it if necessary /// throws HL7Exception if the repetition requested is more than one /// greater than the number of existing repetitions. ///</summary> public PRT GetPRT(int rep) { return (PRT)this.GetStructure("PRT", rep); } /** * Returns the number of existing repetitions of PRT */ public int PRTRepetitionsUsed { get{ int reps = -1; try { reps = this.GetAll("PRT").Length; } catch (HL7Exception e) { string message = "Unexpected error accessing data - this is probably a bug in the source code generator."; HapiLogFactory.GetHapiLog(GetType()).Error(message, e); throw new System.Exception(message); } return reps; } } /** * Enumerate over the PRT results */ public IEnumerable<PRT> PRTs { get { for (int rep = 0; rep < PRTRepetitionsUsed; rep++) { yield return (PRT)this.GetStructure("PRT", rep); } } } ///<summary> ///Adds a new PRT ///</summary> public PRT AddPRT() { return this.AddStructure("PRT") as PRT; } ///<summary> ///Removes the given PRT ///</summary> public void RemovePRT(PRT toRemove) { this.RemoveStructure("PRT", toRemove); } ///<summary> ///Removes the PRT at the given index ///</summary> public void RemovePRTAt(int index) { this.RemoveRepetition("PRT", index); } ///<summary> /// Returns first repetition of ARV (Access Restriction) - creates it if necessary ///</summary> public ARV GetARV() { ARV ret = null; try { ret = (ARV)this.GetStructure("ARV"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } ///<summary> ///Returns a specific repetition of ARV /// * (Access Restriction) - creates it if necessary /// throws HL7Exception if the repetition requested is more than one /// greater than the number of existing repetitions. ///</summary> public ARV GetARV(int rep) { return (ARV)this.GetStructure("ARV", rep); } /** * Returns the number of existing repetitions of ARV */ public int ARVRepetitionsUsed { get{ int reps = -1; try { reps = this.GetAll("ARV").Length; } catch (HL7Exception e) { string message = "Unexpected error accessing data - this is probably a bug in the source code generator."; HapiLogFactory.GetHapiLog(GetType()).Error(message, e); throw new System.Exception(message); } return reps; } } /** * Enumerate over the ARV results */ public IEnumerable<ARV> ARVs { get { for (int rep = 0; rep < ARVRepetitionsUsed; rep++) { yield return (ARV)this.GetStructure("ARV", rep); } } } ///<summary> ///Adds a new ARV ///</summary> public ARV AddARV() { return this.AddStructure("ARV") as ARV; } ///<summary> ///Removes the given ARV ///</summary> public void RemoveARV(ARV toRemove) { this.RemoveStructure("ARV", toRemove); } ///<summary> ///Removes the ARV at the given index ///</summary> public void RemoveARVAt(int index) { this.RemoveRepetition("ARV", index); } } }
26.547414
159
0.655464
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
AMCN41R/nHapi
src/NHapi.Model.V281/Group/OPL_O37_PATIENT_PRIOR.cs
6,159
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlaneMove : MonoBehaviour { float time; float movex = 0.05f; // Use this for initialization void Start () { } // Update is called once per frame void Update () { time += Time.deltaTime; transform.Translate(movex,0,0); if(time >= 2.0f) { movex = -0.05f; } if(time >= 4.0f) { movex = 0.05f; time = 0; } } }
9.48
40
0.580169
[ "MIT" ]
senshirou/Kusoge2
Assets/Script/PlaneMove.cs
476
C#
// Copyright (c) Pixel Crushers. All rights reserved. using UnityEngine; namespace PixelCrushers.DialogueSystem.Wrappers { /// <summary> /// This wrapper class keeps references intact if you switch between the /// compiled assembly and source code versions of the original class. /// </summary> [AddComponentMenu("Pixel Crushers/Dialogue System/UI/Unity UI/Quest/Unity UI Quest Log Window")] public class UnityUIQuestLogWindow : PixelCrushers.DialogueSystem.UnityUIQuestLogWindow { } }
29.055556
100
0.736138
[ "CC0-1.0" ]
Bomtill/Co-op-Assessment-1
Assets/Plugins/Pixel Crushers/Dialogue System/Wrappers/UI/Unity UI/Quest/UnityUIQuestLogWindow.cs
523
C#
// ******************************************************************************************************** // Product Name: DotSpatial.Data.dll // Description: The data access libraries for the DotSpatial project. // ******************************************************************************************************** // The contents of this file are subject to the MIT License (MIT) // you may not use this file except in compliance with the License. You may obtain a copy of the License at // http://dotspatial.codeplex.com/license // // Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF // ANY KIND, either expressed or implied. See the License for the specific language governing rights and // limitations under the License. // // The Original Code is from MapWindow.dll version 6.0 // // The Initial Developer of this Original Code is Ted Dunsford. Created 2/25/2010 4:23:30 PM // // Contributor(s): (Open source contributors should list themselves and their modifications here). // // ******************************************************************************************************** using System.Collections.Generic; namespace DotSpatial.Data { /// <summary> /// Extension Methods useful for the DotSpatial.Data.Img content /// </summary> public static class HfaExt { /// <summary> /// A common task seems to be parsing the text up to a certain delimiter /// starting from a certain index, and then advancing the string pointer. /// This advances the index, extracting the string up to the point of the /// specified delimeter, or the end of the string, and advancing the string /// past the delimeter itself. If the index is equal to the length, /// then you are at the end of the string. /// </summary> public static string ExtractTo(this string input, ref int start, string delimeter) { int origialStart = start; if (input.Contains(delimeter)) { start = input.IndexOf(delimeter); } else { start = input.Length - 1; } int length = start - origialStart; start += 1; // advance one unit past the delimeter return input.Substring(start, length); } /// <summary> /// Given a string, this reads digits into a numeric value. /// </summary> /// <param name="input">The string to read the integer from</param> /// <returns>An integer read from the string</returns> public static int ExtractInteger(this string input) { List<char> number = new List<char>(); int start = 0; while (input.Length > start && char.IsDigit(input[start])) { number.Add(input[start]); start++; } return int.Parse(new string(number.ToArray())); } /// <summary> /// This variant of the ExtractTo algorithm effectively splits the string into teh content /// before the delimeter and after the delimeter, not counting the delimeter. /// </summary> /// <param name="input">The string input</param> /// <param name="delimeter">The string delimeter</param> /// <param name="remainder">the string remainder</param> public static string ExtractTo(this string input, string delimeter, out string remainder) { remainder = null; if (input.Contains(delimeter)) { int i = input.IndexOf(delimeter); string result = input.Substring(0, i); if (i < input.Length - 1) { remainder = input.Substring(i + 1, input.Length - (i + 1)); } return result; } return input; } /// <summary> /// This method returns a substring based on the next occurance of the /// specified delimeter. /// </summary> /// <param name="input">The string input</param> /// <param name="delimeter">The delimeter</param> public static string SkipTo(this string input, string delimeter) { int index = input.IndexOf(delimeter) + 1; return input.Substring(index, input.Length - index); } } }
43.056604
108
0.53681
[ "MIT" ]
sdrmaps/dotspatial
Source/DotSpatial.Data/HfaExt.cs
4,564
C#
using System; using System.Drawing; using System.Windows.Forms; namespace Treefrog.Windows.Controls.WinEx { public class LayerListView : ListView { private const int WM_LBUTTONDBLCLK = 0x203; protected override void WndProc (ref Message m) { if (m.Msg >= 0x201 && m.Msg <= 0x209) { if (m.Msg == WM_LBUTTONDBLCLK) { OnDoubleClick(EventArgs.Empty); return; } Point pos = new Point(m.LParam.ToInt32() & 0xffff, m.LParam.ToInt32() >> 16); ListViewHitTestInfo hit = this.HitTest(pos); switch (hit.Location) { case ListViewHitTestLocations.AboveClientArea: case ListViewHitTestLocations.BelowClientArea: case ListViewHitTestLocations.LeftOfClientArea: case ListViewHitTestLocations.RightOfClientArea: case ListViewHitTestLocations.None: return; } } base.WndProc(ref m); } } }
31.972222
94
0.524761
[ "MIT" ]
Jorch72/CS-Treefrog
Treefrog/Windows/Controls/WinEx/LayerListView.cs
1,153
C#
using Hell.Interfaces.Entities; namespace Hell.Entities.Heroes { public class Barbarian : AbstractHero { public Barbarian(string name, IInventory inventory) : base(name, inventory) { this.Strength = 90; this.Agility = 25; this.Intelligence = 10; this.HitPoints = 350; this.Damage = 150; } } }
23
83
0.565217
[ "MIT" ]
BlueDress/School
C# OOP Advanced/Exams/Exam Prep - 16 August 2017/Hell-Skeleton/Hell/Entities/Heroes/Barbarian.cs
393
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("PropertyChange")] [assembly: AssemblyDescription("A Simple Directory Service Audit Log Monitor")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Neio Zhou")] [assembly: AssemblyProduct("PropertyChange")] [assembly: AssemblyCopyright("Copyright © Neio Zhou 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("50db91fe-cd07-4016-8f85-4dcbe6b81b61")] // 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")]
39.567568
84
0.750683
[ "MIT" ]
Neio/DSAccessMonitor
Properties/AssemblyInfo.cs
1,467
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 iotevents-2018-07-27.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.IoTEvents.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.IoTEvents.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for UntagResource operation /// </summary> public class UntagResourceResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { UntagResourceResponse response = new UntagResourceResponse(); return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("InternalFailureException")) { return InternalFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidRequestException")) { return InvalidRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceInUseException")) { return ResourceInUseExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottlingException")) { return ThrottlingExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonIoTEventsException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static UntagResourceResponseUnmarshaller _instance = new UntagResourceResponseUnmarshaller(); internal static UntagResourceResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static UntagResourceResponseUnmarshaller Instance { get { return _instance; } } } }
39.852174
192
0.654375
[ "Apache-2.0" ]
DetlefGolze/aws-sdk-net
sdk/src/Services/IoTEvents/Generated/Model/Internal/MarshallTransformations/UntagResourceResponseUnmarshaller.cs
4,583
C#
// Copyright (c) Christof Senn. All rights reserved. See license.txt in the project root for license information. namespace Remote.Linq.Tests.DynamicQuery.RemoteQueryable { using Remote.Linq; using Remote.Linq.Async; using Remote.Linq.SimpleQuery; using Shouldly; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Xunit; #pragma warning disable SA1629 // Documentation text should end with a period /// <summary> /// I.e. without query execution without <code>ToList()</code>, <code>ToArray()</code>, etc. /// </summary> #pragma warning restore SA1629 // Documentation text should end with a period public class When_executing_straight { private class Entity { } [Fact] public void Should_return_the_untransformed_instance() { var instance = new Entity(); var queryable = RemoteQueryable.Factory.CreateQueryable<Entity>(exp => instance); var result = queryable.Execute<Entity>(); result.ShouldBeSameAs(instance); } [Fact] public void Should_return_collection_with_the_the_untransformed_instance() { var instance = new Entity(); var queryable = RemoteQueryable.Factory.CreateQueryable<Entity>(exp => new[] { instance }); var result = queryable.Execute<IEnumerable<Entity>>(); result.Single().ShouldBeSameAs(instance); } [Fact] public async Task Should_return_the_untransformed_instance_async() { var instance = new Entity(); var queryable = RemoteQueryable.Factory.CreateAsyncQueryable<Entity>(exp => new ValueTask<object>(new[] { instance })); var result = await queryable.ExecuteAsync<Entity>().ConfigureAwait(false); result.Single().ShouldBeSameAs(instance); } [Fact] public async Task Should_return_collection_with_the_the_untransformed_instance_async() { var instance = new Entity(); var queryable = RemoteQueryable.Factory.CreateAsyncQueryable<Entity>(exp => new ValueTask<object>(new[] { instance })); var result = await queryable.ExecuteAsync<Entity[]>().ConfigureAwait(false); result.Single().ShouldBeSameAs(instance); } [Fact] public void Should_return_the_untransformed_instance_from_untyped_queryable() { var instance = new Entity(); var queryable = RemoteQueryable.Factory.CreateQueryable(typeof(object), exp => instance); var result = queryable.Execute<Entity>(); result.ShouldBeSameAs(instance); } [Fact] public void Should_return_collection_with_the_the_untransformed_instance_from_untyped_queryable() { var instance = new Entity(); var queryable = RemoteQueryable.Factory.CreateQueryable(typeof(object), exp => new[] { instance }); var result = queryable.Execute<Entity[]>(); result.Single().ShouldBeSameAs(instance); } [Fact] public async Task Should_return_the_untransformed_instance_from_untyped_queryable_async() { var instance = new Entity(); var queryable = RemoteQueryable.Factory.CreateAsyncQueryable(typeof(object), exp => new ValueTask<object>(instance)); var result = await queryable.ExecuteAsync<Entity>().ConfigureAwait(false); result.ShouldBeSameAs(instance); } [Fact] public async Task Should_return_collection_with_the_the_untransformed_instance_from_untyped_queryable_async() { var instance = new Entity(); var queryable = RemoteQueryable.Factory.CreateAsyncQueryable(typeof(object), exp => new ValueTask<object>(new[] { instance })); var result = await queryable.ExecuteAsync<IEnumerable<Entity>>().ConfigureAwait(false); result.Single().ShouldBeSameAs(instance); } } }
41.989691
139
0.651608
[ "MIT" ]
6bee/Remote.Linq
test/Remote.Linq.Tests/DynamicQuery/RemoteQueryable/When_executing_straight.cs
4,075
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.17929 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace ExampleBrowser.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } } }
39.592593
151
0.582788
[ "MIT" ]
Kaos1105/PointCloudViewer-HelixToolkit
Source/Examples/WPF.SharpDX/ExampleBrowser/Properties/Settings.Designer.cs
1,071
C#
using System.Threading.Tasks; using Abp.Configuration; using Abp.Zero.Configuration; using LTMCompanyNameFree.YoyoCmsTemplate.Authorization.Accounts.Dto; using LTMCompanyNameFree.YoyoCmsTemplate.Authorization.Users; namespace LTMCompanyNameFree.YoyoCmsTemplate.Authorization.Accounts { public class AccountAppService : YoyoCmsTemplateAppServiceBase, IAccountAppService { // from: http://regexlib.com/REDetails.aspx?regexp_id=1923 public const string PasswordRegex = "(?=^.{8,}$)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\\s)[0-9a-zA-Z!@#$%^&*()]*$"; private readonly UserRegistrationManager _userRegistrationManager; public AccountAppService( UserRegistrationManager userRegistrationManager) { _userRegistrationManager = userRegistrationManager; } public async Task<IsTenantAvailableOutput> IsTenantAvailable(IsTenantAvailableInput input) { var tenant = await TenantManager.FindByTenancyNameAsync(input.TenancyName); if (tenant == null) { return new IsTenantAvailableOutput(TenantAvailabilityState.NotFound); } if (!tenant.IsActive) { return new IsTenantAvailableOutput(TenantAvailabilityState.InActive); } return new IsTenantAvailableOutput(TenantAvailabilityState.Available, tenant.Id); } public async Task<RegisterOutput> Register(RegisterInput input) { var user = await _userRegistrationManager.RegisterAsync( input.Name, input.Surname, input.EmailAddress, input.UserName, input.Password, true // Assumed email address is always confirmed. Change this if you want to implement email confirmation. ); var isEmailConfirmationRequiredForLogin = await SettingManager.GetSettingValueAsync<bool>(AbpZeroSettingNames.UserManagement.IsEmailConfirmationRequiredForLogin); return new RegisterOutput { CanLogin = user.IsActive && (user.IsEmailConfirmed || !isEmailConfirmationRequiredForLogin) }; } } }
38.672414
174
0.654481
[ "MIT" ]
52ABP/52ABP.Template
src/aspnet-core/src/LTMCompanyNameFree.YoyoCmsTemplate.Application/Authorization/Accounts/AccountAppService.cs
2,243
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.Functions.Models.Api20190801 { using static Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Extensions; /// <summary>ARM resource for a site.</summary> public partial class SitePatchResource { /// <summary> /// <c>AfterFromJson</c> will be called after the json deserialization has finished, allowing customization of the object /// before it is returned. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="json">The JsonNode that should be deserialized into this object.</param> partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonObject json); /// <summary> /// <c>AfterToJson</c> will be called after the json serialization has finished, allowing customization of the <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonObject" /// /> before it is returned. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="container">The JSON container that the serialization result will be placed in.</param> partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonObject container); /// <summary> /// <c>BeforeFromJson</c> will be called before the json deserialization has commenced, allowing complete customization of /// the object before it is deserialized. /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <paramref name= "returnNow" /> /// output parameter. /// Implement this method in a partial class to enable this behavior. /// </summary> /// <param name="json">The JsonNode that should be deserialized into this object.</param> /// <param name="returnNow">Determines if the rest of the deserialization should be processed, or if the method should return /// instantly.</param> partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonObject json, ref bool returnNow); /// <summary> /// <c>BeforeToJson</c> will be called before the json serialization has commenced, allowing complete customization of the /// object before it is serialized. /// If you wish to disable the default serialization entirely, return <c>true</c> in the <paramref name="returnNow" /> output /// parameter. /// Implement this method in a partial class to enable this behavior. /// </summary> /// <param name="container">The JSON container that the serialization result will be placed in.</param> /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return /// instantly.</param> partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonObject container, ref bool returnNow); /// <summary> /// Deserializes a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonNode"/> into an instance of Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ISitePatchResource. /// </summary> /// <param name="node">a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonNode" /> to deserialize from.</param> /// <returns> /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ISitePatchResource. /// </returns> public static Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ISitePatchResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonObject json ? new SitePatchResource(json) : null; } /// <summary> /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonObject into a new instance of <see cref="SitePatchResource" />. /// </summary> /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonObject instance to deserialize from.</param> internal SitePatchResource(Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } __proxyOnlyResource = new Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ProxyOnlyResource(json); {_property = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonObject>("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.SitePatchResourceProperties.FromJson(__jsonProperties) : Property;} {_identity = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonObject>("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ManagedServiceIdentity.FromJson(__jsonIdentity) : Identity;} AfterFromJson(json); } /// <summary> /// Serializes this instance of <see cref="SitePatchResource" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param> /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="SitePatchResource" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return container; } __proxyOnlyResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); AfterToJson(ref container); return container; } } }
69.178571
290
0.692824
[ "MIT" ]
AlanFlorance/azure-powershell
src/Functions/generated/api/Models/Api20190801/SitePatchResource.json.cs
7,637
C#
using FluentAssertions; using FsCheck; using FsCheck.Xunit; using NSubstitute; using System; using System.Threading.Tasks; using Toggl.Core.Analytics; using Toggl.Core.Services; using Toggl.Core.Tests.Generators; using Xunit; namespace Toggl.Core.Tests.Services { public sealed class BackgroundServiceTests { public abstract class BackgroundServiceTest { protected ITimeService TimeService { get; } protected IAnalyticsService AnalyticsService { get; } protected IUpdateRemoteConfigCacheService UpdateRemoteConfigCacheService { get; } public BackgroundServiceTest() { TimeService = Substitute.For<ITimeService>(); AnalyticsService = Substitute.For<IAnalyticsService>(); UpdateRemoteConfigCacheService = Substitute.For<IUpdateRemoteConfigCacheService>(); } } public sealed class TheConstructor { [Theory, LogIfTooSlow] [ConstructorData] public void ThrowsWhenTheArgumentIsNull(bool useTimeService, bool useAnalyticsService, bool useRemoteConfigUpdateService) { var timeService = useTimeService ? Substitute.For<ITimeService>() : null; var analyticsService = useAnalyticsService ? Substitute.For<IAnalyticsService>() : null; var updateRemoteConfigCacheService = useRemoteConfigUpdateService ? Substitute.For<IUpdateRemoteConfigCacheService>() : null; Action constructor = () => new BackgroundService(timeService, analyticsService, updateRemoteConfigCacheService); constructor.Should().Throw<ArgumentNullException>(); } } public sealed class TheAppResumedFromBackgroundMethod : BackgroundServiceTest { private readonly DateTimeOffset now = new DateTimeOffset(2017, 12, 11, 0, 30, 59, TimeSpan.Zero); [Fact, LogIfTooSlow] public void DoesNotEmitAnythingWhenItHasNotEnterBackgroundFirst() { bool emitted = false; var backgroundService = new BackgroundService(TimeService, AnalyticsService, UpdateRemoteConfigCacheService); backgroundService .AppResumedFromBackground .Subscribe(_ => emitted = true); backgroundService.EnterForeground(); emitted.Should().BeFalse(); } [Fact, LogIfTooSlow] public void EmitsValueWhenEnteringForegroundAfterBeingInBackground() { bool emitted = false; var backgroundService = new BackgroundService(TimeService, AnalyticsService, UpdateRemoteConfigCacheService); TimeService.CurrentDateTime.Returns(now); backgroundService .AppResumedFromBackground .Subscribe(_ => emitted = true); backgroundService.EnterBackground(); backgroundService.EnterForeground(); emitted.Should().BeTrue(); } [Fact, LogIfTooSlow] public void DoesNotEmitAnythingWhenTheEnterForegroundIsCalledMultipleTimes() { bool emitted = false; var backgroundService = new BackgroundService(TimeService, AnalyticsService, UpdateRemoteConfigCacheService); TimeService.CurrentDateTime.Returns(now); backgroundService.EnterBackground(); TimeService.CurrentDateTime.Returns(now.AddMinutes(1)); backgroundService.EnterForeground(); TimeService.CurrentDateTime.Returns(now.AddMinutes(2)); backgroundService .AppResumedFromBackground .Subscribe(_ => emitted = true); backgroundService.EnterForeground(); emitted.Should().BeFalse(); } [Property] public void EmitsAValueWhenEnteringForegroundAfterBeingInBackgroundForMoreThanTheLimit(NonNegativeInt waitingTime) { TimeSpan? resumedAfter = null; var backgroundService = new BackgroundService(TimeService, AnalyticsService, UpdateRemoteConfigCacheService); backgroundService .AppResumedFromBackground .Subscribe(timeInBackground => resumedAfter = timeInBackground); TimeService.CurrentDateTime.Returns(now); backgroundService.EnterBackground(); TimeService.CurrentDateTime.Returns(now.AddMinutes(waitingTime.Get).AddSeconds(1)); backgroundService.EnterForeground(); resumedAfter.Should().NotBeNull(); resumedAfter.Should().BeGreaterThan(TimeSpan.FromMinutes(waitingTime.Get)); } [Fact] public void TracksEventWhenAppResumed() { var backgroundService = new BackgroundService(TimeService, AnalyticsService, UpdateRemoteConfigCacheService); backgroundService.EnterBackground(); backgroundService.EnterForeground(); AnalyticsService.Received().AppDidEnterForeground.Track(); } [Fact] public void TracksEventWhenAppGoesToBackground() { var backgroundService = new BackgroundService(TimeService, AnalyticsService, UpdateRemoteConfigCacheService); backgroundService.EnterBackground(); AnalyticsService.Received().AppSentToBackground.Track(); } } public sealed class TheEnterForegroundMethod : BackgroundServiceTest { [Fact, LogIfTooSlow] public async Task TriggersRemoteConfigUpdateWhenRemoteConfigDataNeedsToBeUpdated() { var updateRemoteConfigCacheService = Substitute.For<IUpdateRemoteConfigCacheService>(); updateRemoteConfigCacheService.NeedsToUpdateStoredRemoteConfigData().Returns(true); var backgroundService = new BackgroundService(TimeService, AnalyticsService, updateRemoteConfigCacheService); backgroundService.EnterForeground(); // This delay is make sure FetchAndStoreRemoteConfigData has time to execute, since it's called inside a // fire and forget TaskTask.Run(() => {}).ConfigureAwait(false)) await Task.Delay(1); updateRemoteConfigCacheService.Received().FetchAndStoreRemoteConfigData(); } [Fact, LogIfTooSlow] public async Task DoesNotTriggerRemoteConfigUpdateWhenRemoteConfigDataDoesNotNeedToBeUpdated() { var updateRemoteConfigCacheService = Substitute.For<IUpdateRemoteConfigCacheService>(); updateRemoteConfigCacheService.NeedsToUpdateStoredRemoteConfigData().Returns(false); var backgroundService = new BackgroundService(TimeService, AnalyticsService, updateRemoteConfigCacheService); backgroundService.EnterForeground(); // This delay is make sure FetchAndStoreRemoteConfigData has time to execute, since it's called inside a // fire and forget TaskTask.Run(() => {}).ConfigureAwait(false)) await Task.Delay(1); updateRemoteConfigCacheService.DidNotReceive().FetchAndStoreRemoteConfigData(); } } } }
44.982143
141
0.639407
[ "BSD-3-Clause" ]
MULXCODE/mobileapp
Toggl.Core.Tests/Services/BackgroundServiceTests.cs
7,557
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.Network.V20200401.Outputs { [OutputType] public sealed class TunnelConnectionHealthResponse { /// <summary> /// Virtual Network Gateway connection status. /// </summary> public readonly string ConnectionStatus; /// <summary> /// The Egress Bytes Transferred in this connection. /// </summary> public readonly double EgressBytesTransferred; /// <summary> /// The Ingress Bytes Transferred in this connection. /// </summary> public readonly double IngressBytesTransferred; /// <summary> /// The time at which connection was established in Utc format. /// </summary> public readonly string LastConnectionEstablishedUtcTime; /// <summary> /// Tunnel name. /// </summary> public readonly string Tunnel; [OutputConstructor] private TunnelConnectionHealthResponse( string connectionStatus, double egressBytesTransferred, double ingressBytesTransferred, string lastConnectionEstablishedUtcTime, string tunnel) { ConnectionStatus = connectionStatus; EgressBytesTransferred = egressBytesTransferred; IngressBytesTransferred = ingressBytesTransferred; LastConnectionEstablishedUtcTime = lastConnectionEstablishedUtcTime; Tunnel = tunnel; } } }
31.491228
81
0.64624
[ "Apache-2.0" ]
pulumi-bot/pulumi-azure-native
sdk/dotnet/Network/V20200401/Outputs/TunnelConnectionHealthResponse.cs
1,795
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; namespace Osmium.WebCore.ViewModels.Manage { public class AddPhoneNumberViewModel { [Required] [Phone] [Display(Name = "Phone number")] public string PhoneNumber { get; set; } } }
21.647059
47
0.695652
[ "MIT" ]
TJOverbay/Osmium
src/Osmium.WebCore/ViewModels/Manage/AddPhoneNumberViewModel.cs
370
C#
// <auto-generated /> namespace Mobet.Infrastructure.Migrations { using System.CodeDom.Compiler; using System.Data.Entity.Migrations; using System.Data.Entity.Migrations.Infrastructure; using System.Resources; [GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")] public sealed partial class _01 : IMigrationMetadata { private readonly ResourceManager Resources = new ResourceManager(typeof(_01)); string IMigrationMetadata.Id { get { return "201603171038031_01"; } } string IMigrationMetadata.Source { get { return null; } } string IMigrationMetadata.Target { get { return Resources.GetString("Target"); } } } }
26.666667
86
0.61125
[ "Apache-2.0" ]
Mobet/mobet
Mobet-Net/Mobet.Infrastructure/Migrations/201603171038031_01.Designer.cs
800
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Web.Mvc; using Sidekick.Core; namespace Sidekick.ContentMigrator { public class MchapOrLoggedInAttribute : LoggedInAttribute { public override void OnActionExecuting(ActionExecutingContext filterContext) { if (string.IsNullOrWhiteSpace(filterContext.RequestContext.HttpContext.Request.Headers["X-MC-MAC"])) { base.OnActionExecuting(filterContext); } } } }
23.136364
103
0.787819
[ "MIT" ]
JeffDarchuk/SitecoreSidekick
ContentMigrator/MchapOrLoggedInAttribute.cs
511
C#