content
stringlengths
5
1.04M
avg_line_length
float64
1.75
12.9k
max_line_length
int64
2
244k
alphanum_fraction
float64
0
0.98
licenses
list
repository_name
stringlengths
7
92
path
stringlengths
3
249
size
int64
5
1.04M
lang
stringclasses
2 values
using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Reflection; using System.Threading.Tasks; using VkNet.Commands.Results; namespace VkNet.Commands.Readers { internal static class EnumTypeReader { public static TypeReader GetReader(Type type) { Type baseType = Enum.GetUnderlyingType(type); var constructor = typeof(EnumTypeReader<>).MakeGenericType(baseType).GetTypeInfo().DeclaredConstructors.First(); return (TypeReader)constructor.Invoke(new object[] { type, PrimitiveParsers.Get(baseType) }); } } internal class EnumTypeReader<T> : TypeReader { private readonly IReadOnlyDictionary<string, object> _enumsByName; private readonly IReadOnlyDictionary<T, object> _enumsByValue; private readonly Type _enumType; private readonly TryParseDelegate<T> _tryParse; public EnumTypeReader(Type type, TryParseDelegate<T> parser) { _enumType = type; _tryParse = parser; var byNameBuilder = ImmutableDictionary.CreateBuilder<string, object>(); var byValueBuilder = ImmutableDictionary.CreateBuilder<T, object>(); foreach (var v in Enum.GetNames(_enumType)) { var parsedValue = Enum.Parse(_enumType, v); byNameBuilder.Add(v.ToLower(), parsedValue); if (!byValueBuilder.ContainsKey((T)parsedValue)) byValueBuilder.Add((T)parsedValue, parsedValue); } _enumsByName = byNameBuilder.ToImmutable(); _enumsByValue = byValueBuilder.ToImmutable(); } /// <inheritdoc /> public override Task<TypeReaderResult> ReadAsync(ICommandContext context, string input, IServiceProvider services) { object enumValue; if (_tryParse(input, out T baseValue)) { if (_enumsByValue.TryGetValue(baseValue, out enumValue)) return Task.FromResult(TypeReaderResult.FromSuccess(enumValue)); else return Task.FromResult(TypeReaderResult.FromError(CommandError.ParseFailed, $"Value is not a {_enumType.Name}.")); } else { if (_enumsByName.TryGetValue(input.ToLower(), out enumValue)) return Task.FromResult(TypeReaderResult.FromSuccess(enumValue)); else return Task.FromResult(TypeReaderResult.FromError(CommandError.ParseFailed, $"Value is not a {_enumType.Name}.")); } } } }
38.5
134
0.626345
[ "MIT" ]
davidsl4/VkNet.Commands
src/VkNet.Commands/Readers/EnumTypeReader.cs
2,695
C#
using System; using System.Collections.Generic; #if WINFORMS using System.Drawing; #endif namespace Fairweather.Service { /* Various helper methods */ static partial class Extensions { static public char ToUpper(this char ch) { var ret = Char.ToUpper(ch); return ret; } static public IEnumerable<T> OrEmpty<T>(this IEnumerable<T> seq) { return seq ?? new T[0]; } // **************************** // NO MORE!!!!!! // null ? def() : f(obj) static public TRet OrDefault<T1, TRet>(this T1 obj, Func<T1, TRet> f, Func<TRet> def) { if (obj == null) return def(); return f(obj); } // null ? def() : obj static public T OrDefault<T>(this T obj, Func<T> def) { if (obj == null) return def(); return obj; } // **************************** // null ? def : f(obj) static public TRet OrDefault_<T1, TRet>(this T1 obj, Func<T1, TRet> f, TRet def) { if (obj == null) return def; return f(obj); } // null ? def : obj static public T OrDefault_<T>(this T obj, T def) { if (obj == null) return def; return def; } // **************************** static public T OrNew<T>(this T nullable) where T : class, new() { return nullable ?? new T(); } static public T OrNew<T>(this T? nullable) where T : struct { return nullable ?? new T(); } // **************************** static public Font Change_Size(this Font font, float size, bool dispose) { using (dispose ? font : On_Dispose.Nothing) { var ret = new Font(font.FontFamily, size, font.Style); return ret; } } static public Font Underline(this Font font, bool dispose) { using (dispose ? font : On_Dispose.Nothing) { var ret = new Font(font, font.Style | FontStyle.Underline); return ret; } } static public Font Bold(this Font font, bool dispose) { using (dispose ? font : On_Dispose.Nothing) { var ret = new Font(font, font.Style | FontStyle.Bold); return ret; } } static public Font Italic(this Font font, bool dispose) { using (dispose ? font : On_Dispose.Nothing) { var ret = new Font(font, font.Style | FontStyle.Italic); return ret; } } static public Font Regular(this Font font, bool dispose) { using (dispose ? font : On_Dispose.Nothing) { var ret = new Font(font, FontStyle.Regular); return ret; } } #if WINFORMS public static StringFormat Far_Aligned_V(this StringFormat format, bool dispose) { var ret = new StringFormat(format); ret.Alignment = StringAlignment.Far; if (dispose) format.Dispose(); return ret; } public static StringFormat Far_Aligned_H(this StringFormat format, bool dispose) { var ret = new StringFormat(format); ret.LineAlignment = StringAlignment.Far; if (dispose) format.Dispose(); return ret; } public static StringFormat Near_Aligned_V(this StringFormat format, bool dispose) { var ret = new StringFormat(format); ret.Alignment = StringAlignment.Near; if (dispose) format.Dispose(); return ret; } public static StringFormat Near_Aligned_H(this StringFormat format, bool dispose) { var ret = new StringFormat(format); ret.LineAlignment = StringAlignment.Near; if (dispose) format.Dispose(); return ret; } public static StringFormat Word_Trimmed(this StringFormat format, bool dispose) { var ret = new StringFormat(format); ret.Trimming = StringTrimming.Word; if (dispose) format.Dispose(); return ret; } #endif } }
21.610619
92
0.453931
[ "MIT" ]
staafl/dotnet-bclext
to-integrate/Extensions/Mutators.cs
4,886
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.Sql.V20190601Preview { /// <summary> /// An Azure SQL Database sync group. /// </summary> [AzureNativeResourceType("azure-native:sql/v20190601preview:SyncGroup")] public partial class SyncGroup : Pulumi.CustomResource { /// <summary> /// Conflict resolution policy of the sync group. /// </summary> [Output("conflictResolutionPolicy")] public Output<string?> ConflictResolutionPolicy { get; private set; } = null!; /// <summary> /// User name for the sync group hub database credential. /// </summary> [Output("hubDatabaseUserName")] public Output<string?> HubDatabaseUserName { get; private set; } = null!; /// <summary> /// Sync interval of the sync group. /// </summary> [Output("interval")] public Output<int?> Interval { get; private set; } = null!; /// <summary> /// Last sync time of the sync group. /// </summary> [Output("lastSyncTime")] public Output<string> LastSyncTime { get; private set; } = null!; /// <summary> /// Resource name. /// </summary> [Output("name")] public Output<string> Name { get; private set; } = null!; /// <summary> /// Private endpoint name of the sync group if use private link connection is enabled. /// </summary> [Output("privateEndpointName")] public Output<string> PrivateEndpointName { get; private set; } = null!; /// <summary> /// Sync schema of the sync group. /// </summary> [Output("schema")] public Output<Outputs.SyncGroupSchemaResponse?> Schema { get; private set; } = null!; /// <summary> /// ARM resource id of the sync database in the sync group. /// </summary> [Output("syncDatabaseId")] public Output<string?> SyncDatabaseId { get; private set; } = null!; /// <summary> /// Sync state of the sync group. /// </summary> [Output("syncState")] public Output<string> SyncState { get; private set; } = null!; /// <summary> /// Resource type. /// </summary> [Output("type")] public Output<string> Type { get; private set; } = null!; /// <summary> /// If use private link connection is enabled. /// </summary> [Output("usePrivateLinkConnection")] public Output<bool?> UsePrivateLinkConnection { get; private set; } = null!; /// <summary> /// Create a SyncGroup resource with the given unique name, arguments, and options. /// </summary> /// /// <param name="name">The unique name of the resource</param> /// <param name="args">The arguments used to populate this resource's properties</param> /// <param name="options">A bag of options that control this resource's behavior</param> public SyncGroup(string name, SyncGroupArgs args, CustomResourceOptions? options = null) : base("azure-native:sql/v20190601preview:SyncGroup", name, args ?? new SyncGroupArgs(), MakeResourceOptions(options, "")) { } private SyncGroup(string name, Input<string> id, CustomResourceOptions? options = null) : base("azure-native:sql/v20190601preview:SyncGroup", name, null, MakeResourceOptions(options, id)) { } private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id) { var defaultOptions = new CustomResourceOptions { Version = Utilities.Version, Aliases = { new Pulumi.Alias { Type = "azure-nextgen:sql/v20190601preview:SyncGroup"}, new Pulumi.Alias { Type = "azure-native:sql:SyncGroup"}, new Pulumi.Alias { Type = "azure-nextgen:sql:SyncGroup"}, new Pulumi.Alias { Type = "azure-native:sql/v20150501preview:SyncGroup"}, new Pulumi.Alias { Type = "azure-nextgen:sql/v20150501preview:SyncGroup"}, new Pulumi.Alias { Type = "azure-native:sql/v20200202preview:SyncGroup"}, new Pulumi.Alias { Type = "azure-nextgen:sql/v20200202preview:SyncGroup"}, new Pulumi.Alias { Type = "azure-native:sql/v20200801preview:SyncGroup"}, new Pulumi.Alias { Type = "azure-nextgen:sql/v20200801preview:SyncGroup"}, new Pulumi.Alias { Type = "azure-native:sql/v20201101preview:SyncGroup"}, new Pulumi.Alias { Type = "azure-nextgen:sql/v20201101preview:SyncGroup"}, new Pulumi.Alias { Type = "azure-native:sql/v20210201preview:SyncGroup"}, new Pulumi.Alias { Type = "azure-nextgen:sql/v20210201preview:SyncGroup"}, }, }; var merged = CustomResourceOptions.Merge(defaultOptions, options); // Override the ID if one was specified for consistency with other language SDKs. merged.Id = id ?? merged.Id; return merged; } /// <summary> /// Get an existing SyncGroup resource's state with the given name, ID, and optional extra /// properties used to qualify the lookup. /// </summary> /// /// <param name="name">The unique name of the resulting resource.</param> /// <param name="id">The unique provider ID of the resource to lookup.</param> /// <param name="options">A bag of options that control this resource's behavior</param> public static SyncGroup Get(string name, Input<string> id, CustomResourceOptions? options = null) { return new SyncGroup(name, id, options); } } public sealed class SyncGroupArgs : Pulumi.ResourceArgs { /// <summary> /// Conflict resolution policy of the sync group. /// </summary> [Input("conflictResolutionPolicy")] public InputUnion<string, Pulumi.AzureNative.Sql.V20190601Preview.SyncConflictResolutionPolicy>? ConflictResolutionPolicy { get; set; } /// <summary> /// The name of the database on which the sync group is hosted. /// </summary> [Input("databaseName", required: true)] public Input<string> DatabaseName { get; set; } = null!; /// <summary> /// Password for the sync group hub database credential. /// </summary> [Input("hubDatabasePassword")] public Input<string>? HubDatabasePassword { get; set; } /// <summary> /// User name for the sync group hub database credential. /// </summary> [Input("hubDatabaseUserName")] public Input<string>? HubDatabaseUserName { get; set; } /// <summary> /// Sync interval of the sync group. /// </summary> [Input("interval")] public Input<int>? Interval { get; set; } /// <summary> /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. /// </summary> [Input("resourceGroupName", required: true)] public Input<string> ResourceGroupName { get; set; } = null!; /// <summary> /// Sync schema of the sync group. /// </summary> [Input("schema")] public Input<Inputs.SyncGroupSchemaArgs>? Schema { get; set; } /// <summary> /// The name of the server. /// </summary> [Input("serverName", required: true)] public Input<string> ServerName { get; set; } = null!; /// <summary> /// ARM resource id of the sync database in the sync group. /// </summary> [Input("syncDatabaseId")] public Input<string>? SyncDatabaseId { get; set; } /// <summary> /// The name of the sync group. /// </summary> [Input("syncGroupName")] public Input<string>? SyncGroupName { get; set; } /// <summary> /// If use private link connection is enabled. /// </summary> [Input("usePrivateLinkConnection")] public Input<bool>? UsePrivateLinkConnection { get; set; } public SyncGroupArgs() { } } }
40.439815
147
0.587407
[ "Apache-2.0" ]
polivbr/pulumi-azure-native
sdk/dotnet/Sql/V20190601Preview/SyncGroup.cs
8,735
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; using System.Collections.Generic; using Newtonsoft.Json; using NUnit.Framework; using osu.Framework.MathUtils; using osu.Game.Rulesets.Catch.Mods; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Catch.UI; using osu.Game.Rulesets.Objects; using osu.Game.Tests.Beatmaps; namespace osu.Game.Rulesets.Catch.Tests { [TestFixture] public class CatchBeatmapConversionTest : BeatmapConversionTest<ConvertValue> { protected override string ResourceAssembly => "osu.Game.Rulesets.Catch"; [TestCase("basic")] [TestCase("spinner")] [TestCase("spinner-and-circles")] [TestCase("slider")] [TestCase("hardrock-stream", new[] { typeof(CatchModHardRock) })] [TestCase("hardrock-repeat-slider", new[] { typeof(CatchModHardRock) })] [TestCase("hardrock-spinner", new[] { typeof(CatchModHardRock) })] public new void Test(string name, params Type[] mods) => base.Test(name, mods); protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObject) { switch (hitObject) { case JuiceStream stream: foreach (var nested in stream.NestedHitObjects) yield return new ConvertValue((CatchHitObject)nested); break; case BananaShower shower: foreach (var nested in shower.NestedHitObjects) yield return new ConvertValue((CatchHitObject)nested); break; default: yield return new ConvertValue((CatchHitObject)hitObject); break; } } protected override Ruleset CreateRuleset() => new CatchRuleset(); } public struct ConvertValue : IEquatable<ConvertValue> { /// <summary> /// A sane value to account for osu!stable using ints everwhere. /// </summary> private const float conversion_lenience = 2; [JsonIgnore] public readonly CatchHitObject HitObject; public ConvertValue(CatchHitObject hitObject) { HitObject = hitObject; startTime = 0; position = 0; } private double startTime; public double StartTime { get => HitObject?.StartTime ?? startTime; set => startTime = value; } private float position; public float Position { get => HitObject?.X * CatchPlayfield.BASE_WIDTH ?? position; set => position = value; } public bool Equals(ConvertValue other) => Precision.AlmostEquals(StartTime, other.StartTime, conversion_lenience) && Precision.AlmostEquals(Position, other.Position, conversion_lenience); } }
32.821053
93
0.592688
[ "MIT" ]
123tris/osu
osu.Game.Rulesets.Catch.Tests/CatchBeatmapConversionTest.cs
3,026
C#
//----------------------------------------------------------------------- // <copyright file="BagButton.cs" company="None"> // Copyright (c) Brandon Wallace and Jesse Calhoun. All rights reserved. // </copyright> //----------------------------------------------------------------------- namespace TQVaultAE.GUI { using Properties; using Tooltip; /// <summary> /// Used to create sack bag buttons. /// </summary> public class BagButton : BagButtonBase { /// <summary> /// Initializes a new instance of the BagButton class. /// </summary> /// <param name="bagNumber">number of the bag for display</param> /// <param name="getToolTip">Tooltip delegate</param> /// <param name="tooltip">Tooltip instance</param> public BagButton(int bagNumber, GetToolTip getToolTip, TTLib tooltip) : base(bagNumber, getToolTip, tooltip) { } /// <summary> /// Sets the background bitmaps for the BagButton /// </summary> public override void CreateBackgroundGraphics() { this.OnBitmap = Resources.inventorybagup01; this.OffBitmap = Resources.inventorybagdown01; this.OverBitmap = Resources.inventorybagover01; } } }
31.027027
110
0.610627
[ "MIT" ]
marq/TQVaultAE
src/TQVaultAE.GUI/BagButton.cs
1,148
C#
using Newtonsoft.Json; using Newtonsoft.Json.Serialization; namespace Racing.IO { internal static class CustomJsonSerializationSettings { public static readonly JsonSerializerSettings Default = new JsonSerializerSettings { Formatting = Formatting.Indented, ContractResolver = new CamelCasePropertyNamesContractResolver() }; } }
26.1875
79
0.661098
[ "MIT" ]
simonrozsival/racing-simulation
src/Racing.IO/CustomJsonSerializationSettings.cs
421
C#
// /* // Copyright (c) 2017-12 // // moljac // Test.cs // // 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. // */ #if XUNIT using Xunit; // NUnit aliases using Test = Xunit.FactAttribute; using OneTimeSetUp = HolisticWare.Core.Testing.UnitTests.UnitTestsCompatibilityAliasAttribute; // XUnit aliases using TestClass = HolisticWare.Core.Testing.UnitTests.UnitTestsCompatibilityAliasAttribute; using TestContext = HolisticWare.Core.Testing.UnitTests.TestContext; #elif NUNIT using NUnit.Framework; // MSTest aliases using TestInitialize = NUnit.Framework.SetUpAttribute; using TestProperty = NUnit.Framework.PropertyAttribute; using TestClass = HolisticWare.Core.Testing.UnitTests.UnitTestsCompatibilityAliasAttribute; using TestMethod = NUnit.Framework.TestAttribute; using TestCleanup = NUnit.Framework.TearDownAttribute; // XUnit aliases using Fact = NUnit.Framework.TestAttribute; #elif MSTEST using Microsoft.VisualStudio.TestTools.UnitTesting; // NUnit aliases using Test = Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute; using OneTimeSetUp = Microsoft.VisualStudio.TestTools.UnitTesting.ClassInitializeAttribute; // XUnit aliases using Fact = Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute; #endif #if BENCHMARKDOTNET using BenchmarkDotNet.Running; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Attributes.Jobs; #else using Benchmark = HolisticWare.Core.Testing.BenchmarkTests.Benchmark; using ShortRunJob = HolisticWare.Core.Testing.BenchmarkTests.ShortRunJob; #endif using System.Linq; using System.Collections.Generic; using HolisticWare.Xamarin.Tools.GitHub; namespace UnitTests.ClientsAPI.GitHub { [TestClass] // for MSTest - NUnit [TestFixture] and XUnit not needed public partial class Test_GitHubClientAPI { // https://api.github.com/repos/xamarin/AndroidX/tags // https://api.github.com/repos/xamarin/Essentials/tags [Test] public void Test_GetTagsAsync_AndroidX() { GitHubClient ghc = new GitHubClient(Tests.CommonShared.Http.Client); IEnumerable<Tag> tags = ghc.GetTagsAsync("xamarin", "AndroidX").Result; #if MSTEST Assert.IsTrue(tags.Any()); #elif NUNIT Assert.True(tags.Any()); #elif XUNIT Assert.True(tags.Any()); #endif return; } [Test] public void Test_GetTagsAsync_GooglePlayServices() { GitHubClient ghc = new GitHubClient(Tests.CommonShared.Http.Client); IEnumerable<Tag> tags = ghc.GetTagsAsync("xamarin", "GooglePlayServicesComponents").Result; #if MSTEST Assert.IsTrue(tags.Any()); #elif NUNIT Assert.True(tags.Any()); #elif XUNIT Assert.True(tags.Any()); #endif return; } [Test] public void Test_GetTagsAsync_Essentials() { GitHubClient ghc = new GitHubClient(Tests.CommonShared.Http.Client); IEnumerable<Tag> tags = ghc.GetTagsAsync("xamarin", "Essentials").Result; #if MSTEST Assert.IsTrue(tags.Any()); #elif NUNIT Assert.True(tags.Any()); #elif XUNIT Assert.True(tags.Any()); #endif return; } } }
33.380597
103
0.690588
[ "MIT" ]
moljac/HolisticWare.Xamarin.Tools.Bindings.XamarinAndroid.FassBinderMeister
tests/Tests.CommonShared/GitHubClientAPI/GitHubClient.cs
4,475
C#
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.Aws.WafV2.Inputs { public sealed class WebAclRuleStatementOrStatementStatementNotStatementStatementOrStatementStatementXssMatchStatementArgs : Pulumi.ResourceArgs { /// <summary> /// Part of a web request that you want AWS WAF to inspect. See Field to Match below for details. /// </summary> [Input("fieldToMatch")] public Input<Inputs.WebAclRuleStatementOrStatementStatementNotStatementStatementOrStatementStatementXssMatchStatementFieldToMatchArgs>? FieldToMatch { get; set; } [Input("textTransformations", required: true)] private InputList<Inputs.WebAclRuleStatementOrStatementStatementNotStatementStatementOrStatementStatementXssMatchStatementTextTransformationArgs>? _textTransformations; /// <summary> /// Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. See Text Transformation below for details. /// </summary> public InputList<Inputs.WebAclRuleStatementOrStatementStatementNotStatementStatementOrStatementStatementXssMatchStatementTextTransformationArgs> TextTransformations { get => _textTransformations ?? (_textTransformations = new InputList<Inputs.WebAclRuleStatementOrStatementStatementNotStatementStatementOrStatementStatementXssMatchStatementTextTransformationArgs>()); set => _textTransformations = value; } public WebAclRuleStatementOrStatementStatementNotStatementStatementOrStatementStatementXssMatchStatementArgs() { } } }
50.736842
212
0.770228
[ "ECL-2.0", "Apache-2.0" ]
chivandikwa/pulumi-aws
sdk/dotnet/WafV2/Inputs/WebAclRuleStatementOrStatementStatementNotStatementStatementOrStatementStatementXssMatchStatementArgs.cs
1,928
C#
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; using Windows.UI.Xaml.Controls; namespace BassClefStudio.UWP.Core { /// <summary> /// Represents a <see cref="Page"/> with added PropertyChanged handlers (similar to Observable). /// </summary> public class ObservablePage : Page { /// <summary> /// An event which is fired whenever a related property in an inheriting type is set. /// </summary> public event PropertyChangedEventHandler PropertyChanged; /// <summary> /// Sets the value of a field to a specific value and calls the <see cref="PropertyChanged"/> event. /// </summary> /// <typeparam name="T">The type of the value being set.</typeparam> /// <param name="storage">The field to store the value.</param> /// <param name="value">The value to store.</param> /// <param name="propertyName">(Filled automatically) the name of the property being set.</param> protected void Set<T>(ref T storage, T value, [CallerMemberName] string propertyName = null) { if (Equals(storage, value)) { return; } storage = value; OnPropertyChanged(propertyName); } /// <inheritdoc/> protected void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } /// <summary> /// Represents a <see cref="ContentDialog"/> with added PropertyChanged handlers (similar to Observable). /// </summary> public class ObservableDialog : ContentDialog { /// <summary> /// An event which is fired whenever a related property in an inheriting type is set. /// </summary> public event PropertyChangedEventHandler PropertyChanged; /// <summary> /// Sets the value of a field to a specific value and calls the <see cref="PropertyChanged"/> event. /// </summary> /// <typeparam name="T">The type of the value being set.</typeparam> /// <param name="storage">The field to store the value.</param> /// <param name="value">The value to store.</param> /// <param name="propertyName">(Filled automatically) the name of the property being set.</param> protected void Set<T>(ref T storage, T value, [CallerMemberName] string propertyName = null) { if (Equals(storage, value)) { return; } storage = value; OnPropertyChanged(propertyName); } /// <inheritdoc/> protected void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } /// <summary> /// Represents a <see cref="UserControl"/> with added PropertyChanged handlers (similar to Observable). /// </summary> public class ObservableControl : UserControl { /// <summary> /// An event which is fired whenever a related property in an inheriting type is set. /// </summary> public event PropertyChangedEventHandler PropertyChanged; /// <summary> /// Sets the value of a field to a specific value and calls the <see cref="PropertyChanged"/> event. /// </summary> /// <typeparam name="T">The type of the value being set.</typeparam> /// <param name="storage">The field to store the value.</param> /// <param name="value">The value to store.</param> /// <param name="propertyName">(Filled automatically) the name of the property being set.</param> protected void Set<T>(ref T storage, T value, [CallerMemberName] string propertyName = null) { if (Equals(storage, value)) { return; } storage = value; OnPropertyChanged(propertyName); } /// <inheritdoc/> protected void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } }
39.37037
139
0.620414
[ "MIT" ]
bassclefstudio/BassClefStudio.UWP
BassClefStudio.UWP.Core/Observables.cs
4,254
C#
// ========================================================================== // RenameAsset.cs // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex Group // All rights reserved. // ========================================================================== namespace Squidex.Domain.Apps.Write.Assets.Commands { public sealed class RenameAsset : AssetAggregateCommand { public string FileName { get; set; } } }
31.875
78
0.372549
[ "MIT" ]
maooson/squidex
src/Squidex.Domain.Apps.Write/Assets/Commands/RenameAsset.cs
512
C#
namespace HareDu { public enum QueueMode { Default, Lazy } }
11
25
0.511364
[ "Apache-2.0" ]
ahives/HareDu1
src/HareDu/QueueMode.cs
88
C#
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; using Microsoft.Extensions.DependencyInjection; using Senparc.CO2NET; using Senparc.CO2NET.Extensions; using Senparc.CO2NET.RegisterServices; using Senparc.CO2NET.Utilities; using Senparc.Core.Models; using Senparc.Scf.Core.Config; using Senparc.Scf.Core.Models; using System; using System.Diagnostics; using System.IO; namespace Senparc.Web { /// <summary> /// 设计时 DbContext 创建 /// </summary> public class SenparcDbContextFactory : IDesignTimeDbContextFactory<SenparcEntities> { public SenparcEntities CreateDbContext(string[] args) { //修复 https://github.com/SenparcCoreFramework/SCF/issues/13 发现的问题(在非Web环境下无法得到网站根目录路径) IRegisterService register = RegisterService.Start(new SenparcSetting()); CO2NET.Config.RootDictionaryPath = Path.Combine(AppContext.BaseDirectory, "..\\..\\..\\"); // var builder = new DbContextOptionsBuilder<SenparcEntities>(); //如果运行 Add-Migration 命令,并且获取不到正确的网站根目录,此处可能无法自动获取到连接字符串(上述#13问题), //也可通过下面已经注释的的提供默认值方式解决(不推荐) var sqlConnection = SenparcDatabaseConfigs.ClientConnectionString; //?? "Server=.\\;Database=SCF;Trusted_Connection=True;integrated security=True;"; Senparc.Areas.Admin.Register systemRegister = new Areas.Admin.Register(); builder.UseSqlServer(sqlConnection, b => systemRegister.DbContextOptionsAction(b, "Senparc.Web")); return new SenparcEntities(builder.Options); } } }
38.365854
160
0.72028
[ "Apache-2.0" ]
gongzhw/SCF
src/Senparc.Web/DbContext/SenparcDbContextFactory.cs
1,775
C#
// Copyright 2018 by JCoder58. See License.txt for license // Auto-generated --- Do not modify. using System; using System.Collections.Generic; using System.Runtime.InteropServices; using UE4.Core; using UE4.CoreUObject; using UE4.CoreUObject.Native; using UE4.InputCore; using UE4.Native; #pragma warning disable CS0108 using UE4.NavigationSystem.Native; using UE4.Engine; namespace UE4.NavigationSystem { ///<summary>Nav System Config Override</summary> public unsafe partial class NavSystemConfigOverride : Actor { ///<summary>Sprite Component</summary> public unsafe BillboardComponent SpriteComponent { get {return NavSystemConfigOverride_ptr->SpriteComponent;} set {NavSystemConfigOverride_ptr->SpriteComponent = value;} } ///<summary>Navigation System Config</summary> public unsafe NavigationSystemConfig NavigationSystemConfig { get {return NavSystemConfigOverride_ptr->NavigationSystemConfig;} } public bool bLoadOnClient { get {return Main.GetGetBoolPropertyByName(this, "bLoadOnClient"); } set {Main.SetGetBoolPropertyByName(this, "bLoadOnClient", value); } } static NavSystemConfigOverride() { StaticClass = Main.GetClass("NavSystemConfigOverride"); } internal unsafe NavSystemConfigOverride_fields* NavSystemConfigOverride_ptr => (NavSystemConfigOverride_fields*) ObjPointer.ToPointer(); ///<summary>Convert from IntPtr to UObject</summary> public static implicit operator NavSystemConfigOverride(IntPtr p) => UObject.Make<NavSystemConfigOverride>(p); ///<summary>Get UE4 Class</summary> public static Class StaticClass {get; private set;} ///<summary>Get UE4 Default Object for this Class</summary> public static NavSystemConfigOverride DefaultObject => Main.GetDefaultObject(StaticClass); ///<summary>Spawn an object of this class</summary> public static NavSystemConfigOverride New(UObject obj = null, Name name = new Name()) => Main.NewObject(StaticClass, obj, name); } }
45.340426
144
0.716096
[ "MIT" ]
UE4DotNet/Plugin
DotNet/DotNet/UE4/Generated/NavigationSystem/NavSystemConfigOverride.cs
2,131
C#
using System.Threading; using System.Threading.Tasks; using HealthyNutGuysDomain.Models; namespace HealthyNutGuysDomain.Repositories { public interface IRefreshTokenRepository { #region Methods Task<bool> DeleteAsync(ApplicationUser user, RefreshToken refreshToken, CancellationToken ct = default(CancellationToken)); Task<bool> SaveAsync(ApplicationUser user, string newRefreshToken, CancellationToken ct = default(CancellationToken)); Task<bool> ValidateAsync(ApplicationUser user, RefreshToken refreshToken, CancellationToken ct = default(CancellationToken)); #endregion } }
33.722222
129
0.805601
[ "MIT" ]
omikolaj/healthy-nut-guys-api
HealthyNutGuysDomain/Repositories/IRefreshTokenRepository.cs
607
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using AH.Shared.MODEL; namespace AH.INVMS.MODEL { public class DemandRequisition { public string ID { set; get; } public string TransactionType { set; get; } public string SerialNo { set; get; } public DateTime RequisitionDate { set; get; } public string RequisitionType { set; get; } public string RequisitionBy { set; get; } public string RequisitionByName { set; get; } public string VerifiedBy { set; get; } public string Remarks { set; get; } public string ReqDetails { set; get; } public float DemandQty { set; get; } public float RemainingQty { set; get; } public Warehouse Warehouse { set; get; } public ItemMaster ItemMaster { set; get; } public StoreLocation StoreLocation { set; get; } public StoreTypeSCM StoreTypeSCM { set; get; } public Department Department { set; get; } public DepartmentUnit DepartmentUnit { set; get; } public EntryParameter EntryParameter { set; get; } } }
35.606061
58
0.645957
[ "Apache-2.0" ]
atiq-shumon/DotNetProjects
Hospital_ERP_VS13-WCF_WF/AH.INVMS/MODEL/DemandRequisition.cs
1,177
C#
using System; class Bus : Vehicle { public Bus(double fuelQuantity, double fuelConsumation, double tankCapacity) : base(fuelQuantity, fuelConsumation, tankCapacity) { } internal override void Drive(double distance) { DriveCalculate(distance, 1.4); } internal void DriveEmpty(double distance) { DriveCalculate(distance, 0); } private void DriveCalculate(double distance, double additionalConsumation) { double fuelNeeded = distance * (FuelConsumation + additionalConsumation); if (fuelNeeded > FuelQuantity) { throw new ArgumentException($"{this.GetType()} needs refueling"); } FuelQuantity -= fuelNeeded; Console.WriteLine($"{this.GetType()} travelled {distance} km"); } }
25.935484
81
0.652985
[ "MIT" ]
sevgin0954/SoftUni-Projects
C# OOP Basics/Polymorphism - Exercise/Vehicles/Bus.cs
806
C#
namespace PhoenixPointModLoader.Manager { public enum ModLoadPriority { Normal, Low, High } }
11.444444
40
0.728155
[ "Apache-2.0" ]
Ijwu/PhoenixPointModInjector
PhoenixPointModLoader/Manager/ModLoadPriority.cs
105
C#
using numl.Math.LinearAlgebra; using numl.Supervised; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace numl.Supervised.Classification { /// <summary> /// Generated Classification model. /// </summary> public class ClassificationModel : LearningModel { /// <summary> /// Gets or sets whether an item can belong to one or more classes. /// <para>For example: a song may take on one or more classes: Guitar, Drums and Vocals (i.e. not mutually exclusive) where as the genre is mutually exclusive.</para> /// </summary> public bool IsMultiClass { get; set; } /// <summary> /// Dictionary of individual specialist classifiers /// </summary> public Dictionary<object, IClassifier> Classifiers { get; set; } /// <summary> /// Instantiate a new ClassificationModel object. /// </summary> public ClassificationModel() { } /// <summary> /// Predict the given Label across all classifiers for the current object. /// </summary> /// <typeparam name="T"></typeparam> /// <typeparam name="Label"></typeparam> /// <param name="o"></param> /// <returns></returns> public Label Predict<T, Label>(T o) { return (Label)this.Predict(o); } /// <summary> /// Predict all given Labels across all classifiers for the current object. /// </summary> /// <typeparam name="T"></typeparam> /// <typeparam name="Label"></typeparam> /// <param name="o"></param> /// <returns></returns> public Label[] PredictClasses<T, Label>(T o) { return this.PredictClasses(o).Select(s => (Label)s).ToArray(); } /// <summary> /// Predicts the given Label from the object. /// </summary> /// <param name="o"></param> /// <returns></returns> public object Predict(object o) { Vector current = this.Generator.Descriptor.Convert(o, false).ToVector(); var predictions = this.Classifiers.Select(s => new Tuple<object, double>(s.Key, s.Value.PredictRaw(current))) .OrderByDescending(or => or.Item2).ToArray(); return predictions.FirstOrDefault().Item1; } /// <summary> /// Predict all given Labels across all classifiers for the current object. /// </summary> /// <param name="o"></param> /// <returns></returns> public IEnumerable<object> PredictClasses(object o) { Vector current = this.Generator.Descriptor.ToVector(o); var prediction = this.Classifiers.Select(s => new Tuple<object, double>(s.Key, s.Value.PredictRaw(current))) .OrderByDescending(or => or.Item2); double sum = prediction.Sum(s => s.Item2); foreach (var predict in prediction) { if (predict.Item2 >= 0.5) yield return predict.Item1; } } } }
34.494624
174
0.554863
[ "MIT" ]
sethjuarez/numl
Src/numl/Supervised/Classification/ClassificationModel.cs
3,210
C#
/* JustMock Lite Copyright © 2010-2014 Telerik EAD 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.Linq; using System.Reflection; namespace System { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Delegate, Inherited = false)] public sealed class SerializableAttribute : Attribute { public SerializableAttribute() { } } } namespace Microsoft.VisualStudio.TestTools.UnitTesting { [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] public sealed class TestCategoryAttribute : Attribute { public TestCategoryAttribute(string testCategory) { } } }
26.704545
138
0.766809
[ "Apache-2.0" ]
tailsu/JustMockLite
Telerik.JustMock.Silverlight/Silverlight/SilverlightGlue.cs
1,176
C#
namespace Agebull.EntityModel { /// <summary> /// 通知对象的状态类型 /// </summary> public enum NotificationStatusType { /// <summary> /// 原始状态 /// </summary> None, /// <summary> /// 已刷新 /// </summary> Refresh, /// <summary> /// 已修改 /// </summary> Modified, /// <summary> /// 新增完成 /// </summary> Added, /// <summary> /// 保存完成 /// </summary> Saved, /// <summary> /// 已实际刪除 /// </summary> Deleted, /// <summary> /// 正在内部操作 /// </summary> Inner, /// <summary> /// 正在同步 /// </summary> Synchronous, /// <summary> /// 可以重做 /// </summary> CanReDo, /// <summary> /// 可以撤销 /// </summary> CanUnDo, /// <summary> /// 重做 /// </summary> ReDo, /// <summary> /// 撤销 /// </summary> UnDo } }
17.95
38
0.342618
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
agebullhu/MicroZero
src/ZeroTester/Entities/Interface/NotificationStatusType.cs
1,187
C#
/* Copyright (c) 2013, 2014 Paolo Patierno All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 and Eclipse Distribution License v1.0 which accompany this distribution. The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License is available at http://www.eclipse.org/org/documents/edl-v10.php. Contributors: Paolo Patierno - initial API and implementation and/or initial documentation */ #if (NETSTANDARD1_6 || NETSTANDARD2_0) #define SSL #endif #if SSL #if (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3) using Microsoft.SPOT.Net.Security; #else using System.Net.Security; using System.Security.Authentication; #endif #endif using System.Net.Sockets; using System.Net; using System.Security.Cryptography.X509Certificates; using System; using System.Diagnostics; namespace uPLibrary.Networking.M2Mqtt { /// <summary> /// Channel to communicate over the network /// </summary> public class MqttNetworkChannel : IMqttNetworkChannel { #if !(MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || COMPACT_FRAMEWORK) private readonly RemoteCertificateValidationCallback userCertificateValidationCallback; private readonly LocalCertificateSelectionCallback userCertificateSelectionCallback; #endif // remote host information private string remoteHostName; private IPAddress remoteIpAddress; private int remotePort; // socket for communication private Socket socket; // using SSL private bool secure; // CA certificate (on client) private X509Certificate caCert; // Server certificate (on broker) private X509Certificate serverCert; // client certificate (on client) private X509Certificate clientCert; // SSL/TLS protocol version private MqttSslProtocols sslProtocol; /// <summary> /// Remote host name /// </summary> public string RemoteHostName { get { return this.remoteHostName; } } /// <summary> /// Remote IP address /// </summary> public IPAddress RemoteIpAddress { get { return this.remoteIpAddress; } } /// <summary> /// Remote port /// </summary> public int RemotePort { get { return this.remotePort; } } #if SSL // SSL stream private SslStream sslStream; #if (!MF_FRAMEWORK_VERSION_V4_2 && !MF_FRAMEWORK_VERSION_V4_3) private NetworkStream netStream; #endif #endif /// <summary> /// Data available on the channel /// </summary> public bool DataAvailable { get { #if SSL #if (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3) if (secure) return this.sslStream.DataAvailable; else return (this.socket.Available > 0); #else if (secure) return this.netStream.DataAvailable; else return (this.socket.Available > 0); #endif #else return (this.socket.Available > 0); #endif } } /// <summary> /// Constructor /// </summary> /// <param name="socket">Socket opened with the client</param> public MqttNetworkChannel(Socket socket) #if !(MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || COMPACT_FRAMEWORK) : this(socket, false, null, MqttSslProtocols.None, null, null) #else : this(socket, false, null, MqttSslProtocols.None) #endif { } /// <summary> /// Constructor /// </summary> /// <param name="socket">Socket opened with the client</param> /// <param name="secure">Secure connection (SSL/TLS)</param> /// <param name="serverCert">Server X509 certificate for secure connection</param> /// <param name="sslProtocol">SSL/TLS protocol version</param> #if !(MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || COMPACT_FRAMEWORK) /// <param name="userCertificateSelectionCallback">A RemoteCertificateValidationCallback delegate responsible for validating the certificate supplied by the remote party</param> /// <param name="userCertificateValidationCallback">A LocalCertificateSelectionCallback delegate responsible for selecting the certificate used for authentication</param> public MqttNetworkChannel(Socket socket, bool secure, X509Certificate serverCert, MqttSslProtocols sslProtocol, RemoteCertificateValidationCallback userCertificateValidationCallback, LocalCertificateSelectionCallback userCertificateSelectionCallback) #else public MqttNetworkChannel(Socket socket, bool secure, X509Certificate serverCert, MqttSslProtocols sslProtocol) #endif { this.socket = socket; this.secure = secure; this.serverCert = serverCert; this.sslProtocol = sslProtocol; #if !(MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || COMPACT_FRAMEWORK) this.userCertificateValidationCallback = userCertificateValidationCallback; this.userCertificateSelectionCallback = userCertificateSelectionCallback; #endif } /// <summary> /// Constructor /// </summary> /// <param name="remoteHostName">Remote Host name</param> /// <param name="remotePort">Remote port</param> public MqttNetworkChannel(string remoteHostName, int remotePort) #if !(MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || COMPACT_FRAMEWORK) : this(remoteHostName, remotePort, false, null, null, MqttSslProtocols.None, null, null) #else : this(remoteHostName, remotePort, false, null, null, MqttSslProtocols.None) #endif { } /// <summary> /// Constructor /// </summary> /// <param name="remoteHostName">Remote Host name</param> /// <param name="remotePort">Remote port</param> /// <param name="secure">Using SSL</param> /// <param name="caCert">CA certificate</param> /// <param name="clientCert">Client certificate</param> /// <param name="sslProtocol">SSL/TLS protocol version</param> #if !(MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || COMPACT_FRAMEWORK) /// <param name="userCertificateSelectionCallback">A RemoteCertificateValidationCallback delegate responsible for validating the certificate supplied by the remote party</param> /// <param name="userCertificateValidationCallback">A LocalCertificateSelectionCallback delegate responsible for selecting the certificate used for authentication</param> public MqttNetworkChannel(string remoteHostName, int remotePort, bool secure, X509Certificate caCert, X509Certificate clientCert, MqttSslProtocols sslProtocol, RemoteCertificateValidationCallback userCertificateValidationCallback, LocalCertificateSelectionCallback userCertificateSelectionCallback) #else public MqttNetworkChannel(string remoteHostName, int remotePort, bool secure, X509Certificate caCert, X509Certificate clientCert, MqttSslProtocols sslProtocol) #endif { IPAddress remoteIpAddress = null; try { // check if remoteHostName is a valid IP address and get it remoteIpAddress = IPAddress.Parse(remoteHostName); } catch { } // in this case the parameter remoteHostName isn't a valid IP address if (remoteIpAddress == null) { #if (NETSTANDARD1_6 || NETSTANDARD2_0) IPHostEntry hostEntry = Dns.GetHostEntryAsync(remoteHostName).Result; #else IPHostEntry hostEntry = Dns.GetHostEntry(remoteHostName); #endif if ((hostEntry != null) && (hostEntry.AddressList.Length > 0)) { // check for the first address not null // it seems that with .Net Micro Framework, the IPV6 addresses aren't supported and return "null" int i = 0; while (hostEntry.AddressList[i] == null) i++; remoteIpAddress = hostEntry.AddressList[i]; } else { throw new Exception("No address found for the remote host name"); } } this.remoteHostName = remoteHostName; this.remoteIpAddress = remoteIpAddress; this.remotePort = remotePort; this.secure = secure; this.caCert = caCert; this.clientCert = clientCert; this.sslProtocol = sslProtocol; #if !(MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || COMPACT_FRAMEWORK) this.userCertificateValidationCallback = userCertificateValidationCallback; this.userCertificateSelectionCallback = userCertificateSelectionCallback; #endif } /// <summary> /// Connect to remote server /// </summary> public void Connect() { this.socket = new Socket(this.remoteIpAddress.GetAddressFamily(), SocketType.Stream, ProtocolType.Tcp); // try connection to the broker this.socket.Connect(this.remoteHostName, this.remotePort); #if SSL // secure channel requested if (secure) { // create SSL stream #if (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3) this.sslStream = new SslStream(this.socket); #else this.netStream = new NetworkStream(this.socket); this.sslStream = new SslStream(this.netStream, false, this.userCertificateValidationCallback, this.userCertificateSelectionCallback); #endif // server authentication (SSL/TLS handshake) #if (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3) this.sslStream.AuthenticateAsClient(this.remoteHostName, this.clientCert, new X509Certificate[] { this.caCert }, SslVerification.CertificateRequired, MqttSslUtility.ToSslPlatformEnum(this.sslProtocol)); #else X509CertificateCollection clientCertificates = null; // check if there is a client certificate to add to the collection, otherwise it's null (as empty) if (this.clientCert != null) clientCertificates = new X509CertificateCollection(new X509Certificate[] { this.clientCert }); #if (NETSTANDARD1_6 || NETSTANDARD2_0) this.sslStream.AuthenticateAsClientAsync(this.remoteHostName, clientCertificates, MqttSslUtility.ToSslPlatformEnum(this.sslProtocol), false).Wait(); #else this.sslStream.AuthenticateAsClient(this.remoteHostName, clientCertificates, MqttSslUtility.ToSslPlatformEnum(this.sslProtocol), false); #endif #endif } #endif } /// <summary> /// Send data on the network channel /// </summary> /// <param name="buffer">Data buffer to send</param> /// <returns>Number of byte sent</returns> public int Send(byte[] buffer) { #if SSL if (this.secure) { this.sslStream.Write(buffer, 0, buffer.Length); this.sslStream.Flush(); return buffer.Length; } else return this.socket.Send(buffer, 0, buffer.Length, SocketFlags.None); #else return this.socket.Send(buffer, 0, buffer.Length, SocketFlags.None); #endif } /// <summary> /// Receive data from the network /// </summary> /// <param name="buffer">Data buffer for receiving data</param> /// <returns>Number of bytes received</returns> public int Receive(byte[] buffer) { #if SSL if (this.secure) { // read all data needed (until fill buffer) int idx = 0, read = 0; while (idx < buffer.Length) { // fixed scenario with socket closed gracefully by peer/broker and // Read return 0. Avoid infinite loop. read = this.sslStream.Read(buffer, idx, buffer.Length - idx); if (read == 0) return 0; idx += read; } return buffer.Length; } else { // read all data needed (until fill buffer) int idx = 0, read = 0; while (idx < buffer.Length) { // fixed scenario with socket closed gracefully by peer/broker and // Read return 0. Avoid infinite loop. read = this.socket.Receive(buffer, idx, buffer.Length - idx, SocketFlags.None); if (read == 0) return 0; idx += read; } return buffer.Length; } #else // read all data needed (until fill buffer) int idx = 0, read = 0; while (idx < buffer.Length) { // fixed scenario with socket closed gracefully by peer/broker and // Read return 0. Avoid infinite loop. read = this.socket.Receive(buffer, idx, buffer.Length - idx, SocketFlags.None); if (read == 0) return 0; idx += read; } return buffer.Length; #endif } /// <summary> /// Receive data from the network channel with a specified timeout /// </summary> /// <param name="buffer">Data buffer for receiving data</param> /// <param name="timeout">Timeout on receiving (in milliseconds)</param> /// <returns>Number of bytes received</returns> public int Receive(byte[] buffer, int timeout) { // check data availability (timeout is in microseconds) if (this.socket.Poll(timeout * 1000, SelectMode.SelectRead)) { return this.Receive(buffer); } else { return 0; } } /// <summary> /// Close the network channel /// </summary> public void Close() { #if SSL if (this.secure) { #if (!MF_FRAMEWORK_VERSION_V4_2 && !MF_FRAMEWORK_VERSION_V4_3) #if (NETSTANDARD1_6 || NETSTANDARD2_0) this.netStream.Flush(); #else this.netStream.Close(); #endif #endif #if (NETSTANDARD1_6 || NETSTANDARD2_0) this.sslStream.Flush(); #else this.sslStream.Close(); #endif } #if (NETSTANDARD1_6 || NETSTANDARD2_0) try { this.socket.Shutdown(SocketShutdown.Both); } catch { // An error occurred when attempting to access the socket or socket has been closed // Refer to: https://msdn.microsoft.com/en-us/library/system.net.sockets.socket.shutdown(v=vs.110).aspx } this.socket.Dispose(); #else this.socket.Close(); #endif #else this.socket.Close(); #endif } /// <summary> /// Accept connection from a remote client /// </summary> public void Accept() { #if SSL // secure channel requested if (secure) { #if !(MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3) this.netStream = new NetworkStream(this.socket); this.sslStream = new SslStream(this.netStream, false, this.userCertificateValidationCallback, this.userCertificateSelectionCallback); #if (NETSTANDARD1_6 || NETSTANDARD2_0) this.sslStream.AuthenticateAsServerAsync(this.serverCert, false, MqttSslUtility.ToSslPlatformEnum(this.sslProtocol), false).Wait(); #else this.sslStream.AuthenticateAsServer(this.serverCert, false, MqttSslUtility.ToSslPlatformEnum(this.sslProtocol), false); #endif #endif } return; #else return; #endif } } /// <summary> /// IPAddress Utility class /// </summary> public static class IPAddressUtility { /// <summary> /// Return AddressFamily for the IP address /// </summary> /// <param name="ipAddress">IP address to check</param> /// <returns>Address family</returns> public static AddressFamily GetAddressFamily(this IPAddress ipAddress) { #if (!MF_FRAMEWORK_VERSION_V4_2 && !MF_FRAMEWORK_VERSION_V4_3) return ipAddress.AddressFamily; #else return (ipAddress.ToString().IndexOf(':') != -1) ? AddressFamily.InterNetworkV6 : AddressFamily.InterNetwork; #endif } } /// <summary> /// MQTT SSL utility class /// </summary> public static class MqttSslUtility { #if (!MF_FRAMEWORK_VERSION_V4_2 && !MF_FRAMEWORK_VERSION_V4_3 && !COMPACT_FRAMEWORK) public static SslProtocols ToSslPlatformEnum(MqttSslProtocols mqttSslProtocol) { switch (mqttSslProtocol) { case MqttSslProtocols.None: return SslProtocols.None; case MqttSslProtocols.SSLv3: return SslProtocols.Ssl3; case MqttSslProtocols.TLSv1_0: return SslProtocols.Tls; case MqttSslProtocols.TLSv1_1: return SslProtocols.Tls11; case MqttSslProtocols.TLSv1_2: return SslProtocols.Tls12; default: throw new ArgumentException("SSL/TLS protocol version not supported"); } } #elif (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3) public static SslProtocols ToSslPlatformEnum(MqttSslProtocols mqttSslProtocol) { switch (mqttSslProtocol) { case MqttSslProtocols.None: return SslProtocols.None; case MqttSslProtocols.SSLv3: return SslProtocols.SSLv3; case MqttSslProtocols.TLSv1_0: return SslProtocols.TLSv1; case MqttSslProtocols.TLSv1_1: case MqttSslProtocols.TLSv1_2: default: throw new ArgumentException("SSL/TLS protocol version not supported"); } } #endif } }
37.358121
185
0.600943
[ "EPL-1.0" ]
sandermvanvliet/paho.mqtt.m2mqtt
M2Mqtt/Net/MqttNetworkChannel.cs
19,090
C#
using System.Linq; using System.Threading.Tasks; using IdentitySample.Models; using IdentitySample.Models.ManageViewModels; using IdentitySample.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http.Authentication; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; namespace IdentitySamples.Controllers { [Authorize] public class ManageController : Controller { private readonly IEmailSender _emailSender; private readonly ILogger _logger; private readonly SignInManager<ApplicationUser> _signInManager; private readonly ISmsSender _smsSender; private readonly UserManager<ApplicationUser> _userManager; public ManageController( UserManager<ApplicationUser> userManager, SignInManager<ApplicationUser> signInManager, IEmailSender emailSender, ISmsSender smsSender, ILoggerFactory loggerFactory) { _userManager = userManager; _signInManager = signInManager; _emailSender = emailSender; _smsSender = smsSender; _logger = loggerFactory.CreateLogger<ManageController>(); } // // GET: /Manage/Index [HttpGet] public async Task<IActionResult> Index(ManageMessageId? message = null) { ViewData["StatusMessage"] = message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." : message == ManageMessageId.SetPasswordSuccess ? "Your password has been set." : message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set." : message == ManageMessageId.Error ? "An error has occurred." : message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added." : message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed." : ""; var user = await GetCurrentUserAsync(); var model = new IndexViewModel { HasPassword = await _userManager.HasPasswordAsync(user), PhoneNumber = await _userManager.GetPhoneNumberAsync(user), TwoFactor = await _userManager.GetTwoFactorEnabledAsync(user), Logins = await _userManager.GetLoginsAsync(user), BrowserRemembered = await _signInManager.IsTwoFactorClientRememberedAsync(user) }; return View(model); } // // POST: /Manage/RemoveLogin [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> RemoveLogin(RemoveLoginViewModel account) { ManageMessageId? message = ManageMessageId.Error; var user = await GetCurrentUserAsync(); if (user != null) { var result = await _userManager.RemoveLoginAsync(user, account.LoginProvider, account.ProviderKey); if (result.Succeeded) { await _signInManager.SignInAsync(user, false); message = ManageMessageId.RemoveLoginSuccess; } } return RedirectToAction(nameof(ManageLogins), new {Message = message}); } // // GET: /Manage/AddPhoneNumber public IActionResult AddPhoneNumber() { return View(); } // // POST: /Manage/AddPhoneNumber [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> AddPhoneNumber(AddPhoneNumberViewModel model) { if (!ModelState.IsValid) return View(model); // Generate the token and send it var user = await GetCurrentUserAsync(); var code = await _userManager.GenerateChangePhoneNumberTokenAsync(user, model.PhoneNumber); await _smsSender.SendSmsAsync(model.PhoneNumber, "Your security code is: " + code); return RedirectToAction(nameof(VerifyPhoneNumber), new {model.PhoneNumber}); } // // POST: /Manage/EnableTwoFactorAuthentication [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> EnableTwoFactorAuthentication() { var user = await GetCurrentUserAsync(); if (user != null) { await _userManager.SetTwoFactorEnabledAsync(user, true); await _signInManager.SignInAsync(user, false); _logger.LogInformation(1, "User enabled two-factor authentication."); } return RedirectToAction(nameof(Index), "Manage"); } // // POST: /Manage/DisableTwoFactorAuthentication [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> DisableTwoFactorAuthentication() { var user = await GetCurrentUserAsync(); if (user != null) { await _userManager.SetTwoFactorEnabledAsync(user, false); await _signInManager.SignInAsync(user, false); _logger.LogInformation(2, "User disabled two-factor authentication."); } return RedirectToAction(nameof(Index), "Manage"); } // // GET: /Manage/VerifyPhoneNumber [HttpGet] public async Task<IActionResult> VerifyPhoneNumber(string phoneNumber) { var code = await _userManager.GenerateChangePhoneNumberTokenAsync(await GetCurrentUserAsync(), phoneNumber); // Send an SMS to verify the phone number return phoneNumber == null ? View("Error") : View(new VerifyPhoneNumberViewModel {PhoneNumber = phoneNumber}); } // // POST: /Manage/VerifyPhoneNumber [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> VerifyPhoneNumber(VerifyPhoneNumberViewModel model) { if (!ModelState.IsValid) return View(model); var user = await GetCurrentUserAsync(); if (user != null) { var result = await _userManager.ChangePhoneNumberAsync(user, model.PhoneNumber, model.Code); if (result.Succeeded) { await _signInManager.SignInAsync(user, false); return RedirectToAction(nameof(Index), new {Message = ManageMessageId.AddPhoneSuccess}); } } // If we got this far, something failed, redisplay the form ModelState.AddModelError(string.Empty, "Failed to verify phone number"); return View(model); } // // GET: /Manage/RemovePhoneNumber [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> RemovePhoneNumber() { var user = await GetCurrentUserAsync(); if (user != null) { var result = await _userManager.SetPhoneNumberAsync(user, null); if (result.Succeeded) { await _signInManager.SignInAsync(user, false); return RedirectToAction(nameof(Index), new {Message = ManageMessageId.RemovePhoneSuccess}); } } return RedirectToAction(nameof(Index), new {Message = ManageMessageId.Error}); } // // GET: /Manage/ChangePassword [HttpGet] public IActionResult ChangePassword() { return View(); } // // POST: /Manage/ChangePassword [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> ChangePassword(ChangePasswordViewModel model) { if (!ModelState.IsValid) return View(model); var user = await GetCurrentUserAsync(); if (user != null) { var result = await _userManager.ChangePasswordAsync(user, model.OldPassword, model.NewPassword); if (result.Succeeded) { await _signInManager.SignInAsync(user, false); _logger.LogInformation(3, "User changed their password successfully."); return RedirectToAction(nameof(Index), new {Message = ManageMessageId.ChangePasswordSuccess}); } AddErrors(result); return View(model); } return RedirectToAction(nameof(Index), new {Message = ManageMessageId.Error}); } // // GET: /Manage/SetPassword [HttpGet] public IActionResult SetPassword() { return View(); } // // POST: /Manage/SetPassword [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> SetPassword(SetPasswordViewModel model) { if (!ModelState.IsValid) return View(model); var user = await GetCurrentUserAsync(); if (user != null) { var result = await _userManager.AddPasswordAsync(user, model.NewPassword); if (result.Succeeded) { await _signInManager.SignInAsync(user, false); return RedirectToAction(nameof(Index), new {Message = ManageMessageId.SetPasswordSuccess}); } AddErrors(result); return View(model); } return RedirectToAction(nameof(Index), new {Message = ManageMessageId.Error}); } //GET: /Manage/ManageLogins [HttpGet] public async Task<IActionResult> ManageLogins(ManageMessageId? message = null) { ViewData["StatusMessage"] = message == ManageMessageId.RemoveLoginSuccess ? "The external login was removed." : message == ManageMessageId.AddLoginSuccess ? "The external login was added." : message == ManageMessageId.Error ? "An error has occurred." : ""; var user = await GetCurrentUserAsync(); if (user == null) return View("Error"); var userLogins = await _userManager.GetLoginsAsync(user); var otherLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()) .Where(auth => userLogins.All(ul => auth.Name != ul.LoginProvider)) .Select(auth => new AuthenticationDescription(){ AuthenticationScheme = auth.Name, DisplayName = auth.DisplayName }) .ToList(); ViewData["ShowRemoveButton"] = user.PasswordHash != null || userLogins.Count > 1; return View(new ManageLoginsViewModel { CurrentLogins = userLogins, OtherLogins = otherLogins }); } // // POST: /Manage/LinkLogin [HttpPost] [ValidateAntiForgeryToken] public IActionResult LinkLogin(string provider) { // Request a redirect to the external login provider to link a login for the current user var redirectUrl = Url.Action("LinkLoginCallback", "Manage"); var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl, _userManager.GetUserId(User)); return Challenge(properties, provider); } // // GET: /Manage/LinkLoginCallback [HttpGet] public async Task<ActionResult> LinkLoginCallback() { var user = await GetCurrentUserAsync(); if (user == null) return View("Error"); var info = await _signInManager.GetExternalLoginInfoAsync(await _userManager.GetUserIdAsync(user)); if (info == null) return RedirectToAction(nameof(ManageLogins), new {Message = ManageMessageId.Error}); var result = await _userManager.AddLoginAsync(user, info); var message = result.Succeeded ? ManageMessageId.AddLoginSuccess : ManageMessageId.Error; return RedirectToAction(nameof(ManageLogins), new {Message = message}); } #region Helpers private void AddErrors(IdentityResult result) { foreach (var error in result.Errors) ModelState.AddModelError(string.Empty, error.Description); } public enum ManageMessageId { AddPhoneSuccess, AddLoginSuccess, ChangePasswordSuccess, SetTwoFactorSuccess, SetPasswordSuccess, RemoveLoginSuccess, RemovePhoneSuccess, Error } private Task<ApplicationUser> GetCurrentUserAsync() { return _userManager.GetUserAsync(HttpContext.User); } #endregion } }
31.163265
120
0.724951
[ "MIT" ]
iamshen/LinqToDB.Identity
samples/IdentitySample.Mvc/Controllers/ManageController.cs
10,689
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("05. Boxes")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("05. Boxes")] [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("975341a3-736e-475a-a477-dff06d2e59ed")] // 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.459459
84
0.743867
[ "MIT" ]
Shtereva/Fundamentals-with-CSharp
Objects and Simple Classes/05. Boxes/Properties/AssemblyInfo.cs
1,389
C#
using System; namespace XmlFormatter.src.Interfaces.Settings.DataStructure { /// <summary> /// This interface is a single setting /// </summary> public interface ISettingPair { /// <summary> /// The key or name of the setting /// </summary> string Name { get; } /// <summary> /// The data type of the stored value /// </summary> Type Type { get; } /// <summary> /// The setting value /// </summary> object Value { get; } /// <summary> /// Get the value in a specific format from the setting container /// </summary> /// <typeparam name="T">The type the setting should be casted to</typeparam> /// <returns></returns> T GetValue<T>(); /// <summary> /// Set or change the value of this setting /// </summary> /// <typeparam name="T">The type of the data to add</typeparam> /// <param name="value">The value of the dataset</param> void SetValue<T>(T value); } }
27.692308
84
0.532407
[ "MIT" ]
XanatosX/XmlFormatter
XmlFormatter/src/Interfaces/Settings/DataStructure/ISettingPair.cs
1,082
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. using Microsoft.AspNetCore.Razor.LanguageServer.Tooltip; using Xunit; namespace Microsoft.AspNetCore.Razor.LanguageServer.Test.Completion { public class TagHelperTooltipFactoryBaseTest { [Fact] public void ReduceTypeName_Plain() { // Arrange var content = "Microsoft.AspNetCore.SomeTagHelpers.SomeTypeName"; // Act var reduced = TagHelperTooltipFactoryBase.ReduceTypeName(content); // Assert Assert.Equal("SomeTypeName", reduced); } [Fact] public void ReduceTypeName_Generics() { // Arrange var content = "System.Collections.Generic.List<System.String>"; // Act var reduced = TagHelperTooltipFactoryBase.ReduceTypeName(content); // Assert Assert.Equal("List<System.String>", reduced); } [Fact] public void ReduceTypeName_CrefGenerics() { // Arrange var content = "System.Collections.Generic.List{System.String}"; // Act var reduced = TagHelperTooltipFactoryBase.ReduceTypeName(content); // Assert Assert.Equal("List{System.String}", reduced); } [Fact] public void ReduceTypeName_NestedGenerics() { // Arrange var content = "Microsoft.AspNetCore.SometTagHelpers.SomeType<Foo.Bar<Baz.Phi>>"; // Act var reduced = TagHelperTooltipFactoryBase.ReduceTypeName(content); // Assert Assert.Equal("SomeType<Foo.Bar<Baz.Phi>>", reduced); } [Theory] [InlineData("Microsoft.AspNetCore.SometTagHelpers.SomeType.Foo.Bar<Baz.Phi>>")] [InlineData("Microsoft.AspNetCore.SometTagHelpers.SomeType.Foo.Bar{Baz.Phi}}")] public void ReduceTypeName_UnbalancedDocs_NotRecoverable_ReturnsOriginalContent(string content) { // Arrange // Act var reduced = TagHelperTooltipFactoryBase.ReduceTypeName(content); // Assert Assert.Equal(content, reduced); } [Fact] public void ReduceMemberName_Plain() { // Arrange var content = "Microsoft.AspNetCore.SometTagHelpers.SomeType.SomeProperty"; // Act var reduced = TagHelperTooltipFactoryBase.ReduceMemberName(content); // Assert Assert.Equal("SomeType.SomeProperty", reduced); } [Fact] public void ReduceMemberName_Generics() { // Arrange var content = "Microsoft.AspNetCore.SometTagHelpers.SomeType<Foo.Bar>.SomeProperty<Foo.Bar>"; // Act var reduced = TagHelperTooltipFactoryBase.ReduceMemberName(content); // Assert Assert.Equal("SomeType<Foo.Bar>.SomeProperty<Foo.Bar>", reduced); } [Fact] public void ReduceMemberName_CrefGenerics() { // Arrange var content = "Microsoft.AspNetCore.SometTagHelpers.SomeType{Foo.Bar}.SomeProperty{Foo.Bar}"; // Act var reduced = TagHelperTooltipFactoryBase.ReduceMemberName(content); // Assert Assert.Equal("SomeType{Foo.Bar}.SomeProperty{Foo.Bar}", reduced); } [Fact] public void ReduceMemberName_NestedGenericsMethodsTypes() { // Arrange var content = "Microsoft.AspNetCore.SometTagHelpers.SomeType<Foo.Bar<Baz,Fi>>.SomeMethod(Foo.Bar<System.String>,Baz<Something>.Fi)"; // Act var reduced = TagHelperTooltipFactoryBase.ReduceMemberName(content); // Assert Assert.Equal("SomeType<Foo.Bar<Baz,Fi>>.SomeMethod(Foo.Bar<System.String>,Baz<Something>.Fi)", reduced); } [Theory] [InlineData("Microsoft.AspNetCore.SometTagHelpers.SomeType.Foo.Bar<Baz.Phi>>")] [InlineData("Microsoft.AspNetCore.SometTagHelpers.SomeType.Foo.Bar{Baz.Phi}}")] [InlineData("Microsoft.AspNetCore.SometTagHelpers.SomeType.Foo.Bar(Baz.Phi))")] [InlineData("Microsoft.AspNetCore.SometTagHelpers.SomeType.Foo{.>")] public void ReduceMemberName_UnbalancedDocs_NotRecoverable_ReturnsOriginalContent(string content) { // Arrange // Act var reduced = TagHelperTooltipFactoryBase.ReduceMemberName(content); // Assert Assert.Equal(content, reduced); } [Fact] public void ReduceCrefValue_InvalidShortValue_ReturnsEmptyString() { // Arrange var content = "T:"; // Act var value = TagHelperTooltipFactoryBase.ReduceCrefValue(content); // Assert Assert.Equal(string.Empty, value); } [Fact] public void ReduceCrefValue_InvalidUnknownIdentifierValue_ReturnsEmptyString() { // Arrange var content = "X:"; // Act var value = TagHelperTooltipFactoryBase.ReduceCrefValue(content); // Assert Assert.Equal(string.Empty, value); } [Fact] public void ReduceCrefValue_Type() { // Arrange var content = "T:Microsoft.AspNetCore.SometTagHelpers.SomeType"; // Act var value = TagHelperTooltipFactoryBase.ReduceCrefValue(content); // Assert Assert.Equal("SomeType", value); } [Fact] public void ReduceCrefValue_Property() { // Arrange var content = "P:Microsoft.AspNetCore.SometTagHelpers.SomeType.SomeProperty"; // Act var value = TagHelperTooltipFactoryBase.ReduceCrefValue(content); // Assert Assert.Equal("SomeType.SomeProperty", value); } [Fact] public void ReduceCrefValue_Member() { // Arrange var content = "P:Microsoft.AspNetCore.SometTagHelpers.SomeType.SomeMember"; // Act var value = TagHelperTooltipFactoryBase.ReduceCrefValue(content); // Assert Assert.Equal("SomeType.SomeMember", value); } [Fact] public void TryExtractSummary_Null_ReturnsFalse() { // Arrange & Act var result = TagHelperTooltipFactoryBase.TryExtractSummary(documentation: null, out var summary); // Assert Assert.False(result); Assert.Null(summary); } [Fact] public void TryExtractSummary_ExtractsSummary_ReturnsTrue() { // Arrange var expectedSummary = " Hello World "; var documentation = $@" Prefixed invalid content <summary>{expectedSummary}</summary> Suffixed invalid content"; // Act var result = TagHelperTooltipFactoryBase.TryExtractSummary(documentation, out var summary); // Assert Assert.True(result); Assert.Equal(expectedSummary, summary); } [Fact] public void TryExtractSummary_NoStartSummary_ReturnsFalse() { // Arrange var documentation = @" Prefixed invalid content </summary> Suffixed invalid content"; // Act var result = TagHelperTooltipFactoryBase.TryExtractSummary(documentation, out var summary); // Assert Assert.True(result); Assert.Equal(@"Prefixed invalid content </summary> Suffixed invalid content", summary); } [Fact] public void TryExtractSummary_NoEndSummary_ReturnsTrue() { // Arrange var documentation = @" Prefixed invalid content <summary> Suffixed invalid content"; // Act var result = TagHelperTooltipFactoryBase.TryExtractSummary(documentation, out var summary); // Assert Assert.True(result); Assert.Equal(@"Prefixed invalid content <summary> Suffixed invalid content", summary); } [Fact] public void TryExtractSummary_XMLButNoSummary_ReturnsFalse() { // Arrange var documentation = @" <param type=""stuff"">param1</param> <return>Result</return> "; // Act var result = TagHelperTooltipFactoryBase.TryExtractSummary(documentation, out var summary); // Assert Assert.False(result); Assert.Null(summary); } [Fact] public void TryExtractSummary_NoXml_ReturnsTrue() { // Arrange var documentation = @" There is no xml, but I got you this < and the >. "; // Act var result = TagHelperTooltipFactoryBase.TryExtractSummary(documentation, out var summary); // Assert Assert.True(result); Assert.Equal("There is no xml, but I got you this < and the >.", summary); } } }
28.5
144
0.587235
[ "MIT" ]
dougbu/razor-tooling
src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/TagHelperTooltipFactoryBaseTest.cs
9,293
C#
using System.Collections; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using Microsoft.Xna.Framework; using Olive.SceneManagement; namespace Olive; /// <summary> /// Represents an object which exists in a scene. /// </summary> public sealed class GameObject : IDisposable { private readonly List<Coroutine> _coroutines = new(); private readonly List<Component> _components = new(); private Transform? _transform; // lazy load of Transform component private string _name; private bool _activeSelf = true; /// <summary> /// Initializes a new instance of the <see cref="GameObject" /> class. /// </summary> /// <param name="owningScene">The owning scene.</param> /// <exception cref="ArgumentNullException"><paramref name="owningScene" /> is <see langword="null" />.</exception> public GameObject(Scene owningScene) { OwningScene = owningScene ?? throw new ArgumentNullException(nameof(owningScene)); owningScene.AddGameObject(this); AddComponent<Transform>(); } /// <summary> /// Gets a value indicating whether this game object is active in the hierarchy. /// </summary> /// <value><see langword="true" /> if this game object is active in the hierarchy, otherwise <see langword="false" />.</value> /// <remarks> /// A game object is considered "active in the hierarchy" if <see cref="ActiveSelf" /> on the object and all of its /// parents are <see langword="true" /> /// </remarks> public bool ActiveInHierarchy { get { AssertNonDisposed(); if (Transform.Parent is { } parent) { return ActiveSelf && parent.GameObject.ActiveInHierarchy; } return ActiveSelf; } } /// <summary> /// Gets a value indicating whether this game object is active. /// </summary> /// <value><see langword="true" /> if this game object is active, otherwise <see langword="false" />.</value> public bool ActiveSelf { get { AssertNonDisposed(); return _activeSelf; } } /// <summary> /// Gets a value indicating whether this component has been disposed by calling <see cref="Dispose" />. /// </summary> /// <value><see langword="true" /> if the component has been disposed; otherwise, <see langword="false" />.</value> public bool IsDisposed { get; private set; } /// <summary> /// Gets or sets the name of this game object. /// </summary> /// <value>The name of this game object.</value> public string Name { get { AssertNonDisposed(); return _name; } set { AssertNonDisposed(); _name = string.IsNullOrWhiteSpace(value) ? string.Empty : value; } } /// <summary> /// Gets the scene which owns this game object. /// </summary> /// <value>The scene which owns this game object.</value> public Scene OwningScene { get; } /// <summary> /// Gets the transform component attached to this game object. /// </summary> /// <value>The transform component.</value> public Transform Transform { get { AssertNonDisposed(); _transform ??= GetComponent<Transform>(); // we can safely assume that GetComponent<Transform> will not be null. // because if it is, something is tremendously fucked. all GOs should have a Transform Trace.Assert(_transform is not null); return _transform!; } } /// <summary> /// Gets a read-only view of the components in this handler. /// </summary> /// <value>A read-only view of the components.</value> public IReadOnlyCollection<Component> Components => _components.AsReadOnly(); /// <summary> /// Adds a new component to this handler. /// </summary> /// <typeparam name="T">The component type.</typeparam> /// <returns>The newly-added component.</returns> public T AddComponent<T>() where T : Component { return (T) AddComponent(typeof(T)); } /// <summary> /// Adds a new component to this handler. /// </summary> /// <param name="factory">The factory to invoke in order to fetch the necessary component.</param> /// <typeparam name="T">The component type.</typeparam> /// <returns>The newly-added component.</returns> /// <exception cref="ArgumentNullException"><paramref name="factory" /> is <see langword="null" />.</exception> /// <exception cref="InvalidCastException"><paramref name="factory" /> returned invalid component (possibly <see langword="null" />).</exception> public T AddComponent<T>(Func<T> factory) where T : Component { AssertNonDisposed(); if (factory is null) { throw new ArgumentNullException(nameof(factory)); } if (factory.Invoke() is not { } component) { throw new InvalidCastException("Factory did not return valid behavior. (Perhaps it returned null?)"); } _components.Add(component); component.GameObject = this; if (component is Behavior behavior) behavior.Initialize(); return component; } /// <summary> /// Adds a new component to this handler. /// </summary> /// <param name="type">The component type.</param> /// <returns>The newly-added component.</returns> /// <exception cref="ArgumentNullException"><paramref name="type" /> is <see langword="null" />.</exception> /// <exception cref="ArgumentException"> /// <para><paramref name="type" /> does is abstract.</para> /// -or- /// <para><paramref name="type" /> does not inherit <see cref="Component" />.</para> /// </exception> public Component AddComponent(Type type) { AssertNonDisposed(); if (type is null) { throw new ArgumentNullException(nameof(type)); } if (type.IsAbstract) { throw new ArgumentException("Type cannot be abstract", nameof(type)); } if (!type.IsSubclassOf(typeof(Component))) { throw new ArgumentException($"Type does not inherit {typeof(Component)}"); } var component = (Component) Activator.CreateInstance(type)!; _components.Add(component); component.GameObject = this; if (component is Behavior behavior) behavior.Initialize(); return component; } /// <summary> /// Gets the specified component. /// </summary> /// <typeparam name="T">The component type.</typeparam> /// <returns>All components whose type matches <typeparamref name="T" />.</returns> public IEnumerable<T> EnumerateComponents<T>() { AssertNonDisposed(); return _components.OfType<T>(); } /// <summary> /// Gets the specified component. /// </summary> /// <typeparam name="T">The component type.</typeparam> /// <returns>The component whose type matches <typeparamref name="T" />, or <see langword="null" /> on failure.</returns> public T? GetComponent<T>() { AssertNonDisposed(); return _components.OfType<T>().FirstOrDefault(); } /// <summary> /// Gets the specified component. /// </summary> /// <typeparam name="T">The component type.</typeparam> /// <returns>All components whose type matches <typeparamref name="T" />.</returns> public T[] GetComponents<T>() { return EnumerateComponents<T>().ToArray(); } /// <summary> /// Sets whether or not this game object is active. /// </summary> /// <param name="active"><see langword="true" /> if this game object should be activated, otherwise <see langword="false" />.</param> public void SetActive(bool active) { AssertNonDisposed(); _activeSelf = active; } /// <summary> /// Attempts to get a component, and returns the result of that attempt. /// </summary> /// <param name="component">The destination of the component instance.</param> /// <typeparam name="T">The type of the component to retrieve.</typeparam> /// <returns><see langword="true" /> if the component was found, otherwise <see langword="false" />.</returns> public bool TryGetComponent<T>([NotNullWhen(true)] out T? component) { AssertNonDisposed(); return (component = GetComponent<T>()) is not null; } /// <summary> /// Disposes all resources allocated by this game object, and removes the object from the scene. /// </summary> public void Dispose() { AssertNonDisposed(); foreach (Component component in _components.ToArray()) { component.Dispose(true); } IsDisposed = true; } internal void RemoveComponent<T>(T component, bool force = false) where T : Component { if (component is Transform && !force) { throw new InvalidOperationException("Cannot remove the Transform component from a game object."); } _components.Remove(component); } internal Coroutine StartCoroutine(IEnumerator enumerator) { var coroutine = new Coroutine(enumerator); _coroutines.Add(coroutine); return coroutine; } internal void StopCoroutine(Coroutine coroutine) { _coroutines.Remove(coroutine); } internal void Update(GameTime gameTime) { foreach (Behavior behavior in _components.OfType<Behavior>()) { behavior.Update(gameTime); } for (var index = 0; index < _coroutines.Count; index++) { Coroutine coroutine = _coroutines[index]; Stack<IEnumerator> instructions = coroutine.CallStack; if (instructions.Count == 0) { _coroutines.RemoveAt(index); index--; continue; } IEnumerator instruction = instructions.Peek(); if (!instruction.MoveNext()) { instructions.Pop(); continue; } if (instruction.Current is IEnumerator next && instruction != next) { instructions.Push(next); } } } private void AssertNonDisposed() { if (IsDisposed) { throw new ObjectDisposedException(_name); } } }
32.4
149
0.594463
[ "MIT" ]
olive-engine/olive
Olive/GameObject.cs
10,692
C#
// LogSwrveActionOnMethod Decompiled was cancelled.
13.25
25
0.830189
[ "MIT" ]
smdx24/CPI-Source-Code
ClubPenguin.Analytics/LogSwrveActionOnMethod.cs
53
C#
namespace Sdl.Web.Mvc { /// <summary> /// Constants representing the names of ViewData/ViewBag items used by the DXA framework. /// </summary> public static class DxaViewDataItems { public const string RegionName = "RegionName"; public const string Renderer = "Renderer"; public const string ContainerSize = "ContainerSize"; public const string AddIncludes = "AddIncludes"; public const string DataFormatter = "DataFormatter"; public const string DisableOutputCache = "DisableOutputCache"; } }
35.4375
93
0.679012
[ "Apache-2.0" ]
JaimeSA/dxa-web-application-dotnet
Sdl.Web.Mvc/DxaViewDataItems.cs
569
C#
// <auto-generated> // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. // </auto-generated> namespace Microsoft.Azure.Management.DataMigration.Models { using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// <summary> /// Input for the task that validates MySQL database connection /// </summary> public partial class ConnectToSourceMySqlTaskInput { /// <summary> /// Initializes a new instance of the ConnectToSourceMySqlTaskInput /// class. /// </summary> public ConnectToSourceMySqlTaskInput() { CustomInit(); } /// <summary> /// Initializes a new instance of the ConnectToSourceMySqlTaskInput /// class. /// </summary> /// <param name="sourceConnectionInfo">Information for connecting to /// MySQL source</param> /// <param name="targetPlatform">Target Platform for the migration. /// Possible values include: 'SqlServer', 'AzureDbForMySQL'</param> /// <param name="checkPermissionsGroup">Permission group for /// validations. Possible values include: 'Default', /// 'MigrationFromSqlServerToAzureDB', /// 'MigrationFromSqlServerToAzureMI', /// 'MigrationFromMySQLToAzureDBForMySQL'</param> /// <param name="isOfflineMigration">Flag for whether or not the /// migration is offline</param> public ConnectToSourceMySqlTaskInput(MySqlConnectionInfo sourceConnectionInfo, string targetPlatform = default(string), ServerLevelPermissionsGroup? checkPermissionsGroup = default(ServerLevelPermissionsGroup?), bool? isOfflineMigration = default(bool?)) { SourceConnectionInfo = sourceConnectionInfo; TargetPlatform = targetPlatform; CheckPermissionsGroup = checkPermissionsGroup; IsOfflineMigration = isOfflineMigration; CustomInit(); } /// <summary> /// An initialization method that performs custom operations like setting defaults /// </summary> partial void CustomInit(); /// <summary> /// Gets or sets information for connecting to MySQL source /// </summary> [JsonProperty(PropertyName = "sourceConnectionInfo")] public MySqlConnectionInfo SourceConnectionInfo { get; set; } /// <summary> /// Gets or sets target Platform for the migration. Possible values /// include: 'SqlServer', 'AzureDbForMySQL' /// </summary> [JsonProperty(PropertyName = "targetPlatform")] public string TargetPlatform { get; set; } /// <summary> /// Gets or sets permission group for validations. Possible values /// include: 'Default', 'MigrationFromSqlServerToAzureDB', /// 'MigrationFromSqlServerToAzureMI', /// 'MigrationFromMySQLToAzureDBForMySQL' /// </summary> [JsonProperty(PropertyName = "checkPermissionsGroup")] public ServerLevelPermissionsGroup? CheckPermissionsGroup { get; set; } /// <summary> /// Gets or sets flag for whether or not the migration is offline /// </summary> [JsonProperty(PropertyName = "isOfflineMigration")] public bool? IsOfflineMigration { get; set; } /// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (SourceConnectionInfo == null) { throw new ValidationException(ValidationRules.CannotBeNull, "SourceConnectionInfo"); } if (SourceConnectionInfo != null) { SourceConnectionInfo.Validate(); } } } }
38.607477
262
0.632292
[ "MIT" ]
93mishra/azure-sdk-for-net
sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/ConnectToSourceMySqlTaskInput.cs
4,131
C#
namespace Call_in_a_Doctor { partial class frmInPersonPaymentJasmin { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmInPersonPaymentJasmin)); this.tbOnlineName = new System.Windows.Forms.TextBox(); this.label13 = new System.Windows.Forms.Label(); this.dtpOnlineDate = new System.Windows.Forms.DateTimePicker(); this.tbOnlineMobile = new System.Windows.Forms.TextBox(); this.tbOnlineEmail = new System.Windows.Forms.TextBox(); this.label12 = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label(); this.btnBackPatient = new System.Windows.Forms.Button(); this.btnPaymentConfirm = new System.Windows.Forms.Button(); this.tbTrxID = new System.Windows.Forms.TextBox(); this.label5 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.label7 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // // tbOnlineName // this.tbOnlineName.Font = new System.Drawing.Font("Times New Roman", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tbOnlineName.Location = new System.Drawing.Point(46, 305); this.tbOnlineName.Multiline = true; this.tbOnlineName.Name = "tbOnlineName"; this.tbOnlineName.Size = new System.Drawing.Size(234, 35); this.tbOnlineName.TabIndex = 220; // // label13 // this.label13.AutoSize = true; this.label13.BackColor = System.Drawing.Color.Transparent; this.label13.Font = new System.Drawing.Font("Times New Roman", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label13.Location = new System.Drawing.Point(43, 492); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(115, 23); this.label13.TabIndex = 219; this.label13.Text = "Pick a Date:"; // // dtpOnlineDate // this.dtpOnlineDate.Font = new System.Drawing.Font("Times New Roman", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.dtpOnlineDate.Location = new System.Drawing.Point(46, 521); this.dtpOnlineDate.Name = "dtpOnlineDate"; this.dtpOnlineDate.Size = new System.Drawing.Size(234, 29); this.dtpOnlineDate.TabIndex = 218; // // tbOnlineMobile // this.tbOnlineMobile.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Append; this.tbOnlineMobile.Font = new System.Drawing.Font("Times New Roman", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tbOnlineMobile.Location = new System.Drawing.Point(46, 443); this.tbOnlineMobile.Multiline = true; this.tbOnlineMobile.Name = "tbOnlineMobile"; this.tbOnlineMobile.Size = new System.Drawing.Size(234, 33); this.tbOnlineMobile.TabIndex = 217; // // tbOnlineEmail // this.tbOnlineEmail.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Append; this.tbOnlineEmail.Font = new System.Drawing.Font("Times New Roman", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tbOnlineEmail.Location = new System.Drawing.Point(46, 373); this.tbOnlineEmail.Multiline = true; this.tbOnlineEmail.Name = "tbOnlineEmail"; this.tbOnlineEmail.Size = new System.Drawing.Size(234, 33); this.tbOnlineEmail.TabIndex = 216; // // label12 // this.label12.AutoSize = true; this.label12.BackColor = System.Drawing.Color.Transparent; this.label12.Font = new System.Drawing.Font("Times New Roman", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label12.Location = new System.Drawing.Point(44, 417); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(114, 23); this.label12.TabIndex = 215; this.label12.Text = "Mobile No.: "; // // label11 // this.label11.AutoSize = true; this.label11.BackColor = System.Drawing.Color.Transparent; this.label11.Font = new System.Drawing.Font("Times New Roman", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label11.Location = new System.Drawing.Point(42, 346); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(70, 23); this.label11.TabIndex = 214; this.label11.Text = "Email: "; // // label10 // this.label10.AutoSize = true; this.label10.BackColor = System.Drawing.Color.Transparent; this.label10.Font = new System.Drawing.Font("Times New Roman", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label10.Location = new System.Drawing.Point(42, 278); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(71, 23); this.label10.TabIndex = 213; this.label10.Text = "Name: "; // // label9 // this.label9.AutoSize = true; this.label9.BackColor = System.Drawing.Color.Transparent; this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label9.Location = new System.Drawing.Point(43, 259); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(200, 17); this.label9.TabIndex = 212; this.label9.Text = "--------------------------------"; // // label8 // this.label8.AutoSize = true; this.label8.BackColor = System.Drawing.Color.Transparent; this.label8.Font = new System.Drawing.Font("Times New Roman", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label8.Location = new System.Drawing.Point(42, 237); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(189, 23); this.label8.TabIndex = 211; this.label8.Text = "Make an Appoinment"; // // btnBackPatient // this.btnBackPatient.Font = new System.Drawing.Font("Modern No. 20", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnBackPatient.Location = new System.Drawing.Point(46, 31); this.btnBackPatient.Name = "btnBackPatient"; this.btnBackPatient.Size = new System.Drawing.Size(67, 36); this.btnBackPatient.TabIndex = 210; this.btnBackPatient.Text = "Back"; this.btnBackPatient.UseVisualStyleBackColor = true; this.btnBackPatient.Click += new System.EventHandler(this.btnBackPatient_Click); // // btnPaymentConfirm // this.btnPaymentConfirm.Font = new System.Drawing.Font("Times New Roman", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnPaymentConfirm.ForeColor = System.Drawing.Color.Navy; this.btnPaymentConfirm.Location = new System.Drawing.Point(99, 630); this.btnPaymentConfirm.Name = "btnPaymentConfirm"; this.btnPaymentConfirm.Size = new System.Drawing.Size(106, 41); this.btnPaymentConfirm.TabIndex = 209; this.btnPaymentConfirm.Text = "Confirm"; this.btnPaymentConfirm.UseVisualStyleBackColor = true; this.btnPaymentConfirm.Click += new System.EventHandler(this.btnPaymentConfirm_Click); // // tbTrxID // this.tbTrxID.Font = new System.Drawing.Font("Times New Roman", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tbTrxID.Location = new System.Drawing.Point(130, 573); this.tbTrxID.Multiline = true; this.tbTrxID.Name = "tbTrxID"; this.tbTrxID.Size = new System.Drawing.Size(150, 36); this.tbTrxID.TabIndex = 208; // // label5 // this.label5.AutoSize = true; this.label5.BackColor = System.Drawing.Color.Transparent; this.label5.Font = new System.Drawing.Font("Times New Roman", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label5.Location = new System.Drawing.Point(45, 578); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(78, 23); this.label5.TabIndex = 207; this.label5.Text = "Trx ID: "; // // label4 // this.label4.AutoSize = true; this.label4.BackColor = System.Drawing.Color.Transparent; this.label4.Font = new System.Drawing.Font("Times New Roman", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label4.Location = new System.Drawing.Point(510, 192); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(237, 23); this.label4.TabIndex = 206; this.label4.Text = "Bkash Payment Instruction"; // // pictureBox1 // this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); this.pictureBox1.Location = new System.Drawing.Point(514, 236); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(676, 435); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox1.TabIndex = 205; this.pictureBox1.TabStop = false; // // label7 // this.label7.AutoSize = true; this.label7.BackColor = System.Drawing.Color.Transparent; this.label7.Font = new System.Drawing.Font("Bahnschrift Condensed", 30F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label7.ForeColor = System.Drawing.Color.ForestGreen; this.label7.Location = new System.Drawing.Point(504, 56); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(270, 60); this.label7.TabIndex = 201; this.label7.Text = "Call in a Doctor"; // // label3 // this.label3.AutoSize = true; this.label3.BackColor = System.Drawing.Color.Transparent; this.label3.Location = new System.Drawing.Point(255, 192); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(193, 17); this.label3.TabIndex = 223; this.label3.Text = "* including 5% system charge"; // // label2 // this.label2.AutoSize = true; this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.Font = new System.Drawing.Font("Times New Roman", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label2.Location = new System.Drawing.Point(42, 192); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(217, 23); this.label2.TabIndex = 222; this.label2.Text = "Total Charge: 1050 BDT"; // // label1 // this.label1.AutoSize = true; this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.Font = new System.Drawing.Font("Times New Roman", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Location = new System.Drawing.Point(42, 159); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(232, 23); this.label1.TabIndex = 221; this.label1.Text = "Doctor Charge: 1000 BDT"; // // frmInPersonPaymentJasmin // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackgroundImage = global::Call_in_a_Doctor.Properties.Resources.CallinaDoctorBack; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.ClientSize = new System.Drawing.Size(1232, 703); this.Controls.Add(this.label3); this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Controls.Add(this.tbOnlineName); this.Controls.Add(this.label13); this.Controls.Add(this.dtpOnlineDate); this.Controls.Add(this.tbOnlineMobile); this.Controls.Add(this.tbOnlineEmail); this.Controls.Add(this.label12); this.Controls.Add(this.label11); this.Controls.Add(this.label10); this.Controls.Add(this.label9); this.Controls.Add(this.label8); this.Controls.Add(this.btnBackPatient); this.Controls.Add(this.btnPaymentConfirm); this.Controls.Add(this.tbTrxID); this.Controls.Add(this.label5); this.Controls.Add(this.label4); this.Controls.Add(this.pictureBox1); this.Controls.Add(this.label7); this.Name = "frmInPersonPaymentJasmin"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Online Payment"; this.Load += new System.EventHandler(this.frmInPersonPaymentJasmin_Load); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); } #endregion public System.Windows.Forms.TextBox tbOnlineName; private System.Windows.Forms.Label label13; public System.Windows.Forms.DateTimePicker dtpOnlineDate; public System.Windows.Forms.TextBox tbOnlineMobile; public System.Windows.Forms.TextBox tbOnlineEmail; private System.Windows.Forms.Label label12; private System.Windows.Forms.Label label11; private System.Windows.Forms.Label label10; private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label8; private System.Windows.Forms.Button btnBackPatient; private System.Windows.Forms.Button btnPaymentConfirm; private System.Windows.Forms.TextBox tbTrxID; private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label4; private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label1; } }
54.119632
170
0.594627
[ "MIT" ]
Atanusaha143/Call-in-a-Doctor
Call in a Doctor/Call in a Doctor/InPersonPaymentJasmin.Designer.cs
17,645
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Cofoundry.Core.Configuration; using Microsoft.AspNetCore.Hosting; namespace Cofoundry.Core { /// <summary> /// Settings that give finer grained control over debugging Cofoundry features. /// </summary> public partial class DebugSettings : CofoundryConfigurationSettingsBase { /// <summary> /// Disables the dynamic robots.txt file and instead serves up a file that /// disallows all. /// </summary> public bool DisableRobotsTxt { get; set; } /// <summary> /// Used to indicate whether the application should show the /// developer exception page with full exception details or not. /// By default this is set to Cofoundry.Core.DeveloperExceptionPageMode.DevelopmentOnly. /// </summary> public DeveloperExceptionPageMode DeveloperExceptionPageMode { get; set; } = DeveloperExceptionPageMode.DevelopmentOnly; /// <summary> /// By default Cofoundry will try and load minified css/js files, but /// this can be overriden for debugging purposes and an uncompressed /// version will try and be located first. /// </summary> public bool UseUncompressedResources { get; set; } /// <summary> /// Use this to bypass resources embedded in assemblies and instead load them straight from the /// file system. This is intended to be used when debugging the Cofoundry project to avoid having to re-start /// the project when embedded resources have been updated. False by default. /// </summary> public bool BypassEmbeddedContent { get; set; } /// <summary> /// If bypassing embedded content, MapPath will be used to determine the folder root unless this override /// is specified. The assembly name is added to the path to make the folder root of the project with the resource in. /// </summary> public string EmbeddedContentPhysicalPathRootOverride { get; set; } /// <summary> /// USe to determine if we should show the developer exception page, /// taking the current environment into consideration. /// </summary> /// <param name="env">The current hosting environment.</param> /// <returns>True if we can show the developer exception page; otherwise false.</returns> public bool CanShowDeveloperExceptionPage(IHostingEnvironment env) { return DeveloperExceptionPageMode == DeveloperExceptionPageMode.On || (DeveloperExceptionPageMode == DeveloperExceptionPageMode.DevelopmentOnly && env.IsDevelopment()); } } }
45.278689
128
0.672339
[ "MIT" ]
BOBO41/cofoundry
src/Cofoundry.Core/Core/Settings/DebugSettings.cs
2,764
C#
namespace Highway.Data { /// <summary> /// An Interface for Scalar Queries that return a single value or object /// </summary> /// <typeparam name="T">The Type that is being returned</typeparam> public interface IScalar<out T> { /// <summary> /// Executes the expression against the passed in context /// </summary> /// <param name="context">The data context that the scalar query is executed against</param> /// <returns>The instance of <typeparamref name="T"/> that the query materialized if any</returns> T Execute(IDataContext context); } }
38.75
106
0.63871
[ "Apache-2.0" ]
mrayburn/Highway.Data
Highway/src/Highway.Data/Interfaces/Queries/IScalar.cs
620
C#
/* Copyright 2010-2014 MongoDB Inc. * * 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 MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; using MongoDB.Driver.Builders; using NUnit.Framework; namespace MongoDB.DriverUnitTests.Jira.CSharp532 { [TestFixture] public class CSharp532Tests { [BsonKnownTypes(typeof(B))] public abstract class A { } public class B : A { } public class C { [BsonElement("a")] public A A { get; set; } } [Test] public void TestTypedBuildersWithSubclasses() { var b = new B(); var t = Update<C>.Set(c => c.A, b); } } }
24.215686
74
0.636437
[ "Apache-2.0" ]
EvilMindz/mongo-csharp-driver
MongoDB.DriverUnitTests/Jira/CSharp532Tests.cs
1,237
C#
using System.Windows; namespace WpfApplication1 { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { DataContext = new TestWindowViewModel(); InitializeComponent(); } } }
19.411765
52
0.578788
[ "MIT" ]
JPVenson/WPFCommon
WpfApplication1/MainWindow.xaml.cs
332
C#
namespace LiteDB.Studio { partial class MainForm { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.splitMain = new System.Windows.Forms.SplitContainer(); this.tvwDatabase = new System.Windows.Forms.TreeView(); this.imgList = new System.Windows.Forms.ImageList(this.components); this.splitRight = new System.Windows.Forms.SplitContainer(); this.tabResult = new System.Windows.Forms.TabControl(); this.tabGrid = new System.Windows.Forms.TabPage(); this.grdResult = new System.Windows.Forms.DataGridView(); this.tabText = new System.Windows.Forms.TabPage(); this.tabParameters = new System.Windows.Forms.TabPage(); this.tabSql = new System.Windows.Forms.TabControl(); this.stbStatus = new System.Windows.Forms.StatusStrip(); this.lblCursor = new System.Windows.Forms.ToolStripStatusLabel(); this.lblResultCount = new System.Windows.Forms.ToolStripStatusLabel(); this.prgRunning = new System.Windows.Forms.ToolStripProgressBar(); this.lblElapsed = new System.Windows.Forms.ToolStripStatusLabel(); this.tlbMain = new System.Windows.Forms.ToolStrip(); this.recentDBsDropDownButton = new System.Windows.Forms.ToolStripDropDownButton(); this.recentListSettings = new System.Windows.Forms.ToolStripMenuItem(); this.clearRecentListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.validateRecentListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); this.btnConnect = new System.Windows.Forms.ToolStripButton(); this.tlbSep1 = new System.Windows.Forms.ToolStripSeparator(); this.btnRefresh = new System.Windows.Forms.ToolStripButton(); this.tlbSep2 = new System.Windows.Forms.ToolStripSeparator(); this.btnRun = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.btnBegin = new System.Windows.Forms.ToolStripButton(); this.btnCommit = new System.Windows.Forms.ToolStripButton(); this.btnRollback = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.btnCheckpoint = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.btnDebug = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); this.load_last_db_now = new System.Windows.Forms.ToolStripButton(); this.ctxMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.mnuQueryAll = new System.Windows.Forms.ToolStripMenuItem(); this.mnuQueryCount = new System.Windows.Forms.ToolStripMenuItem(); this.mnuExplanPlan = new System.Windows.Forms.ToolStripMenuItem(); this.mnuSep1 = new System.Windows.Forms.ToolStripSeparator(); this.mnuIndexes = new System.Windows.Forms.ToolStripMenuItem(); this.mnuSep2 = new System.Windows.Forms.ToolStripSeparator(); this.mnuExport = new System.Windows.Forms.ToolStripMenuItem(); this.mnuAnalyze = new System.Windows.Forms.ToolStripMenuItem(); this.mnuRename = new System.Windows.Forms.ToolStripMenuItem(); this.mnuDropCollection = new System.Windows.Forms.ToolStripMenuItem(); this.ctxMenuRoot = new System.Windows.Forms.ContextMenuStrip(this.components); this.mnuInfo = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.mnuImport = new System.Windows.Forms.ToolStripMenuItem(); this.mnuRebuild = new System.Windows.Forms.ToolStripMenuItem(); this.imgCodeCompletion = new System.Windows.Forms.ImageList(this.components); this.loadLastDb = new System.Windows.Forms.CheckBox(); this.maxRecentListItems = new System.Windows.Forms.NumericUpDown(); this.txtSql = new ICSharpCode.TextEditor.TextEditorControl(); this.txtResult = new ICSharpCode.TextEditor.TextEditorControl(); this.txtParameters = new ICSharpCode.TextEditor.TextEditorControl(); this.maxRecentItemsTooltip = new System.Windows.Forms.ToolTip(this.components); ((System.ComponentModel.ISupportInitialize)(this.splitMain)).BeginInit(); this.splitMain.Panel1.SuspendLayout(); this.splitMain.Panel2.SuspendLayout(); this.splitMain.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitRight)).BeginInit(); this.splitRight.Panel1.SuspendLayout(); this.splitRight.Panel2.SuspendLayout(); this.splitRight.SuspendLayout(); this.tabResult.SuspendLayout(); this.tabGrid.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.grdResult)).BeginInit(); this.tabText.SuspendLayout(); this.tabParameters.SuspendLayout(); this.stbStatus.SuspendLayout(); this.tlbMain.SuspendLayout(); this.ctxMenu.SuspendLayout(); this.ctxMenuRoot.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.maxRecentListItems)).BeginInit(); this.SuspendLayout(); // // splitMain // this.splitMain.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.splitMain.Location = new System.Drawing.Point(5, 36); this.splitMain.Name = "splitMain"; // // splitMain.Panel1 // this.splitMain.Panel1.Controls.Add(this.tvwDatabase); // // splitMain.Panel2 // this.splitMain.Panel2.Controls.Add(this.splitRight); this.splitMain.Panel2.Controls.Add(this.tabSql); this.splitMain.Size = new System.Drawing.Size(1080, 599); this.splitMain.SplitterDistance = 234; this.splitMain.TabIndex = 10; this.splitMain.TabStop = false; // // tvwDatabase // this.tvwDatabase.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tvwDatabase.ImageIndex = 0; this.tvwDatabase.ImageList = this.imgList; this.tvwDatabase.Location = new System.Drawing.Point(0, 0); this.tvwDatabase.Margin = new System.Windows.Forms.Padding(0); this.tvwDatabase.Name = "tvwDatabase"; this.tvwDatabase.SelectedImageIndex = 0; this.tvwDatabase.Size = new System.Drawing.Size(234, 596); this.tvwDatabase.TabIndex = 9; this.tvwDatabase.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.TvwCols_NodeMouseDoubleClick); this.tvwDatabase.MouseUp += new System.Windows.Forms.MouseEventHandler(this.TvwCols_MouseUp); // // imgList // this.imgList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgList.ImageStream"))); this.imgList.TransparentColor = System.Drawing.Color.Transparent; this.imgList.Images.SetKeyName(0, "database"); this.imgList.Images.SetKeyName(1, "folder"); this.imgList.Images.SetKeyName(2, "table"); this.imgList.Images.SetKeyName(3, "table_gear"); // // splitRight // this.splitRight.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.splitRight.Location = new System.Drawing.Point(3, 26); this.splitRight.Name = "splitRight"; this.splitRight.Orientation = System.Windows.Forms.Orientation.Horizontal; // // splitRight.Panel1 // this.splitRight.Panel1.BackColor = System.Drawing.SystemColors.Control; this.splitRight.Panel1.Controls.Add(this.txtSql); // // splitRight.Panel2 // this.splitRight.Panel2.Controls.Add(this.tabResult); this.splitRight.Size = new System.Drawing.Size(832, 570); this.splitRight.SplitterDistance = 174; this.splitRight.TabIndex = 8; // // tabResult // this.tabResult.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tabResult.Controls.Add(this.tabGrid); this.tabResult.Controls.Add(this.tabText); this.tabResult.Controls.Add(this.tabParameters); this.tabResult.Location = new System.Drawing.Point(0, 3); this.tabResult.Name = "tabResult"; this.tabResult.SelectedIndex = 0; this.tabResult.Size = new System.Drawing.Size(832, 389); this.tabResult.TabIndex = 0; this.tabResult.TabStop = false; this.tabResult.Selected += new System.Windows.Forms.TabControlEventHandler(this.TabResult_Selected); // // tabGrid // this.tabGrid.Controls.Add(this.grdResult); this.tabGrid.Location = new System.Drawing.Point(4, 24); this.tabGrid.Name = "tabGrid"; this.tabGrid.Padding = new System.Windows.Forms.Padding(3); this.tabGrid.Size = new System.Drawing.Size(824, 361); this.tabGrid.TabIndex = 0; this.tabGrid.Text = "Grid"; this.tabGrid.UseVisualStyleBackColor = true; // // grdResult // this.grdResult.AllowUserToAddRows = false; this.grdResult.AllowUserToDeleteRows = false; this.grdResult.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.grdResult.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.grdResult.Location = new System.Drawing.Point(6, 5); this.grdResult.Name = "grdResult"; this.grdResult.Size = new System.Drawing.Size(811, 232); this.grdResult.TabIndex = 0; this.grdResult.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.GrdResult_CellBeginEdit); this.grdResult.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.GrdResult_CellEndEdit); this.grdResult.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.grdResult_CellFormatting); this.grdResult.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.GrdResult_RowPostPaint); this.grdResult.SortCompare += new System.Windows.Forms.DataGridViewSortCompareEventHandler(this.grdResult_SortCompare); // // tabText // this.tabText.Controls.Add(this.txtResult); this.tabText.Location = new System.Drawing.Point(4, 24); this.tabText.Name = "tabText"; this.tabText.Padding = new System.Windows.Forms.Padding(3); this.tabText.Size = new System.Drawing.Size(824, 361); this.tabText.TabIndex = 3; this.tabText.Text = "Text"; this.tabText.UseVisualStyleBackColor = true; // // tabParameters // this.tabParameters.Controls.Add(this.txtParameters); this.tabParameters.Location = new System.Drawing.Point(4, 24); this.tabParameters.Name = "tabParameters"; this.tabParameters.Padding = new System.Windows.Forms.Padding(3); this.tabParameters.Size = new System.Drawing.Size(824, 361); this.tabParameters.TabIndex = 5; this.tabParameters.Text = "Parameters"; this.tabParameters.UseVisualStyleBackColor = true; // // tabSql // this.tabSql.Location = new System.Drawing.Point(3, 0); this.tabSql.Margin = new System.Windows.Forms.Padding(0); this.tabSql.Name = "tabSql"; this.tabSql.SelectedIndex = 0; this.tabSql.Size = new System.Drawing.Size(821, 24); this.tabSql.TabIndex = 9; this.tabSql.TabStop = false; this.tabSql.SelectedIndexChanged += new System.EventHandler(this.TabSql_SelectedIndexChanged); this.tabSql.Selected += new System.Windows.Forms.TabControlEventHandler(this.TabSql_Selected); this.tabSql.MouseClick += new System.Windows.Forms.MouseEventHandler(this.TabSql_MouseClick); // // stbStatus // this.stbStatus.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.lblCursor, this.lblResultCount, this.prgRunning, this.lblElapsed}); this.stbStatus.Location = new System.Drawing.Point(0, 638); this.stbStatus.Name = "stbStatus"; this.stbStatus.Size = new System.Drawing.Size(1090, 22); this.stbStatus.TabIndex = 11; this.stbStatus.Text = "statusStrip1"; // // lblCursor // this.lblCursor.Name = "lblCursor"; this.lblCursor.Size = new System.Drawing.Size(713, 17); this.lblCursor.Spring = true; this.lblCursor.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // lblResultCount // this.lblResultCount.AutoSize = false; this.lblResultCount.Name = "lblResultCount"; this.lblResultCount.Size = new System.Drawing.Size(150, 17); this.lblResultCount.Text = "0 documents"; // // prgRunning // this.prgRunning.Name = "prgRunning"; this.prgRunning.Size = new System.Drawing.Size(100, 16); // // lblElapsed // this.lblElapsed.AutoSize = false; this.lblElapsed.Name = "lblElapsed"; this.lblElapsed.Size = new System.Drawing.Size(110, 17); this.lblElapsed.Text = "00:00:00.0000"; this.lblElapsed.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // tlbMain // this.tlbMain.GripMargin = new System.Windows.Forms.Padding(3); this.tlbMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.recentDBsDropDownButton, this.btnConnect, this.tlbSep1, this.btnRefresh, this.tlbSep2, this.btnRun, this.toolStripSeparator1, this.btnBegin, this.btnCommit, this.btnRollback, this.toolStripSeparator2, this.btnCheckpoint, this.toolStripSeparator4, this.btnDebug, this.toolStripSeparator5, this.load_last_db_now}); this.tlbMain.Location = new System.Drawing.Point(0, 0); this.tlbMain.Name = "tlbMain"; this.tlbMain.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2); this.tlbMain.Size = new System.Drawing.Size(1090, 33); this.tlbMain.TabIndex = 12; this.tlbMain.Text = "toolStrip"; // // recentDBsDropDownButton // this.recentDBsDropDownButton.AutoToolTip = false; this.recentDBsDropDownButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.recentDBsDropDownButton.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.recentListSettings, this.toolStripSeparator6}); this.recentDBsDropDownButton.Image = ((System.Drawing.Image)(resources.GetObject("recentDBsDropDownButton.Image"))); this.recentDBsDropDownButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.recentDBsDropDownButton.Name = "recentDBsDropDownButton"; this.recentDBsDropDownButton.Size = new System.Drawing.Size(29, 26); this.recentDBsDropDownButton.Text = "recentDBsDropDownButton"; this.recentDBsDropDownButton.ToolTipText = "Recent Databases"; // // recentListSettings // this.recentListSettings.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.clearRecentListToolStripMenuItem, this.validateRecentListToolStripMenuItem}); this.recentListSettings.Name = "recentListSettings"; this.recentListSettings.Size = new System.Drawing.Size(116, 22); this.recentListSettings.Text = "Settings"; // // clearRecentListToolStripMenuItem // this.clearRecentListToolStripMenuItem.Name = "clearRecentListToolStripMenuItem"; this.clearRecentListToolStripMenuItem.Size = new System.Drawing.Size(175, 22); this.clearRecentListToolStripMenuItem.Text = "Clear Recent List"; this.clearRecentListToolStripMenuItem.Click += new System.EventHandler(this.clearAllToolStripMenuItem_Click); // // validateRecentListToolStripMenuItem // this.validateRecentListToolStripMenuItem.Name = "validateRecentListToolStripMenuItem"; this.validateRecentListToolStripMenuItem.Size = new System.Drawing.Size(175, 22); this.validateRecentListToolStripMenuItem.Text = "Validate Recent List"; this.validateRecentListToolStripMenuItem.ToolTipText = "Remove Any Not Existed Database"; this.validateRecentListToolStripMenuItem.Click += new System.EventHandler(this.validateRecentListToolStripMenuItem_Click); // // toolStripSeparator6 // this.toolStripSeparator6.Name = "toolStripSeparator6"; this.toolStripSeparator6.Size = new System.Drawing.Size(113, 6); // // btnConnect // this.btnConnect.Image = global::LiteDB.Studio.Properties.Resources.database_connect; this.btnConnect.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnConnect.Name = "btnConnect"; this.btnConnect.Padding = new System.Windows.Forms.Padding(3); this.btnConnect.Size = new System.Drawing.Size(78, 26); this.btnConnect.Text = "Connect"; this.btnConnect.Click += new System.EventHandler(this.BtnConnect_Click); // // tlbSep1 // this.tlbSep1.Name = "tlbSep1"; this.tlbSep1.Size = new System.Drawing.Size(6, 29); // // btnRefresh // this.btnRefresh.Image = global::LiteDB.Studio.Properties.Resources.arrow_refresh; this.btnRefresh.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnRefresh.Name = "btnRefresh"; this.btnRefresh.Padding = new System.Windows.Forms.Padding(3); this.btnRefresh.Size = new System.Drawing.Size(72, 26); this.btnRefresh.Text = "Refresh"; this.btnRefresh.Click += new System.EventHandler(this.BtnRefresh_Click); // // tlbSep2 // this.tlbSep2.Name = "tlbSep2"; this.tlbSep2.Size = new System.Drawing.Size(6, 29); // // btnRun // this.btnRun.Image = global::LiteDB.Studio.Properties.Resources.resultset_next; this.btnRun.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnRun.Name = "btnRun"; this.btnRun.Padding = new System.Windows.Forms.Padding(3); this.btnRun.Size = new System.Drawing.Size(54, 26); this.btnRun.Text = "Run"; this.btnRun.Click += new System.EventHandler(this.BtnRun_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new System.Drawing.Size(6, 29); // // btnBegin // this.btnBegin.Image = global::LiteDB.Studio.Properties.Resources.database; this.btnBegin.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnBegin.Name = "btnBegin"; this.btnBegin.Size = new System.Drawing.Size(57, 26); this.btnBegin.Text = "Begin"; this.btnBegin.ToolTipText = "Begin Transaction"; this.btnBegin.Click += new System.EventHandler(this.BtnBegin_Click); // // btnCommit // this.btnCommit.Image = global::LiteDB.Studio.Properties.Resources.database_save; this.btnCommit.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnCommit.Name = "btnCommit"; this.btnCommit.Size = new System.Drawing.Size(71, 26); this.btnCommit.Text = "Commit"; this.btnCommit.Click += new System.EventHandler(this.BtnCommit_Click); // // btnRollback // this.btnRollback.Image = global::LiteDB.Studio.Properties.Resources.database_delete; this.btnRollback.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnRollback.Name = "btnRollback"; this.btnRollback.Size = new System.Drawing.Size(72, 26); this.btnRollback.Text = "Rollback"; this.btnRollback.Click += new System.EventHandler(this.BtnRollback_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new System.Drawing.Size(6, 29); // // btnCheckpoint // this.btnCheckpoint.Image = global::LiteDB.Studio.Properties.Resources.application_put; this.btnCheckpoint.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnCheckpoint.Name = "btnCheckpoint"; this.btnCheckpoint.Size = new System.Drawing.Size(88, 26); this.btnCheckpoint.Text = "Checkpoint"; this.btnCheckpoint.Click += new System.EventHandler(this.BtnCheckpoint_Click); // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Size = new System.Drawing.Size(6, 29); // // btnDebug // this.btnDebug.Image = global::LiteDB.Studio.Properties.Resources.bug_link; this.btnDebug.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnDebug.Name = "btnDebug"; this.btnDebug.Size = new System.Drawing.Size(62, 26); this.btnDebug.Text = "Debug"; this.btnDebug.Click += new System.EventHandler(this.btnDebug_Click); // // toolStripSeparator5 // this.toolStripSeparator5.Name = "toolStripSeparator5"; this.toolStripSeparator5.Size = new System.Drawing.Size(6, 29); // // load_last_db_now // this.load_last_db_now.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.load_last_db_now.Image = global::LiteDB.Studio.Properties.Resources.load_last_db; this.load_last_db_now.ImageTransparentColor = System.Drawing.Color.Magenta; this.load_last_db_now.Name = "load_last_db_now"; this.load_last_db_now.Size = new System.Drawing.Size(23, 26); this.load_last_db_now.Text = "toolStripButton1"; this.load_last_db_now.ToolTipText = "Load Last Db"; this.load_last_db_now.Click += new System.EventHandler(this.loadLastDbNow_Click); // // ctxMenu // this.ctxMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.mnuQueryAll, this.mnuQueryCount, this.mnuExplanPlan, this.mnuSep1, this.mnuIndexes, this.mnuSep2, this.mnuExport, this.mnuAnalyze, this.mnuRename, this.mnuDropCollection}); this.ctxMenu.Name = "ctxMenu"; this.ctxMenu.Size = new System.Drawing.Size(156, 192); this.ctxMenu.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.CtxMenu_ItemClicked); // // mnuQueryAll // this.mnuQueryAll.Image = global::LiteDB.Studio.Properties.Resources.table_lightning; this.mnuQueryAll.Name = "mnuQueryAll"; this.mnuQueryAll.Size = new System.Drawing.Size(155, 22); this.mnuQueryAll.Tag = "SELECT $ FROM {0};"; this.mnuQueryAll.Text = "Query"; // // mnuQueryCount // this.mnuQueryCount.Image = global::LiteDB.Studio.Properties.Resources.table; this.mnuQueryCount.Name = "mnuQueryCount"; this.mnuQueryCount.Size = new System.Drawing.Size(155, 22); this.mnuQueryCount.Tag = "SELECT COUNT(*) FROM {0};"; this.mnuQueryCount.Text = "Count"; // // mnuExplanPlan // this.mnuExplanPlan.Image = global::LiteDB.Studio.Properties.Resources.table_sort; this.mnuExplanPlan.Name = "mnuExplanPlan"; this.mnuExplanPlan.Size = new System.Drawing.Size(155, 22); this.mnuExplanPlan.Tag = "EXPLAIN SELECT $ FROM {0};"; this.mnuExplanPlan.Text = "Explain plan"; // // mnuSep1 // this.mnuSep1.Name = "mnuSep1"; this.mnuSep1.Size = new System.Drawing.Size(152, 6); // // mnuIndexes // this.mnuIndexes.Image = global::LiteDB.Studio.Properties.Resources.key; this.mnuIndexes.Name = "mnuIndexes"; this.mnuIndexes.Size = new System.Drawing.Size(155, 22); this.mnuIndexes.Tag = "SELECT $ FROM $indexes WHERE collection = \"{0}\";"; this.mnuIndexes.Text = "Indexes"; // // mnuSep2 // this.mnuSep2.Name = "mnuSep2"; this.mnuSep2.Size = new System.Drawing.Size(152, 6); // // mnuExport // this.mnuExport.Image = global::LiteDB.Studio.Properties.Resources.table_save; this.mnuExport.Name = "mnuExport"; this.mnuExport.Size = new System.Drawing.Size(155, 22); this.mnuExport.Tag = "SELECT $\\n INTO $file(\'C:/temp/{0}.json\')\\n FROM {0};"; this.mnuExport.Text = "Export to JSON"; // // mnuAnalyze // this.mnuAnalyze.Image = global::LiteDB.Studio.Properties.Resources.page_white_gear; this.mnuAnalyze.Name = "mnuAnalyze"; this.mnuAnalyze.Size = new System.Drawing.Size(155, 22); this.mnuAnalyze.Tag = "ANALYZE {0};"; this.mnuAnalyze.Text = "Analyze"; // // mnuRename // this.mnuRename.Image = global::LiteDB.Studio.Properties.Resources.textfield_rename; this.mnuRename.Name = "mnuRename"; this.mnuRename.Size = new System.Drawing.Size(155, 22); this.mnuRename.Tag = "RENAME COLLECTION {0} TO new_name;"; this.mnuRename.Text = "Rename"; // // mnuDropCollection // this.mnuDropCollection.Image = global::LiteDB.Studio.Properties.Resources.table_delete; this.mnuDropCollection.Name = "mnuDropCollection"; this.mnuDropCollection.Size = new System.Drawing.Size(155, 22); this.mnuDropCollection.Tag = "DROP COLLECTION {0};"; this.mnuDropCollection.Text = "Drop collection"; // // ctxMenuRoot // this.ctxMenuRoot.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.mnuInfo, this.toolStripSeparator3, this.mnuImport, this.mnuRebuild}); this.ctxMenuRoot.Name = "ctxMenu"; this.ctxMenuRoot.Size = new System.Drawing.Size(171, 76); this.ctxMenuRoot.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.CtxMenuRoot_ItemClicked); // // mnuInfo // this.mnuInfo.Image = global::LiteDB.Studio.Properties.Resources.information; this.mnuInfo.Name = "mnuInfo"; this.mnuInfo.Size = new System.Drawing.Size(170, 22); this.mnuInfo.Tag = "SELECT $ FROM $database;"; this.mnuInfo.Text = "Database Info"; // // toolStripSeparator3 // this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Size = new System.Drawing.Size(167, 6); // // mnuImport // this.mnuImport.Image = global::LiteDB.Studio.Properties.Resources.layout_add; this.mnuImport.Name = "mnuImport"; this.mnuImport.Size = new System.Drawing.Size(170, 22); this.mnuImport.Tag = "SELECT $\\n INTO new_col\\n FROM $file(\'C:/temp/file.json\');"; this.mnuImport.Text = "Import from JSON"; // // mnuRebuild // this.mnuRebuild.Image = global::LiteDB.Studio.Properties.Resources.compress; this.mnuRebuild.Name = "mnuRebuild"; this.mnuRebuild.Size = new System.Drawing.Size(170, 22); this.mnuRebuild.Tag = "REBUILD { collation: \'en-US/IgnoreCase\', password: \'newpassword\' };"; this.mnuRebuild.Text = "Rebuild"; // // imgCodeCompletion // this.imgCodeCompletion.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgCodeCompletion.ImageStream"))); this.imgCodeCompletion.TransparentColor = System.Drawing.Color.Transparent; this.imgCodeCompletion.Images.SetKeyName(0, "METHOD"); this.imgCodeCompletion.Images.SetKeyName(1, "COLLECTION"); this.imgCodeCompletion.Images.SetKeyName(2, "FIELD"); this.imgCodeCompletion.Images.SetKeyName(3, "KEYWORD"); this.imgCodeCompletion.Images.SetKeyName(4, "SYSTEM"); this.imgCodeCompletion.Images.SetKeyName(5, "SYSTEM_FN"); // // loadLastDb // this.loadLastDb.AutoSize = true; this.loadLastDb.Location = new System.Drawing.Point(672, 8); this.loadLastDb.Name = "loadLastDb"; this.loadLastDb.Size = new System.Drawing.Size(154, 19); this.loadLastDb.TabIndex = 13; this.loadLastDb.Text = "Load Last Db On Startup"; this.loadLastDb.UseVisualStyleBackColor = true; this.loadLastDb.CheckedChanged += new System.EventHandler(this.loadLastDbChecked_Changed); // // maxRecentListItems // this.maxRecentListItems.Location = new System.Drawing.Point(841, 7); this.maxRecentListItems.Maximum = new decimal(new int[] { 20, 0, 0, 0}); this.maxRecentListItems.Minimum = new decimal(new int[] { 3, 0, 0, 0}); this.maxRecentListItems.Name = "maxRecentListItems"; this.maxRecentListItems.Size = new System.Drawing.Size(89, 23); this.maxRecentListItems.TabIndex = 14; this.maxRecentListItems.Value = new decimal(new int[] { 10, 0, 0, 0}); this.maxRecentListItems.ValueChanged += new System.EventHandler(this.maxRecentListItems_ValueChanged); // // txtSql // this.txtSql.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtSql.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtSql.ConvertTabsToSpaces = true; this.txtSql.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtSql.Highlighting = "SQL"; this.txtSql.Location = new System.Drawing.Point(0, 0); this.txtSql.Name = "txtSql"; this.txtSql.ShowLineNumbers = false; this.txtSql.ShowVRuler = false; this.txtSql.Size = new System.Drawing.Size(828, 171); this.txtSql.TabIndex = 2; // // txtResult // this.txtResult.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtResult.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtResult.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtResult.Highlighting = "JSON"; this.txtResult.Location = new System.Drawing.Point(5, 4); this.txtResult.Name = "txtResult"; this.txtResult.ReadOnly = true; this.txtResult.ShowLineNumbers = false; this.txtResult.ShowVRuler = false; this.txtResult.Size = new System.Drawing.Size(812, 353); this.txtResult.TabIndex = 1; // // txtParameters // this.txtParameters.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtParameters.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtParameters.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtParameters.Highlighting = "JSON"; this.txtParameters.Location = new System.Drawing.Point(6, 5); this.txtParameters.Name = "txtParameters"; this.txtParameters.ReadOnly = true; this.txtParameters.ShowLineNumbers = false; this.txtParameters.ShowVRuler = false; this.txtParameters.Size = new System.Drawing.Size(811, 352); this.txtParameters.TabIndex = 2; // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1090, 660); this.Controls.Add(this.maxRecentListItems); this.Controls.Add(this.loadLastDb); this.Controls.Add(this.tlbMain); this.Controls.Add(this.stbStatus); this.Controls.Add(this.splitMain); this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.KeyPreview = true; this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.Name = "MainForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "LiteDB Studio"; this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MainForm_KeyDown); this.splitMain.Panel1.ResumeLayout(false); this.splitMain.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitMain)).EndInit(); this.splitMain.ResumeLayout(false); this.splitRight.Panel1.ResumeLayout(false); this.splitRight.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitRight)).EndInit(); this.splitRight.ResumeLayout(false); this.tabResult.ResumeLayout(false); this.tabGrid.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.grdResult)).EndInit(); this.tabText.ResumeLayout(false); this.tabParameters.ResumeLayout(false); this.stbStatus.ResumeLayout(false); this.stbStatus.PerformLayout(); this.tlbMain.ResumeLayout(false); this.tlbMain.PerformLayout(); this.ctxMenu.ResumeLayout(false); this.ctxMenuRoot.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.maxRecentListItems)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); } private System.Windows.Forms.ToolStripButton btnBegin; private System.Windows.Forms.ToolStripButton btnCheckpoint; private System.Windows.Forms.ToolStripButton btnCommit; private System.Windows.Forms.ToolStripButton btnConnect; private System.Windows.Forms.ToolStripButton btnDebug; private System.Windows.Forms.ToolStripButton btnRefresh; private System.Windows.Forms.ToolStripButton btnRollback; private System.Windows.Forms.ToolStripButton btnRun; private System.Windows.Forms.ToolStripMenuItem recentListSettings; private System.Windows.Forms.ContextMenuStrip ctxMenu; private System.Windows.Forms.ContextMenuStrip ctxMenuRoot; private System.Windows.Forms.DataGridView grdResult; private System.Windows.Forms.ImageList imgCodeCompletion; private System.Windows.Forms.ImageList imgList; private System.Windows.Forms.ToolStripStatusLabel lblCursor; private System.Windows.Forms.ToolStripStatusLabel lblElapsed; private System.Windows.Forms.ToolStripStatusLabel lblResultCount; private System.Windows.Forms.ToolStripButton load_last_db_now; private System.Windows.Forms.CheckBox loadLastDb; private System.Windows.Forms.ToolStripMenuItem mnuAnalyze; private System.Windows.Forms.ToolStripMenuItem mnuDropCollection; private System.Windows.Forms.ToolStripMenuItem mnuExplanPlan; private System.Windows.Forms.ToolStripMenuItem mnuExport; private System.Windows.Forms.ToolStripMenuItem mnuImport; private System.Windows.Forms.ToolStripMenuItem mnuIndexes; private System.Windows.Forms.ToolStripMenuItem mnuInfo; private System.Windows.Forms.ToolStripMenuItem mnuQueryAll; private System.Windows.Forms.ToolStripMenuItem mnuQueryCount; private System.Windows.Forms.ToolStripMenuItem mnuRebuild; private System.Windows.Forms.ToolStripMenuItem mnuRename; private System.Windows.Forms.ToolStripSeparator mnuSep1; private System.Windows.Forms.ToolStripSeparator mnuSep2; private System.Windows.Forms.ToolStripProgressBar prgRunning; private System.Windows.Forms.ToolStripDropDownButton recentDBsDropDownButton; private System.Windows.Forms.SplitContainer splitMain; private System.Windows.Forms.SplitContainer splitRight; private System.Windows.Forms.StatusStrip stbStatus; private System.Windows.Forms.TabPage tabGrid; private System.Windows.Forms.TabPage tabParameters; private System.Windows.Forms.TabControl tabResult; private System.Windows.Forms.TabControl tabSql; private System.Windows.Forms.TabPage tabText; private System.Windows.Forms.ToolStrip tlbMain; private System.Windows.Forms.ToolStripSeparator tlbSep1; private System.Windows.Forms.ToolStripSeparator tlbSep2; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; private System.Windows.Forms.TreeView tvwDatabase; private ICSharpCode.TextEditor.TextEditorControl txtParameters; private ICSharpCode.TextEditor.TextEditorControl txtResult; private ICSharpCode.TextEditor.TextEditorControl txtSql; #endregion private System.Windows.Forms.ToolStripMenuItem clearRecentListToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem validateRecentListToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; private System.Windows.Forms.NumericUpDown maxRecentListItems; private System.Windows.Forms.ToolTip maxRecentItemsTooltip; } }
53.722494
162
0.626215
[ "MIT" ]
AlBannaTechno/LiteDB.Studio
LiteDB.Studio/Forms/MainForm.Designer.cs
43,947
C#
using System.Collections.Generic; using System.Collections.Immutable; using System.Threading; using System.Threading.Tasks; using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Server; using ShaderTools.CodeAnalysis; using ShaderTools.CodeAnalysis.ReferenceHighlighting; namespace ShaderTools.LanguageServer.Handlers { internal sealed class DocumentHighlightHandler : IDocumentHighlightHandler { private readonly LanguageServerWorkspace _workspace; private readonly TextDocumentRegistrationOptions _registrationOptions; public DocumentHighlightHandler(LanguageServerWorkspace workspace, TextDocumentRegistrationOptions registrationOptions) { _workspace = workspace; _registrationOptions = registrationOptions; } public TextDocumentRegistrationOptions GetRegistrationOptions() => _registrationOptions; public async Task<DocumentHighlightContainer> Handle(DocumentHighlightParams request, CancellationToken token) { var (document, position) = _workspace.GetLogicalDocument(request); var documentHighlightsService = _workspace.Services.GetService<IDocumentHighlightsService>(); var documentHighlightsList = await documentHighlightsService.GetDocumentHighlightsAsync( document, position, ImmutableHashSet<Document>.Empty, // TODO token); var result = new List<DocumentHighlight>(); foreach (var documentHighlights in documentHighlightsList) { if (documentHighlights.Document != document) { continue; } foreach (var highlightSpan in documentHighlights.HighlightSpans) { result.Add(new DocumentHighlight { Kind = highlightSpan.Kind == HighlightSpanKind.Definition ? DocumentHighlightKind.Write : DocumentHighlightKind.Read, Range = Helpers.ToRange(document.SourceText, highlightSpan.TextSpan) }); } } return result; } public void SetCapability(DocumentHighlightCapability capability) { } } }
39.53125
128
0.647036
[ "Apache-2.0" ]
BigHeadGift/HLSL
src/ShaderTools.LanguageServer/Handlers/DocumentHighlightHandler.cs
2,469
C#
using HackConsole; using SurvivalHack.ECM; using System.Collections.Generic; using System.Linq; namespace SurvivalHack.Combat { public interface IWeapon : IComponent { Damage Damage { get; } Vec? Dir(Entity attacker, Entity defender); IEnumerable<Entity> Targets(Entity attacker, Vec dir); } public class MeleeWeapon : IWeapon, IEquippableComponent { public Damage Damage { get; } public MeleeWeapon(Damage damage) { Damage = damage; } public MeleeWeapon(float damage, EAttackMove move, EDamageType type) { Damage = new Damage(damage, type, move); } public Vec? Dir(Entity attacker, Entity defender) { Vec delta = (defender.Pos - attacker.Pos); if (delta.ManhattanLength > 1) return null; return delta; } public IEnumerable<Entity> Targets(Entity attacker, Vec dir) { var level = attacker.Level; return level.GetEntities(attacker.Pos + dir); } public ESlotType SlotType => ESlotType.Hand; } public class SweepWeapon : IWeapon, IEquippableComponent { public Damage Damage { get; } public int MinRange { get; } = 1; public int MaxRange { get; } = 1; public SweepWeapon(Damage damage, int minRange = 1, int maxRange = 1 ) { Damage = damage; } public Vec? Dir(Entity attacker, Entity defender) { Vec delta = (defender.Pos - attacker.Pos); if (delta.ManhattanLength > MaxRange) return null; return delta.Clamped; } public IEnumerable<Entity> Targets(Entity attacker, Vec _) { var level = attacker.Level; var center = attacker.Pos; return level.GetEntities(center.BoundingBox.Grow(MaxRange)).Where(e => (e.Pos - center).ManhattanLength >= MinRange); } public ESlotType SlotType => ESlotType.Hand; } public class RangedWeapon : IWeapon, IEquippableComponent { public Damage Damage { get; } public float Range; public RangedWeapon(int damage, EDamageType type, float range) { Damage = new Damage(damage,type, EAttackMove.Projectile); Range = range; } public RangedWeapon(Damage damage, float range) { Damage = damage; Range = range; } //TODO: Fix ranged weapons public Vec? Dir(Entity attacker, Entity defender) { Vec delta = (defender.Pos - attacker.Pos); return new Vec(MyMath.Clamp(delta.X, -1, 1), MyMath.Clamp(delta.Y, -1, 1)); } public IEnumerable<Entity> Targets(Entity attacker, Vec dir) { var level = attacker.Level; var pos = attacker.Pos; while (!level.GetTile(pos).Solid) { pos += dir; var targets = level.GetEntities(pos); foreach (var target in targets) yield return target; // TODO: Single-hit bullets. This works great for lightning bolt but that isn't really the idea here. } } public ESlotType SlotType => ESlotType.Ranged; } }
27.039683
129
0.560611
[ "BSD-2-Clause" ]
wokste/LotUS-Roguelike
SurvivalHack/Combat/Weapons.cs
3,409
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.Drawing.Design; using System.Globalization; using System.Windows.Forms.Internal; using System.Windows.Forms.Layout; using static Interop; namespace System.Windows.Forms { /// <summary> /// Displays text that can contain a hyperlink. /// </summary> [DefaultEvent(nameof(LinkClicked))] [ToolboxItem("System.Windows.Forms.Design.AutoSizeToolboxItem," + AssemblyRef.SystemDesign)] [SRDescription(nameof(SR.DescriptionLinkLabel))] public partial class LinkLabel : Label, IButtonControl { private static readonly object s_eventLinkClicked = new object(); private static Color s_iedisabledLinkColor = Color.Empty; private static readonly LinkComparer s_linkComparer = new LinkComparer(); private DialogResult _dialogResult; private Color _linkColor = Color.Empty; private Color _activeLinkColor = Color.Empty; private Color _visitedLinkColor = Color.Empty; private Color _disabledLinkColor = Color.Empty; private Font _linkFont; private Font _hoverLinkFont; private bool _textLayoutValid; private bool _receivedDoubleClick; private readonly List<Link> _links = new List<Link>(2); private Link _focusLink; private LinkCollection _linkCollection; private Region _textRegion; private Cursor _overrideCursor; private bool _processingOnGotFocus; // used to avoid raising the OnGotFocus event twice after selecting a focus link. private LinkBehavior _linkBehavior = LinkBehavior.SystemDefault; /// <summary> /// Initializes a new default instance of the <see cref='LinkLabel'/> class. /// </summary> public LinkLabel() : base() { SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.Opaque | ControlStyles.UserPaint | ControlStyles.StandardClick | ControlStyles.ResizeRedraw, true); ResetLinkArea(); } /// <summary> /// Gets or sets the color used to display active links. /// </summary> [SRCategory(nameof(SR.CatAppearance))] [SRDescription(nameof(SR.LinkLabelActiveLinkColorDescr))] public Color ActiveLinkColor { get { if (_activeLinkColor.IsEmpty) { return IEActiveLinkColor; } else { return _activeLinkColor; } } set { if (_activeLinkColor != value) { _activeLinkColor = value; InvalidateLink(null); } } } /// <summary> /// Gets or sets the color used to display disabled links. /// </summary> [SRCategory(nameof(SR.CatAppearance))] [SRDescription(nameof(SR.LinkLabelDisabledLinkColorDescr))] public Color DisabledLinkColor { get { if (_disabledLinkColor.IsEmpty) { return IEDisabledLinkColor; } else { return _disabledLinkColor; } } set { if (_disabledLinkColor != value) { _disabledLinkColor = value; InvalidateLink(null); } } } private Link FocusLink { get { return _focusLink; } set { if (_focusLink != value) { if (_focusLink is not null) { InvalidateLink(_focusLink); } _focusLink = value; if (_focusLink is not null) { InvalidateLink(_focusLink); UpdateAccessibilityLink(_focusLink); } } } } private Color IELinkColor { get { return LinkUtilities.IELinkColor; } } private Color IEActiveLinkColor { get { return LinkUtilities.IEActiveLinkColor; } } private Color IEVisitedLinkColor { get { return LinkUtilities.IEVisitedLinkColor; } } private Color IEDisabledLinkColor { get { if (s_iedisabledLinkColor.IsEmpty) { s_iedisabledLinkColor = ControlPaint.Dark(DisabledColor); } return s_iedisabledLinkColor; } } private Rectangle ClientRectWithPadding { get { return LayoutUtils.DeflateRect(ClientRectangle, Padding); } } [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] public new FlatStyle FlatStyle { get => base.FlatStyle; set => base.FlatStyle = value; } /// <summary> /// Gets or sets the range in the text that is treated as a link. /// </summary> [Editor("System.Windows.Forms.Design.LinkAreaEditor, " + AssemblyRef.SystemDesign, typeof(UITypeEditor))] [RefreshProperties(RefreshProperties.Repaint)] [Localizable(true)] [SRCategory(nameof(SR.CatBehavior))] [SRDescription(nameof(SR.LinkLabelLinkAreaDescr))] public LinkArea LinkArea { get { if (_links.Count == 0) { return new LinkArea(0, 0); } return new LinkArea(_links[0].Start, _links[0].Length); } set { LinkArea pt = LinkArea; _links.Clear(); if (!value.IsEmpty) { if (value.Start < 0) { throw new ArgumentOutOfRangeException(nameof(LinkArea), value, SR.LinkLabelAreaStart); } if (value.Length < -1) { throw new ArgumentOutOfRangeException(nameof(LinkArea), value, SR.LinkLabelAreaLength); } if (value.Start != 0 || !value.IsEmpty) { Links.Add(new Link(this)); // Update the link area of the first link. _links[0].Start = value.Start; _links[0].Length = value.Length; } } UpdateSelectability(); if (!pt.Equals(LinkArea)) { InvalidateTextLayout(); LayoutTransaction.DoLayout(ParentInternal, this, PropertyNames.LinkArea); base.AdjustSize(); Invalidate(); } } } /// <summary> /// Gets ir sets a value that represents how the link will be underlined. /// </summary> [DefaultValue(LinkBehavior.SystemDefault)] [SRCategory(nameof(SR.CatBehavior))] [SRDescription(nameof(SR.LinkLabelLinkBehaviorDescr))] public LinkBehavior LinkBehavior { get { return _linkBehavior; } set { //valid values are 0x0 to 0x3 SourceGenerated.EnumValidator.Validate(value); if (value != _linkBehavior) { _linkBehavior = value; InvalidateLinkFonts(); InvalidateLink(null); } } } /// <summary> /// Gets or sets the color used to display links in normal cases. /// </summary> [SRCategory(nameof(SR.CatAppearance))] [SRDescription(nameof(SR.LinkLabelLinkColorDescr))] public Color LinkColor { get { if (_linkColor.IsEmpty) { if (SystemInformation.HighContrast) { return SystemColors.HotTrack; } return IELinkColor; } else { return _linkColor; } } set { if (_linkColor != value) { _linkColor = value; InvalidateLink(null); } } } /// <summary> /// Gets the collection of links used in a <see cref='LinkLabel'/>. /// </summary> [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public LinkCollection Links { get { if (_linkCollection is null) { _linkCollection = new LinkCollection(this); } return _linkCollection; } } /// <summary> /// Gets or sets a value indicating whether the link should be displayed as if it was visited. /// </summary> [DefaultValue(false)] [SRCategory(nameof(SR.CatAppearance))] [SRDescription(nameof(SR.LinkLabelLinkVisitedDescr))] public bool LinkVisited { get { if (_links.Count == 0) { return false; } else { return _links[0].Visited; } } set { if (value != LinkVisited) { if (_links.Count == 0) { Links.Add(new Link(this)); } _links[0].Visited = value; } } } // link labels must always ownerdraw // internal override bool OwnerDraw { get { return true; } } protected Cursor OverrideCursor { get { return _overrideCursor; } set { if (_overrideCursor != value) { _overrideCursor = value; if (IsHandleCreated) { // We want to instantly change the cursor if the mouse is within our bounds. // This includes the case where the mouse is over one of our children var r = new RECT(); User32.GetCursorPos(out Point p); User32.GetWindowRect(this, ref r); if ((r.left <= p.X && p.X < r.right && r.top <= p.Y && p.Y < r.bottom) || User32.GetCapture() == Handle) { User32.SendMessageW(this, User32.WM.SETCURSOR, Handle, (IntPtr)User32.HT.CLIENT); } } } } } // Make this event visible through the property browser. [Browsable(true)] [EditorBrowsable(EditorBrowsableState.Always)] new public event EventHandler TabStopChanged { add => base.TabStopChanged += value; remove => base.TabStopChanged -= value; } [Browsable(true)] [EditorBrowsable(EditorBrowsableState.Always)] new public bool TabStop { get => base.TabStop; set => base.TabStop = value; } [RefreshProperties(RefreshProperties.Repaint)] public override string Text { get => base.Text; set => base.Text = value; } [RefreshProperties(RefreshProperties.Repaint)] public new Padding Padding { get => base.Padding; set => base.Padding = value; } /// <summary> /// Gets or sets the color used to display the link once it has been visited. /// </summary> [SRCategory(nameof(SR.CatAppearance))] [SRDescription(nameof(SR.LinkLabelVisitedLinkColorDescr))] public Color VisitedLinkColor { get { if (_visitedLinkColor.IsEmpty) { if (SystemInformation.HighContrast) { return LinkUtilities.GetVisitedLinkColor(); } return IEVisitedLinkColor; } else { return _visitedLinkColor; } } set { if (_visitedLinkColor != value) { _visitedLinkColor = value; InvalidateLink(null); } } } /// <summary> /// Occurs when the link is clicked. /// </summary> [WinCategory("Action")] [SRDescription(nameof(SR.LinkLabelLinkClickedDescr))] public event LinkLabelLinkClickedEventHandler LinkClicked { add => Events.AddHandler(s_eventLinkClicked, value); remove => Events.RemoveHandler(s_eventLinkClicked, value); } internal static Rectangle CalcTextRenderBounds(Rectangle textRect, Rectangle clientRect, ContentAlignment align) { int xLoc, yLoc, width, height; if ((align & WindowsFormsUtils.AnyRightAlign) != 0) { xLoc = clientRect.Right - textRect.Width; } else if ((align & WindowsFormsUtils.AnyCenterAlign) != 0) { xLoc = (clientRect.Width - textRect.Width) / 2; } else { xLoc = clientRect.X; } if ((align & WindowsFormsUtils.AnyBottomAlign) != 0) { yLoc = clientRect.Bottom - textRect.Height; } else if ((align & WindowsFormsUtils.AnyMiddleAlign) != 0) { yLoc = (clientRect.Height - textRect.Height) / 2; } else { yLoc = clientRect.Y; } // If the text rect does not fit in the client rect, make it fit. if (textRect.Width > clientRect.Width) { xLoc = clientRect.X; width = clientRect.Width; } else { width = textRect.Width; } if (textRect.Height > clientRect.Height) { yLoc = clientRect.Y; height = clientRect.Height; } else { height = textRect.Height; } return new Rectangle(xLoc, yLoc, width, height); } /// <summary> /// Constructs the new instance of the accessibility object for this control. Subclasses /// should not call base.CreateAccessibilityObject. /// </summary> protected override AccessibleObject CreateAccessibilityInstance() { return new LinkLabelAccessibleObject(this); } /// <summary> /// Creates a handle for this control. This method is called by the framework, /// this should not be called directly. Inheriting classes should always call /// <c>base.CreateHandle</c> when overriding this method. /// </summary> protected override void CreateHandle() { base.CreateHandle(); InvalidateTextLayout(); } /// <summary> /// Determines whether the current state of the control allows for rendering text using /// TextRenderer (GDI). /// The Gdi library doesn't currently have a way to calculate character ranges so we cannot /// use it for painting link(s) within the text, but if the link are is null or covers the /// entire text we are ok since it is just one area with the same size of the text binding /// area. /// </summary> internal override bool CanUseTextRenderer { get { // If no link or the LinkArea is one and covers the entire text, we can support UseCompatibleTextRendering = false. // Observe that LinkArea refers to the first link always. StringInfo stringInfo = new StringInfo(Text); return LinkArea.Start == 0 && (LinkArea.IsEmpty || LinkArea.Length == stringInfo.LengthInTextElements); } } internal override bool UseGDIMeasuring() { return !UseCompatibleTextRendering; } /// <summary> /// Converts the character index into char index of the string /// This method is copied in LinkCollectionEditor.cs. Update the other /// one as well if you change this method. /// This method mainly deal with surrogate. Suppose we /// have a string consisting of 3 surrogates, and we want the /// second character, then the index we need should be 2 instead of /// 1, and this method returns the correct index. /// </summary> private static int ConvertToCharIndex(int index, string text) { if (index <= 0) { return 0; } if (string.IsNullOrEmpty(text)) { Debug.Assert(text is not null, "string should not be null"); //do no conversion, just return the original value passed in return index; } //Dealing with surrogate characters //in some languages, characters can expand over multiple //chars, using StringInfo lets us properly deal with it. StringInfo stringInfo = new StringInfo(text); int numTextElements = stringInfo.LengthInTextElements; //index is greater than the length of the string if (index > numTextElements) { return index - numTextElements + text.Length; //pretend all the characters after are ASCII characters } //return the length of the substring which has specified number of characters string sub = stringInfo.SubstringByTextElements(0, index); return sub.Length; } /// <summary> /// Ensures that we have analyzed the text run so that we can render each segment /// and link. /// </summary> private void EnsureRun(Graphics g) { // bail early if everything is valid! if (_textLayoutValid) { return; } if (_textRegion is not null) { _textRegion.Dispose(); _textRegion = null; } // bail early for no text // if (Text.Length == 0) { Links.Clear(); Links.Add(new Link(0, -1)); // default 'magic' link. _textLayoutValid = true; return; } StringFormat textFormat = CreateStringFormat(); string text = Text; try { Font alwaysUnderlined = new Font(Font, Font.Style | FontStyle.Underline); Graphics created = null; try { if (g is null) { g = created = CreateGraphicsInternal(); } if (UseCompatibleTextRendering) { Region[] textRegions = g.MeasureCharacterRanges(text, alwaysUnderlined, ClientRectWithPadding, textFormat); int regionIndex = 0; for (int i = 0; i < Links.Count; i++) { Link link = Links[i]; int charStart = ConvertToCharIndex(link.Start, text); int charEnd = ConvertToCharIndex(link.Start + link.Length, text); if (LinkInText(charStart, charEnd - charStart)) { Links[i].VisualRegion = textRegions[regionIndex]; regionIndex++; } } Debug.Assert(regionIndex == (textRegions.Length - 1), "Failed to consume all link label visual regions"); _textRegion = textRegions[textRegions.Length - 1]; } else { // use TextRenderer.MeasureText to see the size of the text Rectangle clientRectWithPadding = ClientRectWithPadding; Size clientSize = new Size(clientRectWithPadding.Width, clientRectWithPadding.Height); TextFormatFlags flags = CreateTextFormatFlags(clientSize); Size textSize = TextRenderer.MeasureText(text, alwaysUnderlined, clientSize, flags); // We need to take into account the padding that GDI adds around the text. int iLeftMargin, iRightMargin; TextPaddingOptions padding = default; if ((flags & TextFormatFlags.NoPadding) == TextFormatFlags.NoPadding) { padding = TextPaddingOptions.NoPadding; } else if ((flags & TextFormatFlags.LeftAndRightPadding) == TextFormatFlags.LeftAndRightPadding) { padding = TextPaddingOptions.LeftAndRightPadding; } using var hfont = GdiCache.GetHFONT(Font); User32.DRAWTEXTPARAMS dtParams = hfont.GetTextMargins(padding); iLeftMargin = dtParams.iLeftMargin; iRightMargin = dtParams.iRightMargin; Rectangle visualRectangle = new Rectangle(clientRectWithPadding.X + iLeftMargin, clientRectWithPadding.Y, textSize.Width - iRightMargin - iLeftMargin, textSize.Height); visualRectangle = CalcTextRenderBounds(visualRectangle /*textRect*/, clientRectWithPadding /*clientRect*/, RtlTranslateContent(TextAlign)); // Region visualRegion = new Region(visualRectangle); if (_links is not null && _links.Count == 1) { Links[0].VisualRegion = visualRegion; } _textRegion = visualRegion; } } finally { alwaysUnderlined.Dispose(); if (created is not null) { created.Dispose(); } } _textLayoutValid = true; } finally { textFormat.Dispose(); } } internal override StringFormat CreateStringFormat() { StringFormat stringFormat = base.CreateStringFormat(); if (string.IsNullOrEmpty(Text)) { return stringFormat; } CharacterRange[] regions = AdjustCharacterRangesForSurrogateChars(); stringFormat.SetMeasurableCharacterRanges(regions); return stringFormat; } /// <summary> /// Calculate character ranges taking into account the locale. Provided for surrogate chars support. /// </summary> private CharacterRange[] AdjustCharacterRangesForSurrogateChars() { string text = Text; if (string.IsNullOrEmpty(text)) { return Array.Empty<CharacterRange>(); } StringInfo stringInfo = new StringInfo(text); int textLen = stringInfo.LengthInTextElements; List<CharacterRange> ranges = new List<CharacterRange>(Links.Count + 1); foreach (Link link in Links) { int charStart = ConvertToCharIndex(link.Start, text); int charEnd = ConvertToCharIndex(link.Start + link.Length, text); if (LinkInText(charStart, charEnd - charStart)) { int length = (int)Math.Min(link.Length, textLen - link.Start); ranges.Add(new CharacterRange(charStart, ConvertToCharIndex(link.Start + length, text) - charStart)); } } ranges.Add(new CharacterRange(0, text.Length)); return ranges.ToArray(); } /// <summary> /// Determines whether the whole link label contains only one link, /// and the link runs from the beginning of the label to the end of it /// </summary> private bool IsOneLink() { if (_links is null || _links.Count != 1 || Text is null) { return false; } StringInfo stringInfo = new StringInfo(Text); if (LinkArea.Start == 0 && LinkArea.Length == stringInfo.LengthInTextElements) { return true; } return false; } /// <summary> /// Determines if the given client coordinates is contained within a portion /// of a link area. /// </summary> protected Link PointInLink(int x, int y) { Graphics g = CreateGraphicsInternal(); Link hit = null; try { EnsureRun(g); foreach (Link link in _links) { if (link.VisualRegion is not null && link.VisualRegion.IsVisible(x, y, g)) { hit = link; break; } } } finally { g.Dispose(); g = null; } return hit; } /// <summary> /// Invalidates only the portions of the text that is linked to /// the specified link. If link is null, then all linked text /// is invalidated. /// </summary> private void InvalidateLink(Link link) { if (IsHandleCreated) { if (link is null || link.VisualRegion is null || IsOneLink()) { Invalidate(); } else { Invalidate(link.VisualRegion); } } } /// <summary> /// Invalidates the current set of fonts we use when painting /// links. The fonts will be recreated when needed. /// </summary> private void InvalidateLinkFonts() { if (_linkFont is not null) { _linkFont.Dispose(); } if (_hoverLinkFont is not null && _hoverLinkFont != _linkFont) { _hoverLinkFont.Dispose(); } _linkFont = null; _hoverLinkFont = null; } private void InvalidateTextLayout() { _textLayoutValid = false; } private bool LinkInText(int start, int length) { return (0 <= start && start < Text.Length && 0 < length); } /// <summary> /// Gets or sets a value that is returned to the /// parent form when the link label. /// is clicked. /// </summary> DialogResult IButtonControl.DialogResult { get { return _dialogResult; } set { //valid values are 0x0 to 0x7 SourceGenerated.EnumValidator.Validate(value); _dialogResult = value; } } void IButtonControl.NotifyDefault(bool value) { } /// <summary> /// Raises the <see cref='Control.GotFocus'/> event. /// </summary> protected override void OnGotFocus(EventArgs e) { if (!_processingOnGotFocus) { base.OnGotFocus(e); _processingOnGotFocus = true; } try { Link focusLink = FocusLink; if (focusLink is null) { // Set focus on first link. // This will raise the OnGotFocus event again but it will not be processed because processingOnGotFocus is true. Select(true /*directed*/, true /*forward*/); } else { InvalidateLink(focusLink); UpdateAccessibilityLink(focusLink); } } finally { if (_processingOnGotFocus) { _processingOnGotFocus = false; } } } /// <summary> /// Raises the <see cref='Control.LostFocus'/> /// event. /// </summary> protected override void OnLostFocus(EventArgs e) { base.OnLostFocus(e); if (FocusLink is not null) { InvalidateLink(FocusLink); } } /// <summary> /// Raises the <see cref='Control.OnKeyDown'/> /// event. /// </summary> protected override void OnKeyDown(KeyEventArgs e) { base.OnKeyDown(e); if (e.KeyCode == Keys.Enter) { if (FocusLink is not null && FocusLink.Enabled) { OnLinkClicked(new LinkLabelLinkClickedEventArgs(FocusLink)); } } } /// <summary> /// Raises the <see cref='Control.OnMouseLeave'/> /// event. /// </summary> protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); if (!Enabled) { return; } foreach (Link link in _links) { if ((link.State & LinkState.Hover) == LinkState.Hover || (link.State & LinkState.Active) == LinkState.Active) { bool activeChanged = (link.State & LinkState.Active) == LinkState.Active; link.State &= ~(LinkState.Hover | LinkState.Active); if (activeChanged || _hoverLinkFont != _linkFont) { InvalidateLink(link); } OverrideCursor = null; } } } /// <summary> /// Raises the <see cref='Control.OnMouseDown'/> /// event. /// </summary> protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); if (!Enabled || e.Clicks > 1) { _receivedDoubleClick = true; return; } for (int i = 0; i < _links.Count; i++) { if ((_links[i].State & LinkState.Hover) == LinkState.Hover) { _links[i].State |= LinkState.Active; Focus(); if (_links[i].Enabled) { FocusLink = _links[i]; InvalidateLink(FocusLink); } Capture = true; break; } } } /// <summary> /// Raises the <see cref='Control.OnMouseUp'/> /// event. /// </summary> protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); // if (Disposing || IsDisposed) { return; } if (!Enabled || e.Clicks > 1 || _receivedDoubleClick) { _receivedDoubleClick = false; return; } for (int i = 0; i < _links.Count; i++) { if ((_links[i].State & LinkState.Active) == LinkState.Active) { _links[i].State &= ~LinkState.Active; InvalidateLink(_links[i]); Capture = false; Link clicked = PointInLink(e.X, e.Y); if (clicked is not null && clicked == FocusLink && clicked.Enabled) { OnLinkClicked(new LinkLabelLinkClickedEventArgs(clicked, e.Button)); } } } } /// <summary> /// Raises the <see cref='Control.OnMouseMove'/> /// event. /// </summary> protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); if (!Enabled) { return; } Link hoverLink = null; foreach (Link link in _links) { if ((link.State & LinkState.Hover) == LinkState.Hover) { hoverLink = link; break; } } Link pointIn = PointInLink(e.X, e.Y); if (pointIn != hoverLink) { if (hoverLink is not null) { hoverLink.State &= ~LinkState.Hover; } if (pointIn is not null) { pointIn.State |= LinkState.Hover; if (pointIn.Enabled) { OverrideCursor = Cursors.Hand; } } else { OverrideCursor = null; } if (_hoverLinkFont != _linkFont) { if (hoverLink is not null) { InvalidateLink(hoverLink); } if (pointIn is not null) { InvalidateLink(pointIn); } } } } /// <summary> /// Raises the <see cref='OnLinkClicked'/> event. /// </summary> protected virtual void OnLinkClicked(LinkLabelLinkClickedEventArgs e) { ((LinkLabelLinkClickedEventHandler)Events[s_eventLinkClicked])?.Invoke(this, e); } protected override void OnPaddingChanged(EventArgs e) { base.OnPaddingChanged(e); InvalidateTextLayout(); } /// <summary> /// Raises the <see cref='Control.OnPaint'/> /// event. /// </summary> protected override void OnPaint(PaintEventArgs e) { RectangleF finalrect = RectangleF.Empty; //the focus rectangle if there is only one link Animate(); ImageAnimator.UpdateFrames(Image); Graphics g = e.GraphicsInternal; EnsureRun(g); if (Text.Length == 0) { // bail early for no text PaintLinkBackground(g); } else { // Paint enabled link label if (AutoEllipsis) { Rectangle clientRect = ClientRectWithPadding; Size preferredSize = GetPreferredSize(new Size(clientRect.Width, clientRect.Height)); _showToolTip = (clientRect.Width < preferredSize.Width || clientRect.Height < preferredSize.Height); } else { _showToolTip = false; } if (Enabled) { // Control.Enabled not to be confused with Link.Enabled bool optimizeBackgroundRendering = !GetStyle(ControlStyles.OptimizedDoubleBuffer); var foreBrush = ForeColor.GetCachedSolidBrushScope(); var linkBrush = LinkColor.GetCachedSolidBrushScope(); try { if (!optimizeBackgroundRendering) { PaintLinkBackground(g); } LinkUtilities.EnsureLinkFonts(Font, LinkBehavior, ref _linkFont, ref _hoverLinkFont); Region originalClip = g.Clip; try { if (IsOneLink()) { //exclude the area to draw the focus rectangle g.Clip = originalClip; RectangleF[] rects = _links[0].VisualRegion.GetRegionScans(e.GraphicsInternal.Transform); if (rects is not null && rects.Length > 0) { if (UseCompatibleTextRendering) { finalrect = new RectangleF(rects[0].Location, SizeF.Empty); foreach (RectangleF rect in rects) { finalrect = RectangleF.Union(finalrect, rect); } } else { finalrect = ClientRectWithPadding; Size finalRectSize = finalrect.Size.ToSize(); Size requiredSize = MeasureTextCache.GetTextSize(Text, Font, finalRectSize, CreateTextFormatFlags(finalRectSize)); finalrect.Width = requiredSize.Width; if (requiredSize.Height < finalrect.Height) { finalrect.Height = requiredSize.Height; } finalrect = CalcTextRenderBounds(Rectangle.Round(finalrect) /*textRect*/, ClientRectWithPadding /*clientRect*/, RtlTranslateContent(TextAlign)); } using (Region region = new Region(finalrect)) { g.ExcludeClip(region); } } } else { foreach (Link link in _links) { if (link.VisualRegion is not null) { g.ExcludeClip(link.VisualRegion); } } } // When there is only one link in link label, // it's not necessary to paint with foreBrush first // as it will be overlapped by linkBrush in the following steps if (!IsOneLink()) { PaintLink(e, null, foreBrush, linkBrush, optimizeBackgroundRendering, finalrect); } foreach (Link link in _links) { PaintLink(e, link, foreBrush, linkBrush, optimizeBackgroundRendering, finalrect); } if (optimizeBackgroundRendering) { g.Clip = originalClip; g.ExcludeClip(_textRegion); PaintLinkBackground(g); } } finally { g.Clip = originalClip; } } finally { foreBrush.Dispose(); linkBrush.Dispose(); } } else { // Paint disabled link label (disabled control, not to be confused with disabled link). Region originalClip = g.Clip; try { // We need to paint the background first before clipping to textRegion because it is calculated using // ClientRectWithPadding which in some cases is smaller that ClientRectangle. PaintLinkBackground(g); g.IntersectClip(_textRegion); if (UseCompatibleTextRendering) { // APPCOMPAT: Use DisabledColor because Everett used DisabledColor. // (ie, don't use Graphics.GetNearestColor(DisabledColor.) StringFormat stringFormat = CreateStringFormat(); ControlPaint.DrawStringDisabled(g, Text, Font, DisabledColor, ClientRectWithPadding, stringFormat); } else { Color foreColor; using (var scope = new DeviceContextHdcScope(e, applyGraphicsState: false)) { foreColor = scope.HDC.FindNearestColor(DisabledColor); } Rectangle clientRectWidthPadding = ClientRectWithPadding; ControlPaint.DrawStringDisabled( g, Text, Font, foreColor, clientRectWidthPadding, CreateTextFormatFlags(clientRectWidthPadding.Size)); } } finally { g.Clip = originalClip; } } } // We can't call base.OnPaint because labels paint differently from link labels, // but we still need to raise the Paint event. RaisePaintEvent(this, e); } protected override void OnPaintBackground(PaintEventArgs e) { Image i = Image; if (i is not null) { Region oldClip = e.Graphics.Clip; Rectangle imageBounds = CalcImageRenderBounds(i, ClientRectangle, RtlTranslateAlignment(ImageAlign)); e.Graphics.ExcludeClip(imageBounds); try { base.OnPaintBackground(e); } finally { e.Graphics.Clip = oldClip; } e.Graphics.IntersectClip(imageBounds); try { base.OnPaintBackground(e); DrawImage(e.Graphics, i, ClientRectangle, RtlTranslateAlignment(ImageAlign)); } finally { e.Graphics.Clip = oldClip; } } else { base.OnPaintBackground(e); } } protected override void OnFontChanged(EventArgs e) { base.OnFontChanged(e); InvalidateTextLayout(); InvalidateLinkFonts(); Invalidate(); } protected override void OnAutoSizeChanged(EventArgs e) { base.OnAutoSizeChanged(e); InvalidateTextLayout(); } /// <summary> /// Overriden by LinkLabel. /// </summary> internal override void OnAutoEllipsisChanged() { base.OnAutoEllipsisChanged(/*e*/); InvalidateTextLayout(); } protected override void OnEnabledChanged(EventArgs e) { base.OnEnabledChanged(e); if (!Enabled) { for (int i = 0; i < _links.Count; i++) { _links[i].State &= ~(LinkState.Hover | LinkState.Active); } OverrideCursor = null; } InvalidateTextLayout(); Invalidate(); } protected override void OnTextChanged(EventArgs e) { base.OnTextChanged(e); InvalidateTextLayout(); UpdateSelectability(); } protected override void OnTextAlignChanged(EventArgs e) { base.OnTextAlignChanged(e); InvalidateTextLayout(); UpdateSelectability(); } private void PaintLink( PaintEventArgs e, Link link, SolidBrush foreBrush, SolidBrush linkBrush, bool optimizeBackgroundRendering, RectangleF finalrect) { // link = null means paint the whole text Graphics g = e.GraphicsInternal; Debug.Assert(g is not null, "Must pass valid graphics"); Debug.Assert(foreBrush is not null, "Must pass valid foreBrush"); Debug.Assert(linkBrush is not null, "Must pass valid linkBrush"); Font font = Font; if (link is not null) { if (link.VisualRegion is not null) { Color brushColor = Color.Empty; LinkState linkState = link.State; font = (linkState & LinkState.Hover) == LinkState.Hover ? _hoverLinkFont : _linkFont; if (link.Enabled) { // Not to be confused with Control.Enabled. if ((linkState & LinkState.Active) == LinkState.Active) { brushColor = ActiveLinkColor; } else if ((linkState & LinkState.Visited) == LinkState.Visited) { brushColor = VisitedLinkColor; } } else { brushColor = DisabledLinkColor; } g.Clip = IsOneLink() ? new Region(finalrect) : link.VisualRegion; if (optimizeBackgroundRendering) { PaintLinkBackground(g); } if (brushColor == Color.Empty) { brushColor = linkBrush.Color; } if (UseCompatibleTextRendering) { using var useBrush = brushColor.GetCachedSolidBrushScope(); StringFormat stringFormat = CreateStringFormat(); g.DrawString(Text, font, useBrush, ClientRectWithPadding, stringFormat); } else { brushColor = g.FindNearestColor(brushColor); Rectangle clientRectWithPadding = ClientRectWithPadding; TextRenderer.DrawText( g, Text, font, clientRectWithPadding, brushColor, CreateTextFormatFlags(clientRectWithPadding.Size) #if DEBUG // Skip the asserts in TextRenderer because the DC has been modified | TextRenderer.SkipAssertFlag #endif ); } if (Focused && ShowFocusCues && FocusLink == link) { // Get the rectangles making up the visual region, and draw each one. RectangleF[] rects = link.VisualRegion.GetRegionScans(g.Transform); if (rects is not null && rects.Length > 0) { Rectangle focusRect; if (IsOneLink()) { // Draw one merged focus rectangle focusRect = Rectangle.Ceiling(finalrect); Debug.Assert(finalrect != RectangleF.Empty, "finalrect should be initialized"); ControlPaint.DrawFocusRectangle(g, focusRect, ForeColor, BackColor); } else { foreach (RectangleF rect in rects) { ControlPaint.DrawFocusRectangle(g, Rectangle.Ceiling(rect), ForeColor, BackColor); } } } } } // no else clause... we don't paint anything if we are given a link with no visual region. } else { // Painting with no link. g.IntersectClip(_textRegion); if (optimizeBackgroundRendering) { PaintLinkBackground(g); } if (UseCompatibleTextRendering) { StringFormat stringFormat = CreateStringFormat(); g.DrawString(Text, font, foreBrush, ClientRectWithPadding, stringFormat); } else { Color color; using (var hdc = new DeviceContextHdcScope(g, applyGraphicsState: false)) { color = ColorTranslator.FromWin32( Gdi32.GetNearestColor(hdc, ColorTranslator.ToWin32(foreBrush.Color))); } Rectangle clientRectWithPadding = ClientRectWithPadding; TextRenderer.DrawText( g, Text, font, clientRectWithPadding, color, CreateTextFormatFlags(clientRectWithPadding.Size)); } } } private void PaintLinkBackground(Graphics g) { using (PaintEventArgs e = new PaintEventArgs(g, ClientRectangle)) { InvokePaintBackground(this, e); } } void IButtonControl.PerformClick() { // If a link is not currently focused, focus on the first link // if (FocusLink is null && Links.Count > 0) { string text = Text; foreach (Link link in Links) { int charStart = ConvertToCharIndex(link.Start, text); int charEnd = ConvertToCharIndex(link.Start + link.Length, text); if (link.Enabled && LinkInText(charStart, charEnd - charStart)) { FocusLink = link; break; } } } // Act as if the focused link was clicked // if (FocusLink is not null) { OnLinkClicked(new LinkLabelLinkClickedEventArgs(FocusLink)); } } /// <summary> /// Processes a dialog key. This method is called during message pre-processing /// to handle dialog characters, such as TAB, RETURN, ESCAPE, and arrow keys. This /// method is called only if the isInputKey() method indicates that the control /// isn't interested in the key. processDialogKey() simply sends the character to /// the parent's processDialogKey() method, or returns false if the control has no /// parent. The Form class overrides this method to perform actual processing /// of dialog keys. When overriding processDialogKey(), a control should return true /// to indicate that it has processed the key. For keys that aren't processed by the /// control, the result of "base.processDialogChar()" should be returned. Controls /// will seldom, if ever, need to override this method. /// </summary> protected override bool ProcessDialogKey(Keys keyData) { if ((keyData & (Keys.Alt | Keys.Control)) != Keys.Alt) { Keys keyCode = keyData & Keys.KeyCode; switch (keyCode) { case Keys.Tab: if (TabStop) { bool forward = (keyData & Keys.Shift) != Keys.Shift; if (FocusNextLink(forward)) { return true; } } break; case Keys.Up: case Keys.Left: if (FocusNextLink(false)) { return true; } break; case Keys.Down: case Keys.Right: if (FocusNextLink(true)) { return true; } break; } } return base.ProcessDialogKey(keyData); } private bool FocusNextLink(bool forward) { int focusIndex = -1; if (_focusLink is not null) { for (int i = 0; i < _links.Count; i++) { if (_links[i] == _focusLink) { focusIndex = i; break; } } } focusIndex = GetNextLinkIndex(focusIndex, forward); if (focusIndex != -1) { FocusLink = Links[focusIndex]; return true; } else { FocusLink = null; return false; } } private int GetNextLinkIndex(int focusIndex, bool forward) { Link test; string text = Text; int charStart = 0; int charEnd = 0; if (forward) { do { focusIndex++; if (focusIndex < Links.Count) { test = Links[focusIndex]; charStart = ConvertToCharIndex(test.Start, text); charEnd = ConvertToCharIndex(test.Start + test.Length, text); } else { test = null; } } while (test is not null && !test.Enabled && LinkInText(charStart, charEnd - charStart)); } else { do { focusIndex--; if (focusIndex >= 0) { test = Links[focusIndex]; charStart = ConvertToCharIndex(test.Start, text); charEnd = ConvertToCharIndex(test.Start + test.Length, text); } else { test = null; } } while (test is not null && !test.Enabled && LinkInText(charStart, charEnd - charStart)); } if (focusIndex < 0 || focusIndex >= _links.Count) { return -1; } else { return focusIndex; } } private void ResetLinkArea() { LinkArea = new LinkArea(0, -1); } internal void ResetActiveLinkColor() { _activeLinkColor = Color.Empty; } internal void ResetDisabledLinkColor() { _disabledLinkColor = Color.Empty; } internal void ResetLinkColor() { _linkColor = Color.Empty; InvalidateLink(null); } private void ResetVisitedLinkColor() { _visitedLinkColor = Color.Empty; } /// <summary> /// Performs the work of setting the bounds of this control. Inheriting classes /// can override this function to add size restrictions. Inheriting classes must call /// base.setBoundsCore to actually cause the bounds of the control to change. /// </summary> protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified) { // we cache too much state to try and optimize this (regions, etc)... it is best // to always relayout here... If we want to resurrect this code in the future, // remember that we need to handle a word wrapped top aligned text that // will become newly exposed (and therefore layed out) when we resize... InvalidateTextLayout(); Invalidate(); base.SetBoundsCore(x, y, width, height, specified); } protected override void Select(bool directed, bool forward) { if (directed) { // In a multi-link label, if the tab came from another control, we want to keep the currently // focused link, otherwise, we set the focus to the next link. if (_links.Count > 0) { // Find which link is currently focused // int focusIndex = -1; if (FocusLink is not null) { focusIndex = _links.IndexOf(FocusLink); } // We could be getting focus from ourself, so we must // invalidate each time. // FocusLink = null; int newFocus = GetNextLinkIndex(focusIndex, forward); if (newFocus == -1) { if (forward) { newFocus = GetNextLinkIndex(-1, forward); // -1, so "next" will be 0 } else { newFocus = GetNextLinkIndex(_links.Count, forward); // Count, so "next" will be Count-1 } } if (newFocus != -1) { FocusLink = _links[newFocus]; } } } base.Select(directed, forward); } /// <summary> /// Determines if the color for active links should remain the same. /// </summary> internal bool ShouldSerializeActiveLinkColor() { return !_activeLinkColor.IsEmpty; } /// <summary> /// Determines if the color for disabled links should remain the same. /// </summary> internal bool ShouldSerializeDisabledLinkColor() { return !_disabledLinkColor.IsEmpty; } /// <summary> /// Determines if the range in text that is treated as a link should remain the same. /// </summary> private bool ShouldSerializeLinkArea() { if (_links.Count == 1) { // use field access to find out if "length" is really -1 return Links[0].Start != 0 || Links[0]._length != -1; } return true; } /// <summary> /// Determines if the color of links in normal cases should remain the same. /// </summary> internal bool ShouldSerializeLinkColor() { return !_linkColor.IsEmpty; } /// <summary> /// Determines whether designer should generate code for setting the UseCompatibleTextRendering or not. /// DefaultValue(false) /// </summary> private bool ShouldSerializeUseCompatibleTextRendering() { // Serialize code if LinkLabel cannot support the feature or the property's value is not the default. return !CanUseTextRenderer || UseCompatibleTextRendering != Control.UseCompatibleTextRenderingDefault; } /// <summary> /// Determines if the color of links that have been visited should remain the same. /// </summary> private bool ShouldSerializeVisitedLinkColor() { return !_visitedLinkColor.IsEmpty; } /// <summary> /// Update accessibility with the currently focused link. /// </summary> private void UpdateAccessibilityLink(Link focusLink) { if (!IsHandleCreated) { return; } int focusIndex = -1; for (int i = 0; i < _links.Count; i++) { if (_links[i] == focusLink) { focusIndex = i; } } AccessibilityNotifyClients(AccessibleEvents.Focus, focusIndex); } /// <summary> /// Validates that no links overlap. This will throw an exception if they do. /// </summary> private void ValidateNoOverlappingLinks() { for (int x = 0; x < _links.Count; x++) { Link left = _links[x]; if (left.Length < 0) { throw new InvalidOperationException(SR.LinkLabelOverlap); } for (int y = x; y < _links.Count; y++) { if (x != y) { Link right = _links[y]; int maxStart = Math.Max(left.Start, right.Start); int minEnd = Math.Min(left.Start + left.Length, right.Start + right.Length); if (maxStart < minEnd) { throw new InvalidOperationException(SR.LinkLabelOverlap); } } } } } /// <summary> /// Updates the label's ability to get focus. If there are any links in the label, then the label can get /// focus, else it can't. /// </summary> private void UpdateSelectability() { LinkArea pt = LinkArea; bool selectable = false; string text = Text; int charStart = ConvertToCharIndex(pt.Start, text); int charEnd = ConvertToCharIndex(pt.Start + pt.Length, text); if (LinkInText(charStart, charEnd - charStart)) { selectable = true; } else { // If a link is currently focused, de-select it // if (FocusLink is not null) { FocusLink = null; } } OverrideCursor = null; TabStop = selectable; SetStyle(ControlStyles.Selectable, selectable); } /// <summary> /// Determines whether to use compatible text rendering engine (GDI+) or not (GDI). /// </summary> [RefreshProperties(RefreshProperties.Repaint)] [SRCategory(nameof(SR.CatBehavior))] [SRDescription(nameof(SR.UseCompatibleTextRenderingDescr))] public new bool UseCompatibleTextRendering { get { Debug.Assert(CanUseTextRenderer || base.UseCompatibleTextRendering, "Using GDI text rendering when CanUseTextRenderer reported false."); return base.UseCompatibleTextRendering; } set { if (base.UseCompatibleTextRendering != value) { // Cache the value so it is restored if CanUseTextRenderer becomes true and the designer can undo changes to this as side effect. base.UseCompatibleTextRendering = value; InvalidateTextLayout(); } } } internal override bool SupportsUiaProviders => false; /// <summary> /// Handles the WM_SETCURSOR message /// </summary> private void WmSetCursor(ref Message m) { // Accessing through the Handle property has side effects that break this // logic. You must use InternalHandle. // if (m.WParam == InternalHandle && PARAM.LOWORD(m.LParam) == (int)User32.HT.CLIENT) { if (OverrideCursor is not null) { Cursor.Current = OverrideCursor; } else { Cursor.Current = Cursor; } } else { DefWndProc(ref m); } } protected override void WndProc(ref Message msg) { switch ((User32.WM)msg.Msg) { case User32.WM.SETCURSOR: WmSetCursor(ref msg); break; default: base.WndProc(ref msg); break; } } } }
33.711632
184
0.450837
[ "MIT" ]
jsoref/dotnet-winforms
src/System.Windows.Forms/src/System/Windows/Forms/LinkLabel.cs
68,976
C#
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using MySql.Data.MySqlClient; using System.IO; using System.Text.RegularExpressions; namespace Car_Renting_Management_System { public partial class carsForm : Form { public carsForm() { InitializeComponent(); } public string cleanTextboxes{ set { monoFlat_TextBox1.Text = value; } } CURDQueryClass curdClass = new CURDQueryClass(); //Class for Curd function. private void label2_Click(object sender, EventArgs e) { this.Close(); //Closing mark X. } private void carsForm_Load(object sender, EventArgs e) { getDataFromTheDB(); //load data into DataGridView. buttonToGetBlackAndWhite(); //Change the Update and Delete Button to be black and white and Disabled. comboBox1.SelectedIndex = 0; //comboBox1 must have the first value as default when form loads. } /// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void bunifuFlatButton1_Click(object sender, EventArgs e) { //Insertion //If non of them empty do let to insert. string meterType = ""; if (radioButton1.Checked == true) { meterType = "Normal"; } else if (radioButton2.Checked == true) { meterType = "Digital"; } if (monoFlat_TextBox1.Text == string.Empty || monoFlat_TextBox2.Text == string.Empty || monoFlat_TextBox3.Text == string.Empty || monoFlat_TextBox4.Text == string.Empty || monoFlat_TextBox5.Text == string.Empty || monoFlat_TextBox6.Text == string.Empty || monoFlat_TextBox7.Text == string.Empty || monoFlat_TextBox8.Text == string.Empty) { ErrorMsgBox er = new ErrorMsgBox("Please Fill all the columns"); er.Show(); } else { string canInsert = "yes"; if (monoFlat_TextBox8.Text.Length < 5) { ErrorMsgBox er = new ErrorMsgBox("The mileage meter must have five digits"); er.Show(); canInsert = "no"; } if (canInsert == "yes") { string InsertQuery = "INSERT INTO car VALUES ('" + monoFlat_TextBox1.Text + "','" + monoFlat_TextBox2.Text + "','" + monoFlat_TextBox3.Text + "','" + monoFlat_TextBox4.Text + "','" + monoFlat_TextBox5.Text + "','" + monoFlat_TextBox6.Text + "','" + monoFlat_TextBox7.Text + "','IN','" + monoFlat_TextBox8.Text + "','"+meterType+"')"; RegisterCarMethod(InsertQuery); } } } string carIdForBug1 = ""; string meterType = ""; private void bunifuFlatButton2_Click(object sender, EventArgs e) { //Selection string query = "SELECT * FROM car WHERE carId='" + monoFlat_TextBox9.Text + "'"; string dataComeChecker = "no"; //The data returns back as MySqlDataReader format. That's why we can loop it. MySqlDataReader returnData = curdClass.SelectQuery(query); while (returnData.Read()) { monoFlat_TextBox1.Text = returnData.GetString(0); monoFlat_TextBox2.Text = returnData.GetString(1); monoFlat_TextBox3.Text = returnData.GetString(2); monoFlat_TextBox4.Text = returnData.GetString(3); monoFlat_TextBox5.Text = returnData.GetString(4); monoFlat_TextBox6.Text = returnData.GetString(5); monoFlat_TextBox7.Text = returnData.GetString(6); monoFlat_TextBox8.Text = returnData.GetString("odometer"); meterType = returnData.GetString("kmmeter_type"); dataComeChecker = monoFlat_TextBox8.Text; carIdForBug1 = returnData.GetString(0); } if (dataComeChecker == "no") { ErrorMsgBox ee = new ErrorMsgBox("You have entered a wrong car ID"); ee.Show(); } if (meterType == "Normal") { radioButton1.Checked = true; } else if (meterType == "Digital") { radioButton2.Checked = true; } //if the data comes back, Enable the update and delete buttons and change their colors from black and white to colors. if (monoFlat_TextBox1.Text.Length > 0 && monoFlat_TextBox6.Text.Length > 0 && monoFlat_TextBox5.Text.Length > 0) { buttonToGetColor(); } } private void bunifuFlatButton3_Click(object sender, EventArgs e) { //Update string selectCar = "SELECT carStatus FROM car WHERE carId='" + monoFlat_TextBox9.Text + "'"; MySqlDataReader datas = curdClass.SelectQueryOutMsg(selectCar); string carS = ""; while (datas.Read()) { carS = datas.GetString(0); } string meterType = ""; if (radioButton1.Checked == true) { meterType = "Normal"; } else { meterType = "Digital"; } string selectCarforUpateallNotAllow = "SELECT * FROM car WHERE carId='" + monoFlat_TextBox9.Text + "'"; MySqlDataReader dataForselectCarforUpateallNotAllow = curdClass.SelectQueryOutMsg(selectCarforUpateallNotAllow); string carId = ""; string model = ""; string brand = ""; string makeYear = ""; string color = ""; string dailyRate = ""; string monthlyRate = ""; string odameterValue = ""; string meterTypeOld = ""; while (dataForselectCarforUpateallNotAllow.Read()) { carId = dataForselectCarforUpateallNotAllow.GetString("carId"); model = dataForselectCarforUpateallNotAllow.GetString("carModel"); brand = dataForselectCarforUpateallNotAllow.GetString("carBrand"); makeYear = dataForselectCarforUpateallNotAllow.GetString("carMakeYear"); color = dataForselectCarforUpateallNotAllow.GetString("carColor"); dailyRate = dataForselectCarforUpateallNotAllow.GetString("carDailyRate"); monthlyRate = dataForselectCarforUpateallNotAllow.GetString("carMonthlyRate"); odameterValue = dataForselectCarforUpateallNotAllow.GetString("odometer"); meterTypeOld = dataForselectCarforUpateallNotAllow.GetString("kmmeter_type"); } string canUpdate = "yes"; if (monoFlat_TextBox8.Text.Length < 5 && carS != "OUT" && carIdForBug1 == monoFlat_TextBox9.Text) { ErrorMsgBox er = new ErrorMsgBox("The Odometer must have five digits"); er.Show(); canUpdate = "no"; } if (carId == monoFlat_TextBox1.Text && model == monoFlat_TextBox2.Text && brand == monoFlat_TextBox3.Text && makeYear == monoFlat_TextBox4.Text && color == monoFlat_TextBox5.Text && dailyRate == monoFlat_TextBox6.Text && monthlyRate == monoFlat_TextBox7.Text && odameterValue == monoFlat_TextBox8.Text && carIdForBug1 == monoFlat_TextBox9.Text && carS != "OUT" && meterTypeOld==meterType) { ErrorMsgBox er = new ErrorMsgBox("You did not make any changes to update"); er.Show(); canUpdate = "no"; } if (monoFlat_TextBox1.Text == string.Empty || monoFlat_TextBox2.Text == string.Empty || monoFlat_TextBox3.Text == string.Empty || monoFlat_TextBox4.Text == string.Empty || monoFlat_TextBox5.Text == string.Empty || monoFlat_TextBox6.Text == string.Empty || monoFlat_TextBox7.Text == string.Empty || monoFlat_TextBox8.Text == string.Empty) { ErrorMsgBox er = new ErrorMsgBox("Please Fill all the columns"); er.Show(); } else { if (carIdForBug1 == monoFlat_TextBox9.Text) { if (carS != "OUT") { if (canUpdate == "yes") { string query = "UPDATE car SET carId='" + monoFlat_TextBox1.Text + "', carModel='" + monoFlat_TextBox2.Text + "',carBrand='" + monoFlat_TextBox3.Text + "',carMakeYear='" + monoFlat_TextBox4.Text + "',carColor='" + monoFlat_TextBox5.Text + "',carDailyRate='" + monoFlat_TextBox6.Text + "',carMonthlyRate='" + monoFlat_TextBox7.Text + "',odometer='" + monoFlat_TextBox8.Text + "',kmmeter_type='" + meterType + "' WHERE carId='" + monoFlat_TextBox9.Text + "'"; try { MySqlConnection myConnect = new MySqlConnection("SERVER=localhost;DATABASE=rentcarsystem;UID=root;PASSWORD="); myConnect.Open(); MySqlCommand myCommand = new MySqlCommand(query, myConnect); myCommand.ExecuteNonQuery(); myConnect.Clone(); string pathforLog = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); string txt = "The Car ID " + monoFlat_TextBox1.Text + " was Updated on " + DateTime.Now.ToString("yyyy-MM-dd") + " at " + DateTime.Now.ToLongTimeString(); File.AppendAllText(pathforLog + "//CRMS//ActivityLog.txt", txt + Environment.NewLine); if (comboBox1.Text == "All") { ComboBoxSearch(comboBox1.Text); } else if (comboBox1.Text == "Hired") { ComboBoxSearch(comboBox1.Text); } else if (comboBox1.Text == "Avaliable") { ComboBoxSearch(comboBox1.Text); } else { getDataFromTheDB(); } SuccessMSGBox s = new SuccessMSGBox("Update Successfully"); s.Show(); cleanTextBoxes(); //Clear the Textboxes as empty. } catch (Exception Ex) { string messageFoDuplicatePrimaryKey = Ex.Message; if (messageFoDuplicatePrimaryKey.StartsWith("Duplicate")) { ErrorMsgBox r = new ErrorMsgBox("The car ID " + monoFlat_TextBox1.Text + " is already existed."); r.Show(); } else { MessageBox.Show(Ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } } else { ErrorMsgBox es = new ErrorMsgBox("Car is in renting, unable to make changes"); es.Show(); } } else { ErrorMsgBox es = new ErrorMsgBox("You have entered a wrong car ID. \n" + "We automatically fixed the right ID (" + carIdForBug1 + ")."); es.Show(); monoFlat_TextBox9.Text = carIdForBug1; } } } private void bunifuFlatButton4_Click(object sender, EventArgs e) { string selectCar = "SELECT carStatus FROM car WHERE carId='" + monoFlat_TextBox9.Text + "'"; MySqlDataReader datas = curdClass.SelectQueryOutMsg(selectCar); string carS = ""; while (datas.Read()) { carS = datas.GetString(0); } if (monoFlat_TextBox9.Text == carIdForBug1) { if (carS != "OUT") { ComformFormDelete cfd = new ComformFormDelete("Do you want to delete Car ID '" + monoFlat_TextBox9.Text + "'", "DELETE FROM car WHERE carId='" + monoFlat_TextBox9.Text + "'", monoFlat_TextBox9.Text, "carDeletion"); cfd.ShowDialog(); if (comboBox1.Text == "All") { ComboBoxSearch(comboBox1.Text); } else if (comboBox1.Text == "Hired") { ComboBoxSearch(comboBox1.Text); } else if (comboBox1.Text == "Avaliable") { ComboBoxSearch(comboBox1.Text); } else { getDataFromTheDB(); } string selectCar2 = "SELECT carId FROM car WHERE carId='" + monoFlat_TextBox9.Text + "'"; MySqlDataReader datas2 = curdClass.SelectQueryOutMsg(selectCar2); string carS2 = ""; while (datas2.Read()) { carS2 = datas2.GetString(0); } if (carS2 == string.Empty) { cleanTextBoxes(); } } else { ErrorMsgBox es = new ErrorMsgBox("Car is in renting, unable to delete"); es.Show(); } } else { ErrorMsgBox es = new ErrorMsgBox("You have entered a wrong car ID. \n" + "We automatically fixed the right ID (" + carIdForBug1 + ")."); es.Show(); monoFlat_TextBox9.Text = carIdForBug1; } } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { //Search the database bashed on comboBox1 Text like Hire All and Etc. if (comboBox1.Text == "All") { //in this case text All. ComboBoxSearch(comboBox1.Text); } else if (comboBox1.Text == "Hired") { //in this case text Hired. ComboBoxSearch(comboBox1.Text); } else if (comboBox1.Text == "Avaliable") { //in this case text Avaliable. ComboBoxSearch(comboBox1.Text); } } private void bunifuTextbox1_OnTextChange(object sender, EventArgs e) { //When the user entering the Car brand we need to update the GridView. //But in this case we are sending what is it being typed in the bunifuTextbox1. //according to the text the DataGridView will be updated. if (bunifuTextbox1.text == string.Empty) { ComboBoxSearch(comboBox1.Text); } else { if (bunifuTextbox1.text != "All" && bunifuTextbox1.text != "Hired" && bunifuTextbox1.text!="Avaliable") { ComboBoxSearch(bunifuTextbox1.text); } if (System.Text.RegularExpressions.Regex.IsMatch(bunifuTextbox1.text, @"[^a-zA-Z \s]")) { char[] chars = bunifuTextbox1.text.ToCharArray(); ErrorMsgBox er = new ErrorMsgBox("The brand name must be in text format.\nNumbers and symbols are not allowed."); er.Show(); string charsToStr = new string(chars); bunifuTextbox1.text = charsToStr.Remove(charsToStr.Length - 1); } } } private void bunifuCustomDataGrid1_CellClick(object sender, DataGridViewCellEventArgs e) { //We are displaying data in the form from the DataGridView in a sense of cell click. string position; string meterType = ""; if (bunifuCustomDataGrid1.CurrentCell.ColumnIndex.Equals(0)) { position = bunifuCustomDataGrid1.CurrentCell.Value.ToString(); string query = "SELECT * FROM car WHERE carId='" + position + "'"; MySqlDataReader data = curdClass.SelectQuery(query); while (data.Read()) { monoFlat_TextBox1.Text = data.GetString(0); monoFlat_TextBox2.Text = data.GetString(1); monoFlat_TextBox3.Text = data.GetString(2); monoFlat_TextBox4.Text = data.GetString(3); monoFlat_TextBox5.Text = data.GetString(4); monoFlat_TextBox6.Text = data.GetString(5); monoFlat_TextBox7.Text = data.GetString(6); monoFlat_TextBox8.Text = data.GetString("odometer"); monoFlat_TextBox9.Text = data.GetString(0); carIdForBug1 = data.GetString(0); meterType = data.GetString("kmmeter_type"); } if (meterType == "Normal") { radioButton1.Checked = true; }else if (meterType == "Digital") { radioButton2.Checked = true; } buttonToGetColor(); } } //Clear TextBoxes Method. public void cleanTextBoxes() { monoFlat_TextBox1.Text = ""; monoFlat_TextBox2.Text = ""; monoFlat_TextBox3.Text = ""; monoFlat_TextBox4.Text = ""; monoFlat_TextBox5.Text = ""; monoFlat_TextBox6.Text = ""; monoFlat_TextBox7.Text = ""; monoFlat_TextBox8.Text = ""; monoFlat_TextBox9.Text = ""; } //Update and Delete Buttons Enabled and Get Color Method. public void buttonToGetColor() { bunifuFlatButton3.Enabled = true; bunifuFlatButton4.Enabled = true; this.bunifuFlatButton4.Iconimage = global::Car_Renting_Management_System.Properties.Resources.if_Remove_27874; this.bunifuFlatButton3.Iconimage = global::Car_Renting_Management_System.Properties.Resources.if_db_update_32131; } //Update and Delete Buttons Disabled and Lost Color Method. public void buttonToGetBlackAndWhite() { bunifuFlatButton3.Enabled = false; bunifuFlatButton4.Enabled = false; this.bunifuFlatButton4.Iconimage = global::Car_Renting_Management_System.Properties.Resources.if_Remove_27874_ConvertImage; ; this.bunifuFlatButton3.Iconimage = global::Car_Renting_Management_System.Properties.Resources.if_db_update_3213_ConvertImage; } //Load data from the database into DataGridView Method. public void getDataFromTheDB() { DataTable data = new DataTable(); data.Columns.Add("Car ID"); data.Columns.Add("Brand"); data.Columns.Add("Model"); data.Columns.Add("Make Year"); data.Columns.Add("Color"); data.Columns.Add("Daily Rate"); data.Columns.Add("Monthly Rate"); data.Columns.Add("Odometer Value"); data.Columns.Add("Status"); data.Columns.Add("Odometer Type"); string querySelect = "SELECT * FROM car"; MySqlDataReader datas = curdClass.SelectQuery(querySelect); while (datas.Read()) { data.Rows.Add(datas.GetString(0), datas.GetString(1), datas.GetString(2), datas.GetString(3), datas.GetString(4), datas.GetString(5), datas.GetString(6), datas.GetString(8),datas.GetString(7),datas.GetString(9)); } bunifuCustomDataGrid1.DataSource = data; } //ComboBoxSearch Method.Like Hire Basics or All and more. public void ComboBoxSearch(string status) { DataTable dTable1 = new DataTable(); dTable1.Columns.Add("Car ID"); dTable1.Columns.Add("Brand"); dTable1.Columns.Add("Model"); dTable1.Columns.Add("Make Year"); dTable1.Columns.Add("Color"); dTable1.Columns.Add("Daily Rate"); dTable1.Columns.Add("Monthly Rate"); dTable1.Columns.Add("Odometer Value"); dTable1.Columns.Add("Status"); dTable1.Columns.Add("Odometer Type"); if (status == "All") { string queryForAll = "SELECT * FROM car"; MySqlDataReader reData = curdClass.SelectQuery(queryForAll); while (reData.Read()) { dTable1.Rows.Add(reData.GetString(0), reData.GetString(1), reData.GetString(2), reData.GetString(3), reData.GetString(4), reData.GetString(5), reData.GetString(6), reData.GetString(8), reData.GetString(7),reData.GetString(9)); } } else if (status == "Hired") { string queryForHired = "SELECT * FROM car WHERE carStatus='OUT'"; MySqlDataReader reData = curdClass.SelectQuery(queryForHired); while (reData.Read()) { dTable1.Rows.Add(reData.GetString(0), reData.GetString(1), reData.GetString(2), reData.GetString(3), reData.GetString(4), reData.GetString(5), reData.GetString(6), reData.GetString(8), reData.GetString(7)); } } else if (status == "Avaliable") { string queryForAvaliable = "SELECT * FROM car WHERE carStatus='IN'"; MySqlDataReader reData = curdClass.SelectQuery(queryForAvaliable); while (reData.Read()) { dTable1.Rows.Add(reData.GetString(0), reData.GetString(1), reData.GetString(2), reData.GetString(3), reData.GetString(4), reData.GetString(5), reData.GetString(6), reData.GetString(8), reData.GetString(7)); } } else { string queryType = ""; string query = ""; if (comboBox1.Text == "All") { query = "SELECT * FROM car WHERE carBrand like'" + status + "%'"; } else if (comboBox1.Text == "Hired") { query = "SELECT * FROM car WHERE carBrand like'" + status + "%' AND carStatus='OUT'"; } else if (comboBox1.Text == "Avaliable") { query = "SELECT * FROM car WHERE carBrand like'" + status + "%' AND carStatus='IN'"; } else { query = "SELECT * FROM car WHERE carBrand like'" + status + "%'"; } string queryForBrand = query; MySqlDataReader dataBrand = curdClass.SelectQuery(queryForBrand); while (dataBrand.Read()) { dTable1.Rows.Add(dataBrand.GetString(0), dataBrand.GetString(1), dataBrand.GetString(2), dataBrand.GetString(3), dataBrand.GetString(4), dataBrand.GetString(5), dataBrand.GetString(6), dataBrand.GetString(8), dataBrand.GetString(7)); } } bunifuCustomDataGrid1.DataSource = dTable1; } private void bunifuFlatButton6_Click(object sender, EventArgs e) { cleanTextBoxes(); buttonToGetBlackAndWhite(); } private void groupBox1_Enter(object sender, EventArgs e) { } private void label3_Click(object sender, EventArgs e) { } private void monoFlat_TextBox9_TextChanged(object sender, EventArgs e) { //If the TextBox9.length is 0 ,change the update and delete buttons to be disabled and black and white. //Becasue we don't need to be enabled when is not updating or deleting. if (monoFlat_TextBox9.Text.Length == 0) { buttonToGetBlackAndWhite(); cleanTextBoxes(); } if (System.Text.RegularExpressions.Regex.IsMatch(monoFlat_TextBox9.Text, @"[!@#$%^&*\~{}.`,\\;=<|>/?+'\""]")) { char[] chars = monoFlat_TextBox9.Text.ToCharArray(); ErrorMsgBox er = new ErrorMsgBox("You cannot enter symbols like " + chars[chars.Length - 1]); er.Show(); string charsToStr = new string(chars); monoFlat_TextBox9.Text = charsToStr.Remove(charsToStr.Length - 1); } } private void monoFlat_TextBox4_TextChanged(object sender, EventArgs e) { if (System.Text.RegularExpressions.Regex.IsMatch(monoFlat_TextBox4.Text, "[^0-9]")) { char[] chars = monoFlat_TextBox4.Text.ToCharArray(); string charsToStr = new string(chars); ErrorMsgBox er = new ErrorMsgBox("The make year must be in digits format.\nLetters and symbols are not allowed."); er.Show(); monoFlat_TextBox4.Text = charsToStr.Remove(charsToStr.Length - 1); } } private void monoFlat_TextBox5_TextChanged(object sender, EventArgs e) { if (System.Text.RegularExpressions.Regex.IsMatch(monoFlat_TextBox5.Text, @"[^a-zA-Z \s]")) { char[] chars = monoFlat_TextBox5.Text.ToCharArray(); string charsToStr = new string(chars); ErrorMsgBox er = new ErrorMsgBox("The color must be in text format.\nNumbers and symbols are not allowed."); er.Show(); monoFlat_TextBox5.Text = charsToStr.Remove(charsToStr.Length - 1); } } private void monoFlat_TextBox6_TextChanged(object sender, EventArgs e) { if (System.Text.RegularExpressions.Regex.IsMatch(monoFlat_TextBox6.Text, "[^0-9.]")) { char[] chars = monoFlat_TextBox6.Text.ToCharArray(); string charsToStr = new string(chars); ErrorMsgBox er = new ErrorMsgBox("The daily rate must be in digit format.\nLetters and symbols are not allowed."); er.Show(); monoFlat_TextBox6.Text = charsToStr.Remove(charsToStr.Length - 1); } } private void monoFlat_TextBox7_TextChanged(object sender, EventArgs e) { if (System.Text.RegularExpressions.Regex.IsMatch(monoFlat_TextBox7.Text, "[^0-9.]")) { char[] chars = monoFlat_TextBox7.Text.ToCharArray(); string charsToStr = new string(chars); ErrorMsgBox er = new ErrorMsgBox("The monthly rate must be in digit format.\nLetters and symbols are not allowed."); er.Show(); monoFlat_TextBox7.Text = charsToStr.Remove(charsToStr.Length - 1); } } private void monoFlat_TextBox8_TextChanged(object sender, EventArgs e) { if (System.Text.RegularExpressions.Regex.IsMatch(monoFlat_TextBox8.Text, "[^0-9]")) { char[] chars = monoFlat_TextBox8.Text.ToCharArray(); string charsToStr = new string(chars); ErrorMsgBox er = new ErrorMsgBox("The odometer must be in digit format.\nLetters and symbols are not allowed."); er.Show(); monoFlat_TextBox8.Text = charsToStr.Remove(charsToStr.Length - 1); } } private void groupBox2_Enter(object sender, EventArgs e) { } public void RegisterCarMethod(string query) { try { MySqlConnection myConnect = new MySqlConnection("SERVER=localhost;DATABASE=rentcarsystem;UID=root;PASSWORD="); myConnect.Open(); MySqlCommand myCommand = new MySqlCommand(query, myConnect); myCommand.ExecuteNonQuery(); myConnect.Clone(); string pathforLog = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); string txt = "A new car was registered on " + DateTime.Now.ToString("yyyy-MM-dd") + " at " + DateTime.Now.ToLongTimeString() + " The ID is " + monoFlat_TextBox1.Text; File.AppendAllText(pathforLog + "//CRMS//ActivityLog.txt", txt + Environment.NewLine); SuccessMSGBox s = new SuccessMSGBox("Registered successfully."); s.Show(); getDataFromTheDB(); cleanTextBoxes(); } catch (Exception Ex) { string messageFoDuplicatePrimaryKey = Ex.Message; if (messageFoDuplicatePrimaryKey.StartsWith("Duplicate")) { ErrorMsgBox r = new ErrorMsgBox("The car ID " + monoFlat_TextBox1.Text + " is already existed."); r.Show(); } else { MessageBox.Show(Ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } private void monoFlat_TextBox1_TextChanged(object sender, EventArgs e) { if (System.Text.RegularExpressions.Regex.IsMatch(monoFlat_TextBox1.Text, @"[!@#$%^&*\~{}.`,\\;=<|>/?'\""]")) { char[] chars=monoFlat_TextBox1.Text.ToCharArray(); ErrorMsgBox er = new ErrorMsgBox("You cannot enter symbols like "+chars[chars.Length-1]); er.Show(); string charsToStr = new string(chars); monoFlat_TextBox1.Text = charsToStr.Remove(charsToStr.Length - 1); } } private void monoFlat_TextBox2_TextChanged(object sender, EventArgs e) { if (System.Text.RegularExpressions.Regex.IsMatch(monoFlat_TextBox2.Text, @"[!@#$%^&*\~`{},\\;.=<|>/?'\""]")) { char[] chars = monoFlat_TextBox2.Text.ToCharArray(); ErrorMsgBox er = new ErrorMsgBox("You cannot enter symbols like " + chars[chars.Length - 1]); er.Show(); string charsToStr = new string(chars); monoFlat_TextBox2.Text = charsToStr.Remove(charsToStr.Length - 1); } } private void monoFlat_TextBox3_TextChanged(object sender, EventArgs e) { if (System.Text.RegularExpressions.Regex.IsMatch(monoFlat_TextBox3.Text, @"[^a-zA-Z \s]")) { char[] chars = monoFlat_TextBox3.Text.ToCharArray(); ErrorMsgBox er = new ErrorMsgBox("The brand name must be in text format.\nNumbers and symbols are not allowed."); er.Show(); string charsToStr = new string(chars); monoFlat_TextBox3.Text = charsToStr.Remove(charsToStr.Length - 1); } } private void bunifuCustomDataGrid1_CellContentClick(object sender, DataGridViewCellEventArgs e) { } } }
33.950156
485
0.523246
[ "Apache-2.0" ]
GunaRakulan-GR/car-rental-system
0-project-files/Car_Renting_Management_System/carsForm.cs
32,696
C#
/* * * (c) Copyright Ascensio System Limited 2010-2021 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ namespace ASC.HealthCheck.Models { public enum ServiceEnum { OnlyofficeJabber, OnlyofficeSignalR, OnlyofficeNotify, OnlyofficeBackup, OnlyofficeFeed, OnlyofficeMailAggregator, OnlyofficeMailWatchdog, OnlyofficeAutoreply, OnlyofficeIndex, EditorsFileConverter, EditorsCoAuthoring, EditorsSpellChecker, MiniChat } }
28.972222
75
0.698945
[ "ECL-2.0", "Apache-2.0", "MIT" ]
ONLYOFFICE/CommunityServer
module/ASC.HealthCheck/ASC.HealthCheck/Models/ServiceEnum.cs
1,043
C#
// <auto-generated> // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. // </auto-generated> namespace Microsoft.Azure.Management.Network { using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Threading; using System.Threading.Tasks; /// <summary> /// PeerExpressRouteCircuitConnectionsOperations operations. /// </summary> internal partial class PeerExpressRouteCircuitConnectionsOperations : IServiceOperations<NetworkManagementClient>, IPeerExpressRouteCircuitConnectionsOperations { /// <summary> /// Initializes a new instance of the PeerExpressRouteCircuitConnectionsOperations class. /// </summary> /// <param name='client'> /// Reference to the service client. /// </param> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient client) { if (client == null) { throw new System.ArgumentNullException("client"); } Client = client; } /// <summary> /// Gets a reference to the NetworkManagementClient /// </summary> public NetworkManagementClient Client { get; private set; } /// <summary> /// Gets the specified Peer Express Route Circuit Connection from the specified /// express route circuit. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='circuitName'> /// The name of the express route circuit. /// </param> /// <param name='peeringName'> /// The name of the peering. /// </param> /// <param name='connectionName'> /// The name of the peer express route circuit connection. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<PeerExpressRouteCircuitConnection>> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } if (peeringName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); } if (connectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections/{connectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<PeerExpressRouteCircuitConnection>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<PeerExpressRouteCircuitConnection>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Gets all global reach peer connections associated with a private peering in /// an express route circuit. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='circuitName'> /// The name of the circuit. /// </param> /// <param name='peeringName'> /// The name of the peering. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<IPage<PeerExpressRouteCircuitConnection>>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } if (peeringName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<IPage<PeerExpressRouteCircuitConnection>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<PeerExpressRouteCircuitConnection>>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Gets all global reach peer connections associated with a private peering in /// an express route circuit. /// </summary> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<IPage<PeerExpressRouteCircuitConnection>>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); List<string> _queryParameters = new List<string>(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<IPage<PeerExpressRouteCircuitConnection>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<PeerExpressRouteCircuitConnection>>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } }
45.852941
319
0.567975
[ "MIT" ]
LingyunSu/azure-sdk-for-net
sdk/network/Microsoft.Azure.Management.Network/src/Generated/PeerExpressRouteCircuitConnectionsOperations.cs
29,621
C#
/* * Copyright (C) Sportradar AG. See LICENSE for full license governing this code */ using Dawn; using System.Linq; using Sportradar.OddsFeed.SDK.Entities.REST.Internal.DTO; using Sportradar.OddsFeed.SDK.Entities.REST.Internal.DTO.Lottery; using Sportradar.OddsFeed.SDK.Messages.REST; namespace Sportradar.OddsFeed.SDK.Entities.REST.Internal.Mapping.Lottery { /// <summary> /// A <see cref="ISingleTypeMapper{T}" /> used to map <see cref="lotteries" /> instances to <see cref="EntityList{LotteryDTO}" /> instances /// </summary> /// <seealso cref="ISingleTypeMapper{LotteryDTO}" /> internal class LotteriesMapper : ISingleTypeMapper<EntityList<LotteryDTO>> { /// <summary> /// A <see cref="lotteries"/> containing rest data /// </summary> private readonly lotteries _data; /// <summary> /// Initializes a new instance of the <see cref="LotteriesMapper"/> class /// </summary> /// <param name="lotteries">A <see cref="lottery"/> containing list of lotteries</param> internal LotteriesMapper(lotteries lotteries) { Guard.Argument(lotteries, nameof(lotteries)).NotNull(); _data = lotteries; } public EntityList<LotteryDTO> Map() { var items = _data.lottery.Select(s=> new LotteryDTO(s)).ToList(); return new EntityList<LotteryDTO>(items); } } }
35.02439
143
0.64624
[ "Apache-2.0" ]
Honore-Gaming/UnifiedOddsSdkNetCore
src/Sportradar.OddsFeed.SDK/Entities/REST/Internal/Mapping/Lottery/LotteriesMapper.cs
1,438
C#
using Lucene.Net.Analysis; namespace Lucene.Net.Search.Highlight { /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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. */ /// <summary> <see cref="IFragmenter"/> implementation which does not fragment the text. /// This is useful for highlighting the entire content of a document or field. /// </summary> public class NullFragmenter : IFragmenter { public virtual void Start(string originalText, TokenStream tokenStream) { } public virtual bool IsNewFragment() { return false; } } }
37.942857
92
0.704066
[ "Apache-2.0" ]
DiogenesPolanco/lucenenet
src/Lucene.Net.Highlighter/Highlight/NullFragmenter.cs
1,330
C#
using UnityEngine; using System.Collections; // Object that lists all its children and, when told to, scrolls them public class BackgroundScroller : MonoBehaviour { // Set these through the editor public float begin; public float end; public float scrollSpeed; bool scrolling = false; ArrayList children = new ArrayList(); private class Child { GameObject childObject; // The position FROM WHICH the object should be reset (to the left of the camera) public float resetPosition; // The position TO WHICH the object should be reset (to the right of the camera) public float resetDestination; // The higher the parallax layer, the faster the scroll speed for an object public float parallaxLayer; public Child(GameObject child, float begin, float end) { float spriteWidth = child.GetComponent<SpriteRenderer>().bounds.size.x; childObject = child; resetPosition = begin - spriteWidth / 2; resetDestination = end - spriteWidth / 2; parallaxLayer = child.GetComponent<SpriteRenderer>().sortingOrder; } public Transform GetTransform() { return childObject.transform; } public void ResetPosition() { Vector3 position = childObject.transform.localPosition; position.x = resetDestination + (childObject.transform.localPosition.x - resetPosition); childObject.transform.localPosition = position; } } void Start () { // List every child as a Child object var list = gameObject.GetComponentsInChildren<Transform>(); foreach (Transform t in list) { if (t.gameObject != gameObject) { children.Add(new Child(t.gameObject, begin, end)); } } } void Update () { if (scrolling) { foreach (Child child in children) { child.GetTransform().Translate(-scrollSpeed * child.parallaxLayer * Time.deltaTime, 0, 0, Space.Self); if (child.GetTransform().localPosition.x < child.resetPosition) { child.ResetPosition(); } } } } public void Scroll() { scrolling = true; } public void StopScrolling() { scrolling = false; } }
32
118
0.614443
[ "Apache-2.0" ]
UnBiHealth/fisiogame
Assets/Script/Minigames/BackgroundScroller.cs
2,370
C#
/* * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.Collections.Generic; using System.Linq; using Moq; using NodaTime; using NUnit.Framework; using QuantConnect.Algorithm; using QuantConnect.Brokerages; using QuantConnect.Brokerages.Backtesting; using QuantConnect.Data; using QuantConnect.Lean.Engine.Results; using QuantConnect.Lean.Engine.TransactionHandlers; using QuantConnect.Orders; using QuantConnect.Securities; using QuantConnect.Data.Market; using QuantConnect.Interfaces; using QuantConnect.Packets; using QuantConnect.Util; using HistoryRequest = QuantConnect.Data.HistoryRequest; namespace QuantConnect.Tests.Engine.BrokerageTransactionHandlerTests { [TestFixture] class BrokerageTransactionHandlerTests { private const string Ticker = "EURUSD"; private TestAlgorithm _algorithm; [SetUp] public void Initialize() { _algorithm = new TestAlgorithm { HistoryProvider = new EmptyHistoryProvider() }; _algorithm.SetBrokerageModel(BrokerageName.FxcmBrokerage); _algorithm.SetCash(100000); _algorithm.AddSecurity(SecurityType.Forex, Ticker); _algorithm.SetFinishedWarmingUp(); } [Test] public void OrderQuantityIsFlooredToNearestMultipleOfLotSizeWhenLongOrderIsRounded() { //Initializes the transaction handler var transactionHandler = new BrokerageTransactionHandler(); transactionHandler.Initialize(_algorithm, new BacktestingBrokerage(_algorithm), new BacktestingResultHandler()); // Creates the order var security = _algorithm.Securities[Ticker]; var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1600, 0, 0, DateTime.Now, ""); // Mock the the order processor var orderProcessorMock = new Mock<IOrderProcessor>(); orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest)); _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object); // Act var orderTicket = transactionHandler.Process(orderRequest); Assert.IsTrue(orderTicket.Status == OrderStatus.New); transactionHandler.HandleOrderRequest(orderRequest); // Assert Assert.IsTrue(orderRequest.Response.IsProcessed); Assert.IsTrue(orderRequest.Response.IsSuccess); Assert.IsTrue(orderTicket.Status == OrderStatus.Submitted); // 1600 after round off becomes 1000 Assert.AreEqual(1000, orderTicket.Quantity); } [Test] public void OrderQuantityIsCeiledToNearestMultipleOfLotSizeWhenShortOrderIsRounded() { //Initializes the transaction handler var transactionHandler = new BrokerageTransactionHandler(); transactionHandler.Initialize(_algorithm, new BacktestingBrokerage(_algorithm), new BacktestingResultHandler()); // Creates the order var security = _algorithm.Securities[Ticker]; var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, -1600, 0, 0, DateTime.Now, ""); // Mock the the order processor var orderProcessorMock = new Mock<IOrderProcessor>(); orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest)); _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object); // Act var orderTicket = transactionHandler.Process(orderRequest); Assert.IsTrue(orderTicket.Status == OrderStatus.New); transactionHandler.HandleOrderRequest(orderRequest); // Assert Assert.IsTrue(orderRequest.Response.IsProcessed); Assert.IsTrue(orderRequest.Response.IsSuccess); Assert.IsTrue(orderTicket.Status == OrderStatus.Submitted); // -1600 after round off becomes -1000 Assert.AreEqual(-1000, orderTicket.Quantity); } [Test] public void OrderIsNotPlacedWhenOrderIsLowerThanLotSize() { //Initializes the transaction handler var transactionHandler = new BrokerageTransactionHandler(); transactionHandler.Initialize(_algorithm, new BacktestingBrokerage(_algorithm), new BacktestingResultHandler()); // Creates the order var security = _algorithm.Securities[Ticker]; var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 600, 0, 0, DateTime.Now, ""); // Mock the the order processor var orderProcessorMock = new Mock<IOrderProcessor>(); orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest)); _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object); // Act var orderTicket = transactionHandler.Process(orderRequest); Assert.IsTrue(orderTicket.Status == OrderStatus.New); transactionHandler.HandleOrderRequest(orderRequest); // 600 after round off becomes 0 -> order is not placed Assert.IsTrue(orderRequest.Response.IsProcessed); Assert.IsTrue(orderRequest.Response.IsError); Assert.IsTrue(orderTicket.Status == OrderStatus.Invalid); } [Test] public void LimitOrderPriceIsRounded() { //Initializes the transaction handler var transactionHandler = new BrokerageTransactionHandler(); transactionHandler.Initialize(_algorithm, new BacktestingBrokerage(_algorithm), new BacktestingResultHandler()); // Creates the order var security = _algorithm.Securities[Ticker]; var price = 1.12129m; security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price)); var orderRequest = new SubmitOrderRequest(OrderType.Limit, security.Type, security.Symbol, 1600, 1.12121212m, 1.12121212m, DateTime.Now, ""); // Mock the the order processor var orderProcessorMock = new Mock<IOrderProcessor>(); orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest)); _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object); // Act var orderTicket = transactionHandler.Process(orderRequest); Assert.IsTrue(orderTicket.Status == OrderStatus.New); transactionHandler.HandleOrderRequest(orderRequest); // Assert Assert.IsTrue(orderRequest.Response.IsProcessed); Assert.IsTrue(orderRequest.Response.IsSuccess); Assert.IsTrue(orderTicket.Status == OrderStatus.Submitted); // 1600 after round off becomes 1000 Assert.AreEqual(1000, orderTicket.Quantity); // 1.12121212 after round becomes 1.12121 Assert.AreEqual(1.12121m, orderTicket.Get(OrderField.LimitPrice)); } [Test] public void StopMarketOrderPriceIsRounded() { //Initializes the transaction handler var transactionHandler = new BrokerageTransactionHandler(); transactionHandler.Initialize(_algorithm, new BacktestingBrokerage(_algorithm), new BacktestingResultHandler()); // Creates the order var security = _algorithm.Securities[Ticker]; var price = 1.12129m; security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price)); var orderRequest = new SubmitOrderRequest(OrderType.StopMarket, security.Type, security.Symbol, 1600, 1.12131212m, 1.12131212m, DateTime.Now, ""); // Mock the the order processor var orderProcessorMock = new Mock<IOrderProcessor>(); orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest)); _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object); // Act var orderTicket = transactionHandler.Process(orderRequest); Assert.IsTrue(orderTicket.Status == OrderStatus.New); transactionHandler.HandleOrderRequest(orderRequest); // Assert Assert.IsTrue(orderRequest.Response.IsProcessed); Assert.IsTrue(orderRequest.Response.IsSuccess); Assert.IsTrue(orderTicket.Status == OrderStatus.Submitted); // 1600 after round off becomes 1000 Assert.AreEqual(1000, orderTicket.Quantity); // 1.12131212 after round becomes 1.12131 Assert.AreEqual(1.12131m, orderTicket.Get(OrderField.StopPrice)); } [Test] public void OrderCancellationTransitionsThroughCancelPendingStatus() { // Initializes the transaction handler var transactionHandler = new TestBrokerageTransactionHandler(); transactionHandler.Initialize(_algorithm, new BacktestingBrokerage(_algorithm), new BacktestingResultHandler()); // Creates a limit order var security = _algorithm.Securities[Ticker]; var price = 1.12m; security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price)); var orderRequest = new SubmitOrderRequest(OrderType.Limit, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, ""); // Mock the the order processor var orderProcessorMock = new Mock<IOrderProcessor>(); orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest)); _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object); // Submit and process a limit order var orderTicket = transactionHandler.Process(orderRequest); transactionHandler.HandleOrderRequest(orderRequest); Assert.IsTrue(orderRequest.Response.IsProcessed); Assert.IsTrue(orderRequest.Response.IsSuccess); Assert.IsTrue(orderTicket.Status == OrderStatus.Submitted); // Cancel the order var cancelRequest = new CancelOrderRequest(DateTime.Now, orderTicket.OrderId, ""); transactionHandler.Process(cancelRequest); Assert.IsTrue(cancelRequest.Response.IsProcessed); Assert.IsTrue(cancelRequest.Response.IsSuccess); Assert.IsTrue(cancelRequest.Status == OrderRequestStatus.Processing); Assert.IsTrue(orderTicket.Status == OrderStatus.CancelPending); Assert.AreEqual(transactionHandler.CancelPendingOrdersSize, 1); transactionHandler.HandleOrderRequest(cancelRequest); Assert.IsTrue(cancelRequest.Response.IsProcessed); Assert.IsTrue(cancelRequest.Response.IsSuccess); Assert.IsTrue(cancelRequest.Status == OrderRequestStatus.Processed); Assert.IsTrue(orderTicket.Status == OrderStatus.Canceled); Assert.AreEqual(transactionHandler.CancelPendingOrdersSize, 0); // Check CancelPending was sent Assert.AreEqual(_algorithm.OrderEvents.Count, 3); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Submitted), 1); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.CancelPending), 1); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Canceled), 1); } [Test] public void RoundOff_Long_Fractional_Orders() { var algo = new QCAlgorithm(); algo.SetBrokerageModel(BrokerageName.Default); algo.SetCash(100000); // Sets the Security var security = algo.AddSecurity(SecurityType.Crypto, "BTCUSD", Resolution.Hour, Market.GDAX, false, 3.3m, true); //Initializes the transaction handler var transactionHandler = new BrokerageTransactionHandler(); transactionHandler.Initialize(algo, new BacktestingBrokerage(algo), new BacktestingResultHandler()); // Creates the order var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 123.123456789m, 0, 0, DateTime.Now, ""); var order = Order.CreateOrder(orderRequest); var actual = transactionHandler.RoundOffOrder(order, security); Assert.AreEqual(123.12345678m, actual); } [Test] public void RoundOff_Short_Fractional_Orders() { var algo = new QCAlgorithm(); algo.SetBrokerageModel(BrokerageName.Default); algo.SetCash(100000); // Sets the Security var security = algo.AddSecurity(SecurityType.Crypto, "BTCUSD", Resolution.Hour, Market.GDAX, false, 3.3m, true); //Initializes the transaction handler var transactionHandler = new BrokerageTransactionHandler(); transactionHandler.Initialize(algo, new BacktestingBrokerage(algo), new BacktestingResultHandler()); // Creates the order var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, -123.123456789m, 0, 0, DateTime.Now, ""); var order = Order.CreateOrder(orderRequest); var actual = transactionHandler.RoundOffOrder(order, security); Assert.AreEqual(-123.12345678m, actual); } [Test] public void RoundOff_LessThanLotSize_Fractional_Orders() { var algo = new QCAlgorithm(); algo.SetBrokerageModel(BrokerageName.Default); algo.SetCash(100000); // Sets the Security var security = algo.AddSecurity(SecurityType.Crypto, "BTCUSD", Resolution.Hour, Market.GDAX, false, 3.3m, true); //Initializes the transaction handler var transactionHandler = new BrokerageTransactionHandler(); transactionHandler.Initialize(algo, new BacktestingBrokerage(algo), new BacktestingResultHandler()); // Creates the order var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 0.000000009m, 0, 0, DateTime.Now, ""); var order = Order.CreateOrder(orderRequest); var actual = transactionHandler.RoundOffOrder(order, security); Assert.AreEqual(0, actual); } [Test] public void InvalidUpdateOrderRequestShouldNotInvalidateOrder() { // Initializes the transaction handler var transactionHandler = new BrokerageTransactionHandler(); transactionHandler.Initialize(_algorithm, new BacktestingBrokerage(_algorithm), new BacktestingResultHandler()); _algorithm.SetBrokerageModel(new TestBrokerageModel()); // Creates a limit order var security = _algorithm.Securities[Ticker]; var price = 1.12m; security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price)); var orderRequest = new SubmitOrderRequest(OrderType.Limit, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, ""); // Mock the the order processor var orderProcessorMock = new Mock<IOrderProcessor>(); orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest)); _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object); // Submit and process a limit order var orderTicket = transactionHandler.Process(orderRequest); transactionHandler.HandleOrderRequest(orderRequest); Assert.IsTrue(orderRequest.Response.IsProcessed); Assert.IsTrue(orderRequest.Response.IsSuccess); Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted); var updateRequest = new UpdateOrderRequest(DateTime.Now, orderTicket.OrderId, new UpdateOrderFields()); transactionHandler.Process(updateRequest); Assert.AreEqual(updateRequest.Status, OrderRequestStatus.Processing); Assert.IsTrue(updateRequest.Response.IsSuccess); Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted); transactionHandler.HandleOrderRequest(updateRequest); Assert.IsFalse(updateRequest.Response.ErrorMessage.IsNullOrEmpty()); Assert.IsTrue(updateRequest.Response.IsError); Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted); Assert.AreEqual(_algorithm.OrderEvents.Count, 2); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Message.Contains("unable to update order")), 1); Assert.IsTrue(_algorithm.OrderEvents.TrueForAll(orderEvent => orderEvent.Status == OrderStatus.Submitted)); } [Test] public void UpdateOrderRequestShouldWork() { // Initializes the transaction handler var transactionHandler = new BrokerageTransactionHandler(); transactionHandler.Initialize(_algorithm, new BacktestingBrokerage(_algorithm), new BacktestingResultHandler()); // Creates a limit order var security = _algorithm.Securities[Ticker]; var price = 1.12m; security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price)); var orderRequest = new SubmitOrderRequest(OrderType.Limit, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, ""); // Mock the the order processor var orderProcessorMock = new Mock<IOrderProcessor>(); orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest)); _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object); // Submit and process a limit order var orderTicket = transactionHandler.Process(orderRequest); transactionHandler.HandleOrderRequest(orderRequest); Assert.IsTrue(orderRequest.Response.IsProcessed); Assert.IsTrue(orderRequest.Response.IsSuccess); Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted); var updateRequest = new UpdateOrderRequest(DateTime.Now, orderTicket.OrderId, new UpdateOrderFields()); transactionHandler.Process(updateRequest); Assert.AreEqual(updateRequest.Status, OrderRequestStatus.Processing); Assert.IsTrue(updateRequest.Response.IsSuccess); Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted); transactionHandler.HandleOrderRequest(updateRequest); Assert.IsTrue(updateRequest.Response.IsSuccess); Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted); Assert.AreEqual(_algorithm.OrderEvents.Count, 2); Assert.IsTrue(_algorithm.OrderEvents.TrueForAll(orderEvent => orderEvent.Status == OrderStatus.Submitted)); } [Test] public void UpdateOrderRequestShouldFailForFilledOrder() { // Initializes the transaction handler var transactionHandler = new BrokerageTransactionHandler(); var broker = new BacktestingBrokerage(_algorithm); transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler()); // Creates a limit order var security = _algorithm.Securities[Ticker]; var price = 1.12m; security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price)); var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, ""); // Mock the the order processor var orderProcessorMock = new Mock<IOrderProcessor>(); orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest)); _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object); // Submit and process a limit order var orderTicket = transactionHandler.Process(orderRequest); transactionHandler.HandleOrderRequest(orderRequest); Assert.IsTrue(orderRequest.Response.IsProcessed); Assert.IsTrue(orderRequest.Response.IsSuccess); Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted); broker.Scan(); Assert.AreEqual(orderTicket.Status, OrderStatus.Filled); var updateRequest = new UpdateOrderRequest(DateTime.Now, orderTicket.OrderId, new UpdateOrderFields()); transactionHandler.Process(updateRequest); Assert.AreEqual(updateRequest.Status, OrderRequestStatus.Error); Assert.IsTrue(updateRequest.Response.IsError); Assert.AreEqual(updateRequest.Response.ErrorCode, OrderResponseErrorCode.InvalidOrderStatus); Assert.AreEqual(orderTicket.Status, OrderStatus.Filled); Assert.AreEqual(_algorithm.OrderEvents.Count, 2); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Submitted), 1); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Filled), 1); } [Test] public void CancelOrderRequestShouldFailForFilledOrder() { // Initializes the transaction handler var transactionHandler = new BrokerageTransactionHandler(); var broker = new BacktestingBrokerage(_algorithm); transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler()); var security = _algorithm.Securities[Ticker]; var price = 1.12m; security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price)); var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, ""); // Mock the the order processor var orderProcessorMock = new Mock<IOrderProcessor>(); orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest)); _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object); var orderTicket = transactionHandler.Process(orderRequest); transactionHandler.HandleOrderRequest(orderRequest); Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted); broker.Scan(); Assert.AreEqual(orderTicket.Status, OrderStatus.Filled); var cancelRequest = new CancelOrderRequest(DateTime.Now, orderTicket.OrderId, ""); transactionHandler.Process(cancelRequest); Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Error); Assert.IsTrue(cancelRequest.Response.IsError); Assert.AreEqual(cancelRequest.Response.ErrorCode, OrderResponseErrorCode.InvalidOrderStatus); Assert.AreEqual(orderTicket.Status, OrderStatus.Filled); Assert.AreEqual(_algorithm.OrderEvents.Count, 2); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Submitted), 1); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Filled), 1); } [Test] public void SyncFailedCancelOrderRequestShouldUpdateOrderStatusCorrectly() { // Initializes the transaction handler var transactionHandler = new TestBrokerageTransactionHandler(); var broker = new TestBroker(_algorithm, false); transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler()); var security = _algorithm.Securities[Ticker]; var price = 1.12m; security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price)); var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, ""); // Mock the the order processor var orderProcessorMock = new Mock<IOrderProcessor>(); orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest)); _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object); var orderTicket = transactionHandler.Process(orderRequest); transactionHandler.HandleOrderRequest(orderRequest); Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted); var cancelRequest = new CancelOrderRequest(DateTime.Now, orderTicket.OrderId, ""); Assert.AreEqual(transactionHandler.CancelPendingOrdersSize, 0); transactionHandler.Process(cancelRequest); Assert.AreEqual(transactionHandler.CancelPendingOrdersSize, 1); Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Processing); Assert.IsTrue(cancelRequest.Response.IsSuccess); Assert.AreEqual(orderTicket.Status, OrderStatus.CancelPending); transactionHandler.HandleOrderRequest(cancelRequest); Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted); Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Error); Assert.IsTrue(cancelRequest.Response.IsProcessed); Assert.IsTrue(cancelRequest.Response.IsError); Assert.IsTrue(cancelRequest.Response.ErrorMessage.Contains("Brokerage failed to cancel order")); Assert.AreEqual(transactionHandler.CancelPendingOrdersSize, 0); Assert.AreEqual(_algorithm.OrderEvents.Count, 2); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.CancelPending), 1); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Submitted), 1); } [Test] public void AsyncFailedCancelOrderRequestShouldUpdateOrderStatusCorrectly() { // Initializes the transaction handler var transactionHandler = new TestBrokerageTransactionHandler(); var broker = new TestBroker(_algorithm, true); transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler()); var security = _algorithm.Securities[Ticker]; var price = 1.12m; security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price)); var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, ""); // Mock the the order processor var orderProcessorMock = new Mock<IOrderProcessor>(); orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest)); _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object); var orderTicket = transactionHandler.Process(orderRequest); transactionHandler.HandleOrderRequest(orderRequest); Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted); var cancelRequest = new CancelOrderRequest(DateTime.Now, orderTicket.OrderId, ""); Assert.AreEqual(transactionHandler.CancelPendingOrdersSize, 0); transactionHandler.Process(cancelRequest); Assert.AreEqual(transactionHandler.CancelPendingOrdersSize, 1); Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Processing); Assert.IsTrue(cancelRequest.Response.IsSuccess); Assert.AreEqual(orderTicket.Status, OrderStatus.CancelPending); transactionHandler.HandleOrderRequest(cancelRequest); Assert.AreEqual(orderTicket.Status, OrderStatus.CancelPending); Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Processed); Assert.IsTrue(cancelRequest.Response.IsProcessed); Assert.IsFalse(cancelRequest.Response.IsError); Assert.AreEqual(transactionHandler.CancelPendingOrdersSize, 1); broker.Scan(); Assert.AreEqual(orderTicket.Status, OrderStatus.Filled); Assert.AreEqual(transactionHandler.CancelPendingOrdersSize, 0); Assert.AreEqual(_algorithm.OrderEvents.Count, 3); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.CancelPending), 1); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Submitted), 1); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Filled), 1); } [Test] public void AsyncFailedCancelOrderRequestShouldUpdateOrderStatusCorrectlyWithIntermediateUpdate() { // Initializes the transaction handler var transactionHandler = new TestBrokerageTransactionHandler(); var broker = new TestBroker(_algorithm, true); transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler()); var security = _algorithm.Securities[Ticker]; var price = 1.12m; security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price)); var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, ""); // Mock the the order processor var orderProcessorMock = new Mock<IOrderProcessor>(); orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest)); _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object); var orderTicket = transactionHandler.Process(orderRequest); transactionHandler.HandleOrderRequest(orderRequest); Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted); var cancelRequest = new CancelOrderRequest(DateTime.Now, orderTicket.OrderId, ""); Assert.AreEqual(transactionHandler.CancelPendingOrdersSize, 0); transactionHandler.Process(cancelRequest); Assert.AreEqual(transactionHandler.CancelPendingOrdersSize, 1); Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Processing); Assert.IsTrue(cancelRequest.Response.IsSuccess); Assert.AreEqual(orderTicket.Status, OrderStatus.CancelPending); broker.Scan(); Assert.AreEqual(orderTicket.Status, OrderStatus.Filled); transactionHandler.HandleOrderRequest(cancelRequest); Assert.AreEqual(transactionHandler.CancelPendingOrdersSize, 0); Assert.AreEqual(orderTicket.Status, OrderStatus.Filled); Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Error); Assert.IsTrue(cancelRequest.Response.IsProcessed); Assert.IsTrue(cancelRequest.Response.IsError); Assert.AreEqual(cancelRequest.Response.ErrorCode, OrderResponseErrorCode.InvalidOrderStatus); Assert.AreEqual(_algorithm.OrderEvents.Count, 3); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.CancelPending), 1); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Submitted), 1); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Filled), 1); } [Test] public void SyncFailedCancelOrderRequestShouldUpdateOrderStatusCorrectlyWithIntermediateUpdate() { // Initializes the transaction handler var transactionHandler = new TestBrokerageTransactionHandler(); var broker = new TestBroker(_algorithm, false); transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler()); var security = _algorithm.Securities[Ticker]; var price = 1.12m; security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price)); var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, ""); // Mock the the order processor var orderProcessorMock = new Mock<IOrderProcessor>(); orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest)); _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object); var orderTicket = transactionHandler.Process(orderRequest); transactionHandler.HandleOrderRequest(orderRequest); Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted); var cancelRequest = new CancelOrderRequest(DateTime.Now, orderTicket.OrderId, ""); Assert.AreEqual(transactionHandler.CancelPendingOrdersSize, 0); transactionHandler.Process(cancelRequest); Assert.AreEqual(transactionHandler.CancelPendingOrdersSize, 1); Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Processing); Assert.IsTrue(cancelRequest.Response.IsSuccess); Assert.AreEqual(orderTicket.Status, OrderStatus.CancelPending); broker.Scan(); Assert.AreEqual(orderTicket.Status, OrderStatus.Filled); transactionHandler.HandleOrderRequest(cancelRequest); Assert.AreEqual(transactionHandler.CancelPendingOrdersSize, 0); Assert.AreEqual(orderTicket.Status, OrderStatus.Filled); Assert.AreEqual(cancelRequest.Status, OrderRequestStatus.Error); Assert.IsTrue(cancelRequest.Response.IsProcessed); Assert.IsTrue(cancelRequest.Response.IsError); Assert.AreEqual(cancelRequest.Response.ErrorCode, OrderResponseErrorCode.InvalidOrderStatus); Assert.AreEqual(_algorithm.OrderEvents.Count, 3); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.CancelPending), 1); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Submitted), 1); Assert.AreEqual(_algorithm.OrderEvents.Count(orderEvent => orderEvent.Status == OrderStatus.Filled), 1); } [Test] public void UpdateOrderRequestShouldFailForInvalidOrderId() { // Initializes the transaction handler var transactionHandler = new BrokerageTransactionHandler(); transactionHandler.Initialize(_algorithm, new BacktestingBrokerage(_algorithm), new BacktestingResultHandler()); var updateRequest = new UpdateOrderRequest(DateTime.Now, -10, new UpdateOrderFields()); transactionHandler.Process(updateRequest); Assert.AreEqual(updateRequest.Status, OrderRequestStatus.Error); Assert.IsTrue(updateRequest.Response.IsError); Assert.IsTrue(_algorithm.OrderEvents.IsNullOrEmpty()); } [Test] public void GetOpenOrdersWorksForSubmittedFilledStatus() { // Initializes the transaction handler var transactionHandler = new BrokerageTransactionHandler(); var broker = new BacktestingBrokerage(_algorithm); transactionHandler.Initialize(_algorithm, broker, new BacktestingResultHandler()); // Creates a limit order var security = _algorithm.Securities[Ticker]; var price = 1.12m; security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price)); var orderRequest = new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, ""); // Mock the the order processor var orderProcessorMock = new Mock<IOrderProcessor>(); orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest)); _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object); Assert.AreEqual(transactionHandler.GetOpenOrders().Count, 0); // Submit and process a limit order var orderTicket = transactionHandler.Process(orderRequest); transactionHandler.HandleOrderRequest(orderRequest); Assert.AreEqual(orderTicket.Status, OrderStatus.Submitted); var openOrders = transactionHandler.GetOpenOrders(); Assert.AreEqual(openOrders.Count, 1); Assert.AreEqual(openOrders[0].Id, orderTicket.OrderId); broker.Scan(); Assert.AreEqual(orderTicket.Status, OrderStatus.Filled); Assert.AreEqual(transactionHandler.GetOpenOrders().Count, 0); } [Test] public void GetOpenOrdersWorksForCancelPendingCanceledStatus() { // Initializes the transaction handler var transactionHandler = new BrokerageTransactionHandler(); transactionHandler.Initialize(_algorithm, new BacktestingBrokerage(_algorithm), new BacktestingResultHandler()); // Creates a limit order var security = _algorithm.Securities[Ticker]; var price = 1.12m; security.SetMarketPrice(new Tick(DateTime.Now, security.Symbol, price, price, price)); var orderRequest = new SubmitOrderRequest(OrderType.Limit, security.Type, security.Symbol, 1000, 0, 1.11m, DateTime.Now, ""); // Mock the the order processor var orderProcessorMock = new Mock<IOrderProcessor>(); orderProcessorMock.Setup(m => m.GetOrderTicket(It.IsAny<int>())).Returns(new OrderTicket(_algorithm.Transactions, orderRequest)); _algorithm.Transactions.SetOrderProcessor(orderProcessorMock.Object); Assert.AreEqual(transactionHandler.GetOpenOrders().Count, 0); // Submit and process a limit order var orderTicket = transactionHandler.Process(orderRequest); transactionHandler.HandleOrderRequest(orderRequest); Assert.IsTrue(orderTicket.Status == OrderStatus.Submitted); var openOrders = transactionHandler.GetOpenOrders(); Assert.AreEqual(openOrders.Count, 1); Assert.AreEqual(openOrders[0].Id, orderTicket.OrderId); // Cancel the order var cancelRequest = new CancelOrderRequest(DateTime.Now, orderTicket.OrderId, ""); transactionHandler.Process(cancelRequest); Assert.IsTrue(orderTicket.Status == OrderStatus.CancelPending); openOrders = transactionHandler.GetOpenOrders(); Assert.AreEqual(openOrders.Count, 1); Assert.AreEqual(openOrders[0].Id, orderTicket.OrderId); transactionHandler.HandleOrderRequest(cancelRequest); Assert.IsTrue(orderTicket.Status == OrderStatus.Canceled); Assert.AreEqual(transactionHandler.GetOpenOrders().Count, 0); } internal class EmptyHistoryProvider : IHistoryProvider { public int DataPointCount { get { return 0; } } public void Initialize(AlgorithmNodePacket job, IDataProvider dataProvider, IDataCacheProvider dataCacheProvider, IMapFileProvider mapFileProvider, IFactorFileProvider factorFileProvider, Action<int> statusUpdate) { } public IEnumerable<Slice> GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone) { return Enumerable.Empty<Slice>(); } } internal class TestBrokerageModel : DefaultBrokerageModel { public override bool CanUpdateOrder(Security security, Order order, UpdateOrderRequest request, out BrokerageMessageEvent message) { message = new BrokerageMessageEvent(0, 0, ""); return false; } } internal class TestAlgorithm : QCAlgorithm { public List<OrderEvent> OrderEvents = new List<OrderEvent>(); public override void OnOrderEvent(OrderEvent orderEvent) { OrderEvents.Add(orderEvent); } } internal class TestBroker : BacktestingBrokerage { private readonly bool _cancelOrderResult; public TestBroker(IAlgorithm algorithm, bool cancelOrderResult) : base(algorithm) { _cancelOrderResult = cancelOrderResult; } public override bool CancelOrder(Order order) { return _cancelOrderResult; } } internal class TestBrokerageTransactionHandler : BrokerageTransactionHandler { public int CancelPendingOrdersSize => _cancelPendingOrders.GetCancelPendingOrdersSize; } } }
52.655087
225
0.680961
[ "Apache-2.0" ]
PracplayLLC/Lean
Tests/Engine/BrokerageTransactionHandlerTests/BrokerageTransactionHandlerTests.cs
42,442
C#
// <auto-generated /> using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using TestApp.EntityFrameworkCore; namespace TestApp.Migrations { [DbContext(typeof(TestAppDbContext))] [Migration("20201111192402_Update-order2")] partial class Updateorder2 { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "3.1.9") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("Abp.Application.Editions.Edition", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<long?>("DeleterUserId") .HasColumnType("bigint"); b.Property<DateTime?>("DeletionTime") .HasColumnType("datetime2"); b.Property<string>("DisplayName") .IsRequired() .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<DateTime?>("LastModificationTime") .HasColumnType("datetime2"); b.Property<long?>("LastModifierUserId") .HasColumnType("bigint"); b.Property<string>("Name") .IsRequired() .HasColumnType("nvarchar(32)") .HasMaxLength(32); b.HasKey("Id"); b.ToTable("AbpEditions"); }); modelBuilder.Entity("Abp.Application.Features.FeatureSetting", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<string>("Discriminator") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property<string>("Name") .IsRequired() .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<string>("Value") .IsRequired() .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); b.HasKey("Id"); b.ToTable("AbpFeatures"); b.HasDiscriminator<string>("Discriminator").HasValue("FeatureSetting"); }); modelBuilder.Entity("Abp.Auditing.AuditLog", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("BrowserInfo") .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property<string>("ClientIpAddress") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("ClientName") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("CustomData") .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); b.Property<string>("Exception") .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); b.Property<int>("ExecutionDuration") .HasColumnType("int"); b.Property<DateTime>("ExecutionTime") .HasColumnType("datetime2"); b.Property<int?>("ImpersonatorTenantId") .HasColumnType("int"); b.Property<long?>("ImpersonatorUserId") .HasColumnType("bigint"); b.Property<string>("MethodName") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("Parameters") .HasColumnType("nvarchar(1024)") .HasMaxLength(1024); b.Property<string>("ReturnValue") .HasColumnType("nvarchar(max)"); b.Property<string>("ServiceName") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<long?>("UserId") .HasColumnType("bigint"); b.HasKey("Id"); b.HasIndex("TenantId", "ExecutionDuration"); b.HasIndex("TenantId", "ExecutionTime"); b.HasIndex("TenantId", "UserId"); b.ToTable("AbpAuditLogs"); }); modelBuilder.Entity("Abp.Authorization.PermissionSetting", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<string>("Discriminator") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property<bool>("IsGranted") .HasColumnType("bit"); b.Property<string>("Name") .IsRequired() .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<int?>("TenantId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("TenantId", "Name"); b.ToTable("AbpPermissions"); b.HasDiscriminator<string>("Discriminator").HasValue("PermissionSetting"); }); modelBuilder.Entity("Abp.Authorization.Roles.RoleClaim", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("ClaimType") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("ClaimValue") .HasColumnType("nvarchar(max)"); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<int>("RoleId") .HasColumnType("int"); b.Property<int?>("TenantId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("RoleId"); b.HasIndex("TenantId", "ClaimType"); b.ToTable("AbpRoleClaims"); }); modelBuilder.Entity("Abp.Authorization.Users.UserAccount", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<long?>("DeleterUserId") .HasColumnType("bigint"); b.Property<DateTime?>("DeletionTime") .HasColumnType("datetime2"); b.Property<string>("EmailAddress") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<DateTime?>("LastModificationTime") .HasColumnType("datetime2"); b.Property<long?>("LastModifierUserId") .HasColumnType("bigint"); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<long>("UserId") .HasColumnType("bigint"); b.Property<long?>("UserLinkId") .HasColumnType("bigint"); b.Property<string>("UserName") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.HasKey("Id"); b.HasIndex("EmailAddress"); b.HasIndex("UserName"); b.HasIndex("TenantId", "EmailAddress"); b.HasIndex("TenantId", "UserId"); b.HasIndex("TenantId", "UserName"); b.ToTable("AbpUserAccounts"); }); modelBuilder.Entity("Abp.Authorization.Users.UserClaim", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("ClaimType") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("ClaimValue") .HasColumnType("nvarchar(max)"); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<long>("UserId") .HasColumnType("bigint"); b.HasKey("Id"); b.HasIndex("UserId"); b.HasIndex("TenantId", "ClaimType"); b.ToTable("AbpUserClaims"); }); modelBuilder.Entity("Abp.Authorization.Users.UserLogin", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("LoginProvider") .IsRequired() .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("ProviderKey") .IsRequired() .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<long>("UserId") .HasColumnType("bigint"); b.HasKey("Id"); b.HasIndex("UserId"); b.HasIndex("TenantId", "UserId"); b.HasIndex("TenantId", "LoginProvider", "ProviderKey"); b.ToTable("AbpUserLogins"); }); modelBuilder.Entity("Abp.Authorization.Users.UserLoginAttempt", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("BrowserInfo") .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property<string>("ClientIpAddress") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("ClientName") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<byte>("Result") .HasColumnType("tinyint"); b.Property<string>("TenancyName") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<long?>("UserId") .HasColumnType("bigint"); b.Property<string>("UserNameOrEmailAddress") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.HasKey("Id"); b.HasIndex("UserId", "TenantId"); b.HasIndex("TenancyName", "UserNameOrEmailAddress", "Result"); b.ToTable("AbpUserLoginAttempts"); }); modelBuilder.Entity("Abp.Authorization.Users.UserOrganizationUnit", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<long>("OrganizationUnitId") .HasColumnType("bigint"); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<long>("UserId") .HasColumnType("bigint"); b.HasKey("Id"); b.HasIndex("TenantId", "OrganizationUnitId"); b.HasIndex("TenantId", "UserId"); b.ToTable("AbpUserOrganizationUnits"); }); modelBuilder.Entity("Abp.Authorization.Users.UserRole", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<int>("RoleId") .HasColumnType("int"); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<long>("UserId") .HasColumnType("bigint"); b.HasKey("Id"); b.HasIndex("UserId"); b.HasIndex("TenantId", "RoleId"); b.HasIndex("TenantId", "UserId"); b.ToTable("AbpUserRoles"); }); modelBuilder.Entity("Abp.Authorization.Users.UserToken", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime?>("ExpireDate") .HasColumnType("datetime2"); b.Property<string>("LoginProvider") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("Name") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<long>("UserId") .HasColumnType("bigint"); b.Property<string>("Value") .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.HasKey("Id"); b.HasIndex("UserId"); b.HasIndex("TenantId", "UserId"); b.ToTable("AbpUserTokens"); }); modelBuilder.Entity("Abp.BackgroundJobs.BackgroundJobInfo", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<bool>("IsAbandoned") .HasColumnType("bit"); b.Property<string>("JobArgs") .IsRequired() .HasColumnType("nvarchar(max)") .HasMaxLength(1048576); b.Property<string>("JobType") .IsRequired() .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property<DateTime?>("LastTryTime") .HasColumnType("datetime2"); b.Property<DateTime>("NextTryTime") .HasColumnType("datetime2"); b.Property<byte>("Priority") .HasColumnType("tinyint"); b.Property<short>("TryCount") .HasColumnType("smallint"); b.HasKey("Id"); b.HasIndex("IsAbandoned", "NextTryTime"); b.ToTable("AbpBackgroundJobs"); }); modelBuilder.Entity("Abp.Configuration.Setting", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<DateTime?>("LastModificationTime") .HasColumnType("datetime2"); b.Property<long?>("LastModifierUserId") .HasColumnType("bigint"); b.Property<string>("Name") .IsRequired() .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<long?>("UserId") .HasColumnType("bigint"); b.Property<string>("Value") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("UserId"); b.HasIndex("TenantId", "Name", "UserId") .IsUnique(); b.ToTable("AbpSettings"); }); modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityProperty", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<int>("DynamicPropertyId") .HasColumnType("int"); b.Property<string>("EntityFullName") .HasColumnType("nvarchar(450)"); b.Property<int?>("TenantId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("DynamicPropertyId"); b.HasIndex("EntityFullName", "DynamicPropertyId", "TenantId") .IsUnique() .HasFilter("[EntityFullName] IS NOT NULL AND [TenantId] IS NOT NULL"); b.ToTable("AbpDynamicEntityProperties"); }); modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityPropertyValue", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<int>("DynamicEntityPropertyId") .HasColumnType("int"); b.Property<string>("EntityId") .HasColumnType("nvarchar(max)"); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<string>("Value") .IsRequired() .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("DynamicEntityPropertyId"); b.ToTable("AbpDynamicEntityPropertyValues"); }); modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicProperty", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("InputType") .HasColumnType("nvarchar(max)"); b.Property<string>("Permission") .HasColumnType("nvarchar(max)"); b.Property<string>("PropertyName") .HasColumnType("nvarchar(450)"); b.Property<int?>("TenantId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("PropertyName", "TenantId") .IsUnique() .HasFilter("[PropertyName] IS NOT NULL AND [TenantId] IS NOT NULL"); b.ToTable("AbpDynamicProperties"); }); modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicPropertyValue", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<int>("DynamicPropertyId") .HasColumnType("int"); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<string>("Value") .IsRequired() .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("DynamicPropertyId"); b.ToTable("AbpDynamicPropertyValues"); }); modelBuilder.Entity("Abp.EntityHistory.EntityChange", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("ChangeTime") .HasColumnType("datetime2"); b.Property<byte>("ChangeType") .HasColumnType("tinyint"); b.Property<long>("EntityChangeSetId") .HasColumnType("bigint"); b.Property<string>("EntityId") .HasColumnType("nvarchar(48)") .HasMaxLength(48); b.Property<string>("EntityTypeFullName") .HasColumnType("nvarchar(192)") .HasMaxLength(192); b.Property<int?>("TenantId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("EntityChangeSetId"); b.HasIndex("EntityTypeFullName", "EntityId"); b.ToTable("AbpEntityChanges"); }); modelBuilder.Entity("Abp.EntityHistory.EntityChangeSet", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("BrowserInfo") .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property<string>("ClientIpAddress") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("ClientName") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<string>("ExtensionData") .HasColumnType("nvarchar(max)"); b.Property<int?>("ImpersonatorTenantId") .HasColumnType("int"); b.Property<long?>("ImpersonatorUserId") .HasColumnType("bigint"); b.Property<string>("Reason") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<long?>("UserId") .HasColumnType("bigint"); b.HasKey("Id"); b.HasIndex("TenantId", "CreationTime"); b.HasIndex("TenantId", "Reason"); b.HasIndex("TenantId", "UserId"); b.ToTable("AbpEntityChangeSets"); }); modelBuilder.Entity("Abp.EntityHistory.EntityPropertyChange", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<long>("EntityChangeId") .HasColumnType("bigint"); b.Property<string>("NewValue") .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property<string>("OriginalValue") .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property<string>("PropertyName") .HasColumnType("nvarchar(96)") .HasMaxLength(96); b.Property<string>("PropertyTypeFullName") .HasColumnType("nvarchar(192)") .HasMaxLength(192); b.Property<int?>("TenantId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("EntityChangeId"); b.ToTable("AbpEntityPropertyChanges"); }); modelBuilder.Entity("Abp.Localization.ApplicationLanguage", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<long?>("DeleterUserId") .HasColumnType("bigint"); b.Property<DateTime?>("DeletionTime") .HasColumnType("datetime2"); b.Property<string>("DisplayName") .IsRequired() .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("Icon") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<bool>("IsDisabled") .HasColumnType("bit"); b.Property<DateTime?>("LastModificationTime") .HasColumnType("datetime2"); b.Property<long?>("LastModifierUserId") .HasColumnType("bigint"); b.Property<string>("Name") .IsRequired() .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<int?>("TenantId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("TenantId", "Name"); b.ToTable("AbpLanguages"); }); modelBuilder.Entity("Abp.Localization.ApplicationLanguageText", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<string>("Key") .IsRequired() .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("LanguageName") .IsRequired() .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<DateTime?>("LastModificationTime") .HasColumnType("datetime2"); b.Property<long?>("LastModifierUserId") .HasColumnType("bigint"); b.Property<string>("Source") .IsRequired() .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<string>("Value") .IsRequired() .HasColumnType("nvarchar(max)") .HasMaxLength(67108864); b.HasKey("Id"); b.HasIndex("TenantId", "Source", "LanguageName", "Key"); b.ToTable("AbpLanguageTexts"); }); modelBuilder.Entity("Abp.Notifications.NotificationInfo", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<string>("Data") .HasColumnType("nvarchar(max)") .HasMaxLength(1048576); b.Property<string>("DataTypeName") .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property<string>("EntityId") .HasColumnType("nvarchar(96)") .HasMaxLength(96); b.Property<string>("EntityTypeAssemblyQualifiedName") .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property<string>("EntityTypeName") .HasColumnType("nvarchar(250)") .HasMaxLength(250); b.Property<string>("ExcludedUserIds") .HasColumnType("nvarchar(max)") .HasMaxLength(131072); b.Property<string>("NotificationName") .IsRequired() .HasColumnType("nvarchar(96)") .HasMaxLength(96); b.Property<byte>("Severity") .HasColumnType("tinyint"); b.Property<string>("TenantIds") .HasColumnType("nvarchar(max)") .HasMaxLength(131072); b.Property<string>("UserIds") .HasColumnType("nvarchar(max)") .HasMaxLength(131072); b.HasKey("Id"); b.ToTable("AbpNotifications"); }); modelBuilder.Entity("Abp.Notifications.NotificationSubscriptionInfo", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<string>("EntityId") .HasColumnType("nvarchar(96)") .HasMaxLength(96); b.Property<string>("EntityTypeAssemblyQualifiedName") .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property<string>("EntityTypeName") .HasColumnType("nvarchar(250)") .HasMaxLength(250); b.Property<string>("NotificationName") .HasColumnType("nvarchar(96)") .HasMaxLength(96); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<long>("UserId") .HasColumnType("bigint"); b.HasKey("Id"); b.HasIndex("NotificationName", "EntityTypeName", "EntityId", "UserId"); b.HasIndex("TenantId", "NotificationName", "EntityTypeName", "EntityId", "UserId"); b.ToTable("AbpNotificationSubscriptions"); }); modelBuilder.Entity("Abp.Notifications.TenantNotificationInfo", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<string>("Data") .HasColumnType("nvarchar(max)") .HasMaxLength(1048576); b.Property<string>("DataTypeName") .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property<string>("EntityId") .HasColumnType("nvarchar(96)") .HasMaxLength(96); b.Property<string>("EntityTypeAssemblyQualifiedName") .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property<string>("EntityTypeName") .HasColumnType("nvarchar(250)") .HasMaxLength(250); b.Property<string>("NotificationName") .IsRequired() .HasColumnType("nvarchar(96)") .HasMaxLength(96); b.Property<byte>("Severity") .HasColumnType("tinyint"); b.Property<int?>("TenantId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("TenantId"); b.ToTable("AbpTenantNotifications"); }); modelBuilder.Entity("Abp.Notifications.UserNotificationInfo", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<int>("State") .HasColumnType("int"); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<Guid>("TenantNotificationId") .HasColumnType("uniqueidentifier"); b.Property<long>("UserId") .HasColumnType("bigint"); b.HasKey("Id"); b.HasIndex("UserId", "State", "CreationTime"); b.ToTable("AbpUserNotifications"); }); modelBuilder.Entity("Abp.Organizations.OrganizationUnit", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("Code") .IsRequired() .HasColumnType("nvarchar(95)") .HasMaxLength(95); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<long?>("DeleterUserId") .HasColumnType("bigint"); b.Property<DateTime?>("DeletionTime") .HasColumnType("datetime2"); b.Property<string>("DisplayName") .IsRequired() .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<DateTime?>("LastModificationTime") .HasColumnType("datetime2"); b.Property<long?>("LastModifierUserId") .HasColumnType("bigint"); b.Property<long?>("ParentId") .HasColumnType("bigint"); b.Property<int?>("TenantId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("ParentId"); b.HasIndex("TenantId", "Code"); b.ToTable("AbpOrganizationUnits"); }); modelBuilder.Entity("Abp.Organizations.OrganizationUnitRole", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<long>("OrganizationUnitId") .HasColumnType("bigint"); b.Property<int>("RoleId") .HasColumnType("int"); b.Property<int?>("TenantId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("TenantId", "OrganizationUnitId"); b.HasIndex("TenantId", "RoleId"); b.ToTable("AbpOrganizationUnitRoles"); }); modelBuilder.Entity("Abp.Webhooks.WebhookEvent", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<string>("Data") .HasColumnType("nvarchar(max)"); b.Property<DateTime?>("DeletionTime") .HasColumnType("datetime2"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<string>("WebhookName") .IsRequired() .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.ToTable("AbpWebhookEvents"); }); modelBuilder.Entity("Abp.Webhooks.WebhookSendAttempt", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<DateTime?>("LastModificationTime") .HasColumnType("datetime2"); b.Property<string>("Response") .HasColumnType("nvarchar(max)"); b.Property<int?>("ResponseStatusCode") .HasColumnType("int"); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<Guid>("WebhookEventId") .HasColumnType("uniqueidentifier"); b.Property<Guid>("WebhookSubscriptionId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.HasIndex("WebhookEventId"); b.ToTable("AbpWebhookSendAttempts"); }); modelBuilder.Entity("Abp.Webhooks.WebhookSubscriptionInfo", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<string>("Headers") .HasColumnType("nvarchar(max)"); b.Property<bool>("IsActive") .HasColumnType("bit"); b.Property<string>("Secret") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<string>("WebhookUri") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property<string>("Webhooks") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.ToTable("AbpWebhookSubscriptions"); }); modelBuilder.Entity("TestApp.Authorization.Roles.Role", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<long?>("DeleterUserId") .HasColumnType("bigint"); b.Property<DateTime?>("DeletionTime") .HasColumnType("datetime2"); b.Property<string>("Description") .HasColumnType("nvarchar(max)") .HasMaxLength(5000); b.Property<string>("DisplayName") .IsRequired() .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<bool>("IsDefault") .HasColumnType("bit"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<bool>("IsStatic") .HasColumnType("bit"); b.Property<DateTime?>("LastModificationTime") .HasColumnType("datetime2"); b.Property<long?>("LastModifierUserId") .HasColumnType("bigint"); b.Property<string>("Name") .IsRequired() .HasColumnType("nvarchar(32)") .HasMaxLength(32); b.Property<string>("NormalizedName") .IsRequired() .HasColumnType("nvarchar(32)") .HasMaxLength(32); b.Property<int?>("TenantId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("CreatorUserId"); b.HasIndex("DeleterUserId"); b.HasIndex("LastModifierUserId"); b.HasIndex("TenantId", "NormalizedName"); b.ToTable("AbpRoles"); }); modelBuilder.Entity("TestApp.Authorization.Users.User", b => { b.Property<long>("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<int>("AccessFailedCount") .HasColumnType("int"); b.Property<string>("AuthenticationSource") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<long?>("DeleterUserId") .HasColumnType("bigint"); b.Property<DateTime?>("DeletionTime") .HasColumnType("datetime2"); b.Property<string>("EmailAddress") .IsRequired() .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("EmailConfirmationCode") .HasColumnType("nvarchar(328)") .HasMaxLength(328); b.Property<bool>("IsActive") .HasColumnType("bit"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<bool>("IsEmailConfirmed") .HasColumnType("bit"); b.Property<bool>("IsLockoutEnabled") .HasColumnType("bit"); b.Property<bool>("IsPhoneNumberConfirmed") .HasColumnType("bit"); b.Property<bool>("IsTwoFactorEnabled") .HasColumnType("bit"); b.Property<DateTime?>("LastModificationTime") .HasColumnType("datetime2"); b.Property<long?>("LastModifierUserId") .HasColumnType("bigint"); b.Property<DateTime?>("LockoutEndDateUtc") .HasColumnType("datetime2"); b.Property<string>("Name") .IsRequired() .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("NormalizedEmailAddress") .IsRequired() .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("NormalizedUserName") .IsRequired() .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("Password") .IsRequired() .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("PasswordResetCode") .HasColumnType("nvarchar(328)") .HasMaxLength(328); b.Property<string>("PhoneNumber") .HasColumnType("nvarchar(32)") .HasMaxLength(32); b.Property<string>("SecurityStamp") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("Surname") .IsRequired() .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<int?>("TenantId") .HasColumnType("int"); b.Property<string>("UserName") .IsRequired() .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.HasKey("Id"); b.HasIndex("CreatorUserId"); b.HasIndex("DeleterUserId"); b.HasIndex("LastModifierUserId"); b.HasIndex("TenantId", "NormalizedEmailAddress"); b.HasIndex("TenantId", "NormalizedUserName"); b.ToTable("AbpUsers"); }); modelBuilder.Entity("TestApp.Models.Item", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<long?>("DeleterUserId") .HasColumnType("bigint"); b.Property<DateTime?>("DeletionTime") .HasColumnType("datetime2"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<DateTime?>("LastModificationTime") .HasColumnType("datetime2"); b.Property<long?>("LastModifierUserId") .HasColumnType("bigint"); b.Property<string>("Name") .HasColumnType("nvarchar(max)"); b.Property<int>("OrderId") .HasColumnType("int"); b.Property<decimal>("Price") .HasColumnType("decimal(18,2)"); b.Property<int>("Quantity") .HasColumnType("int"); b.Property<decimal>("TotalPrice") .HasColumnType("decimal(18,2)"); b.HasKey("Id"); b.HasIndex("OrderId"); b.ToTable("Item"); }); modelBuilder.Entity("TestApp.Models.Order", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<long?>("DeleterUserId") .HasColumnType("bigint"); b.Property<DateTime?>("DeletionTime") .HasColumnType("datetime2"); b.Property<string>("EmpolyeeName") .HasColumnType("nvarchar(max)"); b.Property<byte[]>("File") .HasColumnType("varbinary(max)"); b.Property<string>("FileName") .HasColumnType("nvarchar(max)"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<bool>("IsSubmit") .HasColumnType("bit"); b.Property<DateTime?>("LastModificationTime") .HasColumnType("datetime2"); b.Property<long?>("LastModifierUserId") .HasColumnType("bigint"); b.Property<string>("Name") .HasColumnType("nvarchar(max)"); b.Property<string>("OrderDate") .HasColumnType("nvarchar(max)"); b.Property<string>("OrderNo") .HasColumnType("nvarchar(max)"); b.Property<decimal>("TotalPrice") .HasColumnType("decimal(18,2)"); b.HasKey("Id"); b.ToTable("Order"); }); modelBuilder.Entity("TestApp.MultiTenancy.Tenant", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("ConnectionString") .HasColumnType("nvarchar(1024)") .HasMaxLength(1024); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<long?>("CreatorUserId") .HasColumnType("bigint"); b.Property<long?>("DeleterUserId") .HasColumnType("bigint"); b.Property<DateTime?>("DeletionTime") .HasColumnType("datetime2"); b.Property<int?>("EditionId") .HasColumnType("int"); b.Property<bool>("IsActive") .HasColumnType("bit"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<DateTime?>("LastModificationTime") .HasColumnType("datetime2"); b.Property<long?>("LastModifierUserId") .HasColumnType("bigint"); b.Property<string>("Name") .IsRequired() .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("TenancyName") .IsRequired() .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.HasKey("Id"); b.HasIndex("CreatorUserId"); b.HasIndex("DeleterUserId"); b.HasIndex("EditionId"); b.HasIndex("LastModifierUserId"); b.HasIndex("TenancyName"); b.ToTable("AbpTenants"); }); modelBuilder.Entity("TestApp.Todo_list.TodoList", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("title") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.ToTable("Todolist"); }); modelBuilder.Entity("Abp.Application.Features.EditionFeatureSetting", b => { b.HasBaseType("Abp.Application.Features.FeatureSetting"); b.Property<int>("EditionId") .HasColumnType("int"); b.HasIndex("EditionId", "Name"); b.ToTable("AbpFeatures"); b.HasDiscriminator().HasValue("EditionFeatureSetting"); }); modelBuilder.Entity("Abp.MultiTenancy.TenantFeatureSetting", b => { b.HasBaseType("Abp.Application.Features.FeatureSetting"); b.HasIndex("TenantId", "Name"); b.ToTable("AbpFeatures"); b.HasDiscriminator().HasValue("TenantFeatureSetting"); }); modelBuilder.Entity("Abp.Authorization.Roles.RolePermissionSetting", b => { b.HasBaseType("Abp.Authorization.PermissionSetting"); b.Property<int>("RoleId") .HasColumnType("int"); b.HasIndex("RoleId"); b.ToTable("AbpPermissions"); b.HasDiscriminator().HasValue("RolePermissionSetting"); }); modelBuilder.Entity("Abp.Authorization.Users.UserPermissionSetting", b => { b.HasBaseType("Abp.Authorization.PermissionSetting"); b.Property<long>("UserId") .HasColumnType("bigint"); b.HasIndex("UserId"); b.ToTable("AbpPermissions"); b.HasDiscriminator().HasValue("UserPermissionSetting"); }); modelBuilder.Entity("Abp.Authorization.Roles.RoleClaim", b => { b.HasOne("TestApp.Authorization.Roles.Role", null) .WithMany("Claims") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Abp.Authorization.Users.UserClaim", b => { b.HasOne("TestApp.Authorization.Users.User", null) .WithMany("Claims") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Abp.Authorization.Users.UserLogin", b => { b.HasOne("TestApp.Authorization.Users.User", null) .WithMany("Logins") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Abp.Authorization.Users.UserRole", b => { b.HasOne("TestApp.Authorization.Users.User", null) .WithMany("Roles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Abp.Authorization.Users.UserToken", b => { b.HasOne("TestApp.Authorization.Users.User", null) .WithMany("Tokens") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Abp.Configuration.Setting", b => { b.HasOne("TestApp.Authorization.Users.User", null) .WithMany("Settings") .HasForeignKey("UserId"); }); modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityProperty", b => { b.HasOne("Abp.DynamicEntityProperties.DynamicProperty", "DynamicProperty") .WithMany() .HasForeignKey("DynamicPropertyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityPropertyValue", b => { b.HasOne("Abp.DynamicEntityProperties.DynamicEntityProperty", "DynamicEntityProperty") .WithMany() .HasForeignKey("DynamicEntityPropertyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicPropertyValue", b => { b.HasOne("Abp.DynamicEntityProperties.DynamicProperty", "DynamicProperty") .WithMany("DynamicPropertyValues") .HasForeignKey("DynamicPropertyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Abp.EntityHistory.EntityChange", b => { b.HasOne("Abp.EntityHistory.EntityChangeSet", null) .WithMany("EntityChanges") .HasForeignKey("EntityChangeSetId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Abp.EntityHistory.EntityPropertyChange", b => { b.HasOne("Abp.EntityHistory.EntityChange", null) .WithMany("PropertyChanges") .HasForeignKey("EntityChangeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Abp.Organizations.OrganizationUnit", b => { b.HasOne("Abp.Organizations.OrganizationUnit", "Parent") .WithMany("Children") .HasForeignKey("ParentId"); }); modelBuilder.Entity("Abp.Webhooks.WebhookSendAttempt", b => { b.HasOne("Abp.Webhooks.WebhookEvent", "WebhookEvent") .WithMany() .HasForeignKey("WebhookEventId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("TestApp.Authorization.Roles.Role", b => { b.HasOne("TestApp.Authorization.Users.User", "CreatorUser") .WithMany() .HasForeignKey("CreatorUserId"); b.HasOne("TestApp.Authorization.Users.User", "DeleterUser") .WithMany() .HasForeignKey("DeleterUserId"); b.HasOne("TestApp.Authorization.Users.User", "LastModifierUser") .WithMany() .HasForeignKey("LastModifierUserId"); }); modelBuilder.Entity("TestApp.Authorization.Users.User", b => { b.HasOne("TestApp.Authorization.Users.User", "CreatorUser") .WithMany() .HasForeignKey("CreatorUserId"); b.HasOne("TestApp.Authorization.Users.User", "DeleterUser") .WithMany() .HasForeignKey("DeleterUserId"); b.HasOne("TestApp.Authorization.Users.User", "LastModifierUser") .WithMany() .HasForeignKey("LastModifierUserId"); }); modelBuilder.Entity("TestApp.Models.Item", b => { b.HasOne("TestApp.Models.Order", null) .WithMany("Items") .HasForeignKey("OrderId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("TestApp.MultiTenancy.Tenant", b => { b.HasOne("TestApp.Authorization.Users.User", "CreatorUser") .WithMany() .HasForeignKey("CreatorUserId"); b.HasOne("TestApp.Authorization.Users.User", "DeleterUser") .WithMany() .HasForeignKey("DeleterUserId"); b.HasOne("Abp.Application.Editions.Edition", "Edition") .WithMany() .HasForeignKey("EditionId"); b.HasOne("TestApp.Authorization.Users.User", "LastModifierUser") .WithMany() .HasForeignKey("LastModifierUserId"); }); modelBuilder.Entity("Abp.Application.Features.EditionFeatureSetting", b => { b.HasOne("Abp.Application.Editions.Edition", "Edition") .WithMany() .HasForeignKey("EditionId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Abp.Authorization.Roles.RolePermissionSetting", b => { b.HasOne("TestApp.Authorization.Roles.Role", null) .WithMany("Permissions") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Abp.Authorization.Users.UserPermissionSetting", b => { b.HasOne("TestApp.Authorization.Users.User", null) .WithMany("Permissions") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); #pragma warning restore 612, 618 } } }
36.929959
125
0.444854
[ "MIT" ]
hasan-ak1996/boilerplate
aspnet-core/src/TestApp.EntityFrameworkCore/Migrations/20201111192402_Update-order2.Designer.cs
72,237
C#
/* * OpaqueMail (https://opaquemail.org/). * * Licensed according to the MIT License (http://mit-license.org/). * * Copyright © Bert Johnson (https://bertjohnson.com/) of Allcloud Inc. (https://allcloud.com/). * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ using System; using System.Collections.Generic; namespace OpaqueMail { /// <summary> /// Represents an IMAP mailbox. /// </summary> public class Mailbox { /// <summary>List of FETCH commands returned by QRESYNC.</summary> public List<string> FetchList { get; set; } /// <summary>Standard IMAP flags associated with this mailbox.</summary> public HashSet<string> Flags { get; set; } /// <summary>Mailbox hierarchy delimiting string.</summary> public string HierarchyDelimiter { get; set; } /// <summary>Name of the mailbox.</summary> public string Name { get; set; } /// <summary>True if ModSeq is explicitly unavailable.</summary> public bool NoModSeq { get; set; } /// <summary>Permanent IMAP flags associated with this mailbox.</summary> public HashSet<string> PermanentFlags { get; set; } /// <summary>List of message IDs that have disappeared since the last QRESYNC.</summary> public string VanishedList { get; set; } /// <summary>Number of messages in the mailbox. Null if COUNT was not parsed.</summary> public int? Count { get; set; } /// <summary>Highest ModSeq in the mailbox. Null if HIGHESTMODSEQ was not parsed.</summary> public int? HighestModSeq { get; set; } /// <summary>Number of recent messages in the mailbox. Null if RECENT was not parsed.</summary> public int? Recent { get; set; } /// <summary>Expected next UID for the mailbox. Null if UIDNEXT was not parsed.</summary> public int? UidNext { get; set; } /// <summary>UID validity for the mailbox. Null if UIDVALIDITY was not parsed.</summary> public int? UidValidity { get; set; } #region Constructors /// <summary> /// Default constructor. /// </summary> public Mailbox() { FetchList = new List<string>(); Flags = new HashSet<string>(); NoModSeq = false; PermanentFlags = new HashSet<string>(); Count = null; HighestModSeq = null; Recent = null; UidNext = null; UidValidity = null; } /// <summary> /// Parse IMAP output from an EXAMINE or SELECT command. /// </summary> /// <param name="name">Name of the mailbox.</param> /// <param name="imapResponse">Raw IMAP output of an EXAMINE or SELECT command.</param> public Mailbox(string name, string imapResponse) : this() { // Escape modifed UTF-7 encoding for ampersands or Unicode characters. Name = Functions.FromModifiedUTF7(name); string[] responseLines = imapResponse.Replace("\r", "").Split('\n'); foreach (string responseLine in responseLines) { if (responseLine.StartsWith("* FLAGS (")) { string[] flags = responseLine.Substring(9, responseLine.Length - 10).Split(' '); foreach (string flag in flags) { if (!Flags.Contains(flag)) Flags.Add(flag); } } else if (responseLine.StartsWith("* OK [NOMODSEQ]")) NoModSeq = true; else if (responseLine.StartsWith("* OK [HIGHESTMODSEQ ")) { string highestModSeq = responseLine.Substring(20, responseLine.IndexOf("]") - 20); int highestModSeqValue; int.TryParse(highestModSeq, out highestModSeqValue); HighestModSeq = highestModSeqValue; } else if (responseLine.StartsWith("* OK [PERMANENTFLAGS (")) { string[] permanentFlags = responseLine.Substring(22, responseLine.IndexOf("]") - 22).Split(' '); foreach (string permanentFlag in permanentFlags) { if (!PermanentFlags.Contains(permanentFlag)) PermanentFlags.Add(permanentFlag); } } else if (responseLine.StartsWith("* OK [UIDNEXT ")) { string uidNext = responseLine.Substring(14, responseLine.IndexOf("]") - 14); int uidNextValue; int.TryParse(uidNext, out uidNextValue); UidNext = uidNextValue; } else if (responseLine.StartsWith("* OK [UIDVALIDITY ")) { string uidValidity = responseLine.Substring(18, responseLine.IndexOf("]") - 18); int UidValidityValue; int.TryParse(uidValidity, out UidValidityValue); UidValidity = UidValidityValue; } else if (responseLine.StartsWith("* VANISHED ")) VanishedList = responseLine.Substring(11); else if (responseLine.IndexOf(" FETCH ", StringComparison.Ordinal) > -1) FetchList.Add(responseLine); else if (responseLine.EndsWith(" EXISTS")) { string existsCount = responseLine.Substring(2, responseLine.Length - 9); int existsCountValue; int.TryParse(existsCount, out existsCountValue); Count = existsCountValue; } else if (responseLine.EndsWith(" RECENT")) { string recentCount = responseLine.Substring(2, responseLine.Length - 9); int recentCountValue; int.TryParse(recentCount, out recentCountValue); Recent = recentCountValue; } } } /// <summary> /// Parse IMAP output from a LIST, LSUB, or XLIST command. /// </summary> /// <param name="lineFromListCommand">Raw output line from a LIST, LSUB, or XLIST command.</param> /// <returns></returns> public static Mailbox CreateFromList(string lineFromListCommand) { // Ensure the list of flags is contained on this line. int startsFlagList = lineFromListCommand.IndexOf("("); int endFlagList = lineFromListCommand.IndexOf(")", startsFlagList + 1); if (startsFlagList > -1 && endFlagList > -1) { Mailbox mailbox = new Mailbox(); string[] flags = lineFromListCommand.Substring(startsFlagList + 1, endFlagList - startsFlagList - 1).Split(' '); foreach (string flag in flags) { if (!mailbox.Flags.Contains(flag)) mailbox.Flags.Add(flag); } // Ensure the hierarchy delimiter and name are returned. string[] remainingParts = lineFromListCommand.Substring(endFlagList + 2).Split(new char[] { ' ' }, 2); if (remainingParts.Length == 2) { mailbox.HierarchyDelimiter = remainingParts[0].Replace("\"", ""); // Escape modifed UTF-7 encoding for ampersands or Unicode characters. mailbox.Name = Functions.FromModifiedUTF7(remainingParts[1].Replace("\"", "")); return mailbox; } } // No valid mailbox listing found, so return null. return null; } #endregion Constructors } }
48.075269
463
0.569112
[ "MIT" ]
bertjohnson/OpaqueMail
OpaqueMail/Mailbox.cs
8,953
C#
// Copyright (c) Dolittle. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.Globalization; using System.Linq; using System.Threading; using Dolittle.Artifacts.Contracts; using Dolittle.Runtime.Artifacts; using Dolittle.Runtime.Domain.Platform; using Dolittle.Runtime.Events.Contracts; using Dolittle.Runtime.Events.Store.MongoDB.Aggregates; using Dolittle.Runtime.Events.Store.Persistence; using Dolittle.Runtime.Execution; using Dolittle.Runtime.Protobuf; using Dolittle.Services.Contracts; using Machine.Specifications; using MongoDB.Driver; using Moq; using ExecutionContext = Dolittle.Runtime.Execution.ExecutionContext; namespace Dolittle.Runtime.Events.Store.MongoDB.Persistence.for_UpdateAggregateVersionsAfterCommit.given; public class all_dependencies { protected static UpdateAggregateVersionsAfterCommit updater; protected static Mock<IAggregateRoots> aggregate_roots; protected static ExecutionContext execution_context; protected static Mock<IClientSessionHandle> session; protected static CancellationToken cancellation_token; Establish context = () => { aggregate_roots = new Mock<IAggregateRoots>(); execution_context = new ExecutionContext( "4dfac023-5fbd-4bc2-a774-72c1743bff0f", "efdf7df8-e855-4267-81b3-c5743b0dc3ca", Version.NotSet, Environment.Development, "61603e6d-4582-4e3b-a5ff-e3a868dbfa6d", Claims.Empty, CultureInfo.InvariantCulture); session = new Mock<IClientSessionHandle>(); cancellation_token = default; updater = new UpdateAggregateVersionsAfterCommit(aggregate_roots.Object); }; protected static Commit create_commit(EventLogSequenceNumber next_sequence_number, params (ArtifactId aggregate_root_id, EventSourceId event_source_id, AggregateRootVersion expected_aggregate_root_version, int num_events)[] aggregates) { var commit_builder = new CommitBuilder(next_sequence_number); foreach (var (aggregate_root_id, event_source_id, expected_aggregate_root_version, num_events) in aggregates) { var request = new CommitAggregateEventsRequest { CallContext = new CallRequestContext { ExecutionContext = execution_context.ToProtobuf() }, Events = new Contracts.UncommittedAggregateEvents { AggregateRootId = aggregate_root_id.ToProtobuf(), EventSourceId = event_source_id, ExpectedAggregateRootVersion = expected_aggregate_root_version } }; request.Events.Events.AddRange(Enumerable.Repeat(new Contracts.UncommittedAggregateEvents.Types.UncommittedAggregateEvent { Content = "{\"hello\": 42}", Public = false, EventType = new Runtime.Artifacts.Artifact(aggregate_root_id, ArtifactGeneration.First).ToProtobuf() }, num_events)); var tryAdd = commit_builder.TryAddEventsFrom(request); if (!tryAdd.Success) { throw tryAdd.Exception; } } return commit_builder.Build().Commit; } protected static void verify_updated_aggregate_root_version_for( Times times, (EventSourceId event_source_id, ArtifactId aggregate_root) aggregate = default, (AggregateRootVersion expected_version, AggregateRootVersion next_version) expected_and_next_version = default) => aggregate_roots.Verify(_ => _.IncrementVersionFor( Moq.It.IsAny<IClientSessionHandle>(), aggregate.event_source_id ?? Moq.It.IsAny<EventSourceId>(), aggregate.aggregate_root ?? Moq.It.IsAny<ArtifactId>(), expected_and_next_version.expected_version ?? Moq.It.IsAny<AggregateRootVersion>(), expected_and_next_version.next_version ?? Moq.It.IsAny<AggregateRootVersion>(), cancellation_token), times); protected static void verify_no_more_updates() => aggregate_roots.VerifyNoOtherCalls(); }
45.159574
239
0.700824
[ "MIT" ]
dolittle-runtime/Runtime
Specifications/Events.Store.MongoDB/Persistence/for_UpdateAggregateVersionsAfterCommit/given/all_dependencies.cs
4,245
C#
using Flight.Seats.Models; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Flight.Data.Configurations; public class SeatConfiguration : IEntityTypeConfiguration<Seat> { public void Configure(EntityTypeBuilder<Seat> builder) { builder.ToTable("Seat", "dbo"); builder.HasKey(r => r.Id); builder.Property(r => r.Id).ValueGeneratedNever(); builder .HasOne<Flights.Models.Flight>() .WithMany() .HasForeignKey(p => p.FlightId); } }
25.636364
63
0.671986
[ "MIT" ]
xpertdev/Airline-Microservices
src/Services/Airline.Flight/src/Flight/Data/Configurations/SeatConfiguration.cs
564
C#
using Com.Elarian.Hera.Proto; namespace Elarian.Net.Model { public class ConsentUpdateReply { public MessagingConsentUpdateStatus Status { get; } public string Description { get; } public string CustomerId { get; } internal ConsentUpdateReply(UpdateMessagingConsentReply reply): this((MessagingConsentUpdateStatus)reply.Status, reply.Description, reply.CustomerId) { } public ConsentUpdateReply(MessagingConsentUpdateStatus status, string description, string customerId) { Status = status; Description = description; CustomerId = customerId; } } public enum MessagingConsentUpdateStatus { Unknown = 0, Queued, Completed, InvalidChannelNumber, DecommissionedCustomerID, ApplicationError } }
27.176471
121
0.615801
[ "MIT" ]
ElarianLtd/dotnet-sdk
Elarian.Net/Model/Reply/ConsentUpdateReply.cs
926
C#
#region BSD License /* * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE.md file or at * https://github.com/Wagnerp/Krypton-Toolkit-Suite-Extended-NET-5.471/blob/master/LICENSE * */ #endregion using Core.Classes.Colours; using Core.Enumerations; using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; namespace Core.Controls.Colours { public class RGBAColourSlider : ColourSlider { #region Constants private static readonly object _eventChannelChanged = new object(); private static readonly object _eventColourChanged = new object(); #endregion #region Fields private Brush _cellBackgroundBrush; private RGBAChannel _channel; private Color _colour; #endregion #region Constructors public RGBAColourSlider() { base.BarStyle = ColourBarStyle.CUSTOM; base.Maximum = 255; this.Colour = Color.Black; this.CreateScale(); } #endregion #region Events [Category("Property Changed")] public event EventHandler ChannelChanged { add { this.Events.AddHandler(_eventChannelChanged, value); } remove { this.Events.RemoveHandler(_eventChannelChanged, value); } } [Category("Property Changed")] public event EventHandler ColourChanged { add { this.Events.AddHandler(_eventColourChanged, value); } remove { this.Events.RemoveHandler(_eventColourChanged, value); } } #endregion #region Properties [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public override ColourBarStyle BarStyle { get { return base.BarStyle; } set { base.BarStyle = value; } } [Category("Appearance")] [DefaultValue(typeof(RGBAChannel), "Red")] public virtual RGBAChannel Channel { get { return _channel; } set { if (this.Channel != value) { _channel = value; this.OnChannelChanged(EventArgs.Empty); } } } [Category("Appearance")] [DefaultValue(typeof(Color), "Black")] public virtual Color Colour { get { return _colour; } set { if (this.Colour != value) { _colour = value; this.OnColorChanged(EventArgs.Empty); } } } [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public override Color Colour1 { get { return base.Colour1; } set { base.Colour1 = value; } } [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public override Color Colour2 { get { return base.Colour2; } set { base.Colour2 = value; } } [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public override Color Colour3 { get { return base.Colour3; } set { base.Colour3 = value; } } [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public override float Maximum { get { return base.Maximum; } set { base.Maximum = value; } } [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public override float Minimum { get { return base.Minimum; } set { base.Minimum = value; } } public override float Value { get { return base.Value; } set { base.Value = (int)value; } } #endregion #region Methods protected virtual void CreateScale() { ColourCollection custom; Color colour; RGBAChannel channel; custom = new ColourCollection(); colour = this.Colour; channel = this.Channel; for (int i = 0; i < 254; i++) { int a; int r; int g; int b; a = colour.A; r = colour.R; g = colour.G; b = colour.B; switch (channel) { case RGBAChannel.RED: r = i; break; case RGBAChannel.GREEN: g = i; break; case RGBAChannel.BLUE: b = i; break; case RGBAChannel.ALPHA: a = i; break; } custom.Add(Color.FromArgb(a, r, g, b)); } this.CustomColours = custom; } protected virtual Brush CreateTransparencyBrush() { Type type; type = typeof(RGBAColourSlider); using (Bitmap background = new Bitmap(type.Assembly.GetManifestResourceStream(string.Concat(type.Namespace, ".Resources.cellbackground.png")))) { return new TextureBrush(background, WrapMode.Tile); } } protected override void Dispose(bool disposing) { if (disposing) { if (_cellBackgroundBrush != null) { _cellBackgroundBrush.Dispose(); } } base.Dispose(disposing); } /// <summary> /// Raises the <see cref="ChannelChanged" /> event. /// </summary> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> protected virtual void OnChannelChanged(EventArgs e) { EventHandler handler; this.CreateScale(); this.Invalidate(); handler = (EventHandler)this.Events[_eventChannelChanged]; handler?.Invoke(this, e); } /// <summary> /// Raises the <see cref="ColourChanged" /> event. /// </summary> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> protected virtual void OnColorChanged(EventArgs e) { EventHandler handler; this.CreateScale(); this.Invalidate(); handler = (EventHandler)this.Events[_eventColourChanged]; handler?.Invoke(this, e); } protected override void PaintBar(PaintEventArgs e) { if (this.Colour.A != 255) { if (_cellBackgroundBrush == null) { _cellBackgroundBrush = this.CreateTransparencyBrush(); } e.Graphics.FillRectangle(_cellBackgroundBrush, this.BarBounds); } base.PaintBar(e); } #endregion } }
26.864286
155
0.51808
[ "BSD-3-Clause" ]
Krypton-Suite-Legacy/Krypton-Toolkit-Suite-Extended-NET-5.471
Source/Krypton Toolkit Suite Extended/Shared/Tooling/Controls/Colours/RGBAColourSlider.cs
7,524
C#
using Architect.Repositories.Abstractions; using RestSharp; using System; using System.Collections.Generic; using System.Net; using System.Text; using System.Threading; using System.Threading.Tasks; namespace Architect.Repositories.WebRepositories { public abstract class BaseWebRepository { protected CancellationTokenSource cancellationToken; private string baseUrl; private RestClient client; public BaseWebRepository(string baseUrl) { this.baseUrl = baseUrl; client = new RestClient(); } private async Task<IRestResponse<K>> ExecuteAsync<K>(RestRequest request) { cancellationToken = new CancellationTokenSource(); var result = await client.ExecuteTaskAsync<K>(request, cancellationToken.Token).ConfigureAwait(false); if (result.ErrorException == null) return result; if (result.StatusCode == 0) result.StatusCode = HttpStatusCode.BadGateway; throw result.ErrorException; } protected async Task<K> Request<K>(string url) { var request = new RestRequest(url); var result = await ExecuteAsync<K>(request).ConfigureAwait(false); return result.Data; } protected void Abort() { if (cancellationToken != null) cancellationToken.Cancel(); } } }
31.021739
114
0.644008
[ "MIT" ]
MuhammadBashir/Architect
src/Architect.Repositories/WebRepositories/BaseWebRepository.cs
1,429
C#
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using Microsoft.AspNetCore.Mvc; namespace MVCApp.Models { /// <summary> /// creation of concrete class of a person /// </summary> public class TimePerson { //below are property fields of a new TimePerson object public int Year { get; set; } public string Honor { get; set; } public string Name { get; set; } public string Country { get; set; } public int Birth_Year { get; set; } public int DeathYear { get; set; } public string Title { get; set; } public string Category { get; set; } public string Context { get; set; } /// <summary> /// method to find list of users based on input parameters /// </summary> /// <param name="begYear">integer year beginning of search</param> /// <param name="endYear">integer year ending of search</param> /// <returns>returns list parsed from csv file</returns> public static List<TimePerson>GetPersons(int begYear, int endYear) { //creates enumerable list List<TimePerson> people = new List<TimePerson>(); //sets string of the path to the current directory string path = Environment.CurrentDirectory; //sets path string to the root file and imported csv file string newPath = Path.GetFullPath(Path.Combine(path, @"wwwroot\PersonOfTheYear.csv")); //string array reading contents found at path string[] myFile = File.ReadAllLines(newPath); //for loop to populate array fields by splitting the strings at "," into new array values for(int i = 1; i < myFile.Length; i++) { string[] fields = myFile[i].Split(","); //method to add new person to list people.Add(new TimePerson { Year = Convert.ToInt32(fields[0]), Honor = fields[1], Name = fields[2], Country = fields[3], Birth_Year = (fields[4] == "") ? 0 : Convert.ToInt32(fields[4]), DeathYear = (fields[5] == "") ? 0 : Convert.ToInt32(fields[5]), Title = fields[6], Category = fields[7], Context = fields[8] }); } //parses list based on year input and adds to the instantiated list List<TimePerson>listofPeople = people.Where(p => (p.Year >= begYear) && (p.Year <= endYear)).ToList(); //returns list out of method for use in the code return listofPeople; } } }
32.077922
105
0.679757
[ "MIT" ]
jaatay/Lab11-MVCApp
MVCApp/MVCApp/Models/TimePerson.cs
2,472
C#
using DatabaseBuilder.MigrationManagers; using System; using System.Configuration; using System.Data.SqlClient; namespace DatabaseBuilder { class Program { static void Main(string[] args) { Console.WriteLine("Starting Migration Manager"); var connectionString = ConfigurationManager.AppSettings["connectionString"]; var connection = new SqlConnection(connectionString); Console.WriteLine("Enter option to run scripts"); Console.WriteLine("1: Run database migrations"); Console.WriteLine("2: Roll back database migrations"); var option = Console.ReadLine(); IMigrationManager migrationManager = new MigrationManager(); switch (option) { case "1": migrationManager.RunMigrations(connection); break; case "2": migrationManager.RollBackMigrations(connection); break; default: break; } Console.WriteLine("Program completed. Press any key to close console"); Console.ReadLine(); } } }
30.195122
88
0.567044
[ "MIT" ]
mwijnen/WebPortal
DatabaseBuilder/Program.cs
1,240
C#
// Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.LanguageServices; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.CSharp { [ExportLanguageService(typeof(ISymbolDeclarationService), LanguageNames.CSharp)] internal class CSharpSymbolDeclarationService : ISymbolDeclarationService { public IEnumerable<SyntaxReference> GetDeclarations(ISymbol symbol) { return symbol != null ? symbol.DeclaringSyntaxReferences.AsEnumerable() : SpecializedCollections.EmptyEnumerable<SyntaxReference>(); } } }
39.818182
184
0.751142
[ "Apache-2.0" ]
jdm7dv/Rosyln
Src/Workspaces/CSharp/LanguageServices/CSharpSymbolDeclarationService.cs
878
C#
using Sandbox.Common.ObjectBuilders; using Sandbox.Game.Entities.Cube; using Sandbox.ModAPI; using VRage.Game.ModAPI; using VRage.ObjectBuilders; namespace Rynchodon.Weapons.SystemDisruption { public class DisableTurret : Disruption { protected override MyObjectBuilderType[] BlocksAffected { get { return new MyObjectBuilderType[] { typeof(MyObjectBuilder_LargeGatlingTurret), typeof(MyObjectBuilder_LargeMissileTurret), typeof(MyObjectBuilder_InteriorTurret) }; } } protected override float MinCost { get { return 15f; } } protected override void StartEffect(IMyCubeBlock block) { (block as MyFunctionalBlock).Enabled = false; } protected override void EndEffect(IMyCubeBlock block) { (block as MyFunctionalBlock).Enabled = true; } } }
25.032258
175
0.775773
[ "CC0-1.0" ]
Rynchodon/ARMS
Scripts/Weapons/SystemDisruption/DisableTurret.cs
776
C#
using Abp.Authorization.Roles; using Abp.Authorization.Users; using Abp.Domain.Repositories; using Portal.Core.Authorization.Users; namespace Portal.Core.Authorization.Roles { public class RoleStore : AbpRoleStore<Role, User> { public RoleStore( IRepository<Role> roleRepository, IRepository<UserRole, long> userRoleRepository, IRepository<RolePermissionSetting, long> rolePermissionSettingRepository) : base( roleRepository, userRoleRepository, rolePermissionSettingRepository) { } } }
29.47619
85
0.657512
[ "MIT" ]
EtwasGE/InformationPortal
Portal.Core/Authorization/Roles/RoleStore.cs
619
C#
using System.Diagnostics; using Armature.Core.Logging; namespace Armature.Core.UnitMatchers.Properties { /// <summary> /// Matches Unit representing "property" of the currently building Unit /// </summary> public class PropertyMatcher : IUnitMatcher { public static readonly IUnitMatcher Instance = new PropertyMatcher(); private PropertyMatcher() { } public bool Matches(UnitInfo unitInfo) => unitInfo.Token == SpecialToken.Property && unitInfo.GetUnitTypeSafe() != null; [DebuggerStepThrough] public override string ToString() => GetType().GetShortName(); #region Equality [DebuggerStepThrough] public bool Equals(IUnitMatcher obj) => obj is PropertyMatcher; [DebuggerStepThrough] public override bool Equals(object obj) => Equals(obj as IUnitMatcher); public override int GetHashCode() => 0; #endregion } }
29.3
124
0.721274
[ "Apache-2.0" ]
Temp1ar/Armature
src/Armature.Core/UnitMatchers/Properties/PropertyMatcher.cs
881
C#
namespace ContosoUniversity.IntegrationTests { using Ploeh.AutoFixture; public abstract class AutoFixtureCustomization : ICustomization { public void Customize(IFixture fixture) { fixture.Customizations.Add(new IdOmitterBuilder()); fixture.Customizations.Add(new OmitListBuilder()); CustomizeFixture(fixture); fixture.Behaviors.Remove(new ThrowingRecursionBehavior()); fixture.Behaviors.Add(new OmitOnRecursionBehavior()); } protected abstract void CustomizeFixture(IFixture fixture); } }
30.05
70
0.680532
[ "Apache-2.0" ]
jbogard/ContinuousDeliveryExample
src/IntegrationTests/AutoFixtureCustomization.cs
603
C#
using BudgetTrack.Data; using BudgetTrack.Extentions; using BudgetTrack.ViewModels; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using System; using System.Globalization; using System.Linq; using System.Threading.Tasks; namespace BudgetTrack.Controllers { [ApiController] [Route("api/[controller]/[action]")] [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] public class ExpensesController : ControllerBase { private readonly string DATE_FORMAT = "dd-MM-yyyy"; private readonly ApplicationDbContext _context; public ExpensesController(ApplicationDbContext context) { _context = context; } [HttpGet] public async Task<IActionResult> GetExpenses(string startDate, string endDate, int? category) { var dbItems = _context.Expenses .Select(x => new ExpenseIndexModel { Id = x.Id, AddedBy = x.AddedBy, Ammount = x.Ammount, Date = x.Date, Description = x.Description, Latitude = x.Latitude, Longitude = x.Longitude, ExpenseCategoryId = x.ExpenseCategoryId, ExpenseCategoryName = x.ExpenseCategory.Name }); if (!string.IsNullOrEmpty(startDate)) { if (DateTime.TryParseExact(startDate, DATE_FORMAT, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime start)) dbItems = dbItems.Where(x => x.Date >= start); } if (!string.IsNullOrEmpty(endDate)) { if (DateTime.TryParseExact(endDate, DATE_FORMAT, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime end)) dbItems = dbItems.Where(x => x.Date <= end); } if (category.HasValue) dbItems = dbItems.Where(x => x.ExpenseCategoryId == category); var result = await dbItems.OrderByDescending(d => d.Date).ToListAsync(); return Ok(result); } [HttpGet] public async Task<IActionResult> GetExpenseById(int id) { var dbData = await _context.Expenses.Where(x => x.Id == id) .Select(x => new ExpenseModel { Id = x.Id, Ammount = x.Ammount, Date = x.Date.ToString(DATE_FORMAT, CultureInfo.InvariantCulture), Description = x.Description, ExpenseCategoryId = x.ExpenseCategoryId }).FirstOrDefaultAsync(); if (dbData == null) return NotFound(); return Ok(dbData); } [HttpPost] public IActionResult PostExpense([FromBody]ExpenseModel model) { if (!ModelState.IsValid) return BadRequest("Model state is not valid."); if (!DateTime.TryParseExact(model.Date, this.DATE_FORMAT, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime modelDate)) { return BadRequest($"Date is not formated correctly. Please use: {DATE_FORMAT} format."); } _context.Expenses.Add(new Entities.Expense { ExpenseCategoryId = model.ExpenseCategoryId, Description = model.Description, Date = modelDate, Ammount = model.Ammount, AddedBy = User.GetUserId(), Latitude = model.Latitude, Longitude = model.Longitude }); _context.SaveChanges(); return Ok(); } [HttpPut] public async Task<IActionResult> PutExpense(int? id, [FromBody]ExpenseModel model) { if (!id.HasValue) return NotFound(); if (id != model.Id) return BadRequest("Identifier of the object does not match"); if (!ModelState.IsValid) return BadRequest("Model state is not valid."); if (!DateTime.TryParseExact(model.Date, this.DATE_FORMAT, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime modelDate)) return BadRequest($"Date is not formated correctly. Please use: {DATE_FORMAT} format."); var dbExpense = await _context.Expenses.Where(x => x.Id == id).FirstOrDefaultAsync(); if (dbExpense == null) return NotFound(); dbExpense.ExpenseCategoryId = model.ExpenseCategoryId; dbExpense.Date = modelDate; dbExpense.Ammount = model.Ammount; dbExpense.Description = model.Description; // who changed this dbExpense.ModifiedBy = User.GetUserId(); dbExpense.ModifiedDate = DateTime.UtcNow; _context.Entry(dbExpense).State = EntityState.Modified; _context.SaveChanges(); return Ok(model); } public async Task<IActionResult> DeleteExpense(int? id) { if (!id.HasValue) return NotFound(); var dbItem = await _context.Expenses.Where(x => x.Id == id).FirstOrDefaultAsync(); if (dbItem == null) return NotFound(); else { dbItem.ModifiedDate = DateTime.UtcNow; dbItem.ModifiedBy = User.GetUserId(); dbItem.Active = false; _context.Entry(dbItem).State = EntityState.Modified; _context.SaveChanges(); return Ok(); } } } }
40.146497
145
0.525147
[ "MIT" ]
ermirbeqiraj/expense-tracker
BudgetTrack/Controllers/ExpensesController.cs
6,305
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _10.Check_Prime { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); bool isPrime = true; for (int i = 1; i < Math.Sqrt(n); i++) { if (n % i == 0) { isPrime = false; break; } } if (isPrime && n > 2) { Console.WriteLine("Prime"); } else { Console.WriteLine("Not Prime"); } } } }
20.942857
50
0.405184
[ "MIT" ]
Koceto/SoftUni
Old Code/Programming Basics/Advanced Loops/10. Check Prime/Program.cs
735
C#
using UIKit; namespace SignInExample { public class Application { // This is the main entry point of the application. static void Main (string[] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. UIApplication.Main (args, null, "AppDelegate"); } } }
21.0625
82
0.697329
[ "MIT" ]
Acidburn0zzz/GoogleApisForiOSComponents
Google.SignIn/samples/SignInExample/SignInExample/Main.cs
339
C#
#region License // Copyright (c) 2007 James Newton-King // // 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.Collections.Generic; #if !NETFX_CORE using NUnit.Framework; #else using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute; using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute; #endif using Newtonsoft.Json.Converters; using Newtonsoft.Json.Tests.Serialization; using Newtonsoft.Json.Tests.TestObjects; namespace Newtonsoft.Json.Tests.Converters { [TestFixture] public class JavaScriptDateTimeConverterTests : TestFixtureBase { [Test] public void SerializeDateTime() { JavaScriptDateTimeConverter converter = new JavaScriptDateTimeConverter(); DateTime d = new DateTime(2000, 12, 15, 22, 11, 3, 55, DateTimeKind.Utc); string result; result = JsonConvert.SerializeObject(d, converter); Assert.AreEqual("new Date(976918263055)", result); } #if !NET20 [Test] public void SerializeDateTimeOffset() { JavaScriptDateTimeConverter converter = new JavaScriptDateTimeConverter(); DateTimeOffset now = new DateTimeOffset(2000, 12, 15, 22, 11, 3, 55, TimeSpan.Zero); string result; result = JsonConvert.SerializeObject(now, converter); Assert.AreEqual("new Date(976918263055)", result); } [Test] public void sdfs() { int i = Convert.ToInt32("+1"); Console.WriteLine(i); } [Test] public void SerializeNullableDateTimeClass() { NullableDateTimeTestClass t = new NullableDateTimeTestClass() { DateTimeField = null, DateTimeOffsetField = null }; JavaScriptDateTimeConverter converter = new JavaScriptDateTimeConverter(); string result; result = JsonConvert.SerializeObject(t, converter); Assert.AreEqual(@"{""PreField"":null,""DateTimeField"":null,""DateTimeOffsetField"":null,""PostField"":null}", result); t = new NullableDateTimeTestClass() { DateTimeField = new DateTime(2000, 12, 15, 22, 11, 3, 55, DateTimeKind.Utc), DateTimeOffsetField = new DateTimeOffset(2000, 12, 15, 22, 11, 3, 55, TimeSpan.Zero) }; result = JsonConvert.SerializeObject(t, converter); Assert.AreEqual(@"{""PreField"":null,""DateTimeField"":new Date(976918263055),""DateTimeOffsetField"":new Date(976918263055),""PostField"":null}", result); } [Test] public void DeserializeNullToNonNullable() { ExceptionAssert.Throws<Exception>("Cannot convert null value to System.DateTime. Path 'DateTimeField', line 1, position 38.", () => { DateTimeTestClass c2 = JsonConvert.DeserializeObject<DateTimeTestClass>(@"{""PreField"":""Pre"",""DateTimeField"":null,""DateTimeOffsetField"":null,""PostField"":""Post""}", new JavaScriptDateTimeConverter()); }); } [Test] public void DeserializeDateTimeOffset() { JavaScriptDateTimeConverter converter = new JavaScriptDateTimeConverter(); DateTimeOffset start = new DateTimeOffset(2000, 12, 15, 22, 11, 3, 55, TimeSpan.Zero); string json = JsonConvert.SerializeObject(start, converter); DateTimeOffset result = JsonConvert.DeserializeObject<DateTimeOffset>(json, converter); Assert.AreEqual(new DateTimeOffset(2000, 12, 15, 22, 11, 3, 55, TimeSpan.Zero), result); } #endif [Test] public void DeserializeDateTime() { JavaScriptDateTimeConverter converter = new JavaScriptDateTimeConverter(); DateTime result = JsonConvert.DeserializeObject<DateTime>("new Date(976918263055)", converter); Assert.AreEqual(new DateTime(2000, 12, 15, 22, 11, 3, 55, DateTimeKind.Utc), result); } [Test] public void ConverterList() { ConverterList<object> l1 = new ConverterList<object>(); l1.Add(new DateTime(2000, 12, 12, 20, 10, 0, DateTimeKind.Utc)); l1.Add(new DateTime(1983, 10, 9, 23, 10, 0, DateTimeKind.Utc)); string json = JsonConvert.SerializeObject(l1, Formatting.Indented); Assert.AreEqual(@"[ new Date( 976651800000 ), new Date( 434589000000 ) ]", json); ConverterList<object> l2 = JsonConvert.DeserializeObject<ConverterList<object>>(json); Assert.IsNotNull(l2); Assert.AreEqual(new DateTime(2000, 12, 12, 20, 10, 0, DateTimeKind.Utc), l2[0]); Assert.AreEqual(new DateTime(1983, 10, 9, 23, 10, 0, DateTimeKind.Utc), l2[1]); } [Test] public void ConverterDictionary() { ConverterDictionary<object> l1 = new ConverterDictionary<object>(); l1.Add("First", new DateTime(2000, 12, 12, 20, 10, 0, DateTimeKind.Utc)); l1.Add("Second", new DateTime(1983, 10, 9, 23, 10, 0, DateTimeKind.Utc)); string json = JsonConvert.SerializeObject(l1, Formatting.Indented); Assert.AreEqual(@"{ ""First"": new Date( 976651800000 ), ""Second"": new Date( 434589000000 ) }", json); ConverterDictionary<object> l2 = JsonConvert.DeserializeObject<ConverterDictionary<object>>(json); Assert.IsNotNull(l2); Assert.AreEqual(new DateTime(2000, 12, 12, 20, 10, 0, DateTimeKind.Utc), l2["First"]); Assert.AreEqual(new DateTime(1983, 10, 9, 23, 10, 0, DateTimeKind.Utc), l2["Second"]); } [Test] public void ConverterObject() { ConverterObject l1 = new ConverterObject(); l1.Object1 = new DateTime(2000, 12, 12, 20, 10, 0, DateTimeKind.Utc); l1.Object2 = null; l1.ObjectNotHandled = new DateTime(2000, 12, 12, 20, 10, 0, DateTimeKind.Utc); string json = JsonConvert.SerializeObject(l1, Formatting.Indented); Assert.AreEqual(@"{ ""Object1"": new Date( 976651800000 ), ""Object2"": null, ""ObjectNotHandled"": 631122486000000000 }", json); ConverterObject l2 = JsonConvert.DeserializeObject<ConverterObject>(json); Assert.IsNotNull(l2); //Assert.AreEqual(new DateTime(2000, 12, 12, 20, 10, 0, DateTimeKind.Utc), l2["First"]); //Assert.AreEqual(new DateTime(1983, 10, 9, 23, 10, 0, DateTimeKind.Utc), l2["Second"]); } } [JsonArray(ItemConverterType = typeof(JavaScriptDateTimeConverter))] public class ConverterList<T> : List<T> { } [JsonDictionary(ItemConverterType = typeof(JavaScriptDateTimeConverter))] public class ConverterDictionary<T> : Dictionary<string, T> { } [JsonObject(ItemConverterType = typeof(JavaScriptDateTimeConverter))] public class ConverterObject { public object Object1 { get; set; } public object Object2 { get; set; } [JsonConverter(typeof(DateIntConverter))] public object ObjectNotHandled { get; set; } } public class DateIntConverter : JsonConverter { public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { DateTime? d = (DateTime?) value; if (d == null) writer.WriteNull(); else writer.WriteValue(d.Value.Ticks); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { return new DateTime(Convert.ToInt64(reader.Value), DateTimeKind.Utc); } public override bool CanConvert(Type objectType) { return objectType == typeof (DateTime) || objectType == typeof (DateTime?); } } }
34.177419
195
0.692308
[ "MIT" ]
Chimpaneez/LiveSplit
LiveSplit/Libs/JSON.Net/Source/Src/Newtonsoft.Json.Tests/Converters/JavaScriptDateTimeConverterTests.cs
8,478
C#
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.SumoLogic.Inputs { public sealed class MonitorTriggerConditionsLogsStaticConditionArgs : Pulumi.ResourceArgs { [Input("critical")] public Input<Inputs.MonitorTriggerConditionsLogsStaticConditionCriticalArgs>? Critical { get; set; } [Input("field")] public Input<string>? Field { get; set; } [Input("warning")] public Input<Inputs.MonitorTriggerConditionsLogsStaticConditionWarningArgs>? Warning { get; set; } public MonitorTriggerConditionsLogsStaticConditionArgs() { } } }
30.827586
108
0.710291
[ "ECL-2.0", "Apache-2.0" ]
pulumi/pulumi-sumologic
sdk/dotnet/Inputs/MonitorTriggerConditionsLogsStaticConditionArgs.cs
894
C#
using System; using System.Runtime.CompilerServices; namespace ScrambledLinear { /// <summary> /// 32-bit all-purpose random number generator with 128-bit state (xoshiro128++). /// </summary> /// <remarks>http://prng.di.unimi.it/xoshiro128plusplus.c</remarks> public class Xoshiro128PP { /// <summary> /// Creates a new instance. /// </summary> public Xoshiro128PP() : this(DateTime.UtcNow.Ticks) { } /// <summary> /// Creates a new instance. /// </summary> /// <param name="seed">Seed value.</param> public Xoshiro128PP(long seed) { var sm64 = new SplitMix64(seed); for (var i = 0; i < 4; i++) { s[i] = unchecked((UInt32)sm64.Next()); } } private readonly UInt32[] s = new UInt32[4]; /// <summary> /// Returns the next 32-bit pseudo-random number. /// </summary> public int Next() { UInt32 result = unchecked(RotateLeft(unchecked(s[0] + s[3]), 7) + s[0]); UInt32 t = s[1] << 9; s[2] ^= s[0]; s[3] ^= s[1]; s[1] ^= s[2]; s[0] ^= s[3]; s[2] ^= t; s[3] = RotateLeft(s[3], 11); return (int)result; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static UInt32 RotateLeft(UInt32 x, int k) { return (x << k) | (x >> (32 - k)); } } }
25.383333
85
0.483913
[ "CC0-1.0" ]
medo64/ScrambledLinear
src/ScrambledLinear/Xoshiro/Xoshiro128PP.cs
1,523
C#
using System; using System.IO; using System.Reflection; namespace Coding4Fun.Toolkit.Tool.XamlMerger { public static class FilePaths { public static string BaseFilePath = Path.Combine( BaseFolderPath, Constants.ControlFolder, Constants.ThemesFolder); // source/Coding4Fun.Toolkit.Controls/Themes/Generic/SYSTEM/Generic.Xaml" public static string GenerateGenericFilePath(string arg) { return GenerateGenericFilePath(SystemTargets.GetSystemTargetFromArgument(arg)); } public static string GenerateGenericFilePath(SystemTarget target) { return Path.Combine( BaseFolderPath, Constants.ControlFolder + "." + SystemTargets.GetSystemTargetPath(target).Replace(" ", ""), Constants.ThemesFolder, Constants.GenericThemeXaml); } public static string GenerateXamlSearchFolderPath() { return Path.Combine(BaseFolderPath, Constants.ControlThemeFolder); } public static string GetExecutingAssemblyFilePath() { var returnVal = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase); if (returnVal != null && returnVal.StartsWith(Constants.FileCmdDeclare)) returnVal = returnVal.Remove(0, Constants.FileCmdDeclare.Length); return returnVal; } private static string _baseFolderPath; public static string BaseFolderPath { get { if (!string.IsNullOrEmpty(_baseFolderPath)) return _baseFolderPath; var di = new DirectoryInfo(GetExecutingAssemblyFilePath()); var found = false; while (di != null && !IsBase(di)) { var childern = di.GetDirectories(Constants.BaseFolder); if (childern.Length != 0) { foreach (var child in childern) { if (!IsBase(child)) continue; di = child; found = true; break; } } if (found) break; if (di.Parent != null) { di = di.Parent; } } if (!IsBase(di)) throw new Exception("Can't find " + Constants.BaseFolder); _baseFolderPath = di.FullName; return _baseFolderPath; } set { _baseFolderPath = value; } } private static bool IsBase(FileSystemInfo di) { return (di.Name.ToLowerInvariant() == Constants.BaseFolder.ToLowerInvariant()); } } }
23.846939
96
0.660676
[ "MIT" ]
Coding4FunProjects/Coding4FunToolk
source/Coding4Fun.Toolkit.Tool.XamlMerger/FilePaths.cs
2,339
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Reflection; namespace Miru; public static class EnumExtensions { public static string DisplayName(this Enum @enum) { var fieldInfo = @enum.GetType().GetField(@enum.ToString()); if (fieldInfo is null) return string.Empty; var descriptionAttributes = fieldInfo! .GetCustomAttributes(typeof(DisplayAttribute), false) as DisplayAttribute[]; if (descriptionAttributes == null) return string.Empty; return descriptionAttributes.Length > 0 ? descriptionAttributes[0].Name : @enum.ToString(); } public static IEnumerable<TEnum> All<TEnum>() where TEnum : struct, IComparable, IFormattable, IConvertible { var enumType = typeof(TEnum); if(!enumType.IsEnum) throw new ArgumentException($"The type passed is not an Enum: {enumType.Name}"); return Enum.GetValues(enumType).Cast<TEnum>(); } public static TAttribute GetAttribute<TAttribute>(this Enum enumValue) where TAttribute : Attribute { return enumValue.GetType() .GetMember(enumValue.ToString()) .First() .GetCustomAttribute<TAttribute>(); } }
29.276596
112
0.638808
[ "MIT" ]
mirufx/miru
src/Miru/EnumExtensions.cs
1,376
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; using System.Data.SqlClient; using Microsoft.Data.Sqlite; using Microsoft.EntityFrameworkCore.Design; namespace where_is_my_doctor.Models{ public class ApplicationDbContext : DbContext{ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder){ var connectionStringBuilder = new SqliteConnectionStringBuilder { DataSource = "database.db" }; var connectionString = connectionStringBuilder.ToString(); var connection = new SqliteConnection(connectionString); optionsBuilder.UseSqlite(connection); } public void EnsureCreated(){} public DbSet<Doctor> Doctors { get; set; } public DbSet<City> Cities { get; set; } public DbSet<User> Users { get; set; } public DbSet<Specialty> Specialties { get; set; } public DbSet<Banner> AdvertisingBanners {get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity<Specialty>() .HasData( new Specialty() { SpecialtyId = 1, Name = "Test Emp1" }, new Specialty() { SpecialtyId = 2, Name = "Test Emp2" }); } } }
31.76
86
0.586902
[ "MIT" ]
victor-cleber/where_is_my_doctor
Models/ApplicationDbContext.cs
1,588
C#
namespace ATF.Repository.Replicas { using System; using System.Collections.Generic; using Newtonsoft.Json; internal class BatchQueryReplica: IBatchQuery { [JsonProperty("items")] public List<IBaseQuery> Queries { get; set; } [JsonProperty("continueIfError")] public bool ContinueIfError { get; set; } [JsonProperty("instanceId")] public Guid InstanceId { get; set; } [JsonProperty("includeProcessExecutionData")] public bool IncludeProcessExecutionData { get; } internal BatchQueryReplica() { IncludeProcessExecutionData = true; InstanceId = Guid.NewGuid(); } } }
22.296296
50
0.734219
[ "MIT" ]
Advance-Technologies-Foundation/repository
ATF.Repository/Replicas/BatchQueryReplica.cs
604
C#
using System; using System.Globalization; using System.Text.RegularExpressions; using Elasticsearch.Net; using Elasticsearch.Net.Utf8Json; namespace Nest { [JsonFormatter(typeof(DistanceFormatter))] public class Distance { private static readonly Regex DistanceUnitRegex = new Regex(@"^(?<precision>\d+(?:\.\d+)?)(?<unit>\D+)?$", RegexOptions.Compiled | RegexOptions.ExplicitCapture); public Distance(double distance) : this(distance, DistanceUnit.Meters) { } public Distance(double distance, DistanceUnit unit) { Precision = distance; Unit = unit; } public Distance(string distanceUnit) { distanceUnit.ThrowIfNullOrEmpty(nameof(distanceUnit)); var match = DistanceUnitRegex.Match(distanceUnit); if (!match.Success) throw new ArgumentException("must be a valid distance unit", nameof(distanceUnit)); var precision = double.Parse(match.Groups["precision"].Value, NumberStyles.Any, CultureInfo.InvariantCulture); var unit = match.Groups["unit"].Value; Precision = precision; if (string.IsNullOrEmpty(unit)) { Unit = DistanceUnit.Meters; return; } var unitMeasure = unit.ToEnum<DistanceUnit>(); if (unitMeasure == null) throw new InvalidCastException($"cannot parse {typeof(DistanceUnit).Name} from string '{unit}'"); Unit = unitMeasure.Value; } public double Precision { get; private set; } public DistanceUnit Unit { get; private set; } public static Distance Inches(double inches) => new Distance(inches, DistanceUnit.Inch); public static Distance Yards(double yards) => new Distance(yards, DistanceUnit.Yards); public static Distance Miles(double miles) => new Distance(miles, DistanceUnit.Miles); public static Distance Kilometers(double kilometers) => new Distance(kilometers, DistanceUnit.Kilometers); public static Distance Meters(double meters) => new Distance(meters, DistanceUnit.Meters); public static Distance Centimeters(double centimeters) => new Distance(centimeters, DistanceUnit.Centimeters); public static Distance Millimeters(double millimeter) => new Distance(millimeter, DistanceUnit.Millimeters); public static Distance NauticalMiles(double nauticalMiles) => new Distance(nauticalMiles, DistanceUnit.NauticalMiles); public static implicit operator Distance(string distanceUnit) => new Distance(distanceUnit); public override string ToString() => Precision.ToString(CultureInfo.InvariantCulture) + Unit.GetStringValue(); } }
34.263889
125
0.753141
[ "Apache-2.0" ]
AnthAbou/elasticsearch-net
src/Nest/CommonOptions/Geo/Distance.cs
2,469
C#
namespace NextTech.ChaChing123.UI.Web.Models { public class HomeInOneCategoryContentModel { public string ID { get; set; } public string Content { get; set; } public string ImagePath { get; set; } public string CategoryID { get; set; } } }
25.818182
46
0.630282
[ "MIT" ]
hochaucan/123ChaChing-Web
NextTech.ChaChing123.UI.Web/Models/HomeInOneCategoryContentModel.cs
284
C#
using Xamarin.Forms.CustomAttributes; using Xamarin.Forms.Internals; using System.Collections.Generic; using System.Collections.Specialized; using System; using System.Collections; #if UITEST using Xamarin.UITest; using NUnit.Framework; #endif namespace Xamarin.Forms.Controls.Issues { #if UITEST [NUnit.Framework.Category(Core.UITests.UITestCategories.Bugzilla)] #endif [Preserve(AllMembers = true)] [Issue(IssueTracker.Bugzilla, 57674, "ListView not honoring INotifyCollectionChanged ", PlatformAffected.UWP)] public class Bugzilla57674 : TestContentPage { MyCollection _myCollection; protected override void Init() { // Initialize ui here instead of ctor _myCollection = new MyCollection(); var stackLayout = new StackLayout(); var button = new Button { AutomationId = "IssueButton", Text = "Add new element to ListView" }; button.Clicked += (object sender, EventArgs e) => _myCollection.AddNewItem(); stackLayout.Children.Add(button); stackLayout.Children.Add(new ListView { AutomationId = "IssueListView", ItemsSource = _myCollection }); Content = stackLayout; } #if UITEST [Test] public void Bugzilla57674Test() { RunningApp.Screenshot("Initial Status"); RunningApp.WaitForElement(q => q.Marked("IssueListView")); RunningApp.Tap(a => a.Button("IssueButton")); RunningApp.Screenshot("Element Added to List"); } #endif } public class MyCollection : IEnumerable<string>, INotifyCollectionChanged { readonly List<string> _internalList = new List<string>(); public MyCollection() { } public IEnumerable<string> GetItems() { foreach (var item in _internalList) { yield return item; } } public IEnumerator<string> GetEnumerator() { return GetItems().GetEnumerator(); } public void AddNewItem() { int index = _internalList.Count; string item = Guid.NewGuid().ToString(); _internalList.Add(item); OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, index)); } public event NotifyCollectionChangedEventHandler CollectionChanged; protected void OnCollectionChanged(NotifyCollectionChangedEventArgs e) { CollectionChanged?.Invoke(this, e); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } }
23.734694
111
0.733878
[ "MIT" ]
Alan-love/Xamarin.Forms
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla57674.cs
2,328
C#
using System; namespace Charlotte { // Token: 0x02000170 RID: 368 public struct ConfigureOptionalEuantheCase { // Token: 0x06001C67 RID: 7271 RVA: 0x00043192 File Offset: 0x00041392 public void ListExternalHeliumInterval(int RestartNextGraceHost, int NotePreferredIsonoeMessage, int DeployInitialSkollYou) { this.ExportExternalMatadorDescription(RestartNextGraceHost, NotePreferredIsonoeMessage, DeployInitialSkollYou, this.ContributePreviousDreamRule()); } // Token: 0x06001C68 RID: 7272 RVA: 0x000431A3 File Offset: 0x000413A3 public int ModifyAbstractYttriumLabel() { if (this.CrashAdditionalVanadiumDialog() == 0) { return ConfigureOptionalEuantheCase.OverwriteExternalHaumeaCloud; } return 1; } // Token: 0x06001C69 RID: 7273 RVA: 0x000431B4 File Offset: 0x000413B4 public void ShareCoreRhythmContact(int RestartNextGraceHost, int NotePreferredIsonoeMessage) { this.ListExternalHeliumInterval(RestartNextGraceHost, NotePreferredIsonoeMessage, this.ContributePreviousDreamRule()); } // Token: 0x06001C6A RID: 7274 RVA: 0x000431C4 File Offset: 0x000413C4 public static ConfigureOptionalEuantheCase operator /(ConfigureOptionalEuantheCase ContainVirtualPotassiumAuthor, int ReferencePreviousLeadModule) { return new ConfigureOptionalEuantheCase(ContainVirtualPotassiumAuthor.WrapIncompatibleNitrogenProcess / ReferencePreviousLeadModule, ContainVirtualPotassiumAuthor.MonitorInnerEgretScope / ReferencePreviousLeadModule); } // Token: 0x06001C6B RID: 7275 RVA: 0x000431DB File Offset: 0x000413DB public void ScheduleDeprecatedRosalindCheckout() { this.SynchronizeTrueSilverAvailability(this.ContributePreviousDreamRule()); } // Token: 0x06001C6C RID: 7276 RVA: 0x000431E9 File Offset: 0x000413E9 public static ConfigureOptionalEuantheCase operator +(ConfigureOptionalEuantheCase ContainVirtualPotassiumAuthor, ConfigureOptionalEuantheCase ReferencePreviousLeadModule) { return new ConfigureOptionalEuantheCase(ContainVirtualPotassiumAuthor.WrapIncompatibleNitrogenProcess + ReferencePreviousLeadModule.WrapIncompatibleNitrogenProcess, ContainVirtualPotassiumAuthor.MonitorInnerEgretScope + ReferencePreviousLeadModule.MonitorInnerEgretScope); } // Token: 0x06001C6D RID: 7277 RVA: 0x0004320A File Offset: 0x0004140A public static ConfigureOptionalEuantheCase operator -(ConfigureOptionalEuantheCase ContainVirtualPotassiumAuthor, ConfigureOptionalEuantheCase ReferencePreviousLeadModule) { return new ConfigureOptionalEuantheCase(ContainVirtualPotassiumAuthor.WrapIncompatibleNitrogenProcess - ReferencePreviousLeadModule.WrapIncompatibleNitrogenProcess, ContainVirtualPotassiumAuthor.MonitorInnerEgretScope - ReferencePreviousLeadModule.MonitorInnerEgretScope); } // Token: 0x06001C6E RID: 7278 RVA: 0x0004322B File Offset: 0x0004142B public int ContributePreviousDreamRule() { return ConfigureOptionalEuantheCase.RedirectPreviousPuckLatency++; } // Token: 0x06001C6F RID: 7279 RVA: 0x0004323C File Offset: 0x0004143C public void ExportExternalMatadorDescription(int RestartNextGraceHost, int NotePreferredIsonoeMessage, int DeployInitialSkollYou, int AdjustInitialRoseScreen) { var FindMultipleMintLimit = new <>f__AnonymousType193<int, int>[] { new { BootOptionalPlatinumGraphic = RestartNextGraceHost, IntroduceMatchingDaphnisCrash = NotePreferredIsonoeMessage }, new { BootOptionalPlatinumGraphic = DeployInitialSkollYou, IntroduceMatchingDaphnisCrash = AdjustInitialRoseScreen } }; this.InvokeStaticKaleOffset(RestartNextGraceHost); this.InvokeStaticKaleOffset(NotePreferredIsonoeMessage); this.InvokeStaticKaleOffset(DeployInitialSkollYou); this.InvokeStaticKaleOffset(AdjustInitialRoseScreen); if (FindMultipleMintLimit[0].BootOptionalPlatinumGraphic == this.ContributePreviousDreamRule()) { this.RevertCoreFlamingoTransition(FindMultipleMintLimit[0].IntroduceMatchingDaphnisCrash); } if (FindMultipleMintLimit[1].BootOptionalPlatinumGraphic == this.ContributePreviousDreamRule()) { this.RevertCoreFlamingoTransition(FindMultipleMintLimit[1].IntroduceMatchingDaphnisCrash); } } // Token: 0x06001C70 RID: 7280 RVA: 0x000432BE File Offset: 0x000414BE public static ConfigureOptionalEuantheCase operator *(ConfigureOptionalEuantheCase ContainVirtualPotassiumAuthor, int ReferencePreviousLeadModule) { return new ConfigureOptionalEuantheCase(ContainVirtualPotassiumAuthor.WrapIncompatibleNitrogenProcess * ReferencePreviousLeadModule, ContainVirtualPotassiumAuthor.MonitorInnerEgretScope * ReferencePreviousLeadModule); } // Token: 0x06001C71 RID: 7281 RVA: 0x000432D5 File Offset: 0x000414D5 public void InvokeStaticKaleOffset(int ObtainActiveCosmoNull) { ConfigureOptionalEuantheCase.RedirectPreviousPuckLatency += ObtainActiveCosmoNull; } // Token: 0x06001C72 RID: 7282 RVA: 0x000432E3 File Offset: 0x000414E3 public int BreakGenericFranciumLookup() { if (this.DeleteExtraMarineConnection() != 0) { return ConfigureOptionalEuantheCase.InitializeApplicableMacaronCache; } return 0; } // Token: 0x06001C73 RID: 7283 RVA: 0x000432F4 File Offset: 0x000414F4 public void RevertCoreFlamingoTransition(int InspectAlternativePanPopup) { ConfigureOptionalEuantheCase.RedirectPreviousPuckLatency -= InspectAlternativePanPopup; this.ScheduleDeprecatedRosalindCheckout(); } // Token: 0x06001C74 RID: 7284 RVA: 0x00043308 File Offset: 0x00041508 public void SynchronizeTrueSilverAvailability(int RestartNextGraceHost) { this.ShareCoreRhythmContact(RestartNextGraceHost, this.ContributePreviousDreamRule()); } // Token: 0x06001C75 RID: 7285 RVA: 0x00043317 File Offset: 0x00041517 public int RetrieveLocalAmaltheaPrefix() { return this.BreakGenericFranciumLookup() + ConfigureOptionalEuantheCase.OutputPublicMarchCertificate; } // Token: 0x06001C76 RID: 7286 RVA: 0x00043325 File Offset: 0x00041525 public AvoidFalseTethysSpace ShowUnauthorizedFelicePackage() { return new AvoidFalseTethysSpace((double)this.WrapIncompatibleNitrogenProcess, (double)this.MonitorInnerEgretScope); } // Token: 0x06001C77 RID: 7287 RVA: 0x0004333A File Offset: 0x0004153A public int DeleteExtraMarineConnection() { return ConfigureOptionalEuantheCase.WarnSpecificEuantheUsername; } // Token: 0x06001C78 RID: 7288 RVA: 0x00043341 File Offset: 0x00041541 public ConfigureOptionalEuantheCase(int DistributeNormalCalciumChoice, int RegisterStandaloneUmbrielLabel) { this.WrapIncompatibleNitrogenProcess = DistributeNormalCalciumChoice; this.MonitorInnerEgretScope = RegisterStandaloneUmbrielLabel; } // Token: 0x06001C79 RID: 7289 RVA: 0x00043351 File Offset: 0x00041551 public int CrashAdditionalVanadiumDialog() { if (this.RetrieveLocalAmaltheaPrefix() == 1) { return ConfigureOptionalEuantheCase.ExistUnknownMolybdenumScope; } return 1; } // Token: 0x04000C5B RID: 3163 public static int OverwriteExternalHaumeaCloud; // Token: 0x04000C5C RID: 3164 public int MonitorInnerEgretScope; // Token: 0x04000C5D RID: 3165 public static int WarnSpecificEuantheUsername; // Token: 0x04000C5E RID: 3166 public int WrapIncompatibleNitrogenProcess; // Token: 0x04000C5F RID: 3167 public static int ExistUnknownMolybdenumScope; // Token: 0x04000C60 RID: 3168 public static int OutputPublicMarchCertificate; // Token: 0x04000C61 RID: 3169 public static int InitializeApplicableMacaronCache; // Token: 0x04000C62 RID: 3170 public static int RedirectPreviousPuckLatency; } }
41.291892
275
0.812279
[ "MIT" ]
soleil-taruto/Hatena
a20201226/Decompile/Confused_03/Elsa20200001/ConfigureOptionalEuantheCase.cs
7,641
C#
// (c) Copyright Microsoft Corporation. // This source is subject to the Microsoft Public License (Ms-PL). // Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details. // All other rights reserved. using System; using System.Windows.Controls; namespace Microsoft.Phone.Controls.Primitives { /// <summary> /// Defines how the LoopingSelector communicates with data source. /// </summary> /// <QualityBand>Preview</QualityBand> public interface ILoopingSelectorDataSource { /// <summary> /// Get the next datum, relative to an existing datum. /// </summary> /// <param name="relativeTo">The datum the return value will be relative to.</param> /// <returns>The next datum.</returns> object GetNext(object relativeTo); /// <summary> /// Get the previous datum, relative to an existing datum. /// </summary> /// <param name="relativeTo">The datum the return value will be relative to.</param> /// <returns>The previous datum.</returns> object GetPrevious(object relativeTo); /// <summary> /// The selected item. Should never be null. /// </summary> object SelectedItem { get; set; } /// <summary> /// Raised when the selection changes. /// </summary> event EventHandler<SelectionChangedEventArgs> SelectionChanged; } }
33.809524
92
0.632394
[ "MIT" ]
misenhower/WPRemote
CommonLibraries/Libraries/Microsoft.Phone.Controls.Toolkit/Microsoft.Phone.Controls.Toolkit/Primitives/LoopingSelectorDataSource.cs
1,422
C#
using System; namespace NAudio.Wave { /// <summary> /// Represents Channel for the WaveMixerStream /// 32 bit output and 16 bit input /// It's output is always stereo /// The input stream can be panned /// </summary> public class WaveChannel32 : WaveStream, ISampleNotifier { private WaveStream sourceStream; private readonly WaveFormat waveFormat; private readonly long length; private readonly int destBytesPerSample; private readonly int sourceBytesPerSample; private volatile float volume; private volatile float pan; private long position; /// <summary> /// Creates a new WaveChannel32 /// </summary> /// <param name="sourceStream">the source stream</param> /// <param name="volume">stream volume (1 is 0dB)</param> /// <param name="pan">pan control (-1 to 1)</param> public WaveChannel32(WaveStream sourceStream, float volume, float pan) { PadWithZeroes = true; if (sourceStream.WaveFormat.Encoding != WaveFormatEncoding.Pcm) throw new ApplicationException("Only PCM supported"); if (sourceStream.WaveFormat.BitsPerSample != 16) throw new ApplicationException("Only 16 bit audio supported"); // always outputs stereo 32 bit waveFormat = WaveFormat.CreateIeeeFloatWaveFormat(sourceStream.WaveFormat.SampleRate, 2); destBytesPerSample = 8; // includes stereo factoring this.sourceStream = sourceStream; this.volume = volume; this.pan = pan; sourceBytesPerSample = sourceStream.WaveFormat.Channels * sourceStream.WaveFormat.BitsPerSample / 8; long sourceSamples = sourceStream.Length / sourceBytesPerSample; length = sourceSamples * destBytesPerSample; // output is stereo position = 0; } /// <summary> /// Creates a WaveChannel32 with default settings /// </summary> /// <param name="sourceStream">The source stream</param> public WaveChannel32(WaveStream sourceStream) : this(sourceStream, 1.0f, 0.0f) { } /// <summary> /// Gets the block alignment for this WaveStream /// </summary> public override int BlockAlign { get { return sourceStream.BlockAlign * (destBytesPerSample / sourceBytesPerSample); } } /// <summary> /// Returns the stream length /// </summary> public override long Length { get { return length; } } /// <summary> /// Gets or sets the current position in the stream /// </summary> public override long Position { get { return position; } set { lock (this) { // make sure we don't get out of sync value -= (value % BlockAlign); if (value < 0) sourceStream.Position = 0; else sourceStream.Position = (value / destBytesPerSample) * sourceBytesPerSample; position = value; } } } byte[] sourceBuffer; /// <summary> /// Helper function to avoid creating a new buffer every read /// </summary> byte[] GetSourceBuffer(int bytesRequired) { if (sourceBuffer == null || sourceBuffer.Length < bytesRequired) { sourceBuffer = new byte[Math.Min(sourceStream.WaveFormat.AverageBytesPerSecond,bytesRequired)]; } return sourceBuffer; } /// <summary> /// Reads bytes from this wave stream /// </summary> /// <param name="destBuffer">The destination buffer</param> /// <param name="offset">Offset into the destination buffer</param> /// <param name="numBytes">Number of bytes read</param> /// <returns>Number of bytes read.</returns> public override int Read(byte[] destBuffer, int offset, int numBytes) { int bytesWritten = 0; // 1. fill with silence if (position < 0) { bytesWritten = (int)Math.Min(numBytes, 0 - position); for (int n = 0; n < bytesWritten; n++) destBuffer[n + offset] = 0; } if (bytesWritten < numBytes) { if (sourceStream.WaveFormat.Channels == 1) { int sourceBytesRequired = (numBytes - bytesWritten) / 4; byte[] sourceBuffer = GetSourceBuffer(sourceBytesRequired); int read = sourceStream.Read(sourceBuffer, 0, sourceBytesRequired); MonoToStereo(destBuffer, offset + bytesWritten, sourceBuffer, read); bytesWritten += (read * 4); } else { int sourceBytesRequired = (numBytes - bytesWritten) / 2; byte[] sourceBuffer = GetSourceBuffer(sourceBytesRequired); int read = sourceStream.Read(sourceBuffer, 0, sourceBytesRequired); AdjustVolume(destBuffer, offset + bytesWritten, sourceBuffer, read); bytesWritten += (read * 2); } } // 3. Fill out with zeroes if (PadWithZeroes && bytesWritten < numBytes) { Array.Clear(destBuffer, offset + bytesWritten, numBytes - bytesWritten); bytesWritten = numBytes; } position += bytesWritten; return bytesWritten; } /// <summary> /// If true, Read always returns the number of bytes requested /// </summary> public bool PadWithZeroes { get; set; } /// <summary> /// Converts Mono to stereo, adjusting volume and pan /// </summary> private unsafe void MonoToStereo(byte[] destBuffer, int offset, byte[] sourceBuffer, int bytesRead) { fixed (byte* pDestBuffer = &destBuffer[offset], pSourceBuffer = &sourceBuffer[0]) { float* pfDestBuffer = (float*)pDestBuffer; short* psSourceBuffer = (short*)pSourceBuffer; // implement better panning laws. float leftVolume = (pan <= 0) ? volume : (volume * (1 - pan) / 2.0f); float rightVolume = (pan >= 0) ? volume : (volume * (pan + 1) / 2.0f); leftVolume = leftVolume / 32768f; rightVolume = rightVolume / 32768f; int samplesRead = bytesRead / 2; for (int n = 0; n < samplesRead; n++) { pfDestBuffer[n * 2] = psSourceBuffer[n] * leftVolume; pfDestBuffer[n * 2 + 1] = psSourceBuffer[n] * rightVolume; if (Sample != null) RaiseSample(pfDestBuffer[n * 2], pfDestBuffer[n * 2 + 1]); } } } /// <summary> /// Converts stereo to stereo /// </summary> private unsafe void AdjustVolume(byte[] destBuffer, int offset, byte[] sourceBuffer, int bytesRead) { fixed (byte* pDestBuffer = &destBuffer[offset], pSourceBuffer = &sourceBuffer[0]) { float* pfDestBuffer = (float*)pDestBuffer; short* psSourceBuffer = (short*)pSourceBuffer; // implement better panning laws. float leftVolume = (pan <= 0) ? volume : (volume * (1 - pan) / 2.0f); float rightVolume = (pan >= 0) ? volume : (volume * (pan + 1) / 2.0f); leftVolume = leftVolume / 32768f; rightVolume = rightVolume / 32768f; //float leftVolume = (volume * (1 - pan) / 2.0f) / 32768f; //float rightVolume = (volume * (pan + 1) / 2.0f) / 32768f; int samplesRead = bytesRead / 2; for (int n = 0; n < samplesRead; n += 2) { pfDestBuffer[n] = psSourceBuffer[n] * leftVolume; pfDestBuffer[n + 1] = psSourceBuffer[n + 1] * rightVolume; if (Sample != null) RaiseSample(pfDestBuffer[n], pfDestBuffer[n + 1]); } } } /// <summary> /// <see cref="WaveStream.WaveFormat"/> /// </summary> public override WaveFormat WaveFormat { get { return waveFormat; } } /// <summary> /// Volume of this channel. 1.0 = full scale /// </summary> public float Volume { get { return volume; } set { volume = value; } } /// <summary> /// Pan of this channel (from -1 to 1) /// </summary> public float Pan { get { return pan; } set { pan = value; } } /// <summary> /// Determines whether this channel has any data to play /// to allow optimisation to not read, but bump position forward /// </summary> public override bool HasData(int count) { // Check whether the source stream has data. bool sourceHasData = sourceStream.HasData(count); if (sourceHasData) { if (position + count < 0) return false; return (position < length) && (volume != 0); } return false; } /// <summary> /// Disposes this WaveStream /// </summary> protected override void Dispose(bool disposing) { if (disposing) { if (sourceStream != null) { sourceStream.Dispose(); sourceStream = null; } } else { System.Diagnostics.Debug.Assert(false, "WaveChannel32 was not Disposed"); } base.Dispose(disposing); } /// <summary> /// Block /// </summary> public event EventHandler Block; private void RaiseBlock() { var handler = Block; if (handler != null) { handler(this, EventArgs.Empty); } } /// <summary> /// Sample /// </summary> public event EventHandler<SampleEventArgs> Sample; // reuse the same object every time to avoid making lots of work for the garbage collector private SampleEventArgs sampleEventArgs = new SampleEventArgs(0,0); /// <summary> /// Raise the sample event (no check for null because it has already been done) /// </summary> private void RaiseSample(float left, float right) { sampleEventArgs.Left = left; sampleEventArgs.Right = right; Sample(this, sampleEventArgs); } } }
34.380531
112
0.499871
[ "MIT" ]
alexsigaras/auxy-robot
Code/Robot/ThirdParty/NAudio-1-3/Source Code/NAudio/Wave/WaveStreams/WaveChannel32.cs
11,655
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System; using System.Globalization; using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication.OpenIdConnect; using Microsoft.Extensions.Logging; using Microsoft.IdentityModel.Protocols.OpenIdConnect; namespace Microsoft.Identity.Web.Resource { /// <summary> /// Diagnostics used in the OpenID Connect middleware /// (used in Web Apps). /// </summary> public class OpenIdConnectMiddlewareDiagnostics : IOpenIdConnectMiddlewareDiagnostics { private readonly ILogger _logger; /// <summary> /// Constructor of the <see cref="OpenIdConnectMiddlewareDiagnostics"/>, used /// by dependency injection. /// </summary> /// <param name="logger">Logger used to log the diagnostics.</param> public OpenIdConnectMiddlewareDiagnostics(ILogger<OpenIdConnectMiddlewareDiagnostics> logger) { _logger = logger; } // Summary: // Invoked before redirecting to the identity provider to authenticate. This can // be used to set ProtocolMessage.State that will be persisted through the authentication // process. The ProtocolMessage can also be used to add or customize parameters // sent to the identity provider. private Func<RedirectContext, Task> s_onRedirectToIdentityProvider = null!; // Summary: // Invoked when a protocol message is first received. private Func<MessageReceivedContext, Task> s_onMessageReceived = null!; // Summary: // Invoked after security token validation if an authorization code is present in // the protocol message. private Func<AuthorizationCodeReceivedContext, Task> s_onAuthorizationCodeReceived = null!; // Summary: // Invoked after "authorization code" is redeemed for tokens at the token endpoint. private Func<TokenResponseReceivedContext, Task> s_onTokenResponseReceived = null!; // Summary: // Invoked when an IdToken has been validated and produced an AuthenticationTicket. private Func<TokenValidatedContext, Task> s_onTokenValidated = null!; // Summary: // Invoked when user information is retrieved from the UserInfoEndpoint. private Func<UserInformationReceivedContext, Task> s_onUserInformationReceived = null!; // Summary: // Invoked if exceptions are thrown during request processing. The exceptions will // be re-thrown after this event unless suppressed. private Func<AuthenticationFailedContext, Task> s_onAuthenticationFailed = null!; // Summary: // Invoked when a request is received on the RemoteSignOutPath. private Func<RemoteSignOutContext, Task> s_onRemoteSignOut = null!; // Summary: // Invoked before redirecting to the identity provider to sign out. private Func<RedirectContext, Task> s_onRedirectToIdentityProviderForSignOut = null!; // Summary: // Invoked before redirecting to the Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectOptions.SignedOutRedirectUri // at the end of a remote sign-out flow. private Func<RemoteSignOutContext, Task> s_onSignedOutCallbackRedirect = null!; /// <summary> /// Subscribes to all the OpenIdConnect events, to help debugging, while /// preserving the previous handlers (which are called). /// </summary> /// <param name="events">Events to subscribe to.</param> public void Subscribe(OpenIdConnectEvents events) { events ??= new OpenIdConnectEvents(); s_onRedirectToIdentityProvider = events.OnRedirectToIdentityProvider; events.OnRedirectToIdentityProvider = OnRedirectToIdentityProviderAsync; s_onMessageReceived = events.OnMessageReceived; events.OnMessageReceived = OnMessageReceivedAsync; s_onAuthorizationCodeReceived = events.OnAuthorizationCodeReceived; events.OnAuthorizationCodeReceived = OnAuthorizationCodeReceivedAsync; s_onTokenResponseReceived = events.OnTokenResponseReceived; events.OnTokenResponseReceived = OnTokenResponseReceivedAsync; s_onTokenValidated = events.OnTokenValidated; events.OnTokenValidated = OnTokenValidatedAsync; s_onUserInformationReceived = events.OnUserInformationReceived; events.OnUserInformationReceived = OnUserInformationReceivedAsync; s_onAuthenticationFailed = events.OnAuthenticationFailed; events.OnAuthenticationFailed = OnAuthenticationFailedAsync; s_onRemoteSignOut = events.OnRemoteSignOut; events.OnRemoteSignOut = OnRemoteSignOutAsync; s_onRedirectToIdentityProviderForSignOut = events.OnRedirectToIdentityProviderForSignOut; events.OnRedirectToIdentityProviderForSignOut = OnRedirectToIdentityProviderForSignOutAsync; s_onSignedOutCallbackRedirect = events.OnSignedOutCallbackRedirect; events.OnSignedOutCallbackRedirect = OnSignedOutCallbackRedirectAsync; } private async Task OnRedirectToIdentityProviderAsync(RedirectContext context) { _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodBegin, nameof(OnRedirectToIdentityProviderAsync))); await s_onRedirectToIdentityProvider(context).ConfigureAwait(false); _logger.LogDebug(" Sending OpenIdConnect message:"); DisplayProtocolMessage(context.ProtocolMessage); _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodEnd, nameof(OnRedirectToIdentityProviderAsync))); } private void DisplayProtocolMessage(OpenIdConnectMessage message) { foreach (var property in message.GetType().GetProperties()) { object? value = property.GetValue(message); if (value != null) { _logger.LogDebug($" - {property.Name}={value}"); } } } private async Task OnMessageReceivedAsync(MessageReceivedContext context) { _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodBegin, nameof(OnMessageReceivedAsync))); _logger.LogDebug(" Received from STS the OpenIdConnect message:"); DisplayProtocolMessage(context.ProtocolMessage); await s_onMessageReceived(context).ConfigureAwait(false); _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodEnd, nameof(OnMessageReceivedAsync))); } private async Task OnAuthorizationCodeReceivedAsync(AuthorizationCodeReceivedContext context) { _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodBegin, nameof(OnAuthorizationCodeReceivedAsync))); await s_onAuthorizationCodeReceived(context).ConfigureAwait(false); _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodEnd, nameof(OnAuthorizationCodeReceivedAsync))); } private async Task OnTokenResponseReceivedAsync(TokenResponseReceivedContext context) { _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodBegin, nameof(OnTokenResponseReceivedAsync))); await s_onTokenResponseReceived(context).ConfigureAwait(false); _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodEnd, nameof(OnTokenResponseReceivedAsync))); } private async Task OnTokenValidatedAsync(TokenValidatedContext context) { _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodBegin, nameof(OnTokenValidatedAsync))); await s_onTokenValidated(context).ConfigureAwait(false); _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodEnd, nameof(OnTokenValidatedAsync))); } private async Task OnUserInformationReceivedAsync(UserInformationReceivedContext context) { _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodBegin, nameof(OnUserInformationReceivedAsync))); await s_onUserInformationReceived(context).ConfigureAwait(false); _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodEnd, nameof(OnUserInformationReceivedAsync))); } private async Task OnAuthenticationFailedAsync(AuthenticationFailedContext context) { _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodBegin, nameof(OnAuthenticationFailedAsync))); await s_onAuthenticationFailed(context).ConfigureAwait(false); _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodEnd, nameof(OnAuthenticationFailedAsync))); } private async Task OnRedirectToIdentityProviderForSignOutAsync(RedirectContext context) { _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodBegin, nameof(OnRedirectToIdentityProviderForSignOutAsync))); await s_onRedirectToIdentityProviderForSignOut(context).ConfigureAwait(false); _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodEnd, nameof(OnRedirectToIdentityProviderForSignOutAsync))); } private async Task OnRemoteSignOutAsync(RemoteSignOutContext context) { _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodBegin, nameof(OnRemoteSignOutAsync))); await s_onRemoteSignOut(context).ConfigureAwait(false); _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodEnd, nameof(OnRemoteSignOutAsync))); } private async Task OnSignedOutCallbackRedirectAsync(RemoteSignOutContext context) { _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodBegin, nameof(OnSignedOutCallbackRedirectAsync))); await s_onSignedOutCallbackRedirect(context).ConfigureAwait(false); _logger.LogDebug(string.Format(CultureInfo.InvariantCulture, LogMessages.MethodEnd, nameof(OnSignedOutCallbackRedirectAsync))); } } }
51.61165
152
0.717269
[ "MIT" ]
TiagoBrenck/microsoft-identity-web
src/Microsoft.Identity.Web/Resource/OpenIdConnectMiddlewareDiagnostics.cs
10,634
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.GoogleNative.Compute.Alpha { /// <summary> /// Creates a HealthCheck resource in the specified project using the data included in the request. /// </summary> [GoogleNativeResourceType("google-native:compute/alpha:RegionHealthCheck")] public partial class RegionHealthCheck : Pulumi.CustomResource { /// <summary> /// How often (in seconds) to send a health check. The default value is 5 seconds. /// </summary> [Output("checkIntervalSec")] public Output<int> CheckIntervalSec { get; private set; } = null!; /// <summary> /// Creation timestamp in 3339 text format. /// </summary> [Output("creationTimestamp")] public Output<string> CreationTimestamp { get; private set; } = null!; /// <summary> /// An optional description of this resource. Provide this property when you create the resource. /// </summary> [Output("description")] public Output<string> Description { get; private set; } = null!; [Output("grpcHealthCheck")] public Output<Outputs.GRPCHealthCheckResponse> GrpcHealthCheck { get; private set; } = null!; /// <summary> /// A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2. /// </summary> [Output("healthyThreshold")] public Output<int> HealthyThreshold { get; private set; } = null!; [Output("http2HealthCheck")] public Output<Outputs.HTTP2HealthCheckResponse> Http2HealthCheck { get; private set; } = null!; [Output("httpHealthCheck")] public Output<Outputs.HTTPHealthCheckResponse> HttpHealthCheck { get; private set; } = null!; [Output("httpsHealthCheck")] public Output<Outputs.HTTPSHealthCheckResponse> HttpsHealthCheck { get; private set; } = null!; /// <summary> /// Type of the resource. /// </summary> [Output("kind")] public Output<string> Kind { get; private set; } = null!; /// <summary> /// Configure logging on this health check. /// </summary> [Output("logConfig")] public Output<Outputs.HealthCheckLogConfigResponse> LogConfig { get; private set; } = null!; /// <summary> /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. For example, a name that is 1-63 characters long, matches the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`, and otherwise complies with RFC1035. This regular expression describes a name where the first character is a lowercase letter, and all following characters are a dash, lowercase letter, or digit, except the last character, which isn't a dash. /// </summary> [Output("name")] public Output<string> Name { get; private set; } = null!; /// <summary> /// Region where the health check resides. Not applicable to global health checks. /// </summary> [Output("region")] public Output<string> Region { get; private set; } = null!; /// <summary> /// Server-defined URL for the resource. /// </summary> [Output("selfLink")] public Output<string> SelfLink { get; private set; } = null!; /// <summary> /// Server-defined URL for this resource with the resource id. /// </summary> [Output("selfLinkWithId")] public Output<string> SelfLinkWithId { get; private set; } = null!; [Output("sslHealthCheck")] public Output<Outputs.SSLHealthCheckResponse> SslHealthCheck { get; private set; } = null!; [Output("tcpHealthCheck")] public Output<Outputs.TCPHealthCheckResponse> TcpHealthCheck { get; private set; } = null!; /// <summary> /// How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec. /// </summary> [Output("timeoutSec")] public Output<int> TimeoutSec { get; private set; } = null!; /// <summary> /// Specifies the type of the healthCheck, either TCP, SSL, HTTP, HTTPS or HTTP2. Exactly one of the protocol-specific health check field must be specified, which must match type field. /// </summary> [Output("type")] public Output<string> Type { get; private set; } = null!; [Output("udpHealthCheck")] public Output<Outputs.UDPHealthCheckResponse> UdpHealthCheck { get; private set; } = null!; /// <summary> /// A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2. /// </summary> [Output("unhealthyThreshold")] public Output<int> UnhealthyThreshold { get; private set; } = null!; /// <summary> /// Create a RegionHealthCheck resource with the given unique name, arguments, and options. /// </summary> /// /// <param name="name">The unique name of the resource</param> /// <param name="args">The arguments used to populate this resource's properties</param> /// <param name="options">A bag of options that control this resource's behavior</param> public RegionHealthCheck(string name, RegionHealthCheckArgs args, CustomResourceOptions? options = null) : base("google-native:compute/alpha:RegionHealthCheck", name, args ?? new RegionHealthCheckArgs(), MakeResourceOptions(options, "")) { } private RegionHealthCheck(string name, Input<string> id, CustomResourceOptions? options = null) : base("google-native:compute/alpha:RegionHealthCheck", name, null, MakeResourceOptions(options, id)) { } private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id) { var defaultOptions = new CustomResourceOptions { Version = Utilities.Version, }; var merged = CustomResourceOptions.Merge(defaultOptions, options); // Override the ID if one was specified for consistency with other language SDKs. merged.Id = id ?? merged.Id; return merged; } /// <summary> /// Get an existing RegionHealthCheck resource's state with the given name, ID, and optional extra /// properties used to qualify the lookup. /// </summary> /// /// <param name="name">The unique name of the resulting resource.</param> /// <param name="id">The unique provider ID of the resource to lookup.</param> /// <param name="options">A bag of options that control this resource's behavior</param> public static RegionHealthCheck Get(string name, Input<string> id, CustomResourceOptions? options = null) { return new RegionHealthCheck(name, id, options); } } public sealed class RegionHealthCheckArgs : Pulumi.ResourceArgs { /// <summary> /// How often (in seconds) to send a health check. The default value is 5 seconds. /// </summary> [Input("checkIntervalSec")] public Input<int>? CheckIntervalSec { get; set; } /// <summary> /// An optional description of this resource. Provide this property when you create the resource. /// </summary> [Input("description")] public Input<string>? Description { get; set; } [Input("grpcHealthCheck")] public Input<Inputs.GRPCHealthCheckArgs>? GrpcHealthCheck { get; set; } /// <summary> /// A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2. /// </summary> [Input("healthyThreshold")] public Input<int>? HealthyThreshold { get; set; } [Input("http2HealthCheck")] public Input<Inputs.HTTP2HealthCheckArgs>? Http2HealthCheck { get; set; } [Input("httpHealthCheck")] public Input<Inputs.HTTPHealthCheckArgs>? HttpHealthCheck { get; set; } [Input("httpsHealthCheck")] public Input<Inputs.HTTPSHealthCheckArgs>? HttpsHealthCheck { get; set; } /// <summary> /// Type of the resource. /// </summary> [Input("kind")] public Input<string>? Kind { get; set; } /// <summary> /// Configure logging on this health check. /// </summary> [Input("logConfig")] public Input<Inputs.HealthCheckLogConfigArgs>? LogConfig { get; set; } /// <summary> /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. For example, a name that is 1-63 characters long, matches the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`, and otherwise complies with RFC1035. This regular expression describes a name where the first character is a lowercase letter, and all following characters are a dash, lowercase letter, or digit, except the last character, which isn't a dash. /// </summary> [Input("name")] public Input<string>? Name { get; set; } [Input("project")] public Input<string>? Project { get; set; } [Input("region", required: true)] public Input<string> Region { get; set; } = null!; [Input("requestId")] public Input<string>? RequestId { get; set; } [Input("sslHealthCheck")] public Input<Inputs.SSLHealthCheckArgs>? SslHealthCheck { get; set; } [Input("tcpHealthCheck")] public Input<Inputs.TCPHealthCheckArgs>? TcpHealthCheck { get; set; } /// <summary> /// How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec. /// </summary> [Input("timeoutSec")] public Input<int>? TimeoutSec { get; set; } /// <summary> /// Specifies the type of the healthCheck, either TCP, SSL, HTTP, HTTPS or HTTP2. Exactly one of the protocol-specific health check field must be specified, which must match type field. /// </summary> [Input("type")] public Input<Pulumi.GoogleNative.Compute.Alpha.RegionHealthCheckType>? Type { get; set; } [Input("udpHealthCheck")] public Input<Inputs.UDPHealthCheckArgs>? UdpHealthCheck { get; set; } /// <summary> /// A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2. /// </summary> [Input("unhealthyThreshold")] public Input<int>? UnhealthyThreshold { get; set; } public RegionHealthCheckArgs() { } } }
44.812749
504
0.632557
[ "Apache-2.0" ]
AaronFriel/pulumi-google-native
sdk/dotnet/Compute/Alpha/RegionHealthCheck.cs
11,248
C#
// 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. // Generated code. DO NOT EDIT! namespace Google.Apis.GameServices.v1beta { /// <summary>The GameServices Service.</summary> public class GameServicesService : Google.Apis.Services.BaseClientService { /// <summary>The API version.</summary> public const string Version = "v1beta"; /// <summary>The discovery version used to generate this service.</summary> public static Google.Apis.Discovery.DiscoveryVersion DiscoveryVersionUsed = Google.Apis.Discovery.DiscoveryVersion.Version_1_0; /// <summary>Constructs a new service.</summary> public GameServicesService() : this(new Google.Apis.Services.BaseClientService.Initializer()) { } /// <summary>Constructs a new service.</summary> /// <param name="initializer">The service initializer.</param> public GameServicesService(Google.Apis.Services.BaseClientService.Initializer initializer) : base(initializer) { Projects = new ProjectsResource(this); } /// <summary>Gets the service supported features.</summary> public override System.Collections.Generic.IList<string> Features => new string[0]; /// <summary>Gets the service name.</summary> public override string Name => "gameservices"; /// <summary>Gets the service base URI.</summary> public override string BaseUri => #if NETSTANDARD1_3 || NETSTANDARD2_0 || NET45 BaseUriOverride ?? "https://gameservices.googleapis.com/"; #else "https://gameservices.googleapis.com/"; #endif /// <summary>Gets the service base path.</summary> public override string BasePath => ""; #if !NET40 /// <summary>Gets the batch base URI; <c>null</c> if unspecified.</summary> public override string BatchUri => "https://gameservices.googleapis.com/batch"; /// <summary>Gets the batch base path; <c>null</c> if unspecified.</summary> public override string BatchPath => "batch"; #endif /// <summary>Available OAuth 2.0 scopes for use with the Game Services API.</summary> public class Scope { /// <summary>View and manage your data across Google Cloud Platform services</summary> public static string CloudPlatform = "https://www.googleapis.com/auth/cloud-platform"; } /// <summary>Available OAuth 2.0 scope constants for use with the Game Services API.</summary> public static class ScopeConstants { /// <summary>View and manage your data across Google Cloud Platform services</summary> public const string CloudPlatform = "https://www.googleapis.com/auth/cloud-platform"; } /// <summary>Gets the Projects resource.</summary> public virtual ProjectsResource Projects { get; } } /// <summary>A base abstract class for GameServices requests.</summary> public abstract class GameServicesBaseServiceRequest<TResponse> : Google.Apis.Requests.ClientServiceRequest<TResponse> { /// <summary>Constructs a new GameServicesBaseServiceRequest instance.</summary> protected GameServicesBaseServiceRequest(Google.Apis.Services.IClientService service) : base(service) { } /// <summary>V1 error format.</summary> [Google.Apis.Util.RequestParameterAttribute("$.xgafv", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<XgafvEnum> Xgafv { get; set; } /// <summary>V1 error format.</summary> public enum XgafvEnum { /// <summary>v1 error format</summary> [Google.Apis.Util.StringValueAttribute("1")] Value1, /// <summary>v2 error format</summary> [Google.Apis.Util.StringValueAttribute("2")] Value2, } /// <summary>OAuth access token.</summary> [Google.Apis.Util.RequestParameterAttribute("access_token", Google.Apis.Util.RequestParameterType.Query)] public virtual string AccessToken { get; set; } /// <summary>Data format for response.</summary> [Google.Apis.Util.RequestParameterAttribute("alt", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<AltEnum> Alt { get; set; } /// <summary>Data format for response.</summary> public enum AltEnum { /// <summary>Responses with Content-Type of application/json</summary> [Google.Apis.Util.StringValueAttribute("json")] Json, /// <summary>Media download with context-dependent Content-Type</summary> [Google.Apis.Util.StringValueAttribute("media")] Media, /// <summary>Responses with Content-Type of application/x-protobuf</summary> [Google.Apis.Util.StringValueAttribute("proto")] Proto, } /// <summary>JSONP</summary> [Google.Apis.Util.RequestParameterAttribute("callback", Google.Apis.Util.RequestParameterType.Query)] public virtual string Callback { get; set; } /// <summary>Selector specifying which fields to include in a partial response.</summary> [Google.Apis.Util.RequestParameterAttribute("fields", Google.Apis.Util.RequestParameterType.Query)] public virtual string Fields { get; set; } /// <summary>API key. Your API key identifies your project and provides you with API access, quota, and reports. /// Required unless you provide an OAuth 2.0 token.</summary> [Google.Apis.Util.RequestParameterAttribute("key", Google.Apis.Util.RequestParameterType.Query)] public virtual string Key { get; set; } /// <summary>OAuth 2.0 token for the current user.</summary> [Google.Apis.Util.RequestParameterAttribute("oauth_token", Google.Apis.Util.RequestParameterType.Query)] public virtual string OauthToken { get; set; } /// <summary>Returns response with indentations and line breaks.</summary> [Google.Apis.Util.RequestParameterAttribute("prettyPrint", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<bool> PrettyPrint { get; set; } /// <summary>Available to use for quota purposes for server-side applications. Can be any arbitrary string /// assigned to a user, but should not exceed 40 characters.</summary> [Google.Apis.Util.RequestParameterAttribute("quotaUser", Google.Apis.Util.RequestParameterType.Query)] public virtual string QuotaUser { get; set; } /// <summary>Legacy upload protocol for media (e.g. "media", "multipart").</summary> [Google.Apis.Util.RequestParameterAttribute("uploadType", Google.Apis.Util.RequestParameterType.Query)] public virtual string UploadType { get; set; } /// <summary>Upload protocol for media (e.g. "raw", "multipart").</summary> [Google.Apis.Util.RequestParameterAttribute("upload_protocol", Google.Apis.Util.RequestParameterType.Query)] public virtual string UploadProtocol { get; set; } /// <summary>Initializes GameServices parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("$.xgafv", new Google.Apis.Discovery.Parameter { Name = "$.xgafv", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("access_token", new Google.Apis.Discovery.Parameter { Name = "access_token", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("alt", new Google.Apis.Discovery.Parameter { Name = "alt", IsRequired = false, ParameterType = "query", DefaultValue = "json", Pattern = null, }); RequestParameters.Add("callback", new Google.Apis.Discovery.Parameter { Name = "callback", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("fields", new Google.Apis.Discovery.Parameter { Name = "fields", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("key", new Google.Apis.Discovery.Parameter { Name = "key", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("oauth_token", new Google.Apis.Discovery.Parameter { Name = "oauth_token", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("prettyPrint", new Google.Apis.Discovery.Parameter { Name = "prettyPrint", IsRequired = false, ParameterType = "query", DefaultValue = "true", Pattern = null, }); RequestParameters.Add("quotaUser", new Google.Apis.Discovery.Parameter { Name = "quotaUser", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("uploadType", new Google.Apis.Discovery.Parameter { Name = "uploadType", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("upload_protocol", new Google.Apis.Discovery.Parameter { Name = "upload_protocol", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>The "projects" collection of methods.</summary> public class ProjectsResource { private const string Resource = "projects"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public ProjectsResource(Google.Apis.Services.IClientService service) { this.service = service; Locations = new LocationsResource(service); } /// <summary>Gets the Locations resource.</summary> public virtual LocationsResource Locations { get; } /// <summary>The "locations" collection of methods.</summary> public class LocationsResource { private const string Resource = "locations"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public LocationsResource(Google.Apis.Services.IClientService service) { this.service = service; GameServerDeployments = new GameServerDeploymentsResource(service); Operations = new OperationsResource(service); Realms = new RealmsResource(service); } /// <summary>Gets the GameServerDeployments resource.</summary> public virtual GameServerDeploymentsResource GameServerDeployments { get; } /// <summary>The "gameServerDeployments" collection of methods.</summary> public class GameServerDeploymentsResource { private const string Resource = "gameServerDeployments"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public GameServerDeploymentsResource(Google.Apis.Services.IClientService service) { this.service = service; Configs = new ConfigsResource(service); } /// <summary>Gets the Configs resource.</summary> public virtual ConfigsResource Configs { get; } /// <summary>The "configs" collection of methods.</summary> public class ConfigsResource { private const string Resource = "configs"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public ConfigsResource(Google.Apis.Services.IClientService service) { this.service = service; } /// <summary>Creates a new game server config in a given project, location, and game server /// deployment. Game server configs are immutable, and are not applied until referenced in the game /// server deployment rollout resource.</summary> /// <param name="body">The body of the request.</param> /// <param name="parent">Required. The parent resource name. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`.</param> public virtual CreateRequest Create(Google.Apis.GameServices.v1beta.Data.GameServerConfig body, string parent) { return new CreateRequest(service, body, parent); } /// <summary>Creates a new game server config in a given project, location, and game server /// deployment. Game server configs are immutable, and are not applied until referenced in the game /// server deployment rollout resource.</summary> public class CreateRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Operation> { /// <summary>Constructs a new Create request.</summary> public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.GameServices.v1beta.Data.GameServerConfig body, string parent) : base(service) { Parent = parent; Body = body; InitParameters(); } /// <summary>Required. The parent resource name. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>Required. The ID of the game server config resource to be created.</summary> [Google.Apis.Util.RequestParameterAttribute("configId", Google.Apis.Util.RequestParameterType.Query)] public virtual string ConfigId { get; set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.GameServices.v1beta.Data.GameServerConfig Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "create"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+parent}/configs"; /// <summary>Initializes Create parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter { Name = "parent", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/gameServerDeployments/[^/]+$", }); RequestParameters.Add("configId", new Google.Apis.Discovery.Parameter { Name = "configId", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Deletes a single game server config. The deletion will fail if the game server config /// is referenced in a game server deployment rollout.</summary> /// <param name="name">Required. The name of the game server config to delete. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`.</param> public virtual DeleteRequest Delete(string name) { return new DeleteRequest(service, name); } /// <summary>Deletes a single game server config. The deletion will fail if the game server config /// is referenced in a game server deployment rollout.</summary> public class DeleteRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Operation> { /// <summary>Constructs a new Delete request.</summary> public DeleteRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>Required. The name of the game server config to delete. Uses the form: `projects/{p /// roject}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "delete"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "DELETE"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}"; /// <summary>Initializes Delete parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/gameServerDeployments/[^/]+/configs/[^/]+$", }); } } /// <summary>Gets details of a single game server config.</summary> /// <param name="name">Required. The name of the game server config to retrieve. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`.</param> public virtual GetRequest Get(string name) { return new GetRequest(service, name); } /// <summary>Gets details of a single game server config.</summary> public class GetRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.GameServerConfig> { /// <summary>Constructs a new Get request.</summary> public GetRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>Required. The name of the game server config to retrieve. Uses the form: `projects/ /// {project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`.</summar /// y> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "get"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}"; /// <summary>Initializes Get parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/gameServerDeployments/[^/]+/configs/[^/]+$", }); } } /// <summary>Lists game server configs in a given project, location, and game server /// deployment.</summary> /// <param name="parent">Required. The parent resource name. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs`.</param> public virtual ListRequest List(string parent) { return new ListRequest(service, parent); } /// <summary>Lists game server configs in a given project, location, and game server /// deployment.</summary> public class ListRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.ListGameServerConfigsResponse> { /// <summary>Constructs a new List request.</summary> public ListRequest(Google.Apis.Services.IClientService service, string parent) : base(service) { Parent = parent; InitParameters(); } /// <summary>Required. The parent resource name. Uses the form: `projects/{project}/locations/{l /// ocation}/gameServerDeployments/{deployment}/configs`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>Optional. The filter to apply to list results.</summary> [Google.Apis.Util.RequestParameterAttribute("filter", Google.Apis.Util.RequestParameterType.Query)] public virtual string Filter { get; set; } /// <summary>Optional. Specifies the ordering of results following syntax at /// https://cloud.google.com/apis/design/design_patterns#sorting_order.</summary> [Google.Apis.Util.RequestParameterAttribute("orderBy", Google.Apis.Util.RequestParameterType.Query)] public virtual string OrderBy { get; set; } /// <summary>Optional. The maximum number of items to return. If unspecified, server will pick /// an appropriate default. Server may return fewer items than requested. A caller should only /// rely on response's next_page_token to determine if there are more GameServerConfigs left to /// be queried.</summary> [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> PageSize { get; set; } /// <summary>Optional. The next_page_token value returned from a previous list request, if /// any.</summary> [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)] public virtual string PageToken { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "list"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+parent}/configs"; /// <summary>Initializes List parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter { Name = "parent", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/gameServerDeployments/[^/]+$", }); RequestParameters.Add("filter", new Google.Apis.Discovery.Parameter { Name = "filter", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("orderBy", new Google.Apis.Discovery.Parameter { Name = "orderBy", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageSize", new Google.Apis.Discovery.Parameter { Name = "pageSize", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageToken", new Google.Apis.Discovery.Parameter { Name = "pageToken", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } } /// <summary>Creates a new game server deployment in a given project and location.</summary> /// <param name="body">The body of the request.</param> /// <param name="parent">Required. The parent resource name. Uses the form: /// `projects/{project}/locations/{location}`.</param> public virtual CreateRequest Create(Google.Apis.GameServices.v1beta.Data.GameServerDeployment body, string parent) { return new CreateRequest(service, body, parent); } /// <summary>Creates a new game server deployment in a given project and location.</summary> public class CreateRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Operation> { /// <summary>Constructs a new Create request.</summary> public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.GameServices.v1beta.Data.GameServerDeployment body, string parent) : base(service) { Parent = parent; Body = body; InitParameters(); } /// <summary>Required. The parent resource name. Uses the form: /// `projects/{project}/locations/{location}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>Required. The ID of the game server delpoyment resource to be created.</summary> [Google.Apis.Util.RequestParameterAttribute("deploymentId", Google.Apis.Util.RequestParameterType.Query)] public virtual string DeploymentId { get; set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.GameServices.v1beta.Data.GameServerDeployment Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "create"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+parent}/gameServerDeployments"; /// <summary>Initializes Create parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter { Name = "parent", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+$", }); RequestParameters.Add("deploymentId", new Google.Apis.Discovery.Parameter { Name = "deploymentId", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Deletes a single game server deployment.</summary> /// <param name="name">Required. The name of the game server delpoyment to delete. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`.</param> public virtual DeleteRequest Delete(string name) { return new DeleteRequest(service, name); } /// <summary>Deletes a single game server deployment.</summary> public class DeleteRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Operation> { /// <summary>Constructs a new Delete request.</summary> public DeleteRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>Required. The name of the game server delpoyment to delete. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "delete"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "DELETE"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}"; /// <summary>Initializes Delete parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/gameServerDeployments/[^/]+$", }); } } /// <summary>Retrieves information about the current state of the game server deployment. Gathers all /// the Agones fleets and Agones autoscalers, including fleets running an older version of the game /// server deployment.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">Required. The name of the game server delpoyment. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`.</param> public virtual FetchDeploymentStateRequest FetchDeploymentState(Google.Apis.GameServices.v1beta.Data.FetchDeploymentStateRequest body, string name) { return new FetchDeploymentStateRequest(service, body, name); } /// <summary>Retrieves information about the current state of the game server deployment. Gathers all /// the Agones fleets and Agones autoscalers, including fleets running an older version of the game /// server deployment.</summary> public class FetchDeploymentStateRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.FetchDeploymentStateResponse> { /// <summary>Constructs a new FetchDeploymentState request.</summary> public FetchDeploymentStateRequest(Google.Apis.Services.IClientService service, Google.Apis.GameServices.v1beta.Data.FetchDeploymentStateRequest body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>Required. The name of the game server delpoyment. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.GameServices.v1beta.Data.FetchDeploymentStateRequest Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "fetchDeploymentState"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}:fetchDeploymentState"; /// <summary>Initializes FetchDeploymentState parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/gameServerDeployments/[^/]+$", }); } } /// <summary>Gets details of a single game server deployment.</summary> /// <param name="name">Required. The name of the game server delpoyment to retrieve. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`.</param> public virtual GetRequest Get(string name) { return new GetRequest(service, name); } /// <summary>Gets details of a single game server deployment.</summary> public class GetRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.GameServerDeployment> { /// <summary>Constructs a new Get request.</summary> public GetRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>Required. The name of the game server delpoyment to retrieve. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "get"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}"; /// <summary>Initializes Get parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/gameServerDeployments/[^/]+$", }); } } /// <summary>Gets the access control policy for a resource. Returns an empty policy if the resource /// exists and does not have a policy set.</summary> /// <param name="resource">REQUIRED: The resource for which the policy is being requested. See the operation /// documentation for the appropriate value for this field.</param> public virtual GetIamPolicyRequest GetIamPolicy(string resource) { return new GetIamPolicyRequest(service, resource); } /// <summary>Gets the access control policy for a resource. Returns an empty policy if the resource /// exists and does not have a policy set.</summary> public class GetIamPolicyRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Policy> { /// <summary>Constructs a new GetIamPolicy request.</summary> public GetIamPolicyRequest(Google.Apis.Services.IClientService service, string resource) : base(service) { Resource = resource; InitParameters(); } /// <summary>REQUIRED: The resource for which the policy is being requested. See the operation /// documentation for the appropriate value for this field.</summary> [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)] public virtual string Resource { get; private set; } /// <summary>Optional. The policy format version to be returned. Valid values are 0, 1, and 3. /// Requests specifying an invalid value will be rejected. Requests for policies with any /// conditional bindings must specify version 3. Policies without any conditional bindings may /// specify any valid value or leave the field unset. To learn which resources support conditions in /// their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions /// /resource-policies).</summary> [Google.Apis.Util.RequestParameterAttribute("options.requestedPolicyVersion", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> OptionsRequestedPolicyVersion { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "getIamPolicy"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+resource}:getIamPolicy"; /// <summary>Initializes GetIamPolicy parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("resource", new Google.Apis.Discovery.Parameter { Name = "resource", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/gameServerDeployments/[^/]+$", }); RequestParameters.Add("options.requestedPolicyVersion", new Google.Apis.Discovery.Parameter { Name = "options.requestedPolicyVersion", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Gets details a single game server deployment rollout.</summary> /// <param name="name">Required. The name of the game server delpoyment to retrieve. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`.</param> public virtual GetRolloutRequest GetRollout(string name) { return new GetRolloutRequest(service, name); } /// <summary>Gets details a single game server deployment rollout.</summary> public class GetRolloutRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.GameServerDeploymentRollout> { /// <summary>Constructs a new GetRollout request.</summary> public GetRolloutRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>Required. The name of the game server delpoyment to retrieve. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "getRollout"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}/rollout"; /// <summary>Initializes GetRollout parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/gameServerDeployments/[^/]+$", }); } } /// <summary>Lists game server deployments in a given project and location.</summary> /// <param name="parent">Required. The parent resource name. Uses the form: /// `projects/{project}/locations/{location}`.</param> public virtual ListRequest List(string parent) { return new ListRequest(service, parent); } /// <summary>Lists game server deployments in a given project and location.</summary> public class ListRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.ListGameServerDeploymentsResponse> { /// <summary>Constructs a new List request.</summary> public ListRequest(Google.Apis.Services.IClientService service, string parent) : base(service) { Parent = parent; InitParameters(); } /// <summary>Required. The parent resource name. Uses the form: /// `projects/{project}/locations/{location}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>Optional. The filter to apply to list results.</summary> [Google.Apis.Util.RequestParameterAttribute("filter", Google.Apis.Util.RequestParameterType.Query)] public virtual string Filter { get; set; } /// <summary>Optional. Specifies the ordering of results following syntax at /// https://cloud.google.com/apis/design/design_patterns#sorting_order.</summary> [Google.Apis.Util.RequestParameterAttribute("orderBy", Google.Apis.Util.RequestParameterType.Query)] public virtual string OrderBy { get; set; } /// <summary>Optional. The maximum number of items to return. If unspecified, the server will pick /// an appropriate default. The server may return fewer items than requested. A caller should only /// rely on response's next_page_token to determine if there are more GameServerDeployments left to /// be queried.</summary> [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> PageSize { get; set; } /// <summary>Optional. The next_page_token value returned from a previous List request, if /// any.</summary> [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)] public virtual string PageToken { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "list"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+parent}/gameServerDeployments"; /// <summary>Initializes List parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter { Name = "parent", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+$", }); RequestParameters.Add("filter", new Google.Apis.Discovery.Parameter { Name = "filter", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("orderBy", new Google.Apis.Discovery.Parameter { Name = "orderBy", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageSize", new Google.Apis.Discovery.Parameter { Name = "pageSize", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageToken", new Google.Apis.Discovery.Parameter { Name = "pageToken", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Patches a game server deployment.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">The resource name of the game server deployment. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. For example, `projects/my- /// project/locations/global/gameServerDeployments/my-deployment`.</param> public virtual PatchRequest Patch(Google.Apis.GameServices.v1beta.Data.GameServerDeployment body, string name) { return new PatchRequest(service, body, name); } /// <summary>Patches a game server deployment.</summary> public class PatchRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Operation> { /// <summary>Constructs a new Patch request.</summary> public PatchRequest(Google.Apis.Services.IClientService service, Google.Apis.GameServices.v1beta.Data.GameServerDeployment body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>The resource name of the game server deployment. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. For example, /// `projects/my-project/locations/global/gameServerDeployments/my-deployment`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Required. Mask of fields to update. At least one path must be supplied in this field. /// For the `FieldMask` definition, see https: //developers.google.com/protocol-buffers // /// /docs/reference/google.protobuf#fieldmask</summary> [Google.Apis.Util.RequestParameterAttribute("updateMask", Google.Apis.Util.RequestParameterType.Query)] public virtual object UpdateMask { get; set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.GameServices.v1beta.Data.GameServerDeployment Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "patch"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "PATCH"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}"; /// <summary>Initializes Patch parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/gameServerDeployments/[^/]+$", }); RequestParameters.Add("updateMask", new Google.Apis.Discovery.Parameter { Name = "updateMask", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Previews the game server deployment rollout. This API does not mutate the rollout /// resource.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">The resource name of the game server deployment rollout. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. For example, `projects/my- /// project/locations/global/gameServerDeployments/my-deployment/rollout`.</param> public virtual PreviewRolloutRequest PreviewRollout(Google.Apis.GameServices.v1beta.Data.GameServerDeploymentRollout body, string name) { return new PreviewRolloutRequest(service, body, name); } /// <summary>Previews the game server deployment rollout. This API does not mutate the rollout /// resource.</summary> public class PreviewRolloutRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.PreviewGameServerDeploymentRolloutResponse> { /// <summary>Constructs a new PreviewRollout request.</summary> public PreviewRolloutRequest(Google.Apis.Services.IClientService service, Google.Apis.GameServices.v1beta.Data.GameServerDeploymentRollout body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>The resource name of the game server deployment rollout. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. For /// example, `projects/my-project/locations/global/gameServerDeployments/my- /// deployment/rollout`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Optional. The target timestamp to compute the preview. Defaults to the immediately /// after the proposed rollout completes.</summary> [Google.Apis.Util.RequestParameterAttribute("previewTime", Google.Apis.Util.RequestParameterType.Query)] public virtual object PreviewTime { get; set; } /// <summary>Optional. Mask of fields to update. At least one path must be supplied in this field. /// For the `FieldMask` definition, see https: //developers.google.com/protocol-buffers // /// /docs/reference/google.protobuf#fieldmask</summary> [Google.Apis.Util.RequestParameterAttribute("updateMask", Google.Apis.Util.RequestParameterType.Query)] public virtual object UpdateMask { get; set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.GameServices.v1beta.Data.GameServerDeploymentRollout Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "previewRollout"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "PATCH"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}/rollout:preview"; /// <summary>Initializes PreviewRollout parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/gameServerDeployments/[^/]+$", }); RequestParameters.Add("previewTime", new Google.Apis.Discovery.Parameter { Name = "previewTime", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("updateMask", new Google.Apis.Discovery.Parameter { Name = "updateMask", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Sets the access control policy on the specified resource. Replaces any existing policy. Can /// return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.</summary> /// <param name="body">The body of the request.</param> /// <param name="resource">REQUIRED: The resource for which the policy is being specified. See the operation /// documentation for the appropriate value for this field.</param> public virtual SetIamPolicyRequest SetIamPolicy(Google.Apis.GameServices.v1beta.Data.SetIamPolicyRequest body, string resource) { return new SetIamPolicyRequest(service, body, resource); } /// <summary>Sets the access control policy on the specified resource. Replaces any existing policy. Can /// return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.</summary> public class SetIamPolicyRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Policy> { /// <summary>Constructs a new SetIamPolicy request.</summary> public SetIamPolicyRequest(Google.Apis.Services.IClientService service, Google.Apis.GameServices.v1beta.Data.SetIamPolicyRequest body, string resource) : base(service) { Resource = resource; Body = body; InitParameters(); } /// <summary>REQUIRED: The resource for which the policy is being specified. See the operation /// documentation for the appropriate value for this field.</summary> [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)] public virtual string Resource { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.GameServices.v1beta.Data.SetIamPolicyRequest Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "setIamPolicy"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+resource}:setIamPolicy"; /// <summary>Initializes SetIamPolicy parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("resource", new Google.Apis.Discovery.Parameter { Name = "resource", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/gameServerDeployments/[^/]+$", }); } } /// <summary>Returns permissions that a caller has on the specified resource. If the resource does not /// exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation /// is designed to be used for building permission-aware UIs and command-line tools, not for /// authorization checking. This operation may "fail open" without warning.</summary> /// <param name="body">The body of the request.</param> /// <param name="resource">REQUIRED: The resource for which the policy detail is being requested. See the operation /// documentation for the appropriate value for this field.</param> public virtual TestIamPermissionsRequest TestIamPermissions(Google.Apis.GameServices.v1beta.Data.TestIamPermissionsRequest body, string resource) { return new TestIamPermissionsRequest(service, body, resource); } /// <summary>Returns permissions that a caller has on the specified resource. If the resource does not /// exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation /// is designed to be used for building permission-aware UIs and command-line tools, not for /// authorization checking. This operation may "fail open" without warning.</summary> public class TestIamPermissionsRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.TestIamPermissionsResponse> { /// <summary>Constructs a new TestIamPermissions request.</summary> public TestIamPermissionsRequest(Google.Apis.Services.IClientService service, Google.Apis.GameServices.v1beta.Data.TestIamPermissionsRequest body, string resource) : base(service) { Resource = resource; Body = body; InitParameters(); } /// <summary>REQUIRED: The resource for which the policy detail is being requested. See the /// operation documentation for the appropriate value for this field.</summary> [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)] public virtual string Resource { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.GameServices.v1beta.Data.TestIamPermissionsRequest Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "testIamPermissions"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+resource}:testIamPermissions"; /// <summary>Initializes TestIamPermissions parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("resource", new Google.Apis.Discovery.Parameter { Name = "resource", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/gameServerDeployments/[^/]+$", }); } } /// <summary>Patches a single game server deployment rollout. The method will not return an error if the /// update does not affect any existing realms. For example - if the default_game_server_config is /// changed but all existing realms use the override, that is valid. Similarly, if a non existing realm /// is explicitly called out in game_server_config_overrides field, that will also not result in an /// error.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">The resource name of the game server deployment rollout. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. For example, `projects/my- /// project/locations/global/gameServerDeployments/my-deployment/rollout`.</param> public virtual UpdateRolloutRequest UpdateRollout(Google.Apis.GameServices.v1beta.Data.GameServerDeploymentRollout body, string name) { return new UpdateRolloutRequest(service, body, name); } /// <summary>Patches a single game server deployment rollout. The method will not return an error if the /// update does not affect any existing realms. For example - if the default_game_server_config is /// changed but all existing realms use the override, that is valid. Similarly, if a non existing realm /// is explicitly called out in game_server_config_overrides field, that will also not result in an /// error.</summary> public class UpdateRolloutRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Operation> { /// <summary>Constructs a new UpdateRollout request.</summary> public UpdateRolloutRequest(Google.Apis.Services.IClientService service, Google.Apis.GameServices.v1beta.Data.GameServerDeploymentRollout body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>The resource name of the game server deployment rollout. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. For /// example, `projects/my-project/locations/global/gameServerDeployments/my- /// deployment/rollout`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Required. Mask of fields to update. At least one path must be supplied in this field. /// For the `FieldMask` definition, see https: //developers.google.com/protocol-buffers // /// /docs/reference/google.protobuf#fieldmask</summary> [Google.Apis.Util.RequestParameterAttribute("updateMask", Google.Apis.Util.RequestParameterType.Query)] public virtual object UpdateMask { get; set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.GameServices.v1beta.Data.GameServerDeploymentRollout Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "updateRollout"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "PATCH"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}/rollout"; /// <summary>Initializes UpdateRollout parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/gameServerDeployments/[^/]+$", }); RequestParameters.Add("updateMask", new Google.Apis.Discovery.Parameter { Name = "updateMask", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } } /// <summary>Gets the Operations resource.</summary> public virtual OperationsResource Operations { get; } /// <summary>The "operations" collection of methods.</summary> public class OperationsResource { private const string Resource = "operations"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public OperationsResource(Google.Apis.Services.IClientService service) { this.service = service; } /// <summary>Starts asynchronous cancellation on a long-running operation. The server makes a best /// effort to cancel the operation, but success is not guaranteed. If the server doesn't support this /// method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other /// methods to check whether the cancellation succeeded or whether the operation completed despite /// cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an /// operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to /// `Code.CANCELLED`.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">The name of the operation resource to be cancelled.</param> public virtual CancelRequest Cancel(Google.Apis.GameServices.v1beta.Data.CancelOperationRequest body, string name) { return new CancelRequest(service, body, name); } /// <summary>Starts asynchronous cancellation on a long-running operation. The server makes a best /// effort to cancel the operation, but success is not guaranteed. If the server doesn't support this /// method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other /// methods to check whether the cancellation succeeded or whether the operation completed despite /// cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an /// operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to /// `Code.CANCELLED`.</summary> public class CancelRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Empty> { /// <summary>Constructs a new Cancel request.</summary> public CancelRequest(Google.Apis.Services.IClientService service, Google.Apis.GameServices.v1beta.Data.CancelOperationRequest body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>The name of the operation resource to be cancelled.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.GameServices.v1beta.Data.CancelOperationRequest Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "cancel"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}:cancel"; /// <summary>Initializes Cancel parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/operations/[^/]+$", }); } } /// <summary>Deletes a long-running operation. This method indicates that the client is no longer /// interested in the operation result. It does not cancel the operation. If the server doesn't support /// this method, it returns `google.rpc.Code.UNIMPLEMENTED`.</summary> /// <param name="name">The name of the operation resource to be deleted.</param> public virtual DeleteRequest Delete(string name) { return new DeleteRequest(service, name); } /// <summary>Deletes a long-running operation. This method indicates that the client is no longer /// interested in the operation result. It does not cancel the operation. If the server doesn't support /// this method, it returns `google.rpc.Code.UNIMPLEMENTED`.</summary> public class DeleteRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Empty> { /// <summary>Constructs a new Delete request.</summary> public DeleteRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>The name of the operation resource to be deleted.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "delete"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "DELETE"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}"; /// <summary>Initializes Delete parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/operations/[^/]+$", }); } } /// <summary>Gets the latest state of a long-running operation. Clients can use this method to poll the /// operation result at intervals as recommended by the API service.</summary> /// <param name="name">The name of the operation resource.</param> public virtual GetRequest Get(string name) { return new GetRequest(service, name); } /// <summary>Gets the latest state of a long-running operation. Clients can use this method to poll the /// operation result at intervals as recommended by the API service.</summary> public class GetRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Operation> { /// <summary>Constructs a new Get request.</summary> public GetRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>The name of the operation resource.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "get"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}"; /// <summary>Initializes Get parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/operations/[^/]+$", }); } } /// <summary>Lists operations that match the specified filter in the request. If the server doesn't /// support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to /// override the binding to use different resource name schemes, such as `users/operations`. To override /// the binding, API services can add a binding such as `"/v1/{name=users}/operations"` to their service /// configuration. For backwards compatibility, the default name includes the operations collection id, /// however overriding users must ensure the name binding is the parent resource, without the operations /// collection id.</summary> /// <param name="name">The name of the operation's parent resource.</param> public virtual ListRequest List(string name) { return new ListRequest(service, name); } /// <summary>Lists operations that match the specified filter in the request. If the server doesn't /// support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to /// override the binding to use different resource name schemes, such as `users/operations`. To override /// the binding, API services can add a binding such as `"/v1/{name=users}/operations"` to their service /// configuration. For backwards compatibility, the default name includes the operations collection id, /// however overriding users must ensure the name binding is the parent resource, without the operations /// collection id.</summary> public class ListRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.ListOperationsResponse> { /// <summary>Constructs a new List request.</summary> public ListRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>The name of the operation's parent resource.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>The standard list filter.</summary> [Google.Apis.Util.RequestParameterAttribute("filter", Google.Apis.Util.RequestParameterType.Query)] public virtual string Filter { get; set; } /// <summary>The standard list page size.</summary> [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> PageSize { get; set; } /// <summary>The standard list page token.</summary> [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)] public virtual string PageToken { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "list"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}/operations"; /// <summary>Initializes List parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+$", }); RequestParameters.Add("filter", new Google.Apis.Discovery.Parameter { Name = "filter", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageSize", new Google.Apis.Discovery.Parameter { Name = "pageSize", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageToken", new Google.Apis.Discovery.Parameter { Name = "pageToken", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } } /// <summary>Gets the Realms resource.</summary> public virtual RealmsResource Realms { get; } /// <summary>The "realms" collection of methods.</summary> public class RealmsResource { private const string Resource = "realms"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public RealmsResource(Google.Apis.Services.IClientService service) { this.service = service; GameServerClusters = new GameServerClustersResource(service); } /// <summary>Gets the GameServerClusters resource.</summary> public virtual GameServerClustersResource GameServerClusters { get; } /// <summary>The "gameServerClusters" collection of methods.</summary> public class GameServerClustersResource { private const string Resource = "gameServerClusters"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public GameServerClustersResource(Google.Apis.Services.IClientService service) { this.service = service; } /// <summary>Creates a new game server cluster in a given project and location.</summary> /// <param name="body">The body of the request.</param> /// <param name="parent">Required. The parent resource name. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm-id}`.</param> public virtual CreateRequest Create(Google.Apis.GameServices.v1beta.Data.GameServerCluster body, string parent) { return new CreateRequest(service, body, parent); } /// <summary>Creates a new game server cluster in a given project and location.</summary> public class CreateRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Operation> { /// <summary>Constructs a new Create request.</summary> public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.GameServices.v1beta.Data.GameServerCluster body, string parent) : base(service) { Parent = parent; Body = body; InitParameters(); } /// <summary>Required. The parent resource name. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm-id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>Required. The ID of the game server cluster resource to be created.</summary> [Google.Apis.Util.RequestParameterAttribute("gameServerClusterId", Google.Apis.Util.RequestParameterType.Query)] public virtual string GameServerClusterId { get; set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.GameServices.v1beta.Data.GameServerCluster Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "create"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+parent}/gameServerClusters"; /// <summary>Initializes Create parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter { Name = "parent", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/realms/[^/]+$", }); RequestParameters.Add("gameServerClusterId", new Google.Apis.Discovery.Parameter { Name = "gameServerClusterId", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Deletes a single game server cluster.</summary> /// <param name="name">Required. The name of the game server cluster to delete. Uses the form: /// `projects/{project}/locations/{location}/gameServerClusters/{cluster}`.</param> public virtual DeleteRequest Delete(string name) { return new DeleteRequest(service, name); } /// <summary>Deletes a single game server cluster.</summary> public class DeleteRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Operation> { /// <summary>Constructs a new Delete request.</summary> public DeleteRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>Required. The name of the game server cluster to delete. Uses the form: /// `projects/{project}/locations/{location}/gameServerClusters/{cluster}`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "delete"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "DELETE"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}"; /// <summary>Initializes Delete parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/realms/[^/]+/gameServerClusters/[^/]+$", }); } } /// <summary>Gets details of a single game server cluster.</summary> /// <param name="name">Required. The name of the game server cluster to retrieve. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`.</param> public virtual GetRequest Get(string name) { return new GetRequest(service, name); } /// <summary>Gets details of a single game server cluster.</summary> public class GetRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.GameServerCluster> { /// <summary>Constructs a new Get request.</summary> public GetRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>Required. The name of the game server cluster to retrieve. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm- /// id}/gameServerClusters/{cluster}`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "get"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}"; /// <summary>Initializes Get parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/realms/[^/]+/gameServerClusters/[^/]+$", }); } } /// <summary>Lists game server clusters in a given project and location.</summary> /// <param name="parent">Required. The parent resource name. Uses the form: /// "projects/{project}/locations/{location}/realms/{realm}".</param> public virtual ListRequest List(string parent) { return new ListRequest(service, parent); } /// <summary>Lists game server clusters in a given project and location.</summary> public class ListRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.ListGameServerClustersResponse> { /// <summary>Constructs a new List request.</summary> public ListRequest(Google.Apis.Services.IClientService service, string parent) : base(service) { Parent = parent; InitParameters(); } /// <summary>Required. The parent resource name. Uses the form: /// "projects/{project}/locations/{location}/realms/{realm}".</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>Optional. The filter to apply to list results.</summary> [Google.Apis.Util.RequestParameterAttribute("filter", Google.Apis.Util.RequestParameterType.Query)] public virtual string Filter { get; set; } /// <summary>Optional. Specifies the ordering of results following syntax at /// https://cloud.google.com/apis/design/design_patterns#sorting_order.</summary> [Google.Apis.Util.RequestParameterAttribute("orderBy", Google.Apis.Util.RequestParameterType.Query)] public virtual string OrderBy { get; set; } /// <summary>Optional. The maximum number of items to return. If unspecified, the server will /// pick an appropriate default. The server may return fewer items than requested. A caller /// should only rely on response's next_page_token to determine if there are more /// GameServerClusters left to be queried.</summary> [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> PageSize { get; set; } /// <summary>Optional. The next_page_token value returned from a previous List request, if /// any.</summary> [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)] public virtual string PageToken { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "list"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+parent}/gameServerClusters"; /// <summary>Initializes List parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter { Name = "parent", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/realms/[^/]+$", }); RequestParameters.Add("filter", new Google.Apis.Discovery.Parameter { Name = "filter", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("orderBy", new Google.Apis.Discovery.Parameter { Name = "orderBy", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageSize", new Google.Apis.Discovery.Parameter { Name = "pageSize", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageToken", new Google.Apis.Discovery.Parameter { Name = "pageToken", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Patches a single game server cluster.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">Required. The resource name of the game server cluster. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`. For example, `projects/my- /// project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`.</param> public virtual PatchRequest Patch(Google.Apis.GameServices.v1beta.Data.GameServerCluster body, string name) { return new PatchRequest(service, body, name); } /// <summary>Patches a single game server cluster.</summary> public class PatchRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Operation> { /// <summary>Constructs a new Patch request.</summary> public PatchRequest(Google.Apis.Services.IClientService service, Google.Apis.GameServices.v1beta.Data.GameServerCluster body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>Required. The resource name of the game server cluster. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`. For /// example, `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my- /// onprem-cluster`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Required. Mask of fields to update. At least one path must be supplied in this /// field. For the `FieldMask` definition, see https: //developers.google.com/protocol-buffers /// // /docs/reference/google.protobuf#fieldmask</summary> [Google.Apis.Util.RequestParameterAttribute("updateMask", Google.Apis.Util.RequestParameterType.Query)] public virtual object UpdateMask { get; set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.GameServices.v1beta.Data.GameServerCluster Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "patch"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "PATCH"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}"; /// <summary>Initializes Patch parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/realms/[^/]+/gameServerClusters/[^/]+$", }); RequestParameters.Add("updateMask", new Google.Apis.Discovery.Parameter { Name = "updateMask", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Previews creation of a new game server cluster in a given project and /// location.</summary> /// <param name="body">The body of the request.</param> /// <param name="parent">Required. The parent resource name. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm}`.</param> public virtual PreviewCreateRequest PreviewCreate(Google.Apis.GameServices.v1beta.Data.GameServerCluster body, string parent) { return new PreviewCreateRequest(service, body, parent); } /// <summary>Previews creation of a new game server cluster in a given project and /// location.</summary> public class PreviewCreateRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.PreviewCreateGameServerClusterResponse> { /// <summary>Constructs a new PreviewCreate request.</summary> public PreviewCreateRequest(Google.Apis.Services.IClientService service, Google.Apis.GameServices.v1beta.Data.GameServerCluster body, string parent) : base(service) { Parent = parent; Body = body; InitParameters(); } /// <summary>Required. The parent resource name. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>Required. The ID of the game server cluster resource to be created.</summary> [Google.Apis.Util.RequestParameterAttribute("gameServerClusterId", Google.Apis.Util.RequestParameterType.Query)] public virtual string GameServerClusterId { get; set; } /// <summary>Optional. The target timestamp to compute the preview.</summary> [Google.Apis.Util.RequestParameterAttribute("previewTime", Google.Apis.Util.RequestParameterType.Query)] public virtual object PreviewTime { get; set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.GameServices.v1beta.Data.GameServerCluster Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "previewCreate"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+parent}/gameServerClusters:previewCreate"; /// <summary>Initializes PreviewCreate parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter { Name = "parent", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/realms/[^/]+$", }); RequestParameters.Add("gameServerClusterId", new Google.Apis.Discovery.Parameter { Name = "gameServerClusterId", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("previewTime", new Google.Apis.Discovery.Parameter { Name = "previewTime", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Previews deletion of a single game server cluster.</summary> /// <param name="name">Required. The name of the game server cluster to delete. Uses the form: /// `projects/{project}/locations/{location}/gameServerClusters/{cluster}`.</param> public virtual PreviewDeleteRequest PreviewDelete(string name) { return new PreviewDeleteRequest(service, name); } /// <summary>Previews deletion of a single game server cluster.</summary> public class PreviewDeleteRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.PreviewDeleteGameServerClusterResponse> { /// <summary>Constructs a new PreviewDelete request.</summary> public PreviewDeleteRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>Required. The name of the game server cluster to delete. Uses the form: /// `projects/{project}/locations/{location}/gameServerClusters/{cluster}`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Optional. The target timestamp to compute the preview.</summary> [Google.Apis.Util.RequestParameterAttribute("previewTime", Google.Apis.Util.RequestParameterType.Query)] public virtual object PreviewTime { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "previewDelete"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "DELETE"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}:previewDelete"; /// <summary>Initializes PreviewDelete parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/realms/[^/]+/gameServerClusters/[^/]+$", }); RequestParameters.Add("previewTime", new Google.Apis.Discovery.Parameter { Name = "previewTime", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Previews updating a GameServerCluster.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">Required. The resource name of the game server cluster. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`. For example, `projects/my- /// project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`.</param> public virtual PreviewUpdateRequest PreviewUpdate(Google.Apis.GameServices.v1beta.Data.GameServerCluster body, string name) { return new PreviewUpdateRequest(service, body, name); } /// <summary>Previews updating a GameServerCluster.</summary> public class PreviewUpdateRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.PreviewUpdateGameServerClusterResponse> { /// <summary>Constructs a new PreviewUpdate request.</summary> public PreviewUpdateRequest(Google.Apis.Services.IClientService service, Google.Apis.GameServices.v1beta.Data.GameServerCluster body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>Required. The resource name of the game server cluster. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`. For /// example, `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my- /// onprem-cluster`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Optional. The target timestamp to compute the preview.</summary> [Google.Apis.Util.RequestParameterAttribute("previewTime", Google.Apis.Util.RequestParameterType.Query)] public virtual object PreviewTime { get; set; } /// <summary>Required. Mask of fields to update. At least one path must be supplied in this /// field. For the `FieldMask` definition, see https: //developers.google.com/protocol-buffers /// // /docs/reference/google.protobuf#fieldmask</summary> [Google.Apis.Util.RequestParameterAttribute("updateMask", Google.Apis.Util.RequestParameterType.Query)] public virtual object UpdateMask { get; set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.GameServices.v1beta.Data.GameServerCluster Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "previewUpdate"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "PATCH"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}:previewUpdate"; /// <summary>Initializes PreviewUpdate parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/realms/[^/]+/gameServerClusters/[^/]+$", }); RequestParameters.Add("previewTime", new Google.Apis.Discovery.Parameter { Name = "previewTime", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("updateMask", new Google.Apis.Discovery.Parameter { Name = "updateMask", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } } /// <summary>Creates a new realm in a given project and location.</summary> /// <param name="body">The body of the request.</param> /// <param name="parent">Required. The parent resource name. Uses the form: /// `projects/{project}/locations/{location}`.</param> public virtual CreateRequest Create(Google.Apis.GameServices.v1beta.Data.Realm body, string parent) { return new CreateRequest(service, body, parent); } /// <summary>Creates a new realm in a given project and location.</summary> public class CreateRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Operation> { /// <summary>Constructs a new Create request.</summary> public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.GameServices.v1beta.Data.Realm body, string parent) : base(service) { Parent = parent; Body = body; InitParameters(); } /// <summary>Required. The parent resource name. Uses the form: /// `projects/{project}/locations/{location}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>Required. The ID of the realm resource to be created.</summary> [Google.Apis.Util.RequestParameterAttribute("realmId", Google.Apis.Util.RequestParameterType.Query)] public virtual string RealmId { get; set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.GameServices.v1beta.Data.Realm Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "create"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+parent}/realms"; /// <summary>Initializes Create parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter { Name = "parent", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+$", }); RequestParameters.Add("realmId", new Google.Apis.Discovery.Parameter { Name = "realmId", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Deletes a single realm.</summary> /// <param name="name">Required. The name of the realm to delete. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm}`.</param> public virtual DeleteRequest Delete(string name) { return new DeleteRequest(service, name); } /// <summary>Deletes a single realm.</summary> public class DeleteRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Operation> { /// <summary>Constructs a new Delete request.</summary> public DeleteRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>Required. The name of the realm to delete. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm}`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "delete"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "DELETE"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}"; /// <summary>Initializes Delete parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/realms/[^/]+$", }); } } /// <summary>Gets details of a single realm.</summary> /// <param name="name">Required. The name of the realm to retrieve. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm}`.</param> public virtual GetRequest Get(string name) { return new GetRequest(service, name); } /// <summary>Gets details of a single realm.</summary> public class GetRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Realm> { /// <summary>Constructs a new Get request.</summary> public GetRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>Required. The name of the realm to retrieve. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm}`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "get"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}"; /// <summary>Initializes Get parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/realms/[^/]+$", }); } } /// <summary>Lists realms in a given project and location.</summary> /// <param name="parent">Required. The parent resource name. Uses the form: /// `projects/{project}/locations/{location}`.</param> public virtual ListRequest List(string parent) { return new ListRequest(service, parent); } /// <summary>Lists realms in a given project and location.</summary> public class ListRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.ListRealmsResponse> { /// <summary>Constructs a new List request.</summary> public ListRequest(Google.Apis.Services.IClientService service, string parent) : base(service) { Parent = parent; InitParameters(); } /// <summary>Required. The parent resource name. Uses the form: /// `projects/{project}/locations/{location}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>Optional. The filter to apply to list results.</summary> [Google.Apis.Util.RequestParameterAttribute("filter", Google.Apis.Util.RequestParameterType.Query)] public virtual string Filter { get; set; } /// <summary>Optional. Specifies the ordering of results following syntax at /// https://cloud.google.com/apis/design/design_patterns#sorting_order.</summary> [Google.Apis.Util.RequestParameterAttribute("orderBy", Google.Apis.Util.RequestParameterType.Query)] public virtual string OrderBy { get; set; } /// <summary>Optional. The maximum number of items to return. If unspecified, server will pick an /// appropriate default. Server may return fewer items than requested. A caller should only rely on /// response's next_page_token to determine if there are more realms left to be queried.</summary> [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> PageSize { get; set; } /// <summary>Optional. The next_page_token value returned from a previous List request, if /// any.</summary> [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)] public virtual string PageToken { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "list"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+parent}/realms"; /// <summary>Initializes List parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter { Name = "parent", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+$", }); RequestParameters.Add("filter", new Google.Apis.Discovery.Parameter { Name = "filter", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("orderBy", new Google.Apis.Discovery.Parameter { Name = "orderBy", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageSize", new Google.Apis.Discovery.Parameter { Name = "pageSize", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageToken", new Google.Apis.Discovery.Parameter { Name = "pageToken", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Patches a single realm.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">The resource name of the realm. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm}`. For example, `projects/my- /// project/locations/{location}/realms/my-realm`.</param> public virtual PatchRequest Patch(Google.Apis.GameServices.v1beta.Data.Realm body, string name) { return new PatchRequest(service, body, name); } /// <summary>Patches a single realm.</summary> public class PatchRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Operation> { /// <summary>Constructs a new Patch request.</summary> public PatchRequest(Google.Apis.Services.IClientService service, Google.Apis.GameServices.v1beta.Data.Realm body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>The resource name of the realm. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm}`. For example, `projects/my- /// project/locations/{location}/realms/my-realm`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Required. The update mask applies to the resource. For the `FieldMask` definition, see /// https: //developers.google.com/protocol-buffers // /// /docs/reference/google.protobuf#fieldmask</summary> [Google.Apis.Util.RequestParameterAttribute("updateMask", Google.Apis.Util.RequestParameterType.Query)] public virtual object UpdateMask { get; set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.GameServices.v1beta.Data.Realm Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "patch"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "PATCH"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}"; /// <summary>Initializes Patch parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/realms/[^/]+$", }); RequestParameters.Add("updateMask", new Google.Apis.Discovery.Parameter { Name = "updateMask", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Previews patches to a single realm.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">The resource name of the realm. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm}`. For example, `projects/my- /// project/locations/{location}/realms/my-realm`.</param> public virtual PreviewUpdateRequest PreviewUpdate(Google.Apis.GameServices.v1beta.Data.Realm body, string name) { return new PreviewUpdateRequest(service, body, name); } /// <summary>Previews patches to a single realm.</summary> public class PreviewUpdateRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.PreviewRealmUpdateResponse> { /// <summary>Constructs a new PreviewUpdate request.</summary> public PreviewUpdateRequest(Google.Apis.Services.IClientService service, Google.Apis.GameServices.v1beta.Data.Realm body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>The resource name of the realm. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm}`. For example, `projects/my- /// project/locations/{location}/realms/my-realm`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Optional. The target timestamp to compute the preview.</summary> [Google.Apis.Util.RequestParameterAttribute("previewTime", Google.Apis.Util.RequestParameterType.Query)] public virtual object PreviewTime { get; set; } /// <summary>Required. The update mask applies to the resource. For the `FieldMask` definition, see /// https: //developers.google.com/protocol-buffers // /// /docs/reference/google.protobuf#fieldmask</summary> [Google.Apis.Util.RequestParameterAttribute("updateMask", Google.Apis.Util.RequestParameterType.Query)] public virtual object UpdateMask { get; set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.GameServices.v1beta.Data.Realm Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "previewUpdate"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "PATCH"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}:previewUpdate"; /// <summary>Initializes PreviewUpdate parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/realms/[^/]+$", }); RequestParameters.Add("previewTime", new Google.Apis.Discovery.Parameter { Name = "previewTime", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("updateMask", new Google.Apis.Discovery.Parameter { Name = "updateMask", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } } /// <summary>Gets information about a location.</summary> /// <param name="name">Resource name for the location.</param> public virtual GetRequest Get(string name) { return new GetRequest(service, name); } /// <summary>Gets information about a location.</summary> public class GetRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.Location> { /// <summary>Constructs a new Get request.</summary> public GetRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>Resource name for the location.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "get"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}"; /// <summary>Initializes Get parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+$", }); } } /// <summary>Lists information about the supported locations for this service.</summary> /// <param name="name">The resource that owns the locations collection, if applicable.</param> public virtual ListRequest List(string name) { return new ListRequest(service, name); } /// <summary>Lists information about the supported locations for this service.</summary> public class ListRequest : GameServicesBaseServiceRequest<Google.Apis.GameServices.v1beta.Data.ListLocationsResponse> { /// <summary>Constructs a new List request.</summary> public ListRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>The resource that owns the locations collection, if applicable.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>The standard list filter.</summary> [Google.Apis.Util.RequestParameterAttribute("filter", Google.Apis.Util.RequestParameterType.Query)] public virtual string Filter { get; set; } /// <summary>If true, the returned list will include locations which are not yet revealed.</summary> [Google.Apis.Util.RequestParameterAttribute("includeUnrevealedLocations", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<bool> IncludeUnrevealedLocations { get; set; } /// <summary>The standard list page size.</summary> [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> PageSize { get; set; } /// <summary>The standard list page token.</summary> [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)] public virtual string PageToken { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "list"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1beta/{+name}/locations"; /// <summary>Initializes List parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+$", }); RequestParameters.Add("filter", new Google.Apis.Discovery.Parameter { Name = "filter", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("includeUnrevealedLocations", new Google.Apis.Discovery.Parameter { Name = "includeUnrevealedLocations", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageSize", new Google.Apis.Discovery.Parameter { Name = "pageSize", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageToken", new Google.Apis.Discovery.Parameter { Name = "pageToken", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } } } } namespace Google.Apis.GameServices.v1beta.Data { /// <summary>Specifies the audit configuration for a service. The configuration determines which permission types /// are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more /// AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two /// AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the /// exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { /// "audit_configs": [ { "service": "allServices", "audit_log_configs": [ { "log_type": "DATA_READ", /// "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type": "ADMIN_READ" } ] /// }, { "service": "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": "DATA_READ" }, { /// "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For sampleservice, this /// policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ /// logging, and aliya@example.com from DATA_WRITE logging.</summary> public class AuditConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The configuration for logging of each type of permission.</summary> [Newtonsoft.Json.JsonPropertyAttribute("auditLogConfigs")] public virtual System.Collections.Generic.IList<AuditLogConfig> AuditLogConfigs { get; set; } [Newtonsoft.Json.JsonPropertyAttribute("exemptedMembers")] public virtual System.Collections.Generic.IList<string> ExemptedMembers { get; set; } /// <summary>Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, /// `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.</summary> [Newtonsoft.Json.JsonPropertyAttribute("service")] public virtual string Service { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Provides the configuration for logging a type of permissions. Example: { "audit_log_configs": [ { /// "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" } ] } /// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ /// logging.</summary> public class AuditLogConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Specifies the identities that do not cause logging for this type of permission. Follows the same /// format of Binding.members.</summary> [Newtonsoft.Json.JsonPropertyAttribute("exemptedMembers")] public virtual System.Collections.Generic.IList<string> ExemptedMembers { get; set; } [Newtonsoft.Json.JsonPropertyAttribute("ignoreChildExemptions")] public virtual System.Nullable<bool> IgnoreChildExemptions { get; set; } /// <summary>The log type that this config enables.</summary> [Newtonsoft.Json.JsonPropertyAttribute("logType")] public virtual string LogType { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Authorization-related information used by Cloud Audit Logging.</summary> public class AuthorizationLoggingOptions : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The type of the permission that was checked.</summary> [Newtonsoft.Json.JsonPropertyAttribute("permissionType")] public virtual string PermissionType { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Associates `members` with a `role`.</summary> public class Binding : Google.Apis.Requests.IDirectResponseSchema { /// <summary>A client-specified ID for this binding. Expected to be globally unique to support the internal /// bindings-by-ID API.</summary> [Newtonsoft.Json.JsonPropertyAttribute("bindingId")] public virtual string BindingId { get; set; } /// <summary>The condition that is associated with this binding. If the condition evaluates to `true`, then this /// binding applies to the current request. If the condition evaluates to `false`, then this binding does not /// apply to the current request. However, a different role binding might grant the same role to one or more of /// the members in this binding. To learn which resources support conditions in their IAM policies, see the [IAM /// documentation](https://cloud.google.com/iam/help/conditions/resource-policies).</summary> [Newtonsoft.Json.JsonPropertyAttribute("condition")] public virtual Expr Condition { get; set; } /// <summary>Specifies the identities requesting access for a Cloud Platform resource. `members` can have the /// following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or /// without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is /// authenticated with a Google account or a service account. * `user:{emailid}`: An email address that /// represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An /// email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * /// `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * /// `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that /// has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is /// recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * /// `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a /// service account that has been recently deleted. For example, `my-other- /// app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value /// reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * /// `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google /// group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the /// group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the /// binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For /// example, `google.com` or `example.com`. </summary> [Newtonsoft.Json.JsonPropertyAttribute("members")] public virtual System.Collections.Generic.IList<string> Members { get; set; } /// <summary>Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or /// `roles/owner`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("role")] public virtual string Role { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The request message for Operations.CancelOperation.</summary> public class CancelOperationRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Write a Cloud Audit log</summary> public class CloudAuditOptions : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Information used by the Cloud Audit Logging pipeline.</summary> [Newtonsoft.Json.JsonPropertyAttribute("authorizationLoggingOptions")] public virtual AuthorizationLoggingOptions AuthorizationLoggingOptions { get; set; } /// <summary>The log_name to populate in the Cloud Audit Record.</summary> [Newtonsoft.Json.JsonPropertyAttribute("logName")] public virtual string LogName { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A condition to be met.</summary> public class Condition : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Trusted attributes supplied by the IAM system.</summary> [Newtonsoft.Json.JsonPropertyAttribute("iam")] public virtual string Iam { get; set; } /// <summary>An operator to apply the subject with.</summary> [Newtonsoft.Json.JsonPropertyAttribute("op")] public virtual string Op { get; set; } /// <summary>Trusted attributes discharged by the service.</summary> [Newtonsoft.Json.JsonPropertyAttribute("svc")] public virtual string Svc { get; set; } /// <summary>Trusted attributes supplied by any service that owns resources and uses the IAM system for access /// control.</summary> [Newtonsoft.Json.JsonPropertyAttribute("sys")] public virtual string Sys { get; set; } /// <summary>The objects of the condition.</summary> [Newtonsoft.Json.JsonPropertyAttribute("values")] public virtual System.Collections.Generic.IList<string> Values { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Increment a streamz counter with the specified metric and field names. Metric names should start with a /// '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The /// actual exported metric names will have "/iam/policy" prepended. Field names correspond to IAM request parameters /// and field values are their respective values. Supported field names: - "authority", which is "[token]" if /// IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a /// representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a /// token or authority selector is present; or - "" (empty string), resulting in a counter with no fields. Examples: /// counter { metric: "/debug_access_count" field: "iam_principal" } ==> increment counter /// /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}</summary> public class CounterOptions : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Custom fields.</summary> [Newtonsoft.Json.JsonPropertyAttribute("customFields")] public virtual System.Collections.Generic.IList<CustomField> CustomFields { get; set; } /// <summary>The field value to attribute.</summary> [Newtonsoft.Json.JsonPropertyAttribute("field")] public virtual string Field { get; set; } /// <summary>The metric to update.</summary> [Newtonsoft.Json.JsonPropertyAttribute("metric")] public virtual string Metric { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp- /// custom-fields.</summary> public class CustomField : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Name is the field name.</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>Value is the field value. It is important that in contrast to the CounterOptions.field, the value /// here is a constant that is not derived from the IAMContext.</summary> [Newtonsoft.Json.JsonPropertyAttribute("value")] public virtual string Value { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Write a Data Access (Gin) log</summary> public class DataAccessOptions : Google.Apis.Requests.IDirectResponseSchema { [Newtonsoft.Json.JsonPropertyAttribute("logMode")] public virtual string LogMode { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The game server cluster changes made by the game server deployment.</summary> public class DeployedClusterState : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The name of the cluster.</summary> [Newtonsoft.Json.JsonPropertyAttribute("cluster")] public virtual string Cluster { get; set; } /// <summary>The details about the Agones fleets and autoscalers created in the game server cluster.</summary> [Newtonsoft.Json.JsonPropertyAttribute("fleetDetails")] public virtual System.Collections.Generic.IList<DeployedFleetDetails> FleetDetails { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Agones fleet specification and details.</summary> public class DeployedFleet : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The name of the Agones fleet.</summary> [Newtonsoft.Json.JsonPropertyAttribute("fleet")] public virtual string Fleet { get; set; } /// <summary>The fleet spec retrieved from the Agones fleet.</summary> [Newtonsoft.Json.JsonPropertyAttribute("fleetSpec")] public virtual string FleetSpec { get; set; } /// <summary>The source spec that is used to create the Agones fleet. The GameServerConfig resource may no /// longer exist in the system.</summary> [Newtonsoft.Json.JsonPropertyAttribute("specSource")] public virtual SpecSource SpecSource { get; set; } /// <summary>The current status of the Agones fleet. Includes count of game servers in various states.</summary> [Newtonsoft.Json.JsonPropertyAttribute("status")] public virtual DeployedFleetStatus Status { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Details about the Agones autoscaler.</summary> public class DeployedFleetAutoscaler : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The name of the Agones autoscaler.</summary> [Newtonsoft.Json.JsonPropertyAttribute("autoscaler")] public virtual string Autoscaler { get; set; } /// <summary>The autoscaler spec retrieved from Agones.</summary> [Newtonsoft.Json.JsonPropertyAttribute("fleetAutoscalerSpec")] public virtual string FleetAutoscalerSpec { get; set; } /// <summary>The source spec that is used to create the autoscaler. The GameServerConfig resource may no longer /// exist in the system.</summary> [Newtonsoft.Json.JsonPropertyAttribute("specSource")] public virtual SpecSource SpecSource { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Details of the deployed Agones fleet.</summary> public class DeployedFleetDetails : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Information about the Agones autoscaler for that fleet.</summary> [Newtonsoft.Json.JsonPropertyAttribute("deployedAutoscaler")] public virtual DeployedFleetAutoscaler DeployedAutoscaler { get; set; } /// <summary>Information about the Agones fleet.</summary> [Newtonsoft.Json.JsonPropertyAttribute("deployedFleet")] public virtual DeployedFleet DeployedFleet { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>DeployedFleetStatus has details about the Agones fleets such as how many are running, how many /// allocated, and so on.</summary> public class DeployedFleetStatus : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The number of GameServer replicas in the ALLOCATED state in this fleet.</summary> [Newtonsoft.Json.JsonPropertyAttribute("allocatedReplicas")] public virtual System.Nullable<long> AllocatedReplicas { get; set; } /// <summary>The number of GameServer replicas in the READY state in this fleet.</summary> [Newtonsoft.Json.JsonPropertyAttribute("readyReplicas")] public virtual System.Nullable<long> ReadyReplicas { get; set; } /// <summary>The total number of current GameServer replicas in this fleet.</summary> [Newtonsoft.Json.JsonPropertyAttribute("replicas")] public virtual System.Nullable<long> Replicas { get; set; } /// <summary>The number of GameServer replicas in the RESERVED state in this fleet. Reserved instances won't be /// deleted on scale down, but won't cause an autoscaler to scale up.</summary> [Newtonsoft.Json.JsonPropertyAttribute("reservedReplicas")] public virtual System.Nullable<long> ReservedReplicas { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A /// typical example is to use it as the request or the response type of an API method. For instance: service Foo { /// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty /// JSON object `{}`.</summary> public class Empty : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like /// expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. /// Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" /// expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: /// "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" /// Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly /// visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): /// title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New /// message received at ' + string(document.create_time)" The exact variables and functions that may be referenced /// within an expression are determined by the service that evaluates it. See the service documentation for /// additional information.</summary> public class Expr : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Optional. Description of the expression. This is a longer text which describes the expression, e.g. /// when hovered over it in a UI.</summary> [Newtonsoft.Json.JsonPropertyAttribute("description")] public virtual string Description { get; set; } /// <summary>Textual representation of an expression in Common Expression Language syntax.</summary> [Newtonsoft.Json.JsonPropertyAttribute("expression")] public virtual string Expression { get; set; } /// <summary>Optional. String indicating the location of the expression for error reporting, e.g. a file name /// and a position in the file.</summary> [Newtonsoft.Json.JsonPropertyAttribute("location")] public virtual string Location { get; set; } /// <summary>Optional. Title for the expression, i.e. a short string describing its purpose. This can be used /// e.g. in UIs which allow to enter the expression.</summary> [Newtonsoft.Json.JsonPropertyAttribute("title")] public virtual string Title { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Request message for GameServerDeploymentsService.FetchDeploymentState.</summary> public class FetchDeploymentStateRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Response message for GameServerDeploymentsService.FetchDeploymentState.</summary> public class FetchDeploymentStateResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The state of the game server deployment in each game server cluster.</summary> [Newtonsoft.Json.JsonPropertyAttribute("clusterState")] public virtual System.Collections.Generic.IList<DeployedClusterState> ClusterState { get; set; } /// <summary>List of locations that could not be reached.</summary> [Newtonsoft.Json.JsonPropertyAttribute("unavailable")] public virtual System.Collections.Generic.IList<string> Unavailable { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Fleet configs for Agones.</summary> public class FleetConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Agones fleet spec. Example spec: `https://agones.dev/site/docs/reference/fleet/`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("fleetSpec")] public virtual string FleetSpec { get; set; } /// <summary>The name of the FleetConfig.</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A game server cluster resource.</summary> public class GameServerCluster : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The game server cluster connection information. This information is used to manage game server /// clusters.</summary> [Newtonsoft.Json.JsonPropertyAttribute("connectionInfo")] public virtual GameServerClusterConnectionInfo ConnectionInfo { get; set; } /// <summary>Output only. The creation time.</summary> [Newtonsoft.Json.JsonPropertyAttribute("createTime")] public virtual object CreateTime { get; set; } /// <summary>Human readable description of the cluster.</summary> [Newtonsoft.Json.JsonPropertyAttribute("description")] public virtual string Description { get; set; } /// <summary>ETag of the resource.</summary> [Newtonsoft.Json.JsonPropertyAttribute("etag")] public virtual string ETag { get; set; } /// <summary>The labels associated with this game server cluster. Each label is a key-value pair.</summary> [Newtonsoft.Json.JsonPropertyAttribute("labels")] public virtual System.Collections.Generic.IDictionary<string, string> Labels { get; set; } /// <summary>Required. The resource name of the game server cluster. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`. For example, /// `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>Output only. The last-modified time.</summary> [Newtonsoft.Json.JsonPropertyAttribute("updateTime")] public virtual object UpdateTime { get; set; } } /// <summary>The game server cluster connection information.</summary> public class GameServerClusterConnectionInfo : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Reference to the GKE cluster where the game servers are installed.</summary> [Newtonsoft.Json.JsonPropertyAttribute("gkeClusterReference")] public virtual GkeClusterReference GkeClusterReference { get; set; } /// <summary>Namespace designated on the game server cluster where the Agones game server instances will be /// created. Existence of the namespace will be validated during creation.</summary> [Newtonsoft.Json.JsonPropertyAttribute("namespace")] public virtual string Namespace__ { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A game server config resource.</summary> public class GameServerConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Output only. The creation time.</summary> [Newtonsoft.Json.JsonPropertyAttribute("createTime")] public virtual object CreateTime { get; set; } /// <summary>The description of the game server config.</summary> [Newtonsoft.Json.JsonPropertyAttribute("description")] public virtual string Description { get; set; } /// <summary>FleetConfig contains a list of Agones fleet specs. Only one FleetConfig is allowed.</summary> [Newtonsoft.Json.JsonPropertyAttribute("fleetConfigs")] public virtual System.Collections.Generic.IList<FleetConfig> FleetConfigs { get; set; } /// <summary>The labels associated with this game server config. Each label is a key-value pair.</summary> [Newtonsoft.Json.JsonPropertyAttribute("labels")] public virtual System.Collections.Generic.IDictionary<string, string> Labels { get; set; } /// <summary>The resource name of the game server config. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. For example, /// `projects/my-project/locations/global/gameServerDeployments/my-game/configs/my-config`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>The autoscaling settings.</summary> [Newtonsoft.Json.JsonPropertyAttribute("scalingConfigs")] public virtual System.Collections.Generic.IList<ScalingConfig> ScalingConfigs { get; set; } /// <summary>Output only. The last-modified time.</summary> [Newtonsoft.Json.JsonPropertyAttribute("updateTime")] public virtual object UpdateTime { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A game server config override.</summary> public class GameServerConfigOverride : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The game server config for this override.</summary> [Newtonsoft.Json.JsonPropertyAttribute("configVersion")] public virtual string ConfigVersion { get; set; } /// <summary>Selector for choosing applicable realms.</summary> [Newtonsoft.Json.JsonPropertyAttribute("realmsSelector")] public virtual RealmSelector RealmsSelector { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A game server deployment resource.</summary> public class GameServerDeployment : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Output only. The creation time.</summary> [Newtonsoft.Json.JsonPropertyAttribute("createTime")] public virtual object CreateTime { get; set; } /// <summary>Human readable description of the game server delpoyment.</summary> [Newtonsoft.Json.JsonPropertyAttribute("description")] public virtual string Description { get; set; } /// <summary>ETag of the resource.</summary> [Newtonsoft.Json.JsonPropertyAttribute("etag")] public virtual string ETag { get; set; } /// <summary>The labels associated with this game server deployment. Each label is a key-value pair.</summary> [Newtonsoft.Json.JsonPropertyAttribute("labels")] public virtual System.Collections.Generic.IDictionary<string, string> Labels { get; set; } /// <summary>The resource name of the game server deployment. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. For example, `projects/my- /// project/locations/global/gameServerDeployments/my-deployment`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>Output only. The last-modified time.</summary> [Newtonsoft.Json.JsonPropertyAttribute("updateTime")] public virtual object UpdateTime { get; set; } } /// <summary>The game server deployment rollout which represents the desired rollout state.</summary> public class GameServerDeploymentRollout : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Output only. The creation time.</summary> [Newtonsoft.Json.JsonPropertyAttribute("createTime")] public virtual object CreateTime { get; set; } /// <summary>The default game server config is applied to all realms unless overridden in the rollout. For /// example, `projects/my-project/locations/global/gameServerDeployments/my-game/configs/my-config`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("defaultGameServerConfig")] public virtual string DefaultGameServerConfig { get; set; } /// <summary>ETag of the resource.</summary> [Newtonsoft.Json.JsonPropertyAttribute("etag")] public virtual string ETag { get; set; } /// <summary>Contains the game server config rollout overrides. Overrides are processed in the order they are /// listed. Once a match is found for a realm, the rest of the list is not processed.</summary> [Newtonsoft.Json.JsonPropertyAttribute("gameServerConfigOverrides")] public virtual System.Collections.Generic.IList<GameServerConfigOverride> GameServerConfigOverrides { get; set; } /// <summary>The resource name of the game server deployment rollout. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. For example, `projects /// /my-project/locations/global/gameServerDeployments/my-deployment/rollout`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>Output only. The last-modified time.</summary> [Newtonsoft.Json.JsonPropertyAttribute("updateTime")] public virtual object UpdateTime { get; set; } } /// <summary>A reference to a GKE cluster.</summary> public class GkeClusterReference : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The full or partial name of a GKE cluster, using one of the following forms: * /// `projects/{project}/locations/{location}/clusters/{cluster}` * `locations/{location}/clusters/{cluster}` * /// `{cluster}` If project and location are not specified, the project and location of the GameServerCluster /// resource are used to generate the full name of the GKE cluster.</summary> [Newtonsoft.Json.JsonPropertyAttribute("cluster")] public virtual string Cluster { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The label selector, used to group labels on the resources.</summary> public class LabelSelector : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Resource labels for this selector.</summary> [Newtonsoft.Json.JsonPropertyAttribute("labels")] public virtual System.Collections.Generic.IDictionary<string, string> Labels { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Response message for GameServerClustersService.ListGameServerClusters.</summary> public class ListGameServerClustersResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The list of game server clusters.</summary> [Newtonsoft.Json.JsonPropertyAttribute("gameServerClusters")] public virtual System.Collections.Generic.IList<GameServerCluster> GameServerClusters { get; set; } /// <summary>Token to retrieve the next page of results, or empty if there are no more results in the /// list.</summary> [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")] public virtual string NextPageToken { get; set; } /// <summary>List of locations that could not be reached.</summary> [Newtonsoft.Json.JsonPropertyAttribute("unreachable")] public virtual System.Collections.Generic.IList<string> Unreachable { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Response message for GameServerConfigsService.ListGameServerConfigs.</summary> public class ListGameServerConfigsResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The list of game server configs.</summary> [Newtonsoft.Json.JsonPropertyAttribute("gameServerConfigs")] public virtual System.Collections.Generic.IList<GameServerConfig> GameServerConfigs { get; set; } /// <summary>Token to retrieve the next page of results, or empty if there are no more results in the /// list.</summary> [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")] public virtual string NextPageToken { get; set; } /// <summary>List of locations that could not be reached.</summary> [Newtonsoft.Json.JsonPropertyAttribute("unreachable")] public virtual System.Collections.Generic.IList<string> Unreachable { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Response message for GameServerDeploymentsService.ListGameServerDeployments.</summary> public class ListGameServerDeploymentsResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The list of game server deployments.</summary> [Newtonsoft.Json.JsonPropertyAttribute("gameServerDeployments")] public virtual System.Collections.Generic.IList<GameServerDeployment> GameServerDeployments { get; set; } /// <summary>Token to retrieve the next page of results, or empty if there are no more results in the /// list.</summary> [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")] public virtual string NextPageToken { get; set; } /// <summary>List of locations that could not be reached.</summary> [Newtonsoft.Json.JsonPropertyAttribute("unreachable")] public virtual System.Collections.Generic.IList<string> Unreachable { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The response message for Locations.ListLocations.</summary> public class ListLocationsResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>A list of locations that matches the specified filter in the request.</summary> [Newtonsoft.Json.JsonPropertyAttribute("locations")] public virtual System.Collections.Generic.IList<Location> Locations { get; set; } /// <summary>The standard List next-page token.</summary> [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")] public virtual string NextPageToken { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The response message for Operations.ListOperations.</summary> public class ListOperationsResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The standard List next-page token.</summary> [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")] public virtual string NextPageToken { get; set; } /// <summary>A list of operations that matches the specified filter in the request.</summary> [Newtonsoft.Json.JsonPropertyAttribute("operations")] public virtual System.Collections.Generic.IList<Operation> Operations { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Response message for RealmsService.ListRealms.</summary> public class ListRealmsResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Token to retrieve the next page of results, or empty if there are no more results in the /// list.</summary> [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")] public virtual string NextPageToken { get; set; } /// <summary>The list of realms.</summary> [Newtonsoft.Json.JsonPropertyAttribute("realms")] public virtual System.Collections.Generic.IList<Realm> Realms { get; set; } /// <summary>List of locations that could not be reached.</summary> [Newtonsoft.Json.JsonPropertyAttribute("unreachable")] public virtual System.Collections.Generic.IList<string> Unreachable { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A resource that represents Google Cloud Platform location.</summary> public class Location : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The friendly name for this location, typically a nearby city name. For example, "Tokyo".</summary> [Newtonsoft.Json.JsonPropertyAttribute("displayName")] public virtual string DisplayName { get; set; } /// <summary>Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us- /// east1"}</summary> [Newtonsoft.Json.JsonPropertyAttribute("labels")] public virtual System.Collections.Generic.IDictionary<string, string> Labels { get; set; } /// <summary>The canonical id for this location. For example: `"us-east1"`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("locationId")] public virtual string LocationId { get; set; } /// <summary>Service-specific metadata. For example the available capacity at the given location.</summary> [Newtonsoft.Json.JsonPropertyAttribute("metadata")] public virtual System.Collections.Generic.IDictionary<string, object> Metadata { get; set; } /// <summary>Resource name for the location, which may vary between implementations. For example: `"projects /// /example-project/locations/us-east1"`</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Specifies what kind of log the caller must write</summary> public class LogConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Cloud audit options.</summary> [Newtonsoft.Json.JsonPropertyAttribute("cloudAudit")] public virtual CloudAuditOptions CloudAudit { get; set; } /// <summary>Counter options.</summary> [Newtonsoft.Json.JsonPropertyAttribute("counter")] public virtual CounterOptions Counter { get; set; } /// <summary>Data access options.</summary> [Newtonsoft.Json.JsonPropertyAttribute("dataAccess")] public virtual DataAccessOptions DataAccess { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>This resource represents a long-running operation that is the result of a network API call.</summary> public class Operation : Google.Apis.Requests.IDirectResponseSchema { /// <summary>If the value is `false`, it means the operation is still in progress. If `true`, the operation is /// completed, and either `error` or `response` is available.</summary> [Newtonsoft.Json.JsonPropertyAttribute("done")] public virtual System.Nullable<bool> Done { get; set; } /// <summary>The error result of the operation in case of failure or cancellation.</summary> [Newtonsoft.Json.JsonPropertyAttribute("error")] public virtual Status Error { get; set; } /// <summary>Service-specific metadata associated with the operation. It typically contains progress information /// and common metadata such as create time. Some services might not provide such metadata. Any method that /// returns a long-running operation should document the metadata type, if any.</summary> [Newtonsoft.Json.JsonPropertyAttribute("metadata")] public virtual System.Collections.Generic.IDictionary<string, object> Metadata { get; set; } /// <summary>The server-assigned name, which is only unique within the same service that originally returns it. /// If you use the default HTTP mapping, the `name` should be a resource name ending with /// `operations/{unique_id}`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>The normal response of the operation in case of success. If the original method returns no data on /// success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard /// `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have /// the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("response")] public virtual System.Collections.Generic.IDictionary<string, object> Response { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Represents the metadata of the long-running operation.</summary> public class OperationMetadata : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Output only. API version used to start the operation.</summary> [Newtonsoft.Json.JsonPropertyAttribute("apiVersion")] public virtual string ApiVersion { get; set; } /// <summary>Output only. The time the operation was created.</summary> [Newtonsoft.Json.JsonPropertyAttribute("createTime")] public virtual object CreateTime { get; set; } /// <summary>Output only. The time the operation finished running.</summary> [Newtonsoft.Json.JsonPropertyAttribute("endTime")] public virtual object EndTime { get; set; } /// <summary>Output only. Operation status for Game Services API operations. Operation status is in the form of /// key-value pairs where keys are resource IDs and the values show the status of the operation. In case of /// failures, the value includes an error code and error message.</summary> [Newtonsoft.Json.JsonPropertyAttribute("operationStatus")] public virtual System.Collections.Generic.IDictionary<string, OperationStatus> OperationStatus { get; set; } /// <summary>Output only. Identifies whether the user has requested cancellation of the operation. Operations /// that have successfully been cancelled have Operation.error value with a google.rpc.Status.code of 1, /// corresponding to `Code.CANCELLED`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("requestedCancellation")] public virtual System.Nullable<bool> RequestedCancellation { get; set; } /// <summary>Output only. Human-readable status of the operation, if any.</summary> [Newtonsoft.Json.JsonPropertyAttribute("statusMessage")] public virtual string StatusMessage { get; set; } /// <summary>Output only. Server-defined resource path for the target of the operation.</summary> [Newtonsoft.Json.JsonPropertyAttribute("target")] public virtual string Target { get; set; } /// <summary>Output only. List of Locations that could not be reached.</summary> [Newtonsoft.Json.JsonPropertyAttribute("unreachable")] public virtual System.Collections.Generic.IList<string> Unreachable { get; set; } /// <summary>Output only. Name of the verb executed by the operation.</summary> [Newtonsoft.Json.JsonPropertyAttribute("verb")] public virtual string Verb { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } public class OperationStatus : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Output only. Whether the operation is done or still in progress.</summary> [Newtonsoft.Json.JsonPropertyAttribute("done")] public virtual System.Nullable<bool> Done { get; set; } /// <summary>The error code in case of failures.</summary> [Newtonsoft.Json.JsonPropertyAttribute("errorCode")] public virtual string ErrorCode { get; set; } /// <summary>The human-readable error message.</summary> [Newtonsoft.Json.JsonPropertyAttribute("errorMessage")] public virtual string ErrorMessage { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud /// resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. /// Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a /// named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some /// types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that /// allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on /// attributes of the request, the resource, or both. To learn which resources support conditions in their IAM /// policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON /// example:** { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ /// "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project- /// id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ /// "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access /// after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": /// "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - user:mike@example.com - /// group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: /// roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: /// roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access /// after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: /// 3 For a description of IAM and its features, see the [IAM /// documentation](https://cloud.google.com/iam/docs/).</summary> public class Policy : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Specifies cloud audit logging configuration for this policy.</summary> [Newtonsoft.Json.JsonPropertyAttribute("auditConfigs")] public virtual System.Collections.Generic.IList<AuditConfig> AuditConfigs { get; set; } /// <summary>Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines /// how and when the `bindings` are applied. Each of the `bindings` must contain at least one member.</summary> [Newtonsoft.Json.JsonPropertyAttribute("bindings")] public virtual System.Collections.Generic.IList<Binding> Bindings { get; set; } /// <summary>`etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of /// a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the /// read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned /// in the response to `getIamPolicy`, and systems are expected to put that etag in the request to /// `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** /// If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit /// this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the /// conditions in the version `3` policy are lost.</summary> [Newtonsoft.Json.JsonPropertyAttribute("etag")] public virtual string ETag { get; set; } [Newtonsoft.Json.JsonPropertyAttribute("iamOwned")] public virtual System.Nullable<bool> IamOwned { get; set; } /// <summary>If more than one rule is specified, the rules are applied in the following manner: - All matching /// LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will /// be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule /// matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - /// Otherwise, if no rule applies, permission is denied.</summary> [Newtonsoft.Json.JsonPropertyAttribute("rules")] public virtual System.Collections.Generic.IList<Rule> Rules { get; set; } /// <summary>Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an /// invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. /// This requirement applies to the following operations: * Getting a policy that includes a conditional role /// binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * /// Removing any role binding, with or without a condition, from a policy that includes conditions /// **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call /// `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version /// `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any /// conditions, operations on that policy may specify any valid version or leave the field unset. To learn which /// resources support conditions in their IAM policies, see the [IAM /// documentation](https://cloud.google.com/iam/help/conditions/resource-policies).</summary> [Newtonsoft.Json.JsonPropertyAttribute("version")] public virtual System.Nullable<int> Version { get; set; } } /// <summary>Response message for GameServerClustersService.PreviewCreateGameServerCluster.</summary> public class PreviewCreateGameServerClusterResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The ETag of the game server cluster.</summary> [Newtonsoft.Json.JsonPropertyAttribute("etag")] public virtual string ETag { get; set; } /// <summary>The target state.</summary> [Newtonsoft.Json.JsonPropertyAttribute("targetState")] public virtual TargetState TargetState { get; set; } } /// <summary>Response message for GameServerClustersService.PreviewDeleteGameServerCluster.</summary> public class PreviewDeleteGameServerClusterResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The ETag of the game server cluster.</summary> [Newtonsoft.Json.JsonPropertyAttribute("etag")] public virtual string ETag { get; set; } /// <summary>The target state.</summary> [Newtonsoft.Json.JsonPropertyAttribute("targetState")] public virtual TargetState TargetState { get; set; } } /// <summary>Response message for PreviewGameServerDeploymentRollout. This has details about the Agones fleet and /// autoscaler to be actuated.</summary> public class PreviewGameServerDeploymentRolloutResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>ETag of the game server deployment.</summary> [Newtonsoft.Json.JsonPropertyAttribute("etag")] public virtual string ETag { get; set; } /// <summary>The target state.</summary> [Newtonsoft.Json.JsonPropertyAttribute("targetState")] public virtual TargetState TargetState { get; set; } /// <summary>Locations that could not be reached on this request.</summary> [Newtonsoft.Json.JsonPropertyAttribute("unavailable")] public virtual System.Collections.Generic.IList<string> Unavailable { get; set; } } /// <summary>Response message for RealmsService.PreviewRealmUpdate.</summary> public class PreviewRealmUpdateResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>ETag of the realm.</summary> [Newtonsoft.Json.JsonPropertyAttribute("etag")] public virtual string ETag { get; set; } /// <summary>The target state.</summary> [Newtonsoft.Json.JsonPropertyAttribute("targetState")] public virtual TargetState TargetState { get; set; } } /// <summary>Response message for GameServerClustersService.PreviewUpdateGameServerCluster</summary> public class PreviewUpdateGameServerClusterResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The ETag of the game server cluster.</summary> [Newtonsoft.Json.JsonPropertyAttribute("etag")] public virtual string ETag { get; set; } /// <summary>The target state.</summary> [Newtonsoft.Json.JsonPropertyAttribute("targetState")] public virtual TargetState TargetState { get; set; } } /// <summary>A realm resource.</summary> public class Realm : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Output only. The creation time.</summary> [Newtonsoft.Json.JsonPropertyAttribute("createTime")] public virtual object CreateTime { get; set; } /// <summary>Human readable description of the realm.</summary> [Newtonsoft.Json.JsonPropertyAttribute("description")] public virtual string Description { get; set; } /// <summary>ETag of the resource.</summary> [Newtonsoft.Json.JsonPropertyAttribute("etag")] public virtual string ETag { get; set; } /// <summary>The labels associated with this realm. Each label is a key-value pair.</summary> [Newtonsoft.Json.JsonPropertyAttribute("labels")] public virtual System.Collections.Generic.IDictionary<string, string> Labels { get; set; } /// <summary>The resource name of the realm. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm}`. For example, `projects/my- /// project/locations/{location}/realms/my-realm`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>Required. Time zone where all policies targeting this realm are evaluated. The value of this field /// must be from the IANA time zone database: https://www.iana.org/time-zones.</summary> [Newtonsoft.Json.JsonPropertyAttribute("timeZone")] public virtual string TimeZone { get; set; } /// <summary>Output only. The last-modified time.</summary> [Newtonsoft.Json.JsonPropertyAttribute("updateTime")] public virtual object UpdateTime { get; set; } } /// <summary>The realm selector, used to match realm resources.</summary> public class RealmSelector : Google.Apis.Requests.IDirectResponseSchema { /// <summary>List of realms to match.</summary> [Newtonsoft.Json.JsonPropertyAttribute("realms")] public virtual System.Collections.Generic.IList<string> Realms { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A rule to be applied in a Policy.</summary> public class Rule : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Required</summary> [Newtonsoft.Json.JsonPropertyAttribute("action")] public virtual string Action { get; set; } /// <summary>Additional restrictions that must be met. All conditions must pass for the rule to match.</summary> [Newtonsoft.Json.JsonPropertyAttribute("conditions")] public virtual System.Collections.Generic.IList<Condition> Conditions { get; set; } /// <summary>Human-readable description of the rule.</summary> [Newtonsoft.Json.JsonPropertyAttribute("description")] public virtual string Description { get; set; } /// <summary>If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is /// in at least one of these entries.</summary> [Newtonsoft.Json.JsonPropertyAttribute("in")] public virtual System.Collections.Generic.IList<string> In__ { get; set; } /// <summary>The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG /// action.</summary> [Newtonsoft.Json.JsonPropertyAttribute("logConfig")] public virtual System.Collections.Generic.IList<LogConfig> LogConfig { get; set; } /// <summary>If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR /// is in none of the entries. The format for in and not_in entries can be found at in the Local IAM /// documentation (see go/local-iam#features).</summary> [Newtonsoft.Json.JsonPropertyAttribute("notIn")] public virtual System.Collections.Generic.IList<string> NotIn { get; set; } /// <summary>A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all /// permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.</summary> [Newtonsoft.Json.JsonPropertyAttribute("permissions")] public virtual System.Collections.Generic.IList<string> Permissions { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Autoscaling config for an Agones fleet.</summary> public class ScalingConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Required. Agones fleet autoscaler spec. Example spec: /// https://agones.dev/site/docs/reference/fleetautoscaler/</summary> [Newtonsoft.Json.JsonPropertyAttribute("fleetAutoscalerSpec")] public virtual string FleetAutoscalerSpec { get; set; } /// <summary>Required. The name of the Scaling Config</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>The schedules to which this Scaling Config applies.</summary> [Newtonsoft.Json.JsonPropertyAttribute("schedules")] public virtual System.Collections.Generic.IList<Schedule> Schedules { get; set; } /// <summary>Labels used to identify the game server clusters to which this Agones scaling config applies. A /// game server cluster is subject to this Agones scaling config if its labels match any of the selector /// entries.</summary> [Newtonsoft.Json.JsonPropertyAttribute("selectors")] public virtual System.Collections.Generic.IList<LabelSelector> Selectors { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The schedule of a recurring or one time event. The event's time span is specified by start_time and /// end_time. If the scheduled event's timespan is larger than the cron_spec + cron_job_duration, the event will be /// recurring. If only cron_spec + cron_job_duration are specified, the event is effective starting at the local /// time specified by cron_spec, and is recurring. start_time|-------[cron job]-------[cron job]-------[cron /// job]---|end_time cron job: cron spec start time + duration</summary> public class Schedule : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The duration for the cron job event. The duration of the event is effective after the cron job's /// start time.</summary> [Newtonsoft.Json.JsonPropertyAttribute("cronJobDuration")] public virtual object CronJobDuration { get; set; } /// <summary>The cron definition of the scheduled event. See https://en.wikipedia.org/wiki/Cron. Cron spec /// specifies the local time as defined by the realm.</summary> [Newtonsoft.Json.JsonPropertyAttribute("cronSpec")] public virtual string CronSpec { get; set; } /// <summary>The end time of the event.</summary> [Newtonsoft.Json.JsonPropertyAttribute("endTime")] public virtual object EndTime { get; set; } /// <summary>The start time of the event.</summary> [Newtonsoft.Json.JsonPropertyAttribute("startTime")] public virtual object StartTime { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Request message for `SetIamPolicy` method.</summary> public class SetIamPolicyRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary>REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to /// a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) /// might reject them.</summary> [Newtonsoft.Json.JsonPropertyAttribute("policy")] public virtual Policy Policy { get; set; } /// <summary>OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask /// will be modified. If no mask is provided, the following default mask is used: `paths: "bindings, /// etag"`</summary> [Newtonsoft.Json.JsonPropertyAttribute("updateMask")] public virtual object UpdateMask { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Encapsulates Agones fleet spec and Agones autoscaler spec sources.</summary> public class SpecSource : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The game server config resource. Uses the form: `projects/{project}/locations/{location}/gameServer /// Deployments/{deployment_id}/configs/{config_id}`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("gameServerConfigName")] public virtual string GameServerConfigName { get; set; } /// <summary>The name of the Agones leet config or Agones scaling config used to derive the Agones fleet or /// Agones autoscaler spec.</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The `Status` type defines a logical error model that is suitable for different programming /// environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` /// message contains three pieces of data: error code, error message, and error details. You can find out more about /// this error model and how to work with it in the [API Design /// Guide](https://cloud.google.com/apis/design/errors).</summary> public class Status : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The status code, which should be an enum value of google.rpc.Code.</summary> [Newtonsoft.Json.JsonPropertyAttribute("code")] public virtual System.Nullable<int> Code { get; set; } /// <summary>A list of messages that carry the error details. There is a common set of message types for APIs to /// use.</summary> [Newtonsoft.Json.JsonPropertyAttribute("details")] public virtual System.Collections.Generic.IList<System.Collections.Generic.IDictionary<string, object>> Details { get; set; } /// <summary>A developer-facing error message, which should be in English. Any user-facing error message should /// be localized and sent in the google.rpc.Status.details field, or localized by the client.</summary> [Newtonsoft.Json.JsonPropertyAttribute("message")] public virtual string Message { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Details about the Agones resources.</summary> public class TargetDetails : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Agones fleet details for game server clusters and game server deployments.</summary> [Newtonsoft.Json.JsonPropertyAttribute("fleetDetails")] public virtual System.Collections.Generic.IList<TargetFleetDetails> FleetDetails { get; set; } /// <summary>The game server cluster name. Uses the form: /// `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("gameServerClusterName")] public virtual string GameServerClusterName { get; set; } /// <summary>The game server deployment name. Uses the form: /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment_id}`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("gameServerDeploymentName")] public virtual string GameServerDeploymentName { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Target Agones fleet specification.</summary> public class TargetFleet : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The name of the Agones fleet.</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>Encapsulates the source of the Agones fleet spec. The Agones fleet spec source.</summary> [Newtonsoft.Json.JsonPropertyAttribute("specSource")] public virtual SpecSource SpecSource { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Target Agones autoscaler policy reference.</summary> public class TargetFleetAutoscaler : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The name of the Agones autoscaler.</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>Encapsulates the source of the Agones fleet spec. Details about the Agones autoscaler /// spec.</summary> [Newtonsoft.Json.JsonPropertyAttribute("specSource")] public virtual SpecSource SpecSource { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Details of the target Agones fleet.</summary> public class TargetFleetDetails : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Reference to target Agones fleet autoscaling policy.</summary> [Newtonsoft.Json.JsonPropertyAttribute("autoscaler")] public virtual TargetFleetAutoscaler Autoscaler { get; set; } /// <summary>Reference to target Agones fleet.</summary> [Newtonsoft.Json.JsonPropertyAttribute("fleet")] public virtual TargetFleet Fleet { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Encapsulates the Target state.</summary> public class TargetState : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Details about Agones fleets.</summary> [Newtonsoft.Json.JsonPropertyAttribute("details")] public virtual System.Collections.Generic.IList<TargetDetails> Details { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Request message for `TestIamPermissions` method.</summary> public class TestIamPermissionsRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The set of permissions to check for the `resource`. Permissions with wildcards (such as '*' or /// 'storage.*') are not allowed. For more information see [IAM /// Overview](https://cloud.google.com/iam/docs/overview#permissions).</summary> [Newtonsoft.Json.JsonPropertyAttribute("permissions")] public virtual System.Collections.Generic.IList<string> Permissions { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Response message for `TestIamPermissions` method.</summary> public class TestIamPermissionsResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>A subset of `TestPermissionsRequest.permissions` that the caller is allowed.</summary> [Newtonsoft.Json.JsonPropertyAttribute("permissions")] public virtual System.Collections.Generic.IList<string> Permissions { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } }
53.801457
199
0.567179
[ "Apache-2.0" ]
17666349388/google-api-dotnet-client
Src/Generated/Google.Apis.GameServices.v1beta/Google.Apis.GameServices.v1beta.cs
228,979
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("1To20")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("1To20")] [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("204db20f-090b-4941-a7e7-7d0b5df0b6b9")] // 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.243243
84
0.745283
[ "MIT" ]
bobo4aces/02.SoftUni-TechModule
02. ST - 01. Git And GitHub/Homeworkk/1To20/Properties/AssemblyInfo.cs
1,381
C#
/* * * * * * * * */ using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace VisualStudioRichPresence.Entities { [UnmanagedFunctionPointer (CallingConvention.Cdecl)] public delegate void ReadyCallback(); [UnmanagedFunctionPointer (CallingConvention.Cdecl)] public delegate void DisconnectedCallback(int errorCode, string message); [UnmanagedFunctionPointer (CallingConvention.Cdecl)] public delegate void ErrorCallback(int errorCode, string message); [UnmanagedFunctionPointer (CallingConvention.Cdecl)] public delegate void JoinCallback(string secret); [UnmanagedFunctionPointer (CallingConvention.Cdecl)] public delegate void SpectateCallback(string secret); [UnmanagedFunctionPointer (CallingConvention.Cdecl)] public delegate void RequestCallback(ref JoinRequest request); public struct EventHandlers { public ReadyCallback readyCallback; public DisconnectedCallback disconnectedCallback; public ErrorCallback errorCallback; public JoinCallback joinCallback; public SpectateCallback spectateCallback; public RequestCallback requestCallback; } [Serializable, StructLayout (LayoutKind.Sequential)] public struct RichPresenceStruct { public IntPtr state; /* max 128 bytes */ public IntPtr details; /* max 128 bytes */ public long startTimestamp; public long endTimestamp; public IntPtr largeImageKey; /* max 32 bytes */ public IntPtr largeImageText; /* max 128 bytes */ public IntPtr smallImageKey; /* max 32 bytes */ public IntPtr smallImageText; /* max 128 bytes */ public IntPtr partyId; /* max 128 bytes */ public int partySize; public int partyMax; public IntPtr matchSecret; /* max 128 bytes */ public IntPtr joinSecret; /* max 128 bytes */ public IntPtr spectateSecret; /* max 128 bytes */ public bool instance; } [Serializable] public struct JoinRequest { public string userId; public string username; public string discriminator; public string avatar; } public enum Reply { No = 0, Yes = 1, Ignore = 2 } public class DiscordRpc { public static long GetTimestamp() => GetTimestamp(DateTime.UtcNow); public static long GetTimestamp(DateTime dt) { return (long)dt.Subtract (new DateTime (1970, 1, 1)).TotalSeconds; } [DllImport ("discord-rpc", EntryPoint = "Discord_Initialize", CallingConvention = CallingConvention.Cdecl)] public static extern void Initialize(string applicationId, ref EventHandlers handlers, bool autoRegister, string optionalSteamId); [DllImport ("discord-rpc", EntryPoint = "Discord_Shutdown", CallingConvention = CallingConvention.Cdecl)] public static extern void Shutdown(); [DllImport ("discord-rpc", EntryPoint = "Discord_RunCallbacks", CallingConvention = CallingConvention.Cdecl)] public static extern void RunCallbacks(); [DllImport ("discord-rpc", EntryPoint = "Discord_UpdatePresence", CallingConvention = CallingConvention.Cdecl)] private static extern void UpdatePresenceNative(ref RichPresenceStruct presence); [DllImport ("discord-rpc", EntryPoint = "Discord_ClearPresence", CallingConvention = CallingConvention.Cdecl)] public static extern void ClearPresence(); [DllImport ("discord-rpc", EntryPoint = "Discord_Respond", CallingConvention = CallingConvention.Cdecl)] public static extern void Respond(string userId, Reply reply); [DllImport ("discord-rpc", EntryPoint = "Discord_UpdateHandlers", CallingConvention = CallingConvention.Cdecl)] public static extern void UpdateHandlers(ref EventHandlers handlers); public static void UpdatePresence(RichPresence presence) { var presencestruct = presence.GetStruct (); UpdatePresenceNative (ref presencestruct); presence.FreeMem (); } } public class RichPresence { private RichPresenceStruct _presence; private readonly List<IntPtr> _buffers = new List<IntPtr> (10); public string state; /* max 128 bytes */ public string details; /* max 128 bytes */ public long? startTimestamp; public long? endTimestamp; public string largeImageKey; /* max 32 bytes */ public string largeImageText; /* max 128 bytes */ public string smallImageKey; /* max 32 bytes */ public string smallImageText; /* max 128 bytes */ public string partyId; /* max 128 bytes */ public int partySize; public int partyMax; public string matchSecret; /* max 128 bytes */ public string joinSecret; /* max 128 bytes */ public string spectateSecret; /* max 128 bytes */ public bool instance; /// <summary> /// Get the <see cref="RichPresenceStruct"/> reprensentation of this instance /// </summary> /// <returns><see cref="RichPresenceStruct"/> reprensentation of this instance</returns> internal RichPresenceStruct GetStruct() { if(_buffers.Count > 0) { FreeMem (); } _presence.state = StrToPtr (state, 128); _presence.details = StrToPtr (details, 128); if (startTimestamp.HasValue) _presence.startTimestamp = startTimestamp.Value; if (endTimestamp.HasValue) _presence.endTimestamp = endTimestamp.Value; _presence.largeImageKey = StrToPtr (largeImageKey, 32); _presence.largeImageText = StrToPtr (largeImageText, 128); _presence.smallImageKey = StrToPtr (smallImageKey, 32); _presence.smallImageText = StrToPtr (smallImageText, 128); _presence.partyId = StrToPtr (partyId, 128); _presence.partySize = partySize; _presence.partyMax = partyMax; _presence.matchSecret = StrToPtr (matchSecret, 128); _presence.joinSecret = StrToPtr (joinSecret, 128); _presence.spectateSecret = StrToPtr (spectateSecret, 128); _presence.instance = instance; return _presence; } /// <summary> /// Returns a pointer to a representation of the given string with a size of maxbytes /// </summary> /// <param name="input">String to convert</param> /// <param name="maxbytes">Max number of bytes to use</param> /// <returns>Pointer to the UTF-8 representation of <see cref="input"/></returns> private IntPtr StrToPtr(string input, int maxbytes) { if(string.IsNullOrEmpty (input)) return IntPtr.Zero; var convstr = StrClampBytes (input, maxbytes); var convbytecnt = Encoding.UTF8.GetByteCount (convstr); var buffer = Marshal.AllocHGlobal (convbytecnt); _buffers.Add (buffer); Marshal.Copy (Encoding.UTF8.GetBytes (convstr), 0, buffer, convbytecnt); return buffer; } /// <summary> /// Convert string to UTF-8 and add null termination /// </summary> /// <param name="toconv">string to convert</param> /// <returns>UTF-8 representation of <see cref="toconv"/> with added null termination</returns> private static string StrToUtf8NullTerm(string toconv) { var str = toconv.Trim (); var bytes = Encoding.Default.GetBytes (str); if(bytes.Length > 0 && bytes[bytes.Length - 1] != 0) { str += "\0\0"; } return Encoding.UTF8.GetString (Encoding.UTF8.GetBytes (str)); } /// <summary> /// Clamp the string to the given byte length preserving null termination /// </summary> /// <param name="toclamp">string to clamp</param> /// <param name="maxbytes">max bytes the resulting string should have (including null termination)</param> /// <returns>null terminated string with a byte length less or equal to <see cref="maxbytes"/></returns> private static string StrClampBytes(string toclamp, int maxbytes) { var str = StrToUtf8NullTerm (toclamp); var strbytes = Encoding.UTF8.GetBytes (str); if(strbytes.Length <= maxbytes) { return str; } var newstrbytes = new byte[] { }; Array.Copy (strbytes, 0, newstrbytes, 0, maxbytes - 1); newstrbytes[newstrbytes.Length - 1] = 0; newstrbytes[newstrbytes.Length - 2] = 0; return Encoding.UTF8.GetString (newstrbytes); } /// <summary> /// Free the allocated memory for conversion to <see cref="RichPresenceStruct"/> /// </summary> internal void FreeMem() { for(var i = _buffers.Count - 1; i >= 0; i--) { Marshal.FreeHGlobal (_buffers[i]); _buffers.RemoveAt (i); } } } }
34.080169
132
0.72985
[ "MIT" ]
Storm-MC/VisualStudioRichPresence
VisualStudioRichPresence/Entities/DiscordRpc.cs
8,079
C#
using Com.Danliris.Service.Packing.Inventory.Application.ToBeRefactored.GarmentShipping.ExportSalesDO; using System; using System.Collections.Generic; using System.Linq; using System.Text; using Xunit; namespace Com.Danliris.Service.Packing.Inventory.Test.Services.GarmentShipping.ExportSalesDO { public class GarmentShippingExportSalesDOValidationTest { [Fact] public void Validate_DefaultValue() { GarmentShippingExportSalesDOViewModel viewModel = new GarmentShippingExportSalesDOViewModel(); var result = viewModel.Validate(null); Assert.NotEmpty(result.ToList()); } [Fact] public void Validate_ItemsDefaultValue() { GarmentShippingExportSalesDOViewModel viewModel = new GarmentShippingExportSalesDOViewModel(); viewModel.items = new List<GarmentShippingExportSalesDOItemViewModel> { new GarmentShippingExportSalesDOItemViewModel() }; var result = viewModel.Validate(null); Assert.NotEmpty(result.ToList()); } } }
31.194444
106
0.688335
[ "MIT" ]
AndreaZain/com-danliris-service-packing-inventory
src/Com.Danliris.Service.Packing.Inventory.Test/Services/GarmentShipping/ExportSalesDO/GarmentShippingExportSalesDOValidationTest.cs
1,125
C#
namespace EventTraceKit.VsExtension.Filtering { using System; using System.Diagnostics; [Flags] public enum TokenFlags { None = 0, Unary = 1 } public struct SourceLocation { public SourceLocation(int id) { Id = id; } public int Id { get; } } public enum TokenKind { Unknown, LParen, RParen, Less, LessLess, LessEqual, Greater, GreaterGreater, GreaterEqual, Question, Exclaim, ExclaimEqual, Amp, AmpAmp, Pipe, PipePipe, Plus, Minus, Percent, Star, Slash, Colon, EqualEqual, Caret, NumericConstant, StringLiteral, GuidLiteral, Identifier, } [DebuggerDisplay("{" + nameof(Kind) + "}")] public struct Token { private TextBuffer buffer; private int literalOffset; public TokenKind Kind { get; set; } public TokenFlags Flags { get; set; } public int Length { get; set; } public SourceLocation Location { get; set; } public string GetText() { return buffer?.GetText(literalOffset, Length); } public string GetUnquotedText() { if (Length < 2) return null; return buffer?.GetText(literalOffset + 1, Length - 2); } public bool Is(TokenKind kind) { return Kind == kind; } public bool IsOneOf(TokenKind kind1, TokenKind kind2) { return Kind == kind1 || Kind == kind2; } public void Reset() { Kind = TokenKind.Unknown; Flags = 0; Length = 0; literalOffset = 0; buffer = null; } public void SetLiteralData(TextBuffer buffer, int offset) { this.buffer = buffer; literalOffset = offset; } } }
20.086538
66
0.486357
[ "MIT" ]
gix/event-trace-kit
src/EventTraceKit.VsExtension/Filtering/Token.cs
2,089
C#
using Nexus.Entities; using Nexus.Entities.Pickups.Base; using Nexus.EventSystem; namespace Nexus.Events { /// <summary> /// Fires after a player drops an item. /// </summary> public class DroppedItem : Event { /// <summary> /// Gets the player who dropped the item. /// </summary> public Player Player { get; } /// <summary> /// Gets the item that was dropped. /// </summary> public BasePickup Item { get; } public DroppedItem(Player player, BasePickup item) { Player = player; Item = item; } } }
21.3
58
0.543036
[ "MIT" ]
NexusCommunity/Nexus
Nexus/Events/DroppedItem.cs
641
C#
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; namespace OrchardCore.Modules { /// <summary> /// When used on a class, it will include the service only /// if the specific features are enabled. /// </summary> [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] public class RequireFeaturesAttribute : Attribute { public RequireFeaturesAttribute(string featureName) { RequiredFeatureNames = new string[] { featureName }; } public RequireFeaturesAttribute(string featureName, params string[] otherFeatureNames) { var list = new List<string>(otherFeatureNames); list.Add(featureName); RequiredFeatureNames = list; } /// <summary> /// The names of the required features. /// </summary> public IList<string> RequiredFeatureNames { get; } public static IList<string> GetRequiredFeatureNamesForType(Type type) { var attribute = type.GetTypeInfo().GetCustomAttributes<RequireFeaturesAttribute>(false).FirstOrDefault(); return attribute?.RequiredFeatureNames ?? Array.Empty<string>(); } } }
31.3
117
0.65016
[ "BSD-3-Clause" ]
Yuexs/OrchardCore
src/OrchardCore/OrchardCore.Modules.Abstractions/RequireFeaturesAttribute.cs
1,252
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class DestroySoon : MonoBehaviour { void Start() { Destroy(gameObject, 0.5f); } }
15.75
40
0.693122
[ "MIT" ]
Dmarsh12fitch/RobDavGGJ
Assets/DestroySoon.cs
189
C#
using System; using System.Globalization; using ClearHl7.Extensions; using ClearHl7.Helpers; using ClearHl7.Serialization; using ClearHl7.V281.Types; namespace ClearHl7.V281.Segments { /// <summary> /// HL7 Version 2 Segment CNS - Clear Notification. /// </summary> public class CnsSegment : ISegment { /// <summary> /// Gets the ID for the Segment. This property is read-only. /// </summary> public string Id { get; } = "CNS"; /// <summary> /// Gets or sets the rank, or ordinal, which describes the place that this Segment resides in an ordered list of Segments. /// </summary> public int Ordinal { get; set; } /// <summary> /// CNS.1 - Starting Notification Reference Number. /// </summary> public decimal? StartingNotificationReferenceNumber { get; set; } /// <summary> /// CNS.2 - Ending Notification Reference Number. /// </summary> public decimal? EndingNotificationReferenceNumber { get; set; } /// <summary> /// CNS.3 - Starting Notification Date/Time. /// </summary> public DateTime? StartingNotificationDateTime { get; set; } /// <summary> /// CNS.4 - Ending Notification Date/Time. /// </summary> public DateTime? EndingNotificationDateTime { get; set; } /// <summary> /// CNS.5 - Starting Notification Code. /// </summary> public CodedWithExceptions StartingNotificationCode { get; set; } /// <summary> /// CNS.6 - Ending Notification Code. /// </summary> public CodedWithExceptions EndingNotificationCode { get; set; } /// <summary> /// Initializes properties of this instance with values parsed from the given delimited string. Separators defined in the Configuration class are used to split the string. /// </summary> /// <param name="delimitedString">A string representation that will be deserialized into the object instance.</param> /// <exception cref="ArgumentException">delimitedString does not begin with the proper segment Id.</exception> public void FromDelimitedString(string delimitedString) { FromDelimitedString(delimitedString, null); } /// <summary> /// Initializes properties of this instance with values parsed from the given delimited string. The provided separators are used to split the string. /// </summary> /// <param name="delimitedString">A string representation that will be deserialized into the object instance.</param> /// <param name="separators">The separators to use for splitting the string.</param> /// <exception cref="ArgumentException">delimitedString does not begin with the proper segment Id.</exception> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty<string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } StartingNotificationReferenceNumber = segments.Length > 1 && segments[1].Length > 0 ? segments[1].ToNullableDecimal() : null; EndingNotificationReferenceNumber = segments.Length > 2 && segments[2].Length > 0 ? segments[2].ToNullableDecimal() : null; StartingNotificationDateTime = segments.Length > 3 && segments[3].Length > 0 ? segments[3].ToNullableDateTime() : null; EndingNotificationDateTime = segments.Length > 4 && segments[4].Length > 0 ? segments[4].ToNullableDateTime() : null; StartingNotificationCode = segments.Length > 5 && segments[5].Length > 0 ? TypeSerializer.Deserialize<CodedWithExceptions>(segments[5], false, seps) : null; EndingNotificationCode = segments.Length > 6 && segments[6].Length > 0 ? TypeSerializer.Deserialize<CodedWithExceptions>(segments[6], false, seps) : null; } /// <summary> /// Returns a delimited string representation of this instance. /// </summary> /// <returns>A string.</returns> public string ToDelimitedString() { CultureInfo culture = CultureInfo.CurrentCulture; return string.Format( culture, StringHelper.StringFormatSequence(0, 7, Configuration.FieldSeparator), Id, StartingNotificationReferenceNumber.HasValue ? StartingNotificationReferenceNumber.Value.ToString(Consts.NumericFormat, culture) : null, EndingNotificationReferenceNumber.HasValue ? EndingNotificationReferenceNumber.Value.ToString(Consts.NumericFormat, culture) : null, StartingNotificationDateTime.HasValue ? StartingNotificationDateTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null, EndingNotificationDateTime.HasValue ? EndingNotificationDateTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null, StartingNotificationCode?.ToDelimitedString(), EndingNotificationCode?.ToDelimitedString() ).TrimEnd(Configuration.FieldSeparator.ToCharArray()); } } }
51.556522
181
0.628436
[ "MIT" ]
davebronson/clear-hl7-net
src/ClearHl7/V281/Segments/CnsSegment.cs
5,931
C#
using System; using System.Xml.Serialization; namespace Niue.Alipay.Domain { /// <summary> /// GetRuleInfo Data Structure. /// </summary> [Serializable] public class GetRuleInfo : AopObject { /// <summary> /// 截至时间 /// </summary> [XmlElement("end_time")] public string EndTime { get; set; } /// <summary> /// 发放次数限制 /// </summary> [XmlElement("get_count_limit")] public PeriodInfo GetCountLimit { get; set; } /// <summary> /// 开始时间 /// </summary> [XmlElement("start_time")] public string StartTime { get; set; } } }
21.548387
53
0.523952
[ "MIT" ]
P79N6A/abp-ant-design-pro-vue
Niue.Alipay/Domain/GetRuleInfo.cs
698
C#
using System; using System.Text; using Logger.Enums; using Logger.Models.Appenders.Contracts; using Logger.Models.Errors.Contracts; using Logger.Models.Layouts.Contracts; namespace Logger.Models.Appenders { class ConsoleAppender : IAppender { private int messagesAppended; public ConsoleAppender(ILayout layout, ErrorLevel errorLevel) { this.Layout = layout; this.ErrorLevel = errorLevel; this.messagesAppended = 0; } public ILayout Layout { get; } public ErrorLevel ErrorLevel { get; } public void Append(IError error) { string formattedError = this.Layout.FormatError(error); Console.WriteLine(formattedError); this.messagesAppended++; } public override string ToString() { StringBuilder sb = new StringBuilder(); sb.AppendLine($"Appender type: {this.GetType().Name}, Layout type: {this.Layout.GetType().Name}, Report level: {this.ErrorLevel.ToString()}, Messages appended: {this.messagesAppended}"); return sb.ToString().TrimEnd(); } } }
27.139535
198
0.631534
[ "MIT" ]
doba7a/SoftUni
CSharp Fundamentals/CSharp OOP Advanced/2. SOLID - Exercise/1. Logger/Models/Appenders/ConsoleAppender.cs
1,169
C#
using System; #nullable enable namespace Nexus.Tools.Validations.Attributes { public class DisplayNameAttribute : System.ComponentModel.DisplayNameAttribute { private readonly string? _displayName; public DisplayNameAttribute(string displayName) => _displayName = displayName; public DisplayNameAttribute(Type resourceType, string resourceName) { ResourceType = resourceType; ResourceName = resourceName; } public override string DisplayName { get { if (_displayName != null) return _displayName; if (ResourceName == null || !(ResourceType != null)) return string.Empty; object obj = ResourceType.GetProperty(ResourceName)?.GetValue(null, null) ?? string.Empty; return obj is string str ? str : obj.ToString() ?? string.Empty; } } public Type? ResourceType { get; set; } public string? ResourceName { get; set; } } } #nullable disable
26.5
106
0.586703
[ "MIT" ]
JuanDouglas/Nexus-Validations-Tools
Nexus.Tools/Attributes/DisplayNameAttribute.cs
1,115
C#
using System; using System.Collections.Generic; using Aop.Api.Response; namespace Aop.Api.Request { /// <summary> /// AOP API: alipay.mobile.public.label.delete /// </summary> public class AlipayMobilePublicLabelDeleteRequest : IAopRequest<AlipayMobilePublicLabelDeleteResponse> { /// <summary> /// JSON串 /// </summary> public string BizContent { get; set; } #region IAopRequest Members private string apiVersion = "1.0"; private string terminalType; private string terminalInfo; private string prodCode; private string notifyUrl; public void SetNotifyUrl(string notifyUrl){ this.notifyUrl = notifyUrl; } public string GetNotifyUrl(){ return this.notifyUrl; } public void SetTerminalType(String terminalType){ this.terminalType=terminalType; } public string GetTerminalType(){ return this.terminalType; } public void SetTerminalInfo(String terminalInfo){ this.terminalInfo=terminalInfo; } public string GetTerminalInfo(){ return this.terminalInfo; } public void SetProdCode(String prodCode){ this.prodCode=prodCode; } public string GetProdCode(){ return this.prodCode; } public string GetApiName() { return "alipay.mobile.public.label.delete"; } public void SetApiVersion(string apiVersion){ this.apiVersion=apiVersion; } public string GetApiVersion(){ return this.apiVersion; } public IDictionary<string, string> GetParameters() { AopDictionary parameters = new AopDictionary(); parameters.Add("biz_content", this.BizContent); return parameters; } #endregion } }
23.949367
106
0.613636
[ "Apache-2.0" ]
oceanho/AnyPayment
docs/alipay-sdk-NET-20151130120112/Request/AlipayMobilePublicLabelDeleteRequest.cs
1,894
C#
using System.ComponentModel.DataAnnotations; namespace Infotechia.DAL.Entities { public class Solution : IEntity { public int Id { get; set; } public string Name { get; set; } [DataType(DataType.Text)] public string Description { get; set; } public int ProblemId { get; set; } public Problem Problem { get; set; } } }
22.411765
47
0.614173
[ "BSD-2-Clause" ]
earth-emoji/Infotechia.Net
Infotechia.DAL/Entities/Solution.cs
381
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Irony.Ast; using Irony.Parsing; namespace Irony.Interpreter.Ast { //A node representing an anonymous function public class LambdaNode : AstNode { public AstNode Parameters; public AstNode Body; public LambdaNode() { } //Used by FunctionDefNode public LambdaNode(AstContext context, ParseTreeNode node, ParseTreeNode parameters, ParseTreeNode body) { InitImpl(context, node, parameters, body); } public override void Init(AstContext context, ParseTreeNode parseNode) { var mappedNodes = parseNode.GetMappedChildNodes(); InitImpl(context, parseNode, mappedNodes[0], mappedNodes[1]); } private void InitImpl(AstContext context, ParseTreeNode parseNode, ParseTreeNode parametersNode, ParseTreeNode bodyNode) { base.Init(context, parseNode); Parameters = AddChild("Parameters", parametersNode); Body = AddChild("Body", bodyNode); AsString = "Lambda[" + Parameters.ChildNodes.Count + "]"; Body.SetIsTail(); //this will be propagated to the last statement } public override void Reset() { DependentScopeInfo = null; base.Reset(); } protected override object DoEvaluate(ScriptThread thread) { thread.CurrentNode = this; //standard prolog lock (LockObject) { if (DependentScopeInfo == null) { var langCaseSensitive = thread.App.Language.Grammar.CaseSensitive; DependentScopeInfo = new ScopeInfo(this, langCaseSensitive); } // In the first evaluation the parameter list will add parameter's SlotInfo objects to Scope.ScopeInfo thread.PushScope(DependentScopeInfo, null); Parameters.Evaluate(thread); thread.PopScope(); //Set Evaluate method and invoke it later this.Evaluate = EvaluateAfter; } var result = Evaluate(thread); thread.CurrentNode = Parent; //standard epilog return result; } private object EvaluateAfter(ScriptThread thread) { thread.CurrentNode = this; //standard prolog var closure = new Closure(thread.CurrentScope, this); thread.CurrentNode = Parent; //standard epilog return closure; } public object Call(Scope creatorScope, ScriptThread thread, object[] parameters) { var save = thread.CurrentNode; //prolog, not standard - the caller is NOT target node's parent thread.CurrentNode = this; thread.PushClosureScope(DependentScopeInfo, creatorScope, parameters); Parameters.Evaluate(thread); // pre-process parameters var result = Body.Evaluate(thread); thread.PopScope(); thread.CurrentNode = save; //epilog, restoring caller return result; } public override void SetIsTail() { //ignore this call, do not mark this node as tail, it is meaningless } }//class }//namespace
34.783505
128
0.601363
[ "MIT" ]
Hyperspaces/Hyperspace.DotLua
src/Irony.Interpreter/Ast/Functions/LambdaNode.cs
3,376
C#
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Linq; using System.Threading.Tasks; using System.Windows; namespace TRMDesktopUI { /// <summary> /// App.xaml에 대한 상호 작용 논리 /// </summary> public partial class App : Application { } }
17.611111
42
0.694006
[ "MIT" ]
tspark9946/ParkRetailManager
TRMDesktopUI/App.xaml.cs
337
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. namespace System.Xml.Schema { using System.Collections; using System.Diagnostics; internal sealed class SchemaNames { private XmlNameTable _nameTable; public XmlNameTable NameTable { get { return _nameTable; } } public string NsDataType; public string NsDataTypeAlias; public string NsDataTypeOld; public string NsXml; public string NsXmlNs; public string NsXdr; public string NsXdrAlias; public string NsXs; public string NsXsi; public string XsiType; public string XsiNil; public string XsiSchemaLocation; public string XsiNoNamespaceSchemaLocation; public string XsdSchema; public string XdrSchema; public XmlQualifiedName QnPCData; public XmlQualifiedName QnXml; public XmlQualifiedName QnXmlNs; public XmlQualifiedName QnDtDt; public XmlQualifiedName QnXmlLang; public XmlQualifiedName QnName; public XmlQualifiedName QnType; public XmlQualifiedName QnMaxOccurs; public XmlQualifiedName QnMinOccurs; public XmlQualifiedName QnInfinite; public XmlQualifiedName QnModel; public XmlQualifiedName QnOpen; public XmlQualifiedName QnClosed; public XmlQualifiedName QnContent; public XmlQualifiedName QnMixed; public XmlQualifiedName QnEmpty; public XmlQualifiedName QnEltOnly; public XmlQualifiedName QnTextOnly; public XmlQualifiedName QnOrder; public XmlQualifiedName QnSeq; public XmlQualifiedName QnOne; public XmlQualifiedName QnMany; public XmlQualifiedName QnRequired; public XmlQualifiedName QnYes; public XmlQualifiedName QnNo; public XmlQualifiedName QnString; public XmlQualifiedName QnID; public XmlQualifiedName QnIDRef; public XmlQualifiedName QnIDRefs; public XmlQualifiedName QnEntity; public XmlQualifiedName QnEntities; public XmlQualifiedName QnNmToken; public XmlQualifiedName QnNmTokens; public XmlQualifiedName QnEnumeration; public XmlQualifiedName QnDefault; public XmlQualifiedName QnXdrSchema; public XmlQualifiedName QnXdrElementType; public XmlQualifiedName QnXdrElement; public XmlQualifiedName QnXdrGroup; public XmlQualifiedName QnXdrAttributeType; public XmlQualifiedName QnXdrAttribute; public XmlQualifiedName QnXdrDataType; public XmlQualifiedName QnXdrDescription; public XmlQualifiedName QnXdrExtends; public XmlQualifiedName QnXdrAliasSchema; public XmlQualifiedName QnDtType; public XmlQualifiedName QnDtValues; public XmlQualifiedName QnDtMaxLength; public XmlQualifiedName QnDtMinLength; public XmlQualifiedName QnDtMax; public XmlQualifiedName QnDtMin; public XmlQualifiedName QnDtMinExclusive; public XmlQualifiedName QnDtMaxExclusive; // For XSD Schema public XmlQualifiedName QnTargetNamespace; public XmlQualifiedName QnVersion; public XmlQualifiedName QnFinalDefault; public XmlQualifiedName QnBlockDefault; public XmlQualifiedName QnFixed; public XmlQualifiedName QnAbstract; public XmlQualifiedName QnBlock; public XmlQualifiedName QnSubstitutionGroup; public XmlQualifiedName QnFinal; public XmlQualifiedName QnNillable; public XmlQualifiedName QnRef; public XmlQualifiedName QnBase; public XmlQualifiedName QnDerivedBy; public XmlQualifiedName QnNamespace; public XmlQualifiedName QnProcessContents; public XmlQualifiedName QnRefer; public XmlQualifiedName QnPublic; public XmlQualifiedName QnSystem; public XmlQualifiedName QnSchemaLocation; public XmlQualifiedName QnValue; public XmlQualifiedName QnUse; public XmlQualifiedName QnForm; public XmlQualifiedName QnElementFormDefault; public XmlQualifiedName QnAttributeFormDefault; public XmlQualifiedName QnItemType; public XmlQualifiedName QnMemberTypes; public XmlQualifiedName QnXPath; public XmlQualifiedName QnXsdSchema; public XmlQualifiedName QnXsdAnnotation; public XmlQualifiedName QnXsdInclude; public XmlQualifiedName QnXsdImport; public XmlQualifiedName QnXsdElement; public XmlQualifiedName QnXsdAttribute; public XmlQualifiedName QnXsdAttributeGroup; public XmlQualifiedName QnXsdAnyAttribute; public XmlQualifiedName QnXsdGroup; public XmlQualifiedName QnXsdAll; public XmlQualifiedName QnXsdChoice; public XmlQualifiedName QnXsdSequence; public XmlQualifiedName QnXsdAny; public XmlQualifiedName QnXsdNotation; public XmlQualifiedName QnXsdSimpleType; public XmlQualifiedName QnXsdComplexType; public XmlQualifiedName QnXsdUnique; public XmlQualifiedName QnXsdKey; public XmlQualifiedName QnXsdKeyRef; public XmlQualifiedName QnXsdSelector; public XmlQualifiedName QnXsdField; public XmlQualifiedName QnXsdMinExclusive; public XmlQualifiedName QnXsdMinInclusive; public XmlQualifiedName QnXsdMaxInclusive; public XmlQualifiedName QnXsdMaxExclusive; public XmlQualifiedName QnXsdTotalDigits; public XmlQualifiedName QnXsdFractionDigits; public XmlQualifiedName QnXsdLength; public XmlQualifiedName QnXsdMinLength; public XmlQualifiedName QnXsdMaxLength; public XmlQualifiedName QnXsdEnumeration; public XmlQualifiedName QnXsdPattern; public XmlQualifiedName QnXsdDocumentation; public XmlQualifiedName QnXsdAppinfo; public XmlQualifiedName QnSource; public XmlQualifiedName QnXsdComplexContent; public XmlQualifiedName QnXsdSimpleContent; public XmlQualifiedName QnXsdRestriction; public XmlQualifiedName QnXsdExtension; public XmlQualifiedName QnXsdUnion; public XmlQualifiedName QnXsdList; public XmlQualifiedName QnXsdWhiteSpace; public XmlQualifiedName QnXsdRedefine; public XmlQualifiedName QnXsdAnyType; internal XmlQualifiedName[] TokenToQName = new XmlQualifiedName[(int)Token.XmlLang + 1]; public SchemaNames(XmlNameTable nameTable) { _nameTable = nameTable; NsDataType = nameTable.Add(XmlReservedNs.NsDataType); NsDataTypeAlias = nameTable.Add(XmlReservedNs.NsDataTypeAlias); NsDataTypeOld = nameTable.Add(XmlReservedNs.NsDataTypeOld); NsXml = nameTable.Add(XmlReservedNs.NsXml); NsXmlNs = nameTable.Add(XmlReservedNs.NsXmlNs); NsXdr = nameTable.Add(XmlReservedNs.NsXdr); NsXdrAlias = nameTable.Add(XmlReservedNs.NsXdrAlias); NsXs = nameTable.Add(XmlReservedNs.NsXs); NsXsi = nameTable.Add(XmlReservedNs.NsXsi); XsiType = nameTable.Add("type"); XsiNil = nameTable.Add("nil"); XsiSchemaLocation = nameTable.Add("schemaLocation"); XsiNoNamespaceSchemaLocation = nameTable.Add("noNamespaceSchemaLocation"); XsdSchema = nameTable.Add("schema"); XdrSchema = nameTable.Add("Schema"); QnPCData = new XmlQualifiedName(nameTable.Add("#PCDATA")); QnXml = new XmlQualifiedName(nameTable.Add("xml")); QnXmlNs = new XmlQualifiedName(nameTable.Add("xmlns"), NsXmlNs); QnDtDt = new XmlQualifiedName(nameTable.Add("dt"), NsDataType); QnXmlLang = new XmlQualifiedName(nameTable.Add("lang"), NsXml); // Empty namespace QnName = new XmlQualifiedName(nameTable.Add("name")); QnType = new XmlQualifiedName(nameTable.Add("type")); QnMaxOccurs = new XmlQualifiedName(nameTable.Add("maxOccurs")); QnMinOccurs = new XmlQualifiedName(nameTable.Add("minOccurs")); QnInfinite = new XmlQualifiedName(nameTable.Add("*")); QnModel = new XmlQualifiedName(nameTable.Add("model")); QnOpen = new XmlQualifiedName(nameTable.Add("open")); QnClosed = new XmlQualifiedName(nameTable.Add("closed")); QnContent = new XmlQualifiedName(nameTable.Add("content")); QnMixed = new XmlQualifiedName(nameTable.Add("mixed")); QnEmpty = new XmlQualifiedName(nameTable.Add("empty")); QnEltOnly = new XmlQualifiedName(nameTable.Add("eltOnly")); QnTextOnly = new XmlQualifiedName(nameTable.Add("textOnly")); QnOrder = new XmlQualifiedName(nameTable.Add("order")); QnSeq = new XmlQualifiedName(nameTable.Add("seq")); QnOne = new XmlQualifiedName(nameTable.Add("one")); QnMany = new XmlQualifiedName(nameTable.Add("many")); QnRequired = new XmlQualifiedName(nameTable.Add("required")); QnYes = new XmlQualifiedName(nameTable.Add("yes")); QnNo = new XmlQualifiedName(nameTable.Add("no")); QnString = new XmlQualifiedName(nameTable.Add("string")); QnID = new XmlQualifiedName(nameTable.Add("id")); QnIDRef = new XmlQualifiedName(nameTable.Add("idref")); QnIDRefs = new XmlQualifiedName(nameTable.Add("idrefs")); QnEntity = new XmlQualifiedName(nameTable.Add("entity")); QnEntities = new XmlQualifiedName(nameTable.Add("entities")); QnNmToken = new XmlQualifiedName(nameTable.Add("nmtoken")); QnNmTokens = new XmlQualifiedName(nameTable.Add("nmtokens")); QnEnumeration = new XmlQualifiedName(nameTable.Add("enumeration")); QnDefault = new XmlQualifiedName(nameTable.Add("default")); //For XSD Schema QnTargetNamespace = new XmlQualifiedName(nameTable.Add("targetNamespace")); QnVersion = new XmlQualifiedName(nameTable.Add("version")); QnFinalDefault = new XmlQualifiedName(nameTable.Add("finalDefault")); QnBlockDefault = new XmlQualifiedName(nameTable.Add("blockDefault")); QnFixed = new XmlQualifiedName(nameTable.Add("fixed")); QnAbstract = new XmlQualifiedName(nameTable.Add("abstract")); QnBlock = new XmlQualifiedName(nameTable.Add("block")); QnSubstitutionGroup = new XmlQualifiedName(nameTable.Add("substitutionGroup")); QnFinal = new XmlQualifiedName(nameTable.Add("final")); QnNillable = new XmlQualifiedName(nameTable.Add("nillable")); QnRef = new XmlQualifiedName(nameTable.Add("ref")); QnBase = new XmlQualifiedName(nameTable.Add("base")); QnDerivedBy = new XmlQualifiedName(nameTable.Add("derivedBy")); QnNamespace = new XmlQualifiedName(nameTable.Add("namespace")); QnProcessContents = new XmlQualifiedName(nameTable.Add("processContents")); QnRefer = new XmlQualifiedName(nameTable.Add("refer")); QnPublic = new XmlQualifiedName(nameTable.Add("public")); QnSystem = new XmlQualifiedName(nameTable.Add("system")); QnSchemaLocation = new XmlQualifiedName(nameTable.Add("schemaLocation")); QnValue = new XmlQualifiedName(nameTable.Add("value")); QnUse = new XmlQualifiedName(nameTable.Add("use")); QnForm = new XmlQualifiedName(nameTable.Add("form")); QnAttributeFormDefault = new XmlQualifiedName(nameTable.Add("attributeFormDefault")); QnElementFormDefault = new XmlQualifiedName(nameTable.Add("elementFormDefault")); QnSource = new XmlQualifiedName(nameTable.Add("source")); QnMemberTypes = new XmlQualifiedName(nameTable.Add("memberTypes")); QnItemType = new XmlQualifiedName(nameTable.Add("itemType")); QnXPath = new XmlQualifiedName(nameTable.Add("xpath")); // XDR namespace QnXdrSchema = new XmlQualifiedName(XdrSchema, NsXdr); QnXdrElementType = new XmlQualifiedName(nameTable.Add("ElementType"), NsXdr); QnXdrElement = new XmlQualifiedName(nameTable.Add("element"), NsXdr); QnXdrGroup = new XmlQualifiedName(nameTable.Add("group"), NsXdr); QnXdrAttributeType = new XmlQualifiedName(nameTable.Add("AttributeType"), NsXdr); QnXdrAttribute = new XmlQualifiedName(nameTable.Add("attribute"), NsXdr); QnXdrDataType = new XmlQualifiedName(nameTable.Add("datatype"), NsXdr); QnXdrDescription = new XmlQualifiedName(nameTable.Add("description"), NsXdr); QnXdrExtends = new XmlQualifiedName(nameTable.Add("extends"), NsXdr); // XDR alias namespace QnXdrAliasSchema = new XmlQualifiedName(nameTable.Add("Schema"), NsDataTypeAlias); // DataType namespace QnDtType = new XmlQualifiedName(nameTable.Add("type"), NsDataType); QnDtValues = new XmlQualifiedName(nameTable.Add("values"), NsDataType); QnDtMaxLength = new XmlQualifiedName(nameTable.Add("maxLength"), NsDataType); QnDtMinLength = new XmlQualifiedName(nameTable.Add("minLength"), NsDataType); QnDtMax = new XmlQualifiedName(nameTable.Add("max"), NsDataType); QnDtMin = new XmlQualifiedName(nameTable.Add("min"), NsDataType); QnDtMinExclusive = new XmlQualifiedName(nameTable.Add("minExclusive"), NsDataType); QnDtMaxExclusive = new XmlQualifiedName(nameTable.Add("maxExclusive"), NsDataType); // XSD namespace QnXsdSchema = new XmlQualifiedName(XsdSchema, NsXs); QnXsdAnnotation = new XmlQualifiedName(nameTable.Add("annotation"), NsXs); QnXsdInclude = new XmlQualifiedName(nameTable.Add("include"), NsXs); QnXsdImport = new XmlQualifiedName(nameTable.Add("import"), NsXs); QnXsdElement = new XmlQualifiedName(nameTable.Add("element"), NsXs); QnXsdAttribute = new XmlQualifiedName(nameTable.Add("attribute"), NsXs); QnXsdAttributeGroup = new XmlQualifiedName(nameTable.Add("attributeGroup"), NsXs); QnXsdAnyAttribute = new XmlQualifiedName(nameTable.Add("anyAttribute"), NsXs); QnXsdGroup = new XmlQualifiedName(nameTable.Add("group"), NsXs); QnXsdAll = new XmlQualifiedName(nameTable.Add("all"), NsXs); QnXsdChoice = new XmlQualifiedName(nameTable.Add("choice"), NsXs); QnXsdSequence = new XmlQualifiedName(nameTable.Add("sequence"), NsXs); QnXsdAny = new XmlQualifiedName(nameTable.Add("any"), NsXs); QnXsdNotation = new XmlQualifiedName(nameTable.Add("notation"), NsXs); QnXsdSimpleType = new XmlQualifiedName(nameTable.Add("simpleType"), NsXs); QnXsdComplexType = new XmlQualifiedName(nameTable.Add("complexType"), NsXs); QnXsdUnique = new XmlQualifiedName(nameTable.Add("unique"), NsXs); QnXsdKey = new XmlQualifiedName(nameTable.Add("key"), NsXs); QnXsdKeyRef = new XmlQualifiedName(nameTable.Add("keyref"), NsXs); QnXsdSelector = new XmlQualifiedName(nameTable.Add("selector"), NsXs); QnXsdField = new XmlQualifiedName(nameTable.Add("field"), NsXs); QnXsdMinExclusive = new XmlQualifiedName(nameTable.Add("minExclusive"), NsXs); QnXsdMinInclusive = new XmlQualifiedName(nameTable.Add("minInclusive"), NsXs); QnXsdMaxInclusive = new XmlQualifiedName(nameTable.Add("maxInclusive"), NsXs); QnXsdMaxExclusive = new XmlQualifiedName(nameTable.Add("maxExclusive"), NsXs); QnXsdTotalDigits = new XmlQualifiedName(nameTable.Add("totalDigits"), NsXs); QnXsdFractionDigits = new XmlQualifiedName(nameTable.Add("fractionDigits"), NsXs); QnXsdLength = new XmlQualifiedName(nameTable.Add("length"), NsXs); QnXsdMinLength = new XmlQualifiedName(nameTable.Add("minLength"), NsXs); QnXsdMaxLength = new XmlQualifiedName(nameTable.Add("maxLength"), NsXs); QnXsdEnumeration = new XmlQualifiedName(nameTable.Add("enumeration"), NsXs); QnXsdPattern = new XmlQualifiedName(nameTable.Add("pattern"), NsXs); QnXsdDocumentation = new XmlQualifiedName(nameTable.Add("documentation"), NsXs); QnXsdAppinfo = new XmlQualifiedName(nameTable.Add("appinfo"), NsXs); QnXsdComplexContent = new XmlQualifiedName(nameTable.Add("complexContent"), NsXs); QnXsdSimpleContent = new XmlQualifiedName(nameTable.Add("simpleContent"), NsXs); QnXsdRestriction = new XmlQualifiedName(nameTable.Add("restriction"), NsXs); QnXsdExtension = new XmlQualifiedName(nameTable.Add("extension"), NsXs); QnXsdUnion = new XmlQualifiedName(nameTable.Add("union"), NsXs); QnXsdList = new XmlQualifiedName(nameTable.Add("list"), NsXs); QnXsdWhiteSpace = new XmlQualifiedName(nameTable.Add("whiteSpace"), NsXs); QnXsdRedefine = new XmlQualifiedName(nameTable.Add("redefine"), NsXs); QnXsdAnyType = new XmlQualifiedName(nameTable.Add("anyType"), NsXs); //Create token to Qname table CreateTokenToQNameTable(); } public void CreateTokenToQNameTable() { TokenToQName[(int)Token.SchemaName] = QnName; TokenToQName[(int)Token.SchemaType] = QnType; TokenToQName[(int)Token.SchemaMaxOccurs] = QnMaxOccurs; TokenToQName[(int)Token.SchemaMinOccurs] = QnMinOccurs; TokenToQName[(int)Token.SchemaInfinite] = QnInfinite; TokenToQName[(int)Token.SchemaModel] = QnModel; TokenToQName[(int)Token.SchemaOpen] = QnOpen; TokenToQName[(int)Token.SchemaClosed] = QnClosed; TokenToQName[(int)Token.SchemaContent] = QnContent; TokenToQName[(int)Token.SchemaMixed] = QnMixed; TokenToQName[(int)Token.SchemaEmpty] = QnEmpty; TokenToQName[(int)Token.SchemaElementOnly] = QnEltOnly; TokenToQName[(int)Token.SchemaTextOnly] = QnTextOnly; TokenToQName[(int)Token.SchemaOrder] = QnOrder; TokenToQName[(int)Token.SchemaSeq] = QnSeq; TokenToQName[(int)Token.SchemaOne] = QnOne; TokenToQName[(int)Token.SchemaMany] = QnMany; TokenToQName[(int)Token.SchemaRequired] = QnRequired; TokenToQName[(int)Token.SchemaYes] = QnYes; TokenToQName[(int)Token.SchemaNo] = QnNo; TokenToQName[(int)Token.SchemaString] = QnString; TokenToQName[(int)Token.SchemaId] = QnID; TokenToQName[(int)Token.SchemaIdref] = QnIDRef; TokenToQName[(int)Token.SchemaIdrefs] = QnIDRefs; TokenToQName[(int)Token.SchemaEntity] = QnEntity; TokenToQName[(int)Token.SchemaEntities] = QnEntities; TokenToQName[(int)Token.SchemaNmtoken] = QnNmToken; TokenToQName[(int)Token.SchemaNmtokens] = QnNmTokens; TokenToQName[(int)Token.SchemaEnumeration] = QnEnumeration; TokenToQName[(int)Token.SchemaDefault] = QnDefault; TokenToQName[(int)Token.XdrRoot] = QnXdrSchema; TokenToQName[(int)Token.XdrElementType] = QnXdrElementType; TokenToQName[(int)Token.XdrElement] = QnXdrElement; TokenToQName[(int)Token.XdrGroup] = QnXdrGroup; TokenToQName[(int)Token.XdrAttributeType] = QnXdrAttributeType; TokenToQName[(int)Token.XdrAttribute] = QnXdrAttribute; TokenToQName[(int)Token.XdrDatatype] = QnXdrDataType; TokenToQName[(int)Token.XdrDescription] = QnXdrDescription; TokenToQName[(int)Token.XdrExtends] = QnXdrExtends; TokenToQName[(int)Token.SchemaXdrRootAlias] = QnXdrAliasSchema; TokenToQName[(int)Token.SchemaDtType] = QnDtType; TokenToQName[(int)Token.SchemaDtValues] = QnDtValues; TokenToQName[(int)Token.SchemaDtMaxLength] = QnDtMaxLength; TokenToQName[(int)Token.SchemaDtMinLength] = QnDtMinLength; TokenToQName[(int)Token.SchemaDtMax] = QnDtMax; TokenToQName[(int)Token.SchemaDtMin] = QnDtMin; TokenToQName[(int)Token.SchemaDtMinExclusive] = QnDtMinExclusive; TokenToQName[(int)Token.SchemaDtMaxExclusive] = QnDtMaxExclusive; TokenToQName[(int)Token.SchemaTargetNamespace] = QnTargetNamespace; TokenToQName[(int)Token.SchemaVersion] = QnVersion; TokenToQName[(int)Token.SchemaFinalDefault] = QnFinalDefault; TokenToQName[(int)Token.SchemaBlockDefault] = QnBlockDefault; TokenToQName[(int)Token.SchemaFixed] = QnFixed; TokenToQName[(int)Token.SchemaAbstract] = QnAbstract; TokenToQName[(int)Token.SchemaBlock] = QnBlock; TokenToQName[(int)Token.SchemaSubstitutionGroup] = QnSubstitutionGroup; TokenToQName[(int)Token.SchemaFinal] = QnFinal; TokenToQName[(int)Token.SchemaNillable] = QnNillable; TokenToQName[(int)Token.SchemaRef] = QnRef; TokenToQName[(int)Token.SchemaBase] = QnBase; TokenToQName[(int)Token.SchemaDerivedBy] = QnDerivedBy; TokenToQName[(int)Token.SchemaNamespace] = QnNamespace; TokenToQName[(int)Token.SchemaProcessContents] = QnProcessContents; TokenToQName[(int)Token.SchemaRefer] = QnRefer; TokenToQName[(int)Token.SchemaPublic] = QnPublic; TokenToQName[(int)Token.SchemaSystem] = QnSystem; TokenToQName[(int)Token.SchemaSchemaLocation] = QnSchemaLocation; TokenToQName[(int)Token.SchemaValue] = QnValue; TokenToQName[(int)Token.SchemaItemType] = QnItemType; TokenToQName[(int)Token.SchemaMemberTypes] = QnMemberTypes; TokenToQName[(int)Token.SchemaXPath] = QnXPath; TokenToQName[(int)Token.XsdSchema] = QnXsdSchema; TokenToQName[(int)Token.XsdAnnotation] = QnXsdAnnotation; TokenToQName[(int)Token.XsdInclude] = QnXsdInclude; TokenToQName[(int)Token.XsdImport] = QnXsdImport; TokenToQName[(int)Token.XsdElement] = QnXsdElement; TokenToQName[(int)Token.XsdAttribute] = QnXsdAttribute; TokenToQName[(int)Token.xsdAttributeGroup] = QnXsdAttributeGroup; TokenToQName[(int)Token.XsdAnyAttribute] = QnXsdAnyAttribute; TokenToQName[(int)Token.XsdGroup] = QnXsdGroup; TokenToQName[(int)Token.XsdAll] = QnXsdAll; TokenToQName[(int)Token.XsdChoice] = QnXsdChoice; TokenToQName[(int)Token.XsdSequence] = QnXsdSequence; TokenToQName[(int)Token.XsdAny] = QnXsdAny; TokenToQName[(int)Token.XsdNotation] = QnXsdNotation; TokenToQName[(int)Token.XsdSimpleType] = QnXsdSimpleType; TokenToQName[(int)Token.XsdComplexType] = QnXsdComplexType; TokenToQName[(int)Token.XsdUnique] = QnXsdUnique; TokenToQName[(int)Token.XsdKey] = QnXsdKey; TokenToQName[(int)Token.XsdKeyref] = QnXsdKeyRef; TokenToQName[(int)Token.XsdSelector] = QnXsdSelector; TokenToQName[(int)Token.XsdField] = QnXsdField; TokenToQName[(int)Token.XsdMinExclusive] = QnXsdMinExclusive; TokenToQName[(int)Token.XsdMinInclusive] = QnXsdMinInclusive; TokenToQName[(int)Token.XsdMaxExclusive] = QnXsdMaxExclusive; TokenToQName[(int)Token.XsdMaxInclusive] = QnXsdMaxInclusive; TokenToQName[(int)Token.XsdTotalDigits] = QnXsdTotalDigits; TokenToQName[(int)Token.XsdFractionDigits] = QnXsdFractionDigits; TokenToQName[(int)Token.XsdLength] = QnXsdLength; TokenToQName[(int)Token.XsdMinLength] = QnXsdMinLength; TokenToQName[(int)Token.XsdMaxLength] = QnXsdMaxLength; TokenToQName[(int)Token.XsdEnumeration] = QnXsdEnumeration; TokenToQName[(int)Token.XsdPattern] = QnXsdPattern; TokenToQName[(int)Token.XsdWhitespace] = QnXsdWhiteSpace; TokenToQName[(int)Token.XsdDocumentation] = QnXsdDocumentation; TokenToQName[(int)Token.XsdAppInfo] = QnXsdAppinfo; TokenToQName[(int)Token.XsdComplexContent] = QnXsdComplexContent; TokenToQName[(int)Token.XsdComplexContentRestriction] = QnXsdRestriction; TokenToQName[(int)Token.XsdSimpleContentRestriction] = QnXsdRestriction; TokenToQName[(int)Token.XsdSimpleTypeRestriction] = QnXsdRestriction; TokenToQName[(int)Token.XsdComplexContentExtension] = QnXsdExtension; TokenToQName[(int)Token.XsdSimpleContentExtension] = QnXsdExtension; TokenToQName[(int)Token.XsdSimpleContent] = QnXsdSimpleContent; TokenToQName[(int)Token.XsdSimpleTypeUnion] = QnXsdUnion; TokenToQName[(int)Token.XsdSimpleTypeList] = QnXsdList; TokenToQName[(int)Token.XsdRedefine] = QnXsdRedefine; TokenToQName[(int)Token.SchemaSource] = QnSource; TokenToQName[(int)Token.SchemaUse] = QnUse; TokenToQName[(int)Token.SchemaForm] = QnForm; TokenToQName[(int)Token.SchemaElementFormDefault] = QnElementFormDefault; TokenToQName[(int)Token.SchemaAttributeFormDefault] = QnAttributeFormDefault; TokenToQName[(int)Token.XmlLang] = QnXmlLang; TokenToQName[(int)Token.Empty] = XmlQualifiedName.Empty; } public SchemaType SchemaTypeFromRoot(string localName, string ns) { if (IsXSDRoot(localName, ns)) { return SchemaType.XSD; } else if (IsXDRRoot(localName, XmlSchemaDatatype.XdrCanonizeUri(ns, _nameTable, this))) { return SchemaType.XDR; } else { return SchemaType.None; } } public bool IsXSDRoot(string localName, string ns) { return Ref.Equal(ns, NsXs) && Ref.Equal(localName, XsdSchema); } public bool IsXDRRoot(string localName, string ns) { return Ref.Equal(ns, NsXdr) && Ref.Equal(localName, XdrSchema); } public XmlQualifiedName GetName(SchemaNames.Token token) { return TokenToQName[(int)token]; } public enum Token { Empty, SchemaName, SchemaType, SchemaMaxOccurs, SchemaMinOccurs, SchemaInfinite, SchemaModel, SchemaOpen, SchemaClosed, SchemaContent, SchemaMixed, SchemaEmpty, SchemaElementOnly, SchemaTextOnly, SchemaOrder, SchemaSeq, SchemaOne, SchemaMany, SchemaRequired, SchemaYes, SchemaNo, SchemaString, SchemaId, SchemaIdref, SchemaIdrefs, SchemaEntity, SchemaEntities, SchemaNmtoken, SchemaNmtokens, SchemaEnumeration, SchemaDefault, XdrRoot, XdrElementType, XdrElement, XdrGroup, XdrAttributeType, XdrAttribute, XdrDatatype, XdrDescription, XdrExtends, SchemaXdrRootAlias, SchemaDtType, SchemaDtValues, SchemaDtMaxLength, SchemaDtMinLength, SchemaDtMax, SchemaDtMin, SchemaDtMinExclusive, SchemaDtMaxExclusive, SchemaTargetNamespace, SchemaVersion, SchemaFinalDefault, SchemaBlockDefault, SchemaFixed, SchemaAbstract, SchemaBlock, SchemaSubstitutionGroup, SchemaFinal, SchemaNillable, SchemaRef, SchemaBase, SchemaDerivedBy, SchemaNamespace, SchemaProcessContents, SchemaRefer, SchemaPublic, SchemaSystem, SchemaSchemaLocation, SchemaValue, SchemaSource, SchemaAttributeFormDefault, SchemaElementFormDefault, SchemaUse, SchemaForm, XsdSchema, XsdAnnotation, XsdInclude, XsdImport, XsdElement, XsdAttribute, xsdAttributeGroup, XsdAnyAttribute, XsdGroup, XsdAll, XsdChoice, XsdSequence, XsdAny, XsdNotation, XsdSimpleType, XsdComplexType, XsdUnique, XsdKey, XsdKeyref, XsdSelector, XsdField, XsdMinExclusive, XsdMinInclusive, XsdMaxExclusive, XsdMaxInclusive, XsdTotalDigits, XsdFractionDigits, XsdLength, XsdMinLength, XsdMaxLength, XsdEnumeration, XsdPattern, XsdDocumentation, XsdAppInfo, XsdComplexContent, XsdComplexContentExtension, XsdComplexContentRestriction, XsdSimpleContent, XsdSimpleContentExtension, XsdSimpleContentRestriction, XsdSimpleTypeList, XsdSimpleTypeRestriction, XsdSimpleTypeUnion, XsdWhitespace, XsdRedefine, SchemaItemType, SchemaMemberTypes, SchemaXPath, XmlLang }; }; }
49.594108
98
0.652267
[ "MIT" ]
Aevitas/corefx
src/System.Private.Xml/src/System/Xml/Schema/SchemaNames.cs
30,302
C#
using Microsoft.Xna.Framework; using System; using System.Collections.Generic; using System.Text; namespace Ash.Impl.DefaultEC.Utils.Extensions { public static class CompatExt { public static bool RayIntersects(this RectangleF rect, ref Ray2D ray, out float distance) { distance = 0f; var maxValue = float.MaxValue; if (Math.Abs(ray.Direction.X) < 1E-06f) { if ((ray.Start.X < rect.X) || (ray.Start.X > rect.X + rect.Width)) return false; } else { var num11 = 1f / ray.Direction.X; var num8 = (rect.X - ray.Start.X) * num11; var num7 = (rect.X + rect.Width - ray.Start.X) * num11; if (num8 > num7) { var num14 = num8; num8 = num7; num7 = num14; } distance = MathHelper.Max(num8, distance); maxValue = MathHelper.Min(num7, maxValue); if (distance > maxValue) return false; } if (Math.Abs(ray.Direction.Y) < 1E-06f) { if ((ray.Start.Y < rect.Y) || (ray.Start.Y > rect.Y + rect.Height)) { return false; } } else { var num10 = 1f / ray.Direction.Y; var num6 = (rect.Y - ray.Start.Y) * num10; var num5 = (rect.Y + rect.Height - ray.Start.Y) * num10; if (num6 > num5) { var num13 = num6; num6 = num5; num5 = num13; } distance = MathHelper.Max(num6, distance); maxValue = MathHelper.Min(num5, maxValue); if (distance > maxValue) return false; } return true; } public static bool RayIntersects(ref Rectangle rect, ref Ray2D ray, out float distance) { distance = 0f; var maxValue = float.MaxValue; if (Math.Abs(ray.Direction.X) < 1E-06f) { if ((ray.Start.X < rect.X) || (ray.Start.X > rect.X + rect.Width)) return false; } else { var num11 = 1f / ray.Direction.X; var num8 = (rect.X - ray.Start.X) * num11; var num7 = (rect.X + rect.Width - ray.Start.X) * num11; if (num8 > num7) { var num14 = num8; num8 = num7; num7 = num14; } distance = MathHelper.Max(num8, distance); maxValue = MathHelper.Min(num7, maxValue); if (distance > maxValue) return false; } if (Math.Abs(ray.Direction.Y) < 1E-06f) { if ((ray.Start.Y < rect.Y) || (ray.Start.Y > rect.Y + rect.Height)) { return false; } } else { var num10 = 1f / ray.Direction.Y; var num6 = (rect.Y - ray.Start.Y) * num10; var num5 = (rect.Y + rect.Height - ray.Start.Y) * num10; if (num6 > num5) { var num13 = num6; num6 = num5; num5 = num13; } distance = MathHelper.Max(num6, distance); maxValue = MathHelper.Min(num5, maxValue); if (distance > maxValue) return false; } return true; } } }
22.319672
91
0.58061
[ "MIT" ]
JonSnowbd/Ash
Ash.DefaultEC/Utils/Extensions/CompatExt.cs
2,725
C#
#pragma checksum "..\..\..\Formularios\Grid.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "88ED70D5A880B095DF0858FECE5699D18CEEB1A39DEDA72C7FBEB08010A0DAD6" //------------------------------------------------------------------------------ // <auto-generated> // O código foi gerado por uma ferramenta. // Versão de Tempo de Execução:4.0.30319.42000 // // As alterações ao arquivo poderão causar comportamento incorreto e serão perdidas se // o código for gerado novamente. // </auto-generated> //------------------------------------------------------------------------------ using Projeto1.Formularios; using System; using System.Diagnostics; using System.Windows; using System.Windows.Automation; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Markup; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Media.Effects; using System.Windows.Media.Imaging; using System.Windows.Media.Media3D; using System.Windows.Media.TextFormatting; using System.Windows.Navigation; using System.Windows.Shapes; using System.Windows.Shell; namespace Projeto1.Formularios { /// <summary> /// Grid /// </summary> public partial class Grid : System.Windows.Window, System.Windows.Markup.IComponentConnector { #line 27 "..\..\..\Formularios\Grid.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal System.Windows.Controls.TextBox txtNome; #line default #line hidden #line 29 "..\..\..\Formularios\Grid.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal System.Windows.Controls.DatePicker dataNascimento; #line default #line hidden #line 31 "..\..\..\Formularios\Grid.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal System.Windows.Controls.TextBox txtCPF; #line default #line hidden #line 33 "..\..\..\Formularios\Grid.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal System.Windows.Controls.TextBox txtRG; #line default #line hidden #line 38 "..\..\..\Formularios\Grid.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal System.Windows.Controls.TextBox txtRua; #line default #line hidden #line 40 "..\..\..\Formularios\Grid.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal System.Windows.Controls.TextBox txtNumero; #line default #line hidden #line 42 "..\..\..\Formularios\Grid.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal System.Windows.Controls.TextBox txtBairro; #line default #line hidden #line 44 "..\..\..\Formularios\Grid.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal System.Windows.Controls.TextBox txtComplemento; #line default #line hidden #line 45 "..\..\..\Formularios\Grid.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal System.Windows.Controls.Button btCadastrar; #line default #line hidden #line 48 "..\..\..\Formularios\Grid.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal System.Windows.Controls.Button btFechar; #line default #line hidden private bool _contentLoaded; /// <summary> /// InitializeComponent /// </summary> [System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; System.Uri resourceLocater = new System.Uri("/Projeto1;component/formularios/grid.xaml", System.UriKind.Relative); #line 1 "..\..\..\Formularios\Grid.xaml" System.Windows.Application.LoadComponent(this, resourceLocater); #line default #line hidden } [System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.txtNome = ((System.Windows.Controls.TextBox)(target)); return; case 2: this.dataNascimento = ((System.Windows.Controls.DatePicker)(target)); return; case 3: this.txtCPF = ((System.Windows.Controls.TextBox)(target)); return; case 4: this.txtRG = ((System.Windows.Controls.TextBox)(target)); return; case 5: this.txtRua = ((System.Windows.Controls.TextBox)(target)); return; case 6: this.txtNumero = ((System.Windows.Controls.TextBox)(target)); return; case 7: this.txtBairro = ((System.Windows.Controls.TextBox)(target)); return; case 8: this.txtComplemento = ((System.Windows.Controls.TextBox)(target)); return; case 9: this.btCadastrar = ((System.Windows.Controls.Button)(target)); #line 45 "..\..\..\Formularios\Grid.xaml" this.btCadastrar.Click += new System.Windows.RoutedEventHandler(this.btCadastrar_Click); #line default #line hidden return; case 10: this.btFechar = ((System.Windows.Controls.Button)(target)); #line 48 "..\..\..\Formularios\Grid.xaml" this.btFechar.Click += new System.Windows.RoutedEventHandler(this.btFechar_Click); #line default #line hidden return; } this._contentLoaded = true; } } }
39.646766
159
0.604844
[ "MIT" ]
OlgaVeronica/Tela-Cadastro-E-Login-XAML
Projeto1/obj/Debug/Formularios/Grid.g.cs
7,980
C#
using System; using System.ComponentModel.DataAnnotations.Schema; namespace SimpleSocial.Data.Models { public class Comment { public string Id { get; set; } public string AuthorId { get; set; } public SimpleSocialUser Author { get; set; } public DateTime PostedOn { get; set; } = DateTime.UtcNow; public string CommentText { get; set; } [ForeignKey("Post")] public string PostId { get; set; } public Post Post { get; set; } } }
21.333333
65
0.615234
[ "MIT" ]
ctsmohanreddy072/socialnetwork-core
src/SimpleSocial/Data/SimpleSocial.Data.Models/Comment.cs
514
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Routing; namespace jcPL.UnitTests.MVC { public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); } } }
24.416667
99
0.588737
[ "MIT" ]
jcapellman/jcPL
jcPL.UnitTests.MVC/App_Start/RouteConfig.cs
588
C#
using System.Collections.Generic; using System.Linq; using NameSorter.Business.Interfaces; using NameSorter.Models.Implementations; using NameSorter.Models.Interfaces; using NameSorter.Services.Interfaces; namespace NameSorter.Business.Implementations { /// <summary> /// The App. /// </summary> class App : IApp { /// <summary> /// The text file service. /// </summary> private readonly ITextFileService _textFileService; /// <summary> /// The console service. /// </summary> private readonly IConsoleService _consoleService; /// <summary> /// Initializes a new instance of the <see cref="T:NameSorter.Business.Implementations.App"/> class. /// </summary> /// <param name="textFileService">Text file service.</param> /// <param name="consoleService">Console service.</param> public App(ITextFileService textFileService, IConsoleService consoleService) { _textFileService = textFileService; _consoleService = consoleService; } /// <summary> /// Reads the names from file. /// </summary> /// <returns>The names from file.</returns> /// <param name="filePath">File path.</param> public IEnumerable<IName> ReadNamesFromFile(string filePath) { var names = _textFileService.ReadLines(filePath) .Select(line => new Name(line)); return names; } /// <summary> /// Writes the names to file. /// </summary> /// <param name="filePath">File path.</param> /// <param name="names">Names.</param> public void WriteNamesToFile(string filePath, IEnumerable<IName> names) { var nameLines = names.Select(name => name.ToString()); _textFileService.WriteLines(filePath, nameLines); } /// <summary> /// Writes the names to console. /// </summary> /// <param name="names">Names.</param> public void WriteNamesToConsole(IEnumerable<IName> names) { names .ToList() .ForEach(name => _consoleService.WriteLine(name.ToString())); } /// <summary> /// Sorts the names by last name and then by given names. /// </summary> /// <returns>The names sorted by last name and then by given names.</returns> /// <param name="names">Names.</param> public IEnumerable<IName> SortNamesByLastNameAndThenByGivenNames(IEnumerable<IName> names) { return names.OrderBy(name => name.LastName) .ThenBy(name => name.GivenNames); } /// <summary> /// Run the App by reading lines from file, sort and then write to console ans file /// </summary> /// <param name="unsortedNamesFilePath">Unsorted names file path.</param> /// <param name="sortedNamesFilePath">Sorted names file path.</param> public void Run(string unsortedNamesFilePath, string sortedNamesFilePath) { var unsortedNames = ReadNamesFromFile(unsortedNamesFilePath); var sortedNames = SortNamesByLastNameAndThenByGivenNames(unsortedNames); WriteNamesToFile(sortedNamesFilePath, sortedNames); WriteNamesToConsole(sortedNames); } } }
36.231579
108
0.596746
[ "MIT" ]
VineethBolisetty/name-sorter
NameSorter/Business/Implementations/App.cs
3,444
C#
namespace Bash { public interface IPrinter { void Print(string value); } }
12.875
34
0.543689
[ "MIT" ]
kirill-ivanov-a/programming-practice
Second term/Bash/BashLib/IPrinter.cs
105
C#