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 |
|---|---|---|---|---|---|---|---|---|
// Copyright © 2012 onwards, Andrew Whewell
// All rights reserved.
//
// Redistribution and use of this software 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 the author nor the names of the program's 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 AUTHORS OF THE SOFTWARE 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.Collections.Generic;
using System.Linq;
using System.Text;
using VirtualRadar.Interface;
using System.Speech.Synthesis;
namespace VirtualRadar.Library
{
/// <summary>
/// The .NET default implementation of <see cref="ISpeechSynthesizerWrapper"/>.
/// </summary>
sealed class DotNetSpeechSynthesizerWrapper : ISpeechSynthesizerWrapper
{
/// <summary>
/// The speech synthesizer that this class wraps.
/// </summary>
private SpeechSynthesizer _SpeechSynthesizer = new SpeechSynthesizer();
/// <summary>
/// See interface docs.
/// </summary>
public string DefaultVoiceName
{
get { return _SpeechSynthesizer.Voice.Name; }
}
/// <summary>
/// See interface docs.
/// </summary>
public int Rate
{
get { return _SpeechSynthesizer.Rate; }
set { _SpeechSynthesizer.Rate = value; }
}
/// <summary>
/// Finalises the object.
/// </summary>
~DotNetSpeechSynthesizerWrapper()
{
Dispose(false);
}
/// <summary>
/// See interface docs.
/// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>
/// Disposes of or finalises the object. Note that that the class is sealed.
/// </summary>
/// <param name="disposing"></param>
private void Dispose(bool disposing)
{
if(disposing) {
if(_SpeechSynthesizer != null) _SpeechSynthesizer.Dispose();
_SpeechSynthesizer = null;
}
}
/// <summary>
/// See interface docs.
/// </summary>
/// <returns></returns>
public IEnumerable<string> GetInstalledVoiceNames()
{
return _SpeechSynthesizer.GetInstalledVoices().Where(s => s.Enabled).Select(v => v.VoiceInfo.Name);
}
/// <summary>
/// See interface docs.
/// </summary>
/// <param name="name"></param>
public void SelectVoice(string name)
{
_SpeechSynthesizer.SelectVoice(name);
}
/// <summary>
/// See interface docs.
/// </summary>
public void SetOutputToDefaultAudioDevice()
{
_SpeechSynthesizer.SetOutputToDefaultAudioDevice();
}
/// <summary>
/// See interface docs.
/// </summary>
/// <param name="text"></param>
public void SpeakAsync(string text)
{
_SpeechSynthesizer.SpeakAsync(text);
}
}
}
| 39.142857 | 750 | 0.613595 | [
"BSD-3-Clause"
] | wiseman/virtual-radar-server | VirtualRadar.Library/DotNetSpeechSynthesizerWrapper.cs | 4,387 | C# |
#if !WATCH && !__MACCATALYST__
using System;
using ObjCRuntime;
#nullable enable
namespace SceneKit
{
public partial class SCNRenderingOptions {
public SCNRenderingApi? RenderingApi {
get {
var val = GetNUIntValue (SCNRenderingOptionsKeys.RenderingApiKey);
if (val is not null)
return (SCNRenderingApi)(uint) val;
return null;
}
set {
if (value.HasValue)
SetNumberValue (SCNRenderingOptionsKeys.RenderingApiKey, (nuint)(uint)value.Value);
else
RemoveValue (SCNRenderingOptionsKeys.RenderingApiKey);
}
}
}
}
#endif
| 19.066667 | 88 | 0.715035 | [
"BSD-3-Clause"
] | stephen-hawley/xamarin-macios | src/SceneKit/SCNRenderingOptions.cs | 572 | C# |
// --------------------------------------------------------------------------------------------------------------------
// <auto-generated>
// Generated using OBeautifulCode.CodeGen.ModelObject (1.0.0.0)
// </auto-generated>
// --------------------------------------------------------------------------------------------------------------------
namespace OBeautifulCode.CodeGen.ModelObject.Test
{
using global::System;
using global::System.CodeDom.Compiler;
using global::System.Collections.Concurrent;
using global::System.Collections.Generic;
using global::System.Collections.ObjectModel;
using global::System.Diagnostics.CodeAnalysis;
using global::System.Globalization;
using global::System.Linq;
using global::OBeautifulCode.Cloning.Recipes;
using global::OBeautifulCode.Equality.Recipes;
using global::OBeautifulCode.Type;
using global::OBeautifulCode.Type.Recipes;
using static global::System.FormattableString;
[Serializable]
public partial class ModelStringRepresentationPublicSetReadOnlyCollectionChild2 : IStringRepresentable
{
}
} | 38.517241 | 120 | 0.595345 | [
"MIT"
] | OBeautifulCode/OBeautifulCode.CodeGen | OBeautifulCode.CodeGen.ModelObject.Test/Models/Scripted/StringRepresentation/PublicSet/ReadOnlyCollection/ModelStringRepresentationPublicSetReadOnlyCollectionChild2.designer.cs | 1,119 | C# |
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2013 Stefanos Apostolopoulos for the Open Toolkit library.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Diagnostics;
using OpenTK.Graphics;
namespace OpenTK.Platform.SDL2
{
internal class Sdl2GraphicsContext : DesktopGraphicsContext
{
private IWindowInfo Window { get; set; }
private ContextHandle SdlContext { get; set; }
private Sdl2GraphicsContext(IWindowInfo window)
{
// It is possible to create a GraphicsContext on a window
// that is not owned by SDL (e.g. a GLControl). In that case,
// we need to use SDL_CreateWindowFrom in order to
// convert the foreign window to a SDL window.
if (window is Sdl2WindowInfo)
{
Window = window;
}
else
{
Window = new Sdl2WindowInfo(
SDL.CreateWindowFrom(window.Handle),
null);
}
}
public Sdl2GraphicsContext(GraphicsMode mode,
IWindowInfo win, IGraphicsContext shareContext,
int major, int minor,
OpenTK.Graphics.GraphicsContextFlags flags)
: this(win)
{
lock (SDL.Sync)
{
bool retry = false;
do
{
SetGLAttributes(mode, shareContext, major, minor, flags);
SdlContext = new ContextHandle(SDL.GL.CreateContext(Window.Handle));
// If we failed to create a valid context, relax the GraphicsMode
// and try again.
retry =
SdlContext == ContextHandle.Zero &&
Utilities.RelaxGraphicsMode(ref mode);
}
while (retry);
if (SdlContext == ContextHandle.Zero)
{
var error = SDL.GetError();
Console.Error.WriteLine("SDL2 failed to create OpenGL context: {0}", error);
throw new GraphicsContextException(error);
}
Mode = GetGLAttributes(SdlContext, out flags);
}
Handle = GraphicsContext.GetCurrentContext();
Console.Error.WriteLine("SDL2 created GraphicsContext (handle: {0})", Handle);
Console.Error.WriteLine(" Requested GraphicsMode: {0}", mode);
Console.Error.WriteLine(" Applied GraphicsMode: {0}", Mode);
Console.Error.WriteLine(" GraphicsContextFlags: {0}", flags);
}
private static GraphicsMode GetGLAttributes(ContextHandle sdlContext, out GraphicsContextFlags context_flags)
{
context_flags = 0;
int accum_red, accum_green, accum_blue, accum_alpha;
SDL.GL.GetAttribute(ContextAttribute.ACCUM_RED_SIZE, out accum_red);
SDL.GL.GetAttribute(ContextAttribute.ACCUM_GREEN_SIZE, out accum_green);
SDL.GL.GetAttribute(ContextAttribute.ACCUM_BLUE_SIZE, out accum_blue);
SDL.GL.GetAttribute(ContextAttribute.ACCUM_ALPHA_SIZE, out accum_alpha);
int buffers;
SDL.GL.GetAttribute(ContextAttribute.DOUBLEBUFFER, out buffers);
// DOUBLEBUFFER return a boolean (0-false, 1-true), so we need
// to adjust the buffer count (false->1 buffer, true->2 buffers)
buffers++;
int red, green, blue, alpha;
SDL.GL.GetAttribute(ContextAttribute.RED_SIZE, out red);
SDL.GL.GetAttribute(ContextAttribute.GREEN_SIZE, out green);
SDL.GL.GetAttribute(ContextAttribute.BLUE_SIZE, out blue);
SDL.GL.GetAttribute(ContextAttribute.ALPHA_SIZE, out alpha);
int depth, stencil;
SDL.GL.GetAttribute(ContextAttribute.DEPTH_SIZE, out depth);
SDL.GL.GetAttribute(ContextAttribute.STENCIL_SIZE, out stencil);
int samples;
SDL.GL.GetAttribute(ContextAttribute.MULTISAMPLESAMPLES, out samples);
int stereo;
SDL.GL.GetAttribute(ContextAttribute.STEREO, out stereo);
int major, minor;
SDL.GL.GetAttribute(ContextAttribute.CONTEXT_MAJOR_VERSION, out major);
SDL.GL.GetAttribute(ContextAttribute.CONTEXT_MINOR_VERSION, out minor);
int flags;
SDL.GL.GetAttribute(ContextAttribute.CONTEXT_FLAGS, out flags);
int egl;
SDL.GL.GetAttribute(ContextAttribute.CONTEXT_EGL, out egl);
int profile;
SDL.GL.GetAttribute(ContextAttribute.CONTEXT_PROFILE_MASK, out profile);
if (egl != 0 && (profile & (int)ContextProfileFlags.ES) != 0)
{
context_flags |= GraphicsContextFlags.Embedded;
}
if ((flags & (int)ContextFlags.DEBUG) != 0)
{
context_flags |= GraphicsContextFlags.Debug;
}
if ((profile & (int)ContextProfileFlags.CORE) != 0)
{
context_flags |= GraphicsContextFlags.ForwardCompatible;
}
return new GraphicsMode(
new ColorFormat(red, green, blue, alpha),
depth,
stencil,
samples,
new ColorFormat(accum_red, accum_green, accum_blue, accum_alpha),
buffers,
stereo != 0 ? true : false);
}
private static void ClearGLAttributes()
{
SDL.GL.SetAttribute(ContextAttribute.ACCUM_ALPHA_SIZE, 0);
SDL.GL.SetAttribute(ContextAttribute.ACCUM_RED_SIZE, 0);
SDL.GL.SetAttribute(ContextAttribute.ACCUM_GREEN_SIZE, 0);
SDL.GL.SetAttribute(ContextAttribute.ACCUM_BLUE_SIZE, 0);
SDL.GL.SetAttribute(ContextAttribute.DOUBLEBUFFER, 0);
SDL.GL.SetAttribute(ContextAttribute.ALPHA_SIZE, 0);
SDL.GL.SetAttribute(ContextAttribute.RED_SIZE, 0);
SDL.GL.SetAttribute(ContextAttribute.GREEN_SIZE, 0);
SDL.GL.SetAttribute(ContextAttribute.BLUE_SIZE, 0);
SDL.GL.SetAttribute(ContextAttribute.DEPTH_SIZE, 0);
SDL.GL.SetAttribute(ContextAttribute.MULTISAMPLEBUFFERS, 0);
SDL.GL.SetAttribute(ContextAttribute.MULTISAMPLESAMPLES, 0);
SDL.GL.SetAttribute(ContextAttribute.STENCIL_SIZE, 0);
SDL.GL.SetAttribute(ContextAttribute.STEREO, 0);
SDL.GL.SetAttribute(ContextAttribute.CONTEXT_MAJOR_VERSION, 1);
SDL.GL.SetAttribute(ContextAttribute.CONTEXT_MINOR_VERSION, 0);
SDL.GL.SetAttribute(ContextAttribute.CONTEXT_FLAGS, 0);
SDL.GL.SetAttribute(ContextAttribute.CONTEXT_EGL, 0);
SDL.GL.SetAttribute(ContextAttribute.CONTEXT_PROFILE_MASK, 0);
SDL.GL.SetAttribute(ContextAttribute.SHARE_WITH_CURRENT_CONTEXT, 0);
}
private static void SetGLAttributes(GraphicsMode mode,
IGraphicsContext shareContext,
int major, int minor,
GraphicsContextFlags flags)
{
ContextProfileFlags cpflags = 0;
ClearGLAttributes();
if (mode.AccumulatorFormat.BitsPerPixel > 0)
{
SDL.GL.SetAttribute(ContextAttribute.ACCUM_ALPHA_SIZE, mode.AccumulatorFormat.Alpha);
SDL.GL.SetAttribute(ContextAttribute.ACCUM_RED_SIZE, mode.AccumulatorFormat.Red);
SDL.GL.SetAttribute(ContextAttribute.ACCUM_GREEN_SIZE, mode.AccumulatorFormat.Green);
SDL.GL.SetAttribute(ContextAttribute.ACCUM_BLUE_SIZE, mode.AccumulatorFormat.Blue);
}
if (mode.Buffers > 0)
{
SDL.GL.SetAttribute(ContextAttribute.DOUBLEBUFFER, mode.Buffers > 1 ? 1 : 0);
}
if (mode.ColorFormat > 0)
{
SDL.GL.SetAttribute(ContextAttribute.ALPHA_SIZE, mode.ColorFormat.Alpha);
SDL.GL.SetAttribute(ContextAttribute.RED_SIZE, mode.ColorFormat.Red);
SDL.GL.SetAttribute(ContextAttribute.GREEN_SIZE, mode.ColorFormat.Green);
SDL.GL.SetAttribute(ContextAttribute.BLUE_SIZE, mode.ColorFormat.Blue);
}
if (mode.Depth > 0)
{
SDL.GL.SetAttribute(ContextAttribute.DEPTH_SIZE, mode.Depth);
}
if (mode.Samples > 0)
{
SDL.GL.SetAttribute(ContextAttribute.MULTISAMPLEBUFFERS, 1);
SDL.GL.SetAttribute(ContextAttribute.MULTISAMPLESAMPLES, mode.Samples);
}
if (mode.Stencil > 0)
{
SDL.GL.SetAttribute(ContextAttribute.STENCIL_SIZE, 1);
}
if (mode.Stereo)
{
SDL.GL.SetAttribute(ContextAttribute.STEREO, 1);
}
if (major > 0)
{
// Workaround for https://github.com/opentk/opentk/issues/44
// Mac OS X desktop OpenGL 3.x/4.x contexts require require
// ContextProfileFlags.Core, otherwise they will fail to construct.
if (Configuration.RunningOnMacOS && major >= 3 &&
(flags & GraphicsContextFlags.Embedded) == 0)
{
cpflags |= ContextProfileFlags.CORE;
// According to https://developer.apple.com/graphicsimaging/opengl/capabilities/GLInfo_1075_Core.html
// Mac OS X supports 3.2+. Indeed, requesting 3.0 or 3.1 results in failure.
if (major == 3 && minor < 2)
{
minor = 2;
}
}
SDL.GL.SetAttribute(ContextAttribute.CONTEXT_MAJOR_VERSION, major);
SDL.GL.SetAttribute(ContextAttribute.CONTEXT_MINOR_VERSION, minor);
}
if ((flags & GraphicsContextFlags.Debug) != 0)
{
SDL.GL.SetAttribute(ContextAttribute.CONTEXT_FLAGS, ContextFlags.DEBUG);
}
/*
if ((flags & GraphicsContextFlags.Robust) != 0)
{
SDL.GL.SetAttribute(ContextAttribute.CONTEXT_FLAGS, ContextFlags.ROBUST_ACCESS_FLAG);
}
if ((flags & GraphicsContextFlags.ResetIsolation) != 0)
{
SDL.GL.SetAttribute(ContextAttribute.CONTEXT_FLAGS, ContextFlags.RESET_ISOLATION_FLAG);
}
*/
{
if ((flags & GraphicsContextFlags.Embedded) != 0)
{
cpflags |= ContextProfileFlags.ES;
SDL.GL.SetAttribute(ContextAttribute.CONTEXT_EGL, 1);
}
if ((flags & GraphicsContextFlags.ForwardCompatible) != 0)
{
cpflags |= ContextProfileFlags.CORE;
}
if (cpflags != 0)
{
SDL.GL.SetAttribute(ContextAttribute.CONTEXT_PROFILE_MASK, cpflags);
}
}
if (shareContext != null)
{
if (shareContext.IsCurrent)
{
SDL.GL.SetAttribute(ContextAttribute.SHARE_WITH_CURRENT_CONTEXT, 1);
}
else
{
Trace.WriteLine("Warning: SDL2 requires a shared context to be current before sharing. Sharing failed.");
}
}
}
public static ContextHandle GetCurrentContext()
{
return new ContextHandle(SDL.GL.GetCurrentContext());
}
public override void SwapBuffers()
{
SDL.GL.SwapWindow(Window.Handle);
}
public override void MakeCurrent(IWindowInfo window)
{
int result = 0;
if (window != null)
{
result = SDL.GL.MakeCurrent(window.Handle, SdlContext.Handle);
}
else
{
result = SDL.GL.MakeCurrent(IntPtr.Zero, IntPtr.Zero);
}
if (result < 0)
{
Debug.Print("SDL2 MakeCurrent failed with: {0}", SDL.GetError());
}
}
public override IntPtr GetAddress(IntPtr function)
{
return SDL.GL.GetProcAddress(function);
}
public override bool IsCurrent
{
get
{
return GraphicsContext.GetCurrentContext() == Context;
}
}
public override int SwapInterval
{
get
{
return SDL.GL.GetSwapInterval();
}
set
{
if (SDL.GL.SetSwapInterval(value) < 0)
{
Debug.Print("SDL2 failed to set swap interval: {0}", SDL.GetError());
}
}
}
protected override void Dispose(bool manual)
{
if (!IsDisposed)
{
if (manual)
{
Debug.Print("Disposing {0} (handle: {1})", GetType(), Handle);
lock (SDL.Sync)
{
SDL.GL.DeleteContext(SdlContext.Handle);
}
}
else
{
Debug.Print("Sdl2GraphicsContext (handle: {0}) leaked, did you forget to call Dispose()?",
Handle);
}
IsDisposed = true;
}
}
}
}
| 38.227979 | 125 | 0.562957 | [
"BSD-3-Clause"
] | TizenAPI/opentk | src/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs | 14,756 | C# |
namespace Cbn.Infrastructure.Common.ValueObjects
{
/// <summary>
/// ソートの向き
/// </summary>
public enum SortDirection
{
/// <summary>
/// 昇順
/// </summary>
Asc,
/// <summary>
/// 降順
/// </summary>
Desc,
}
} | 17.235294 | 48 | 0.430034 | [
"MIT"
] | wakuwaku3/cbn.clean-sample | Cbn.Infrastructure.Common/ValueObjects/SortDirection.cs | 313 | C# |
// Copyright (c) Stride contributors (https://stride3d.net) and Silicon Studio Corp. (https://www.siliconstudio.co.jp)
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.
using System;
using System.Collections.Generic;
using Stride.Core;
using Stride.Core.Mathematics;
using Stride.Engine;
using Stride.Games;
using Stride.Graphics;
using Stride.Rendering;
namespace Stride.Physics.Engine
{
public class PhysicsShapesRenderingService : GameSystem
{
private GraphicsDevice graphicsDevice;
private enum ComponentType
{
Trigger,
Static,
Dynamic,
Kinematic,
Character,
}
private readonly Dictionary<ComponentType, Color> componentTypeColor = new Dictionary<ComponentType, Color>
{
{ ComponentType.Trigger, Color.Purple },
{ ComponentType.Static, Color.Red },
{ ComponentType.Dynamic, Color.Green },
{ ComponentType.Kinematic, Color.Blue },
{ ComponentType.Character, Color.LightPink },
};
private readonly Dictionary<ComponentType, Material> componentTypeDefaultMaterial = new Dictionary<ComponentType, Material>();
private readonly Dictionary<ComponentType, Material> componentTypeStaticPlaneMaterial = new Dictionary<ComponentType, Material>();
private readonly Dictionary<ComponentType, Material> componentTypeHeightfieldMaterial = new Dictionary<ComponentType, Material>();
private readonly Dictionary<Type, IDebugPrimitive> debugMeshCache = new Dictionary<Type, IDebugPrimitive>();
private readonly Dictionary<ColliderShape, IDebugPrimitive> debugMeshCache2 = new Dictionary<ColliderShape, IDebugPrimitive>();
private readonly Dictionary<ColliderShape, IDebugPrimitive> updatableDebugMeshCache = new Dictionary<ColliderShape, IDebugPrimitive>();
private readonly Dictionary<ColliderShape, IDebugPrimitive> updatableDebugMeshes = new Dictionary<ColliderShape, IDebugPrimitive>();
public override void Initialize()
{
graphicsDevice = Services.GetSafeServiceAs<IGraphicsDeviceService>().GraphicsDevice;
foreach (var typeObject in Enum.GetValues(typeof(ComponentType)))
{
var type = (ComponentType)typeObject;
componentTypeDefaultMaterial[type] = PhysicsDebugShapeMaterial.CreateDefault(graphicsDevice, Color.AdjustSaturation(componentTypeColor[type], 0.77f), 1);
componentTypeStaticPlaneMaterial[type] = componentTypeDefaultMaterial[type];
componentTypeHeightfieldMaterial[type] = PhysicsDebugShapeMaterial.CreateHeightfieldMaterial(graphicsDevice, Color.AdjustSaturation(componentTypeColor[type], 0.77f), 1);
// TODO enable this once material is implemented.
// ComponentTypeStaticPlaneMaterial[type] = PhysicsDebugShapeMaterial.CreateStaticPlane(graphicsDevice, Color.AdjustSaturation(ComponentTypeColor[type], 0.77f), 1);
}
}
public override void Update(GameTime gameTime)
{
var unusedShapes = new List<ColliderShape>();
foreach (var keyValuePair in updatableDebugMeshes)
{
if (keyValuePair.Value != null && keyValuePair.Key.DebugEntity?.Scene != null && keyValuePair.Key.InternalShape != null)
{
keyValuePair.Key.UpdateDebugPrimitive(Game.GraphicsContext.CommandList, keyValuePair.Value);
}
else
{
unusedShapes.Add(keyValuePair.Key);
}
}
foreach (var shape in unusedShapes)
{
updatableDebugMeshes.Remove(shape);
}
}
public PhysicsShapesRenderingService(IServiceRegistry registry) : base(registry)
{
}
public Entity CreateDebugEntity(PhysicsComponent component, RenderGroup renderGroup, bool alwaysAddOffset = false)
{
if (component?.ColliderShape == null) return null;
if (component.DebugEntity != null) return null;
var debugEntity = new Entity();
var skinnedElement = component as PhysicsSkinnedComponentBase;
if (skinnedElement != null && skinnedElement.BoneIndex != -1)
{
Vector3 scale, pos;
Quaternion rot;
skinnedElement.BoneWorldMatrixOut.Decompose(out scale, out rot, out pos);
debugEntity.Transform.Position = pos;
debugEntity.Transform.Rotation = rot;
}
else
{
Vector3 scale, pos;
Quaternion rot;
component.Entity.Transform.WorldMatrix.Decompose(out scale, out rot, out pos);
debugEntity.Transform.Position = pos;
debugEntity.Transform.Rotation = rot;
}
var shouldNotAddOffset = component is RigidbodyComponent || component is CharacterComponent;
//don't add offset for non bone dynamic and kinematic as it is added already in the updates
var colliderEntity = CreateChildEntity(component, component.ColliderShape, renderGroup, alwaysAddOffset || !shouldNotAddOffset);
if (colliderEntity != null) debugEntity.AddChild(colliderEntity);
return debugEntity;
}
private Entity CreateChildEntity(PhysicsComponent component, ColliderShape shape, RenderGroup renderGroup, bool addOffset)
{
if (shape == null)
return null;
switch (shape.Type)
{
case ColliderShapeTypes.Compound:
{
var entity = new Entity();
//We got to recurse
var compound = (CompoundColliderShape)shape;
for (var i = 0; i < compound.Count; i++)
{
var subShape = compound[i];
var subEntity = CreateChildEntity(component, subShape, renderGroup, true); //always add offsets to compounds
if (subEntity != null)
{
entity.AddChild(subEntity);
}
}
entity.Transform.LocalMatrix = Matrix.Identity;
entity.Transform.UseTRS = false;
compound.DebugEntity = entity;
return entity;
}
case ColliderShapeTypes.Box:
case ColliderShapeTypes.Capsule:
case ColliderShapeTypes.ConvexHull:
case ColliderShapeTypes.Cylinder:
case ColliderShapeTypes.Sphere:
case ColliderShapeTypes.Cone:
case ColliderShapeTypes.StaticPlane:
case ColliderShapeTypes.StaticMesh:
case ColliderShapeTypes.Heightfield:
{
IDebugPrimitive debugPrimitive;
var type = shape.GetType();
if (type == typeof(HeightfieldColliderShape) || type.BaseType == typeof(HeightfieldColliderShape))
{
if (!updatableDebugMeshCache.TryGetValue(shape, out debugPrimitive))
{
debugPrimitive = shape.CreateUpdatableDebugPrimitive(graphicsDevice);
updatableDebugMeshCache[shape] = debugPrimitive;
}
if (!updatableDebugMeshes.ContainsKey(shape))
{
updatableDebugMeshes.Add(shape, debugPrimitive);
}
}
else if (type == typeof(CapsuleColliderShape) || type == typeof(ConvexHullColliderShape) || type == typeof(StaticMeshColliderShape))
{
if (!debugMeshCache2.TryGetValue(shape, out debugPrimitive))
{
debugPrimitive = new DebugPrimitive { shape.CreateDebugPrimitive(graphicsDevice) };
debugMeshCache2[shape] = debugPrimitive;
}
}
else
{
if (!debugMeshCache.TryGetValue(shape.GetType(), out debugPrimitive))
{
debugPrimitive = new DebugPrimitive { shape.CreateDebugPrimitive(graphicsDevice) };
debugMeshCache[shape.GetType()] = debugPrimitive;
}
}
var model = new Model
{
GetMaterial(component, shape),
};
foreach (var meshDraw in debugPrimitive.GetMeshDraws())
{
model.Add(new Mesh { Draw = meshDraw });
}
var entity = new Entity
{
new ModelComponent
{
Model = model,
RenderGroup = renderGroup,
},
};
var offset = addOffset ? Matrix.RotationQuaternion(shape.LocalRotation) * Matrix.Translation(shape.LocalOffset) : Matrix.Identity;
entity.Transform.LocalMatrix = shape.DebugPrimitiveMatrix * offset * Matrix.Scaling(shape.Scaling);
entity.Transform.UseTRS = false;
shape.DebugEntity = entity;
return entity;
}
default:
return null;
}
}
private Material GetMaterial(EntityComponent component, ColliderShape shape)
{
var componentType = ComponentType.Trigger;
var rigidbodyComponent = component as RigidbodyComponent;
if (rigidbodyComponent != null)
{
componentType = rigidbodyComponent.IsTrigger ? ComponentType.Trigger :
rigidbodyComponent.IsKinematic ? ComponentType.Kinematic : ComponentType.Dynamic;
}
else if (component is CharacterComponent)
{
componentType = ComponentType.Character;
}
else if (component is StaticColliderComponent)
{
var staticCollider = (StaticColliderComponent)component;
componentType = staticCollider.IsTrigger ? ComponentType.Trigger : ComponentType.Static;
}
if (shape is StaticPlaneColliderShape)
{
return componentTypeStaticPlaneMaterial[componentType];
}
else if (shape is HeightfieldColliderShape)
{
return componentTypeHeightfieldMaterial[componentType];
}
else
{
return componentTypeDefaultMaterial[componentType];
}
}
}
}
| 44.388462 | 185 | 0.554718 | [
"MIT"
] | Aggror/Stride | sources/engine/Stride.Physics/Engine/PhysicsShapesRenderingService.cs | 11,541 | 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 batch-2016-08-10.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.Batch.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Batch.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for Device Object
/// </summary>
public class DeviceUnmarshaller : IUnmarshaller<Device, XmlUnmarshallerContext>, IUnmarshaller<Device, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
Device IUnmarshaller<Device, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
{
throw new NotImplementedException();
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public Device Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
Device unmarshalledObject = new Device();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("containerPath", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ContainerPath = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("hostPath", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.HostPath = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("permissions", targetDepth))
{
var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance);
unmarshalledObject.Permissions = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static DeviceUnmarshaller _instance = new DeviceUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static DeviceUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 34.778846 | 131 | 0.613492 | [
"Apache-2.0"
] | DetlefGolze/aws-sdk-net | sdk/src/Services/Batch/Generated/Model/Internal/MarshallTransformations/DeviceUnmarshaller.cs | 3,617 | C# |
// This file was automatically generated and may be regenerated at any
// time. To ensure any changes are retained, modify the tool with any segment/component/group/field name
// or type changes.
namespace Machete.HL7Schema.V26
{
using HL7;
/// <summary>
/// RSP_K31_ENCODING (Group) -
/// </summary>
public interface RSP_K31_ENCODING :
HL7V26Layout
{
/// <summary>
/// RXE
/// </summary>
Segment<RXE> RXE { get; }
/// <summary>
/// TIMING_ENCODED
/// </summary>
LayoutList<RSP_K31_TIMING_ENCODED> TimingEncoded { get; }
/// <summary>
/// RXR
/// </summary>
SegmentList<RXR> RXR { get; }
/// <summary>
/// RXC
/// </summary>
SegmentList<RXC> RXC { get; }
}
} | 24.323529 | 104 | 0.544135 | [
"Apache-2.0"
] | ahives/Machete | src/Machete.HL7Schema/V26/Groups/RSP_K31_ENCODING.cs | 827 | C# |
using KeePass.Plugins;
namespace MicrosoftKeyImporterPlugin
{
public sealed class MicrosoftKeyImporterPluginExt : Plugin
{
private IPluginHost _host;
private MicrosoftKeysExportFileFormatProvider _provider;
public override bool Initialize(IPluginHost host)
{
_host = host;
_provider = new MicrosoftKeysExportFileFormatProvider();
_host.FileFormatPool.Add(_provider);
return true;
}
public override void Terminate()
{
_host.FileFormatPool.Remove(_provider);
}
}
} | 25.12 | 69 | 0.613057 | [
"BSD-3-Clause"
] | SeanWH/MicrosoftKeyImporterPlugin | MicrosoftKeyImporterPlugin/MicrosoftKeyImporterPluginExt.cs | 630 | C# |
using System;
using System.Collections.Generic;
using System.Text;
namespace QueueWithStacks.Classes
{
public class Stack<T>
{
public Node<T> Top { get; set; }
public void Push(T value)
{
Node<T> node = new Node<T>(value);
node.Next = Top;
Top = node;
}
public Node<T> Pop()
{
Node<T> temperary = Top;
Top = Top.Next;
temperary.Next = null;
return temperary;
}
public Node<T> Peek()
{
return Top;
}
}
}
| 18.625 | 46 | 0.469799 | [
"MIT"
] | Michael-S-Kelly/data-structures-and-algorithms | Challenges/QueueWithStacks/QueueWithStacks/Classes/Stack.cs | 598 | C# |
using HS.Web.Extensions;
using HS.Web.Models.Options;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace HS.Web.Middlewares
{
public class ProtectFolderMiddleware
{
private readonly RequestDelegate _next;
private readonly PathString _path;
private readonly string _policyName;
public ProtectFolderMiddleware(RequestDelegate next, ProtectFolderOptions options)
{
_next = next;
_path = options.Path;
_policyName = options.PolicyName;
}
public async Task Invoke(HttpContext httpContext, IAuthorizationService authorizationService)
{
if (httpContext.Request.Path.StartsWithSegments(_path))
{
var authorized = _policyName.IsNull()
? httpContext.User.Identity.IsAuthenticated
: (await authorizationService.AuthorizeAsync(httpContext.User, null, _policyName)).Succeeded;
if (!authorized)
{
await httpContext.ChallengeAsync();
return;
}
}
await _next(httpContext);
}
}
}
| 30.088889 | 113 | 0.632201 | [
"MIT"
] | OskarKlintrot/heating-system | src/HS.Web/Middlewares/ProtectFolderMiddleware.cs | 1,354 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using UnityEditor;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Utilities.Editor
{
[CustomEditor(typeof(SimpleLineDataProvider))]
public class SimpleLineDataProviderInspector : BaseLineDataProviderInspector
{
private SerializedProperty endPoint;
private SerializedProperty endPointPosition;
protected override void OnEnable()
{
base.OnEnable();
endPoint = serializedObject.FindProperty("endPoint");
}
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
serializedObject.Update();
// We only have two points.
LinePreviewResolution = 2;
EditorGUILayout.LabelField("Simple Line Settings");
EditorGUI.indentLevel++;
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(endPoint);
EditorGUI.indentLevel--;
serializedObject.ApplyModifiedProperties();
}
protected override void OnSceneGUI()
{
base.OnSceneGUI();
serializedObject.Update();
var rotation = endPoint.FindPropertyRelative("rotation");
if (Tools.current == Tool.Move)
{
EditorGUI.BeginChangeCheck();
Vector3 newTargetPosition = Handles.PositionHandle(LineData.GetPoint(1), Quaternion.identity);
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(LineData, "Change Simple Point Position");
LineData.SetPoint(1, newTargetPosition);
}
}
else if (Tools.current == Tool.Rotate)
{
EditorGUI.BeginChangeCheck();
Quaternion newTargetRotation = Handles.RotationHandle(rotation.quaternionValue, LineData.GetPoint(1));
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(LineData, "Change Simple Point Rotation");
rotation.quaternionValue = newTargetRotation;
}
}
serializedObject.ApplyModifiedProperties();
}
}
} | 32.573333 | 119 | 0.578387 | [
"MIT"
] | AzureMentor/MapsSDK-Unity | SampleProject/Assets/MixedRealityToolkit/Inspectors/Utilities/Lines/DataProviders/SimpleLineDataProviderInspector.cs | 2,445 | 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 medialive-2017-10-14.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.MediaLive.Model
{
/// <summary>
/// Settings for the action to activate a static image.
/// </summary>
public partial class StaticImageActivateScheduleActionSettings
{
private int? _duration;
private int? _fadeIn;
private int? _fadeOut;
private int? _height;
private InputLocation _image;
private int? _imageX;
private int? _imageY;
private int? _layer;
private int? _opacity;
private int? _width;
/// <summary>
/// Gets and sets the property Duration. The duration in milliseconds for the image to
/// remain on the video. If omitted or set to 0 the duration is unlimited and the image
/// will remain until it is explicitly deactivated.
/// </summary>
[AWSProperty(Min=0)]
public int Duration
{
get { return this._duration.GetValueOrDefault(); }
set { this._duration = value; }
}
// Check to see if Duration property is set
internal bool IsSetDuration()
{
return this._duration.HasValue;
}
/// <summary>
/// Gets and sets the property FadeIn. The time in milliseconds for the image to fade
/// in. The fade-in starts at the start time of the overlay. Default is 0 (no fade-in).
/// </summary>
[AWSProperty(Min=0)]
public int FadeIn
{
get { return this._fadeIn.GetValueOrDefault(); }
set { this._fadeIn = value; }
}
// Check to see if FadeIn property is set
internal bool IsSetFadeIn()
{
return this._fadeIn.HasValue;
}
/// <summary>
/// Gets and sets the property FadeOut. Applies only if a duration is specified. The time
/// in milliseconds for the image to fade out. The fade-out starts when the duration time
/// is hit, so it effectively extends the duration. Default is 0 (no fade-out).
/// </summary>
[AWSProperty(Min=0)]
public int FadeOut
{
get { return this._fadeOut.GetValueOrDefault(); }
set { this._fadeOut = value; }
}
// Check to see if FadeOut property is set
internal bool IsSetFadeOut()
{
return this._fadeOut.HasValue;
}
/// <summary>
/// Gets and sets the property Height. The height of the image when inserted into the
/// video, in pixels. The overlay will be scaled up or down to the specified height. Leave
/// blank to use the native height of the overlay.
/// </summary>
[AWSProperty(Min=1)]
public int Height
{
get { return this._height.GetValueOrDefault(); }
set { this._height = value; }
}
// Check to see if Height property is set
internal bool IsSetHeight()
{
return this._height.HasValue;
}
/// <summary>
/// Gets and sets the property Image. The location and filename of the image file to overlay
/// on the video. The file must be a 32-bit BMP, PNG, or TGA file, and must not be larger
/// (in pixels) than the input video.
/// </summary>
[AWSProperty(Required=true)]
public InputLocation Image
{
get { return this._image; }
set { this._image = value; }
}
// Check to see if Image property is set
internal bool IsSetImage()
{
return this._image != null;
}
/// <summary>
/// Gets and sets the property ImageX. Placement of the left edge of the overlay relative
/// to the left edge of the video frame, in pixels. 0 (the default) is the left edge of
/// the frame. If the placement causes the overlay to extend beyond the right edge of
/// the underlying video, then the overlay is cropped on the right.
/// </summary>
[AWSProperty(Min=0)]
public int ImageX
{
get { return this._imageX.GetValueOrDefault(); }
set { this._imageX = value; }
}
// Check to see if ImageX property is set
internal bool IsSetImageX()
{
return this._imageX.HasValue;
}
/// <summary>
/// Gets and sets the property ImageY. Placement of the top edge of the overlay relative
/// to the top edge of the video frame, in pixels. 0 (the default) is the top edge of
/// the frame. If the placement causes the overlay to extend beyond the bottom edge of
/// the underlying video, then the overlay is cropped on the bottom.
/// </summary>
[AWSProperty(Min=0)]
public int ImageY
{
get { return this._imageY.GetValueOrDefault(); }
set { this._imageY = value; }
}
// Check to see if ImageY property is set
internal bool IsSetImageY()
{
return this._imageY.HasValue;
}
/// <summary>
/// Gets and sets the property Layer. The number of the layer, 0 to 7. There are 8 layers
/// that can be overlaid on the video, each layer with a different image. The layers are
/// in Z order, which means that overlays with higher values of layer are inserted on
/// top of overlays with lower values of layer. Default is 0.
/// </summary>
[AWSProperty(Min=0, Max=7)]
public int Layer
{
get { return this._layer.GetValueOrDefault(); }
set { this._layer = value; }
}
// Check to see if Layer property is set
internal bool IsSetLayer()
{
return this._layer.HasValue;
}
/// <summary>
/// Gets and sets the property Opacity. Opacity of image where 0 is transparent and 100
/// is fully opaque. Default is 100.
/// </summary>
[AWSProperty(Min=0, Max=100)]
public int Opacity
{
get { return this._opacity.GetValueOrDefault(); }
set { this._opacity = value; }
}
// Check to see if Opacity property is set
internal bool IsSetOpacity()
{
return this._opacity.HasValue;
}
/// <summary>
/// Gets and sets the property Width. The width of the image when inserted into the video,
/// in pixels. The overlay will be scaled up or down to the specified width. Leave blank
/// to use the native width of the overlay.
/// </summary>
[AWSProperty(Min=1)]
public int Width
{
get { return this._width.GetValueOrDefault(); }
set { this._width = value; }
}
// Check to see if Width property is set
internal bool IsSetWidth()
{
return this._width.HasValue;
}
}
} | 34.371179 | 107 | 0.586965 | [
"Apache-2.0"
] | DetlefGolze/aws-sdk-net | sdk/src/Services/MediaLive/Generated/Model/StaticImageActivateScheduleActionSettings.cs | 7,871 | C# |
using Microsoft.Language.Xml;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Xunit;
using Xunit.Abstractions;
namespace MSBuildProjectTools.LanguageServer.Tests
{
using SemanticModel;
using Utilities;
/// <summary>
/// Tests for <see cref="XSParser"/>
/// </summary>
public sealed class XSParserTests
{
/// <summary>
/// The directory for test files.
/// </summary>
static readonly DirectoryInfo TestDirectory = new DirectoryInfo(Path.GetDirectoryName(
typeof(XSParserTests).Assembly.Location
));
/// <summary>
/// Create a new <see cref="XSParser"/> test suite.
/// </summary>
/// <param name="testOutput">
/// Output for the current test.
/// </param>
public XSParserTests(ITestOutputHelper testOutput)
{
if (testOutput == null)
throw new ArgumentNullException(nameof(testOutput));
TestOutput = testOutput;
}
/// <summary>
/// Output for the current test.
/// </summary>
ITestOutputHelper TestOutput { get; }
/// <summary>
/// XSParser should discover the specified number of nodes.
/// </summary>
/// <param name="testFileName">
/// The name of the test file, without the extension.
/// </param>
/// <param name="expectedNodeCount">
/// The expected number of nodes to be
/// </param>
[InlineData("Test1", 12)]
[Theory(DisplayName = "XSParser discovers node count ")]
void NodeCount(string testFileName, int expectedNodeCount)
{
string testXml = LoadTestFile("TestFiles", testFileName + ".xml");
TextPositions xmlPositions = new TextPositions(testXml);
XmlDocumentSyntax xmlDocument = Parser.ParseText(testXml);
List<XSNode> nodes = xmlDocument.GetSemanticModel(xmlPositions);
Assert.NotNull(nodes);
Assert.Equal(expectedNodeCount, nodes.Count);
}
/// <summary>
/// XSParser should discover a node of the specified kind at the specified index.
/// </summary>
/// <param name="testFileName">
/// The name of the test file, without the extension.
/// </param>
/// <param name="index">
/// The node's index within the semantic model.
/// </param>
/// <param name="nodeKind">
/// The node kind.
/// </param>
[InlineData("Test1", 0, XSNodeKind.Element)]
[InlineData("Test1", 1, XSNodeKind.Whitespace)]
[InlineData("Test1", 2, XSNodeKind.Element)]
[InlineData("Test1", 3, XSNodeKind.Attribute)]
[InlineData("Test1", 4, XSNodeKind.Whitespace)]
[InlineData("Test1", 5, XSNodeKind.Element)]
[InlineData("Test1", 6, XSNodeKind.Whitespace)]
[InlineData("Test1", 7, XSNodeKind.Element)]
[InlineData("Test1", 8, XSNodeKind.Whitespace)]
[InlineData("Test1", 9, XSNodeKind.Whitespace)]
[InlineData("Test1", 10, XSNodeKind.Element)]
[InlineData("Test1", 11, XSNodeKind.Whitespace)]
[InlineData("Invalid1.EmptyOpeningTag", 0, XSNodeKind.Element)]
[InlineData("Invalid1.EmptyOpeningTag", 1, XSNodeKind.Whitespace)]
[InlineData("Invalid1.EmptyOpeningTag", 2, XSNodeKind.Element)]
[InlineData("Invalid1.EmptyOpeningTag", 3, XSNodeKind.Attribute)]
[InlineData("Invalid1.EmptyOpeningTag", 4, XSNodeKind.Whitespace)]
[InlineData("Invalid1.EmptyOpeningTag", 5, XSNodeKind.Element)]
[InlineData("Invalid1.EmptyOpeningTag", 6, XSNodeKind.Whitespace)]
[InlineData("Invalid1.EmptyOpeningTag", 7, XSNodeKind.Element)]
[InlineData("Invalid1.EmptyOpeningTag", 8, XSNodeKind.Whitespace)]
[InlineData("Invalid1.EmptyOpeningTag", 9, XSNodeKind.Element)] // Invalid element
[InlineData("Invalid1.EmptyOpeningTag", 10, XSNodeKind.Whitespace)]
[InlineData("Invalid1.EmptyOpeningTag", 11, XSNodeKind.Whitespace)]
[InlineData("Invalid1.EmptyOpeningTag", 12, XSNodeKind.Element)]
[Theory(DisplayName = "XSParser discovers node of kind ")]
void NodeKind(string testFileName, int index, XSNodeKind nodeKind)
{
string testXml = LoadTestFile("TestFiles", testFileName + ".xml");
TextPositions xmlPositions = new TextPositions(testXml);
XmlDocumentSyntax xmlDocument = Parser.ParseText(testXml);
List<XSNode> nodes = xmlDocument.GetSemanticModel(xmlPositions);
Assert.NotNull(nodes);
Assert.InRange(index, 0, nodes.Count - 1);
XSNode node = nodes[index];
Assert.NotNull(node);
Assert.Equal(nodeKind, node.Kind);
}
/// <summary>
/// XSParser should discover an invalid element at the specified index.
/// </summary>
/// <param name="testFileName">
/// The name of the test file, without the extension.
/// </param>
/// <param name="index">
/// The element node's index within the semantic model.
/// </param>
[InlineData("Invalid1.EmptyOpeningTag", 9)]
[InlineData("Invalid1.DoubleOpeningTag", 7)]
[Theory(DisplayName = "XSParser discovers invalid element ")]
void InvalidElement(string testFileName, int index)
{
string testXml = LoadTestFile("TestFiles", testFileName + ".xml");
TextPositions xmlPositions = new TextPositions(testXml);
XmlDocumentSyntax xmlDocument = Parser.ParseText(testXml);
List<XSNode> nodes = xmlDocument.GetSemanticModel(xmlPositions);
Assert.NotNull(nodes);
Assert.InRange(index, 0, nodes.Count - 1);
XSNode node = nodes[index];
Assert.NotNull(node);
Assert.Equal(XSNodeKind.Element, node.Kind);
Assert.False(node.IsValid, "IsValid");
}
/// <summary>
/// XSParser should discover a node with the specified range at the specified index.
/// </summary>
/// <param name="testFileName">
/// The name of the test file, without the extension.
/// </param>
/// <param name="index">
/// The node index.
/// </param>
/// <param name="startLine">
/// The node's starting line.
/// </param>
/// <param name="startColumn">
/// The node's starting column.
/// </param>
/// <param name="endLine">
/// The node's ending line.
/// </param>
/// <param name="endColumn">
/// The node's ending column.
/// </param>
[InlineData("Test1", 0, 1, 1, 7, 12)]
[InlineData("Test1", 1, 1, 11, 2, 5)]
[InlineData("Test1", 2, 2, 5, 5, 16)]
[InlineData("Test1", 3, 2, 15, 2, 34)]
[InlineData("Test1", 4, 2, 36, 3, 9)]
[InlineData("Test1", 5, 3, 9, 3, 21)]
[InlineData("Test1", 6, 3, 21, 4, 9)]
[InlineData("Test1", 7, 4, 9, 4, 21)]
[InlineData("Test1", 8, 4, 21, 5, 5)]
[InlineData("Test1", 9, 5, 16, 6, 5)]
[InlineData("Test1", 10, 6, 5, 6, 27)]
[InlineData("Test1", 11, 6, 27, 7, 1)]
[Theory(DisplayName = "XSParser discovers node with range ")]
void NodeRange(string testFileName, int index, int startLine, int startColumn, int endLine, int endColumn)
{
string testXml = LoadTestFile("TestFiles", testFileName + ".xml");
TextPositions xmlPositions = new TextPositions(testXml);
XmlDocumentSyntax xmlDocument = Parser.ParseText(testXml);
List<XSNode> nodes = xmlDocument.GetSemanticModel(xmlPositions);
Assert.NotNull(nodes);
Assert.InRange(index, 0, nodes.Count - 1);
XSNode node = nodes[index];
Assert.NotNull(node);
TestOutput.WriteLine("Node {0} at {1} is {2}.",
index,
node.Range,
node.Kind
);
Range expectedRange = new Range(
start: new Position(startLine, startColumn),
end: new Position(endLine, endColumn)
);
Assert.Equal(expectedRange, node.Range);
}
/// <summary>
/// XSParser should discover an element with the specified attributes range at the specified index.
/// </summary>
/// <param name="testFileName">
/// The name of the test file, without the extension.
/// </param>
/// <param name="index">
/// The node index.
/// </param>
/// <param name="elementName">
/// The expected element name.
/// </param>
/// <param name="startLine">
/// The element's attributes node's starting line.
/// </param>
/// <param name="startColumn">
/// The element's attributes node's starting column.
/// </param>
/// <param name="endLine">
/// The element's attributes node's ending line.
/// </param>
/// <param name="endColumn">
/// The element's attributes node's ending column.
/// </param>
[InlineData("Test1", "Element2", 2, 15, 2, 35)]
[InlineData("Test2", "PackageReference", 11, 27, 11, 70)]
[Theory(DisplayName = "XSParser discovers element with attributes range ")]
void ElementAttributesRange(string testFileName, string elementName, int startLine, int startColumn, int endLine, int endColumn)
{
string testXml = LoadTestFile("TestFiles", testFileName + ".xml");
TextPositions xmlPositions = new TextPositions(testXml);
XmlDocumentSyntax xmlDocument = Parser.ParseText(testXml);
List<XSNode> nodes = xmlDocument.GetSemanticModel(xmlPositions);
Assert.NotNull(nodes);
XSNode targetNode = nodes.Find(node => node.Name == elementName);
Assert.NotNull(targetNode);
Assert.IsAssignableFrom<XSElement>(targetNode);
XSElement targetElement = (XSElement)targetNode;
Range expectedRange = new Range(
start: new Position(startLine, startColumn),
end: new Position(endLine, endColumn)
);
Assert.Equal(expectedRange, targetElement.AttributesRange);
}
/// <summary>
/// Verify that the Parser correctly determines an invalid element's range.
/// </summary>
/// <param name="testFileName">
/// The name of the test file, without the extension.
/// </param>
/// <param name="index">
/// The node index.
/// </param>
/// <param name="elementName">
/// The expected element name.
/// </param>
/// <param name="startLine">
/// The element's attributes node's starting line.
/// </param>
/// <param name="startColumn">
/// The element's attributes node's starting column.
/// </param>
/// <param name="endLine">
/// The element's attributes node's ending line.
/// </param>
/// <param name="endColumn">
/// The element's attributes node's ending column.
/// </param>
[Theory(DisplayName = "Invalid element has expected range ")]
[InlineData("Invalid2.NoClosingTag", 22, "P", 10, 5, 10, 8)]
public void InvalidElementRange(string testFileName, int nodeIndex, string elementName, int startLine, int startColumn, int endLine, int endColumn)
{
string testXml = LoadTestFile("TestFiles", testFileName + ".xml");
TextPositions xmlPositions = new TextPositions(testXml);
XmlDocumentSyntax xmlDocument = Parser.ParseText(testXml);
List<XSNode> nodes = xmlDocument.GetSemanticModel(xmlPositions);
Assert.NotNull(nodes);
XSNode targetNode = nodes[nodeIndex];
Assert.NotNull(targetNode);
Assert.IsAssignableFrom<XSElement>(targetNode);
XSElement targetElement = (XSElement)targetNode;
Assert.Equal(elementName, targetElement.Name);
Assert.False(targetElement.IsValid, "IsValid");
Range expectedRange = new Range(
start: new Position(startLine, startColumn),
end: new Position(endLine, endColumn)
);
Assert.Equal(expectedRange, targetElement.Range);
}
/// <summary>
/// Load a test file.
/// </summary>
/// <param name="relativePathSegments">
/// The file's relative path segments.
/// </param>
/// <returns>
/// The file content, as a string.
/// </returns>
static string LoadTestFile(params string[] relativePathSegments)
{
if (relativePathSegments == null)
throw new ArgumentNullException(nameof(relativePathSegments));
return File.ReadAllText(
Path.Combine(
TestDirectory.FullName,
Path.Combine(relativePathSegments)
)
);
}
}
}
| 40.328358 | 155 | 0.573723 | [
"MIT"
] | BThree496/msbuild-project-tools-server | test/LanguageServer.Engine.Tests/XSParserTests.cs | 13,510 | C# |
using Common;
using Hangfire;
using Microsoft.AspNetCore.Http;
using System;
using System.IO;
using System.Linq;
namespace Masuit.MyBlogs.Core.Extensions.UEditor
{
/// <summary>
/// UploadHandler 的摘要说明
/// </summary>
public class UploadHandler : Handler
{
public UploadConfig UploadConfig { get; }
public UploadResult Result { get; }
public UploadHandler(HttpContext context, UploadConfig config) : base(context)
{
UploadConfig = config;
Result = new UploadResult()
{
State = UploadState.Unknown
};
}
public override string Process()
{
var file = Request.Form.Files[UploadConfig.UploadFieldName];
var uploadFileName = file.FileName;
if (!CheckFileType(uploadFileName))
{
Result.State = UploadState.TypeNotAllow;
return WriteResult();
}
if (!CheckFileSize(file.Length))
{
Result.State = UploadState.SizeLimitExceed;
return WriteResult();
}
var uploadFileBytes = new byte[file.Length];
try
{
file.OpenReadStream().Read(uploadFileBytes, 0, (int)file.Length);
}
catch (Exception)
{
Result.State = UploadState.NetworkError;
return WriteResult();
}
Result.OriginFileName = uploadFileName;
var savePath = PathFormatter.Format(uploadFileName, UploadConfig.PathFormat);
var localPath = AppContext.BaseDirectory + "wwwroot" + savePath;
try
{
if (UploadConfig.AllowExtensions.Contains(Path.GetExtension(uploadFileName)))
{
if (!Directory.Exists(Path.GetDirectoryName(localPath)))
{
Directory.CreateDirectory(Path.GetDirectoryName(localPath));
}
File.WriteAllBytes(localPath, file.OpenReadStream().ToByteArray());
var (url, success) = CommonHelper.UploadImage(localPath);
if (success)
{
BackgroundJob.Enqueue(() => File.Delete(localPath));
Result.Url = url;
}
else
{
Result.Url = savePath;
}
}
else
{
Result.Url = savePath;
}
Result.State = UploadState.Success;
}
catch (Exception e)
{
Result.State = UploadState.FileAccessError;
Result.ErrorMessage = e.Message;
}
return WriteResult();
}
private string WriteResult()
{
return WriteJson(new
{
state = GetStateMessage(Result.State),
url = Result.Url,
title = Result.OriginFileName,
original = Result.OriginFileName,
error = Result.ErrorMessage
});
}
private string GetStateMessage(UploadState state)
{
switch (state)
{
case UploadState.Success:
return "SUCCESS";
case UploadState.FileAccessError:
return "文件访问出错,请检查写入权限";
case UploadState.SizeLimitExceed:
return "文件大小超出服务器限制";
case UploadState.TypeNotAllow:
return "不允许的文件格式";
case UploadState.NetworkError:
return "网络错误";
}
return "未知错误";
}
private bool CheckFileType(string filename)
{
var fileExtension = Path.GetExtension(filename).ToLower();
return UploadConfig.AllowExtensions.Select(x => x.ToLower()).Contains(fileExtension);
}
private bool CheckFileSize(long size)
{
return size < UploadConfig.SizeLimit;
}
}
public class UploadConfig
{
/// <summary>
/// 文件命名规则
/// </summary>
public string PathFormat { get; set; }
/// <summary>
/// 上传表单域名称
/// </summary>
public string UploadFieldName { get; set; }
/// <summary>
/// 上传大小限制
/// </summary>
public int SizeLimit { get; set; }
/// <summary>
/// 上传允许的文件格式
/// </summary>
public string[] AllowExtensions { get; set; }
/// <summary>
/// 文件是否以 Base64 的形式上传
/// </summary>
public bool Base64 { get; set; }
/// <summary>
/// Base64 字符串所表示的文件名
/// </summary>
public string Base64Filename { get; set; }
}
public class UploadResult
{
public UploadState State { get; set; }
public string Url { get; set; }
public string OriginFileName { get; set; }
public string ErrorMessage { get; set; }
}
public enum UploadState
{
NetworkError = -4,
FileAccessError = -3,
TypeNotAllow = -2,
SizeLimitExceed = -1,
Success = 0,
Unknown = 1
}
} | 29.407609 | 97 | 0.493254 | [
"MIT"
] | vidys/Masuit.MyBlogs | src/Masuit.MyBlogs.Core/Extensions/UEditor/UploadHandler.cs | 5,601 | C# |
namespace Trakx.Shrimpy.ApiClient
{
internal partial class AccountsClient
{
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url)
{
CredentialProvider.AddCredentials(request);
}
}
}
| 22.923077 | 126 | 0.684564 | [
"MIT"
] | trakx/shrimpy-api-client | src/Trakx.Shrimpy.ApiClient/ApiClients.Partials.cs | 300 | C# |
using UnityEngine;
using System.Collections;
public class StartGame : MonoBehaviour {
public static bool first_load = true;
public GameObject GUIC;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
GUIC.GetComponent<AudioSource> ().volume = Settings.music;
AudioListener.volume = Settings.volume;
}
public void ContinueGame () {
if (first_load != true) {
Application.LoadLevel("Solar");
}
}
public void NewGame () {
first_load = false;
Time.timeScale = 0;
Application.LoadLevel("Solar");
Time.timeScale = 1;
}
}
| 17.285714 | 60 | 0.689256 | [
"MIT"
] | darknessomi/Unity-SolarSystem | Assets/scripts/StartGame.cs | 607 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UIGameplayPlayAgainButton : Pieka
{
public void OnClick()
{
FireEvent (EventIDs.GameplayUI.PlayAgainButton);
}
} | 17.833333 | 50 | 0.780374 | [
"MIT"
] | piekaa/4Cannons | Assets/Scripts/UIGameplayPlayAgainButton.cs | 216 | C# |
using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Source.DLaB.Common;
namespace DLaB.Common.Tests
{
[TestClass]
public class ConfigTests
{
[TestMethod]
public void RoundTripDictionary_Should_BeUnchanged()
{
var dict = new Dictionary<string, string>
{
["null"] = null,
["one"] = "1",
["two"] = "2"
};
var values = Config.ToString(dict);
var output = Config.GetDictionary<string, string>(Guid.NewGuid().ToString(), values);
foreach (var key in dict.Keys)
{
Assert.AreEqual(dict[key], output[key]);
}
}
[TestMethod]
public void RoundTripDictionaryList_Should_BeUnchanged()
{
var dict = new Dictionary<string, List<int>>
{
["null"] = null,
["empty"] = new List<int> (),
["one"] = new List<int>{ 1 },
["two"] = new List<int>{ 1, 2 },
["three"] = new List<int> { 1, 2, 3 }
};
var values = Config.ToString(dict);
var output = Config.GetDictionaryList<string, int>(Guid.NewGuid().ToString(), values);
foreach (var key in dict.Keys)
{
if (key == "null")
{
Assert.AreEqual(0, output[key].Count);
continue;
}
Assert.AreEqual(dict[key].Count, output[key].Count);
var i = 0;
foreach (var value in dict[key])
{
Assert.AreEqual(value, output[key][i++]);
}
}
}
[TestMethod]
public void RoundTripDictionaryHash_Should_BeUnchanged()
{
var dict = new Dictionary<string, HashSet<string>>
{
{"0", new HashSet<string>()},
{
"1", new HashSet<string>
{
"A"
}
},
{
"2", new HashSet<string>
{
"A",
"B"
}
}
};
var values = Config.ToString(dict);
var output = Config.GetDictionaryHash<string, string>(Guid.NewGuid().ToString(), values);
Assert.AreEqual(dict.Count, output.Count);
foreach (var kvp in dict)
{
Assert.AreEqual(kvp.Value.Count, output[kvp.Key].Count);
foreach (var value in kvp.Value)
{
Assert.IsTrue(output[kvp.Key].Contains(value));
}
}
}
[TestMethod]
public void RoundTripHash_Should_BeUnchanged()
{
var hash = new HashSet<string>
{
"",
"1",
"2"
};
var values = Config.ToString(hash);
var output = Config.GetHashSet<string>(Guid.NewGuid().ToString(), values);
Assert.AreEqual(hash.Count, output.Count);
hash.Remove(null);
hash.Add("");
foreach (var key in hash)
{
Assert.IsTrue(output.Contains(key));
}
}
[TestMethod]
public void RoundTripList_Should_BeUnchanged()
{
var list = new List<string>
{
"",
"1",
"2"
};
var values = Config.ToString(list);
var output = Config.GetHashSet<string>(Guid.NewGuid().ToString(), values);
Assert.AreEqual(list.Count, output.Count);
list.Remove(null);
list.Add("");
foreach (var key in list)
{
Assert.IsTrue(output.Contains(key));
}
}
}
}
| 27.052632 | 101 | 0.430691 | [
"MIT"
] | daryllabar/DLaB.Common | DLaB.Common.DotNetCore.Tests/ConfigTests.cs | 4,114 | 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 es-2015-01-01.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.Elasticsearch.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.Elasticsearch.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for ResourceAlreadyExistsException Object
/// </summary>
public class ResourceAlreadyExistsExceptionUnmarshaller : IErrorResponseUnmarshaller<ResourceAlreadyExistsException, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public ResourceAlreadyExistsException Unmarshall(JsonUnmarshallerContext context)
{
return this.Unmarshall(context, new ErrorResponse());
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <param name="errorResponse"></param>
/// <returns></returns>
public ResourceAlreadyExistsException Unmarshall(JsonUnmarshallerContext context, ErrorResponse errorResponse)
{
context.Read();
ResourceAlreadyExistsException unmarshalledObject = new ResourceAlreadyExistsException(errorResponse.Message, errorResponse.InnerException,
errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
}
return unmarshalledObject;
}
private static ResourceAlreadyExistsExceptionUnmarshaller _instance = new ResourceAlreadyExistsExceptionUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static ResourceAlreadyExistsExceptionUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 36.552941 | 152 | 0.659157 | [
"Apache-2.0"
] | philasmar/aws-sdk-net | sdk/src/Services/Elasticsearch/Generated/Model/Internal/MarshallTransformations/ResourceAlreadyExistsExceptionUnmarshaller.cs | 3,107 | C# |
using SimpleJSON;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
public partial class ShowTemperature : MonoBehaviour {
Text _textWidget;
string _textToDisplay;
List<string> _deviceIds;
bool _deviceIdsFilled;
// Use this for initialization
/*async*/ void Start () {
Debug.Log("Starting");
_deviceIdsFilled = false;
_textWidget = GetComponentInChildren<Text>();
#if !UNITY_EDITOR
//await ReadItLib.ReadIt.Start(this.SetValue);
//await ReadItLib.ReadIt.updateDeviceIdsComboBoxes(this.ShowDevices);
#else
_textToDisplay = "Unity text";
//await TimeSpan.FromSeconds(1);
#endif
//StartCoroutine(PostRequest(WebAPIEndpoint, "{\"query\":\"select * from devices\"}"));
SetParseResult();
}
//IEnumerator PostRequest(string url, string json)
//{
// var uwr = new UnityWebRequest(url, "POST");
// byte[] jsonToSend = new System.Text.UTF8Encoding().GetBytes(json);
// uwr.uploadHandler = (UploadHandler)new UploadHandlerRaw(jsonToSend);
// uwr.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
// uwr.SetRequestHeader("Authorization", WebAPIHeaderAuthorization);
// uwr.SetRequestHeader("Content-Type", "application/json");
// //Send the request then wait here until it returns
// yield return uwr.SendWebRequest();
// string result = "Waiting...";
// if (uwr.isNetworkError)
// {
// result = "Error While Sending: " + uwr.error;
// }
// else
// {
// result = /*"Received: " +*/ uwr.downloadHandler.text;
// }
// Debug.Log(result);
// //List<DeviceModel> listOfModels = new List<DeviceModel>() { new DeviceModel() { deviceId = "dev_id" } };
// //string jsonString = ShowTemperature.ToJson(listOfModels.ToArray());
// string formattedJson = "{\"Received\"" + result.Substring("Received".Length) + "}";
// var N = JSON.Parse(result);
// var cnt = N.AsArray.Count;
// var sysCount = N.AsArray[0]["tags"]["systems"]["count"];
// //DeviceModel[] devices = ShowTemperature.FromJson<DeviceModel>(formattedJson);
// //_textToDisplay = devices[0].deviceId;
//}
public void SetParseResult()
{
//var parser = new DeviceParser();
}
// Update is called once per frame
void Update () {
_textWidget.text = _textToDisplay;
//if(_deviceIdsFilled)
//{
// if (_deviceIds != null && _deviceIds.Count > 0)
// _textWidget.text = string.Join(",", _deviceIds);
// else
// _textWidget.text = "No devices found";
//}
}
void SetValue(string theValue)
{
_textToDisplay = theValue;
}
//void ShowDevices(bool ready, List<string> deviceIds)
//{
// _deviceIds = deviceIds;
// _deviceIdsFilled = ready;
//}
public static T[] FromJson<T>(string json)
{
Wrapper<T> wrapper = UnityEngine.JsonUtility.FromJson<Wrapper<T>>(json);
return wrapper.Received;
}
public static string ToJson<T>(T[] array)
{
Wrapper<T> wrapper = new Wrapper<T>();
wrapper.Received = array;
return UnityEngine.JsonUtility.ToJson(wrapper);
}
[Serializable]
private class Wrapper<T>
{
public T[] Received;
}
}
| 27.912698 | 115 | 0.607051 | [
"MIT"
] | Trojka/HoloDuino | Unity/ReadIt/Assets/Scripts/ShowTemperature.cs | 3,519 | C# |
using System.Linq;
using System.Web.Http;
using System.Web.OData;
using System.Web.OData.Routing;
using Microsoft.Web.Http;
using TestRestfulAPI.Infrastructure.Authorization.Attributes;
using TestRestfulAPI.Infrastructure.Controllers;
using TestRestfulAPI.RestApi.odata.v1.Users.Entities;
using TestRestfulAPI.RestApi.odata.v1.Users.Services;
namespace TestRestfulAPI.RestApi.odata.v1.Users.Controllers
{
[ApiVersion("1.0")]
[ODataRoutePrefix("Permissions")]
[UserHasRole("UserControl")]
public class PermissionController : ResourceODataController, ICrudController<Permission>
{
private readonly PermissionService _permissionService = GlobalServices.PermissionService;
// GET: {resource}/Permissions
[EnableQuery, HttpGet, ODataRoute("()")]
public IQueryable<Permission> Get()
{
return this._permissionService.All();
}
// GET: {resource}/Permissions({id})
[EnableQuery, HttpGet, ODataRoute("({id})")]
public Permission Get(int id)
{
return this._permissionService.Get(id);
}
// POST: {resource}/Permissions()
[EnableQuery, HttpPost, ODataRoute("()")]
public IHttpActionResult Create(Permission entity)
{
return ODataCreated(this._permissionService.Create(entity), entity.Id);
}
// PUT: {resource}/Permissions({id})
[EnableQuery, HttpPut, ODataRoute("({id})")]
public Permission Update(int id, Permission entity)
{
return this._permissionService.Update(entity);
}
// PATCH: {resource}/Permissions({id})
[EnableQuery, HttpPatch, ODataRoute("({id})")]
public Permission PartialUpdate(int id, Delta<Permission> entity)
{
return this._permissionService.PartialUpdate(id, entity);
}
// DELETE: {resource}/Permissions({id})
[EnableQuery, HttpDelete, ODataRoute("({id})")]
public void Delete(int id)
{
this.ParseResource();
this._permissionService.Delete(id);
this.ODataDeleted(); // Set response headers
}
}
} | 34.03125 | 97 | 0.644628 | [
"MIT"
] | erlingsjostrom/TESS-V2 | API/TestRestfulAPI/RestApi/odata/v1/Users/Controllers/PermissionController.cs | 2,180 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace WebApplication7.Services
{
// This class is used by the application to send email for account confirmation and password reset.
// For more details see https://go.microsoft.com/fwlink/?LinkID=532713
public class EmailSender : IEmailSender
{
public Task SendEmailAsync(string email, string subject, string message)
{
return Task.CompletedTask;
}
}
}
| 28.5 | 103 | 0.709552 | [
"MIT"
] | n3v3r94/FistSPA | WebApplication7/Services/EmailSender.cs | 515 | C# |
using System;
using System.Collections.Generic;
namespace Problem_3.Pyramidic
{
class Program
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
Dictionary<char, int> charAndOccurances = new Dictionary<char, int>();
int currentMax = -1;
char maxChar = (char)1;
for (int i = 0; i < n; i++)
{
string input = Console.ReadLine();
HashSet<char> alreadyChecked = new HashSet<char>();
foreach (var currentChar in input)
{
if (alreadyChecked.Contains(currentChar))
{
continue;
}
alreadyChecked.Add(currentChar);
if (!charAndOccurances.ContainsKey(currentChar))
{
charAndOccurances.Add(currentChar,0);
}
var searchCount = charAndOccurances[currentChar];
if (searchCount == 0)
{
searchCount = 1;
}
else
{
searchCount += 2;
}
if (input.Contains(new string(currentChar, searchCount)))
{
charAndOccurances[currentChar] = searchCount;
if (currentMax < searchCount)
{
currentMax = searchCount;
maxChar = currentChar;
}
}
else
{
charAndOccurances[currentChar] = 1;
}
}
var keysToUpdate = new List<char>(charAndOccurances.Keys);
foreach (var currentChar in keysToUpdate)
{
if (!alreadyChecked.Contains(currentChar))
{
charAndOccurances[currentChar] = 0;
}
}
}
for (int i = 1; i <= currentMax; i+=2)
{
Console.WriteLine(new string(maxChar, i));
}
}
}
} | 29.924051 | 82 | 0.391709 | [
"MIT"
] | Supbads/Softuni-Education | 07 ProgrammingFundamentals 05.17/fakehw/Problem 3. Pyramidic/Program.cs | 2,366 | C# |
// <copyright file="ElasticsearchClientTests.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// 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.
// </copyright>
using System;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Elasticsearch.Net;
using Moq;
using Nest;
using OpenTelemetry.Resources;
using OpenTelemetry.Tests;
using OpenTelemetry.Trace;
using Xunit;
using Status = OpenTelemetry.Trace.Status;
namespace OpenTelemetry.Instrumentation.ElasticsearchClient.Tests
{
public class ElasticsearchClientTests
{
public ElasticsearchClientTests()
{
Activity.DefaultIdFormat = ActivityIdFormat.W3C;
}
[Fact]
public async Task CanCaptureGetById()
{
var expectedResource = ResourceBuilder.CreateDefault().AddService("test-service");
var processor = new Mock<BaseProcessor<Activity>>();
var parent = new Activity("parent").Start();
var client = new ElasticClient(new ConnectionSettings(new InMemoryConnection()).DefaultIndex("customer"));
using (Sdk.CreateTracerProviderBuilder()
.SetSampler(new AlwaysOnSampler())
.AddElasticsearchClientInstrumentation()
.SetResourceBuilder(expectedResource)
.AddProcessor(processor.Object)
.Build())
{
var getResponse = await client.GetAsync<Customer>("123");
Assert.NotNull(getResponse);
Assert.True(getResponse.ApiCall.Success);
Assert.NotEmpty(getResponse.ApiCall.AuditTrail);
var failed = getResponse.ApiCall.AuditTrail.Where(a => a.Event == AuditEvent.BadResponse);
Assert.Empty(failed);
}
// SetParentProvider, OnStart, OnEnd, OnShutdown, Dispose
Assert.Equal(5, processor.Invocations.Count);
var activities = processor.Invocations.Where(i => i.Method.Name == "OnEnd").Select(i => i.Arguments[0]).Cast<Activity>().ToArray();
Assert.Single(activities);
var searchActivity = activities[0];
Assert.Equal(parent.TraceId, searchActivity.Context.TraceId);
Assert.Equal(parent.SpanId, searchActivity.ParentSpanId);
Assert.NotEqual(parent.SpanId, searchActivity.Context.SpanId);
Assert.NotEqual(default, searchActivity.Context.SpanId);
Assert.Equal($"Elasticsearch GET customer", searchActivity.DisplayName);
var tags = searchActivity.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Assert.Equal("localhost", searchActivity.GetTagValue(SemanticConventions.AttributeNetPeerName));
Assert.Equal(9200, searchActivity.GetTagValue(SemanticConventions.AttributeNetPeerPort));
Assert.Equal("elasticsearch", searchActivity.GetTagValue(SemanticConventions.AttributeDbSystem));
Assert.Equal("customer", searchActivity.GetTagValue(SemanticConventions.AttributeDbName));
var debugInfo = (string)searchActivity.GetTagValue(SemanticConventions.AttributeDbStatement);
Assert.NotEmpty(debugInfo);
Assert.Contains("Successful (200) low level call", debugInfo);
Assert.Equal(Status.Unset, searchActivity.GetStatus());
// Assert.Equal(expectedResource, searchActivity.GetResource());
}
[Fact]
public async Task CanCaptureGetByIdNotFound()
{
var expectedResource = ResourceBuilder.CreateDefault().AddService("test-service");
var processor = new Mock<BaseProcessor<Activity>>();
var parent = new Activity("parent").Start();
var client = new ElasticClient(new ConnectionSettings(new InMemoryConnection(null, statusCode: 404)).DefaultIndex("customer"));
using (Sdk.CreateTracerProviderBuilder()
.SetSampler(new AlwaysOnSampler())
.AddElasticsearchClientInstrumentation()
.SetResourceBuilder(expectedResource)
.AddProcessor(processor.Object)
.Build())
{
var getResponse = await client.GetAsync<Customer>("123");
Assert.NotNull(getResponse);
Assert.True(getResponse.ApiCall.Success);
Assert.NotEmpty(getResponse.ApiCall.AuditTrail);
var failed = getResponse.ApiCall.AuditTrail.Where(a => a.Event == AuditEvent.BadResponse);
Assert.Empty(failed);
}
// SetParentProvider, OnStart, OnEnd, OnShutdown, Dispose
Assert.Equal(5, processor.Invocations.Count);
var activities = processor.Invocations.Where(i => i.Method.Name == "OnEnd").Select(i => i.Arguments[0]).Cast<Activity>().ToArray();
Assert.Single(activities);
var searchActivity = activities[0];
Assert.Equal(parent.TraceId, searchActivity.Context.TraceId);
Assert.Equal(parent.SpanId, searchActivity.ParentSpanId);
Assert.NotEqual(parent.SpanId, searchActivity.Context.SpanId);
Assert.NotEqual(default, searchActivity.Context.SpanId);
Assert.Equal($"Elasticsearch GET customer", searchActivity.DisplayName);
var tags = searchActivity.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Assert.Equal("localhost", searchActivity.GetTagValue(SemanticConventions.AttributeNetPeerName));
Assert.Equal(9200, searchActivity.GetTagValue(SemanticConventions.AttributeNetPeerPort));
Assert.Equal("elasticsearch", searchActivity.GetTagValue(SemanticConventions.AttributeDbSystem));
Assert.Equal("customer", searchActivity.GetTagValue(SemanticConventions.AttributeDbName));
var debugInfo = (string)searchActivity.GetTagValue(SemanticConventions.AttributeDbStatement);
Assert.NotEmpty(debugInfo);
Assert.Contains("Successful (404) low level call", debugInfo);
Assert.Equal(Status.Unset, searchActivity.GetStatus());
// Assert.Equal(expectedResource, searchActivity.GetResource());
}
[Fact]
public async Task CanCaptureSearchCall()
{
var expectedResource = ResourceBuilder.CreateDefault().AddService("test-service");
var processor = new Mock<BaseProcessor<Activity>>();
var parent = new Activity("parent").Start();
var client = new ElasticClient(new ConnectionSettings(new InMemoryConnection()).DefaultIndex("customer"));
using (Sdk.CreateTracerProviderBuilder()
.SetSampler(new AlwaysOnSampler())
.AddElasticsearchClientInstrumentation()
.SetResourceBuilder(expectedResource)
.AddProcessor(processor.Object)
.Build())
{
var searchResponse = await client.SearchAsync<Customer>(s => s.Query(q => q.Bool(b => b.Must(m => m.Term(f => f.Id, "123")))));
Assert.NotNull(searchResponse);
Assert.True(searchResponse.ApiCall.Success);
Assert.NotEmpty(searchResponse.ApiCall.AuditTrail);
var failed = searchResponse.ApiCall.AuditTrail.Where(a => a.Event == AuditEvent.BadResponse);
Assert.Empty(failed);
}
// SetParentProvider, OnStart, OnEnd, OnShutdown, Dispose
Assert.Equal(5, processor.Invocations.Count);
var activities = processor.Invocations.Where(i => i.Method.Name == "OnEnd").Select(i => i.Arguments[0]).Cast<Activity>().ToArray();
Assert.Single(activities);
var searchActivity = activities[0];
Assert.Equal(parent.TraceId, searchActivity.Context.TraceId);
Assert.Equal(parent.SpanId, searchActivity.ParentSpanId);
Assert.NotEqual(parent.SpanId, searchActivity.Context.SpanId);
Assert.NotEqual(default, searchActivity.Context.SpanId);
Assert.Equal($"Elasticsearch POST customer", searchActivity.DisplayName);
var tags = searchActivity.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Assert.Equal("localhost", searchActivity.GetTagValue(SemanticConventions.AttributeNetPeerName));
Assert.Equal(9200, searchActivity.GetTagValue(SemanticConventions.AttributeNetPeerPort));
Assert.Equal("elasticsearch", searchActivity.GetTagValue(SemanticConventions.AttributeDbSystem));
Assert.Equal("customer", searchActivity.GetTagValue(SemanticConventions.AttributeDbName));
var debugInfo = (string)searchActivity.GetTagValue(SemanticConventions.AttributeDbStatement);
Assert.NotEmpty(debugInfo);
Assert.Contains("Successful (200) low level call", debugInfo);
Assert.Equal(Status.Unset, searchActivity.GetStatus());
// Assert.Equal(expectedResource, searchActivity.GetResource());
}
[Fact]
public async Task CanRecordAndSampleSearchCall()
{
bool samplerCalled = false;
var sampler = new TestSampler
{
SamplingAction =
(samplingParameters) =>
{
samplerCalled = true;
return new SamplingResult(SamplingDecision.RecordAndSample);
},
};
using TestActivityProcessor testActivityProcessor = new TestActivityProcessor();
int startCalled = 0;
int endCalled = 0;
testActivityProcessor.StartAction =
(a) =>
{
Assert.True(samplerCalled);
Assert.False(Sdk.SuppressInstrumentation);
Assert.True(a.IsAllDataRequested); // If Proccessor.OnStart is called, activity's IsAllDataRequested is set to true
startCalled++;
};
testActivityProcessor.EndAction =
(a) =>
{
Assert.False(Sdk.SuppressInstrumentation);
Assert.True(a.IsAllDataRequested); // If Processor.OnEnd is called, activity's IsAllDataRequested is set to true
endCalled++;
};
var client = new ElasticClient(new ConnectionSettings(new InMemoryConnectionWithDownstreamActivity()).DefaultIndex("customer").EnableDebugMode());
using (Sdk.CreateTracerProviderBuilder()
.SetSampler(sampler)
.AddSource("Downstream")
.AddSource("NestedDownstream")
.AddElasticsearchClientInstrumentation((opt) => opt.SuppressDownstreamInstrumentation = false)
.AddProcessor(testActivityProcessor)
.Build())
{
var searchResponse = await client.SearchAsync<Customer>(s => s.Query(q => q.Bool(b => b.Must(m => m.Term(f => f.Id, "123")))));
Assert.NotNull(searchResponse);
Assert.True(searchResponse.ApiCall.Success);
Assert.NotEmpty(searchResponse.ApiCall.AuditTrail);
var failed = searchResponse.ApiCall.AuditTrail.Where(a => a.Event == AuditEvent.BadResponse);
Assert.Empty(failed);
}
Assert.Equal(3, startCalled); // Processor.OnStart is called since we added a legacy OperationName
Assert.Equal(3, endCalled); // Processor.OnEnd is called since we added a legacy OperationName
}
[Fact]
public async Task CanSupressDownstreamActivities()
{
bool samplerCalled = false;
var sampler = new TestSampler
{
SamplingAction =
(samplingParameters) =>
{
samplerCalled = true;
return new SamplingResult(SamplingDecision.RecordAndSample);
},
};
using TestActivityProcessor testActivityProcessor = new TestActivityProcessor();
int startCalled = 0;
int endCalled = 0;
testActivityProcessor.StartAction =
(a) =>
{
Assert.True(samplerCalled);
Assert.False(Sdk.SuppressInstrumentation);
Assert.True(a.IsAllDataRequested); // If Proccessor.OnStart is called, activity's IsAllDataRequested is set to true
startCalled++;
};
testActivityProcessor.EndAction =
(a) =>
{
Assert.False(Sdk.SuppressInstrumentation);
Assert.True(a.IsAllDataRequested); // If Processor.OnEnd is called, activity's IsAllDataRequested is set to true
endCalled++;
};
var client = new ElasticClient(new ConnectionSettings(new InMemoryConnectionWithDownstreamActivity()).DefaultIndex("customer").EnableDebugMode());
using (Sdk.CreateTracerProviderBuilder()
.SetSampler(sampler)
.AddSource("Downstream")
.AddSource("NestedDownstream")
.AddElasticsearchClientInstrumentation((opt) => opt.SuppressDownstreamInstrumentation = true)
.AddProcessor(testActivityProcessor)
.Build())
{
var searchResponse = await client.SearchAsync<Customer>(s => s.Query(q => q.Bool(b => b.Must(m => m.Term(f => f.Id, "123")))));
Assert.NotNull(searchResponse);
Assert.True(searchResponse.ApiCall.Success);
Assert.NotEmpty(searchResponse.ApiCall.AuditTrail);
var failed = searchResponse.ApiCall.AuditTrail.Where(a => a.Event == AuditEvent.BadResponse);
Assert.Empty(failed);
}
Assert.Equal(1, startCalled); // Processor.OnStart is called since we added a legacy OperationName
Assert.Equal(1, endCalled); // Processor.OnEnd is called since we added a legacy OperationName
}
[Fact]
public async Task CanDropSearchCall()
{
bool samplerCalled = false;
var sampler = new TestSampler
{
SamplingAction =
(samplingParameters) =>
{
samplerCalled = true;
return new SamplingResult(SamplingDecision.Drop);
},
};
using TestActivityProcessor testActivityProcessor = new TestActivityProcessor();
int startCalled = 0;
int endCalled = 0;
testActivityProcessor.StartAction =
(a) =>
{
Assert.True(samplerCalled);
Assert.False(Sdk.SuppressInstrumentation);
Assert.False(a.IsAllDataRequested); // If Proccessor.OnStart is called, activity's IsAllDataRequested is set to true
startCalled++;
};
testActivityProcessor.EndAction =
(a) =>
{
Assert.False(Sdk.SuppressInstrumentation);
Assert.False(a.IsAllDataRequested); // If Processor.OnEnd is called, activity's IsAllDataRequested is set to true
endCalled++;
};
var client = new ElasticClient(new ConnectionSettings(new InMemoryConnectionWithDownstreamActivity()).DefaultIndex("customer").EnableDebugMode());
using (Sdk.CreateTracerProviderBuilder()
.SetSampler(sampler)
.AddSource("Downstream")
.AddSource("NestedDownstream")
.AddElasticsearchClientInstrumentation((opt) => opt.SuppressDownstreamInstrumentation = false)
.AddProcessor(testActivityProcessor)
.Build())
{
var searchResponse = await client.SearchAsync<Customer>(s => s.Query(q => q.Bool(b => b.Must(m => m.Term(f => f.Id, "123")))));
Assert.NotNull(searchResponse);
Assert.True(searchResponse.ApiCall.Success);
Assert.NotEmpty(searchResponse.ApiCall.AuditTrail);
var failed = searchResponse.ApiCall.AuditTrail.Where(a => a.Event == AuditEvent.BadResponse);
Assert.Empty(failed);
}
Assert.Equal(0, startCalled); // Processor.OnStart is called since we added a legacy OperationName
Assert.Equal(0, endCalled); // Processor.OnEnd is called since we added a legacy OperationName
}
[Fact]
public async Task CanCaptureSearchCallWithDebugMode()
{
var expectedResource = ResourceBuilder.CreateDefault().AddService("test-service");
var processor = new Mock<BaseProcessor<Activity>>();
var parent = new Activity("parent").Start();
var client = new ElasticClient(new ConnectionSettings(new InMemoryConnection()).DefaultIndex("customer").EnableDebugMode());
using (Sdk.CreateTracerProviderBuilder()
.SetSampler(new AlwaysOnSampler())
.AddElasticsearchClientInstrumentation()
.SetResourceBuilder(expectedResource)
.AddProcessor(processor.Object)
.Build())
{
var searchResponse = await client.SearchAsync<Customer>(s => s.Query(q => q.Bool(b => b.Must(m => m.Term(f => f.Id, "123")))));
Assert.NotNull(searchResponse);
Assert.True(searchResponse.ApiCall.Success);
Assert.NotEmpty(searchResponse.ApiCall.AuditTrail);
var failed = searchResponse.ApiCall.AuditTrail.Where(a => a.Event == AuditEvent.BadResponse);
Assert.Empty(failed);
}
// SetParentProvider, OnStart, OnEnd, OnShutdown, Dispose
Assert.Equal(5, processor.Invocations.Count);
var activities = processor.Invocations.Where(i => i.Method.Name == "OnEnd").Select(i => i.Arguments[0]).Cast<Activity>().ToArray();
Assert.Single(activities);
var searchActivity = activities[0];
Assert.Equal(parent.TraceId, searchActivity.Context.TraceId);
Assert.Equal(parent.SpanId, searchActivity.ParentSpanId);
Assert.NotEqual(parent.SpanId, searchActivity.Context.SpanId);
Assert.NotEqual(default, searchActivity.Context.SpanId);
Assert.Equal($"Elasticsearch POST customer", searchActivity.DisplayName);
var tags = searchActivity.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Assert.Equal("localhost", searchActivity.GetTagValue(SemanticConventions.AttributeNetPeerName));
Assert.Equal(9200, searchActivity.GetTagValue(SemanticConventions.AttributeNetPeerPort));
Assert.Equal("elasticsearch", searchActivity.GetTagValue(SemanticConventions.AttributeDbSystem));
Assert.Equal("customer", searchActivity.GetTagValue(SemanticConventions.AttributeDbName));
var debugInfo = (string)searchActivity.GetTagValue(SemanticConventions.AttributeDbStatement);
Assert.NotEmpty(debugInfo);
Assert.Contains("Successful (200) low level call", debugInfo);
Assert.Equal(Status.Unset, searchActivity.GetStatus());
// Assert.Equal(expectedResource, searchActivity.GetResource());
}
[Fact]
public async Task CanCaptureSearchCallWithParseAndFormatRequestOption()
{
var expectedResource = ResourceBuilder.CreateDefault().AddService("test-service");
var processor = new Mock<BaseProcessor<Activity>>();
var parent = new Activity("parent").Start();
var client = new ElasticClient(new ConnectionSettings(new InMemoryConnection()).DefaultIndex("customer").EnableDebugMode());
using (Sdk.CreateTracerProviderBuilder()
.SetSampler(new AlwaysOnSampler())
.AddElasticsearchClientInstrumentation(o => o.ParseAndFormatRequest = true)
.SetResourceBuilder(expectedResource)
.AddProcessor(processor.Object)
.Build())
{
var searchResponse = await client.SearchAsync<Customer>(s => s.Query(q => q.Bool(b => b.Must(m => m.Term(f => f.Id, "123")))));
Assert.NotNull(searchResponse);
Assert.True(searchResponse.ApiCall.Success);
Assert.NotEmpty(searchResponse.ApiCall.AuditTrail);
var failed = searchResponse.ApiCall.AuditTrail.Where(a => a.Event == AuditEvent.BadResponse);
Assert.Empty(failed);
}
// SetParentProvider, OnStart, OnEnd, OnShutdown, Dispose
Assert.Equal(5, processor.Invocations.Count);
var activities = processor.Invocations.Where(i => i.Method.Name == "OnEnd").Select(i => i.Arguments[0]).Cast<Activity>().ToArray();
Assert.Single(activities);
var searchActivity = activities[0];
Assert.Equal(parent.TraceId, searchActivity.Context.TraceId);
Assert.Equal(parent.SpanId, searchActivity.ParentSpanId);
Assert.NotEqual(parent.SpanId, searchActivity.Context.SpanId);
Assert.NotEqual(default, searchActivity.Context.SpanId);
Assert.Equal($"Elasticsearch POST customer", searchActivity.DisplayName);
Assert.Equal("localhost", searchActivity.GetTagValue(SemanticConventions.AttributeNetPeerName));
Assert.Equal(9200, searchActivity.GetTagValue(SemanticConventions.AttributeNetPeerPort));
Assert.Equal("elasticsearch", searchActivity.GetTagValue(SemanticConventions.AttributeDbSystem));
Assert.Equal("customer", searchActivity.GetTagValue(SemanticConventions.AttributeDbName));
var debugInfo = (string)searchActivity.GetTagValue(SemanticConventions.AttributeDbStatement);
Assert.NotEmpty(debugInfo);
Assert.Equal(
@"{
""query"": {
""bool"": {
""must"": [
{
""term"": {
""id"": {
""value"": ""123""
}
}
}
]
}
}
}".Replace("\r\n", "\n"),
debugInfo.Replace("\r\n", "\n"));
Assert.Equal(Status.Unset, searchActivity.GetStatus());
// Assert.Equal(expectedResource, searchActivity.GetResource());
}
[Fact]
public async Task CanCaptureSearchCallWithoutDebugMode()
{
var expectedResource = ResourceBuilder.CreateDefault().AddService("test-service");
var processor = new Mock<BaseProcessor<Activity>>();
var parent = new Activity("parent").Start();
var client = new ElasticClient(new ConnectionSettings(new InMemoryConnection()).DefaultIndex("customer"));
using (Sdk.CreateTracerProviderBuilder()
.SetSampler(new AlwaysOnSampler())
.AddElasticsearchClientInstrumentation(o => o.ParseAndFormatRequest = true)
.SetResourceBuilder(expectedResource)
.AddProcessor(processor.Object)
.Build())
{
var searchResponse = await client.SearchAsync<Customer>(s => s.Query(q => q.Bool(b => b.Must(m => m.Term(f => f.Id, "123")))));
Assert.NotNull(searchResponse);
Assert.True(searchResponse.ApiCall.Success);
Assert.NotEmpty(searchResponse.ApiCall.AuditTrail);
var failed = searchResponse.ApiCall.AuditTrail.Where(a => a.Event == AuditEvent.BadResponse);
Assert.Empty(failed);
}
// SetParentProvider, OnStart, OnEnd, OnShutdown, Dispose
Assert.Equal(5, processor.Invocations.Count);
var activities = processor.Invocations.Where(i => i.Method.Name == "OnEnd").Select(i => i.Arguments[0]).Cast<Activity>().ToArray();
Assert.Single(activities);
var searchActivity = activities[0];
Assert.Equal(parent.TraceId, searchActivity.Context.TraceId);
Assert.Equal(parent.SpanId, searchActivity.ParentSpanId);
Assert.NotEqual(parent.SpanId, searchActivity.Context.SpanId);
Assert.NotEqual(default, searchActivity.Context.SpanId);
Assert.Equal($"Elasticsearch POST customer", searchActivity.DisplayName);
var tags = searchActivity.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Assert.Equal("localhost", searchActivity.GetTagValue(SemanticConventions.AttributeNetPeerName));
Assert.Equal(9200, searchActivity.GetTagValue(SemanticConventions.AttributeNetPeerPort));
Assert.Equal("elasticsearch", searchActivity.GetTagValue(SemanticConventions.AttributeDbSystem));
Assert.Equal("customer", searchActivity.GetTagValue(SemanticConventions.AttributeDbName));
var debugInfo = (string)searchActivity.GetTagValue(SemanticConventions.AttributeDbStatement);
Assert.NotEmpty(debugInfo);
Assert.DoesNotContain("123", debugInfo);
Assert.Equal(Status.Unset, searchActivity.GetStatus());
// Assert.Equal(expectedResource, searchActivity.GetResource());
}
[Fact]
public async Task CanCaptureMultipleIndiceSearchCall()
{
var expectedResource = ResourceBuilder.CreateDefault().AddService("test-service");
var processor = new Mock<BaseProcessor<Activity>>();
var parent = new Activity("parent").Start();
var client = new ElasticClient(new ConnectionSettings(new InMemoryConnection()).DefaultIndex("customer,order"));
using (Sdk.CreateTracerProviderBuilder()
.SetSampler(new AlwaysOnSampler())
.AddElasticsearchClientInstrumentation()
.SetResourceBuilder(expectedResource)
.AddProcessor(processor.Object)
.Build())
{
var searchResponse = await client.SearchAsync<Customer>(s => s.Query(q => q.Bool(b => b.Must(m => m.Term(f => f.Id, "123")))));
Assert.NotNull(searchResponse);
Assert.True(searchResponse.ApiCall.Success);
Assert.NotEmpty(searchResponse.ApiCall.AuditTrail);
var failed = searchResponse.ApiCall.AuditTrail.Where(a => a.Event == AuditEvent.BadResponse);
Assert.Empty(failed);
}
// SetParentProvider, OnStart, OnEnd, OnShutdown, Dispose
Assert.Equal(5, processor.Invocations.Count);
var activities = processor.Invocations.Where(i => i.Method.Name == "OnEnd").Select(i => i.Arguments[0]).Cast<Activity>().ToArray();
Assert.Single(activities);
var searchActivity = activities[0];
Assert.Equal(parent.TraceId, searchActivity.Context.TraceId);
Assert.Equal(parent.SpanId, searchActivity.ParentSpanId);
Assert.NotEqual(parent.SpanId, searchActivity.Context.SpanId);
Assert.NotEqual(default, searchActivity.Context.SpanId);
Assert.Equal($"Elasticsearch POST", searchActivity.DisplayName);
var tags = searchActivity.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Assert.Equal("localhost", searchActivity.GetTagValue(SemanticConventions.AttributeNetPeerName));
Assert.Equal(9200, searchActivity.GetTagValue(SemanticConventions.AttributeNetPeerPort));
Assert.Equal("elasticsearch", searchActivity.GetTagValue(SemanticConventions.AttributeDbSystem));
Assert.Null(searchActivity.GetTagValue(SemanticConventions.AttributeDbName));
var debugInfo = (string)searchActivity.GetTagValue(SemanticConventions.AttributeDbStatement);
Assert.NotEmpty(debugInfo);
Assert.Contains("Successful (200) low level call", debugInfo);
Assert.Equal(Status.Unset, searchActivity.GetStatus());
// Assert.Equal(expectedResource, searchActivity.GetResource());
}
[Fact]
public async Task CanCaptureElasticsearchClientException()
{
var expectedResource = ResourceBuilder.CreateDefault().AddService("test-service");
var processor = new Mock<BaseProcessor<Activity>>();
var parent = new Activity("parent").Start();
var connection = new InMemoryConnection(Encoding.UTF8.GetBytes("{}"), statusCode: 500, exception: new ElasticsearchClientException("Boom"));
var client = new ElasticClient(new ConnectionSettings(connection).DefaultIndex("customer").EnableDebugMode());
using (Sdk.CreateTracerProviderBuilder()
.SetSampler(new AlwaysOnSampler())
.AddElasticsearchClientInstrumentation()
.SetResourceBuilder(expectedResource)
.AddProcessor(processor.Object)
.Build())
{
var searchResponse = await client.SearchAsync<Customer>(s => s.Query(q => q.Bool(b => b.Must(m => m.Term(f => f.Id, "123")))));
Assert.NotNull(searchResponse);
Assert.False(searchResponse.ApiCall.Success);
Assert.NotEmpty(searchResponse.ApiCall.AuditTrail);
var failed = searchResponse.ApiCall.AuditTrail.Where(a => a.Event == AuditEvent.BadResponse);
Assert.NotEmpty(failed);
}
// SetParentProvider, OnStart, OnEnd, OnShutdown, Dispose
Assert.Equal(5, processor.Invocations.Count);
var activities = processor.Invocations.Where(i => i.Method.Name == "OnEnd").Select(i => i.Arguments[0]).Cast<Activity>().ToArray();
Assert.Single(activities);
var searchActivity = activities[0];
Assert.Equal(parent.TraceId, searchActivity.Context.TraceId);
Assert.Equal(parent.SpanId, searchActivity.ParentSpanId);
Assert.NotEqual(parent.SpanId, searchActivity.Context.SpanId);
Assert.NotEqual(default, searchActivity.Context.SpanId);
Assert.Equal($"Elasticsearch POST customer", searchActivity.DisplayName);
var tags = searchActivity.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Assert.Equal("localhost", searchActivity.GetTagValue(SemanticConventions.AttributeNetPeerName));
Assert.Equal(9200, searchActivity.GetTagValue(SemanticConventions.AttributeNetPeerPort));
Assert.Equal("elasticsearch", searchActivity.GetTagValue(SemanticConventions.AttributeDbSystem));
Assert.Equal("customer", searchActivity.GetTagValue(SemanticConventions.AttributeDbName));
var debugInfo = (string)searchActivity.GetTagValue(SemanticConventions.AttributeDbStatement);
Assert.NotEmpty(debugInfo);
Assert.Contains("Unsuccessful (500) low level call", debugInfo);
var status = searchActivity.GetStatus();
Assert.Equal(Status.Error.StatusCode, status.StatusCode);
// Assert.Equal(expectedResource, searchActivity.GetResource());
}
[Fact]
public async Task CanCaptureCatRequest()
{
var expectedResource = ResourceBuilder.CreateDefault().AddService("test-service");
var processor = new Mock<BaseProcessor<Activity>>();
var parent = new Activity("parent").Start();
var client = new ElasticClient(new ConnectionSettings(new InMemoryConnection()).DefaultIndex("customer").EnableDebugMode());
using (Sdk.CreateTracerProviderBuilder()
.SetSampler(new AlwaysOnSampler())
.AddElasticsearchClientInstrumentation()
.SetResourceBuilder(expectedResource)
.AddProcessor(processor.Object)
.Build())
{
var getResponse = await client.Cat.IndicesAsync();
Assert.NotNull(getResponse);
Assert.True(getResponse.ApiCall.Success);
Assert.NotEmpty(getResponse.ApiCall.AuditTrail);
var failed = getResponse.ApiCall.AuditTrail.Where(a => a.Event == AuditEvent.BadResponse);
Assert.Empty(failed);
}
// SetParentProvider, OnStart, OnEnd, OnShutdown, Dispose
Assert.Equal(5, processor.Invocations.Count);
var activities = processor.Invocations.Where(i => i.Method.Name == "OnEnd").Select(i => i.Arguments[0]).Cast<Activity>().ToArray();
Assert.Single(activities);
var searchActivity = activities[0];
Assert.Equal(parent.TraceId, searchActivity.Context.TraceId);
Assert.Equal(parent.SpanId, searchActivity.ParentSpanId);
Assert.NotEqual(parent.SpanId, searchActivity.Context.SpanId);
Assert.NotEqual(default, searchActivity.Context.SpanId);
Assert.Equal($"Elasticsearch GET", searchActivity.DisplayName);
var tags = searchActivity.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Assert.Equal("localhost", searchActivity.GetTagValue(SemanticConventions.AttributeNetPeerName));
Assert.Equal(9200, searchActivity.GetTagValue(SemanticConventions.AttributeNetPeerPort));
Assert.Equal("elasticsearch", searchActivity.GetTagValue(SemanticConventions.AttributeDbSystem));
Assert.Null(searchActivity.GetTagValue(SemanticConventions.AttributeDbName));
var debugInfo = (string)searchActivity.GetTagValue(SemanticConventions.AttributeDbStatement);
Assert.NotEmpty(debugInfo);
Assert.Contains("Successful (200) low level call", debugInfo);
Assert.Equal(Status.Unset, searchActivity.GetStatus());
// Assert.Equal(expectedResource, searchActivity.GetResource());
}
[Fact]
public async Task DoesNotCaptureWhenInstrumentationIsSuppressed()
{
var expectedResource = ResourceBuilder.CreateDefault().AddService("test-service");
var processor = new Mock<BaseProcessor<Activity>>();
var parent = new Activity("parent").Start();
var client = new ElasticClient(new ConnectionSettings(new InMemoryConnection()).DefaultIndex("customer"));
using (Sdk.CreateTracerProviderBuilder()
.SetSampler(new AlwaysOnSampler())
.AddElasticsearchClientInstrumentation()
.SetResourceBuilder(expectedResource)
.AddProcessor(processor.Object)
.Build())
{
using var scope = SuppressInstrumentationScope.Begin();
var getResponse = await client.GetAsync<Customer>("123");
Assert.NotNull(getResponse);
Assert.True(getResponse.ApiCall.Success);
Assert.NotEmpty(getResponse.ApiCall.AuditTrail);
var failed = getResponse.ApiCall.AuditTrail.Where(a => a.Event == AuditEvent.BadResponse);
Assert.Empty(failed);
}
// Since instrumentation is suppressed, activity is not emitted
Assert.Equal(3, processor.Invocations.Count); // SetParentProvider + OnShutdown + Dispose
// Processor.OnStart and Processor.OnEnd are not called
Assert.DoesNotContain(processor.Invocations, invo => invo.Method.Name == nameof(processor.Object.OnStart));
Assert.DoesNotContain(processor.Invocations, invo => invo.Method.Name == nameof(processor.Object.OnEnd));
}
[Theory]
[InlineData(SamplingDecision.Drop, false)]
[InlineData(SamplingDecision.RecordOnly, true)]
[InlineData(SamplingDecision.RecordAndSample, true)]
public async Task CapturesBasedOnSamplingDecision(SamplingDecision samplingDecision, bool isActivityExpected)
{
var expectedResource = ResourceBuilder.CreateDefault().AddService("test-service");
var processor = new Mock<BaseProcessor<Activity>>();
var parent = new Activity("parent").Start();
var client = new ElasticClient(new ConnectionSettings(new InMemoryConnection()).DefaultIndex("customer"));
using (Sdk.CreateTracerProviderBuilder()
.SetSampler(new TestSampler() { SamplingAction = (samplingParameters) => new SamplingResult(samplingDecision) })
.AddElasticsearchClientInstrumentation()
.SetResourceBuilder(expectedResource)
.AddProcessor(processor.Object)
.Build())
{
var getResponse = await client.GetAsync<Customer>("123");
Assert.NotNull(getResponse);
Assert.True(getResponse.ApiCall.Success);
Assert.NotEmpty(getResponse.ApiCall.AuditTrail);
var failed = getResponse.ApiCall.AuditTrail.Where(a => a.Event == AuditEvent.BadResponse);
Assert.Empty(failed);
}
Assert.Equal(isActivityExpected, processor.Invocations.Any(invo => invo.Method.Name == nameof(processor.Object.OnStart)));
Assert.Equal(isActivityExpected, processor.Invocations.Any(invo => invo.Method.Name == nameof(processor.Object.OnEnd)));
}
[Fact]
public async Task DbStatementIsNotDisplayedWhenSetDbStatementForRequestIsFalse()
{
var expectedResource = ResourceBuilder.CreateDefault().AddService("test-service");
var processor = new Mock<BaseProcessor<Activity>>();
var parent = new Activity("parent").Start();
var client = new ElasticClient(new ConnectionSettings(new InMemoryConnection()).DefaultIndex("customer"));
using (Sdk.CreateTracerProviderBuilder()
.SetSampler(new AlwaysOnSampler())
.AddElasticsearchClientInstrumentation(o => o.SetDbStatementForRequest = false)
.SetResourceBuilder(expectedResource)
.AddProcessor(processor.Object)
.Build())
{
var searchResponse = await client.SearchAsync<Customer>(s => s.Query(q => q.Bool(b => b.Must(m => m.Term(f => f.Id, "123")))));
Assert.NotNull(searchResponse);
Assert.True(searchResponse.ApiCall.Success);
Assert.NotEmpty(searchResponse.ApiCall.AuditTrail);
var failed = searchResponse.ApiCall.AuditTrail.Where(a => a.Event == AuditEvent.BadResponse);
Assert.Empty(failed);
}
var activities = processor.Invocations.Where(i => i.Method.Name == "OnEnd").Select(i => i.Arguments[0]).Cast<Activity>().ToArray();
Assert.Single(activities);
var searchActivity = activities[0];
var tags = searchActivity.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Assert.Null(searchActivity.GetTagValue(SemanticConventions.AttributeDbStatement));
}
[Fact]
public async Task DbStatementIsDisplayedWhenSetDbStatementForRequestIsUsingTheDefaultValue()
{
var expectedResource = ResourceBuilder.CreateDefault().AddService("test-service");
var processor = new Mock<BaseProcessor<Activity>>();
var parent = new Activity("parent").Start();
var client = new ElasticClient(new ConnectionSettings(new InMemoryConnection()).DefaultIndex("customer"));
using (Sdk.CreateTracerProviderBuilder()
.SetSampler(new AlwaysOnSampler())
.AddElasticsearchClientInstrumentation()
.SetResourceBuilder(expectedResource)
.AddProcessor(processor.Object)
.Build())
{
var searchResponse = await client.SearchAsync<Customer>(s => s.Query(q => q.Bool(b => b.Must(m => m.Term(f => f.Id, "123")))));
Assert.NotNull(searchResponse);
Assert.True(searchResponse.ApiCall.Success);
Assert.NotEmpty(searchResponse.ApiCall.AuditTrail);
var failed = searchResponse.ApiCall.AuditTrail.Where(a => a.Event == AuditEvent.BadResponse);
Assert.Empty(failed);
}
var activities = processor.Invocations.Where(i => i.Method.Name == "OnEnd").Select(i => i.Arguments[0]).Cast<Activity>().ToArray();
Assert.Single(activities);
var searchActivity = activities[0];
var tags = searchActivity.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Assert.NotNull(searchActivity.GetTagValue(SemanticConventions.AttributeDbStatement));
}
}
}
| 47.717566 | 158 | 0.628411 | [
"Apache-2.0"
] | alanwest/opentelemetry-dotnet-contrib | test/OpenTelemetry.Instrumentation.ElasticsearchClient.Tests/ElasticsearchClientTests.cs | 41,562 | C# |
// $Id$
//
// Copyright 2008-2009 The AnkhSVN Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
using System.Collections.Generic;
using System.Text;
namespace Ankh.Commands
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
public sealed class SvnCommandAttribute : CommandAttribute
{
/// <summary>
/// Defines the class or function as a handler of the specified <see cref="AnkhCommand"/>
/// </summary>
/// <param name="command">The command.</param>
public SvnCommandAttribute(AnkhCommand command)
: base(command)
{
Availability = CommandAvailability.SvnActive;
}
public SvnCommandAttribute(AnkhCommand command, AnkhCommandContext context)
: base(command, context)
{
Availability = CommandAvailability.SvnActive;
}
}
}
| 33.581395 | 97 | 0.682825 | [
"Apache-2.0"
] | AnkhSVN/AnkhSVN | src/Ankh.Services/Commands/SvnCommandAttribute.cs | 1,444 | C# |
using Microsoft.VisualStudio.TestTools.UnitTesting;
using GenieLamp.Examples.QuickStart.Services.Adapters.QuickStart;
using GenieLamp.Examples.QuickStart.Services.Adapters;
namespace Services.Test
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
// Preparing connection to services
WebClientFactory.AuthRequired = false;
WebClientFactory.ServiceUrl = "http://localhost:8080/";
// Do tests
PurchaseOrder po = PurchaseOrder.GetByNumber("PO0001");
PurchaseOrderLineCollection lines =
PurchaseOrderLineCollection.GetCollectionByPurchaseOrderId(po.Id);
decimal total = 0.0M;
foreach (PurchaseOrderLine line in lines)
{
total += line.Price * line.Quantity;
}
Assert.AreEqual(total, po.TotalAmount, "Invalid total amount");
Assert.IsFalse(po.Validated, "Order is already validated");
po.Validate();
Assert.IsTrue(po.Validated, "Order is not validated");
}
}
}
| 36.40625 | 83 | 0.607725 | [
"MIT"
] | arbinada-com/genie-lamp | Examples/GLQuickStart/Services.Test/UnitTest1.cs | 1,167 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
namespace Ship_Game.Ships
{
public static class ShipExtensions
{
public static int SurfaceArea(this ShipModule[] modules, ShipModuleType moduleType)
{
int modulesArea = 0;
for (int i = 0; i < modules.Length; ++i)
{
ShipModule m = modules[i];
if (m.ModuleType == moduleType) modulesArea += m.XSIZE * m.YSIZE;
}
return modulesArea;
}
public static int SurfaceArea(this ShipModule[] modules, Func<ShipModule, bool> predicate)
{
int modulesArea = 0;
for (int i = 0; i < modules.Length; ++i)
{
ShipModule m = modules[i];
if (predicate(m)) modulesArea += m.XSIZE * m.YSIZE;
}
return modulesArea;
}
public static ShipModule[] FilterBy(this ShipModule[] modules, ShipModuleType moduleType)
{
int total = 0;
for (int i = 0; i < modules.Length; ++i)
total += (modules[i].ModuleType == moduleType) ? 1 : 0;
var filtered = new ShipModule[total];
for (int i = 0, j = 0; i < modules.Length; ++i)
if (modules[i].ModuleType == moduleType)
filtered[j++] = modules[i];
return filtered;
}
public static bool Any(this ShipModule[] modules, ShipModuleType moduleType)
{
for (int i = 0; i < modules.Length; ++i)
if (modules[i].ModuleType == moduleType)
return true;
return false;
}
}
}
| 32.5 | 99 | 0.500285 | [
"MIT"
] | UnGaucho/StarDrive | Ship_Game/Ships/ShipExtensions.cs | 1,757 | C# |
using Microsoft.Extensions.Logging;
using Promitor.Core.Configuration.Model.Telemetry.Interfaces;
namespace Promitor.Core.Configuration.Model.Telemetry.Sinks
{
public class ApplicationInsightsConfiguration : ISinkConfiguration
{
public LogLevel? Verbosity { get; set; } = Defaults.Telemetry.ApplicationInsights.Verbosity;
public bool IsEnabled { get; set; } = Defaults.Telemetry.ApplicationInsights.IsEnabled;
public string InstrumentationKey { get; set; }
}
} | 41.5 | 100 | 0.761044 | [
"MIT"
] | ChristianEder/promitor | src/Promitor.Core.Configuration/Model/Telemetry/Sinks/ApplicationInsightsConfiguration.cs | 500 | C# |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.EntityFrameworkCore.TestUtilities;
namespace Microsoft.EntityFrameworkCore
{
public abstract class FieldMappingSqliteTest
{
public abstract class FieldMappingSqliteTestBase<TFixture> : FieldMappingTestBase<TFixture>
where TFixture : FieldMappingSqliteTestBase<TFixture>.FieldMappingSqliteFixtureBase, new()
{
protected FieldMappingSqliteTestBase(TFixture fixture)
: base(fixture)
{
}
protected override void UseTransaction(DatabaseFacade facade, IDbContextTransaction transaction)
=> facade.UseTransaction(transaction.GetDbTransaction());
public abstract class FieldMappingSqliteFixtureBase : FieldMappingFixtureBase
{
protected override ITestStoreFactory TestStoreFactory => SqliteTestStoreFactory.Instance;
}
}
public class DefaultMappingTest
: FieldMappingSqliteTestBase<DefaultMappingTest.DefaultMappingFixture>
{
public DefaultMappingTest(DefaultMappingFixture fixture)
: base(fixture)
{
}
public class DefaultMappingFixture : FieldMappingSqliteFixtureBase
{
}
}
public class EnforceFieldTest
: FieldMappingSqliteTestBase<EnforceFieldTest.EnforceFieldFixture>
{
public EnforceFieldTest(EnforceFieldFixture fixture)
: base(fixture)
{
}
public class EnforceFieldFixture : FieldMappingSqliteFixtureBase
{
protected override string StoreName { get; } = "FieldMappingEnforceFieldTest";
protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context)
{
modelBuilder.UsePropertyAccessMode(PropertyAccessMode.Field);
base.OnModelCreating(modelBuilder, context);
}
}
}
public class EnforceFieldForQueryTest
: FieldMappingSqliteTestBase<EnforceFieldForQueryTest.EnforceFieldForQueryFixture>
{
public EnforceFieldForQueryTest(EnforceFieldForQueryFixture fixture)
: base(fixture)
{
}
public class EnforceFieldForQueryFixture : FieldMappingSqliteFixtureBase
{
protected override string StoreName { get; } = "FieldMappingFieldQueryTest";
protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context)
{
modelBuilder.UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
base.OnModelCreating(modelBuilder, context);
}
}
}
public class EnforcePropertyTest
: FieldMappingSqliteTestBase<EnforcePropertyTest.EnforcePropertyFixture>
{
public EnforcePropertyTest(EnforcePropertyFixture fixture)
: base(fixture)
{
}
// Cannot force property access when properties missing getter/setter
public override void Simple_query_read_only_props(bool tracking)
{
}
public override void Include_collection_read_only_props(bool tracking)
{
}
public override void Include_reference_read_only_props(bool tracking)
{
}
public override void Load_collection_read_only_props()
{
}
public override void Load_reference_read_only_props()
{
}
public override void Query_with_conditional_constant_read_only_props(bool tracking)
{
}
public override void Query_with_conditional_param_read_only_props(bool tracking)
{
}
public override void Projection_read_only_props(bool tracking)
{
}
public override void Update_read_only_props()
{
}
public override void Simple_query_read_only_props_with_named_fields(bool tracking)
{
}
public override void Include_collection_read_only_props_with_named_fields(bool tracking)
{
}
public override void Include_reference_read_only_props_with_named_fields(bool tracking)
{
}
public override void Load_collection_read_only_props_with_named_fields()
{
}
public override void Load_reference_read_only_props_with_named_fields()
{
}
public override void Query_with_conditional_constant_read_only_props_with_named_fields(bool tracking)
{
}
public override void Query_with_conditional_param_read_only_props_with_named_fields(bool tracking)
{
}
public override void Projection_read_only_props_with_named_fields(bool tracking)
{
}
public override void Update_read_only_props_with_named_fields()
{
}
public override void Simple_query_write_only_props(bool tracking)
{
}
public override void Include_collection_write_only_props(bool tracking)
{
}
public override void Include_reference_write_only_props(bool tracking)
{
}
public override void Load_collection_write_only_props()
{
}
public override void Load_reference_write_only_props()
{
}
public override void Query_with_conditional_constant_write_only_props(bool tracking)
{
}
public override void Query_with_conditional_param_write_only_props(bool tracking)
{
}
public override void Projection_write_only_props(bool tracking)
{
}
public override void Update_write_only_props()
{
}
public override void Simple_query_write_only_props_with_named_fields(bool tracking)
{
}
public override void Include_collection_write_only_props_with_named_fields(bool tracking)
{
}
public override void Include_reference_write_only_props_with_named_fields(bool tracking)
{
}
public override void Load_collection_write_only_props_with_named_fields()
{
}
public override void Load_reference_write_only_props_with_named_fields()
{
}
public override void Query_with_conditional_constant_write_only_props_with_named_fields(bool tracking)
{
}
public override void Query_with_conditional_param_write_only_props_with_named_fields(bool tracking)
{
}
public override void Projection_write_only_props_with_named_fields(bool tracking)
{
}
public override void Update_write_only_props_with_named_fields()
{
}
public override void Simple_query_fields_only(bool tracking)
{
}
public override void Include_collection_fields_only(bool tracking)
{
}
public override void Include_reference_fields_only(bool tracking)
{
}
public override void Load_collection_fields_only()
{
}
public override void Load_reference_fields_only()
{
}
public override void Query_with_conditional_constant_fields_only(bool tracking)
{
}
public override void Query_with_conditional_param_fields_only(bool tracking)
{
}
public override void Projection_fields_only(bool tracking)
{
}
public override void Update_fields_only()
{
}
public override void Simple_query_fields_only_for_navs_too(bool tracking)
{
}
public override void Include_collection_fields_only_for_navs_too(bool tracking)
{
}
public override void Include_reference_fields_only_only_for_navs_too(bool tracking)
{
}
public override void Load_collection_fields_only_only_for_navs_too()
{
}
public override void Load_reference_fields_only_only_for_navs_too()
{
}
public override void Query_with_conditional_constant_fields_only_only_for_navs_too(bool tracking)
{
}
public override void Query_with_conditional_param_fields_only_only_for_navs_too(bool tracking)
{
}
public override void Projection_fields_only_only_for_navs_too(bool tracking)
{
}
public override void Update_fields_only_only_for_navs_too()
{
}
public override void Include_collection_full_props(bool tracking)
{
}
public override void Include_reference_full_props(bool tracking)
{
}
public override void Load_collection_full_props()
{
}
public override void Load_reference_full_props()
{
}
public override void Update_full_props()
{
}
public override void Simple_query_props_with_IReadOnlyCollection(bool tracking)
{
}
public override void Include_collection_props_with_IReadOnlyCollection(bool tracking)
{
}
public override void Include_reference_props_with_IReadOnlyCollection(bool tracking)
{
}
public override void Load_collection_props_with_IReadOnlyCollection()
{
}
public override void Load_reference_props_with_IReadOnlyCollection()
{
}
public override void Query_with_conditional_constant_props_with_IReadOnlyCollection(bool tracking)
{
}
public override void Query_with_conditional_param_props_with_IReadOnlyCollection(bool tracking)
{
}
public override void Projection_props_with_IReadOnlyCollection(bool tracking)
{
}
public override void Update_props_with_IReadOnlyCollection()
{
}
public class EnforcePropertyFixture : FieldMappingSqliteFixtureBase
{
protected override string StoreName { get; } = "FieldMappingEnforcePropertyTest";
protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context)
{
modelBuilder.UsePropertyAccessMode(PropertyAccessMode.Property);
base.OnModelCreating(modelBuilder, context);
}
}
}
}
}
| 31.172872 | 114 | 0.599352 | [
"Apache-2.0"
] | 1iveowl/efcore | test/EFCore.Sqlite.FunctionalTests/FieldMappingSqliteTest.cs | 11,721 | C# |
using System.Collections.Generic;
using System.Linq;
using RimWorld;
using UnityEngine;
using Verse;
using Verse.AI;
namespace Wizardry
{
internal class Nienna_JobDriver_HealingTouch : JobDriver
{
private const TargetIndex caster = TargetIndex.B;
private readonly bool issueJobAgain = false;
private readonly int ticksTillNextHeal = 30;
private int age = -1;
public int duration = 1200;
private int injuryCount;
private int lastHeal;
public override bool TryMakePreToilReservations(bool errorOnFailed)
{
if (pawn.Reserve(TargetA, job, 1, 1, null, errorOnFailed))
{
return true;
}
return false;
}
protected override IEnumerable<Toil> MakeNewToils()
{
var patient = TargetA.Thing as Pawn;
var gotoPatient = new Toil
{
initAction = () => { pawn.pather.StartPath(TargetA, PathEndMode.Touch); },
defaultCompleteMode = ToilCompleteMode.PatherArrival
};
yield return gotoPatient;
var doHealing = new Toil
{
initAction = delegate
{
if (age > duration)
{
EndJobWith(JobCondition.Succeeded);
}
if (patient != null && (patient.DestroyedOrNull() || patient.Dead))
{
EndJobWith(JobCondition.Incompletable);
}
},
tickAction = delegate
{
if (patient != null && (patient.DestroyedOrNull() || patient.Dead))
{
EndJobWith(JobCondition.Incompletable);
}
if (Find.TickManager.TicksGame % 1 == 0)
{
if (patient != null)
{
EffectMaker.MakeEffect(ThingDef.Named("Mote_HealingMote"), pawn.DrawPos, Map,
Rand.Range(.3f, .5f),
(Quaternion.AngleAxis(90, Vector3.up) * GetVector(pawn.Position, patient.Position))
.ToAngleFlat() + Rand.Range(-10, 10), 5f, 0);
}
}
if (age > lastHeal + ticksTillNextHeal)
{
DoHealingEffect(patient);
if (patient != null)
{
EffectMaker.MakeEffect(ThingDef.Named("Mote_HealingCircles"), patient.DrawPos, Map,
Rand.Range(.3f, .4f), 0, 0, Rand.Range(400, 500), Rand.Range(0, 360), .08f, .01f, .24f,
false);
}
lastHeal = age;
if (injuryCount == 0)
{
EndJobWith(JobCondition.Succeeded);
}
}
if (patient is {Drafted: false} && patient.CurJobDef != JobDefOf.Wait)
{
if (patient.jobs.posture == PawnPosture.Standing)
{
var job1 = new Job(JobDefOf.Wait, patient);
patient.jobs.TryTakeOrderedJob(job1, JobTag.Misc);
}
}
age++;
ticksLeftThisToil = duration - age;
if (age > duration)
{
EndJobWith(JobCondition.Succeeded);
}
},
defaultCompleteMode = ToilCompleteMode.Delay,
defaultDuration = duration
};
doHealing.WithProgressBar(TargetIndex.B, delegate
{
if (pawn.DestroyedOrNull() || pawn.Dead)
{
return 1f;
}
return 1f - ((float) doHealing.actor.jobs.curDriver.ticksLeftThisToil / duration);
}, false, 0f);
doHealing.AddFinishAction(delegate
{
var comp = pawn.GetComp<CompWizardry>();
var pawnAbility =
comp.AbilityData.Powers.FirstOrDefault(x => x.Def == WizardryDefOf.LotRW_Nienna_HealingTouch);
pawnAbility?.PostAbilityAttempt();
patient?.jobs.EndCurrentJob(JobCondition.Succeeded);
});
yield return doHealing;
}
private void DoHealingEffect(Pawn patient)
{
var num = 1;
injuryCount = 0;
using var enumerator = patient.health.hediffSet.GetInjuredParts().GetEnumerator();
while (enumerator.MoveNext())
{
var rec = enumerator.Current;
var num2 = 1;
if (num <= 0)
{
continue;
}
var arg_BB_0 = patient.health.hediffSet.GetHediffs<Hediff_Injury>();
bool ArgBb1(Hediff_Injury injury)
{
return injury.Part == rec;
}
foreach (var current in arg_BB_0.Where(ArgBb1))
{
if (num2 <= 0)
{
continue;
}
if (!current.CanHealNaturally() || current.IsPermanent())
{
continue;
}
injuryCount++;
current.Heal(Rand.Range(1f, 2f));
num--;
num2--;
}
}
}
public Vector3 GetVector(IntVec3 center, IntVec3 objectPos)
{
var heading = (objectPos - center).ToVector3();
var distance = heading.magnitude;
var direction = heading / distance;
return direction;
}
}
} | 34.898305 | 119 | 0.438724 | [
"MIT"
] | emipa606/LordoftheRimsWizardry | Source/Wizardry/Nienna_JobDriver_HealingTouch.cs | 6,179 | C# |
using System;
using System.Collections.Generic;
namespace TwoCheckout
{
public class Sales
{
public long? sale_id { get; set; }
public DateTime? date_placed { get; set; }
public string customer_name { get; set; }
public int? recurring { get; set; }
public DateTime? recurring_declined { get; set; }
public decimal? customer_total { get; set; }
public string sale_url { get; set; }
}
}
| 26.764706 | 57 | 0.61978 | [
"MIT"
] | 2Checkout/2checkout-dotnet | TwoCheckout/Entities/Sales.cs | 457 | C# |
// Copyright (c) MudBlazor 2021
// MudBlazor licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Microsoft.AspNetCore.Components;
using MudBlazor.Extensions;
using MudBlazor.Utilities;
namespace MudBlazor
{
public partial class MudTimeline : MudBaseItemsControl<MudTimelineItem>
{
[CascadingParameter] public bool RightToLeft { get; set; }
/// <summary>
/// Sets the orientation of the timeline and its timeline items.
/// </summary>
[Parameter]
[Category(CategoryTypes.Timeline.Behavior)]
public TimelineOrientation TimelineOrientation { get; set; } = TimelineOrientation.Vertical;
/// <summary>
/// The position the timeline itself and how the timeline items should be displayed.
/// </summary>
[Parameter]
[Category(CategoryTypes.Timeline.Behavior)]
public TimelinePosition TimelinePosition { get; set; } = TimelinePosition.Alternate;
/// <summary>
/// Aligns the dot and any item modifiers is changed, in default mode they are centered to the item.
/// </summary>
[Parameter]
[Category(CategoryTypes.Timeline.Behavior)]
public TimelineAlign TimelineAlign { get; set; } = TimelineAlign.Default;
/// <summary>
/// Reverse the order of TimelineItems when TimelinePosition is set to Alternate.
/// </summary>
[Parameter]
[Category(CategoryTypes.Timeline.Behavior)]
public bool Reverse { get; set; } = false;
/// <summary>
/// If true, disables all TimelineItem modifiers, like adding a caret to a MudCard.
/// </summary>
[Parameter]
[Category(CategoryTypes.Timeline.Behavior)]
public bool DisableModifiers { get; set; } = false;
protected string Classnames =>
new CssBuilder("mud-timeline")
.AddClass($"mud-timeline-{TimelineOrientation.ToDescriptionString()}")
.AddClass($"mud-timeline-position-{ConvertTimelinePosition().ToDescriptionString()}")
.AddClass($"mud-timeline-reverse", Reverse && TimelinePosition == TimelinePosition.Alternate)
.AddClass($"mud-timeline-align-{TimelineAlign.ToDescriptionString()}")
.AddClass($"mud-timeline-modifiers", !DisableModifiers)
.AddClass($"mud-timeline-rtl", RightToLeft)
.AddClass(Class)
.Build();
private TimelinePosition ConvertTimelinePosition()
{
if (TimelineOrientation == TimelineOrientation.Vertical)
{
return TimelinePosition switch
{
TimelinePosition.Left => RightToLeft ? TimelinePosition.End : TimelinePosition.Start,
TimelinePosition.Right => RightToLeft ? TimelinePosition.Start : TimelinePosition.End,
TimelinePosition.Top => TimelinePosition.Alternate,
TimelinePosition.Bottom => TimelinePosition.Alternate,
_ => TimelinePosition
};
}
else
{
return TimelinePosition switch
{
TimelinePosition.Start => TimelinePosition.Alternate,
TimelinePosition.Left => TimelinePosition.Alternate,
TimelinePosition.Right => TimelinePosition.Alternate,
TimelinePosition.End => TimelinePosition.Alternate,
_ => TimelinePosition
};
}
}
}
}
| 41.556818 | 109 | 0.608422 | [
"MIT"
] | 1619digital/MudBlazor | src/MudBlazor/Components/Timeline/MudTimeline.razor.cs | 3,659 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity;
using Crk.Repositorio;
using Crk.Dominio;
namespace Crk.Aplicacao
{
public class ArtistaAplicacao
{
public static DatabaseContext context { get; set; }
public ArtistaAplicacao()
{
context = new DatabaseContext();
}
public void Salvar( Artista artista)
{
context.Artistas.Add(artista);
context.SaveChanges();
}
public IEnumerable<Artista> Listar()
{
return context.Artistas.ToList();
}
public List<Artista> ListaArtista()
{
return context.Artistas.ToList();
}
public void Alterar(Artista artista)
{
Artista artistaSalvar = context.Artistas.First(x => x.artista_id == artista.artista_id);
artistaSalvar.nome = artista.nome;
context.SaveChanges();
}
public void Excluir(int id)
{
Artista artistaExcluir = context.Artistas.First(x => x.artista_id == id);
context.Set<Artista>().Remove(artistaExcluir);
context.SaveChanges();
}
}
}
| 22.803571 | 100 | 0.586531 | [
"MIT"
] | sandroperes/VS2017---Crk | Avaliacao/Crk.Aplicacao/ArtistaAplicacao.cs | 1,279 | C# |
using ServiceSupport.Core.Exceptions;
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace ServiceSupport.Core.Domain
{
public class ShopTime
{
private static readonly Regex TimeRegex = new Regex("\\d{2}:\\d{2}$");
public DayOfWeek Day { get; protected set; }
public DateTime StartTime { get; protected set; } //DateTime.Now +"07:30"
public DateTime EndTime { get; protected set; }//DateTime.Now +"18:00"
protected ShopTime()
{
}
public ShopTime(DayOfWeek day, string startTime, string endTime)
{
Day = day;
SetStartTime(startTime);
SetEndTime(endTime);
}
public void SetStartTime(string startTime)
{
if (String.IsNullOrEmpty(startTime))
{
throw new DomainException(ErrorCodes.InvalidTime,
"Time can not be empty.");
}
if (!TimeRegex.IsMatch(startTime))
{
throw new DomainException(ErrorCodes.InvalidTimeFormat,
"StartTime can not be empty.");
}
StartTime=new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day,
(int.Parse(startTime.Split(':')[0]) % 24),(int.Parse(startTime.Split(':')[1]) % 60),0);
}
public void SetEndTime(string endTime)
{
if (String.IsNullOrEmpty(endTime))
{
throw new DomainException(ErrorCodes.InvalidTimeFormat,
"Time can not be empty.");
}
if (!TimeRegex.IsMatch(endTime))
{
throw new DomainException(ErrorCodes.InvalidTimeFormat,
"StartTime can not be empty.");
}
EndTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day,
(int.Parse(endTime.Split(':')[0]) % 24), (int.Parse(endTime.Split(':')[1]) % 60), 0);
}
}
}
| 36.157895 | 103 | 0.557982 | [
"MIT"
] | Lukasz0303/ServiceSupport | src/ServiceSupport.Core/Domain/ShopTime.cs | 2,063 | C# |
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Screens.Edit.Components.Menus
{
public class EditorMenuBar : OsuMenu
{
public readonly Bindable<EditorScreenMode> Mode = new Bindable<EditorScreenMode>();
public EditorMenuBar()
: base(Direction.Horizontal, true)
{
RelativeSizeAxes = Axes.X;
MaskingContainer.CornerRadius = 0;
ItemsContainer.Padding = new MarginPadding { Left = 100 };
BackgroundColour = Color4Extensions.FromHex("111");
ScreenSelectionTabControl tabControl;
AddRangeInternal(new Drawable[]
{
tabControl = new ScreenSelectionTabControl
{
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
X = -15
}
});
Mode.BindTo(tabControl.Current);
}
protected override void LoadComplete()
{
base.LoadComplete();
Mode.TriggerChange();
}
protected override Framework.Graphics.UserInterface.Menu CreateSubMenu() => new SubMenu();
protected override DrawableMenuItem CreateDrawableMenuItem(MenuItem item) => new DrawableEditorBarMenuItem(item);
private class DrawableEditorBarMenuItem : DrawableOsuMenuItem
{
private BackgroundBox background;
public DrawableEditorBarMenuItem(MenuItem item)
: base(item)
{
Anchor = Anchor.CentreLeft;
Origin = Anchor.CentreLeft;
StateChanged += stateChanged;
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
ForegroundColour = colours.BlueLight;
BackgroundColour = Color4.Transparent;
ForegroundColourHover = Color4.White;
BackgroundColourHover = colours.Gray3;
}
public override void SetFlowDirection(Direction direction)
{
AutoSizeAxes = Axes.Both;
}
protected override void UpdateBackgroundColour()
{
if (State == MenuItemState.Selected)
Background.FadeColour(BackgroundColourHover);
else
base.UpdateBackgroundColour();
}
protected override void UpdateForegroundColour()
{
if (State == MenuItemState.Selected)
Foreground.FadeColour(ForegroundColourHover);
else
base.UpdateForegroundColour();
}
private void stateChanged(MenuItemState newState)
{
if (newState == MenuItemState.Selected)
background.Expand();
else
background.Contract();
}
protected override Drawable CreateBackground() => background = new BackgroundBox();
protected override DrawableOsuMenuItem.TextContainer CreateTextContainer() => new TextContainer();
private new class TextContainer : DrawableOsuMenuItem.TextContainer
{
public TextContainer()
{
NormalText.Font = NormalText.Font.With(size: 14);
BoldText.Font = BoldText.Font.With(size: 14);
NormalText.Margin = BoldText.Margin = new MarginPadding { Horizontal = 10, Vertical = MARGIN_VERTICAL };
}
}
private class BackgroundBox : CompositeDrawable
{
private readonly Container innerBackground;
public BackgroundBox()
{
RelativeSizeAxes = Axes.Both;
Masking = true;
InternalChild = innerBackground = new Container
{
RelativeSizeAxes = Axes.Both,
Masking = true,
CornerRadius = 4,
Child = new Box { RelativeSizeAxes = Axes.Both }
};
}
/// <summary>
/// Expands the background such that it doesn't show the bottom corners.
/// </summary>
public void Expand() => innerBackground.Height = 2;
/// <summary>
/// Contracts the background such that it shows the bottom corners.
/// </summary>
public void Contract() => innerBackground.Height = 1;
}
}
private class SubMenu : OsuMenu
{
public SubMenu()
: base(Direction.Vertical)
{
OriginPosition = new Vector2(5, 1);
ItemsContainer.Padding = new MarginPadding { Top = 5, Bottom = 5 };
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
BackgroundColour = colours.Gray3;
}
protected override Framework.Graphics.UserInterface.Menu CreateSubMenu() => new SubMenu();
protected override DrawableMenuItem CreateDrawableMenuItem(MenuItem item)
{
switch (item)
{
case EditorMenuItemSpacer spacer:
return new DrawableSpacer(spacer);
case StatefulEditorMenuItem stateful:
return new DrawableStatefulEditorSubMenuItem(stateful, stateful.Accelerator);
case EditorMenuItem editorItem:
return new DrawableEditorBarSubMenuItem(editorItem, editorItem.Accelerator);
}
return base.CreateDrawableMenuItem(item);
}
private class DrawableSpacer : DrawableEditorBarSubMenuItem
{
public DrawableSpacer(MenuItem item)
: base(item)
{
}
protected override bool OnHover(HoverEvent e) => true;
protected override bool OnClick(ClickEvent e) => true;
}
public const int MIN_TIP_PADDING = 10;
public const int MIN_STATE_ICON_PADDING = 10;
protected class DrawableEditorBarSubMenuItem : DrawableOsuMenuItem
{
internal readonly SpriteText tip;
public DrawableEditorBarSubMenuItem(MenuItem item)
: base(item)
{
}
public DrawableEditorBarSubMenuItem(MenuItem item, IAccelerator accelerator)
: this(item)
{
if (accelerator != null)
{
AddInternal(tip = new OsuSpriteText()
{
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
Font = OsuFont.GetFont(size: 14),
Margin = new MarginPadding { Horizontal = MARGIN_HORIZONTAL, Vertical = MARGIN_VERTICAL },
Colour = Color4.Gray,
});
tip.Text = accelerator.Representation;
TextContainer container = (TextContainer)Content;
container.LoadTip(tip);
}
}
protected override DrawableOsuMenuItem.TextContainer CreateTextContainer() =>new TextContainer();
protected new class TextContainer : DrawableOsuMenuItem.TextContainer
{
public TextContainer()
: base()
{
}
public virtual void LoadTip(SpriteText tip)
{
tip.Current.BindValueChanged(text =>
{
float extra_width = 0;
if ((text.NewValue?.Length ?? 0) != 0)
extra_width = tip.DrawWidth + MIN_TIP_PADDING;
NormalText.Margin = new MarginPadding { Left = MARGIN_HORIZONTAL, Right = MARGIN_HORIZONTAL + extra_width, Vertical = MARGIN_VERTICAL };
BoldText.Margin = new MarginPadding { Left = MARGIN_HORIZONTAL, Right = MARGIN_HORIZONTAL + extra_width, Vertical = MARGIN_VERTICAL };
}, true);
}
}
}
protected class DrawableStatefulEditorSubMenuItem : DrawableEditorBarSubMenuItem
{
protected new StatefulEditorMenuItem Item => (StatefulEditorMenuItem)base.Item;
public DrawableStatefulEditorSubMenuItem(StatefulEditorMenuItem item, IAccelerator accelerator)
: base(item, accelerator)
{
}
protected override DrawableOsuMenuItem.TextContainer CreateTextContainer() => new ToggleTextContainer(Item);
private class ToggleTextContainer : TextContainer
{
private readonly StatefulEditorMenuItem menuItem;
private readonly Bindable<object> state;
private readonly SpriteIcon stateIcon;
public ToggleTextContainer(StatefulEditorMenuItem menuItem)
: base()
{
this.menuItem = menuItem;
state = menuItem.State.GetBoundCopy();
Add(stateIcon = new SpriteIcon
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Size = new Vector2(10),
Margin = new MarginPadding { Horizontal = MARGIN_HORIZONTAL },
AlwaysPresent = true,
});
}
protected override void LoadComplete()
{
base.LoadComplete();
state.BindValueChanged(updateState, true);
}
protected override void Update()
{
base.Update();
// Todo: This is bad. This can maybe be done better with a refactor of DrawableOsuMenuItem.
stateIcon.X = BoldText.DrawWidth + MIN_STATE_ICON_PADDING;
}
private void updateState(ValueChangedEvent<object> state)
{
var icon = menuItem.GetIconForState(state.NewValue);
if (icon == null)
stateIcon.Alpha = 0;
else
{
stateIcon.Alpha = 1;
stateIcon.Icon = icon.Value;
}
}
public override void LoadTip(SpriteText tip)
{
tip.Current.BindValueChanged(text =>
{
float extra_width = stateIcon.DrawWidth + MIN_STATE_ICON_PADDING;
if ((text.NewValue?.Length ?? 0) != 0)
extra_width += tip.DrawWidth + MIN_TIP_PADDING;
NormalText.Margin = new MarginPadding { Left = MARGIN_HORIZONTAL, Right = MARGIN_HORIZONTAL + extra_width, Vertical = MARGIN_VERTICAL };
BoldText.Margin = new MarginPadding { Left = MARGIN_HORIZONTAL, Right = MARGIN_HORIZONTAL + extra_width, Vertical = MARGIN_VERTICAL };
}, true);
}
}
}
}
}
}
| 39.896024 | 169 | 0.497547 | [
"MIT"
] | yyny/osu | osu.Game/Screens/Edit/Components/Menus/EditorMenuBar.cs | 12,722 | C# |
using EntityFrameworkCore.Extensions.Services;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using Xunit;
namespace EntityFrameworkCore.Extensions.Tests
{
public class DbContextOptionsBuilderExtensionsTest
{
[Fact]
public void UseEntityFrameworkCoreExtensions_should_register_necessary_services()
{
var builder = new DbContextOptionsBuilder<TestContext>()
.UseSqlServer("fake")
.UseEntityFrameworkCoreExtensions()
.Options;
var context = (IInfrastructure<IServiceProvider>)new TestContext(builder);
var migrationSqlGenerator = context.GetService<IMigrationsSqlGenerator>();
var migrationAnnotationsProvider = context.GetService<IMigrationsAnnotationProvider>();
Assert.IsType<ExtendedMigrationSqlServerGenerator>(migrationSqlGenerator);
Assert.IsType<ExtendedSqlServerMigrationsAnnotationProvider>(migrationAnnotationsProvider);
}
}
}
| 38.206897 | 103 | 0.736462 | [
"MIT"
] | pecea/EntityFrameworkCore.Extensions | EntityFrameworkCore.Extensions.Tests/DbContextOptionsBuilderExtensionsTest.cs | 1,110 | C# |
using System.Collections.Generic;
using Script;
using UnityEngine;
public class Spawner : MonoBehaviour {
public GameObject CubePrefab;
private List<GameObject> _cubeList = new List<GameObject>();
private string _savedData;
private void Update() {
if (Input.GetButton("Jump"))
{
GameObject instantiate = Instantiate(CubePrefab, transform.position, Quaternion.identity);
instantiate.GetComponent<Renderer>().material.color = UnityEngine.Random.ColorHSV();
_cubeList.Add(instantiate);
}
if (Input.GetButtonDown("Fire1")) {
// Serialization process
FileSave fileSave = new FileSave(_cubeList);
_savedData = JsonUtility.ToJson(fileSave);
fileSave.SaveData(_savedData);
}
if (Input.GetButtonDown("Fire2")) {
// Clear state
foreach (GameObject o in _cubeList) {
Destroy(o);
}
_cubeList.Clear();
// Deserialization process
FileSave fileSave = JsonUtility.FromJson<FileSave>(new FileSave().Path());
foreach (SerializableTransform serializableTransform in fileSave.SerializableTransforms) {
GameObject instantiate = Instantiate(CubePrefab, transform.position, Quaternion.identity);
instantiate.transform.position = serializableTransform.Position;
instantiate.transform.rotation = serializableTransform.Rotation;
instantiate.GetComponent<MeshRenderer>().material.color = serializableTransform.Color;
instantiate.GetComponent<Rigidbody>().velocity = serializableTransform.Velocity;
instantiate.GetComponent<Rigidbody>().angularVelocity = serializableTransform.AngVelocity;
_cubeList.Add(instantiate);
}
}
}
} | 37.98 | 106 | 0.639284 | [
"MIT"
] | adrytekk/Serialization | Assets/Scripts/Spawner.cs | 1,899 | C# |
using Newtonsoft.Json;
namespace Essensoft.AspNetCore.Payment.UnionPay.Response
{
/// <summary>
/// 无跳转支付(V2.2) 解除标记 - 应答报文
/// </summary>
public class UnionPayNoRedirectPayDeleteTokenResponse : UnionPayResponse
{
/// <summary>
/// 签名
/// </summary>
[JsonProperty("signature")]
public string Signature { get; set; }
/// <summary>
/// 签名方法
/// </summary>
[JsonProperty("signMethod")]
public string SignMethod { get; set; }
/// <summary>
/// 应答码
/// </summary>
[JsonProperty("respCode")]
public string RespCode { get; set; }
/// <summary>
/// 应答信息
/// </summary>
[JsonProperty("respMsg")]
public string RespMsg { get; set; }
/// <summary>
/// 签名公钥证书
/// </summary>
[JsonProperty("signPubKeyCert")]
public string SignPubKeyCert { get; set; }
/// <summary>
/// 版本号
/// </summary>
[JsonProperty("version")]
public string Version { get; set; }
/// <summary>
/// 编码方式
/// </summary>
[JsonProperty("encoding")]
public string Encoding { get; set; }
/// <summary>
/// 产品类型
/// </summary>
[JsonProperty("bizType")]
public string BizType { get; set; }
/// <summary>
/// 订单发送时间
/// </summary>
[JsonProperty("txnTime")]
public string TxnTime { get; set; }
/// <summary>
/// 交易类型
/// </summary>
[JsonProperty("txnType")]
public string TxnType { get; set; }
/// <summary>
/// 交易子类
/// </summary>
[JsonProperty("txnSubType")]
public string TxnSubType { get; set; }
/// <summary>
/// 接入类型
/// </summary>
[JsonProperty("accessType")]
public string AccessType { get; set; }
/// <summary>
/// 请求方保留域
/// </summary>
[JsonProperty("reqReserved")]
public string ReqReserved { get; set; }
/// <summary>
/// 商户代码
/// </summary>
[JsonProperty("merId")]
public string MerId { get; set; }
/// <summary>
/// 商户订单号
/// </summary>
[JsonProperty("orderId")]
public string OrderId { get; set; }
/// <summary>
/// 保留域
/// </summary>
[JsonProperty("reserved")]
public string Reserved { get; set; }
}
}
| 23.953271 | 76 | 0.470933 | [
"MIT"
] | AkonCoder/Payment | src/Essensoft.AspNetCore.Payment.UnionPay/Response/UnionPayNoRedirectPayDeleteTokenResponse.cs | 2,723 | C# |
using System.Collections.Generic;
using UnityEngine;
using System.Collections;
public class WallCollider : MonoBehaviour {
private List<Transform> hitTargets = new List<Transform>();
void Start () {
}
void Update () {
}
void OnCollisionEnter(Collision collision) {
if (hitTargets.Contains(collision.transform)) return;
var fragment = collision.gameObject.GetComponent<WallFragment>();
if (fragment == null) return;
hitTargets.Add(collision.transform);
fragment.Collide();
}
}
| 19.464286 | 73 | 0.678899 | [
"MIT"
] | InteractiveLab/unite-12 | Assets/Modules/The Wall/Scripts/WallCollider.cs | 545 | 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.
// =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
//
// PairComparer.cs
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
using System.Collections.Generic;
namespace System.Linq.Parallel
{
/// <summary>
/// PairComparer compares pairs by the first element, and breaks ties by the second
/// element.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="U"></typeparam>
internal sealed class PairComparer<T, U> : IComparer<Pair<T, U>>
{
private readonly IComparer<T> _comparer1;
private readonly IComparer<U>? _comparer2;
public PairComparer(IComparer<T> comparer1, IComparer<U>? comparer2)
{
_comparer1 = comparer1;
_comparer2 = comparer2;
}
public int Compare(Pair<T, U> x, Pair<T, U> y)
{
int result1 = _comparer1.Compare(x.First, y.First);
if (result1 != 0)
{
return result1;
}
if (_comparer2 == null)
return result1;
return _comparer2.Compare(x.Second, y.Second);
}
}
}
| 30.106383 | 89 | 0.515194 | [
"MIT"
] | 06needhamt/runtime | src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/PairComparer.cs | 1,415 | C# |
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.Entity;
using System.Data.SqlClient;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using BloodDonationManagementSystem;
using PagedList;
namespace BloodDonationManagementSystem.Areas.ADMIN.Controllers
{
public class StatesController : Controller
{
private Entities db = new Entities();
// GET: ADMIN/States
public ActionResult Index(int page = 1)
{
return View(db.States.OrderBy(r=>r.StateName).ToPagedList(page, 8));
}
// GET: ADMIN/States/Create
public ActionResult Create()
{
return View();
}
// POST: ADMIN/States/Create
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
// more details see https://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create([Bind(Include = "stateid,StateName")] State state)
{
if (ModelState.IsValid)
{
db.States.Add(state);
db.SaveChanges();
return RedirectToAction("Index");
}
return View(state);
}
// GET: ADMIN/States/Edit/5
public ActionResult Edit(int? id)
{
if (id == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
State state = db.States.Find(id);
if (state == null)
{
return HttpNotFound();
}
return View(state);
}
// POST: ADMIN/States/Edit/5
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
// more details see https://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Edit([Bind(Include = "stateid,StateName")] State state)
{
if (ModelState.IsValid)
{
db.Entry(state).State = EntityState.Modified;
db.SaveChanges();
return RedirectToAction("Index");
}
return View(state);
}
// GET: ADMIN/States/Delete/5
public ActionResult Delete(int? id)
{
if (id == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
State state = db.States.Find(id);
if (state == null)
{
return HttpNotFound();
}
return View(state);
}
// POST: ADMIN/States/Delete/5
[HttpPost, ActionName("Delete")]
[ValidateAntiForgeryToken]
public ActionResult DeleteConfirmed(int id)
{
State state = db.States.Find(id);
db.States.Remove(state);
db.SaveChanges();
return RedirectToAction("Index");
}
public ActionResult StateIndex()
{
string markers = "[";
string conString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
SqlCommand cmd = new SqlCommand("Sp_GeoLoc");
using (SqlConnection con = new SqlConnection(conString))
{
cmd.Connection = con;
con.Open();
using (SqlDataReader sdr = cmd.ExecuteReader())
{
while (sdr.Read())
{
markers += "{";
markers += string.Format("'title': '{0}',", sdr["Statename"]);
markers += string.Format("'lat': '{0}',", sdr["lat"]);
markers += string.Format("'lng': '{0}',", sdr["long"]);
markers += string.Format("'description': '{0}'", sdr["Descp"]);
markers += "},";
}
}
con.Close();
}
markers += "];";
ViewBag.Markers = markers;
return View();
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
db.Dispose();
}
base.Dispose(disposing);
}
}
}
| 30.856164 | 111 | 0.5101 | [
"MIT"
] | irahulcse/Rudhir-A-BDMS | BloodDonationManagementSystem/Areas/ADMIN/Controllers/StatesController.cs | 4,507 | C# |
using System;
namespace Microsoft.Azure.Batch.SoftwareEntitlement.Common
{
/// <summary>
/// A container that either contains a success (OK) value, or an error.
/// </summary>
/// <typeparam name="TOk">The success type</typeparam>
/// <typeparam name="TError">The error type</typeparam>
public sealed class Result<TOk, TError>
{
private readonly TOk _ok;
private readonly TError _error;
private readonly bool _isOk;
public Result(TOk ok)
{
_ok = ok;
_error = default;
_isOk = true;
}
public Result(TError error)
{
_ok = default;
_error = error;
_isOk = false;
}
public void Match(Action<TOk> okAction, Action<TError> errorAction)
{
if (okAction == null)
{
throw new ArgumentNullException(nameof(okAction));
}
if (errorAction == null)
{
throw new ArgumentNullException(nameof(errorAction));
}
if (_isOk)
{
okAction(_ok);
}
else
{
errorAction(_error);
}
}
public T Match<T>(Func<TOk, T> fromOk, Func<TError, T> fromError)
{
if (fromOk == null)
{
throw new ArgumentNullException(nameof(fromOk));
}
if (fromError == null)
{
throw new ArgumentNullException(nameof(fromError));
}
return _isOk
? fromOk(_ok)
: fromError(_error);
}
public static implicit operator Result<TOk, TError>(TError error) =>
new Result<TOk, TError>(error);
public static implicit operator Result<TOk, TError>(TOk ok) =>
new Result<TOk, TError>(ok);
}
}
| 25.684211 | 76 | 0.493852 | [
"MIT"
] | Azure/azure-batch-software-entitlement | src/Microsoft.Azure.Batch.SoftwareEntitlement.Common/Result.cs | 1,952 | C# |
using System.Reflection;
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("BusinessLogic")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BusinessLogic")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[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("d82e1d7e-a7cc-4f23-830e-b5d382f659ed")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 37.777778 | 84 | 0.741912 | [
"MIT"
] | enriqueescobar-askida/UdeS.Cefti.Inf731.Tp1 | BusinessLogic/Properties/AssemblyInfo.cs | 1,363 | C# |
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System;
using NetRuntimeSystem = System;
using System.ComponentModel;
using NetOffice.Attributes;
using NetOffice.CollectionsGeneric;
namespace NetOffice.VisioApi
{
/// <summary>
/// DispatchInterface IVDataRecordsets
/// SupportByVersion Visio, 12,14,15,16
/// </summary>
[SupportByVersion("Visio", 12,14,15,16)]
[EntityType(EntityType.IsDispatchInterface), BaseType, Enumerator(Enumerator.Reference, EnumeratorInvoke.Property, "Visio", 12, 14, 15, 16), HasIndexProperty(IndexInvoke.Property, "Item")]
[TypeId("000D072E-0000-0000-C000-000000000046")]
[CoClassSource(typeof(NetOffice.VisioApi.DataRecordsets))]
public interface IVDataRecordsets : ICOMObject, IEnumerableProvider<NetOffice.VisioApi.IVDataRecordset>
{
#region Properties
/// <summary>
/// SupportByVersion Visio 12, 14, 15, 16
/// Get
/// </summary>
[SupportByVersion("Visio", 12,14,15,16)]
[BaseResult]
NetOffice.VisioApi.IVApplication Application { get; }
/// <summary>
/// SupportByVersion Visio 12, 14, 15, 16
/// Get
/// </summary>
[SupportByVersion("Visio", 12,14,15,16)]
Int16 Stat { get; }
/// <summary>
/// SupportByVersion Visio 12, 14, 15, 16
/// Get
/// </summary>
[SupportByVersion("Visio", 12,14,15,16)]
[BaseResult]
NetOffice.VisioApi.IVDocument Document { get; }
/// <summary>
/// SupportByVersion Visio 12, 14, 15, 16
/// Get
/// </summary>
[SupportByVersion("Visio", 12,14,15,16)]
Int16 ObjectType { get; }
/// <summary>
/// SupportByVersion Visio 12, 14, 15, 16
/// Get
/// </summary>
[SupportByVersion("Visio", 12,14,15,16)]
Int32 Count { get; }
/// <summary>
/// SupportByVersion Visio 12, 14, 15, 16
/// Get
/// </summary>
/// <param name="index">Int32 index</param>
[SupportByVersion("Visio", 12,14,15,16)]
[BaseResult]
[NetRuntimeSystem.Runtime.CompilerServices.IndexerName("Item"), IndexProperty]
NetOffice.VisioApi.IVDataRecordset this[Int32 index] { get; }
/// <summary>
/// SupportByVersion Visio 12, 14, 15, 16
/// Get
/// </summary>
/// <param name="iD">Int32 iD</param>
[SupportByVersion("Visio", 12,14,15,16)]
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
NetOffice.VisioApi.IVDataRecordset get_ItemFromID(Int32 iD);
/// <summary>
/// SupportByVersion Visio 12, 14, 15, 16
/// Alias for get_ItemFromID
/// </summary>
/// <param name="iD">Int32 iD</param>
[SupportByVersion("Visio", 12,14,15,16), Redirect("get_ItemFromID")]
NetOffice.VisioApi.IVDataRecordset ItemFromID(Int32 iD);
/// <summary>
/// SupportByVersion Visio 12, 14, 15, 16
/// Get
/// </summary>
[SupportByVersion("Visio", 12,14,15,16)]
[BaseResult]
NetOffice.VisioApi.IVEventList EventList { get; }
#endregion
#region Methods
/// <summary>
/// SupportByVersion Visio 12, 14, 15, 16
/// </summary>
/// <param name="connectionIDOrString">object connectionIDOrString</param>
/// <param name="commandString">string commandString</param>
/// <param name="addOptions">Int32 addOptions</param>
/// <param name="name">optional string Name = </param>
[SupportByVersion("Visio", 12,14,15,16)]
[BaseResult]
NetOffice.VisioApi.IVDataRecordset Add(object connectionIDOrString, string commandString, Int32 addOptions, object name);
/// <summary>
/// SupportByVersion Visio 12, 14, 15, 16
/// </summary>
/// <param name="connectionIDOrString">object connectionIDOrString</param>
/// <param name="commandString">string commandString</param>
/// <param name="addOptions">Int32 addOptions</param>
[CustomMethod]
[BaseResult]
[SupportByVersion("Visio", 12,14,15,16)]
NetOffice.VisioApi.IVDataRecordset Add(object connectionIDOrString, string commandString, Int32 addOptions);
/// <summary>
/// SupportByVersion Visio 12, 14, 15, 16
/// </summary>
/// <param name="xMLString">string xMLString</param>
/// <param name="addOptions">Int32 addOptions</param>
/// <param name="name">optional string Name = </param>
[SupportByVersion("Visio", 12,14,15,16)]
[BaseResult]
NetOffice.VisioApi.IVDataRecordset AddFromXML(string xMLString, Int32 addOptions, object name);
/// <summary>
/// SupportByVersion Visio 12, 14, 15, 16
/// </summary>
/// <param name="xMLString">string xMLString</param>
/// <param name="addOptions">Int32 addOptions</param>
[CustomMethod]
[BaseResult]
[SupportByVersion("Visio", 12,14,15,16)]
NetOffice.VisioApi.IVDataRecordset AddFromXML(string xMLString, Int32 addOptions);
/// <summary>
/// SupportByVersion Visio 12, 14, 15, 16
/// </summary>
/// <param name="fileName">string fileName</param>
/// <param name="addOptions">Int32 addOptions</param>
/// <param name="name">optional string Name = </param>
[SupportByVersion("Visio", 12,14,15,16)]
[BaseResult]
NetOffice.VisioApi.IVDataRecordset AddFromConnectionFile(string fileName, Int32 addOptions, object name);
/// <summary>
/// SupportByVersion Visio 12, 14, 15, 16
/// </summary>
/// <param name="fileName">string fileName</param>
/// <param name="addOptions">Int32 addOptions</param>
[CustomMethod]
[BaseResult]
[SupportByVersion("Visio", 12,14,15,16)]
NetOffice.VisioApi.IVDataRecordset AddFromConnectionFile(string fileName, Int32 addOptions);
/// <summary>
/// SupportByVersion Visio 12, 14, 15, 16
/// </summary>
/// <param name="dataErrorCode">Int32 dataErrorCode</param>
/// <param name="dataErrorDescription">string dataErrorDescription</param>
/// <param name="recordsetID">Int32 recordsetID</param>
[SupportByVersion("Visio", 12,14,15,16)]
void GetLastDataError(out Int32 dataErrorCode, out string dataErrorDescription, out Int32 recordsetID);
#endregion
#region IEnumerable<NetOffice.VisioApi.IVDataRecordset>
/// <summary>
/// SupportByVersion Visio, 12,14,15,16
/// </summary>
[SupportByVersion("Visio", 12, 14, 15, 16)]
new IEnumerator<NetOffice.VisioApi.IVDataRecordset> GetEnumerator();
#endregion
}
}
| 33.206522 | 189 | 0.691162 | [
"MIT"
] | igoreksiz/NetOffice | Source/Visio/DispatchInterfaces/IVDataRecordsets.cs | 6,112 | C# |
using System;
namespace RuriLib.Logging
{
/// <summary>
/// Takes care of logging information produced by a job.
/// </summary>
public interface IJobLogger
{
/// <summary>
/// Logs a generic <paramref name="message"/> to the log identified by the <paramref name="jobId"/>.
/// </summary>
void Log(int jobId, string message, LogKind kind);
/// <summary>
/// Logs an info <paramref name="message"/> to the log identified by the <paramref name="jobId"/>.
/// </summary>
void LogInfo(int jobId, string message);
/// <summary>
/// Logs a warning <paramref name="message"/> to the log identified by the <paramref name="jobId"/>.
/// </summary>
void LogWarning(int jobId, string message);
/// <summary>
/// Logs an error <paramref name="message"/> to the log identified by the <paramref name="jobId"/>.
/// </summary>
void LogError(int jobId, string message);
/// <summary>
/// Logs an <paramref name="exception"/> to the log identified by the <paramref name="jobId"/>.
/// </summary>
void LogException(int jobId, Exception exception);
}
}
| 33.972222 | 108 | 0.584628 | [
"MIT"
] | 542980940984363224858439616269115634540/OpenBullet2 | RuriLib/Logging/IJobLogger.cs | 1,225 | C# |
// Copyright (c) 2018 Alachisoft
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License
using System;
using System.Collections.Generic;
using System.Text;
namespace Alachisoft.NCache.Common.Enum
{
public enum CacheTopology
{
Local,
Replicated,
Partitioned
}
}
| 29.666667 | 75 | 0.722846 | [
"Apache-2.0"
] | abayaz61/NCache | Src/NCCommon/Enum/CacheTopology.cs | 801 | 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("Sidecar.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Sidecar.Tests")]
[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("7a2b508e-88e5-4180-8fa6-1558e576528b")]
// 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.747354 | [
"MIT"
] | thesheps/screwdriver | tests/Sidecar.Tests/Properties/AssemblyInfo.cs | 1,420 | 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.V20190801.Outputs
{
/// <summary>
/// Backend address of an application gateway.
/// </summary>
[OutputType]
public sealed class ApplicationGatewayBackendAddressResponse
{
/// <summary>
/// Fully qualified domain name (FQDN).
/// </summary>
public readonly string? Fqdn;
/// <summary>
/// IP address.
/// </summary>
public readonly string? IpAddress;
[OutputConstructor]
private ApplicationGatewayBackendAddressResponse(
string? fqdn,
string? ipAddress)
{
Fqdn = fqdn;
IpAddress = ipAddress;
}
}
}
| 25.871795 | 81 | 0.618434 | [
"Apache-2.0"
] | polivbr/pulumi-azure-native | sdk/dotnet/Network/V20190801/Outputs/ApplicationGatewayBackendAddressResponse.cs | 1,009 | C# |
using System.Linq;
using Microsoft.EntityFrameworkCore;
using UnicornStore.Models.UnicornStore;
using UnicornStore.ViewModels.Shop;
using Microsoft.AspNetCore.Mvc;
namespace UnicornStore.Controllers
{
public class ShopController : Controller
{
private UnicornStoreContext db;
CategoryCache categoryCache;
public ShopController(UnicornStoreContext context, CategoryCache cache)
{
db = context;
categoryCache = cache;
}
public IActionResult Index()
{
// TODO ToList() is a workaround for:
// - https://github.com/aspnet/EntityFramework/issues/1851
// - https://github.com/aspnet/EntityFramework/issues/1852
var products = db.Products
.ToList()
.OrderByDescending(p => p.MSRP - p.CurrentPrice)
.Take(4);
return View(new IndexViewModel
{
FeaturedProducts = products,
TopLevelCategories = categoryCache.TopLevel()
});
}
public IActionResult Category(int? id)
{
if (id == null)
{
return new StatusCodeResult(404);
}
var category = categoryCache.FromKey(id.Value);
if (category == null)
{
return new StatusCodeResult(404);
}
var ids = categoryCache.GetThisAndChildIds(id.Value);
return View(new CategoryViewModel
{
Category = category,
Products = db.Products.Where(p => ids.Contains(p.CategoryId)),
ParentHierarchy = categoryCache.GetHierarchy(category.CategoryId),
Children = category.Children
});
}
public IActionResult Product(int? id)
{
if (id == null)
{
return new StatusCodeResult(404);
}
var product = db.Products
.Include(p => p.Category)
.SingleOrDefault(m => m.ProductId == id);
if (product == null)
{
return new StatusCodeResult(404);
}
return View(new ProductViewModel
{
Product = product,
CategoryHierarchy = categoryCache.GetHierarchy(product.CategoryId),
TopLevelCategories = categoryCache.TopLevel()
});
}
public IActionResult Search(string term)
{
var products = db.Products
.FromSql("SELECT * FROM [dbo].[SearchProducts] (@p0)", term)
.OrderByDescending(p => p.Savings)
.ToList();
return View(new SearchViewModel
{
SearchTerm = term,
Products = products,
TopLevelCategories = categoryCache.TopLevel()
});
}
}
}
| 29.323529 | 83 | 0.520227 | [
"Apache-2.0"
] | SajjadArifGul/UnicornStore | UnicornStore/src/UnicornStore/Controllers/ShopController.cs | 2,991 | C# |
#region License
// Copyright © 2018 Darko Jurić
//
// 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
using System;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
namespace WebSocketRPC
{
/// <summary>
/// Contains functions for creating RPC JavaScript API from a provided class/interface.
/// </summary>
public static class RPCJs
{
/// <summary>
/// Generates JavaScript code from the provided class or interface type.
/// </summary>
/// <typeparam name="T">Class or interface type.</typeparam>
/// <param name="settings">RPC-Js settings used for Javascript code generation.</param>
/// <returns>Javascript API.</returns>
public static string GenerateCaller<T>(RPCJsSettings<T> settings = null)
{
settings = settings ?? new RPCJsSettings<T>();
var (tName, mInfos) = JsCallerGenerator.GetMethods(settings.OmittedMethods);
tName = settings.NameOverwrite ?? tName;
var sb = new StringBuilder();
if (settings.WithRequireSupport) sb.Append(JsCallerGenerator.GenerateRequireJsHeader(tName));
sb.Append(JsCallerGenerator.GenerateHeader(tName));
foreach (var m in mInfos)
{
var mName = m.Name;
var pNames = m.GetParameters().Select(x => x.Name).ToArray();
sb.Append(JsCallerGenerator.GenerateMethod(mName, pNames));
}
sb.Append(JsCallerGenerator.GenerateFooter());
return sb.ToString();
}
/// <summary>
/// Generates JavaScript code including JsDoc comments from the provided class or interface type.
/// </summary>
/// <typeparam name="T">Class or interface type.</typeparam>
/// <param name="xmlDocPath">XML assembly definition file.</param>
/// <param name="settings">RPC-Js settings used for Javascript code generation.</param>
/// <returns>Javascript API.</returns>
public static string GenerateCallerWithDoc<T>(string xmlDocPath, RPCJsSettings<T> settings = null)
{
settings = settings ?? new RPCJsSettings<T>();
var (tName, mInfos) = JsCallerGenerator.GetMethods(settings.OmittedMethods);
tName = settings.NameOverwrite ?? tName;
var xmlMemberNodes = JsDocGenerator.GetMemberNodes(xmlDocPath);
var sb = new StringBuilder();
if (settings.WithRequireSupport) sb.Append(JsCallerGenerator.GenerateRequireJsHeader(tName));
sb.Append(JsDocGenerator.GetClassDoc(xmlMemberNodes, tName));
sb.Append(JsCallerGenerator.GenerateHeader(tName));
foreach (var m in mInfos)
{
var mName = m.Name;
var pTypes = m.GetParameters().Select(x => x.ParameterType).ToArray();
var pNames = m.GetParameters().Select(x => x.Name).ToArray();
sb.Append(JsDocGenerator.GetMethodDoc(xmlMemberNodes, mName, pNames, pTypes, m.ReturnType));
sb.Append(JsCallerGenerator.GenerateMethod(mName, pNames));
}
sb.Append(JsCallerGenerator.GenerateFooter());
return sb.ToString();
}
/// <summary>
/// Generates JavaScript code including JsDoc comments from the provided class or interface type.
/// <para>The XML assembly definition is taken form the executing assembly if available.</para>
/// </summary>
/// <typeparam name="T">Class or interface type.</typeparam>
/// <param name="settings">RPC-Js settings used for Javascript code generation.</param>
/// <returns>Javascript API.</returns>
public static string GenerateCallerWithDoc<T>(RPCJsSettings<T> settings = null)
{
var assembly = Assembly.GetEntryAssembly();
var fInfo = new FileInfo(assembly.Location);
var xmlDocPath = Path.ChangeExtension(assembly.Location, ".xml");
if (!File.Exists(xmlDocPath))
return GenerateCaller(settings);
else
return GenerateCallerWithDoc(xmlDocPath, settings);
}
}
}
| 43.073171 | 108 | 0.652322 | [
"MIT"
] | vacamra/websocket-rpc | Source/WebSocketRPC.JS/RPCJs.cs | 5,302 | C# |
using Unicorn.ControlPanel.Pipelines.UnicornControlPanelRequest;
using Unicorn.ControlPanel.Responses;
using Unicorn.ControlPanel.VisualStudio.Responses;
namespace Unicorn.ControlPanel.VisualStudio.Pipelines.UnicornControlPanelRequest
{
// ReSharper disable once InconsistentNaming
public class VSReserializeVerb : ReserializeVerb
{
public VSReserializeVerb() : base("VSReserialize", new SerializationHelper())
{
}
protected override IResponse CreateResponse(UnicornControlPanelRequestPipelineArgs args)
{
return new StreamingEncodedLogResponse(Process);
}
}
}
| 29.15 | 90 | 0.823328 | [
"MIT"
] | BenGGolden/Unicorn | src/Unicorn/ControlPanel/VisualStudio/Pipelines/UnicornControlPanelRequest/VSReserializeVerb.cs | 585 | C# |
namespace RomanticWeb.Linq.Model
{
/// <summary>Provides a base interface for expressions in query.</summary>
public interface IExpression : IQueryComponent
{
}
} | 25.571429 | 78 | 0.709497 | [
"BSD-3-Clause"
] | alien-mcl/RomanticWeb | RomanticWeb.Contracts/Linq/Model/IExpression.cs | 181 | C# |
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
using System;
using TOutput = Microsoft.Xna.Framework.Matrix;
namespace Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
{
/// <summary>
/// Writes the Matrix value to the output.
/// </summary>
[ContentTypeWriter]
class MatrixWriter : BuiltInContentWriter<TOutput>
{
/// <summary>
/// Writes the value to the output.
/// </summary>
/// <param name="output">The output writer object.</param>
/// <param name="value">The value to write to the output.</param>
protected internal override void Write(ContentWriter output, TOutput value)
{
output.Write(value);
}
}
}
| 31.814815 | 83 | 0.649593 | [
"MIT"
] | Gitspathe/MonoGame | MonoGame.Framework.Content.Pipeline/Serialization/Compiler/MatrixWriter.cs | 859 | C# |
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using System.Text;
using Newtonsoft.Json;
namespace Adyen.Model.MarketPay
{
/// <summary>
/// AccountContainer
/// </summary>
[DataContract]
public partial class UpdateAccountResponse : IEquatable<AccountContainer>, IValidatableObject
{
/// <summary>
/// account.
/// </summary>
/// <value>account.</value>
[DataMember(Name = "Account", EmitDefaultValue = false)]
public Account account { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="AccountContainer" /> class.
/// </summary>
/// <param name="account">account.</param>
public AccountContainer(Account account = default(Account))
{
this.account = account;
}
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class AccountContainer {\n");
sb.Append(" account: ").Append(account).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as AccountContainer);
}
/// <summary>
/// Returns true if MerchantDevice instances are equal
/// </summary>
/// <param name="input">Instance of MerchantDevice to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(AccountContainer input)
{
if (input == null)
return false;
return
(
this.account == input.account ||
(this.account != null &&
this.account.Equals(input.account))
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.account != null)
hashCode = hashCode * 59 + this.account.GetHashCode();
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}
| 31.900901 | 141 | 0.529511 | [
"MIT"
] | Ganesh-Chavan/adyen-dotnet-api-library | Adyen/Model/MarketPay/UpdateAccountResponse.cs | 3,543 | C# |
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Sharp.Entities
{
public class Light : Entity
{
#region Variables
/************************************************************************/
/* Variables */
/************************************************************************/
private Color color = new Color(255, 255, 255, 255);
#endregion
#region Properties
/************************************************************************/
/* Properties */
/************************************************************************/
public Color Color
{
get { return this.color; }
set { this.color = value; }
}
#endregion
#region Methods
/************************************************************************/
/* Methods */
/************************************************************************/
#endregion
}
}
| 36.583333 | 83 | 0.2612 | [
"MIT"
] | frham20/SharpEngine | src/Entities/Light.cs | 1,317 | C# |
using Foundation;
using Prism;
using Prism.Ioc;
using UIKit;
namespace XamarinPrismApp.iOS
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
LoadApplication(new App(new iOSInitializer()));
return base.FinishedLaunching(app, options);
}
}
public class iOSInitializer : IPlatformInitializer
{
public void RegisterTypes(IContainerRegistry container)
{
}
}
}
| 31.846154 | 98 | 0.669082 | [
"MIT"
] | mac-shiota/XamarinPrismApp | XamarinPrismApp/XamarinPrismApp.iOS/AppDelegate.cs | 1,244 | C# |
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#if ASPNET50
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.DependencyInjection.Fallback;
using Microsoft.Framework.OptionsModel;
using Moq;
using Xunit;
namespace Microsoft.AspNet.Routing.Template.Tests
{
public class TemplateBinderTests
{
private static IInlineConstraintResolver _inlineConstraintResolver = GetInlineConstraintResolver();
public static IEnumerable<object[]> EmptyAndNullDefaultValues
{
get
{
return new object[][]
{
new object[]
{
"Test/{val1}/{val2}",
new RouteValueDictionary(new {val1 = "", val2 = ""}),
new RouteValueDictionary(new {val2 = "SomeVal2"}),
null,
},
new object[]
{
"Test/{val1}/{val2}",
new RouteValueDictionary(new {val1 = "", val2 = ""}),
new RouteValueDictionary(new {val1 = "a"}),
"Test/a"
},
new object[]
{
"Test/{val1}/{val2}/{val3}",
new RouteValueDictionary(new {val1 = "", val3 = ""}),
new RouteValueDictionary(new {val2 = "a"}),
null
},
new object[]
{
"Test/{val1}/{val2}",
new RouteValueDictionary(new {val1 = "", val2 = ""}),
new RouteValueDictionary(new {val1 = "a", val2 = "b"}),
"Test/a/b"
},
new object[]
{
"Test/{val1}/{val2}/{val3}",
new RouteValueDictionary(new {val1 = "", val2 = "", val3 = ""}),
new RouteValueDictionary(new {val1 = "a", val2 = "b", val3 = "c"}),
"Test/a/b/c"
},
new object[]
{
"Test/{val1}/{val2}/{val3}",
new RouteValueDictionary(new {val1 = "", val2 = "", val3 = ""}),
new RouteValueDictionary(new {val1 = "a", val2 = "b"}),
"Test/a/b"
},
new object[]
{
"Test/{val1}/{val2}/{val3}",
new RouteValueDictionary(new {val1 = "", val2 = "", val3 = ""}),
new RouteValueDictionary(new {val1 = "a"}),
"Test/a"
},
new object[]
{
"Test/{val1}",
new RouteValueDictionary(new {val1 = "42", val2 = "", val3 = ""}),
new RouteValueDictionary(),
"Test"
},
new object[]
{
"Test/{val1}/{val2}/{val3}",
new RouteValueDictionary(new {val1 = "42", val2 = (string)null, val3 = (string)null}),
new RouteValueDictionary(),
"Test"
},
new object[]
{
"Test/{val1}/{val2}/{val3}/{val4}",
new RouteValueDictionary(new {val1 = "21", val2 = "", val3 = "", val4 = ""}),
new RouteValueDictionary(new {val1 = "42", val2 = "11", val3 = "", val4 = ""}),
"Test/42/11"
},
new object[]
{
"Test/{val1}/{val2}/{val3}",
new RouteValueDictionary(new {val1 = "21", val2 = "", val3 = ""}),
new RouteValueDictionary(new {val1 = "42"}),
"Test/42"
},
new object[]
{
"Test/{val1}/{val2}/{val3}/{val4}",
new RouteValueDictionary(new {val1 = "21", val2 = "", val3 = "", val4 = ""}),
new RouteValueDictionary(new {val1 = "42", val2 = "11"}),
"Test/42/11"
},
new object[]
{
"Test/{val1}/{val2}/{val3}",
new RouteValueDictionary(new {val1 = "21", val2 = (string)null, val3 = (string)null}),
new RouteValueDictionary(new {val1 = "42"}),
"Test/42"
},
new object[]
{
"Test/{val1}/{val2}/{val3}/{val4}",
new RouteValueDictionary(new {val1 = "21", val2 = (string)null, val3 = (string)null, val4 = (string)null}),
new RouteValueDictionary(new {val1 = "42", val2 = "11"}),
"Test/42/11"
},
};
}
}
[Theory]
[MemberData("EmptyAndNullDefaultValues")]
public void Binding_WithEmptyAndNull_DefaultValues(
string template,
IReadOnlyDictionary<string, object> defaults,
IDictionary<string, object> values,
string expected)
{
// Arrange
var binder = new TemplateBinder(
TemplateParser.Parse(template),
defaults);
// Act & Assert
var result = binder.GetValues(ambientValues: null, values: values);
if (result == null)
{
if (expected == null)
{
return;
}
else
{
Assert.NotNull(result);
}
}
var boundTemplate = binder.BindValues(result.AcceptedValues);
if (expected == null)
{
Assert.Null(boundTemplate);
}
else
{
Assert.NotNull(boundTemplate);
Assert.Equal(expected, boundTemplate);
}
}
[Fact]
public void GetVirtualPathWithMultiSegmentParamsOnBothEndsMatches()
{
RunTest(
"language/{lang}-{region}",
null,
new RouteValueDictionary(new { lang = "en", region = "US" }),
new RouteValueDictionary(new { lang = "xx", region = "yy" }),
"language/xx-yy");
}
[Fact]
public void GetVirtualPathWithMultiSegmentParamsOnLeftEndMatches()
{
RunTest(
"language/{lang}-{region}a",
null,
new RouteValueDictionary(new { lang = "en", region = "US" }),
new RouteValueDictionary(new { lang = "xx", region = "yy" }),
"language/xx-yya");
}
[Fact]
public void GetVirtualPathWithMultiSegmentParamsOnRightEndMatches()
{
RunTest(
"language/a{lang}-{region}",
null,
new RouteValueDictionary(new { lang = "en", region = "US" }),
new RouteValueDictionary(new { lang = "xx", region = "yy" }),
"language/axx-yy");
}
public static IEnumerable<object[]> OptionalParamValues
{
get
{
return new object[][]
{
// defaults
// ambient values
// values
new object[]
{
"Test/{val1}/{val2}.{val3?}",
new RouteValueDictionary(new {val1 = "someval1", val2 = "someval2"}),
new RouteValueDictionary(new {val3 = "someval3"}),
new RouteValueDictionary(new {val3 = "someval3"}),
"Test/someval1/someval2.someval3",
},
new object[]
{
"Test/{val1}/{val2}.{val3?}",
new RouteValueDictionary(new {val1 = "someval1", val2 = "someval2"}),
new RouteValueDictionary(new {val3 = "someval3a"}),
new RouteValueDictionary(new {val3 = "someval3v"}),
"Test/someval1/someval2.someval3v",
},
new object[]
{
"Test/{val1}/{val2}.{val3?}",
new RouteValueDictionary(new {val1 = "someval1", val2 = "someval2"}),
new RouteValueDictionary(new {val3 = "someval3a"}),
new RouteValueDictionary(),
"Test/someval1/someval2.someval3a",
},
new object[]
{
"Test/{val1}/{val2}.{val3?}",
new RouteValueDictionary(new {val1 = "someval1", val2 = "someval2"}),
new RouteValueDictionary(),
new RouteValueDictionary(new {val3 = "someval3v"}),
"Test/someval1/someval2.someval3v",
},
new object[]
{
"Test/{val1}/{val2}.{val3?}",
new RouteValueDictionary(new {val1 = "someval1", val2 = "someval2"}),
new RouteValueDictionary(),
new RouteValueDictionary(),
"Test/someval1/someval2",
},
new object[]
{
"Test/{val1}.{val2}.{val3}.{val4?}",
new RouteValueDictionary(new {val1 = "someval1", val2 = "someval2" }),
new RouteValueDictionary(),
new RouteValueDictionary(new {val4 = "someval4", val3 = "someval3" }),
"Test/someval1.someval2.someval3.someval4",
},
new object[]
{
"Test/{val1}.{val2}.{val3}.{val4?}",
new RouteValueDictionary(new {val1 = "someval1", val2 = "someval2" }),
new RouteValueDictionary(),
new RouteValueDictionary(new {val3 = "someval3" }),
"Test/someval1.someval2.someval3",
},
new object[]
{
"Test/.{val2?}",
new RouteValueDictionary(new { }),
new RouteValueDictionary(),
new RouteValueDictionary(new {val2 = "someval2" }),
"Test/.someval2",
},
new object[]
{
"Test/{val1}.{val2}",
new RouteValueDictionary(new {val1 = "someval1", val2 = "someval2" }),
new RouteValueDictionary(),
new RouteValueDictionary(new {val3 = "someval3" }),
"Test/someval1.someval2?val3=someval3",
},
};
}
}
[Theory]
[MemberData("OptionalParamValues")]
public void GetVirtualPathWithMultiSegmentWithOptionalParam(
string template,
IReadOnlyDictionary<string, object> defaults,
IDictionary<string, object> ambientValues,
IDictionary<string, object> values,
string expected)
{
// Arrange
var binder = new TemplateBinder(
TemplateParser.Parse(template),
defaults);
// Act & Assert
var result = binder.GetValues(ambientValues: ambientValues, values: values);
if (result == null)
{
if (expected == null)
{
return;
}
else
{
Assert.NotNull(result);
}
}
var boundTemplate = binder.BindValues(result.AcceptedValues);
if (expected == null)
{
Assert.Null(boundTemplate);
}
else
{
Assert.NotNull(boundTemplate);
Assert.Equal(expected, boundTemplate);
}
}
[Fact]
public void GetVirtualPathWithMultiSegmentParamsOnNeitherEndMatches()
{
RunTest(
"language/a{lang}-{region}a",
null,
new RouteValueDictionary(new { lang = "en", region = "US" }),
new RouteValueDictionary(new { lang = "xx", region = "yy" }),
"language/axx-yya");
}
[Fact]
public void GetVirtualPathWithMultiSegmentParamsOnNeitherEndDoesNotMatch()
{
RunTest(
"language/a{lang}-{region}a",
null,
new RouteValueDictionary(new { lang = "en", region = "US" }),
new RouteValueDictionary(new { lang = "", region = "yy" }),
null);
}
[Fact]
public void GetVirtualPathWithMultiSegmentParamsOnNeitherEndDoesNotMatch2()
{
RunTest(
"language/a{lang}-{region}a",
null,
new RouteValueDictionary(new { lang = "en", region = "US" }),
new RouteValueDictionary(new { lang = "xx", region = "" }),
null);
}
[Fact]
public void GetVirtualPathWithSimpleMultiSegmentParamsOnBothEndsMatches()
{
RunTest(
"language/{lang}",
null,
new RouteValueDictionary(new { lang = "en" }),
new RouteValueDictionary(new { lang = "xx" }),
"language/xx");
}
[Fact]
public void GetVirtualPathWithSimpleMultiSegmentParamsOnLeftEndMatches()
{
RunTest(
"language/{lang}-",
null,
new RouteValueDictionary(new { lang = "en" }),
new RouteValueDictionary(new { lang = "xx" }),
"language/xx-");
}
[Fact]
public void GetVirtualPathWithSimpleMultiSegmentParamsOnRightEndMatches()
{
RunTest(
"language/a{lang}",
null,
new RouteValueDictionary(new { lang = "en" }),
new RouteValueDictionary(new { lang = "xx" }),
"language/axx");
}
[Fact]
public void GetVirtualPathWithSimpleMultiSegmentParamsOnNeitherEndMatches()
{
RunTest(
"language/a{lang}a",
null,
new RouteValueDictionary(new { lang = "en" }),
new RouteValueDictionary(new { lang = "xx" }),
"language/axxa");
}
[Fact]
public void GetVirtualPathWithMultiSegmentStandardMvcRouteMatches()
{
RunTest(
"{controller}.mvc/{action}/{id}",
new RouteValueDictionary(new { action = "Index", id = (string)null }),
new RouteValueDictionary(new { controller = "home", action = "list", id = (string)null }),
new RouteValueDictionary(new { controller = "products" }),
"products.mvc");
}
[Fact]
public void GetVirtualPathWithMultiSegmentParamsOnBothEndsWithDefaultValuesMatches()
{
RunTest(
"language/{lang}-{region}",
new RouteValueDictionary(new { lang = "xx", region = "yy" }),
new RouteValueDictionary(new { lang = "en", region = "US" }),
new RouteValueDictionary(new { lang = "zz" }),
"language/zz-yy");
}
[Fact]
public void GetUrlWithDefaultValue()
{
// URL should be found but excluding the 'id' parameter, which has only a default value.
RunTest(
"{controller}/{action}/{id}",
new RouteValueDictionary(new { id = "defaultid" }),
new RouteValueDictionary(new { controller = "home", action = "oldaction" }),
new RouteValueDictionary(new { action = "newaction" }),
"home/newaction");
}
[Fact]
public void GetVirtualPathWithEmptyStringRequiredValueReturnsNull()
{
RunTest(
"foo/{controller}",
null,
new RouteValueDictionary(new { }),
new RouteValueDictionary(new { controller = "" }),
null);
}
[Fact]
public void GetVirtualPathWithNullRequiredValueReturnsNull()
{
RunTest(
"foo/{controller}",
null,
new RouteValueDictionary(new { }),
new RouteValueDictionary(new { controller = (string)null }),
null);
}
[Fact]
public void GetVirtualPathWithRequiredValueReturnsPath()
{
RunTest(
"foo/{controller}",
null,
new RouteValueDictionary(new { }),
new RouteValueDictionary(new { controller = "home" }),
"foo/home");
}
[Fact]
public void GetUrlWithNullDefaultValue()
{
// URL should be found but excluding the 'id' parameter, which has only a default value.
RunTest(
"{controller}/{action}/{id}",
new RouteValueDictionary(new { id = (string)null }),
new RouteValueDictionary(new { controller = "home", action = "oldaction", id = (string)null }),
new RouteValueDictionary(new { action = "newaction" }),
"home/newaction");
}
[Fact]
public void GetVirtualPathCanFillInSeparatedParametersWithDefaultValues()
{
RunTest(
"{controller}/{language}-{locale}",
new RouteValueDictionary(new { language = "en", locale = "US" }),
new RouteValueDictionary(),
new RouteValueDictionary(new { controller = "Orders" }),
"Orders/en-US");
}
[Fact]
public void GetVirtualPathWithUnusedNullValueShouldGenerateUrlAndIgnoreNullValue()
{
RunTest(
"{controller}.mvc/{action}/{id}",
new RouteValueDictionary(new { action = "Index", id = "" }),
new RouteValueDictionary(new { controller = "Home", action = "Index", id = "" }),
new RouteValueDictionary(new { controller = "Home", action = "TestAction", id = "1", format = (string)null }),
"Home.mvc/TestAction/1");
}
[Fact]
public void GetUrlWithMissingValuesDoesntMatch()
{
RunTest(
"{controller}/{action}/{id}",
null,
new { controller = "home", action = "oldaction" },
new { action = "newaction" },
null);
}
[Fact]
public void GetUrlWithEmptyRequiredValuesReturnsNull()
{
RunTest(
"{p1}/{p2}/{p3}",
null,
new { p1 = "v1", },
new { p2 = "", p3 = "" },
null);
}
[Fact]
public void GetUrlWithEmptyOptionalValuesReturnsShortUrl()
{
RunTest(
"{p1}/{p2}/{p3}",
new { p2 = "d2", p3 = "d3" },
new { p1 = "v1", },
new { p2 = "", p3 = "" },
"v1");
}
[Fact]
public void GetUrlShouldIgnoreValuesAfterChangedParameter()
{
RunTest(
"{controller}/{action}/{id}",
new { action = "Index", id = (string)null },
new { controller = "orig", action = "init", id = "123" },
new { action = "new", },
"orig/new");
}
[Fact]
public void GetUrlWithNullForMiddleParameterIgnoresRemainingParameters()
{
RunTest(
"UrlGeneration1/{controller}.mvc/{action}/{category}/{year}/{occasion}/{SafeParam}",
new { year = 1995, occasion = "Christmas", action = "Play", SafeParam = "SafeParamValue" },
new { controller = "UrlRouting", action = "Play", category = "Photos", year = "2008", occasion = "Easter", SafeParam = "SafeParamValue" },
new { year = (string)null, occasion = "Hola" },
"UrlGeneration1/UrlRouting.mvc/Play/Photos/1995/Hola");
}
[Fact]
public void GetUrlWithEmptyStringForMiddleParameterIgnoresRemainingParameters()
{
var ambientValues = new RouteValueDictionary();
ambientValues.Add("controller", "UrlRouting");
ambientValues.Add("action", "Play");
ambientValues.Add("category", "Photos");
ambientValues.Add("year", "2008");
ambientValues.Add("occasion", "Easter");
ambientValues.Add("SafeParam", "SafeParamValue");
var values = new RouteValueDictionary();
values.Add("year", String.Empty);
values.Add("occasion", "Hola");
RunTest(
"UrlGeneration1/{controller}.mvc/{action}/{category}/{year}/{occasion}/{SafeParam}",
new RouteValueDictionary(new { year = 1995, occasion = "Christmas", action = "Play", SafeParam = "SafeParamValue" }),
ambientValues,
values,
"UrlGeneration1/UrlRouting.mvc/Play/Photos/1995/Hola");
}
[Fact]
public void GetUrlWithEmptyStringForMiddleParameterShouldUseDefaultValue()
{
var ambientValues = new RouteValueDictionary();
ambientValues.Add("Controller", "Test");
ambientValues.Add("Action", "Fallback");
ambientValues.Add("param1", "fallback1");
ambientValues.Add("param2", "fallback2");
ambientValues.Add("param3", "fallback3");
var values = new RouteValueDictionary();
values.Add("controller", "subtest");
values.Add("param1", "b");
RunTest(
"{controller}.mvc/{action}/{param1}",
new RouteValueDictionary(new { action = "Default" }),
ambientValues,
values,
"subtest.mvc/Default/b");
}
[Fact]
public void GetUrlVerifyEncoding()
{
var values = new RouteValueDictionary();
values.Add("controller", "#;?:@&=+$,");
values.Add("action", "showcategory");
values.Add("id", 123);
values.Add("so?rt", "de?sc");
values.Add("maxPrice", 100);
RunTest(
"{controller}.mvc/{action}/{id}",
new RouteValueDictionary(new { controller = "Home" }),
new RouteValueDictionary(new { controller = "home", action = "Index", id = (string)null }),
values,
"%23%3b%3f%3a%40%26%3d%2b%24%2c.mvc/showcategory/123?so%3Frt=de%3Fsc&maxPrice=100");
}
[Fact]
public void GetUrlGeneratesQueryStringForNewValuesAndEscapesQueryString()
{
var values = new RouteValueDictionary(new { controller = "products", action = "showcategory", id = 123, maxPrice = 100 });
values.Add("so?rt", "de?sc");
RunTest(
"{controller}.mvc/{action}/{id}",
new RouteValueDictionary(new { controller = "Home" }),
new RouteValueDictionary(new { controller = "home", action = "Index", id = (string)null }),
values,
"products.mvc/showcategory/123?so%3Frt=de%3Fsc&maxPrice=100");
}
[Fact]
public void GetUrlGeneratesQueryStringForNewValuesButIgnoresNewValuesThatMatchDefaults()
{
RunTest(
"{controller}.mvc/{action}/{id}",
new RouteValueDictionary(new { controller = "Home", Custom = "customValue" }),
new RouteValueDictionary(new { controller = "Home", action = "Index", id = (string)null }),
new RouteValueDictionary(new { controller = "products", action = "showcategory", id = 123, sort = "desc", maxPrice = 100, custom = "customValue" }),
"products.mvc/showcategory/123?sort=desc&maxPrice=100");
}
[Fact]
public void GetVirtualPathEncodesParametersAndLiterals()
{
RunTest(
"bl%og/{controller}/he llo/{action}",
null,
new RouteValueDictionary(new { controller = "ho%me", action = "li st" }),
new RouteValueDictionary(),
"bl%25og/ho%25me/he%20llo/li%20st");
}
[Fact]
public void GetUrlWithCatchAllWithValue()
{
RunTest(
"{p1}/{*p2}",
new RouteValueDictionary(new { id = "defaultid" }),
new RouteValueDictionary(new { p1 = "v1" }),
new RouteValueDictionary(new { p2 = "v2a/v2b" }),
"v1/v2a/v2b");
}
[Fact]
public void GetUrlWithCatchAllWithEmptyValue()
{
RunTest(
"{p1}/{*p2}",
new RouteValueDictionary(new { id = "defaultid" }),
new RouteValueDictionary(new { p1 = "v1" }),
new RouteValueDictionary(new { p2 = "" }),
"v1");
}
[Fact]
public void GetUrlWithCatchAllWithNullValue()
{
RunTest(
"{p1}/{*p2}",
new RouteValueDictionary(new { id = "defaultid" }),
new RouteValueDictionary(new { p1 = "v1" }),
new RouteValueDictionary(new { p2 = (string)null }),
"v1");
}
#if ROUTE_COLLECTION
[Fact]
public void GetUrlShouldValidateOnlyAcceptedParametersAndUserDefaultValuesForInvalidatedParameters()
{
// Arrange
var rd = CreateRouteData();
rd.Values.Add("Controller", "UrlRouting");
rd.Values.Add("Name", "MissmatchedValidateParams");
rd.Values.Add("action", "MissmatchedValidateParameters2");
rd.Values.Add("ValidateParam1", "special1");
rd.Values.Add("ValidateParam2", "special2");
IRouteCollection rc = new DefaultRouteCollection();
rc.Add(CreateRoute(
"UrlConstraints/Validation.mvc/Input5/{action}/{ValidateParam1}/{ValidateParam2}",
new RouteValueDictionary(new { Controller = "UrlRouting", Name = "MissmatchedValidateParams", ValidateParam2 = "valid" }),
new RouteValueDictionary(new { ValidateParam1 = "valid.*", ValidateParam2 = "valid.*" })));
rc.Add(CreateRoute(
"UrlConstraints/Validation.mvc/Input5/{action}/{ValidateParam1}/{ValidateParam2}",
new RouteValueDictionary(new { Controller = "UrlRouting", Name = "MissmatchedValidateParams" }),
new RouteValueDictionary(new { ValidateParam1 = "special.*", ValidateParam2 = "special.*" })));
var values = CreateRouteValueDictionary();
values.Add("Name", "MissmatchedValidateParams");
values.Add("ValidateParam1", "valid1");
// Act
var vpd = rc.GetVirtualPath(GetHttpContext("/app1", "", ""), values);
// Assert
Assert.NotNull(vpd);
Assert.Equal<string>("/app1/UrlConstraints/Validation.mvc/Input5/MissmatchedValidateParameters2/valid1", vpd.VirtualPath);
}
[Fact]
public void GetUrlWithRouteThatHasExtensionWithSubsequentDefaultValueIncludesExtensionButNotDefaultValue()
{
// Arrange
var rd = CreateRouteData();
rd.Values.Add("controller", "Bank");
rd.Values.Add("action", "MakeDeposit");
rd.Values.Add("accountId", "7770");
IRouteCollection rc = new DefaultRouteCollection();
rc.Add(CreateRoute(
"{controller}.mvc/Deposit/{accountId}",
new RouteValueDictionary(new { Action = "DepositView" })));
// Note: This route was in the original bug, but it turns out that this behavior is incorrect. With the
// recent fix to Route (in this changelist) this route would have been selected since we have values for
// all three required parameters.
//rc.Add(new Route {
// Url = "{controller}.mvc/{action}/{accountId}",
// RouteHandler = new DummyRouteHandler()
//});
// This route should be chosen because the requested action is List. Since the default value of the action
// is List then the Action should not be in the URL. However, the file extension should be included since
// it is considered "safe."
rc.Add(CreateRoute(
"{controller}.mvc/{action}",
new RouteValueDictionary(new { Action = "List" })));
var values = CreateRouteValueDictionary();
values.Add("Action", "List");
// Act
var vpd = rc.GetVirtualPath(GetHttpContext("/app1", "", ""), values);
// Assert
Assert.NotNull(vpd);
Assert.Equal<string>("/app1/Bank.mvc", vpd.VirtualPath);
}
[Fact]
public void GetUrlWithRouteThatHasDifferentControllerCaseShouldStillMatch()
{
// Arrange
var rd = CreateRouteData();
rd.Values.Add("controller", "Bar");
rd.Values.Add("action", "bbb");
rd.Values.Add("id", null);
IRouteCollection rc = new DefaultRouteCollection();
rc.Add(CreateRoute("PrettyFooUrl", new RouteValueDictionary(new { controller = "Foo", action = "aaa", id = (string)null })));
rc.Add(CreateRoute("PrettyBarUrl", new RouteValueDictionary(new { controller = "Bar", action = "bbb", id = (string)null })));
rc.Add(CreateRoute("{controller}/{action}/{id}", new RouteValueDictionary(new { action = "Index", id = (string)null })));
var values = CreateRouteValueDictionary();
values.Add("Action", "aaa");
values.Add("Controller", "foo");
// Act
var vpd = rc.GetVirtualPath(GetHttpContext("/app1", "", ""), values);
// Assert
Assert.NotNull(vpd);
Assert.Equal<string>("/app1/PrettyFooUrl", vpd.VirtualPath);
}
[Fact]
public void GetUrlWithNoChangedValuesShouldProduceSameUrl()
{
// Arrange
var rd = CreateRouteData();
rd.Values.Add("controller", "Home");
rd.Values.Add("action", "Index");
rd.Values.Add("id", null);
IRouteCollection rc = new DefaultRouteCollection();
rc.Add(CreateRoute("{controller}.mvc/{action}/{id}", new RouteValueDictionary(new { action = "Index", id = (string)null })));
rc.Add(CreateRoute("{controller}/{action}/{id}", new RouteValueDictionary(new { action = "Index", id = (string)null })));
var values = CreateRouteValueDictionary();
values.Add("Action", "Index");
// Act
var vpd = rc.GetVirtualPath(GetHttpContext("/app1", "", ""), values);
// Assert
Assert.NotNull(vpd);
Assert.Equal<string>("/app1/Home.mvc", vpd.VirtualPath);
}
[Fact]
public void GetUrlAppliesConstraintsRulesToChooseRoute()
{
// Arrange
var rd = CreateRouteData();
rd.Values.Add("controller", "Home");
rd.Values.Add("action", "Index");
rd.Values.Add("id", null);
IRouteCollection rc = new DefaultRouteCollection();
rc.Add(CreateRoute(
"foo.mvc/{action}",
new RouteValueDictionary(new { controller = "Home" }),
new RouteValueDictionary(new { controller = "Home", action = "Contact", httpMethod = CreateHttpMethodConstraint("get") })));
rc.Add(CreateRoute(
"{controller}.mvc/{action}",
new RouteValueDictionary(new { action = "Index" }),
new RouteValueDictionary(new { controller = "Home", action = "(Index|About)", httpMethod = CreateHttpMethodConstraint("post") })));
var values = CreateRouteValueDictionary();
values.Add("Action", "Index");
// Act
var vpd = rc.GetVirtualPath(GetHttpContext("/app1", "", ""), values);
// Assert
Assert.NotNull(vpd);
Assert.Equal<string>("/app1/Home.mvc", vpd.VirtualPath);
}
[Fact]
public void GetUrlWithValuesThatAreCompletelyDifferentFromTheCurrentRoute()
{
// Arrange
HttpContext context = GetHttpContext("/app", null, null);
IRouteCollection rt = new DefaultRouteCollection();
rt.Add(CreateRoute("date/{y}/{m}/{d}", null));
rt.Add(CreateRoute("{controller}/{action}/{id}", null));
var rd = CreateRouteData();
rd.Values.Add("controller", "home");
rd.Values.Add("action", "dostuff");
var values = CreateRouteValueDictionary();
values.Add("y", "2007");
values.Add("m", "08");
values.Add("d", "12");
// Act
var vpd = rt.GetVirtualPath(context, values);
// Assert
Assert.NotNull(vpd);
Assert.Equal<string>("/app/date/2007/08/12", vpd.VirtualPath);
}
[Fact]
public void GetUrlWithValuesThatAreCompletelyDifferentFromTheCurrentRouteAsSecondRoute()
{
// Arrange
HttpContext context = GetHttpContext("/app", null, null);
IRouteCollection rt = new DefaultRouteCollection();
rt.Add(CreateRoute("{controller}/{action}/{id}"));
rt.Add(CreateRoute("date/{y}/{m}/{d}"));
var rd = CreateRouteData();
rd.Values.Add("controller", "home");
rd.Values.Add("action", "dostuff");
var values = CreateRouteValueDictionary();
values.Add("y", "2007");
values.Add("m", "08");
values.Add("d", "12");
// Act
var vpd = rt.GetVirtualPath(context, values);
// Assert
Assert.NotNull(vpd);
Assert.Equal<string>("/app/date/2007/08/12", vpd.VirtualPath);
}
[Fact]
public void GetVirtualPathUsesCurrentValuesNotInRouteToMatch()
{
// Arrange
HttpContext context = GetHttpContext("/app", null, null);
TemplateRoute r1 = CreateRoute(
"ParameterMatching.mvc/{Action}/{product}",
new RouteValueDictionary(new { Controller = "ParameterMatching", product = (string)null }),
null);
TemplateRoute r2 = CreateRoute(
"{controller}.mvc/{action}",
new RouteValueDictionary(new { Action = "List" }),
new RouteValueDictionary(new { Controller = "Action|Bank|Overridden|DerivedFromAction|OverrideInvokeActionAndExecute|InvalidControllerName|Store|HtmlHelpers|(T|t)est|UrlHelpers|Custom|Parent|Child|TempData|ViewFactory|LocatingViews|AccessingDataInViews|ViewOverrides|ViewMasterPage|InlineCompileError|CustomView" }),
null);
var rd = CreateRouteData();
rd.Values.Add("controller", "Bank");
rd.Values.Add("Action", "List");
var valuesDictionary = CreateRouteValueDictionary();
valuesDictionary.Add("action", "AttemptLogin");
// Act for first route
var vpd = r1.GetVirtualPath(context, valuesDictionary);
// Assert
Assert.NotNull(vpd);
Assert.Equal<string>("ParameterMatching.mvc/AttemptLogin", vpd.VirtualPath);
// Act for second route
vpd = r2.GetVirtualPath(context, valuesDictionary);
// Assert
Assert.NotNull(vpd);
Assert.Equal<string>("Bank.mvc/AttemptLogin", vpd.VirtualPath);
}
#endif
#if DATA_TOKENS
[Fact]
public void GetVirtualPathWithDataTokensCopiesThemFromRouteToVirtualPathData()
{
// Arrange
HttpContext context = GetHttpContext("/app", null, null);
TemplateRoute r = CreateRoute("{controller}/{action}", null, null, new RouteValueDictionary(new { foo = "bar", qux = "quux" }));
var rd = CreateRouteData();
rd.Values.Add("controller", "home");
rd.Values.Add("action", "index");
var valuesDictionary = CreateRouteValueDictionary();
// Act
var vpd = r.GetVirtualPath(context, valuesDictionary);
// Assert
Assert.NotNull(vpd);
Assert.Equal<string>("home/index", vpd.VirtualPath);
Assert.Equal(r, vpd.Route);
Assert.Equal<int>(2, vpd.DataTokens.Count);
Assert.Equal("bar", vpd.DataTokens["foo"]);
Assert.Equal("quux", vpd.DataTokens["qux"]);
}
#endif
#if ROUTE_FORMAT_HELPER
[Fact]
public void UrlWithEscapedOpenCloseBraces()
{
RouteFormatHelper("foo/{{p1}}", "foo/{p1}");
}
[Fact]
public void UrlWithEscapedOpenBraceAtTheEnd()
{
RouteFormatHelper("bar{{", "bar{");
}
[Fact]
public void UrlWithEscapedOpenBraceAtTheBeginning()
{
RouteFormatHelper("{{bar", "{bar");
}
[Fact]
public void UrlWithRepeatedEscapedOpenBrace()
{
RouteFormatHelper("foo{{{{bar", "foo{{bar");
}
[Fact]
public void UrlWithEscapedCloseBraceAtTheEnd()
{
RouteFormatHelper("bar}}", "bar}");
}
[Fact]
public void UrlWithEscapedCloseBraceAtTheBeginning()
{
RouteFormatHelper("}}bar", "}bar");
}
[Fact]
public void UrlWithRepeatedEscapedCloseBrace()
{
RouteFormatHelper("foo}}}}bar", "foo}}bar");
}
private static void RouteFormatHelper(string routeUrl, string requestUrl)
{
var defaults = new RouteValueDictionary(new { route = "matched" });
var r = CreateRoute(routeUrl, defaults, null);
GetRouteDataHelper(r, requestUrl, defaults);
GetVirtualPathHelper(r, new RouteValueDictionary(), null, Uri.EscapeUriString(requestUrl));
}
#endif
#if CONSTRAINTS
[Fact]
public void GetVirtualPathWithNonParameterConstraintReturnsUrlWithoutQueryString()
{
// DevDiv Bugs 199612: UrlRouting: UrlGeneration should not append parameter to query string if it is a Constraint parameter and not a Url parameter
RunTest(
"{Controller}.mvc/{action}/{end}",
null,
new RouteValueDictionary(new { foo = CreateHttpMethodConstraint("GET") }),
new RouteValueDictionary(),
new RouteValueDictionary(new { controller = "Orders", action = "Index", end = "end", foo = "GET" }),
"Orders.mvc/Index/end");
}
[Fact]
public void GetVirtualPathWithValidCustomConstraints()
{
// Arrange
HttpContext context = GetHttpContext("/app", null, null);
CustomConstraintTemplateRoute r = new CustomConstraintTemplateRoute("{controller}/{action}", null, new RouteValueDictionary(new { action = 5 }));
var rd = CreateRouteData();
rd.Values.Add("controller", "home");
rd.Values.Add("action", "index");
var valuesDictionary = CreateRouteValueDictionary();
// Act
var vpd = r.GetVirtualPath(context, valuesDictionary);
// Assert
Assert.NotNull(vpd);
Assert.Equal<string>("home/index", vpd.VirtualPath);
Assert.Equal(r, vpd.Route);
Assert.NotNull(r.ConstraintData);
Assert.Equal(5, r.ConstraintData.Constraint);
Assert.Equal("action", r.ConstraintData.ParameterName);
Assert.Equal("index", r.ConstraintData.ParameterValue);
}
[Fact]
public void GetVirtualPathWithInvalidCustomConstraints()
{
// Arrange
HttpContext context = GetHttpContext("/app", null, null);
CustomConstraintTemplateRoute r = new CustomConstraintTemplateRoute("{controller}/{action}", null, new RouteValueDictionary(new { action = 5 }));
var rd = CreateRouteData();
rd.Values.Add("controller", "home");
rd.Values.Add("action", "list");
var valuesDictionary = CreateRouteValueDictionary();
// Act
var vpd = r.GetVirtualPath(context, valuesDictionary);
// Assert
Assert.Null(vpd);
Assert.NotNull(r.ConstraintData);
Assert.Equal(5, r.ConstraintData.Constraint);
Assert.Equal("action", r.ConstraintData.ParameterName);
Assert.Equal("list", r.ConstraintData.ParameterValue);
}
#endif
private static void RunTest(
string template,
IReadOnlyDictionary<string, object> defaults,
IDictionary<string, object> ambientValues,
IDictionary<string, object> values,
string expected)
{
// Arrange
var binder = new TemplateBinder(TemplateParser.Parse(template), defaults);
// Act & Assert
var result = binder.GetValues(ambientValues, values);
if (result == null)
{
if (expected == null)
{
return;
}
else
{
Assert.NotNull(result);
}
}
var boundTemplate = binder.BindValues(result.AcceptedValues);
if (expected == null)
{
Assert.Null(boundTemplate);
}
else
{
Assert.NotNull(boundTemplate);
// We want to chop off the query string and compare that using an unordered comparison
var expectedParts = new PathAndQuery(expected);
var actualParts = new PathAndQuery(boundTemplate);
Assert.Equal(expectedParts.Path, actualParts.Path);
if (expectedParts.Parameters == null)
{
Assert.Null(actualParts.Parameters);
}
else
{
Assert.Equal(expectedParts.Parameters.Count, actualParts.Parameters.Count);
foreach (var kvp in expectedParts.Parameters)
{
string value;
Assert.True(actualParts.Parameters.TryGetValue(kvp.Key, out value));
Assert.Equal(kvp.Value, value);
}
}
}
}
private static void RunTest(
string template,
object defaults,
object ambientValues,
object values,
string expected)
{
RunTest(
template,
new RouteValueDictionary(defaults),
new RouteValueDictionary(ambientValues),
new RouteValueDictionary(values),
expected);
}
[Theory]
[InlineData(null, null, true)]
[InlineData("blog", null, false)]
[InlineData(null, "store", false)]
[InlineData("Cool", "cool", true)]
[InlineData("Co0l", "cool", false)]
public void RoutePartsEqualTest(object left, object right, bool expected)
{
// Arrange & Act & Assert
if (expected)
{
Assert.True(TemplateBinder.RoutePartsEqual(left, right));
}
else
{
Assert.False(TemplateBinder.RoutePartsEqual(left, right));
}
}
private static IInlineConstraintResolver GetInlineConstraintResolver()
{
var services = new ServiceCollection().AddOptions();
var serviceProvider = services.BuildServiceProvider();
var accessor = serviceProvider.GetRequiredService<IOptions<RouteOptions>>();
return new DefaultInlineConstraintResolver(accessor);
}
private class PathAndQuery
{
public PathAndQuery(string uri)
{
var queryIndex = uri.IndexOf("?", StringComparison.Ordinal);
if (queryIndex == -1)
{
Path = uri;
}
else
{
Path = uri.Substring(0, queryIndex);
var query = uri.Substring(queryIndex + 1);
Parameters =
query
.Split(new char[] { '&' }, StringSplitOptions.None)
.Select(s => s.Split(new char[] { '=' }, StringSplitOptions.None))
.ToDictionary(pair => pair[0], pair => pair[1]);
}
}
public string Path { get; private set; }
public Dictionary<string, string> Parameters { get; private set; }
}
}
}
#endif
| 38.511915 | 332 | 0.497856 | [
"Apache-2.0"
] | icyjiang/Microsoft.AspNet.Routing | test/Microsoft.AspNet.Routing.Tests/Template/TemplateBinderTests.cs | 46,869 | C# |
using System;
using Melanchall.DryWetMidi.Common;
namespace Melanchall.DryWetMidi.Tools
{
internal sealed class MinVelocityMerger : VelocityMerger
{
#region Overrides
public override void Merge(SevenBitNumber velocity)
{
_velocity = (SevenBitNumber)Math.Min(_velocity, velocity);
}
#endregion
}
}
| 20.277778 | 70 | 0.663014 | [
"MIT"
] | Amalgam-Cloud/drywetmidi | DryWetMidi/Tools/NotesMerger/VelocityMergers/MinVelocityMerger.cs | 367 | C# |
using SimpleJournal.Controls;
using SimpleJournal.Data;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
namespace SimpleJournal.Templates
{
/// <summary>
/// Interaktionslogik für Chequered.xaml
/// </summary>
public partial class Chequered : UserControl, IPaper
{
public Chequered()
{
InitializeComponent();
// Load the correct drawing brush for the canvas
if (Settings.Instance.UseOldChequeredPattern)
{
if (FindResource("OldChequeredBrush") is DrawingBrush drawingBrush)
canvas.Background = drawingBrush;
}
else
{
if (FindResource("CurrentChequeredBrush") is DrawingBrush drawingBrush)
canvas.Background = drawingBrush;
}
}
public Format Format => Format.A4;
public PaperType Type => PaperType.Chequeued;
public DrawingCanvas Canvas => canvas;
public PageSplitter Border { get; set; }
public void SetDebug(bool state = true)
{
Canvas.SetDebug(state);
}
}
}
| 26.644444 | 87 | 0.588824 | [
"MIT"
] | andyld97/SimpleJournal | SimpleJournal/Templates/Chequered.xaml.cs | 1,202 | C# |
using Game.Logic.Phy.Object;
using System;
namespace Game.Logic.PetEffects
{
public class CASE1214 : BasePetEffect
{
private int int_0;
private int int_1;
private int int_2;
private int int_3;
private int int_4;
private int int_5;
private int int_6;
public CASE1214(int count, int probability, int type, int skillId, int delay, string elementID) : base(ePetEffectType.CASE1214, elementID)
{
this.int_1 = count;
this.int_4 = count;
this.int_2 = ((probability == -1) ? 10000 : probability);
this.int_0 = type;
this.int_3 = delay;
this.int_5 = skillId;
}
public override bool Start(Living living)
{
CASE1214 pE = living.PetEffectList.GetOfType(ePetEffectType.CASE1214) as CASE1214;
if (pE != null)
{
pE.int_2 = ((this.int_2 > pE.int_2) ? this.int_2 : pE.int_2);
return true;
}
return base.Start(living);
}
protected override void OnAttachedToPlayer(Player player)
{
player.BeginNextTurn += new LivingEventHandle(this.player_beginNextTurn);
}
protected override void OnRemovedFromPlayer(Player player)
{
player.BeginNextTurn -= new LivingEventHandle(this.player_beginNextTurn);
}
public void player_beginNextTurn(Living living)
{
if (this.int_6 == 0)
{
this.int_6 = 100;
living.BaseGuard += (double)this.int_6;
Console.WriteLine("+100 diem ho giap");
}
}
}
}
| 33 | 146 | 0.556527 | [
"MIT"
] | HuyTruong19x/DDTank4.1 | Source Server/Game.Logic/PetEffects/CASE1214.cs | 1,718 | C# |
using Database.Entities;
using SqlKata.Execution;
namespace Database.Repositories;
public class ComicsRepository : IComicsRepository
{
private readonly QueryFactory _db;
public ComicsRepository(QueryFactory db)
{
_db = db;
}
public Task<Comics> GetById(Guid id)
{
return _db.Query("Comics").Where("Id", id).FirstOrDefaultAsync<Comics>();
}
public Task<IEnumerable<Comics>> GetAll()
{
return _db.Query("Comics").GetAsync<Comics>();
}
public async Task<Guid> UpdateById(Guid id, Comics comics)
{
await _db.Query("Comics").Where("Id", id).UpdateAsync(comics);
return id;
}
public async Task<Guid> Create(Comics comics)
{
comics.Id = Guid.NewGuid();
await _db.Query("Comics").InsertAsync(comics);
return comics.Id;
}
public Task DeleteById(Guid id)
{
return _db.Query("Comics").Where("Id", id).DeleteAsync();
}
} | 22.44186 | 81 | 0.630052 | [
"MIT"
] | artem-galas/ComicsShop.CSharp | Database/Repositories/ComicsRepository.cs | 965 | C# |
using AndcultureCode.CSharp.Core.Interfaces.Conductors;
namespace AndcultureCode.CSharp.Conductors
{
/// <summary>
/// Conductor class
/// </summary>
public class Conductor : IConductor
{
}
}
| 17.384615 | 55 | 0.646018 | [
"Apache-2.0"
] | AndcultureCode/AndcultureCode.CSharp | src/Conductors/Conductor.cs | 226 | C# |
using UnityEngine;
using System.Collections.Generic;
namespace com.spacepuppy.Anim.Legacy
{
/// <summary>
/// It is usually more convenient to break Animation scripts into several parts for the various tasks they handle. Each script should inherit from this class as it handles a lot of boilerplate.
/// </summary>
public abstract class SPLegacyAnimator : SPComponent, ISPLegacyAnimator
{
#region Fields
[SerializeField()]
[DefaultFromSelf(Relativity = EntityRelativity.Entity)]
private SPLegacyAnimController _controller;
[System.NonSerialized]
private bool _initialized;
#endregion
#region CONSTRUCTOR
protected override void Start()
{
var entity = SPEntity.Pool.GetFromSource<SPEntity>(this);
if (!_initialized && entity != null && entity.IsAwake)
{
_initialized = true;
this.Init(entity, _controller);
}
base.Start();
}
public void Configure(SPLegacyAnimController controller)
{
if (_initialized) throw new System.InvalidOperationException("Can not change the Controller of an SPAnimator once it's been initialized.");
_controller = controller;
}
protected abstract void Init(SPEntity entity, SPLegacyAnimController controller);
#endregion
#region Properties
public SPLegacyAnimController Controller
{
get
{
return _controller;
}
}
public bool IsInitialized
{
get { return _initialized; }
}
#endregion
}
}
| 25.485294 | 197 | 0.601847 | [
"MIT"
] | lordofduct/spacepuppy-unity-framework-4.0 | Framework/com.spacepuppy.anim/Runtime/src/Anim/Legacy/SPLegacyAnimator.cs | 1,735 | C# |
using System;
using Arnible.Assertions;
namespace Arnible.MathModeling.Geometry
{
public static class GetDirectionDerivativeRatiosExtensions
{
/// <summary>
/// Calculate derivative ratios by moving along the array vector
/// </summary>
public static void GetDirectionDerivativeRatios(
in this ReadOnlySpan<Number> direction,
in Span<Number> result)
{
direction.Length.AssertIsGreaterEqualThan(2);
direction.Length.AssertIsEqualTo(result.Length);
Span<Number> buffer = stackalloc Number[result.Length - 1];
direction
.ToSpherical(in buffer)
.Angles
.GetCartesianAxisViewsRatios(in result);
}
/// <summary>
/// Calculate derivative ratios by moving along the array vector
/// </summary>
public static void GetDirectionDerivativeRatios(
in this Span<Number> direction,
in Span<Number> result)
{
GetDirectionDerivativeRatios((ReadOnlySpan<Number>)direction, in result);
}
}
} | 29.057143 | 79 | 0.685349 | [
"Apache-2.0"
] | tomaszbiegacz/Arnible.MathModeling | Arnible.MathModeling/Geometry/GetDirectionDerivativeRatiosExtensions.cs | 1,017 | C# |
using System;
using NLog.Config;
using NLog.Layouts;
namespace NLog.Extensions.AzureStorage
{
[NLogConfigurationItem]
public class DynEntityProperty
{
[RequiredParameter]
public string Name { get; set; }
[RequiredParameter]
public Layout Layout { get; set; }
public override string ToString()
{
return $"Name: {Name}, Layout: {Layout}";
}
}
}
| 19.590909 | 53 | 0.603248 | [
"MIT"
] | marchers/NLog.Extensions.AzureStorage | src/NLog.Extensions.AzureStorage/DynEntityProperty.cs | 433 | C# |
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
namespace WebApplication4
{
public class Program
{
public static void Main(string[] args)
{
WebHost.
CreateDefaultBuilder(args).
UseStartup<Startup>().
Build().
Run();
}
}
}
| 19.555556 | 46 | 0.519886 | [
"MIT"
] | ShloEmi/sandbox.ASP.NetCore | WebApplication4/WebApplication4/Program.cs | 354 | C# |
using System;
using System.Collections.Generic;
using System.Text;
namespace Surging.Core.Protocol.Mqtt.Internal.Messages
{
public class MqttWillMessage
{
public string Topic{ get; set; }
public string WillMessage { get; set; }
public bool WillRetain { get; set; }
public int Qos { get; set; }
}
}
| 18.315789 | 54 | 0.646552 | [
"MIT"
] | 857593381/surging | src/Surging.Core/Surging.Core.Protocol.Mqtt/Internal/Messages/MqttWillMessage.cs | 350 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MakeBigger : MonoBehaviour {
public Transform target; // Gracz
public float distance = 5f;
public Vector3 default_size = new Vector3( 1f, 1f, 1f );
public Vector3 size_speed = new Vector3( 1f, 1f, 1f );
/// <summary> Funkcja Update </summary>
void Update () {
ChangeSizeBasedOnCamera();
}
/// <summary> Funkcja powiększająca lub pomniejszająca obiekt na bazie odległości </summary>
void ChangeSizeBasedOnCamera() {
// Odległość pomiędzy celem a balonem
float dist = Vector3.Distance(target.position, transform.position);
// Jeśli odległość większa niż "distance" zmień rozmiar balona na początkowy "default_size"
if ( dist > distance ){
if ( transform.localScale.x < default_size.x || transform.localScale.y < default_size.y || transform.localScale.z < default_size.z ) {
transform.localScale = default_size;
return;
}
transform.localScale -= (size_speed * Time.deltaTime);
// Jeśli odległość jest mniejsza lub równa dystansowi
} else if ( dist <= distance ){
transform.localScale += (size_speed * Time.deltaTime);
}
}
}
| 37.371429 | 148 | 0.646789 | [
"MIT"
] | Adrixop95/deathly_balloons_vr | src/smiertelne_balony_unity/Assets/Scripts/Ballons/MakeBigger.cs | 1,332 | C# |
namespace Fooidity.Management.AzureIntegration.UserStore.Encoding
{
using System;
using System.Text;
public class Base32BinaryEncodingFormatter :
IBinaryEncodingFormatter
{
const int Base32Size = 5;
const int ByteSize = 8;
const string LowerCaseChars = "abcdefghijklmnopqrstuvwxyz234567";
const string UpperCaseChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
readonly string _chars;
public Base32BinaryEncodingFormatter(bool upperCase = false)
{
_chars = upperCase ? UpperCaseChars : LowerCaseChars;
}
public Base32BinaryEncodingFormatter(string chars)
{
if (chars.Length != 32)
throw new ArgumentException("The character string must be exactly 32 characters");
_chars = chars;
}
public string Format(byte[] bytes)
{
if (bytes == null)
throw new ArgumentNullException("bytes");
if (bytes.Length == 0)
return string.Empty;
var builder = new StringBuilder(bytes.Length * ByteSize / Base32Size);
int inputIndex = 0;
int inputOffset = 0;
byte outputIndex = 0;
int outputOffset = 0;
while (inputIndex < bytes.Length)
{
int bitsAvailableInByte = Math.Min(ByteSize - inputOffset, Base32Size - outputOffset);
outputIndex <<= bitsAvailableInByte;
outputIndex |= (byte)(bytes[inputIndex] >> (ByteSize - (inputOffset + bitsAvailableInByte)));
inputOffset += bitsAvailableInByte;
if (inputOffset >= ByteSize)
{
inputIndex++;
inputOffset = 0;
}
outputOffset += bitsAvailableInByte;
if (outputOffset >= Base32Size)
{
outputIndex &= 0x1F;
builder.Append(_chars[outputIndex]);
outputOffset = 0;
}
}
if (outputOffset > 0)
{
outputIndex <<= (Base32Size - outputOffset);
outputIndex &= 0x1F;
builder.Append(_chars[outputIndex]);
}
return builder.ToString();
}
}
} | 30.320988 | 110 | 0.516694 | [
"Apache-2.0"
] | phatboyg/Fooidity | src/Fooidity.Management.AzureIntegration/UserStore/Encoding/Base32BinaryEncodingFormatter.cs | 2,458 | C# |
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO;
using Microsoft.DotNet.Tools.Test.Utilities;
using Xunit;
namespace Microsoft.DotNet.Tests.EndToEnd
{
public class GivenDotNetLinuxInstallers
{
[Fact]
public void ItHasExpectedDependencies()
{
var installerFile = Environment.GetEnvironmentVariable("SDK_INSTALLER_FILE");
if (string.IsNullOrEmpty(installerFile))
{
return;
}
var ext = Path.GetExtension(installerFile);
switch (ext)
{
case ".deb":
DebianPackageHasDependencyOnAspNetCoreStoreAndDotnetRuntime(installerFile);
return;
case ".rpm":
RpmPackageHasDependencyOnAspNetCoreStoreAndDotnetRuntime(installerFile);
return;
}
}
private void DebianPackageHasDependencyOnAspNetCoreStoreAndDotnetRuntime(string installerFile)
{
// Example output:
// $ dpkg --info dotnet-sdk-2.1.105-ubuntu-x64.deb
// new debian package, version 2.0.
// size 75660448 bytes: control archive=29107 bytes.
// 717 bytes, 11 lines control
// 123707 bytes, 1004 lines md5sums
// 1710 bytes, 28 lines * postinst #!/usr/bin/env
// Package: dotnet-sdk-2.1.104
// Version: 2.1.104-1
// Architecture: amd64
// Maintainer: Microsoft <dotnetcore@microsoft.com>
// Installed-Size: 201119
// Depends: dotnet-runtime-2.0.6, aspnetcore-store-2.0.6
// Section: devel
// Priority: standard
// Homepage: https://dotnet.github.io/core
// Description: Microsoft .NET Core SDK - 2.1.104
new TestCommand("dpkg")
.ExecuteWithCapturedOutput($"--info {installerFile}")
.Should().Pass()
.And.HaveStdOutMatching(@"Depends:.*\s?dotnet-runtime-\d+(\.\d+){2}")
.And.HaveStdOutMatching(@"Depends:.*\s?aspnetcore-store-\d+(\.\d+){2}");
}
private void RpmPackageHasDependencyOnAspNetCoreStoreAndDotnetRuntime(string installerFile)
{
// Example output:
// $ rpm -qpR dotnet-sdk-2.1.105-rhel-x64.rpm
// dotnet-runtime-2.0.7 >= 2.0.7
// aspnetcore-store-2.0.7 >= 2.0.7
// /bin/sh
// /bin/sh
// rpmlib(PayloadFilesHavePrefix) <= 4.0-1
// rpmlib(CompressedFileNames) <= 3.0.4-1
new TestCommand("rpm")
.ExecuteWithCapturedOutput($"-qpR {installerFile}")
.Should().Pass()
.And.HaveStdOutMatching(@"dotnet-runtime-\d+(\.\d+){2} >= \d+(\.\d+){2}")
.And.HaveStdOutMatching(@"aspnetcore-store-\d+(\.\d+){2} >= \d+(\.\d+){2}");
}
}
}
| 37.940476 | 102 | 0.539693 | [
"MIT"
] | 1Crazymoney/installer | test/EndToEnd/GivenDotNetLinuxInstallers.cs | 3,189 | C# |
using System;
namespace EvenFibonacciNumbers
{
partial class Euler002
{
public static void Main()
{
long limit=4000000;
long evenFibonacciSum = 2;
for(
long termN=0, term0=0,term1=2;
termN<limit;
termN = 4 * term1 + term0, term0=term1, term1=termN
)
{
evenFibonacciSum += termN;
}
Console.WriteLine(evenFibonacciSum);
}
}
}
| 22.478261 | 68 | 0.466151 | [
"MIT"
] | AnuragAnalog/project_euler | C#/euler002/euler002.cs | 517 | 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.DBforMySQL.V20180601.Inputs
{
public sealed class PrivateEndpointPropertyArgs : Pulumi.ResourceArgs
{
/// <summary>
/// Resource id of the private endpoint.
/// </summary>
[Input("id")]
public Input<string>? Id { get; set; }
public PrivateEndpointPropertyArgs()
{
}
}
}
| 26 | 81 | 0.661243 | [
"Apache-2.0"
] | polivbr/pulumi-azure-native | sdk/dotnet/DBforMySQL/V20180601/Inputs/PrivateEndpointPropertyArgs.cs | 676 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using MaterialCMS.Entities.People;
using MaterialCMS.Services;
using MaterialCMS.Website;
using MaterialCMS.Website.Binders;
using Ninject;
namespace MaterialCMS.Web.Areas.Admin.ModelBinders
{
public class EditUserModelBinder : MaterialCMSDefaultModelBinder
{
public EditUserModelBinder(IKernel kernel) : base(kernel)
{
}
protected override object CreateModel(ControllerContext controllerContext, ModelBindingContext bindingContext, Type modelType)
{
return Session.Get<User>(Convert.ToInt32(controllerContext.HttpContext.Request["Id"]));
}
public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
{
var user = base.BindModel(controllerContext, bindingContext) as User;
IEnumerable<string> roleValues = controllerContext.HttpContext.Request.Params.AllKeys.Where(s => s.StartsWith("Role-"));
foreach (var value in roleValues)
{
string s = controllerContext.HttpContext.Request[value];
var roleSelected = s.Contains("true");
var id = Convert.ToInt32(value.Split('-')[1]);
var role = Session.Get<UserRole>(id);
if (MaterialCMSApplication.Get<IRoleService>().IsOnlyAdmin(user) && role.IsAdmin)
continue;
if (roleSelected && !user.Roles.Contains(role))
{
user.Roles.Add(role);
role.Users.Add(user);
}
else if (!roleSelected && user.Roles.Contains(role))
{
user.Roles.Remove(role);
role.Users.Remove(user);
}
}
return user;
}
}
} | 35.425926 | 134 | 0.607946 | [
"MIT"
] | DucThanhNguyen/MaterialCMS | MaterialCMS.Web/Areas/Admin/ModelBinders/EditUserModelBinder.cs | 1,915 | C# |
using System.Xml;
using System.Xml.Linq;
namespace CustomRuntimeListBucketsNET6
{
internal class Door
{
private const int _wallGap = 100;
private const int _gapBetweenDoors = 100;
public string Name { private get; set; } = "";
public string Description { private get; set; } = "";
public int Width { private get; set; } = 0;
public int Height { get; set; } = 0;
public int Depth { get; set; } = 0;
public double Hinge1Position { get; set; } = 0;
public double Hinge2Position { get; set; } = 0;
public double Hinge3Position { get; set; } = 0;
public double Hinge4Position { get; set; } = 0;
public double Hinge5Position { get; set; } = 0;
public string HingeLocation { get; set; } = "L";
private double? _positionOnWall;
public XElement CreateXElement()
{
if (_positionOnWall == null) throw new Exception("_positionOnWall must be set by calling SetPositonOnWall before calling CreateXElement()");
const string stringFormatSpecifier = "F4";
Assembly assembly = new Assembly();
assembly.Name.Value = Name;
assembly.Description.Value = Description;
assembly.AssemblyWidth.Value = Width.ToString(stringFormatSpecifier);
assembly.AssemblyHeight.Value = Height.ToString(stringFormatSpecifier);
assembly.AssemblyDepth.Value = Depth.ToString(stringFormatSpecifier);
assembly.AssemblyPosition.Value = _positionOnWall.Value.ToString(stringFormatSpecifier);
assembly.Hinge1.Value = Hinge1Position.ToString(stringFormatSpecifier);
assembly.Hinge2.Value = Hinge2Position.ToString(stringFormatSpecifier);
assembly.Hinge3.Value = Hinge3Position.ToString(stringFormatSpecifier);
assembly.Hinge4.Value = Hinge4Position.ToString(stringFormatSpecifier);
assembly.Hinge5.Value = Hinge5Position.ToString(stringFormatSpecifier);
assembly.FirstSectionWidth.Value = Width.ToString(stringFormatSpecifier);
assembly.FirstSectionHeight.Value = Height.ToString(stringFormatSpecifier);
assembly.FirstSectionHingeLocation.Value = HingeLocation;
assembly.SecondSectionWidth.Value = Width.ToString(stringFormatSpecifier);
assembly.SecondSectionHeight.Value = Height.ToString(stringFormatSpecifier);
return assembly.doorAssemblyElement;
}
public void SetPositionOnWall(XElement assemblies, XElement wall)
{
if (assemblies == null) throw new ArgumentNullException(nameof(assemblies));
if (wall == null) throw new ArgumentNullException(nameof(wall));
// if there are no other doors, we must position at the beginning of the wall
if (assemblies.Elements("Assembly").Count() == 0)
{
_positionOnWall = _wallGap;
return;
}
// if there is another door we need to change the new door position to ensure they don't overlap
string lastDoorPositionValue = ((assemblies.Elements("Assembly").Last()
.Element("Position") ?? throw new XmlException("Can't find assembly.position"))
.Element("X") ?? throw new XmlException("Can't find assembly.position.X"))
.Value;
double lastDoorPosition = double.Parse(lastDoorPositionValue);
string lastDoorWidthValue = ((((assemblies.Elements("Assembly").Last()
.Element("Properties") ?? throw new XmlException("Can't find assembly.properties"))
.Element("General") ?? throw new XmlException("Can't find assembly.properites.general"))
.Element("Size") ?? throw new XmlException("Can't find assembly.properties.general.size"))
.Element("Width") ?? throw new XmlException("Can't find job.properties.general.size.width"))
.Value;
double lastDoorWidth = double.Parse(lastDoorWidthValue);
_positionOnWall = lastDoorPosition + lastDoorWidth + _gapBetweenDoors;
}
}
}
| 47.772727 | 152 | 0.644148 | [
"Apache-2.0"
] | liviu-marciu/LambdaNETCoreSamples | CustomRuntimeListBucketsNET6/Door.cs | 4,206 | C# |
namespace BaristaLabs.Skrapr.ChromeDevTools.Accessibility
{
using Newtonsoft.Json;
/// <summary>
///
/// </summary>
public sealed class AXRelatedNode
{
/// <summary>
/// The BackendNodeId of the related DOM node.
///</summary>
[JsonProperty("backendDOMNodeId")]
public long BackendDOMNodeId
{
get;
set;
}
/// <summary>
/// The IDRef value provided, if any.
///</summary>
[JsonProperty("idref", DefaultValueHandling = DefaultValueHandling.Ignore)]
public string Idref
{
get;
set;
}
/// <summary>
/// The text alternative of this node in the current context.
///</summary>
[JsonProperty("text", DefaultValueHandling = DefaultValueHandling.Ignore)]
public string Text
{
get;
set;
}
}
} | 25.052632 | 83 | 0.521008 | [
"MIT"
] | BaristaLabs/BaristaLabs.Skrapr | src/BaristaLabs.Skrapr.ChromeDevTools/Accessibility/AXRelatedNode.cs | 952 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.JSInterop;
namespace Majorsoft.Blazor.Components.Common.JsInterop.GlobalMouseEvents
{
/// <summary>
/// Implementation of <see cref="IGlobalMouseEventHandler"/>
/// </summary>
public sealed class GlobalMouseEventHandler : IGlobalMouseEventHandler
{
private readonly IJSRuntime _jsRuntime;
private IJSObjectReference _mouseJs;
private List<DotNetObjectReference<PageMouseEventInfo>> _dotNetObjectReferences;
public GlobalMouseEventHandler(IJSRuntime jsRuntime)
{
_jsRuntime = jsRuntime;
_dotNetObjectReferences = new List<DotNetObjectReference<PageMouseEventInfo>>();
}
public async Task<string> RegisterPageMouseDownAsync(Func<MouseEventArgs, Task> mouseDownCallback)
{
await CheckJsObjectAsync();
var id = Guid.NewGuid().ToString();
var info = new PageMouseEventInfo(mouseDownCallback, id);
var dotnetRef = DotNetObjectReference.Create<PageMouseEventInfo>(info);
await _mouseJs.InvokeVoidAsync("addGlobalMouseDownHandler", dotnetRef, id);
_dotNetObjectReferences.Add(dotnetRef);
return id;
}
public async Task RemovePageMouseDownAsync(string eventId)
{
await CheckJsObjectAsync();
await _mouseJs.InvokeVoidAsync("removeGlobalMouseDownHandler", eventId);
RemoveElement(eventId);
}
public async Task<string> RegisterPageMouseMoveAsync(Func<MouseEventArgs, Task> mouseMoveCallback)
{
await CheckJsObjectAsync();
var id = Guid.NewGuid().ToString();
var info = new PageMouseEventInfo(mouseMoveCallback, id);
var dotnetRef = DotNetObjectReference.Create<PageMouseEventInfo>(info);
await _mouseJs.InvokeVoidAsync("addGlobalMouseMoveHandler", dotnetRef, id);
_dotNetObjectReferences.Add(dotnetRef);
return id;
}
public async Task RemovePageMouseMoveAsync(string eventId)
{
await CheckJsObjectAsync();
await _mouseJs.InvokeVoidAsync("removeGlobalMouseMoveHandler", eventId);
RemoveElement(eventId);
}
public async Task<string> RegisterPageMouseUpAsync(Func<MouseEventArgs, Task> mouseUpCallback)
{
await CheckJsObjectAsync();
var id = Guid.NewGuid().ToString();
var info = new PageMouseEventInfo(mouseUpCallback, id);
var dotnetRef = DotNetObjectReference.Create<PageMouseEventInfo>(info);
await _mouseJs.InvokeVoidAsync("addGlobalMouseUpHandler", dotnetRef, id);
_dotNetObjectReferences.Add(dotnetRef);
return id;
}
public async Task RemovePageMouseUpAsync(string eventId)
{
await CheckJsObjectAsync();
await _mouseJs.InvokeVoidAsync("removeGlobalMouseUpHandler", eventId);
RemoveElement(eventId);
}
private void RemoveElement(string eventId)
{
var dotNetRefs = _dotNetObjectReferences.Where(x => x.Value.EventId == eventId);
_dotNetObjectReferences = _dotNetObjectReferences.Except(dotNetRefs).ToList();
foreach (var item in dotNetRefs)
{
item.Dispose();
}
}
private async Task CheckJsObjectAsync()
{
if (_mouseJs is null)
{
#if DEBUG
_mouseJs = await _jsRuntime.InvokeAsync<IJSObjectReference>("import", "./_content/Majorsoft.Blazor.Components.Common.JsInterop/globalMouseEvents.js");
#else
_mouseJs = await _jsRuntime.InvokeAsync<IJSObjectReference>("import", "./_content/Majorsoft.Blazor.Components.Common.JsInterop/globalMouseEvents.min.js");
#endif
}
}
public async ValueTask DisposeAsync()
{
if (_mouseJs is not null)
{
await _mouseJs.InvokeVoidAsync("dispose",
(object)_dotNetObjectReferences.Select(s => s.Value.EventId).Distinct().ToArray());
await _mouseJs.DisposeAsync();
}
foreach (var item in _dotNetObjectReferences)
{
item.Dispose();
}
}
}
} | 29.685039 | 158 | 0.759151 | [
"MIT"
] | ScriptBox99/blazor-components | src/Majorsoft.Blazor.Components.Common.JsInterop/GlobalMouseEvents/GlobalMouseEventHandler.cs | 3,772 | C# |
using System;
using System.Collections.Generic;
using QueueLibrary;
using Xunit;
namespace QueueLibrary.Tests
{
public class QueueClassTests
{
[Fact]
public void IsEmptyMethod_WhereQueueIsEmpty_ShouldReturnTrue()
{
//Arrange
QueueModel testQueue = new QueueModel();
//Act
bool actual = testQueue.IsEmpty();
//Assert
Assert.True(actual);
}
[Fact]
public void IsEmptyMethod_WhereQueueHasOneNode_ShouldReturnFalse()
{
//Arrange
QueueModel testQueue = new QueueModel();
testQueue.Enqueue("Hi");
//Act
bool actual = testQueue.IsEmpty();
//Assert
Assert.False(actual);
}
[Theory]
[InlineData("Hi!")]
public void Dequeue_WhereQueueHasOneNode_ShouldReturnEnqueuedValue(string expected)
{
//Arrange
QueueModel testQueue = new QueueModel();
testQueue.Enqueue(expected);
//Act
String actual = testQueue.Dequeue().ToString();
//Assert
Assert.Equal(actual, expected);
}
[Theory]
[InlineData("Hi!")]
public void QueueLength_AfterEnqueueAndDequeue_ShouldReturnZero(string payload)
{
//Arrange
QueueModel testQueue = new QueueModel();
testQueue.Enqueue(payload);
int actual = 0;
//Act
testQueue.Dequeue().ToString();
actual = testQueue.GetLength();
//Assert
Assert.Equal(0, actual);
}
[Theory]
[InlineData("Hello", "there", "Kenobi")]
public void Dequeue_AfterMultipleEnqueues_ShouldReturnListOfObjects(string first, string second, string third)
{
//Arrange
List<string> expected = new List<string>(new string[] { first, second, third });
QueueModel testQueue = new QueueModel();
foreach (var str in expected)
{
testQueue.Enqueue(str);
}
List<object> actual = new List<object>();
//Act
for (int i = 0; i < expected.Count; i++)
{
actual.Add(testQueue.Dequeue());
}
//Assert
Assert.Equal<object>(expected, actual);
}
[Theory]
[InlineData("Hello", "there", "Kenobi")]
public void DumpQueue_ShouldReturnListOfObjects(string first, string second, string third)
{
//Arrange
List<string> expected = new List<string>( new string[]{ first, second, third });
QueueModel testQueue = new QueueModel();
foreach (var str in expected)
{
testQueue.Enqueue(str);
}
//Act
List<object> actual = testQueue.Dump();
//Assert
Assert.Equal<object>(expected, actual);
}
}
}
| 26.747826 | 118 | 0.525358 | [
"MIT"
] | nortonstudios/C-Sharp-Data-Structures | QueueLibrary/QueueLibrary.Tests/QueueModelTests.cs | 3,078 | C# |
using System.Reflection;
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("Eumel.Dj.Mobile.iOS")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Eumel.Dj.Mobile.iOS")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")]
// 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.171429 | 84 | 0.740336 | [
"MIT"
] | EUMEL-Suite/EUMEL.Dj | Eumel.Dj.Mobile.iOS/Properties/AssemblyInfo.cs | 1,374 | C# |
/*
* DocuSign REST API
*
* The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
*
* OpenAPI spec version: v2.1
* Contact: devcenter@docusign.com
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using SwaggerDateConverter = DocuSign.eSign.Client.SwaggerDateConverter;
namespace DocuSign.eSign.Model
{
/// <summary>
/// List
/// </summary>
[DataContract]
public partial class List : IEquatable<List>, IValidatableObject
{
public List()
{
// Empty Constructor
}
/// <summary>
/// Initializes a new instance of the <see cref="List" /> class.
/// </summary>
/// <param name="AnchorAllowWhiteSpaceInCharacters">AnchorAllowWhiteSpaceInCharacters.</param>
/// <param name="AnchorAllowWhiteSpaceInCharactersMetadata">AnchorAllowWhiteSpaceInCharactersMetadata.</param>
/// <param name="AnchorCaseSensitive">When set to **true**, the anchor string does not consider case when matching strings in the document. The default value is **true**..</param>
/// <param name="AnchorCaseSensitiveMetadata">AnchorCaseSensitiveMetadata.</param>
/// <param name="AnchorHorizontalAlignment">Specifies the alignment of anchor tabs with anchor strings. Possible values are **left** or **right**. The default value is **left**..</param>
/// <param name="AnchorHorizontalAlignmentMetadata">AnchorHorizontalAlignmentMetadata.</param>
/// <param name="AnchorIgnoreIfNotPresent">When set to **true**, this tab is ignored if anchorString is not found in the document..</param>
/// <param name="AnchorIgnoreIfNotPresentMetadata">AnchorIgnoreIfNotPresentMetadata.</param>
/// <param name="AnchorMatchWholeWord">When set to **true**, the anchor string in this tab matches whole words only (strings embedded in other strings are ignored.) The default value is **true**..</param>
/// <param name="AnchorMatchWholeWordMetadata">AnchorMatchWholeWordMetadata.</param>
/// <param name="AnchorString">Anchor text information for a radio button..</param>
/// <param name="AnchorStringMetadata">AnchorStringMetadata.</param>
/// <param name="AnchorTabProcessorVersion">AnchorTabProcessorVersion.</param>
/// <param name="AnchorTabProcessorVersionMetadata">AnchorTabProcessorVersionMetadata.</param>
/// <param name="AnchorUnits">Specifies units of the X and Y offset. Units could be pixels, millimeters, centimeters, or inches..</param>
/// <param name="AnchorUnitsMetadata">AnchorUnitsMetadata.</param>
/// <param name="AnchorXOffset">Specifies the X axis location of the tab, in anchorUnits, relative to the anchorString..</param>
/// <param name="AnchorXOffsetMetadata">AnchorXOffsetMetadata.</param>
/// <param name="AnchorYOffset">Specifies the Y axis location of the tab, in anchorUnits, relative to the anchorString..</param>
/// <param name="AnchorYOffsetMetadata">AnchorYOffsetMetadata.</param>
/// <param name="Bold">When set to **true**, the information in the tab is bold..</param>
/// <param name="BoldMetadata">BoldMetadata.</param>
/// <param name="ConditionalParentLabel">For conditional fields this is the TabLabel of the parent tab that controls this tab's visibility..</param>
/// <param name="ConditionalParentLabelMetadata">ConditionalParentLabelMetadata.</param>
/// <param name="ConditionalParentValue">For conditional fields, this is the value of the parent tab that controls the tab's visibility. If the parent tab is a Checkbox, Radio button, Optional Signature, or Optional Initial use \"on\" as the value to show that the parent tab is active. .</param>
/// <param name="ConditionalParentValueMetadata">ConditionalParentValueMetadata.</param>
/// <param name="CustomTabId">The DocuSign generated custom tab ID for the custom tab to be applied. This can only be used when adding new tabs for a recipient. When used, the new tab inherits all the custom tab properties..</param>
/// <param name="CustomTabIdMetadata">CustomTabIdMetadata.</param>
/// <param name="DocumentId">Specifies the document ID number that the tab is placed on. This must refer to an existing Document's ID attribute..</param>
/// <param name="DocumentIdMetadata">DocumentIdMetadata.</param>
/// <param name="ErrorDetails">ErrorDetails.</param>
/// <param name="Font">The font to be used for the tab value. Supported Fonts: Arial, Arial, ArialNarrow, Calibri, CourierNew, Garamond, Georgia, Helvetica, LucidaConsole, Tahoma, TimesNewRoman, Trebuchet, Verdana, MSGothic, MSMincho, Default..</param>
/// <param name="FontColor">The font color used for the information in the tab. Possible values are: Black, BrightBlue, BrightRed, DarkGreen, DarkRed, Gold, Green, NavyBlue, Purple, or White..</param>
/// <param name="FontColorMetadata">FontColorMetadata.</param>
/// <param name="FontMetadata">FontMetadata.</param>
/// <param name="FontSize">The font size used for the information in the tab. Possible values are: Size7, Size8, Size9, Size10, Size11, Size12, Size14, Size16, Size18, Size20, Size22, Size24, Size26, Size28, Size36, Size48, or Size72..</param>
/// <param name="FontSizeMetadata">FontSizeMetadata.</param>
/// <param name="FormOrder">FormOrder.</param>
/// <param name="FormOrderMetadata">FormOrderMetadata.</param>
/// <param name="FormPageLabel">FormPageLabel.</param>
/// <param name="FormPageLabelMetadata">FormPageLabelMetadata.</param>
/// <param name="FormPageNumber">FormPageNumber.</param>
/// <param name="FormPageNumberMetadata">FormPageNumberMetadata.</param>
/// <param name="Height">Height of the tab in pixels..</param>
/// <param name="HeightMetadata">HeightMetadata.</param>
/// <param name="Italic">When set to **true**, the information in the tab is italic..</param>
/// <param name="ItalicMetadata">ItalicMetadata.</param>
/// <param name="ListItems">The list of values that can be selected by senders. The list values are separated by semi-colons. Example: [one;two;three;four] Maximum Length of listItems: 2048 characters. Maximum Length of items in the list: 100 characters. .</param>
/// <param name="ListSelectedValue">ListSelectedValue.</param>
/// <param name="ListSelectedValueMetadata">ListSelectedValueMetadata.</param>
/// <param name="LocalePolicy">LocalePolicy.</param>
/// <param name="Locked">When set to **true**, the signer cannot change the data of the custom tab..</param>
/// <param name="LockedMetadata">LockedMetadata.</param>
/// <param name="MergeField">MergeField.</param>
/// <param name="MergeFieldXml">MergeFieldXml.</param>
/// <param name="OriginalValue">The initial value of the tab when it was sent to the recipient. .</param>
/// <param name="OriginalValueMetadata">OriginalValueMetadata.</param>
/// <param name="PageNumber">Specifies the page number on which the tab is located..</param>
/// <param name="PageNumberMetadata">PageNumberMetadata.</param>
/// <param name="RecipientId">Unique for the recipient. It is used by the tab element to indicate which recipient is to sign the Document..</param>
/// <param name="RecipientIdGuid">RecipientIdGuid.</param>
/// <param name="RecipientIdGuidMetadata">RecipientIdGuidMetadata.</param>
/// <param name="RecipientIdMetadata">RecipientIdMetadata.</param>
/// <param name="RequireAll">When set to **true** and shared is true, information must be entered in this field to complete the envelope. .</param>
/// <param name="RequireAllMetadata">RequireAllMetadata.</param>
/// <param name="Required">When set to **true**, the signer is required to fill out this tab.</param>
/// <param name="RequiredMetadata">RequiredMetadata.</param>
/// <param name="RequireInitialOnSharedChange">Optional element for field markup. When set to **true**, the signer is required to initial when they modify a shared field..</param>
/// <param name="RequireInitialOnSharedChangeMetadata">RequireInitialOnSharedChangeMetadata.</param>
/// <param name="SenderRequired">When set to **true**, the sender must populate the tab before an envelope can be sent using the template. This value tab can only be changed by modifying (PUT) the template. Tabs with a `senderRequired` value of true cannot be deleted from an envelope..</param>
/// <param name="SenderRequiredMetadata">SenderRequiredMetadata.</param>
/// <param name="Shared">When set to **true**, this custom tab is shared..</param>
/// <param name="SharedMetadata">SharedMetadata.</param>
/// <param name="ShareToRecipients">ShareToRecipients.</param>
/// <param name="ShareToRecipientsMetadata">ShareToRecipientsMetadata.</param>
/// <param name="SmartContractInformation">SmartContractInformation.</param>
/// <param name="Source">Source.</param>
/// <param name="Status">Indicates the envelope status. Valid values are: * sent - The envelope is sent to the recipients. * created - The envelope is saved as a draft and can be modified and sent later..</param>
/// <param name="StatusMetadata">StatusMetadata.</param>
/// <param name="TabGroupLabels">TabGroupLabels.</param>
/// <param name="TabGroupLabelsMetadata">TabGroupLabelsMetadata.</param>
/// <param name="TabId">The unique identifier for the tab. The tabid can be retrieved with the [ML:GET call]. .</param>
/// <param name="TabIdMetadata">TabIdMetadata.</param>
/// <param name="TabLabel">The label string associated with the tab..</param>
/// <param name="TabLabelMetadata">TabLabelMetadata.</param>
/// <param name="TabOrder">TabOrder.</param>
/// <param name="TabOrderMetadata">TabOrderMetadata.</param>
/// <param name="TabType">TabType.</param>
/// <param name="TabTypeMetadata">TabTypeMetadata.</param>
/// <param name="TemplateLocked">When set to **true**, the sender cannot change any attributes of the recipient. Used only when working with template recipients. .</param>
/// <param name="TemplateLockedMetadata">TemplateLockedMetadata.</param>
/// <param name="TemplateRequired">When set to **true**, the sender may not remove the recipient. Used only when working with template recipients..</param>
/// <param name="TemplateRequiredMetadata">TemplateRequiredMetadata.</param>
/// <param name="Tooltip">Tooltip.</param>
/// <param name="ToolTipMetadata">ToolTipMetadata.</param>
/// <param name="Underline">When set to **true**, the information in the tab is underlined..</param>
/// <param name="UnderlineMetadata">UnderlineMetadata.</param>
/// <param name="Value">The value to use when the item is selected..</param>
/// <param name="ValueMetadata">ValueMetadata.</param>
/// <param name="Width">Width of the tab in pixels..</param>
/// <param name="WidthMetadata">WidthMetadata.</param>
/// <param name="XPosition">This indicates the horizontal offset of the object on the page. DocuSign uses 72 DPI when determining position..</param>
/// <param name="XPositionMetadata">XPositionMetadata.</param>
/// <param name="YPosition">This indicates the vertical offset of the object on the page. DocuSign uses 72 DPI when determining position..</param>
/// <param name="YPositionMetadata">YPositionMetadata.</param>
public List(string AnchorAllowWhiteSpaceInCharacters = default(string), PropertyMetadata AnchorAllowWhiteSpaceInCharactersMetadata = default(PropertyMetadata), string AnchorCaseSensitive = default(string), PropertyMetadata AnchorCaseSensitiveMetadata = default(PropertyMetadata), string AnchorHorizontalAlignment = default(string), PropertyMetadata AnchorHorizontalAlignmentMetadata = default(PropertyMetadata), string AnchorIgnoreIfNotPresent = default(string), PropertyMetadata AnchorIgnoreIfNotPresentMetadata = default(PropertyMetadata), string AnchorMatchWholeWord = default(string), PropertyMetadata AnchorMatchWholeWordMetadata = default(PropertyMetadata), string AnchorString = default(string), PropertyMetadata AnchorStringMetadata = default(PropertyMetadata), string AnchorTabProcessorVersion = default(string), PropertyMetadata AnchorTabProcessorVersionMetadata = default(PropertyMetadata), string AnchorUnits = default(string), PropertyMetadata AnchorUnitsMetadata = default(PropertyMetadata), string AnchorXOffset = default(string), PropertyMetadata AnchorXOffsetMetadata = default(PropertyMetadata), string AnchorYOffset = default(string), PropertyMetadata AnchorYOffsetMetadata = default(PropertyMetadata), string Bold = default(string), PropertyMetadata BoldMetadata = default(PropertyMetadata), string ConditionalParentLabel = default(string), PropertyMetadata ConditionalParentLabelMetadata = default(PropertyMetadata), string ConditionalParentValue = default(string), PropertyMetadata ConditionalParentValueMetadata = default(PropertyMetadata), string CustomTabId = default(string), PropertyMetadata CustomTabIdMetadata = default(PropertyMetadata), string DocumentId = default(string), PropertyMetadata DocumentIdMetadata = default(PropertyMetadata), ErrorDetails ErrorDetails = default(ErrorDetails), string Font = default(string), string FontColor = default(string), PropertyMetadata FontColorMetadata = default(PropertyMetadata), PropertyMetadata FontMetadata = default(PropertyMetadata), string FontSize = default(string), PropertyMetadata FontSizeMetadata = default(PropertyMetadata), string FormOrder = default(string), PropertyMetadata FormOrderMetadata = default(PropertyMetadata), string FormPageLabel = default(string), PropertyMetadata FormPageLabelMetadata = default(PropertyMetadata), string FormPageNumber = default(string), PropertyMetadata FormPageNumberMetadata = default(PropertyMetadata), string Height = default(string), PropertyMetadata HeightMetadata = default(PropertyMetadata), string Italic = default(string), PropertyMetadata ItalicMetadata = default(PropertyMetadata), List<ListItem> ListItems = default(List<ListItem>), string ListSelectedValue = default(string), PropertyMetadata ListSelectedValueMetadata = default(PropertyMetadata), LocalePolicyTab LocalePolicy = default(LocalePolicyTab), string Locked = default(string), PropertyMetadata LockedMetadata = default(PropertyMetadata), MergeField MergeField = default(MergeField), string MergeFieldXml = default(string), string OriginalValue = default(string), PropertyMetadata OriginalValueMetadata = default(PropertyMetadata), string PageNumber = default(string), PropertyMetadata PageNumberMetadata = default(PropertyMetadata), string RecipientId = default(string), string RecipientIdGuid = default(string), PropertyMetadata RecipientIdGuidMetadata = default(PropertyMetadata), PropertyMetadata RecipientIdMetadata = default(PropertyMetadata), string RequireAll = default(string), PropertyMetadata RequireAllMetadata = default(PropertyMetadata), string Required = default(string), PropertyMetadata RequiredMetadata = default(PropertyMetadata), string RequireInitialOnSharedChange = default(string), PropertyMetadata RequireInitialOnSharedChangeMetadata = default(PropertyMetadata), string SenderRequired = default(string), PropertyMetadata SenderRequiredMetadata = default(PropertyMetadata), string Shared = default(string), PropertyMetadata SharedMetadata = default(PropertyMetadata), string ShareToRecipients = default(string), PropertyMetadata ShareToRecipientsMetadata = default(PropertyMetadata), SmartContractInformation SmartContractInformation = default(SmartContractInformation), string Source = default(string), string Status = default(string), PropertyMetadata StatusMetadata = default(PropertyMetadata), List<string> TabGroupLabels = default(List<string>), PropertyMetadata TabGroupLabelsMetadata = default(PropertyMetadata), string TabId = default(string), PropertyMetadata TabIdMetadata = default(PropertyMetadata), string TabLabel = default(string), PropertyMetadata TabLabelMetadata = default(PropertyMetadata), string TabOrder = default(string), PropertyMetadata TabOrderMetadata = default(PropertyMetadata), string TabType = default(string), PropertyMetadata TabTypeMetadata = default(PropertyMetadata), string TemplateLocked = default(string), PropertyMetadata TemplateLockedMetadata = default(PropertyMetadata), string TemplateRequired = default(string), PropertyMetadata TemplateRequiredMetadata = default(PropertyMetadata), string Tooltip = default(string), PropertyMetadata ToolTipMetadata = default(PropertyMetadata), string Underline = default(string), PropertyMetadata UnderlineMetadata = default(PropertyMetadata), string Value = default(string), PropertyMetadata ValueMetadata = default(PropertyMetadata), string Width = default(string), PropertyMetadata WidthMetadata = default(PropertyMetadata), string XPosition = default(string), PropertyMetadata XPositionMetadata = default(PropertyMetadata), string YPosition = default(string), PropertyMetadata YPositionMetadata = default(PropertyMetadata))
{
this.AnchorAllowWhiteSpaceInCharacters = AnchorAllowWhiteSpaceInCharacters;
this.AnchorAllowWhiteSpaceInCharactersMetadata = AnchorAllowWhiteSpaceInCharactersMetadata;
this.AnchorCaseSensitive = AnchorCaseSensitive;
this.AnchorCaseSensitiveMetadata = AnchorCaseSensitiveMetadata;
this.AnchorHorizontalAlignment = AnchorHorizontalAlignment;
this.AnchorHorizontalAlignmentMetadata = AnchorHorizontalAlignmentMetadata;
this.AnchorIgnoreIfNotPresent = AnchorIgnoreIfNotPresent;
this.AnchorIgnoreIfNotPresentMetadata = AnchorIgnoreIfNotPresentMetadata;
this.AnchorMatchWholeWord = AnchorMatchWholeWord;
this.AnchorMatchWholeWordMetadata = AnchorMatchWholeWordMetadata;
this.AnchorString = AnchorString;
this.AnchorStringMetadata = AnchorStringMetadata;
this.AnchorTabProcessorVersion = AnchorTabProcessorVersion;
this.AnchorTabProcessorVersionMetadata = AnchorTabProcessorVersionMetadata;
this.AnchorUnits = AnchorUnits;
this.AnchorUnitsMetadata = AnchorUnitsMetadata;
this.AnchorXOffset = AnchorXOffset;
this.AnchorXOffsetMetadata = AnchorXOffsetMetadata;
this.AnchorYOffset = AnchorYOffset;
this.AnchorYOffsetMetadata = AnchorYOffsetMetadata;
this.Bold = Bold;
this.BoldMetadata = BoldMetadata;
this.ConditionalParentLabel = ConditionalParentLabel;
this.ConditionalParentLabelMetadata = ConditionalParentLabelMetadata;
this.ConditionalParentValue = ConditionalParentValue;
this.ConditionalParentValueMetadata = ConditionalParentValueMetadata;
this.CustomTabId = CustomTabId;
this.CustomTabIdMetadata = CustomTabIdMetadata;
this.DocumentId = DocumentId;
this.DocumentIdMetadata = DocumentIdMetadata;
this.ErrorDetails = ErrorDetails;
this.Font = Font;
this.FontColor = FontColor;
this.FontColorMetadata = FontColorMetadata;
this.FontMetadata = FontMetadata;
this.FontSize = FontSize;
this.FontSizeMetadata = FontSizeMetadata;
this.FormOrder = FormOrder;
this.FormOrderMetadata = FormOrderMetadata;
this.FormPageLabel = FormPageLabel;
this.FormPageLabelMetadata = FormPageLabelMetadata;
this.FormPageNumber = FormPageNumber;
this.FormPageNumberMetadata = FormPageNumberMetadata;
this.Height = Height;
this.HeightMetadata = HeightMetadata;
this.Italic = Italic;
this.ItalicMetadata = ItalicMetadata;
this.ListItems = ListItems;
this.ListSelectedValue = ListSelectedValue;
this.ListSelectedValueMetadata = ListSelectedValueMetadata;
this.LocalePolicy = LocalePolicy;
this.Locked = Locked;
this.LockedMetadata = LockedMetadata;
this.MergeField = MergeField;
this.MergeFieldXml = MergeFieldXml;
this.OriginalValue = OriginalValue;
this.OriginalValueMetadata = OriginalValueMetadata;
this.PageNumber = PageNumber;
this.PageNumberMetadata = PageNumberMetadata;
this.RecipientId = RecipientId;
this.RecipientIdGuid = RecipientIdGuid;
this.RecipientIdGuidMetadata = RecipientIdGuidMetadata;
this.RecipientIdMetadata = RecipientIdMetadata;
this.RequireAll = RequireAll;
this.RequireAllMetadata = RequireAllMetadata;
this.Required = Required;
this.RequiredMetadata = RequiredMetadata;
this.RequireInitialOnSharedChange = RequireInitialOnSharedChange;
this.RequireInitialOnSharedChangeMetadata = RequireInitialOnSharedChangeMetadata;
this.SenderRequired = SenderRequired;
this.SenderRequiredMetadata = SenderRequiredMetadata;
this.Shared = Shared;
this.SharedMetadata = SharedMetadata;
this.ShareToRecipients = ShareToRecipients;
this.ShareToRecipientsMetadata = ShareToRecipientsMetadata;
this.SmartContractInformation = SmartContractInformation;
this.Source = Source;
this.Status = Status;
this.StatusMetadata = StatusMetadata;
this.TabGroupLabels = TabGroupLabels;
this.TabGroupLabelsMetadata = TabGroupLabelsMetadata;
this.TabId = TabId;
this.TabIdMetadata = TabIdMetadata;
this.TabLabel = TabLabel;
this.TabLabelMetadata = TabLabelMetadata;
this.TabOrder = TabOrder;
this.TabOrderMetadata = TabOrderMetadata;
this.TabType = TabType;
this.TabTypeMetadata = TabTypeMetadata;
this.TemplateLocked = TemplateLocked;
this.TemplateLockedMetadata = TemplateLockedMetadata;
this.TemplateRequired = TemplateRequired;
this.TemplateRequiredMetadata = TemplateRequiredMetadata;
this.Tooltip = Tooltip;
this.ToolTipMetadata = ToolTipMetadata;
this.Underline = Underline;
this.UnderlineMetadata = UnderlineMetadata;
this.Value = Value;
this.ValueMetadata = ValueMetadata;
this.Width = Width;
this.WidthMetadata = WidthMetadata;
this.XPosition = XPosition;
this.XPositionMetadata = XPositionMetadata;
this.YPosition = YPosition;
this.YPositionMetadata = YPositionMetadata;
}
/// <summary>
/// Gets or Sets AnchorAllowWhiteSpaceInCharacters
/// </summary>
[DataMember(Name="anchorAllowWhiteSpaceInCharacters", EmitDefaultValue=false)]
public string AnchorAllowWhiteSpaceInCharacters { get; set; }
/// <summary>
/// Gets or Sets AnchorAllowWhiteSpaceInCharactersMetadata
/// </summary>
[DataMember(Name="anchorAllowWhiteSpaceInCharactersMetadata", EmitDefaultValue=false)]
public PropertyMetadata AnchorAllowWhiteSpaceInCharactersMetadata { get; set; }
/// <summary>
/// When set to **true**, the anchor string does not consider case when matching strings in the document. The default value is **true**.
/// </summary>
/// <value>When set to **true**, the anchor string does not consider case when matching strings in the document. The default value is **true**.</value>
[DataMember(Name="anchorCaseSensitive", EmitDefaultValue=false)]
public string AnchorCaseSensitive { get; set; }
/// <summary>
/// Gets or Sets AnchorCaseSensitiveMetadata
/// </summary>
[DataMember(Name="anchorCaseSensitiveMetadata", EmitDefaultValue=false)]
public PropertyMetadata AnchorCaseSensitiveMetadata { get; set; }
/// <summary>
/// Specifies the alignment of anchor tabs with anchor strings. Possible values are **left** or **right**. The default value is **left**.
/// </summary>
/// <value>Specifies the alignment of anchor tabs with anchor strings. Possible values are **left** or **right**. The default value is **left**.</value>
[DataMember(Name="anchorHorizontalAlignment", EmitDefaultValue=false)]
public string AnchorHorizontalAlignment { get; set; }
/// <summary>
/// Gets or Sets AnchorHorizontalAlignmentMetadata
/// </summary>
[DataMember(Name="anchorHorizontalAlignmentMetadata", EmitDefaultValue=false)]
public PropertyMetadata AnchorHorizontalAlignmentMetadata { get; set; }
/// <summary>
/// When set to **true**, this tab is ignored if anchorString is not found in the document.
/// </summary>
/// <value>When set to **true**, this tab is ignored if anchorString is not found in the document.</value>
[DataMember(Name="anchorIgnoreIfNotPresent", EmitDefaultValue=false)]
public string AnchorIgnoreIfNotPresent { get; set; }
/// <summary>
/// Gets or Sets AnchorIgnoreIfNotPresentMetadata
/// </summary>
[DataMember(Name="anchorIgnoreIfNotPresentMetadata", EmitDefaultValue=false)]
public PropertyMetadata AnchorIgnoreIfNotPresentMetadata { get; set; }
/// <summary>
/// When set to **true**, the anchor string in this tab matches whole words only (strings embedded in other strings are ignored.) The default value is **true**.
/// </summary>
/// <value>When set to **true**, the anchor string in this tab matches whole words only (strings embedded in other strings are ignored.) The default value is **true**.</value>
[DataMember(Name="anchorMatchWholeWord", EmitDefaultValue=false)]
public string AnchorMatchWholeWord { get; set; }
/// <summary>
/// Gets or Sets AnchorMatchWholeWordMetadata
/// </summary>
[DataMember(Name="anchorMatchWholeWordMetadata", EmitDefaultValue=false)]
public PropertyMetadata AnchorMatchWholeWordMetadata { get; set; }
/// <summary>
/// Anchor text information for a radio button.
/// </summary>
/// <value>Anchor text information for a radio button.</value>
[DataMember(Name="anchorString", EmitDefaultValue=false)]
public string AnchorString { get; set; }
/// <summary>
/// Gets or Sets AnchorStringMetadata
/// </summary>
[DataMember(Name="anchorStringMetadata", EmitDefaultValue=false)]
public PropertyMetadata AnchorStringMetadata { get; set; }
/// <summary>
/// Gets or Sets AnchorTabProcessorVersion
/// </summary>
[DataMember(Name="anchorTabProcessorVersion", EmitDefaultValue=false)]
public string AnchorTabProcessorVersion { get; set; }
/// <summary>
/// Gets or Sets AnchorTabProcessorVersionMetadata
/// </summary>
[DataMember(Name="anchorTabProcessorVersionMetadata", EmitDefaultValue=false)]
public PropertyMetadata AnchorTabProcessorVersionMetadata { get; set; }
/// <summary>
/// Specifies units of the X and Y offset. Units could be pixels, millimeters, centimeters, or inches.
/// </summary>
/// <value>Specifies units of the X and Y offset. Units could be pixels, millimeters, centimeters, or inches.</value>
[DataMember(Name="anchorUnits", EmitDefaultValue=false)]
public string AnchorUnits { get; set; }
/// <summary>
/// Gets or Sets AnchorUnitsMetadata
/// </summary>
[DataMember(Name="anchorUnitsMetadata", EmitDefaultValue=false)]
public PropertyMetadata AnchorUnitsMetadata { get; set; }
/// <summary>
/// Specifies the X axis location of the tab, in anchorUnits, relative to the anchorString.
/// </summary>
/// <value>Specifies the X axis location of the tab, in anchorUnits, relative to the anchorString.</value>
[DataMember(Name="anchorXOffset", EmitDefaultValue=false)]
public string AnchorXOffset { get; set; }
/// <summary>
/// Gets or Sets AnchorXOffsetMetadata
/// </summary>
[DataMember(Name="anchorXOffsetMetadata", EmitDefaultValue=false)]
public PropertyMetadata AnchorXOffsetMetadata { get; set; }
/// <summary>
/// Specifies the Y axis location of the tab, in anchorUnits, relative to the anchorString.
/// </summary>
/// <value>Specifies the Y axis location of the tab, in anchorUnits, relative to the anchorString.</value>
[DataMember(Name="anchorYOffset", EmitDefaultValue=false)]
public string AnchorYOffset { get; set; }
/// <summary>
/// Gets or Sets AnchorYOffsetMetadata
/// </summary>
[DataMember(Name="anchorYOffsetMetadata", EmitDefaultValue=false)]
public PropertyMetadata AnchorYOffsetMetadata { get; set; }
/// <summary>
/// When set to **true**, the information in the tab is bold.
/// </summary>
/// <value>When set to **true**, the information in the tab is bold.</value>
[DataMember(Name="bold", EmitDefaultValue=false)]
public string Bold { get; set; }
/// <summary>
/// Gets or Sets BoldMetadata
/// </summary>
[DataMember(Name="boldMetadata", EmitDefaultValue=false)]
public PropertyMetadata BoldMetadata { get; set; }
/// <summary>
/// For conditional fields this is the TabLabel of the parent tab that controls this tab's visibility.
/// </summary>
/// <value>For conditional fields this is the TabLabel of the parent tab that controls this tab's visibility.</value>
[DataMember(Name="conditionalParentLabel", EmitDefaultValue=false)]
public string ConditionalParentLabel { get; set; }
/// <summary>
/// Gets or Sets ConditionalParentLabelMetadata
/// </summary>
[DataMember(Name="conditionalParentLabelMetadata", EmitDefaultValue=false)]
public PropertyMetadata ConditionalParentLabelMetadata { get; set; }
/// <summary>
/// For conditional fields, this is the value of the parent tab that controls the tab's visibility. If the parent tab is a Checkbox, Radio button, Optional Signature, or Optional Initial use \"on\" as the value to show that the parent tab is active.
/// </summary>
/// <value>For conditional fields, this is the value of the parent tab that controls the tab's visibility. If the parent tab is a Checkbox, Radio button, Optional Signature, or Optional Initial use \"on\" as the value to show that the parent tab is active. </value>
[DataMember(Name="conditionalParentValue", EmitDefaultValue=false)]
public string ConditionalParentValue { get; set; }
/// <summary>
/// Gets or Sets ConditionalParentValueMetadata
/// </summary>
[DataMember(Name="conditionalParentValueMetadata", EmitDefaultValue=false)]
public PropertyMetadata ConditionalParentValueMetadata { get; set; }
/// <summary>
/// The DocuSign generated custom tab ID for the custom tab to be applied. This can only be used when adding new tabs for a recipient. When used, the new tab inherits all the custom tab properties.
/// </summary>
/// <value>The DocuSign generated custom tab ID for the custom tab to be applied. This can only be used when adding new tabs for a recipient. When used, the new tab inherits all the custom tab properties.</value>
[DataMember(Name="customTabId", EmitDefaultValue=false)]
public string CustomTabId { get; set; }
/// <summary>
/// Gets or Sets CustomTabIdMetadata
/// </summary>
[DataMember(Name="customTabIdMetadata", EmitDefaultValue=false)]
public PropertyMetadata CustomTabIdMetadata { get; set; }
/// <summary>
/// Specifies the document ID number that the tab is placed on. This must refer to an existing Document's ID attribute.
/// </summary>
/// <value>Specifies the document ID number that the tab is placed on. This must refer to an existing Document's ID attribute.</value>
[DataMember(Name="documentId", EmitDefaultValue=false)]
public string DocumentId { get; set; }
/// <summary>
/// Gets or Sets DocumentIdMetadata
/// </summary>
[DataMember(Name="documentIdMetadata", EmitDefaultValue=false)]
public PropertyMetadata DocumentIdMetadata { get; set; }
/// <summary>
/// Gets or Sets ErrorDetails
/// </summary>
[DataMember(Name="errorDetails", EmitDefaultValue=false)]
public ErrorDetails ErrorDetails { get; set; }
/// <summary>
/// The font to be used for the tab value. Supported Fonts: Arial, Arial, ArialNarrow, Calibri, CourierNew, Garamond, Georgia, Helvetica, LucidaConsole, Tahoma, TimesNewRoman, Trebuchet, Verdana, MSGothic, MSMincho, Default.
/// </summary>
/// <value>The font to be used for the tab value. Supported Fonts: Arial, Arial, ArialNarrow, Calibri, CourierNew, Garamond, Georgia, Helvetica, LucidaConsole, Tahoma, TimesNewRoman, Trebuchet, Verdana, MSGothic, MSMincho, Default.</value>
[DataMember(Name="font", EmitDefaultValue=false)]
public string Font { get; set; }
/// <summary>
/// The font color used for the information in the tab. Possible values are: Black, BrightBlue, BrightRed, DarkGreen, DarkRed, Gold, Green, NavyBlue, Purple, or White.
/// </summary>
/// <value>The font color used for the information in the tab. Possible values are: Black, BrightBlue, BrightRed, DarkGreen, DarkRed, Gold, Green, NavyBlue, Purple, or White.</value>
[DataMember(Name="fontColor", EmitDefaultValue=false)]
public string FontColor { get; set; }
/// <summary>
/// Gets or Sets FontColorMetadata
/// </summary>
[DataMember(Name="fontColorMetadata", EmitDefaultValue=false)]
public PropertyMetadata FontColorMetadata { get; set; }
/// <summary>
/// Gets or Sets FontMetadata
/// </summary>
[DataMember(Name="fontMetadata", EmitDefaultValue=false)]
public PropertyMetadata FontMetadata { get; set; }
/// <summary>
/// The font size used for the information in the tab. Possible values are: Size7, Size8, Size9, Size10, Size11, Size12, Size14, Size16, Size18, Size20, Size22, Size24, Size26, Size28, Size36, Size48, or Size72.
/// </summary>
/// <value>The font size used for the information in the tab. Possible values are: Size7, Size8, Size9, Size10, Size11, Size12, Size14, Size16, Size18, Size20, Size22, Size24, Size26, Size28, Size36, Size48, or Size72.</value>
[DataMember(Name="fontSize", EmitDefaultValue=false)]
public string FontSize { get; set; }
/// <summary>
/// Gets or Sets FontSizeMetadata
/// </summary>
[DataMember(Name="fontSizeMetadata", EmitDefaultValue=false)]
public PropertyMetadata FontSizeMetadata { get; set; }
/// <summary>
/// Gets or Sets FormOrder
/// </summary>
[DataMember(Name="formOrder", EmitDefaultValue=false)]
public string FormOrder { get; set; }
/// <summary>
/// Gets or Sets FormOrderMetadata
/// </summary>
[DataMember(Name="formOrderMetadata", EmitDefaultValue=false)]
public PropertyMetadata FormOrderMetadata { get; set; }
/// <summary>
/// Gets or Sets FormPageLabel
/// </summary>
[DataMember(Name="formPageLabel", EmitDefaultValue=false)]
public string FormPageLabel { get; set; }
/// <summary>
/// Gets or Sets FormPageLabelMetadata
/// </summary>
[DataMember(Name="formPageLabelMetadata", EmitDefaultValue=false)]
public PropertyMetadata FormPageLabelMetadata { get; set; }
/// <summary>
/// Gets or Sets FormPageNumber
/// </summary>
[DataMember(Name="formPageNumber", EmitDefaultValue=false)]
public string FormPageNumber { get; set; }
/// <summary>
/// Gets or Sets FormPageNumberMetadata
/// </summary>
[DataMember(Name="formPageNumberMetadata", EmitDefaultValue=false)]
public PropertyMetadata FormPageNumberMetadata { get; set; }
/// <summary>
/// Height of the tab in pixels.
/// </summary>
/// <value>Height of the tab in pixels.</value>
[DataMember(Name="height", EmitDefaultValue=false)]
public string Height { get; set; }
/// <summary>
/// Gets or Sets HeightMetadata
/// </summary>
[DataMember(Name="heightMetadata", EmitDefaultValue=false)]
public PropertyMetadata HeightMetadata { get; set; }
/// <summary>
/// When set to **true**, the information in the tab is italic.
/// </summary>
/// <value>When set to **true**, the information in the tab is italic.</value>
[DataMember(Name="italic", EmitDefaultValue=false)]
public string Italic { get; set; }
/// <summary>
/// Gets or Sets ItalicMetadata
/// </summary>
[DataMember(Name="italicMetadata", EmitDefaultValue=false)]
public PropertyMetadata ItalicMetadata { get; set; }
/// <summary>
/// The list of values that can be selected by senders. The list values are separated by semi-colons. Example: [one;two;three;four] Maximum Length of listItems: 2048 characters. Maximum Length of items in the list: 100 characters.
/// </summary>
/// <value>The list of values that can be selected by senders. The list values are separated by semi-colons. Example: [one;two;three;four] Maximum Length of listItems: 2048 characters. Maximum Length of items in the list: 100 characters. </value>
[DataMember(Name="listItems", EmitDefaultValue=false)]
public List<ListItem> ListItems { get; set; }
/// <summary>
/// Gets or Sets ListSelectedValue
/// </summary>
[DataMember(Name="listSelectedValue", EmitDefaultValue=false)]
public string ListSelectedValue { get; set; }
/// <summary>
/// Gets or Sets ListSelectedValueMetadata
/// </summary>
[DataMember(Name="listSelectedValueMetadata", EmitDefaultValue=false)]
public PropertyMetadata ListSelectedValueMetadata { get; set; }
/// <summary>
/// Gets or Sets LocalePolicy
/// </summary>
[DataMember(Name="localePolicy", EmitDefaultValue=false)]
public LocalePolicyTab LocalePolicy { get; set; }
/// <summary>
/// When set to **true**, the signer cannot change the data of the custom tab.
/// </summary>
/// <value>When set to **true**, the signer cannot change the data of the custom tab.</value>
[DataMember(Name="locked", EmitDefaultValue=false)]
public string Locked { get; set; }
/// <summary>
/// Gets or Sets LockedMetadata
/// </summary>
[DataMember(Name="lockedMetadata", EmitDefaultValue=false)]
public PropertyMetadata LockedMetadata { get; set; }
/// <summary>
/// Gets or Sets MergeField
/// </summary>
[DataMember(Name="mergeField", EmitDefaultValue=false)]
public MergeField MergeField { get; set; }
/// <summary>
/// Gets or Sets MergeFieldXml
/// </summary>
[DataMember(Name="mergeFieldXml", EmitDefaultValue=false)]
public string MergeFieldXml { get; set; }
/// <summary>
/// The initial value of the tab when it was sent to the recipient.
/// </summary>
/// <value>The initial value of the tab when it was sent to the recipient. </value>
[DataMember(Name="originalValue", EmitDefaultValue=false)]
public string OriginalValue { get; set; }
/// <summary>
/// Gets or Sets OriginalValueMetadata
/// </summary>
[DataMember(Name="originalValueMetadata", EmitDefaultValue=false)]
public PropertyMetadata OriginalValueMetadata { get; set; }
/// <summary>
/// Specifies the page number on which the tab is located.
/// </summary>
/// <value>Specifies the page number on which the tab is located.</value>
[DataMember(Name="pageNumber", EmitDefaultValue=false)]
public string PageNumber { get; set; }
/// <summary>
/// Gets or Sets PageNumberMetadata
/// </summary>
[DataMember(Name="pageNumberMetadata", EmitDefaultValue=false)]
public PropertyMetadata PageNumberMetadata { get; set; }
/// <summary>
/// Unique for the recipient. It is used by the tab element to indicate which recipient is to sign the Document.
/// </summary>
/// <value>Unique for the recipient. It is used by the tab element to indicate which recipient is to sign the Document.</value>
[DataMember(Name="recipientId", EmitDefaultValue=false)]
public string RecipientId { get; set; }
/// <summary>
/// Gets or Sets RecipientIdGuid
/// </summary>
[DataMember(Name="recipientIdGuid", EmitDefaultValue=false)]
public string RecipientIdGuid { get; set; }
/// <summary>
/// Gets or Sets RecipientIdGuidMetadata
/// </summary>
[DataMember(Name="recipientIdGuidMetadata", EmitDefaultValue=false)]
public PropertyMetadata RecipientIdGuidMetadata { get; set; }
/// <summary>
/// Gets or Sets RecipientIdMetadata
/// </summary>
[DataMember(Name="recipientIdMetadata", EmitDefaultValue=false)]
public PropertyMetadata RecipientIdMetadata { get; set; }
/// <summary>
/// When set to **true** and shared is true, information must be entered in this field to complete the envelope.
/// </summary>
/// <value>When set to **true** and shared is true, information must be entered in this field to complete the envelope. </value>
[DataMember(Name="requireAll", EmitDefaultValue=false)]
public string RequireAll { get; set; }
/// <summary>
/// Gets or Sets RequireAllMetadata
/// </summary>
[DataMember(Name="requireAllMetadata", EmitDefaultValue=false)]
public PropertyMetadata RequireAllMetadata { get; set; }
/// <summary>
/// When set to **true**, the signer is required to fill out this tab
/// </summary>
/// <value>When set to **true**, the signer is required to fill out this tab</value>
[DataMember(Name="required", EmitDefaultValue=false)]
public string Required { get; set; }
/// <summary>
/// Gets or Sets RequiredMetadata
/// </summary>
[DataMember(Name="requiredMetadata", EmitDefaultValue=false)]
public PropertyMetadata RequiredMetadata { get; set; }
/// <summary>
/// Optional element for field markup. When set to **true**, the signer is required to initial when they modify a shared field.
/// </summary>
/// <value>Optional element for field markup. When set to **true**, the signer is required to initial when they modify a shared field.</value>
[DataMember(Name="requireInitialOnSharedChange", EmitDefaultValue=false)]
public string RequireInitialOnSharedChange { get; set; }
/// <summary>
/// Gets or Sets RequireInitialOnSharedChangeMetadata
/// </summary>
[DataMember(Name="requireInitialOnSharedChangeMetadata", EmitDefaultValue=false)]
public PropertyMetadata RequireInitialOnSharedChangeMetadata { get; set; }
/// <summary>
/// When set to **true**, the sender must populate the tab before an envelope can be sent using the template. This value tab can only be changed by modifying (PUT) the template. Tabs with a `senderRequired` value of true cannot be deleted from an envelope.
/// </summary>
/// <value>When set to **true**, the sender must populate the tab before an envelope can be sent using the template. This value tab can only be changed by modifying (PUT) the template. Tabs with a `senderRequired` value of true cannot be deleted from an envelope.</value>
[DataMember(Name="senderRequired", EmitDefaultValue=false)]
public string SenderRequired { get; set; }
/// <summary>
/// Gets or Sets SenderRequiredMetadata
/// </summary>
[DataMember(Name="senderRequiredMetadata", EmitDefaultValue=false)]
public PropertyMetadata SenderRequiredMetadata { get; set; }
/// <summary>
/// When set to **true**, this custom tab is shared.
/// </summary>
/// <value>When set to **true**, this custom tab is shared.</value>
[DataMember(Name="shared", EmitDefaultValue=false)]
public string Shared { get; set; }
/// <summary>
/// Gets or Sets SharedMetadata
/// </summary>
[DataMember(Name="sharedMetadata", EmitDefaultValue=false)]
public PropertyMetadata SharedMetadata { get; set; }
/// <summary>
/// Gets or Sets ShareToRecipients
/// </summary>
[DataMember(Name="shareToRecipients", EmitDefaultValue=false)]
public string ShareToRecipients { get; set; }
/// <summary>
/// Gets or Sets ShareToRecipientsMetadata
/// </summary>
[DataMember(Name="shareToRecipientsMetadata", EmitDefaultValue=false)]
public PropertyMetadata ShareToRecipientsMetadata { get; set; }
/// <summary>
/// Gets or Sets SmartContractInformation
/// </summary>
[DataMember(Name="smartContractInformation", EmitDefaultValue=false)]
public SmartContractInformation SmartContractInformation { get; set; }
/// <summary>
/// Gets or Sets Source
/// </summary>
[DataMember(Name="source", EmitDefaultValue=false)]
public string Source { get; set; }
/// <summary>
/// Indicates the envelope status. Valid values are: * sent - The envelope is sent to the recipients. * created - The envelope is saved as a draft and can be modified and sent later.
/// </summary>
/// <value>Indicates the envelope status. Valid values are: * sent - The envelope is sent to the recipients. * created - The envelope is saved as a draft and can be modified and sent later.</value>
[DataMember(Name="status", EmitDefaultValue=false)]
public string Status { get; set; }
/// <summary>
/// Gets or Sets StatusMetadata
/// </summary>
[DataMember(Name="statusMetadata", EmitDefaultValue=false)]
public PropertyMetadata StatusMetadata { get; set; }
/// <summary>
/// Gets or Sets TabGroupLabels
/// </summary>
[DataMember(Name="tabGroupLabels", EmitDefaultValue=false)]
public List<string> TabGroupLabels { get; set; }
/// <summary>
/// Gets or Sets TabGroupLabelsMetadata
/// </summary>
[DataMember(Name="tabGroupLabelsMetadata", EmitDefaultValue=false)]
public PropertyMetadata TabGroupLabelsMetadata { get; set; }
/// <summary>
/// The unique identifier for the tab. The tabid can be retrieved with the [ML:GET call].
/// </summary>
/// <value>The unique identifier for the tab. The tabid can be retrieved with the [ML:GET call]. </value>
[DataMember(Name="tabId", EmitDefaultValue=false)]
public string TabId { get; set; }
/// <summary>
/// Gets or Sets TabIdMetadata
/// </summary>
[DataMember(Name="tabIdMetadata", EmitDefaultValue=false)]
public PropertyMetadata TabIdMetadata { get; set; }
/// <summary>
/// The label string associated with the tab.
/// </summary>
/// <value>The label string associated with the tab.</value>
[DataMember(Name="tabLabel", EmitDefaultValue=false)]
public string TabLabel { get; set; }
/// <summary>
/// Gets or Sets TabLabelMetadata
/// </summary>
[DataMember(Name="tabLabelMetadata", EmitDefaultValue=false)]
public PropertyMetadata TabLabelMetadata { get; set; }
/// <summary>
/// Gets or Sets TabOrder
/// </summary>
[DataMember(Name="tabOrder", EmitDefaultValue=false)]
public string TabOrder { get; set; }
/// <summary>
/// Gets or Sets TabOrderMetadata
/// </summary>
[DataMember(Name="tabOrderMetadata", EmitDefaultValue=false)]
public PropertyMetadata TabOrderMetadata { get; set; }
/// <summary>
/// Gets or Sets TabType
/// </summary>
[DataMember(Name="tabType", EmitDefaultValue=false)]
public string TabType { get; set; }
/// <summary>
/// Gets or Sets TabTypeMetadata
/// </summary>
[DataMember(Name="tabTypeMetadata", EmitDefaultValue=false)]
public PropertyMetadata TabTypeMetadata { get; set; }
/// <summary>
/// When set to **true**, the sender cannot change any attributes of the recipient. Used only when working with template recipients.
/// </summary>
/// <value>When set to **true**, the sender cannot change any attributes of the recipient. Used only when working with template recipients. </value>
[DataMember(Name="templateLocked", EmitDefaultValue=false)]
public string TemplateLocked { get; set; }
/// <summary>
/// Gets or Sets TemplateLockedMetadata
/// </summary>
[DataMember(Name="templateLockedMetadata", EmitDefaultValue=false)]
public PropertyMetadata TemplateLockedMetadata { get; set; }
/// <summary>
/// When set to **true**, the sender may not remove the recipient. Used only when working with template recipients.
/// </summary>
/// <value>When set to **true**, the sender may not remove the recipient. Used only when working with template recipients.</value>
[DataMember(Name="templateRequired", EmitDefaultValue=false)]
public string TemplateRequired { get; set; }
/// <summary>
/// Gets or Sets TemplateRequiredMetadata
/// </summary>
[DataMember(Name="templateRequiredMetadata", EmitDefaultValue=false)]
public PropertyMetadata TemplateRequiredMetadata { get; set; }
/// <summary>
/// Gets or Sets Tooltip
/// </summary>
[DataMember(Name="tooltip", EmitDefaultValue=false)]
public string Tooltip { get; set; }
/// <summary>
/// Gets or Sets ToolTipMetadata
/// </summary>
[DataMember(Name="toolTipMetadata", EmitDefaultValue=false)]
public PropertyMetadata ToolTipMetadata { get; set; }
/// <summary>
/// When set to **true**, the information in the tab is underlined.
/// </summary>
/// <value>When set to **true**, the information in the tab is underlined.</value>
[DataMember(Name="underline", EmitDefaultValue=false)]
public string Underline { get; set; }
/// <summary>
/// Gets or Sets UnderlineMetadata
/// </summary>
[DataMember(Name="underlineMetadata", EmitDefaultValue=false)]
public PropertyMetadata UnderlineMetadata { get; set; }
/// <summary>
/// The value to use when the item is selected.
/// </summary>
/// <value>The value to use when the item is selected.</value>
[DataMember(Name="value", EmitDefaultValue=false)]
public string Value { get; set; }
/// <summary>
/// Gets or Sets ValueMetadata
/// </summary>
[DataMember(Name="valueMetadata", EmitDefaultValue=false)]
public PropertyMetadata ValueMetadata { get; set; }
/// <summary>
/// Width of the tab in pixels.
/// </summary>
/// <value>Width of the tab in pixels.</value>
[DataMember(Name="width", EmitDefaultValue=false)]
public string Width { get; set; }
/// <summary>
/// Gets or Sets WidthMetadata
/// </summary>
[DataMember(Name="widthMetadata", EmitDefaultValue=false)]
public PropertyMetadata WidthMetadata { get; set; }
/// <summary>
/// This indicates the horizontal offset of the object on the page. DocuSign uses 72 DPI when determining position.
/// </summary>
/// <value>This indicates the horizontal offset of the object on the page. DocuSign uses 72 DPI when determining position.</value>
[DataMember(Name="xPosition", EmitDefaultValue=false)]
public string XPosition { get; set; }
/// <summary>
/// Gets or Sets XPositionMetadata
/// </summary>
[DataMember(Name="xPositionMetadata", EmitDefaultValue=false)]
public PropertyMetadata XPositionMetadata { get; set; }
/// <summary>
/// This indicates the vertical offset of the object on the page. DocuSign uses 72 DPI when determining position.
/// </summary>
/// <value>This indicates the vertical offset of the object on the page. DocuSign uses 72 DPI when determining position.</value>
[DataMember(Name="yPosition", EmitDefaultValue=false)]
public string YPosition { get; set; }
/// <summary>
/// Gets or Sets YPositionMetadata
/// </summary>
[DataMember(Name="yPositionMetadata", EmitDefaultValue=false)]
public PropertyMetadata YPositionMetadata { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class List {\n");
sb.Append(" AnchorAllowWhiteSpaceInCharacters: ").Append(AnchorAllowWhiteSpaceInCharacters).Append("\n");
sb.Append(" AnchorAllowWhiteSpaceInCharactersMetadata: ").Append(AnchorAllowWhiteSpaceInCharactersMetadata).Append("\n");
sb.Append(" AnchorCaseSensitive: ").Append(AnchorCaseSensitive).Append("\n");
sb.Append(" AnchorCaseSensitiveMetadata: ").Append(AnchorCaseSensitiveMetadata).Append("\n");
sb.Append(" AnchorHorizontalAlignment: ").Append(AnchorHorizontalAlignment).Append("\n");
sb.Append(" AnchorHorizontalAlignmentMetadata: ").Append(AnchorHorizontalAlignmentMetadata).Append("\n");
sb.Append(" AnchorIgnoreIfNotPresent: ").Append(AnchorIgnoreIfNotPresent).Append("\n");
sb.Append(" AnchorIgnoreIfNotPresentMetadata: ").Append(AnchorIgnoreIfNotPresentMetadata).Append("\n");
sb.Append(" AnchorMatchWholeWord: ").Append(AnchorMatchWholeWord).Append("\n");
sb.Append(" AnchorMatchWholeWordMetadata: ").Append(AnchorMatchWholeWordMetadata).Append("\n");
sb.Append(" AnchorString: ").Append(AnchorString).Append("\n");
sb.Append(" AnchorStringMetadata: ").Append(AnchorStringMetadata).Append("\n");
sb.Append(" AnchorTabProcessorVersion: ").Append(AnchorTabProcessorVersion).Append("\n");
sb.Append(" AnchorTabProcessorVersionMetadata: ").Append(AnchorTabProcessorVersionMetadata).Append("\n");
sb.Append(" AnchorUnits: ").Append(AnchorUnits).Append("\n");
sb.Append(" AnchorUnitsMetadata: ").Append(AnchorUnitsMetadata).Append("\n");
sb.Append(" AnchorXOffset: ").Append(AnchorXOffset).Append("\n");
sb.Append(" AnchorXOffsetMetadata: ").Append(AnchorXOffsetMetadata).Append("\n");
sb.Append(" AnchorYOffset: ").Append(AnchorYOffset).Append("\n");
sb.Append(" AnchorYOffsetMetadata: ").Append(AnchorYOffsetMetadata).Append("\n");
sb.Append(" Bold: ").Append(Bold).Append("\n");
sb.Append(" BoldMetadata: ").Append(BoldMetadata).Append("\n");
sb.Append(" ConditionalParentLabel: ").Append(ConditionalParentLabel).Append("\n");
sb.Append(" ConditionalParentLabelMetadata: ").Append(ConditionalParentLabelMetadata).Append("\n");
sb.Append(" ConditionalParentValue: ").Append(ConditionalParentValue).Append("\n");
sb.Append(" ConditionalParentValueMetadata: ").Append(ConditionalParentValueMetadata).Append("\n");
sb.Append(" CustomTabId: ").Append(CustomTabId).Append("\n");
sb.Append(" CustomTabIdMetadata: ").Append(CustomTabIdMetadata).Append("\n");
sb.Append(" DocumentId: ").Append(DocumentId).Append("\n");
sb.Append(" DocumentIdMetadata: ").Append(DocumentIdMetadata).Append("\n");
sb.Append(" ErrorDetails: ").Append(ErrorDetails).Append("\n");
sb.Append(" Font: ").Append(Font).Append("\n");
sb.Append(" FontColor: ").Append(FontColor).Append("\n");
sb.Append(" FontColorMetadata: ").Append(FontColorMetadata).Append("\n");
sb.Append(" FontMetadata: ").Append(FontMetadata).Append("\n");
sb.Append(" FontSize: ").Append(FontSize).Append("\n");
sb.Append(" FontSizeMetadata: ").Append(FontSizeMetadata).Append("\n");
sb.Append(" FormOrder: ").Append(FormOrder).Append("\n");
sb.Append(" FormOrderMetadata: ").Append(FormOrderMetadata).Append("\n");
sb.Append(" FormPageLabel: ").Append(FormPageLabel).Append("\n");
sb.Append(" FormPageLabelMetadata: ").Append(FormPageLabelMetadata).Append("\n");
sb.Append(" FormPageNumber: ").Append(FormPageNumber).Append("\n");
sb.Append(" FormPageNumberMetadata: ").Append(FormPageNumberMetadata).Append("\n");
sb.Append(" Height: ").Append(Height).Append("\n");
sb.Append(" HeightMetadata: ").Append(HeightMetadata).Append("\n");
sb.Append(" Italic: ").Append(Italic).Append("\n");
sb.Append(" ItalicMetadata: ").Append(ItalicMetadata).Append("\n");
sb.Append(" ListItems: ").Append(ListItems).Append("\n");
sb.Append(" ListSelectedValue: ").Append(ListSelectedValue).Append("\n");
sb.Append(" ListSelectedValueMetadata: ").Append(ListSelectedValueMetadata).Append("\n");
sb.Append(" LocalePolicy: ").Append(LocalePolicy).Append("\n");
sb.Append(" Locked: ").Append(Locked).Append("\n");
sb.Append(" LockedMetadata: ").Append(LockedMetadata).Append("\n");
sb.Append(" MergeField: ").Append(MergeField).Append("\n");
sb.Append(" MergeFieldXml: ").Append(MergeFieldXml).Append("\n");
sb.Append(" OriginalValue: ").Append(OriginalValue).Append("\n");
sb.Append(" OriginalValueMetadata: ").Append(OriginalValueMetadata).Append("\n");
sb.Append(" PageNumber: ").Append(PageNumber).Append("\n");
sb.Append(" PageNumberMetadata: ").Append(PageNumberMetadata).Append("\n");
sb.Append(" RecipientId: ").Append(RecipientId).Append("\n");
sb.Append(" RecipientIdGuid: ").Append(RecipientIdGuid).Append("\n");
sb.Append(" RecipientIdGuidMetadata: ").Append(RecipientIdGuidMetadata).Append("\n");
sb.Append(" RecipientIdMetadata: ").Append(RecipientIdMetadata).Append("\n");
sb.Append(" RequireAll: ").Append(RequireAll).Append("\n");
sb.Append(" RequireAllMetadata: ").Append(RequireAllMetadata).Append("\n");
sb.Append(" Required: ").Append(Required).Append("\n");
sb.Append(" RequiredMetadata: ").Append(RequiredMetadata).Append("\n");
sb.Append(" RequireInitialOnSharedChange: ").Append(RequireInitialOnSharedChange).Append("\n");
sb.Append(" RequireInitialOnSharedChangeMetadata: ").Append(RequireInitialOnSharedChangeMetadata).Append("\n");
sb.Append(" SenderRequired: ").Append(SenderRequired).Append("\n");
sb.Append(" SenderRequiredMetadata: ").Append(SenderRequiredMetadata).Append("\n");
sb.Append(" Shared: ").Append(Shared).Append("\n");
sb.Append(" SharedMetadata: ").Append(SharedMetadata).Append("\n");
sb.Append(" ShareToRecipients: ").Append(ShareToRecipients).Append("\n");
sb.Append(" ShareToRecipientsMetadata: ").Append(ShareToRecipientsMetadata).Append("\n");
sb.Append(" SmartContractInformation: ").Append(SmartContractInformation).Append("\n");
sb.Append(" Source: ").Append(Source).Append("\n");
sb.Append(" Status: ").Append(Status).Append("\n");
sb.Append(" StatusMetadata: ").Append(StatusMetadata).Append("\n");
sb.Append(" TabGroupLabels: ").Append(TabGroupLabels).Append("\n");
sb.Append(" TabGroupLabelsMetadata: ").Append(TabGroupLabelsMetadata).Append("\n");
sb.Append(" TabId: ").Append(TabId).Append("\n");
sb.Append(" TabIdMetadata: ").Append(TabIdMetadata).Append("\n");
sb.Append(" TabLabel: ").Append(TabLabel).Append("\n");
sb.Append(" TabLabelMetadata: ").Append(TabLabelMetadata).Append("\n");
sb.Append(" TabOrder: ").Append(TabOrder).Append("\n");
sb.Append(" TabOrderMetadata: ").Append(TabOrderMetadata).Append("\n");
sb.Append(" TabType: ").Append(TabType).Append("\n");
sb.Append(" TabTypeMetadata: ").Append(TabTypeMetadata).Append("\n");
sb.Append(" TemplateLocked: ").Append(TemplateLocked).Append("\n");
sb.Append(" TemplateLockedMetadata: ").Append(TemplateLockedMetadata).Append("\n");
sb.Append(" TemplateRequired: ").Append(TemplateRequired).Append("\n");
sb.Append(" TemplateRequiredMetadata: ").Append(TemplateRequiredMetadata).Append("\n");
sb.Append(" Tooltip: ").Append(Tooltip).Append("\n");
sb.Append(" ToolTipMetadata: ").Append(ToolTipMetadata).Append("\n");
sb.Append(" Underline: ").Append(Underline).Append("\n");
sb.Append(" UnderlineMetadata: ").Append(UnderlineMetadata).Append("\n");
sb.Append(" Value: ").Append(Value).Append("\n");
sb.Append(" ValueMetadata: ").Append(ValueMetadata).Append("\n");
sb.Append(" Width: ").Append(Width).Append("\n");
sb.Append(" WidthMetadata: ").Append(WidthMetadata).Append("\n");
sb.Append(" XPosition: ").Append(XPosition).Append("\n");
sb.Append(" XPositionMetadata: ").Append(XPositionMetadata).Append("\n");
sb.Append(" YPosition: ").Append(YPosition).Append("\n");
sb.Append(" YPositionMetadata: ").Append(YPositionMetadata).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
// credit: http://stackoverflow.com/a/10454552/677735
return this.Equals(obj as List);
}
/// <summary>
/// Returns true if List instances are equal
/// </summary>
/// <param name="other">Instance of List to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(List other)
{
// credit: http://stackoverflow.com/a/10454552/677735
if (other == null)
return false;
return
(
this.AnchorAllowWhiteSpaceInCharacters == other.AnchorAllowWhiteSpaceInCharacters ||
this.AnchorAllowWhiteSpaceInCharacters != null &&
this.AnchorAllowWhiteSpaceInCharacters.Equals(other.AnchorAllowWhiteSpaceInCharacters)
) &&
(
this.AnchorAllowWhiteSpaceInCharactersMetadata == other.AnchorAllowWhiteSpaceInCharactersMetadata ||
this.AnchorAllowWhiteSpaceInCharactersMetadata != null &&
this.AnchorAllowWhiteSpaceInCharactersMetadata.Equals(other.AnchorAllowWhiteSpaceInCharactersMetadata)
) &&
(
this.AnchorCaseSensitive == other.AnchorCaseSensitive ||
this.AnchorCaseSensitive != null &&
this.AnchorCaseSensitive.Equals(other.AnchorCaseSensitive)
) &&
(
this.AnchorCaseSensitiveMetadata == other.AnchorCaseSensitiveMetadata ||
this.AnchorCaseSensitiveMetadata != null &&
this.AnchorCaseSensitiveMetadata.Equals(other.AnchorCaseSensitiveMetadata)
) &&
(
this.AnchorHorizontalAlignment == other.AnchorHorizontalAlignment ||
this.AnchorHorizontalAlignment != null &&
this.AnchorHorizontalAlignment.Equals(other.AnchorHorizontalAlignment)
) &&
(
this.AnchorHorizontalAlignmentMetadata == other.AnchorHorizontalAlignmentMetadata ||
this.AnchorHorizontalAlignmentMetadata != null &&
this.AnchorHorizontalAlignmentMetadata.Equals(other.AnchorHorizontalAlignmentMetadata)
) &&
(
this.AnchorIgnoreIfNotPresent == other.AnchorIgnoreIfNotPresent ||
this.AnchorIgnoreIfNotPresent != null &&
this.AnchorIgnoreIfNotPresent.Equals(other.AnchorIgnoreIfNotPresent)
) &&
(
this.AnchorIgnoreIfNotPresentMetadata == other.AnchorIgnoreIfNotPresentMetadata ||
this.AnchorIgnoreIfNotPresentMetadata != null &&
this.AnchorIgnoreIfNotPresentMetadata.Equals(other.AnchorIgnoreIfNotPresentMetadata)
) &&
(
this.AnchorMatchWholeWord == other.AnchorMatchWholeWord ||
this.AnchorMatchWholeWord != null &&
this.AnchorMatchWholeWord.Equals(other.AnchorMatchWholeWord)
) &&
(
this.AnchorMatchWholeWordMetadata == other.AnchorMatchWholeWordMetadata ||
this.AnchorMatchWholeWordMetadata != null &&
this.AnchorMatchWholeWordMetadata.Equals(other.AnchorMatchWholeWordMetadata)
) &&
(
this.AnchorString == other.AnchorString ||
this.AnchorString != null &&
this.AnchorString.Equals(other.AnchorString)
) &&
(
this.AnchorStringMetadata == other.AnchorStringMetadata ||
this.AnchorStringMetadata != null &&
this.AnchorStringMetadata.Equals(other.AnchorStringMetadata)
) &&
(
this.AnchorTabProcessorVersion == other.AnchorTabProcessorVersion ||
this.AnchorTabProcessorVersion != null &&
this.AnchorTabProcessorVersion.Equals(other.AnchorTabProcessorVersion)
) &&
(
this.AnchorTabProcessorVersionMetadata == other.AnchorTabProcessorVersionMetadata ||
this.AnchorTabProcessorVersionMetadata != null &&
this.AnchorTabProcessorVersionMetadata.Equals(other.AnchorTabProcessorVersionMetadata)
) &&
(
this.AnchorUnits == other.AnchorUnits ||
this.AnchorUnits != null &&
this.AnchorUnits.Equals(other.AnchorUnits)
) &&
(
this.AnchorUnitsMetadata == other.AnchorUnitsMetadata ||
this.AnchorUnitsMetadata != null &&
this.AnchorUnitsMetadata.Equals(other.AnchorUnitsMetadata)
) &&
(
this.AnchorXOffset == other.AnchorXOffset ||
this.AnchorXOffset != null &&
this.AnchorXOffset.Equals(other.AnchorXOffset)
) &&
(
this.AnchorXOffsetMetadata == other.AnchorXOffsetMetadata ||
this.AnchorXOffsetMetadata != null &&
this.AnchorXOffsetMetadata.Equals(other.AnchorXOffsetMetadata)
) &&
(
this.AnchorYOffset == other.AnchorYOffset ||
this.AnchorYOffset != null &&
this.AnchorYOffset.Equals(other.AnchorYOffset)
) &&
(
this.AnchorYOffsetMetadata == other.AnchorYOffsetMetadata ||
this.AnchorYOffsetMetadata != null &&
this.AnchorYOffsetMetadata.Equals(other.AnchorYOffsetMetadata)
) &&
(
this.Bold == other.Bold ||
this.Bold != null &&
this.Bold.Equals(other.Bold)
) &&
(
this.BoldMetadata == other.BoldMetadata ||
this.BoldMetadata != null &&
this.BoldMetadata.Equals(other.BoldMetadata)
) &&
(
this.ConditionalParentLabel == other.ConditionalParentLabel ||
this.ConditionalParentLabel != null &&
this.ConditionalParentLabel.Equals(other.ConditionalParentLabel)
) &&
(
this.ConditionalParentLabelMetadata == other.ConditionalParentLabelMetadata ||
this.ConditionalParentLabelMetadata != null &&
this.ConditionalParentLabelMetadata.Equals(other.ConditionalParentLabelMetadata)
) &&
(
this.ConditionalParentValue == other.ConditionalParentValue ||
this.ConditionalParentValue != null &&
this.ConditionalParentValue.Equals(other.ConditionalParentValue)
) &&
(
this.ConditionalParentValueMetadata == other.ConditionalParentValueMetadata ||
this.ConditionalParentValueMetadata != null &&
this.ConditionalParentValueMetadata.Equals(other.ConditionalParentValueMetadata)
) &&
(
this.CustomTabId == other.CustomTabId ||
this.CustomTabId != null &&
this.CustomTabId.Equals(other.CustomTabId)
) &&
(
this.CustomTabIdMetadata == other.CustomTabIdMetadata ||
this.CustomTabIdMetadata != null &&
this.CustomTabIdMetadata.Equals(other.CustomTabIdMetadata)
) &&
(
this.DocumentId == other.DocumentId ||
this.DocumentId != null &&
this.DocumentId.Equals(other.DocumentId)
) &&
(
this.DocumentIdMetadata == other.DocumentIdMetadata ||
this.DocumentIdMetadata != null &&
this.DocumentIdMetadata.Equals(other.DocumentIdMetadata)
) &&
(
this.ErrorDetails == other.ErrorDetails ||
this.ErrorDetails != null &&
this.ErrorDetails.Equals(other.ErrorDetails)
) &&
(
this.Font == other.Font ||
this.Font != null &&
this.Font.Equals(other.Font)
) &&
(
this.FontColor == other.FontColor ||
this.FontColor != null &&
this.FontColor.Equals(other.FontColor)
) &&
(
this.FontColorMetadata == other.FontColorMetadata ||
this.FontColorMetadata != null &&
this.FontColorMetadata.Equals(other.FontColorMetadata)
) &&
(
this.FontMetadata == other.FontMetadata ||
this.FontMetadata != null &&
this.FontMetadata.Equals(other.FontMetadata)
) &&
(
this.FontSize == other.FontSize ||
this.FontSize != null &&
this.FontSize.Equals(other.FontSize)
) &&
(
this.FontSizeMetadata == other.FontSizeMetadata ||
this.FontSizeMetadata != null &&
this.FontSizeMetadata.Equals(other.FontSizeMetadata)
) &&
(
this.FormOrder == other.FormOrder ||
this.FormOrder != null &&
this.FormOrder.Equals(other.FormOrder)
) &&
(
this.FormOrderMetadata == other.FormOrderMetadata ||
this.FormOrderMetadata != null &&
this.FormOrderMetadata.Equals(other.FormOrderMetadata)
) &&
(
this.FormPageLabel == other.FormPageLabel ||
this.FormPageLabel != null &&
this.FormPageLabel.Equals(other.FormPageLabel)
) &&
(
this.FormPageLabelMetadata == other.FormPageLabelMetadata ||
this.FormPageLabelMetadata != null &&
this.FormPageLabelMetadata.Equals(other.FormPageLabelMetadata)
) &&
(
this.FormPageNumber == other.FormPageNumber ||
this.FormPageNumber != null &&
this.FormPageNumber.Equals(other.FormPageNumber)
) &&
(
this.FormPageNumberMetadata == other.FormPageNumberMetadata ||
this.FormPageNumberMetadata != null &&
this.FormPageNumberMetadata.Equals(other.FormPageNumberMetadata)
) &&
(
this.Height == other.Height ||
this.Height != null &&
this.Height.Equals(other.Height)
) &&
(
this.HeightMetadata == other.HeightMetadata ||
this.HeightMetadata != null &&
this.HeightMetadata.Equals(other.HeightMetadata)
) &&
(
this.Italic == other.Italic ||
this.Italic != null &&
this.Italic.Equals(other.Italic)
) &&
(
this.ItalicMetadata == other.ItalicMetadata ||
this.ItalicMetadata != null &&
this.ItalicMetadata.Equals(other.ItalicMetadata)
) &&
(
this.ListItems == other.ListItems ||
this.ListItems != null &&
this.ListItems.SequenceEqual(other.ListItems)
) &&
(
this.ListSelectedValue == other.ListSelectedValue ||
this.ListSelectedValue != null &&
this.ListSelectedValue.Equals(other.ListSelectedValue)
) &&
(
this.ListSelectedValueMetadata == other.ListSelectedValueMetadata ||
this.ListSelectedValueMetadata != null &&
this.ListSelectedValueMetadata.Equals(other.ListSelectedValueMetadata)
) &&
(
this.LocalePolicy == other.LocalePolicy ||
this.LocalePolicy != null &&
this.LocalePolicy.Equals(other.LocalePolicy)
) &&
(
this.Locked == other.Locked ||
this.Locked != null &&
this.Locked.Equals(other.Locked)
) &&
(
this.LockedMetadata == other.LockedMetadata ||
this.LockedMetadata != null &&
this.LockedMetadata.Equals(other.LockedMetadata)
) &&
(
this.MergeField == other.MergeField ||
this.MergeField != null &&
this.MergeField.Equals(other.MergeField)
) &&
(
this.MergeFieldXml == other.MergeFieldXml ||
this.MergeFieldXml != null &&
this.MergeFieldXml.Equals(other.MergeFieldXml)
) &&
(
this.OriginalValue == other.OriginalValue ||
this.OriginalValue != null &&
this.OriginalValue.Equals(other.OriginalValue)
) &&
(
this.OriginalValueMetadata == other.OriginalValueMetadata ||
this.OriginalValueMetadata != null &&
this.OriginalValueMetadata.Equals(other.OriginalValueMetadata)
) &&
(
this.PageNumber == other.PageNumber ||
this.PageNumber != null &&
this.PageNumber.Equals(other.PageNumber)
) &&
(
this.PageNumberMetadata == other.PageNumberMetadata ||
this.PageNumberMetadata != null &&
this.PageNumberMetadata.Equals(other.PageNumberMetadata)
) &&
(
this.RecipientId == other.RecipientId ||
this.RecipientId != null &&
this.RecipientId.Equals(other.RecipientId)
) &&
(
this.RecipientIdGuid == other.RecipientIdGuid ||
this.RecipientIdGuid != null &&
this.RecipientIdGuid.Equals(other.RecipientIdGuid)
) &&
(
this.RecipientIdGuidMetadata == other.RecipientIdGuidMetadata ||
this.RecipientIdGuidMetadata != null &&
this.RecipientIdGuidMetadata.Equals(other.RecipientIdGuidMetadata)
) &&
(
this.RecipientIdMetadata == other.RecipientIdMetadata ||
this.RecipientIdMetadata != null &&
this.RecipientIdMetadata.Equals(other.RecipientIdMetadata)
) &&
(
this.RequireAll == other.RequireAll ||
this.RequireAll != null &&
this.RequireAll.Equals(other.RequireAll)
) &&
(
this.RequireAllMetadata == other.RequireAllMetadata ||
this.RequireAllMetadata != null &&
this.RequireAllMetadata.Equals(other.RequireAllMetadata)
) &&
(
this.Required == other.Required ||
this.Required != null &&
this.Required.Equals(other.Required)
) &&
(
this.RequiredMetadata == other.RequiredMetadata ||
this.RequiredMetadata != null &&
this.RequiredMetadata.Equals(other.RequiredMetadata)
) &&
(
this.RequireInitialOnSharedChange == other.RequireInitialOnSharedChange ||
this.RequireInitialOnSharedChange != null &&
this.RequireInitialOnSharedChange.Equals(other.RequireInitialOnSharedChange)
) &&
(
this.RequireInitialOnSharedChangeMetadata == other.RequireInitialOnSharedChangeMetadata ||
this.RequireInitialOnSharedChangeMetadata != null &&
this.RequireInitialOnSharedChangeMetadata.Equals(other.RequireInitialOnSharedChangeMetadata)
) &&
(
this.SenderRequired == other.SenderRequired ||
this.SenderRequired != null &&
this.SenderRequired.Equals(other.SenderRequired)
) &&
(
this.SenderRequiredMetadata == other.SenderRequiredMetadata ||
this.SenderRequiredMetadata != null &&
this.SenderRequiredMetadata.Equals(other.SenderRequiredMetadata)
) &&
(
this.Shared == other.Shared ||
this.Shared != null &&
this.Shared.Equals(other.Shared)
) &&
(
this.SharedMetadata == other.SharedMetadata ||
this.SharedMetadata != null &&
this.SharedMetadata.Equals(other.SharedMetadata)
) &&
(
this.ShareToRecipients == other.ShareToRecipients ||
this.ShareToRecipients != null &&
this.ShareToRecipients.Equals(other.ShareToRecipients)
) &&
(
this.ShareToRecipientsMetadata == other.ShareToRecipientsMetadata ||
this.ShareToRecipientsMetadata != null &&
this.ShareToRecipientsMetadata.Equals(other.ShareToRecipientsMetadata)
) &&
(
this.SmartContractInformation == other.SmartContractInformation ||
this.SmartContractInformation != null &&
this.SmartContractInformation.Equals(other.SmartContractInformation)
) &&
(
this.Source == other.Source ||
this.Source != null &&
this.Source.Equals(other.Source)
) &&
(
this.Status == other.Status ||
this.Status != null &&
this.Status.Equals(other.Status)
) &&
(
this.StatusMetadata == other.StatusMetadata ||
this.StatusMetadata != null &&
this.StatusMetadata.Equals(other.StatusMetadata)
) &&
(
this.TabGroupLabels == other.TabGroupLabels ||
this.TabGroupLabels != null &&
this.TabGroupLabels.SequenceEqual(other.TabGroupLabels)
) &&
(
this.TabGroupLabelsMetadata == other.TabGroupLabelsMetadata ||
this.TabGroupLabelsMetadata != null &&
this.TabGroupLabelsMetadata.Equals(other.TabGroupLabelsMetadata)
) &&
(
this.TabId == other.TabId ||
this.TabId != null &&
this.TabId.Equals(other.TabId)
) &&
(
this.TabIdMetadata == other.TabIdMetadata ||
this.TabIdMetadata != null &&
this.TabIdMetadata.Equals(other.TabIdMetadata)
) &&
(
this.TabLabel == other.TabLabel ||
this.TabLabel != null &&
this.TabLabel.Equals(other.TabLabel)
) &&
(
this.TabLabelMetadata == other.TabLabelMetadata ||
this.TabLabelMetadata != null &&
this.TabLabelMetadata.Equals(other.TabLabelMetadata)
) &&
(
this.TabOrder == other.TabOrder ||
this.TabOrder != null &&
this.TabOrder.Equals(other.TabOrder)
) &&
(
this.TabOrderMetadata == other.TabOrderMetadata ||
this.TabOrderMetadata != null &&
this.TabOrderMetadata.Equals(other.TabOrderMetadata)
) &&
(
this.TabType == other.TabType ||
this.TabType != null &&
this.TabType.Equals(other.TabType)
) &&
(
this.TabTypeMetadata == other.TabTypeMetadata ||
this.TabTypeMetadata != null &&
this.TabTypeMetadata.Equals(other.TabTypeMetadata)
) &&
(
this.TemplateLocked == other.TemplateLocked ||
this.TemplateLocked != null &&
this.TemplateLocked.Equals(other.TemplateLocked)
) &&
(
this.TemplateLockedMetadata == other.TemplateLockedMetadata ||
this.TemplateLockedMetadata != null &&
this.TemplateLockedMetadata.Equals(other.TemplateLockedMetadata)
) &&
(
this.TemplateRequired == other.TemplateRequired ||
this.TemplateRequired != null &&
this.TemplateRequired.Equals(other.TemplateRequired)
) &&
(
this.TemplateRequiredMetadata == other.TemplateRequiredMetadata ||
this.TemplateRequiredMetadata != null &&
this.TemplateRequiredMetadata.Equals(other.TemplateRequiredMetadata)
) &&
(
this.Tooltip == other.Tooltip ||
this.Tooltip != null &&
this.Tooltip.Equals(other.Tooltip)
) &&
(
this.ToolTipMetadata == other.ToolTipMetadata ||
this.ToolTipMetadata != null &&
this.ToolTipMetadata.Equals(other.ToolTipMetadata)
) &&
(
this.Underline == other.Underline ||
this.Underline != null &&
this.Underline.Equals(other.Underline)
) &&
(
this.UnderlineMetadata == other.UnderlineMetadata ||
this.UnderlineMetadata != null &&
this.UnderlineMetadata.Equals(other.UnderlineMetadata)
) &&
(
this.Value == other.Value ||
this.Value != null &&
this.Value.Equals(other.Value)
) &&
(
this.ValueMetadata == other.ValueMetadata ||
this.ValueMetadata != null &&
this.ValueMetadata.Equals(other.ValueMetadata)
) &&
(
this.Width == other.Width ||
this.Width != null &&
this.Width.Equals(other.Width)
) &&
(
this.WidthMetadata == other.WidthMetadata ||
this.WidthMetadata != null &&
this.WidthMetadata.Equals(other.WidthMetadata)
) &&
(
this.XPosition == other.XPosition ||
this.XPosition != null &&
this.XPosition.Equals(other.XPosition)
) &&
(
this.XPositionMetadata == other.XPositionMetadata ||
this.XPositionMetadata != null &&
this.XPositionMetadata.Equals(other.XPositionMetadata)
) &&
(
this.YPosition == other.YPosition ||
this.YPosition != null &&
this.YPosition.Equals(other.YPosition)
) &&
(
this.YPositionMetadata == other.YPositionMetadata ||
this.YPositionMetadata != null &&
this.YPositionMetadata.Equals(other.YPositionMetadata)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
// credit: http://stackoverflow.com/a/263416/677735
unchecked // Overflow is fine, just wrap
{
int hash = 41;
// Suitable nullity checks etc, of course :)
if (this.AnchorAllowWhiteSpaceInCharacters != null)
hash = hash * 59 + this.AnchorAllowWhiteSpaceInCharacters.GetHashCode();
if (this.AnchorAllowWhiteSpaceInCharactersMetadata != null)
hash = hash * 59 + this.AnchorAllowWhiteSpaceInCharactersMetadata.GetHashCode();
if (this.AnchorCaseSensitive != null)
hash = hash * 59 + this.AnchorCaseSensitive.GetHashCode();
if (this.AnchorCaseSensitiveMetadata != null)
hash = hash * 59 + this.AnchorCaseSensitiveMetadata.GetHashCode();
if (this.AnchorHorizontalAlignment != null)
hash = hash * 59 + this.AnchorHorizontalAlignment.GetHashCode();
if (this.AnchorHorizontalAlignmentMetadata != null)
hash = hash * 59 + this.AnchorHorizontalAlignmentMetadata.GetHashCode();
if (this.AnchorIgnoreIfNotPresent != null)
hash = hash * 59 + this.AnchorIgnoreIfNotPresent.GetHashCode();
if (this.AnchorIgnoreIfNotPresentMetadata != null)
hash = hash * 59 + this.AnchorIgnoreIfNotPresentMetadata.GetHashCode();
if (this.AnchorMatchWholeWord != null)
hash = hash * 59 + this.AnchorMatchWholeWord.GetHashCode();
if (this.AnchorMatchWholeWordMetadata != null)
hash = hash * 59 + this.AnchorMatchWholeWordMetadata.GetHashCode();
if (this.AnchorString != null)
hash = hash * 59 + this.AnchorString.GetHashCode();
if (this.AnchorStringMetadata != null)
hash = hash * 59 + this.AnchorStringMetadata.GetHashCode();
if (this.AnchorTabProcessorVersion != null)
hash = hash * 59 + this.AnchorTabProcessorVersion.GetHashCode();
if (this.AnchorTabProcessorVersionMetadata != null)
hash = hash * 59 + this.AnchorTabProcessorVersionMetadata.GetHashCode();
if (this.AnchorUnits != null)
hash = hash * 59 + this.AnchorUnits.GetHashCode();
if (this.AnchorUnitsMetadata != null)
hash = hash * 59 + this.AnchorUnitsMetadata.GetHashCode();
if (this.AnchorXOffset != null)
hash = hash * 59 + this.AnchorXOffset.GetHashCode();
if (this.AnchorXOffsetMetadata != null)
hash = hash * 59 + this.AnchorXOffsetMetadata.GetHashCode();
if (this.AnchorYOffset != null)
hash = hash * 59 + this.AnchorYOffset.GetHashCode();
if (this.AnchorYOffsetMetadata != null)
hash = hash * 59 + this.AnchorYOffsetMetadata.GetHashCode();
if (this.Bold != null)
hash = hash * 59 + this.Bold.GetHashCode();
if (this.BoldMetadata != null)
hash = hash * 59 + this.BoldMetadata.GetHashCode();
if (this.ConditionalParentLabel != null)
hash = hash * 59 + this.ConditionalParentLabel.GetHashCode();
if (this.ConditionalParentLabelMetadata != null)
hash = hash * 59 + this.ConditionalParentLabelMetadata.GetHashCode();
if (this.ConditionalParentValue != null)
hash = hash * 59 + this.ConditionalParentValue.GetHashCode();
if (this.ConditionalParentValueMetadata != null)
hash = hash * 59 + this.ConditionalParentValueMetadata.GetHashCode();
if (this.CustomTabId != null)
hash = hash * 59 + this.CustomTabId.GetHashCode();
if (this.CustomTabIdMetadata != null)
hash = hash * 59 + this.CustomTabIdMetadata.GetHashCode();
if (this.DocumentId != null)
hash = hash * 59 + this.DocumentId.GetHashCode();
if (this.DocumentIdMetadata != null)
hash = hash * 59 + this.DocumentIdMetadata.GetHashCode();
if (this.ErrorDetails != null)
hash = hash * 59 + this.ErrorDetails.GetHashCode();
if (this.Font != null)
hash = hash * 59 + this.Font.GetHashCode();
if (this.FontColor != null)
hash = hash * 59 + this.FontColor.GetHashCode();
if (this.FontColorMetadata != null)
hash = hash * 59 + this.FontColorMetadata.GetHashCode();
if (this.FontMetadata != null)
hash = hash * 59 + this.FontMetadata.GetHashCode();
if (this.FontSize != null)
hash = hash * 59 + this.FontSize.GetHashCode();
if (this.FontSizeMetadata != null)
hash = hash * 59 + this.FontSizeMetadata.GetHashCode();
if (this.FormOrder != null)
hash = hash * 59 + this.FormOrder.GetHashCode();
if (this.FormOrderMetadata != null)
hash = hash * 59 + this.FormOrderMetadata.GetHashCode();
if (this.FormPageLabel != null)
hash = hash * 59 + this.FormPageLabel.GetHashCode();
if (this.FormPageLabelMetadata != null)
hash = hash * 59 + this.FormPageLabelMetadata.GetHashCode();
if (this.FormPageNumber != null)
hash = hash * 59 + this.FormPageNumber.GetHashCode();
if (this.FormPageNumberMetadata != null)
hash = hash * 59 + this.FormPageNumberMetadata.GetHashCode();
if (this.Height != null)
hash = hash * 59 + this.Height.GetHashCode();
if (this.HeightMetadata != null)
hash = hash * 59 + this.HeightMetadata.GetHashCode();
if (this.Italic != null)
hash = hash * 59 + this.Italic.GetHashCode();
if (this.ItalicMetadata != null)
hash = hash * 59 + this.ItalicMetadata.GetHashCode();
if (this.ListItems != null)
hash = hash * 59 + this.ListItems.GetHashCode();
if (this.ListSelectedValue != null)
hash = hash * 59 + this.ListSelectedValue.GetHashCode();
if (this.ListSelectedValueMetadata != null)
hash = hash * 59 + this.ListSelectedValueMetadata.GetHashCode();
if (this.LocalePolicy != null)
hash = hash * 59 + this.LocalePolicy.GetHashCode();
if (this.Locked != null)
hash = hash * 59 + this.Locked.GetHashCode();
if (this.LockedMetadata != null)
hash = hash * 59 + this.LockedMetadata.GetHashCode();
if (this.MergeField != null)
hash = hash * 59 + this.MergeField.GetHashCode();
if (this.MergeFieldXml != null)
hash = hash * 59 + this.MergeFieldXml.GetHashCode();
if (this.OriginalValue != null)
hash = hash * 59 + this.OriginalValue.GetHashCode();
if (this.OriginalValueMetadata != null)
hash = hash * 59 + this.OriginalValueMetadata.GetHashCode();
if (this.PageNumber != null)
hash = hash * 59 + this.PageNumber.GetHashCode();
if (this.PageNumberMetadata != null)
hash = hash * 59 + this.PageNumberMetadata.GetHashCode();
if (this.RecipientId != null)
hash = hash * 59 + this.RecipientId.GetHashCode();
if (this.RecipientIdGuid != null)
hash = hash * 59 + this.RecipientIdGuid.GetHashCode();
if (this.RecipientIdGuidMetadata != null)
hash = hash * 59 + this.RecipientIdGuidMetadata.GetHashCode();
if (this.RecipientIdMetadata != null)
hash = hash * 59 + this.RecipientIdMetadata.GetHashCode();
if (this.RequireAll != null)
hash = hash * 59 + this.RequireAll.GetHashCode();
if (this.RequireAllMetadata != null)
hash = hash * 59 + this.RequireAllMetadata.GetHashCode();
if (this.Required != null)
hash = hash * 59 + this.Required.GetHashCode();
if (this.RequiredMetadata != null)
hash = hash * 59 + this.RequiredMetadata.GetHashCode();
if (this.RequireInitialOnSharedChange != null)
hash = hash * 59 + this.RequireInitialOnSharedChange.GetHashCode();
if (this.RequireInitialOnSharedChangeMetadata != null)
hash = hash * 59 + this.RequireInitialOnSharedChangeMetadata.GetHashCode();
if (this.SenderRequired != null)
hash = hash * 59 + this.SenderRequired.GetHashCode();
if (this.SenderRequiredMetadata != null)
hash = hash * 59 + this.SenderRequiredMetadata.GetHashCode();
if (this.Shared != null)
hash = hash * 59 + this.Shared.GetHashCode();
if (this.SharedMetadata != null)
hash = hash * 59 + this.SharedMetadata.GetHashCode();
if (this.ShareToRecipients != null)
hash = hash * 59 + this.ShareToRecipients.GetHashCode();
if (this.ShareToRecipientsMetadata != null)
hash = hash * 59 + this.ShareToRecipientsMetadata.GetHashCode();
if (this.SmartContractInformation != null)
hash = hash * 59 + this.SmartContractInformation.GetHashCode();
if (this.Source != null)
hash = hash * 59 + this.Source.GetHashCode();
if (this.Status != null)
hash = hash * 59 + this.Status.GetHashCode();
if (this.StatusMetadata != null)
hash = hash * 59 + this.StatusMetadata.GetHashCode();
if (this.TabGroupLabels != null)
hash = hash * 59 + this.TabGroupLabels.GetHashCode();
if (this.TabGroupLabelsMetadata != null)
hash = hash * 59 + this.TabGroupLabelsMetadata.GetHashCode();
if (this.TabId != null)
hash = hash * 59 + this.TabId.GetHashCode();
if (this.TabIdMetadata != null)
hash = hash * 59 + this.TabIdMetadata.GetHashCode();
if (this.TabLabel != null)
hash = hash * 59 + this.TabLabel.GetHashCode();
if (this.TabLabelMetadata != null)
hash = hash * 59 + this.TabLabelMetadata.GetHashCode();
if (this.TabOrder != null)
hash = hash * 59 + this.TabOrder.GetHashCode();
if (this.TabOrderMetadata != null)
hash = hash * 59 + this.TabOrderMetadata.GetHashCode();
if (this.TabType != null)
hash = hash * 59 + this.TabType.GetHashCode();
if (this.TabTypeMetadata != null)
hash = hash * 59 + this.TabTypeMetadata.GetHashCode();
if (this.TemplateLocked != null)
hash = hash * 59 + this.TemplateLocked.GetHashCode();
if (this.TemplateLockedMetadata != null)
hash = hash * 59 + this.TemplateLockedMetadata.GetHashCode();
if (this.TemplateRequired != null)
hash = hash * 59 + this.TemplateRequired.GetHashCode();
if (this.TemplateRequiredMetadata != null)
hash = hash * 59 + this.TemplateRequiredMetadata.GetHashCode();
if (this.Tooltip != null)
hash = hash * 59 + this.Tooltip.GetHashCode();
if (this.ToolTipMetadata != null)
hash = hash * 59 + this.ToolTipMetadata.GetHashCode();
if (this.Underline != null)
hash = hash * 59 + this.Underline.GetHashCode();
if (this.UnderlineMetadata != null)
hash = hash * 59 + this.UnderlineMetadata.GetHashCode();
if (this.Value != null)
hash = hash * 59 + this.Value.GetHashCode();
if (this.ValueMetadata != null)
hash = hash * 59 + this.ValueMetadata.GetHashCode();
if (this.Width != null)
hash = hash * 59 + this.Width.GetHashCode();
if (this.WidthMetadata != null)
hash = hash * 59 + this.WidthMetadata.GetHashCode();
if (this.XPosition != null)
hash = hash * 59 + this.XPosition.GetHashCode();
if (this.XPositionMetadata != null)
hash = hash * 59 + this.XPositionMetadata.GetHashCode();
if (this.YPosition != null)
hash = hash * 59 + this.YPosition.GetHashCode();
if (this.YPositionMetadata != null)
hash = hash * 59 + this.YPositionMetadata.GetHashCode();
return hash;
}
}
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
yield break;
}
}
}
| 60.46029 | 5,634 | 0.600667 | [
"MIT"
] | shannonmae999/docusign-esign-csharp-client | sdk/src/DocuSign.eSign/Model/List.cs | 104,294 | C# |
using SmartSql.Configuration;
using SmartSql.Exceptions;
using SmartSql.Reflection.PropertyAccessor;
using SmartSql.Reflection.TypeConstants;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
using System.Threading.Tasks;
namespace SmartSql.Deserializer
{
public class MultipleResultDeserializer : IDataReaderDeserializer
{
private readonly IDeserializerFactory _deserializerFactory;
private readonly ISetAccessorFactory _setAccessorFactory;
public MultipleResultDeserializer(IDeserializerFactory deserializerFactory)
{
_deserializerFactory = deserializerFactory;
_setAccessorFactory = EmitSetAccessorFactory.Instance;
}
public bool CanDeserialize(ExecutionContext executionContext, Type resultType, bool isMultiple = false)
{
return isMultiple && !CommonType.IsValueTuple(resultType);
}
public TResult ToSingle<TResult>(ExecutionContext executionContext)
{
TResult result = default;
var resultType = executionContext.Result.ResultType;
var dataReader = executionContext.DataReaderWrapper;
var multipleResultMap = executionContext.Request.MultipleResultMap;
if (multipleResultMap.Root != null)
{
var deser = _deserializerFactory.Get(executionContext, executionContext.Result.ResultType);
result = deser.ToSingle<TResult>(executionContext);
if (result == null)
{
return default(TResult);
}
dataReader.NextResult();
}
else
{
result = (TResult)executionContext.SmartSqlConfig.ObjectFactoryBuilder.GetObjectFactory(resultType, Type.EmptyTypes)(null);
}
foreach (var resultMap in multipleResultMap.Results)
{
#region Set Muti Property
var propertyInfo = resultType.GetProperty(resultMap.Property);
var setProperty = _setAccessorFactory.Create(propertyInfo);
var deser = _deserializerFactory.Get(executionContext, propertyInfo.PropertyType);
var resultMapResult = TypeDeserializer.Deserialize(propertyInfo.PropertyType, deser, executionContext);
setProperty(result, resultMapResult);
#endregion
if (!dataReader.NextResult())
{
break;
}
}
return result;
}
public async Task<TResult> ToSingleAsync<TResult>(ExecutionContext executionContext)
{
TResult result = default;
var resultType = executionContext.Result.ResultType;
var dataReader = executionContext.DataReaderWrapper;
var multipleResultMap = executionContext.Request.MultipleResultMap;
if (multipleResultMap.Root != null)
{
var deser = _deserializerFactory.Get(executionContext);
result = deser.ToSingle<TResult>(executionContext);
if (result == null)
{
return default(TResult);
}
dataReader.NextResult();
}
else
{
result = (TResult)executionContext.SmartSqlConfig.ObjectFactoryBuilder.GetObjectFactory(resultType, Type.EmptyTypes)(null);
}
foreach (var resultMap in multipleResultMap.Results)
{
#region Set Muti Property
var propertyInfo = resultType.GetProperty(resultMap.Property);
var setProperty = _setAccessorFactory.Create(propertyInfo);
var deser = _deserializerFactory.Get(executionContext, propertyInfo.PropertyType);
var resultMapResult = TypeDeserializer.Deserialize(propertyInfo.PropertyType, deser, executionContext);
setProperty(result, resultMapResult);
#endregion
if (!await dataReader.NextResultAsync())
{
break;
}
}
return result;
}
public IList<TResult> ToList<TResult>(ExecutionContext executionContext)
{
throw new SmartSqlException("MultipleResultDeserializer can not support ToList.");
}
public Task<IList<TResult>> ToListAsync<TResult>(ExecutionContext executionContext)
{
throw new SmartSqlException("MultipleResultDeserializer can not support ToListAsync.");
}
}
}
| 41.184211 | 139 | 0.618956 | [
"Apache-2.0"
] | Joye-Net/SmartSql | src/SmartSql/Deserializer/MultipleResultDeserializer.cs | 4,697 | C# |
// Copyright (c) Converter Systems LLC. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Threading;
using System.Threading.Tasks;
namespace Workstation.ServiceModel.Ua
{
/// <summary>Defines the contract for the basic state machine for all communication-oriented objects in the system.</summary>
public interface ICommunicationObject
{
/// <summary>Gets the current state of the communication-oriented object.</summary>
/// <returns>The value of the <see cref="T:System.ServiceModel.CommunicationState" /> of the object.</returns>
CommunicationState State { get; }
/// <summary>Causes a communication object to transition immediately from its current state into the closed state. </summary>
/// <param name="token">The <see cref="T:System.Threading.CancellationToken" /> that notifies that the task should be canceled.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
Task AbortAsync(CancellationToken token = default(CancellationToken));
/// <summary>Causes a communication object to transition from its current state into the closed state. </summary>
/// <param name="token">The <see cref="T:System.Threading.CancellationToken" /> that notifies that the task should be canceled.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
Task CloseAsync(CancellationToken token = default(CancellationToken));
/// <summary>Causes a communication object to transition from the created state into the opened state. </summary>
/// <param name="token">The <see cref="T:System.Threading.CancellationToken" /> that notifies that the task should be canceled.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
Task OpenAsync(CancellationToken token = default(CancellationToken));
}
} | 65.451613 | 143 | 0.719566 | [
"MIT"
] | dojo90/opc-ua-client | UaClient/ServiceModel/Ua/ICommunicationObject.cs | 2,031 | C# |
using FluentAssertions;
using NSubstitute;
using System;
using System.Collections.Generic;
using System.Reactive.Linq;
using System.Threading.Tasks;
using Toggl.Core.DataSources.Interfaces;
using Toggl.Core.Interactors;
using Toggl.Core.Models.Interfaces;
using Toggl.Core.Tests.Generators;
using Toggl.Core.Tests.Mocks;
using Toggl.Storage.Models;
using Toggl.Networking.Sync.Push;
using Xunit;
using System.Linq;
using static Toggl.Storage.SyncStatus;
using Toggl.Networking.Network;
namespace Toggl.Core.Tests.Interactors.Workspace
{
public sealed class PreparePushRequestInteractorTests
{
public sealed class TheConstructor : BaseInteractorTests
{
[Theory, LogIfTooSlow]
[ConstructorData]
public void ThrowsIfAnyOfTheArgumentsIsNull(bool useDataSource)
{
Action tryingToConstructWithNull = () =>
new PreparePushRequestInteractor(UserAgent.ToString(), useDataSource ? DataSource : null);
tryingToConstructWithNull.Should().Throw<ArgumentNullException>();
}
}
public sealed class TheExecuteMethod : BaseInteractorTests
{
private readonly PreparePushRequestInteractor interactor;
public TheExecuteMethod()
{
interactor = new PreparePushRequestInteractor(UserAgent.ToString(), DataSource);
returnsValueOrEmpty(DataSource.Projects);
returnsValueOrEmpty(DataSource.Tasks);
returnsValueOrEmpty(DataSource.Clients);
returnsValueOrEmpty(DataSource.Tags);
returnsValueOrEmpty(DataSource.Workspaces);
returnsValueOrEmpty(DataSource.TimeEntries);
returnsValue(DataSource.User, new MockUser());
returnsValue(DataSource.Preferences, new MockPreferences());
}
[Fact, LogIfTooSlow]
public async Task EmitsEmptyRequestWhenThereAreNoEntities()
{
var request = await interactor.Execute();
request.IsEmpty.Should().BeTrue();
}
[Fact, LogIfTooSlow]
public async Task EmitsEmptyRequestWhenThereAreNoDirtyTags()
{
returnsValueOrEmpty(DataSource.Tags, new[] { new MockTag(), new MockTag() });
var request = await interactor.Execute();
request.IsEmpty.Should().BeTrue();
}
[Fact, LogIfTooSlow]
public async Task EmitsEmptyRequestWhenThereAreNoDirtyClients()
{
returnsValueOrEmpty(DataSource.Clients, new[] { new MockClient(), new MockClient() });
var request = await interactor.Execute();
request.IsEmpty.Should().BeTrue();
}
[Fact, LogIfTooSlow]
public async Task EmitsEmptyRequestWhenThereAreNoDirtyTasks()
{
returnsValueOrEmpty(DataSource.Tasks, new[] { new MockTask(), new MockTask() });
var request = await interactor.Execute();
request.IsEmpty.Should().BeTrue();
}
[Fact, LogIfTooSlow]
public async Task EmitsEmptyRequestWhenThereAreNoDirtyProjects()
{
returnsValueOrEmpty(DataSource.Projects, new[] { new MockProject(), new MockProject() });
var request = await interactor.Execute();
request.IsEmpty.Should().BeTrue();
}
[Fact, LogIfTooSlow]
public async Task EmitsEmptyRequestWhenThereAreNoDirtyTimeEntries()
{
returnsValueOrEmpty(DataSource.TimeEntries, new[] { new MockTimeEntry(), new MockTimeEntry() });
var request = await interactor.Execute();
request.IsEmpty.Should().BeTrue();
}
[Fact, LogIfTooSlow]
public async Task RequestContainsClientsCreations()
{
var clients = new[] {
new MockClient() { Id = -1, SyncStatus = SyncNeeded },
new MockClient() { Id = -2, SyncStatus = SyncNeeded }
};
var createdClientsCount = clients.Count(t => t.Id < 0);
returnsValueOrEmpty(DataSource.Clients, clients);
var request = await interactor.Execute();
request.IsEmpty.Should().BeFalse();
request.Clients.Count.Should().Be(createdClientsCount);
}
[Fact, LogIfTooSlow]
public async Task RequestContainsProjectsCreations()
{
var projects = new[] {
new MockProject() { Id = -1, SyncStatus = SyncNeeded , Color = "#000000" },
new MockProject() { Id = -2, SyncStatus = SyncNeeded , Color = "#000000" }
};
var createdProjectsCount = projects.Count(t => t.Id < 0);
returnsValueOrEmpty(DataSource.Projects, projects);
var request = await interactor.Execute();
request.IsEmpty.Should().BeFalse();
request.Projects.Count.Should().Be(createdProjectsCount);
}
[Fact, LogIfTooSlow]
public async Task RequestContainsTagsCreations()
{
var tags = new[] {
new MockTag() { Id = -1, SyncStatus = SyncNeeded },
new MockTag() { Id = -2, SyncStatus = SyncNeeded }
};
var createdTagsCount = tags.Count(t => t.Id < 0);
returnsValueOrEmpty(DataSource.Tags, tags);
var request = await interactor.Execute();
request.IsEmpty.Should().BeFalse();
request.Tags.Count.Should().Be(createdTagsCount);
}
[Fact, LogIfTooSlow]
public async Task RequestContainsPreferencesChanges()
{
var preferences = new MockPreferences() { SyncStatus = SyncNeeded };
returnsValue(DataSource.Preferences, preferences);
var request = await interactor.Execute();
request.IsEmpty.Should().BeFalse();
request.Preferences.Should().NotBeNull();
}
[Fact, LogIfTooSlow]
public async Task RequestContainsUserChanges()
{
var user = new MockUser() { SyncStatus = SyncNeeded };
returnsValue(DataSource.User, user);
var request = await interactor.Execute();
request.IsEmpty.Should().BeFalse();
request.User.Should().NotBeNull();
}
private MockTimeEntry[] createTimeEntries()
=> new[] {
new MockTimeEntry() { Id = -100, SyncStatus = SyncNeeded },
new MockTimeEntry() { Id = -200, SyncStatus = SyncNeeded },
new MockTimeEntry() { Id = -300, SyncStatus = SyncNeeded },
new MockTimeEntry() { Id = 1, Description = "ABC", SyncStatus = SyncNeeded },
new MockTimeEntry() { Id = 2, Description = "DEF", SyncStatus = SyncNeeded },
new MockTimeEntry() { Id = 99, SyncStatus = SyncNeeded, IsDeleted = true },
new MockTimeEntry() { Id = -99, SyncStatus = SyncNeeded, IsDeleted = true }
};
[Fact, LogIfTooSlow]
public async Task RequestContainsTimeEntryCreations()
{
var timeEntries = createTimeEntries();
var createdTimeEntriesCount = timeEntries.Count(t => t.Id < 0 && !t.IsDeleted);
returnsValueOrEmpty(DataSource.TimeEntries, timeEntries);
var request = await interactor.Execute();
request.IsEmpty.Should().BeFalse();
request.TimeEntries.Where(a => a.Type == ActionType.Create).Should().HaveCount(createdTimeEntriesCount);
}
[Fact, LogIfTooSlow]
public async Task TimeEntryCreationsHaveACorrectUserAgent()
{
var userAgentString = UserAgent.ToString();
returnsValueOrEmpty(DataSource.TimeEntries, createTimeEntries());
var request = await interactor.Execute();
request.TimeEntries
.Where(a => a.Type == ActionType.Create)
.All(te => ((Networking.Models.TimeEntry)te.Payload).CreatedWith == userAgentString)
.Should().BeTrue();
}
[Fact, LogIfTooSlow]
public async Task RequestDoesNotContainTimeEntryCreationsForLocalDeletes()
{
var timeEntries = createTimeEntries();
var createdTimeEntriesCount = timeEntries.Count(t => t.Id < 0 && !t.IsDeleted);
returnsValueOrEmpty(DataSource.TimeEntries, timeEntries);
var request = await interactor.Execute();
request.IsEmpty.Should().BeFalse();
request.TimeEntries.Where(a => a.Type == ActionType.Create).Should().HaveCount(createdTimeEntriesCount);
}
[Fact, LogIfTooSlow]
public async Task RequestContainsTimeEntryUpdates()
{
var timeEntries = createTimeEntries();
var updatedTimeEntriesCount = timeEntries.Count(t => t.Id >= 0 && t.SyncStatus == SyncNeeded && !t.IsDeleted);
returnsValueOrEmpty(DataSource.TimeEntries, timeEntries);
var request = await interactor.Execute();
request.IsEmpty.Should().BeFalse();
request.TimeEntries.Where(a => a.Type == ActionType.Update).Should().HaveCount(updatedTimeEntriesCount);
}
[Fact, LogIfTooSlow]
public async Task RequestContainsTimeEntryDeletions()
{
var timeEntries = createTimeEntries();
var deletedTimeEntriesCount = timeEntries.Count(t => t.Id >= 0 && t.IsDeleted);
returnsValueOrEmpty(DataSource.TimeEntries, timeEntries);
var request = await interactor.Execute();
request.IsEmpty.Should().BeFalse();
request.TimeEntries.Where(a => a.Type == ActionType.Delete).Should().HaveCount(deletedTimeEntriesCount);
}
private void returnsValueOrEmpty<TThreadsafe, TDatabase>(IDataSource<TThreadsafe, TDatabase> dataSource, IEnumerable<TThreadsafe> returnValue = null)
where TDatabase : IDatabaseModel
where TThreadsafe : TDatabase, IThreadSafeModel
{
returnValue ??= Array.Empty<TThreadsafe>();
dataSource
.GetAll(Arg.Any<Func<TDatabase, bool>>(), Arg.Any<bool>())
.Returns(callInfo => Observable.Return(returnValue.Where(item => callInfo.ArgAt<Func<TDatabase, bool>>(0)(item))));
}
private void returnsValue<TThreadsafe>(ISingletonDataSource<TThreadsafe> dataSource, TThreadsafe value)
where TThreadsafe : IThreadSafeModel
{
dataSource.Get().Returns(Observable.Return(value));
}
}
}
}
| 40.370107 | 161 | 0.574665 | [
"BSD-3-Clause"
] | moljac/mobileapp | Toggl.Core.Tests/Interactors/Sync/PreparePushRequestInteractorTests.cs | 11,344 | C# |
namespace AH.ModuleController.UI.ACCMS.Reports.ParameterForms
{
partial class frmACCMSReportLedger
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
this.smartLabel1 = new AtiqsControlLibrary.SmartLabel();
this.cboCompany = new AtiqsControlLibrary.SmartComboBox();
this.lblLabel = new AtiqsControlLibrary.SmartLabel();
this.lvlStartDate = new AtiqsControlLibrary.SmartLabel();
this.lvlEndDate = new AtiqsControlLibrary.SmartLabel();
this.dtStartDate = new System.Windows.Forms.DateTimePicker();
this.dtEndDate = new System.Windows.Forms.DateTimePicker();
this.cboLedgerName = new System.Windows.Forms.ComboBox();
this.txtCodeAllocation = new System.Windows.Forms.TextBox();
this.DGLedger = new AtiqsControlLibrary.SmartDataGridView();
this.Column11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.txtLName = new System.Windows.Forms.TextBox();
this.txtLCode = new System.Windows.Forms.TextBox();
this.lblName = new AtiqsControlLibrary.SmartLabel();
this.pnlMain.SuspendLayout();
this.pnlTop.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.DGLedger)).BeginInit();
this.SuspendLayout();
//
// btnClose
//
this.btnClose.Location = new System.Drawing.Point(473, 324);
//
// btnPrint
//
this.btnPrint.Location = new System.Drawing.Point(359, 324);
this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
//
// frmLabel
//
this.frmLabel.Location = new System.Drawing.Point(240, 9);
this.frmLabel.Size = new System.Drawing.Size(0, 32);
this.frmLabel.Text = "";
//
// pnlMain
//
this.pnlMain.Controls.Add(this.DGLedger);
this.pnlMain.Controls.Add(this.lblName);
this.pnlMain.Controls.Add(this.txtLCode);
this.pnlMain.Controls.Add(this.txtLName);
this.pnlMain.Controls.Add(this.txtCodeAllocation);
this.pnlMain.Controls.Add(this.cboLedgerName);
this.pnlMain.Controls.Add(this.dtEndDate);
this.pnlMain.Controls.Add(this.dtStartDate);
this.pnlMain.Controls.Add(this.lvlStartDate);
this.pnlMain.Controls.Add(this.lvlEndDate);
this.pnlMain.Controls.Add(this.lblLabel);
this.pnlMain.Controls.Add(this.smartLabel1);
this.pnlMain.Controls.Add(this.cboCompany);
this.pnlMain.Location = new System.Drawing.Point(0, 60);
this.pnlMain.Size = new System.Drawing.Size(694, 261);
//
// pnlTop
//
this.pnlTop.Size = new System.Drawing.Size(584, 57);
//
// smartLabel1
//
this.smartLabel1.AutoSize = true;
this.smartLabel1.BackColor = System.Drawing.Color.Transparent;
this.smartLabel1.Font = new System.Drawing.Font("Book Antiqua", 9.75F, System.Drawing.FontStyle.Bold);
this.smartLabel1.Location = new System.Drawing.Point(103, 34);
this.smartLabel1.Name = "smartLabel1";
this.smartLabel1.Size = new System.Drawing.Size(109, 18);
this.smartLabel1.TabIndex = 27;
this.smartLabel1.Text = "Company Name:";
//
// cboCompany
//
this.cboCompany.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboCompany.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cboCompany.ForeColor = System.Drawing.Color.Blue;
this.cboCompany.FormattingEnabled = true;
this.cboCompany.Location = new System.Drawing.Point(223, 31);
this.cboCompany.Name = "cboCompany";
this.cboCompany.Size = new System.Drawing.Size(346, 26);
this.cboCompany.TabIndex = 26;
this.cboCompany.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cboCompany_KeyPress);
//
// lblLabel
//
this.lblLabel.AutoSize = true;
this.lblLabel.BackColor = System.Drawing.Color.Transparent;
this.lblLabel.Font = new System.Drawing.Font("Book Antiqua", 9.75F, System.Drawing.FontStyle.Bold);
this.lblLabel.Location = new System.Drawing.Point(125, 81);
this.lblLabel.Name = "lblLabel";
this.lblLabel.Size = new System.Drawing.Size(87, 18);
this.lblLabel.TabIndex = 29;
this.lblLabel.Text = "Ledger Code:";
//
// lvlStartDate
//
this.lvlStartDate.AutoSize = true;
this.lvlStartDate.BackColor = System.Drawing.Color.Transparent;
this.lvlStartDate.Font = new System.Drawing.Font("Book Antiqua", 9.75F, System.Drawing.FontStyle.Bold);
this.lvlStartDate.Location = new System.Drawing.Point(135, 182);
this.lvlStartDate.Name = "lvlStartDate";
this.lvlStartDate.Size = new System.Drawing.Size(71, 18);
this.lvlStartDate.TabIndex = 32;
this.lvlStartDate.Text = "Start Date:";
//
// lvlEndDate
//
this.lvlEndDate.AutoSize = true;
this.lvlEndDate.BackColor = System.Drawing.Color.Transparent;
this.lvlEndDate.Font = new System.Drawing.Font("Book Antiqua", 9.75F, System.Drawing.FontStyle.Bold);
this.lvlEndDate.Location = new System.Drawing.Point(365, 183);
this.lvlEndDate.Name = "lvlEndDate";
this.lvlEndDate.Size = new System.Drawing.Size(67, 18);
this.lvlEndDate.TabIndex = 33;
this.lvlEndDate.Text = "End Date:";
//
// dtStartDate
//
this.dtStartDate.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.dtStartDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
this.dtStartDate.Location = new System.Drawing.Point(223, 179);
this.dtStartDate.Name = "dtStartDate";
this.dtStartDate.Size = new System.Drawing.Size(131, 26);
this.dtStartDate.TabIndex = 34;
this.dtStartDate.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.dtStartDate_KeyPress);
//
// dtEndDate
//
this.dtEndDate.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.dtEndDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
this.dtEndDate.Location = new System.Drawing.Point(440, 179);
this.dtEndDate.Name = "dtEndDate";
this.dtEndDate.Size = new System.Drawing.Size(129, 26);
this.dtEndDate.TabIndex = 35;
this.dtEndDate.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.dtEndDate_KeyPress);
//
// cboLedgerName
//
this.cboLedgerName.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cboLedgerName.FormattingEnabled = true;
this.cboLedgerName.Location = new System.Drawing.Point(11, 59);
this.cboLedgerName.Name = "cboLedgerName";
this.cboLedgerName.Size = new System.Drawing.Size(42, 24);
this.cboLedgerName.TabIndex = 36;
this.cboLedgerName.Visible = false;
this.cboLedgerName.KeyUp += new System.Windows.Forms.KeyEventHandler(this.cboLedgerName_KeyUp);
//
// txtCodeAllocation
//
this.txtCodeAllocation.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtCodeAllocation.Font = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtCodeAllocation.Location = new System.Drawing.Point(223, 78);
this.txtCodeAllocation.Name = "txtCodeAllocation";
this.txtCodeAllocation.Size = new System.Drawing.Size(343, 27);
this.txtCodeAllocation.TabIndex = 37;
this.txtCodeAllocation.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtLName_KeyDown);
this.txtCodeAllocation.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtLName_KeyPress);
this.txtCodeAllocation.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtLName_KeyUp);
//
// DGLedger
//
this.DGLedger.AllowUserToAddRows = false;
this.DGLedger.AllowUserToDeleteRows = false;
this.DGLedger.AllowUserToOrderColumns = true;
this.DGLedger.AllowUserToResizeColumns = false;
this.DGLedger.AllowUserToResizeRows = false;
this.DGLedger.BackgroundColor = System.Drawing.Color.White;
this.DGLedger.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.LightGreen;
dataGridViewCellStyle1.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle1.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
this.DGLedger.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.DGLedger.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.DGLedger.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column11,
this.Column12,
this.Column1});
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle3.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle3.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle3.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.Lavender;
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.Color.Crimson;
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.DGLedger.DefaultCellStyle = dataGridViewCellStyle3;
this.DGLedger.Location = new System.Drawing.Point(132, 107);
this.DGLedger.MultiSelect = false;
this.DGLedger.Name = "DGLedger";
this.DGLedger.RowHeadersVisible = false;
dataGridViewCellStyle4.BackColor = System.Drawing.Color.White;
this.DGLedger.RowsDefaultCellStyle = dataGridViewCellStyle4;
this.DGLedger.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.DGLedger.Size = new System.Drawing.Size(437, 140);
this.DGLedger.TabIndex = 143;
this.DGLedger.Visible = false;
this.DGLedger.DoubleClick += new System.EventHandler(this.DGLedger_DoubleClick);
this.DGLedger.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.DGLedger_KeyPress);
//
// Column11
//
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopCenter;
this.Column11.DefaultCellStyle = dataGridViewCellStyle2;
this.Column11.HeaderText = "L Code";
this.Column11.Name = "Column11";
this.Column11.ReadOnly = true;
this.Column11.Width = 120;
//
// Column12
//
this.Column12.HeaderText = "Code";
this.Column12.Name = "Column12";
this.Column12.ReadOnly = true;
this.Column12.Visible = false;
//
// Column1
//
this.Column1.HeaderText = "Name";
this.Column1.Name = "Column1";
this.Column1.ReadOnly = true;
this.Column1.Width = 300;
//
// txtLName
//
this.txtLName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtLName.Enabled = false;
this.txtLName.Font = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtLName.ForeColor = System.Drawing.SystemColors.Window;
this.txtLName.Location = new System.Drawing.Point(223, 111);
this.txtLName.Name = "txtLName";
this.txtLName.Size = new System.Drawing.Size(343, 27);
this.txtLName.TabIndex = 144;
//
// txtLCode
//
this.txtLCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtLCode.Font = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtLCode.Location = new System.Drawing.Point(48, 2);
this.txtLCode.Name = "txtLCode";
this.txtLCode.Size = new System.Drawing.Size(142, 27);
this.txtLCode.TabIndex = 145;
this.txtLCode.Visible = false;
//
// lblName
//
this.lblName.AutoSize = true;
this.lblName.BackColor = System.Drawing.Color.Transparent;
this.lblName.Font = new System.Drawing.Font("Book Antiqua", 9.75F, System.Drawing.FontStyle.Bold);
this.lblName.Location = new System.Drawing.Point(119, 114);
this.lblName.Name = "lblName";
this.lblName.Size = new System.Drawing.Size(93, 18);
this.lblName.TabIndex = 146;
this.lblName.Text = "Ledger Name:";
//
// frmACCMSReportLedger
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.ClientSize = new System.Drawing.Size(584, 386);
this.KeyPreview = false;
this.Name = "frmACCMSReportLedger";
this.Load += new System.EventHandler(this.frmACCMSReportLedger_Load);
this.pnlMain.ResumeLayout(false);
this.pnlMain.PerformLayout();
this.pnlTop.ResumeLayout(false);
this.pnlTop.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.DGLedger)).EndInit();
this.ResumeLayout(false);
}
#endregion
private AtiqsControlLibrary.SmartLabel smartLabel1;
private AtiqsControlLibrary.SmartComboBox cboCompany;
private AtiqsControlLibrary.SmartLabel lblLabel;
private AtiqsControlLibrary.SmartLabel lvlStartDate;
private AtiqsControlLibrary.SmartLabel lvlEndDate;
private System.Windows.Forms.DateTimePicker dtEndDate;
private System.Windows.Forms.DateTimePicker dtStartDate;
private System.Windows.Forms.ComboBox cboLedgerName;
private System.Windows.Forms.TextBox txtCodeAllocation;
private AtiqsControlLibrary.SmartDataGridView DGLedger;
private System.Windows.Forms.TextBox txtLName;
private System.Windows.Forms.TextBox txtLCode;
private AtiqsControlLibrary.SmartLabel lblName;
private System.Windows.Forms.DataGridViewTextBoxColumn Column11;
private System.Windows.Forms.DataGridViewTextBoxColumn Column12;
private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
}
}
| 55.009259 | 170 | 0.634629 | [
"Apache-2.0"
] | atiq-shumon/DotNetProjects | Hospital_ERP_VS13-WCF_WF/AH.ModuleController/UI/ACCMS/Reports/ParameterForms/frmACCMSReportLedger.Designer.cs | 17,825 | C# |
//******************************************************************************************************
// NotConverter.cs - Gbtc
//
// Copyright © 2012, Grid Protection Alliance. All Rights Reserved.
//
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
// The GPA licenses this file to you under the MIT License (MIT), 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.opensource.org/licenses/MIT
//
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
// License for the specific language governing permissions and limitations.
//
// Code Modification History:
// ----------------------------------------------------------------------------------------------------
// 03/24/2011 - Mehulbhai P Thakkar
// Generated original version of source code.
// 12/20/2012 - Starlynn Danyelle Gilliam
// Modified Header.
//
//******************************************************************************************************
using System;
using System.Globalization;
using System.Windows.Data;
namespace GSF.TimeSeries.UI.Converters
{
/// <summary>
/// Represents an <see cref="IValueConverter"/> to invert boolean value.
/// </summary>
[ValueConversion(typeof(bool), typeof(bool))]
public class NotConverter : IValueConverter
{
#region [ IValueConverter Members ]
/// <summary>
/// Inverts value of boolean object.
/// </summary>
/// <param name="value">Boolean object to be inverted.</param>
/// <param name="targetType">The type of the binding target property.</param>
/// <param name="parameter">The converter parameter to use.</param>
/// <param name="culture">The culture to use in the converter.</param>
/// <returns>Boolean value for UI use.</returns>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return InvertBoolean(value);
}
/// <summary>
/// Inverts value of boolean object.
/// </summary>
/// <param name="value">Boolean object to be inverted.</param>
/// <param name="targetType">The type of the binding target property.</param>
/// <param name="parameter">The converter parameter to use.</param>
/// <param name="culture">The culture to use in the converter.</param>
/// <returns>Boolean value for UI use.</returns>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return InvertBoolean(value);
}
#endregion
#region [ Methods ]
/// <summary>
/// Inverts value of boolean object.
/// </summary>
/// <param name="value">boolean value to be inverted.</param>
/// <returns></returns>
private static object InvertBoolean(object value)
{
return !value.ToString().ParseBoolean();
}
#endregion
}
}
| 40.783133 | 105 | 0.586706 | [
"MIT"
] | GridProtectionAlliance/gsf | Source/Libraries/GSF.TimeSeries/UI/Converters/NotConverter.cs | 3,388 | C# |
using System.Collections.Generic;
using System;
namespace StoreList
{
public class Stack
{
private readonly List<object> _list= new List<object>();
public void Push()
{
Console.WriteLine("\n\nIntroduce los datos que quieras almacenar en la lista, " +
"presiona 'E' cuando quieras dejar de introducir datos");
while (true)
{
_list.Insert(0,Console.ReadLine());
if (_list[0].ToString() == "e")
{
_list.Remove("e");
break;
}
else if (string.IsNullOrEmpty(_list[0].ToString()))
{
Console.WriteLine("\n********************No se puede introducir datos nulos o empty string a la lista*************************");
_list.Remove(_list[0]);
break;
}
}
Eleccion();
}
public object Pop()
{
return _list[0];
}
public void Clear()
{
Console.WriteLine("\n********************La lista ya esta vacia***********************************");
_list.Clear();
Eleccion();
}
public void Eleccion()
{
Console.WriteLine("\nPara continuar introduciendo datos a la lista presiona 'A', para mostrar el valor top de la lista presiona 'M'" +
"y para limpiar la lista presiona 'C'");
string answer = Console.ReadLine();
switch (answer.ToLower())
{
case "a":
Push();
break;
case "m":
Console.WriteLine("\nPresiona 'enter' para ir mostrando el valor top de la lista, presiona 'e' para salir ");
Console.WriteLine("\n La lista tiene un total de {0} elementos", _list.Count);
var take = Console.ReadLine();
while (true)
{
if (take.ToLower() == "e")
{
break;
}
else
{
if (_list.Count == 0)
{
Console.WriteLine("\n********************La lista no contiene mas elementos***********************************");
break;
}
else
{
Console.WriteLine(Pop());
_list.Remove(_list[0]);
Console.ReadKey();
}
}
}
Eleccion();
break;
case "c":
Clear();
break;
}
}
}
}
| 30.425743 | 149 | 0.355678 | [
"MIT"
] | D-Rosa99/StackList | StoreList/StoreList/Stack.cs | 3,075 | 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 enable
using System.Reflection;
#if DEBUG || BOOTSTRAP
using System;
using System.Collections.Concurrent;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Threading;
using Microsoft.Build.Utilities;
using Roslyn.Utilities;
#endif
namespace Microsoft.CodeAnalysis.BuildTasks
{
using static Microsoft.CodeAnalysis.CommandLine.BuildResponse;
#if DEBUG || BOOTSTRAP
/// <summary>
/// This task exists to help us validate our bootstrap building phase is executing correctly. The bootstrap
/// phase of CI is the best way to validate the integration of our components is functioning correctly. Items
/// which are difficult to validate in a unit test scenario.
/// </summary>
public sealed partial class ValidateBootstrap : Task
{
private static readonly ConcurrentDictionary<AssemblyName, byte> s_failedLoadSet = new ConcurrentDictionary<AssemblyName, byte>();
private static readonly ConcurrentQueue<(ResponseType ResponseType, string? OutputAssembly)> s_failedQueue = new ConcurrentQueue<(ResponseType ResponseType, string? OutputAssembly)>();
private string? _tasksAssemblyFullPath;
[DisallowNull]
public string? TasksAssemblyFullPath
{
get { return _tasksAssemblyFullPath; }
set { _tasksAssemblyFullPath = NormalizePath(Path.GetFullPath(value!)); }
}
public ValidateBootstrap()
{
}
public override bool Execute()
{
if (TasksAssemblyFullPath is null)
{
Log.LogError($"{nameof(ValidateBootstrap)} task must have a {nameof(TasksAssemblyFullPath)} parameter.");
return false;
}
var allGood = true;
var fullPath = typeof(ValidateBootstrap).Assembly.Location;
if (!StringComparer.OrdinalIgnoreCase.Equals(TasksAssemblyFullPath, fullPath))
{
Log.LogError($"Bootstrap assembly {Path.GetFileName(fullPath)} incorrectly loaded from {fullPath} instead of {TasksAssemblyFullPath}");
allGood = false;
}
var failedLoads = s_failedLoadSet.Keys.ToList();
if (failedLoads.Count > 0)
{
foreach (var name in failedLoads.OrderBy(x => x.Name))
{
Log.LogError($"Assembly resolution failed for {name}");
allGood = false;
}
}
// The number chosen is arbitrary here. The goal of this check is to catch cases where a coding error has
// broken our ability to use the compiler server in the bootstrap phase.
//
// It's possible on completely correct code for the server connection to fail. There could be simply
// named pipe errors, CPU load causing timeouts, etc ... Hence flagging a single failure would produce
// a lot of false positives. The current value was chosen as a reasonable number for warranting an
// investigation.
const int maxRejectCount = 5;
var rejectCount = 0;
foreach (var tuple in s_failedQueue.ToList())
{
switch (tuple.ResponseType)
{
case ResponseType.AnalyzerInconsistency:
Log.LogError($"Analyzer inconsistency building {tuple.OutputAssembly}");
allGood = false;
break;
case ResponseType.MismatchedVersion:
case ResponseType.IncorrectHash:
Log.LogError($"Critical error {tuple.ResponseType} building {tuple.OutputAssembly}");
allGood = false;
break;
case ResponseType.Rejected:
rejectCount++;
if (rejectCount > maxRejectCount)
{
Log.LogError($"Too many compiler server connection failures detected");
allGood = false;
}
break;
case ResponseType.Completed:
case ResponseType.Shutdown:
// Expected messages
break;
default:
Log.LogError($"Unexpected response type {tuple.ResponseType}");
allGood = false;
break;
}
}
return allGood;
}
[return: NotNullIfNotNull("path")]
private static string? NormalizePath(string? path)
{
if (RoslynString.IsNullOrEmpty(path))
{
return path;
}
var c = path[path.Length - 1];
if (c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar)
{
path = path.Substring(0, path.Length - 1);
}
return path;
}
private string? GetDirectory(Assembly assembly) => Path.GetDirectoryName(Utilities.TryGetAssemblyPath(assembly));
internal static void AddFailedLoad(AssemblyName name)
{
switch (name.Name)
{
case "System":
case "System.Core":
case "Microsoft.Build.Tasks.CodeAnalysis.resources":
// These are failures are expected by design.
break;
default:
s_failedLoadSet.TryAdd(name, 0);
break;
}
}
internal static void AddFailedServerConnection(ResponseType type, string? outputAssembly)
{
s_failedQueue.Enqueue((type, outputAssembly));
}
}
#endif
internal static class ValidateBootstrapUtil
{
internal static void AddFailedLoad(AssemblyName name)
{
#if DEBUG || BOOTSTRAP
ValidateBootstrap.AddFailedLoad(name);
#endif
}
internal static void AddFailedServerConnection(ResponseType type, string? outputAssembly)
{
#if DEBUG || BOOTSTRAP
ValidateBootstrap.AddFailedServerConnection(type, outputAssembly);
#endif
}
}
}
| 37.101695 | 192 | 0.575758 | [
"MIT"
] | Dean-ZhenYao-Wang/roslyn | src/Compilers/Core/MSBuildTask/ValidateBootstrap.cs | 6,569 | C# |
namespace SimpleMvc.App.Controllers
{
using SimpleMVC.Framework.Attributes.Methods;
using SimpleMVC.Framework.Interfaces;
public class HomeController : BaseController
{
[HttpGet]
public IActionResult Index()
{
return View();
}
}
}
| 19.8 | 49 | 0.622896 | [
"MIT"
] | DannyBerova/CSharp-Web-Development-Basics-May-2018 | 08-AdvancedMVCFramework-Exercise/SimpleMVCFramework/SimpleMvc.App/Controllers/HomeController.cs | 299 | C# |
#pragma checksum "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "ac4eabc98fdf631be1846e93d5f902c1386b3a9e"
// <auto-generated/>
#pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Client_Order), @"mvc.1.0.view", @"/Views/Client/Order.cshtml")]
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/Views/Client/Order.cshtml", typeof(AspNetCore.Views_Client_Order))]
namespace AspNetCore
{
#line hidden
#line 11 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\_ViewImports.cshtml"
using System;
#line default
#line hidden
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
#line 1 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\_ViewImports.cshtml"
using Microsoft.AspNetCore.Identity;
#line default
#line hidden
#line 2 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\_ViewImports.cshtml"
using Foodie1;
#line default
#line hidden
#line 3 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\_ViewImports.cshtml"
using Foodie1.Models;
#line default
#line hidden
#line 4 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\_ViewImports.cshtml"
using Foodie1.Models.AccountViewModels;
#line default
#line hidden
#line 5 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\_ViewImports.cshtml"
using Foodie1.Models.ManageViewModels;
#line default
#line hidden
#line 6 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\_ViewImports.cshtml"
using Foodie1.Models.RestaurantViewModels;
#line default
#line hidden
#line 8 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\_ViewImports.cshtml"
using Foodie1.Controllers;
#line default
#line hidden
#line 9 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\_ViewImports.cshtml"
using Foodie1.Data;
#line default
#line hidden
#line 10 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\_ViewImports.cshtml"
using System.Globalization;
#line default
#line hidden
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"ac4eabc98fdf631be1846e93d5f902c1386b3a9e", @"/Views/Client/Order.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"3d4c33097155458e56da0e7bf9f16cf61390e617", @"/Views/_ViewImports.cshtml")]
public class Views_Client_Order : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<OrderViewModel>
{
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("rel", new global::Microsoft.AspNetCore.Html.HtmlString("stylesheet"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", new global::Microsoft.AspNetCore.Html.HtmlString("text/css"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("href", new global::Microsoft.AspNetCore.Html.HtmlString("~/styles/bootstrap-4.1.2/bootstrap.min.css"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_3 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("href", new global::Microsoft.AspNetCore.Html.HtmlString("~/css/style.css"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_4 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("href", new global::Microsoft.AspNetCore.Html.HtmlString("~/css/menu.css"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_5 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("href", new global::Microsoft.AspNetCore.Html.HtmlString("~/css/menu_responsive.css"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_6 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("href", new global::Microsoft.AspNetCore.Html.HtmlString("~/css/bootstrap.min.css"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_7 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("href", new global::Microsoft.AspNetCore.Html.HtmlString("~/css/simple-line-icons.css"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_8 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("href", new global::Microsoft.AspNetCore.Html.HtmlString("~/css/themify-icons.css"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_9 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("href", new global::Microsoft.AspNetCore.Html.HtmlString("~/css/set1.css"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_10 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("href", new global::Microsoft.AspNetCore.Html.HtmlString("~/css/swiper.min.css"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_11 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("href", new global::Microsoft.AspNetCore.Html.HtmlString("~/css/magnific-popup.css"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_12 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/js/jquery-3.2.1.min.js"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_13 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/styles/bootstrap-4.1.2/popper.js"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_14 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/styles/bootstrap-4.1.2/bootstrap.min.js"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_15 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/plugins/greensock/TweenMax.min.js"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_16 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/plugins/greensock/TimelineMax.min.js"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_17 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/plugins/scrollmagic/ScrollMagic.min.js"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_18 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/plugins/greensock/animation.gsap.min.js"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_19 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/plugins/greensock/ScrollToPlugin.min.js"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_20 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/plugins/OwlCarousel2-2.2.1/owl.carousel.js"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_21 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/plugins/easing/easing.js"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_22 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/plugins/parallax-js-master/parallax.min.js"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_23 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/plugins/colorbox/jquery.colorbox-min.js"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_24 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/plugins/jquery-datepicker/jquery-ui.js"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_25 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/plugins/jquery-timepicker/jquery.timepicker.js"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_26 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/js/custom.js"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_27 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "hidden", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_28 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("id", new global::Microsoft.AspNetCore.Html.HtmlString("hiddenVal"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_29 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("id", new global::Microsoft.AspNetCore.Html.HtmlString("restaurantId"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_30 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("asp-action", "FinishOrder", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_31 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("asp-controller", "Client", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_32 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("method", "post", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_33 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("onsubmit", new global::Microsoft.AspNetCore.Html.HtmlString("sum()"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
#line hidden
#pragma warning disable 0169
private string __tagHelperStringValueBuffer;
#pragma warning restore 0169
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext __tagHelperExecutionContext;
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner __tagHelperRunner = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner();
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __backed__tagHelperScopeManager = null;
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __tagHelperScopeManager
{
get
{
if (__backed__tagHelperScopeManager == null)
{
__backed__tagHelperScopeManager = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
}
return __backed__tagHelperScopeManager;
}
}
private global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper;
private global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper;
private global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper;
private global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper;
#pragma warning disable 1998
public async override global::System.Threading.Tasks.Task ExecuteAsync()
{
BeginContext(0, 2, true);
WriteLiteral("\r\n");
EndContext();
BeginContext(25, 2, true);
WriteLiteral("\r\n");
EndContext();
#line 4 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
ViewData["Title"] = "SeeMenu";
#line default
#line hidden
BeginContext(70, 4, true);
WriteLiteral("\r\n\r\n");
EndContext();
DefineSection("nav", async() => {
BeginContext(87, 36, true);
WriteLiteral("\r\n<div class=\"dark-bg sticky-top\">\r\n");
EndContext();
}
);
BeginContext(126, 2, true);
WriteLiteral("\r\n");
EndContext();
DefineSection("styles", async() => {
BeginContext(144, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(150, 89, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("link", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "0c345ae21c044be6affe90e65bc201c9", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(239, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(245, 62, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("link", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "e44d979dc0c5462eba338f6aa6aa23c3", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(307, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(313, 61, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("link", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "ce8a92f5e641433396159b312afa1cc0", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(374, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(380, 72, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("link", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "f6901ec75a254ed8940037700dfa47ab", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_5);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(452, 8, true);
WriteLiteral("\r\n\r\n ");
EndContext();
BeginContext(460, 54, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("link", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "5feeab86fb01428a983f38a1b0b85a4c", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(514, 39, true);
WriteLiteral("\r\n\r\n <!-- Simple line Icon -->\r\n ");
EndContext();
BeginContext(553, 58, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("link", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "880ef5e15e784ec0b0834c68ca1e2fee", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_7);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(611, 33, true);
WriteLiteral("\r\n <!-- Themify Icon -->\r\n ");
EndContext();
BeginContext(644, 54, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("link", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "50fcb5bc1717450290349016af732644", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_8);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(698, 34, true);
WriteLiteral("\r\n <!-- Hover Effects -->\r\n ");
EndContext();
BeginContext(732, 45, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("link", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "c81005a7ad044ff1a83c4d7d309b4dee", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_9);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(777, 35, true);
WriteLiteral("\r\n <!-- Swipper Slider -->\r\n ");
EndContext();
BeginContext(812, 51, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("link", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "5b25188862d74cbeb940957a32e6dbd5", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_10);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(863, 39, true);
WriteLiteral("\r\n <!-- Magnific Popup CSS -->\r\n ");
EndContext();
BeginContext(902, 55, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("link", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "bd0a2a34e7174b96a97abd321f48cffd", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_11);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(957, 29, true);
WriteLiteral("\r\n <!-- Main CSS -->\r\n ");
EndContext();
BeginContext(986, 46, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("link", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "ef150465a6204bc69fbe3bb6b1f8404a", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(1032, 2, true);
WriteLiteral("\r\n");
EndContext();
}
);
BeginContext(1037, 2, true);
WriteLiteral("\r\n");
EndContext();
DefineSection("scripts2", async() => {
BeginContext(1057, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(1063, 48, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "6cac141c3ebe45c49662755416fda2c6", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_12);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(1111, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(1117, 58, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "6a7dad6c12524dc0b1112a94ba76e431", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_13);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(1175, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(1181, 65, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "3be7dbcd056245679e68626ef977deb3", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_14);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(1246, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(1252, 59, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "8934fc0632da41f7aafc3f64ddecea98", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_15);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(1311, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(1317, 62, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "8ead3ab37ee044e4956e3b6883951ba0", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_16);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(1379, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(1385, 64, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "a2f0497019284637b03d9a1103fbf63a", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_17);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(1449, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(1455, 65, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "03b76326e9284772b4198d1ea611c61b", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_18);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(1520, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(1526, 65, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "55976a1ac7f449069e2caf1252b5af82", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_19);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(1591, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(1597, 68, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "4eb65923929d44a3a58beccdb6ac6247", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_20);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(1665, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(1671, 50, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "0ca93529fedf4dbe82272b5cdea1c1bb", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_21);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(1721, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(1727, 68, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "e5640cc766d540188782bb8c191539bf", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_22);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(1795, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(1801, 65, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "211458fc43574048aeb51148cde837cb", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_23);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(1866, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(1872, 64, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "ec45d1e90d8f46588c2412c85e986865", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_24);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(1936, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(1942, 72, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "a6abbf5722074c2b948aa65dc2de34cb", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_25);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(2014, 6, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(2020, 38, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "2d1de76f214e46738d2691516000eb00", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_26);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(2058, 1475, true);
WriteLiteral(@"
<script>
var arr = {};
function addProduct(id) {
var val = parseInt(document.getElementById(id).innerHTML);
if (isNaN(val) || val == null) {
val = 1;
arr[id] = 1;
} else {
arr[id] += 1;
val = val + 1;
}
document.getElementById(id).innerHTML = val;
sum();
};
function removeProduct(id) {
var val = parseInt(document.getElementById(id).innerHTML);
if (isNaN(val) || val == 0) {
} else {
val = val - 1;
arr[id] -= 1;
document.getElementById(id).innerHTML = val;
}
};
function sum() {
var a="""";
for (key in arr) {
a = a + key + ""."" + arr[key] + "" "";
}
document.getElementById(""hiddenVal"").valu");
WriteLiteral(@"e = a;
};
var listt = document.getElementById(""hiddenVal"").value;
var list = listt.split("" "");
var filtered = list.filter(v => v != '');;
for (var i = 0; i < filtered.length; i++) {
var pro = filtered[i].split(""."");
arr[pro[0] + '.' + pro[1]] = parseInt(pro[2]);
document.getElementById(pro[0] + ""."" + pro[1]).innerHTML = pro[2];
}
</script>
");
EndContext();
}
);
BeginContext(3536, 229, true);
WriteLiteral("\r\n\r\n\r\n\r\n\r\n <div class=\"themenu\">\r\n\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col\">\r\n\r\n </div>\r\n </div>\r\n\r\n <div class=\"row themenu_row\">\r\n");
EndContext();
#line 123 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
foreach (var item in Model.MenuCategories)
{
#line default
#line hidden
#line 125 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
if (item.Products.Count != 0)
{
#line default
#line hidden
BeginContext(3920, 227, true);
WriteLiteral(" <div class=\"col-lg-4 themenu_column\">\r\n <div class=\"themenu_image\"></div>\r\n <div class=\"themenu_col trans_400\">\r\n <h3>");
EndContext();
BeginContext(4148, 9, false);
#line 130 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
Write(item.Name);
#line default
#line hidden
EndContext();
BeginContext(4157, 66, true);
WriteLiteral("</h3>\r\n <div class=\"dish_list\">\r\n\r\n");
EndContext();
#line 133 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
foreach (var item2 in item.Products)
{
#line default
#line hidden
BeginContext(4339, 283, true);
WriteLiteral(@" <div class=""dish"">
<div class=""dish_title_container d-flex flex-xl-row flex-column align-items-start justify-content-start"">
<div class=""dish_title"">");
EndContext();
BeginContext(4623, 10, false);
#line 138 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
Write(item2.Name);
#line default
#line hidden
EndContext();
BeginContext(4633, 134, true);
WriteLiteral("</div>\r\n <div class=\"dish_price\">\r\n ");
EndContext();
BeginContext(4768, 11, false);
#line 140 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
Write(item2.Price);
#line default
#line hidden
EndContext();
BeginContext(4779, 238, true);
WriteLiteral(" лв.\r\n </div>\r\n </div>\r\n <div class=\"dish_contents\">\r\n <p>");
EndContext();
BeginContext(5018, 12, false);
#line 144 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
Write(item2.Weight);
#line default
#line hidden
EndContext();
BeginContext(5030, 545, true);
WriteLiteral(@" гр.</p>
<ul class=""d-flex flex-row align-items-start justify-content-start flex-wrap"">
<li>Pork</li>
<li>Tenderloin</li>
<li>Green Pepper</li>
</ul>
<div>
<a style=""color: dodgerblue; """);
EndContext();
BeginWriteAttribute("onclick", " onclick=\"", 5575, "\"", 5615, 5);
WriteAttributeValue("", 5585, "addProduct(", 5585, 11, true);
#line 151 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
WriteAttributeValue("", 5596, item.Id, 5596, 8, false);
#line default
#line hidden
WriteAttributeValue("", 5604, ".", 5604, 1, true);
#line 151 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
WriteAttributeValue("", 5605, item2.Id, 5605, 9, false);
#line default
#line hidden
WriteAttributeValue("", 5614, ")", 5614, 1, true);
EndWriteAttribute();
BeginContext(5616, 125, true);
WriteLiteral(">Добави към поръчка</a>\r\n\r\n <span class=\"badge badge-secondary badge-pill\"");
EndContext();
BeginWriteAttribute("id", " id=\"", 5741, "\"", 5764, 3);
#line 153 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
WriteAttributeValue("", 5746, item.Id, 5746, 8, false);
#line default
#line hidden
WriteAttributeValue("", 5754, ".", 5754, 1, true);
#line 153 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
WriteAttributeValue("", 5755, item2.Id, 5755, 9, false);
#line default
#line hidden
EndWriteAttribute();
BeginContext(5765, 116, true);
WriteLiteral("></span>\r\n </div>\r\n <a");
EndContext();
BeginWriteAttribute("onclick", " onclick=\"", 5881, "\"", 5924, 5);
WriteAttributeValue("", 5891, "removeProduct(", 5891, 14, true);
#line 155 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
WriteAttributeValue("", 5905, item.Id, 5905, 8, false);
#line default
#line hidden
WriteAttributeValue("", 5913, ".", 5913, 1, true);
#line 155 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
WriteAttributeValue("", 5914, item2.Id, 5914, 9, false);
#line default
#line hidden
WriteAttributeValue("", 5923, ")", 5923, 1, true);
EndWriteAttribute();
BeginContext(5925, 128, true);
WriteLiteral(">Премахни от поръчка</a>\r\n </div>\r\n\r\n </div>\r\n");
EndContext();
#line 159 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
}
#line default
#line hidden
BeginContext(6092, 110, true);
WriteLiteral("\r\n </div>\r\n </div>\r\n </div>\r\n");
EndContext();
#line 164 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
}
#line default
#line hidden
#line 164 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
}
#line default
#line hidden
BeginContext(6244, 95, true);
WriteLiteral(" <!-- Starters -->\r\n\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n ");
EndContext();
BeginContext(6339, 492, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "c9f78f06d5374bc8b0e0a835fcf4240b", async() => {
BeginContext(6425, 14, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(6439, 72, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "ec6b69c795554f3aadb674bcc04d8dd1", async() => {
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper);
#line 174 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.TableNumber);
#line default
#line hidden
__tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.InputTypeName = (string)__tagHelperAttribute_27.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_27);
BeginWriteTagHelperAttribute();
#line 174 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
WriteLiteral(Model.TableNumber);
#line default
#line hidden
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.Value = __tagHelperStringValueBuffer;
__tagHelperExecutionContext.AddTagHelperAttribute("value", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.Value, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(6511, 14, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(6525, 60, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "fab1af3791a943039cf3e6c5cb2b23fc", async() => {
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper);
#line 175 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.HiddenValue);
#line default
#line hidden
__tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.InputTypeName = (string)__tagHelperAttribute_27.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_27);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_28);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(6585, 14, true);
WriteLiteral("\r\n ");
EndContext();
BeginContext(6599, 92, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "09e0f19cc50d4d4d855c85b287943bce", async() => {
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper);
#line 176 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.RestaurantId);
#line default
#line hidden
__tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.InputTypeName = (string)__tagHelperAttribute_27.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_27);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_29);
BeginWriteTagHelperAttribute();
#line 176 "C:\Users\Asus\source\repos\Foodie1\Foodie1\Views\Client\Order.cshtml"
WriteLiteral(Model.RestaurantId);
#line default
#line hidden
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.Value = __tagHelperStringValueBuffer;
__tagHelperExecutionContext.AddTagHelperAttribute("value", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.Value, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(6691, 133, true);
WriteLiteral("\r\n <br> <center><button type=\"submit\" class=\"btn btn-primary btn-lg btn-block\">Изпрати поръчка</button></center>\r\n ");
EndContext();
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper);
__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper);
__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Action = (string)__tagHelperAttribute_30.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_30);
__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Controller = (string)__tagHelperAttribute_31.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_31);
__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Method = (string)__tagHelperAttribute_32.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_32);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_33);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(6831, 18, true);
WriteLiteral("\r\n </div>\r\n\r\n\r\n");
EndContext();
}
#pragma warning restore 1998
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<OrderViewModel> Html { get; private set; }
}
}
#pragma warning restore 1591
| 70.158158 | 385 | 0.674281 | [
"MIT"
] | AdemTsranchaliev/FoodieNOIT | obj/Release/netcoreapp2.1/Razor/Views/Client/Order.g.cshtml.cs | 70,139 | C# |
using System;
using System.Windows.Input;
namespace REghZyFramework.Utilities
{
/// <summary>
/// An always executable capiable of passing parameters
/// </summary>
/// <typeparam name="Parameter">The parameter type (<see cref="string"/>, <see cref="int"/>, etc)</typeparam>
public class CommandParam<Parameter> : ICommand
{
readonly Action<Parameter> _execute;
/// <summary>
/// Creates a new command that can always execute
/// </summary>
/// <param name="execute">The method to execute</param>
public CommandParam(Action<Parameter> execute)
{
if (execute == null)
return;
_execute = execute;
}
/// <summary>
/// Executes the command only if the parameter matches the command's parameter type
/// <para>
/// For example, it wont execute if the command requires a <see cref="int"/> but you provide a <see cref="string"/>
/// </para>
/// </summary>
/// <param name="parameter"></param>
public void Execute(object parameter)
{
if (parameter is Parameter p)
_execute?.Invoke(p);
}
/// <summary>
/// Returns true because this is an always executable command
/// </summary>
/// <param name="parameter">Ignored</param>
/// <returns>True</returns>
public bool CanExecute(object parameter)
{
return true;
}
public event EventHandler CanExecuteChanged
{
add { } remove { }
//add { CommandManager.RequerySuggested += value; }
//remove { CommandManager.RequerySuggested -= value; }
}
}
}
| 30.964912 | 127 | 0.556374 | [
"MIT"
] | 45645615/KoraKora_project | Themes/Utilities/CommandParam.cs | 1,767 | C# |
using UnityEngine;
using UnityEngine.AI;
public class NavMeshAgentRandomMove : MonoBehaviour
{
private NavMeshAgent agent;
private Animator anim;
public float wanderRange = 10f;
// Start is called before the first frame update
void Start()
{
agent = GetComponent<NavMeshAgent>();
anim = GetComponent<Animator>();
if (!agent)
enabled = false;
}
// Update is called once per frame
void Update()
{
if (Vector3.Distance(transform.position, agent.destination) < 0.5f)
{
Random.InitState((int)Time.time + gameObject.GetHashCode());
var target = Random.insideUnitSphere * wanderRange;
target.y = 0;
NavMeshHit hit;
if(NavMesh.SamplePosition(target, out hit, 1f, NavMesh.AllAreas))
agent.destination = hit.position;
}
anim.SetFloat("speed", agent.velocity.magnitude);
}
}
| 28.235294 | 77 | 0.608333 | [
"MIT"
] | DiggingNebula8/Outlier-Shades | Scripts/Runtime/NavMeshAgentRandomMove.cs | 962 | C# |
// Copyright (c) 2018 Ark S.r.l. All rights reserved.
// Licensed under the MIT License. See LICENSE file for license information.
using Ark.Tools.FtpClient.Core;
namespace Ark.Tools.FtpClient.FluentFtp
{
public sealed class FluentFtpClientFactory : DefaultFtpClientFactory
{
public FluentFtpClientFactory()
: base(new FluentFtpClientConnectionFactory())
{
}
}
}
| 27.6 | 77 | 0.695652 | [
"MIT"
] | ARKlab/Ark.Tools | Ark.Tools.FtpClient.FluentFtp/FluentFtpClientFactory.cs | 416 | C# |
/* MapleLib - A general-purpose MapleStory library
* Copyright (C) 2009, 2010, 2015 Snow and haha01haha01
* This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
* This program 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 General Public License for more details.
* You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.*/
using System;
using System.Collections.Generic;
namespace MapleLib.WzLib.WzStructure.Data
{
public static class Tables
{
public static Dictionary<string, string> PortalTypeNames = new Dictionary<string, string>() {
{ "sp", "Start Point"},
{ "pi", "Invisible" },
{ "pv", "Visible" },
{ "pc", "Collision" },
{ "pg", "Changable" },
{ "pgi", "Changable Invisible" },
{ "tp", "Town Portal" },
{ "ps", "Script" },
{ "psi", "Script Invisible" },
{ "pcs", "Script Collision" },
{ "ph", "Hidden" },
{ "psh", "Script Hidden" },
{ "pcj", "Vertical Spring" },
{ "pci", "Custom Impact Spring" },
{ "pcig", "Unknown (PCIG)" }};
public static string[] BackgroundTypeNames = new string[] {
"Regular",
"Horizontal Copies",
"Vertical Copies",
"H+V Copies",
"Horizontal Moving+Copies",
"Vertical Moving+Copies",
"H+V Copies, Horizontal Moving",
"H+V Copies, Vertical Moving"
};
}
public static class WzConstants
{
public const int MinMap = 0;
public const int MaxMap = 999999999;
}
public enum QuestState
{
Available = 0,
InProgress = 1,
Completed = 2
}
} | 32.656716 | 102 | 0.57404 | [
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] | Bia10/Harepacker-resurrected | MapleLib/WzLib/WzStructure/Data/Data.cs | 2,190 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("SuperSocketServerSessionMode")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SuperSocketServerSessionMode")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("f742e486-4f52-4289-b6d0-ed63bf7540be")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 26.405405 | 59 | 0.724667 | [
"Apache-2.0"
] | kiba518/SuperSocketConsole | SuperConsole/Properties/AssemblyInfo.cs | 1,318 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Demo.LearnByDoing.CodeWars
{
public class DuplicateEncoderProgram
{
public static void Main(string[] args)
{
}
}
public class Kata
{
public static string DuplicateEncode(string word)
{
return word;
}
}
}
| 14.75 | 51 | 0.734463 | [
"MIT"
] | dance2die/Demo.LearnByDoing | Demo.LearnByDoing.CodeWars/DuplicateEncoderProgram.cs | 356 | C# |
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation.
// All rights reserved.
//
// This code is licensed under the 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.
//
//------------------------------------------------------------------------------
namespace Microsoft.IdentityModel.JsonWebTokens
{
/// <summary>
/// List of registered claims from different sources
/// http://tools.ietf.org/html/rfc7519#section-4
/// http://openid.net/specs/openid-connect-core-1_0.html#IDToken
/// </summary>
public struct JwtRegisteredClaimNames
{
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string Actort = "actort";
/// <summary>
/// http://openid.net/specs/openid-connect-core-1_0.html#IDToken
/// </summary>
public const string Acr = "acr";
/// <summary>
/// http://openid.net/specs/openid-connect-core-1_0.html#IDToken
/// </summary>
public const string Amr = "amr";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string Aud = "aud";
/// <summary>
/// http://openid.net/specs/openid-connect-core-1_0.html#IDToken
/// </summary>
public const string AuthTime = "auth_time";
/// <summary>
/// http://openid.net/specs/openid-connect-core-1_0.html#IDToken
/// </summary>
public const string Azp = "azp";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string Birthdate = "birthdate";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string CHash = "c_hash";
/// <summary>
/// http://openid.net/specs/openid-connect-core-1_0.html#CodeIDToken
/// </summary>
public const string AtHash = "at_hash";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string Email = "email";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string Exp = "exp";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string Gender = "gender";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string FamilyName = "family_name";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string GivenName = "given_name";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string Iat = "iat";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string Iss = "iss";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string Jti = "jti";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string NameId = "nameid";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string Nonce = "nonce";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string Nbf = "nbf";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string Prn = "prn";
/// <summary>
/// http://openid.net/specs/openid-connect-frontchannel-1_0.html#OPLogout
/// </summary>
public const string Sid = "sid";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string Sub = "sub";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string Typ = "typ";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string UniqueName = "unique_name";
/// <summary>
/// http://tools.ietf.org/html/rfc7519#section-4
/// </summary>
public const string Website = "website";
}
}
| 33.607143 | 81 | 0.568367 | [
"MIT"
] | amccool/azure-activedirectory-identitymodel-extensions-for-dotnet | src/Microsoft.IdentityModel.JsonWebTokens/JwtRegisteredClaimNames.cs | 5,646 | C# |
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: remote.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Prometheus {
/// <summary>Holder for reflection information generated from remote.proto</summary>
public static partial class RemoteReflection {
#region Descriptor
/// <summary>File descriptor for remote.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static RemoteReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CgxyZW1vdGUucHJvdG8SCnByb21ldGhldXMaC3R5cGVzLnByb3RvGhRnb2dv",
"cHJvdG8vZ29nby5wcm90byJACgxXcml0ZVJlcXVlc3QSMAoKdGltZXNlcmll",
"cxgBIAMoCzIWLnByb21ldGhldXMuVGltZVNlcmllc0IEyN4fACIxCgtSZWFk",
"UmVxdWVzdBIiCgdxdWVyaWVzGAEgAygLMhEucHJvbWV0aGV1cy5RdWVyeSI4",
"CgxSZWFkUmVzcG9uc2USKAoHcmVzdWx0cxgBIAMoCzIXLnByb21ldGhldXMu",
"UXVlcnlSZXN1bHQijwEKBVF1ZXJ5EhoKEnN0YXJ0X3RpbWVzdGFtcF9tcxgB",
"IAEoAxIYChBlbmRfdGltZXN0YW1wX21zGAIgASgDEioKCG1hdGNoZXJzGAMg",
"AygLMhgucHJvbWV0aGV1cy5MYWJlbE1hdGNoZXISJAoFaGludHMYBCABKAsy",
"FS5wcm9tZXRoZXVzLlJlYWRIaW50cyI5CgtRdWVyeVJlc3VsdBIqCgp0aW1l",
"c2VyaWVzGAEgAygLMhYucHJvbWV0aGV1cy5UaW1lU2VyaWVzQghaBnByb21w",
"YmIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Prometheus.TypesReflection.Descriptor, global::Gogoproto.GogoReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Prometheus.WriteRequest), global::Prometheus.WriteRequest.Parser, new[]{ "Timeseries" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Prometheus.ReadRequest), global::Prometheus.ReadRequest.Parser, new[]{ "Queries" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Prometheus.ReadResponse), global::Prometheus.ReadResponse.Parser, new[]{ "Results" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Prometheus.Query), global::Prometheus.Query.Parser, new[]{ "StartTimestampMs", "EndTimestampMs", "Matchers", "Hints" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Prometheus.QueryResult), global::Prometheus.QueryResult.Parser, new[]{ "Timeseries" }, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class WriteRequest : pb::IMessage<WriteRequest> {
private static readonly pb::MessageParser<WriteRequest> _parser = new pb::MessageParser<WriteRequest>(() => new WriteRequest());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<WriteRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Prometheus.RemoteReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public WriteRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public WriteRequest(WriteRequest other) : this() {
timeseries_ = other.timeseries_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public WriteRequest Clone() {
return new WriteRequest(this);
}
/// <summary>Field number for the "timeseries" field.</summary>
public const int TimeseriesFieldNumber = 1;
private static readonly pb::FieldCodec<global::Prometheus.TimeSeries> _repeated_timeseries_codec
= pb::FieldCodec.ForMessage(10, global::Prometheus.TimeSeries.Parser);
private readonly pbc::RepeatedField<global::Prometheus.TimeSeries> timeseries_ = new pbc::RepeatedField<global::Prometheus.TimeSeries>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Prometheus.TimeSeries> Timeseries {
get { return timeseries_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as WriteRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(WriteRequest other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!timeseries_.Equals(other.timeseries_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= timeseries_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
timeseries_.WriteTo(output, _repeated_timeseries_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += timeseries_.CalculateSize(_repeated_timeseries_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(WriteRequest other) {
if (other == null) {
return;
}
timeseries_.Add(other.timeseries_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
timeseries_.AddEntriesFrom(input, _repeated_timeseries_codec);
break;
}
}
}
}
}
public sealed partial class ReadRequest : pb::IMessage<ReadRequest> {
private static readonly pb::MessageParser<ReadRequest> _parser = new pb::MessageParser<ReadRequest>(() => new ReadRequest());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ReadRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Prometheus.RemoteReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ReadRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ReadRequest(ReadRequest other) : this() {
queries_ = other.queries_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ReadRequest Clone() {
return new ReadRequest(this);
}
/// <summary>Field number for the "queries" field.</summary>
public const int QueriesFieldNumber = 1;
private static readonly pb::FieldCodec<global::Prometheus.Query> _repeated_queries_codec
= pb::FieldCodec.ForMessage(10, global::Prometheus.Query.Parser);
private readonly pbc::RepeatedField<global::Prometheus.Query> queries_ = new pbc::RepeatedField<global::Prometheus.Query>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Prometheus.Query> Queries {
get { return queries_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ReadRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ReadRequest other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!queries_.Equals(other.queries_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= queries_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
queries_.WriteTo(output, _repeated_queries_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += queries_.CalculateSize(_repeated_queries_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ReadRequest other) {
if (other == null) {
return;
}
queries_.Add(other.queries_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
queries_.AddEntriesFrom(input, _repeated_queries_codec);
break;
}
}
}
}
}
public sealed partial class ReadResponse : pb::IMessage<ReadResponse> {
private static readonly pb::MessageParser<ReadResponse> _parser = new pb::MessageParser<ReadResponse>(() => new ReadResponse());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ReadResponse> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Prometheus.RemoteReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ReadResponse() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ReadResponse(ReadResponse other) : this() {
results_ = other.results_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ReadResponse Clone() {
return new ReadResponse(this);
}
/// <summary>Field number for the "results" field.</summary>
public const int ResultsFieldNumber = 1;
private static readonly pb::FieldCodec<global::Prometheus.QueryResult> _repeated_results_codec
= pb::FieldCodec.ForMessage(10, global::Prometheus.QueryResult.Parser);
private readonly pbc::RepeatedField<global::Prometheus.QueryResult> results_ = new pbc::RepeatedField<global::Prometheus.QueryResult>();
/// <summary>
/// In same order as the request's queries.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Prometheus.QueryResult> Results {
get { return results_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ReadResponse);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ReadResponse other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!results_.Equals(other.results_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= results_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
results_.WriteTo(output, _repeated_results_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += results_.CalculateSize(_repeated_results_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ReadResponse other) {
if (other == null) {
return;
}
results_.Add(other.results_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
results_.AddEntriesFrom(input, _repeated_results_codec);
break;
}
}
}
}
}
public sealed partial class Query : pb::IMessage<Query> {
private static readonly pb::MessageParser<Query> _parser = new pb::MessageParser<Query>(() => new Query());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Query> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Prometheus.RemoteReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Query() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Query(Query other) : this() {
startTimestampMs_ = other.startTimestampMs_;
endTimestampMs_ = other.endTimestampMs_;
matchers_ = other.matchers_.Clone();
hints_ = other.hints_ != null ? other.hints_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Query Clone() {
return new Query(this);
}
/// <summary>Field number for the "start_timestamp_ms" field.</summary>
public const int StartTimestampMsFieldNumber = 1;
private long startTimestampMs_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long StartTimestampMs {
get { return startTimestampMs_; }
set {
startTimestampMs_ = value;
}
}
/// <summary>Field number for the "end_timestamp_ms" field.</summary>
public const int EndTimestampMsFieldNumber = 2;
private long endTimestampMs_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long EndTimestampMs {
get { return endTimestampMs_; }
set {
endTimestampMs_ = value;
}
}
/// <summary>Field number for the "matchers" field.</summary>
public const int MatchersFieldNumber = 3;
private static readonly pb::FieldCodec<global::Prometheus.LabelMatcher> _repeated_matchers_codec
= pb::FieldCodec.ForMessage(26, global::Prometheus.LabelMatcher.Parser);
private readonly pbc::RepeatedField<global::Prometheus.LabelMatcher> matchers_ = new pbc::RepeatedField<global::Prometheus.LabelMatcher>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Prometheus.LabelMatcher> Matchers {
get { return matchers_; }
}
/// <summary>Field number for the "hints" field.</summary>
public const int HintsFieldNumber = 4;
private global::Prometheus.ReadHints hints_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Prometheus.ReadHints Hints {
get { return hints_; }
set {
hints_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Query);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Query other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (StartTimestampMs != other.StartTimestampMs) return false;
if (EndTimestampMs != other.EndTimestampMs) return false;
if(!matchers_.Equals(other.matchers_)) return false;
if (!object.Equals(Hints, other.Hints)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (StartTimestampMs != 0L) hash ^= StartTimestampMs.GetHashCode();
if (EndTimestampMs != 0L) hash ^= EndTimestampMs.GetHashCode();
hash ^= matchers_.GetHashCode();
if (hints_ != null) hash ^= Hints.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (StartTimestampMs != 0L) {
output.WriteRawTag(8);
output.WriteInt64(StartTimestampMs);
}
if (EndTimestampMs != 0L) {
output.WriteRawTag(16);
output.WriteInt64(EndTimestampMs);
}
matchers_.WriteTo(output, _repeated_matchers_codec);
if (hints_ != null) {
output.WriteRawTag(34);
output.WriteMessage(Hints);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (StartTimestampMs != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(StartTimestampMs);
}
if (EndTimestampMs != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(EndTimestampMs);
}
size += matchers_.CalculateSize(_repeated_matchers_codec);
if (hints_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Hints);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Query other) {
if (other == null) {
return;
}
if (other.StartTimestampMs != 0L) {
StartTimestampMs = other.StartTimestampMs;
}
if (other.EndTimestampMs != 0L) {
EndTimestampMs = other.EndTimestampMs;
}
matchers_.Add(other.matchers_);
if (other.hints_ != null) {
if (hints_ == null) {
Hints = new global::Prometheus.ReadHints();
}
Hints.MergeFrom(other.Hints);
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
StartTimestampMs = input.ReadInt64();
break;
}
case 16: {
EndTimestampMs = input.ReadInt64();
break;
}
case 26: {
matchers_.AddEntriesFrom(input, _repeated_matchers_codec);
break;
}
case 34: {
if (hints_ == null) {
Hints = new global::Prometheus.ReadHints();
}
input.ReadMessage(Hints);
break;
}
}
}
}
}
public sealed partial class QueryResult : pb::IMessage<QueryResult> {
private static readonly pb::MessageParser<QueryResult> _parser = new pb::MessageParser<QueryResult>(() => new QueryResult());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<QueryResult> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Prometheus.RemoteReflection.Descriptor.MessageTypes[4]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public QueryResult() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public QueryResult(QueryResult other) : this() {
timeseries_ = other.timeseries_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public QueryResult Clone() {
return new QueryResult(this);
}
/// <summary>Field number for the "timeseries" field.</summary>
public const int TimeseriesFieldNumber = 1;
private static readonly pb::FieldCodec<global::Prometheus.TimeSeries> _repeated_timeseries_codec
= pb::FieldCodec.ForMessage(10, global::Prometheus.TimeSeries.Parser);
private readonly pbc::RepeatedField<global::Prometheus.TimeSeries> timeseries_ = new pbc::RepeatedField<global::Prometheus.TimeSeries>();
/// <summary>
/// Samples within a time series must be ordered by time.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Prometheus.TimeSeries> Timeseries {
get { return timeseries_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as QueryResult);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(QueryResult other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!timeseries_.Equals(other.timeseries_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= timeseries_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
timeseries_.WriteTo(output, _repeated_timeseries_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += timeseries_.CalculateSize(_repeated_timeseries_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(QueryResult other) {
if (other == null) {
return;
}
timeseries_.Add(other.timeseries_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
timeseries_.AddEntriesFrom(input, _repeated_timeseries_codec);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code
| 35.927441 | 195 | 0.681783 | [
"MIT"
] | cosh/PrometheusToAdx | PrmoetheusHelper/Remote.cs | 27,233 | C# |
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
namespace EchoNest.Net.UAP.Tools.Converters
{
public sealed class BooleanToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
return (value is bool && (bool)value) ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
return value is Visibility && (Visibility)value == Visibility.Visible;
}
}
}
| 30.65 | 99 | 0.67863 | [
"MIT"
] | drasticactions/EchoNest.Net | EchoNest.Net.UAP/Tools/Converters/BooleanToVisibilityConverter.cs | 615 | C# |
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Numerics;
using osu.Framework.Bindables;
using osu.Game.Rulesets.Catch.Objects;
namespace osu.Game.Rulesets.Catch.Skinning.Default
{
public class FruitPulpFormation : PulpFormation
{
public readonly Bindable<FruitVisualRepresentation> VisualRepresentation = new Bindable<FruitVisualRepresentation>();
protected override void LoadComplete()
{
base.LoadComplete();
VisualRepresentation.BindValueChanged(setFormation, true);
}
private void setFormation(ValueChangedEvent<FruitVisualRepresentation> visualRepresentation)
{
Clear();
switch (visualRepresentation.NewValue)
{
case FruitVisualRepresentation.Pear:
AddPulp(new Vector2(0, -0.33f), new Vector2(SMALL_PULP));
AddPulp(PositionAt(60, DISTANCE_FROM_CENTRE_3), new Vector2(LARGE_PULP_3));
AddPulp(PositionAt(180, DISTANCE_FROM_CENTRE_3), new Vector2(LARGE_PULP_3));
AddPulp(PositionAt(300, DISTANCE_FROM_CENTRE_3), new Vector2(LARGE_PULP_3));
break;
case FruitVisualRepresentation.Grape:
AddPulp(new Vector2(0, -0.25f), new Vector2(SMALL_PULP));
AddPulp(PositionAt(0, DISTANCE_FROM_CENTRE_3), new Vector2(LARGE_PULP_3));
AddPulp(PositionAt(120, DISTANCE_FROM_CENTRE_3), new Vector2(LARGE_PULP_3));
AddPulp(PositionAt(240, DISTANCE_FROM_CENTRE_3), new Vector2(LARGE_PULP_3));
break;
case FruitVisualRepresentation.Pineapple:
AddPulp(new Vector2(0, -0.3f), new Vector2(SMALL_PULP));
AddPulp(PositionAt(45, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
AddPulp(PositionAt(135, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
AddPulp(PositionAt(225, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
AddPulp(PositionAt(315, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
break;
case FruitVisualRepresentation.Raspberry:
AddPulp(new Vector2(0, -0.34f), new Vector2(SMALL_PULP));
AddPulp(PositionAt(0, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
AddPulp(PositionAt(90, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
AddPulp(PositionAt(180, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
AddPulp(PositionAt(270, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
break;
}
}
}
}
| 49 | 126 | 0.619388 | [
"MIT"
] | Azyyyyyy/osu | osu.Game.Rulesets.Catch/Skinning/Default/FruitPulpFormation.cs | 2,881 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using Azure.Storage.Blobs.Models;
namespace Azure.Storage.Blobs
{
/// <summary>
/// Quick Query extensions.
/// </summary>
internal static class QuickQueryExtensions
{
internal static QuerySerialization ToQuickQuerySerialization(
this BlobQueryTextOptions textConfiguration,
bool isInput)
{
if (textConfiguration == default)
{
return default;
}
QuerySerialization serialization = new QuerySerialization(new QueryFormat());
serialization.Format.DelimitedTextConfiguration = default;
serialization.Format.JsonTextConfiguration = default;
serialization.Format.ArrowConfiguration = default;
if (textConfiguration is BlobQueryCsvTextOptions cvsTextConfiguration)
{
serialization.Format.Type = QueryFormatType.Delimited;
serialization.Format.DelimitedTextConfiguration = new DelimitedTextConfigurationInternal(
columnSeparator: cvsTextConfiguration.ColumnSeparator?.ToString(CultureInfo.InvariantCulture),
fieldQuote: cvsTextConfiguration.QuotationCharacter?.ToString(CultureInfo.InvariantCulture),
recordSeparator: cvsTextConfiguration.RecordSeparator?.ToString(CultureInfo.InvariantCulture),
escapeChar: cvsTextConfiguration.EscapeCharacter?.ToString(CultureInfo.InvariantCulture),
headersPresent: cvsTextConfiguration.HasHeaders);
}
else if (textConfiguration is BlobQueryJsonTextOptions jsonTextConfiguration)
{
serialization.Format.Type = QueryFormatType.Json;
serialization.Format.JsonTextConfiguration = new JsonTextConfigurationInternal(
jsonTextConfiguration.RecordSeparator?.ToString(CultureInfo.InvariantCulture));
}
else if (textConfiguration is BlobQueryArrowOptions arrowConfiguration)
{
if (isInput)
{
throw new ArgumentException($"{nameof(BlobQueryArrowOptions)} can only be used for output serialization.");
}
serialization.Format.Type = QueryFormatType.Arrow;
serialization.Format.ArrowConfiguration = new ArrowTextConfigurationInternal(
arrowConfiguration.Schema?.Select(ToArrowFieldInternal).ToList());
}
else
{
throw new ArgumentException($"Invalid options type. Valid options are {nameof(BlobQueryCsvTextOptions)}, {nameof(BlobQueryJsonTextOptions)}, and {nameof(BlobQueryArrowOptions)}");
}
return serialization;
}
internal static ArrowFieldInternal ToArrowFieldInternal(this BlobQueryArrowField blobQueryArrowField)
{
if (blobQueryArrowField == null)
{
return null;
}
return new ArrowFieldInternal(blobQueryArrowField.Type.ToArrowFiledInternalType())
{
Name = blobQueryArrowField.Name,
Precision = blobQueryArrowField.Precision,
Scale = blobQueryArrowField.Scale
};
}
internal static string ToArrowFiledInternalType(this BlobQueryArrowFieldType blobQueryArrowFieldType)
=> blobQueryArrowFieldType switch
{
BlobQueryArrowFieldType.Bool => Constants.QuickQuery.ArrowFieldTypeBool,
BlobQueryArrowFieldType.Decimal => Constants.QuickQuery.ArrowFieldTypeDecimal,
BlobQueryArrowFieldType.Double => Constants.QuickQuery.ArrowFieldTypeDouble,
BlobQueryArrowFieldType.Int64 => Constants.QuickQuery.ArrowFieldTypeInt64,
BlobQueryArrowFieldType.String => Constants.QuickQuery.ArrowFieldTypeString,
BlobQueryArrowFieldType.Timestamp => Constants.QuickQuery.ArrowFieldTypeTimestamp,
_ => throw new ArgumentException($"Unknown {nameof(BlobQueryArrowFieldType)}: {blobQueryArrowFieldType}"),
};
}
}
| 45.708333 | 196 | 0.658387 | [
"MIT"
] | MahmoudYounes/azure-sdk-for-net | sdk/storage/Azure.Storage.Blobs/src/QuickQueryExtensions.cs | 4,390 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.