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
// *** 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.Synapse.V20210401Preview { public static class GetIotHubDataConnection { /// <summary> /// Class representing an iot hub data connection. /// </summary> public static Task<GetIotHubDataConnectionResult> InvokeAsync(GetIotHubDataConnectionArgs args, InvokeOptions? options = null) => Pulumi.Deployment.Instance.InvokeAsync<GetIotHubDataConnectionResult>("azure-native:synapse/v20210401preview:getIotHubDataConnection", args ?? new GetIotHubDataConnectionArgs(), options.WithVersion()); } public sealed class GetIotHubDataConnectionArgs : Pulumi.InvokeArgs { /// <summary> /// The name of the data connection. /// </summary> [Input("dataConnectionName", required: true)] public string DataConnectionName { get; set; } = null!; /// <summary> /// The name of the database in the Kusto pool. /// </summary> [Input("databaseName", required: true)] public string DatabaseName { get; set; } = null!; /// <summary> /// The name of the Kusto pool. /// </summary> [Input("kustoPoolName", required: true)] public string KustoPoolName { get; set; } = null!; /// <summary> /// The name of the resource group. The name is case insensitive. /// </summary> [Input("resourceGroupName", required: true)] public string ResourceGroupName { get; set; } = null!; /// <summary> /// The name of the workspace /// </summary> [Input("workspaceName", required: true)] public string WorkspaceName { get; set; } = null!; public GetIotHubDataConnectionArgs() { } } [OutputType] public sealed class GetIotHubDataConnectionResult { /// <summary> /// The iot hub consumer group. /// </summary> public readonly string ConsumerGroup; /// <summary> /// The data format of the message. Optionally the data format can be added to each message. /// </summary> public readonly string? DataFormat; /// <summary> /// System properties of the iot hub /// </summary> public readonly ImmutableArray<string> EventSystemProperties; /// <summary> /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// </summary> public readonly string Id; /// <summary> /// The resource ID of the Iot hub to be used to create a data connection. /// </summary> public readonly string IotHubResourceId; /// <summary> /// Kind of the endpoint for the data connection /// Expected value is 'IotHub'. /// </summary> public readonly string Kind; /// <summary> /// Resource location. /// </summary> public readonly string? Location; /// <summary> /// The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. /// </summary> public readonly string? MappingRuleName; /// <summary> /// The name of the resource /// </summary> public readonly string Name; /// <summary> /// The provisioned state of the resource. /// </summary> public readonly string ProvisioningState; /// <summary> /// The name of the share access policy /// </summary> public readonly string SharedAccessPolicyName; /// <summary> /// Azure Resource Manager metadata containing createdBy and modifiedBy information. /// </summary> public readonly Outputs.SystemDataResponse SystemData; /// <summary> /// The table where the data should be ingested. Optionally the table information can be added to each message. /// </summary> public readonly string? TableName; /// <summary> /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// </summary> public readonly string Type; [OutputConstructor] private GetIotHubDataConnectionResult( string consumerGroup, string? dataFormat, ImmutableArray<string> eventSystemProperties, string id, string iotHubResourceId, string kind, string? location, string? mappingRuleName, string name, string provisioningState, string sharedAccessPolicyName, Outputs.SystemDataResponse systemData, string? tableName, string type) { ConsumerGroup = consumerGroup; DataFormat = dataFormat; EventSystemProperties = eventSystemProperties; Id = id; IotHubResourceId = iotHubResourceId; Kind = kind; Location = location; MappingRuleName = mappingRuleName; Name = name; ProvisioningState = provisioningState; SharedAccessPolicyName = sharedAccessPolicyName; SystemData = systemData; TableName = tableName; Type = type; } } }
34.333333
216
0.603849
[ "Apache-2.0" ]
polivbr/pulumi-azure-native
sdk/dotnet/Synapse/V20210401Preview/GetIotHubDataConnection.cs
5,768
C#
using FirstFloor.ModernUI.Windows.Controls; using FirstFloor.ModernUI.Presentation; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace PhoneBook.Pages { /// <summary> /// Interaction logic for SettingsPage.xaml /// </summary> public partial class ContactEditPage : UserControl { public ContactEditPage(ContactEditViewModel contactVM) { InitializeComponent(); this.DataContext = contactVM; } private void ComboBox_Selected(object sender, RoutedEventArgs e) { ((ContactEditViewModel)this.DataContext).HideAndShow(); } } public class ContactEditViewModel : NotifyPropertyChanged { private static IEnumerable<ContactType> contactTypes = Enum.GetValues(typeof(ContactType)).Cast<ContactType>(); public ContactEditViewModel(Contact contact) { Contact = contact; } public Contact Contact { get; set; } public ICollection<City> Cities { get; set; } public ICollection<Person> Persons { get; set; } public IEnumerable<ContactType> ContactTypes { get { return contactTypes; } } public bool IsCityPhone { get { return Contact.Type != ContactType.Mobile; } } public void HideAndShow() { OnPropertyChanged("IsCityPhone"); } } }
27.15942
120
0.63714
[ "Apache-2.0" ]
d8euAI8sMs/db-1-all
PhoneBook/Pages/ContactEdit.xaml.cs
1,876
C#
// MonoGame - Copyright (C) The MonoGame Team // This file is subject to the terms and conditions defined in // file 'LICENSE.txt', which is part of this source code package. using System.Collections.Generic; using System.Xml; namespace Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate { [ContentTypeSerializer] class Vector2Serializer : ElementSerializer<Vector2> { public Vector2Serializer() : base("Vector2", 2) { } protected internal override Vector2 Deserialize(string[] inputs, ref int index) { return new Vector2( XmlConvert.ToSingle(inputs[index++]), XmlConvert.ToSingle(inputs[index++])); } protected internal override void Serialize(Vector2 value, List<string> results) { results.Add(XmlConvert.ToString(value.X)); results.Add(XmlConvert.ToString(value.Y)); } } }
32.133333
87
0.643154
[ "MIT" ]
06needhamt/MonoGame
MonoGame.Framework.Content.Pipeline/Serialization/Intermediate/Vector2Serializer.cs
964
C#
using System; using System.Runtime.Serialization; using System.Xml.Serialization; using XamarinFormsStarterKit.UserInterfaceBuilder.Helpers; namespace XamarinFormsStarterKit.UserInterfaceBuilder.Preserver { public class Color { private const string WhiteColor = "#ffffff"; public Color(Xamarin.Forms.Color color) { R = color.R; G = color.G; B = color.B; Hue = color.Hue; Saturation = color.Saturation; Luminosity = color.Luminosity; Hex = color.ToHex(); } public Color() { } [XmlIgnore] public double R { get; set; } public string Hex { get; set; } = WhiteColor; [XmlIgnore] public double G { get; set; } [XmlIgnore] public double B { get; set; } [XmlIgnore] public double Hue { get; set; } [XmlIgnore] public double Saturation { get; set; } [XmlIgnore] public double Luminosity { get; set; } } }
12.546667
63
0.628055
[ "MIT" ]
arun6202/UserInterfaceBuilder
UserInterfaceBuilder/Preserver/Color.cs
943
C#
using Microsoft.Xaml.Behaviors; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; namespace Humbatt.UI.Toolkit.WPF.Behaviours { public class DataGridSelectedItemsBlendBehavior : Behavior<DataGrid> { public static readonly DependencyProperty SelectedItemsProperty = DependencyProperty.Register("SelectedItems", typeof(IEnumerable), typeof(DataGridSelectedItemsBlendBehavior),new FrameworkPropertyMetadata(null) { }); public IEnumerable SelectedItems { get { return (IEnumerable)GetValue(SelectedItemsProperty); } set { SetValue(SelectedItemsProperty, value); } } protected override void OnAttached() { base.OnAttached(); this.AssociatedObject.SelectionChanged += OnSelectionChanged; } protected override void OnDetaching() { base.OnDetaching(); if (this.AssociatedObject != null) this.AssociatedObject.SelectionChanged -= OnSelectionChanged; } private void OnSelectionChanged(object sender, SelectionChangedEventArgs e) { if (e.AddedItems != null && e.AddedItems.Count > 0 && this.SelectedItems != null) { if (this.SelectedItems is ICollection) { foreach (object obj in e.AddedItems) ((IList)this.SelectedItems).Add(obj); } } if (e.RemovedItems != null && e.RemovedItems.Count > 0 && this.SelectedItems != null) { if (this.SelectedItems is ICollection) { foreach (object obj in e.RemovedItems) ((IList)this.SelectedItems).Remove(obj); } } } } }
29.728571
218
0.567035
[ "MIT" ]
Humbatt/Humbatt.UI.Toolk
Humbatt.UI.Toolkit.WPF/Behaviours/DataGridSelectedItemsBlendBehavior.cs
2,083
C#
using System; using System.Collections.Generic; using System.Text; namespace FactoryMethod { public abstract class Passagem { public String Origem { get; set;} public String Destino { get; set; } public DateTime DataHoraPartida { get; set; } public Passagem(String origem, String destino, DateTime dataHoraPartida) { this.Origem = origem; this.Destino = destino; this.DataHoraPartida = dataHoraPartida; } public abstract void ExibirDetalhes(); } }
23.208333
80
0.628366
[ "MIT" ]
CledsonEC/design-pattern-gof
gof/FactoryMethod/Passagem.cs
559
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Newtonsoft.Json; namespace Maestro.Data.Models { public class Repository { // 450 is short enough to work well in SQL indexes, // and long enough to hold any repository or branch that we need to store. public const int RepositoryNameLength = 450; public const int BranchNameLength = 450; [MaxLength(RepositoryNameLength)] public string RepositoryName { get; set; } public long InstallationId { get; set; } public List<RepositoryBranch> Branches { get; set; } } public class RepositoryBranch { [MaxLength(Repository.RepositoryNameLength)] public string RepositoryName { get; set; } public Repository Repository { get; set; } [MaxLength(Repository.BranchNameLength)] public string BranchName { get; set; } [Column("Policy")] public string PolicyString { get; set; } [NotMapped] public Policy PolicyObject { get => PolicyString == null ? null : JsonConvert.DeserializeObject<Policy>(PolicyString); set => PolicyString = value == null ? null : JsonConvert.SerializeObject(value); } public class Policy { public List<MergePolicyDefinition> MergePolicies { get; set; } } } public class RepositoryBranchUpdate { [MaxLength(Repository.RepositoryNameLength)] public string RepositoryName { get; set; } [MaxLength(Repository.BranchNameLength)] public string BranchName { get; set; } public RepositoryBranch RepositoryBranch { get; set; } /// <summary> /// **true** if the update succeeded; **false** otherwise. /// </summary> public bool Success { get; set; } /// <summary> /// A message describing what the subscription was trying to do. /// e.g. 'Updating dependencies from dotnet/coreclr in dotnet/corefx' /// </summary> public string Action { get; set; } /// <summary> /// The error that occured, if any. /// </summary> public string ErrorMessage { get; set; } /// <summary> /// The method that was called. /// </summary> public string Method { get; set; } /// <summary> /// The parameters to the called method. /// </summary> public string Arguments { get; set; } } public class RepositoryBranchUpdateHistory { [MaxLength(Repository.RepositoryNameLength)] public string RepositoryName { get; set; } [MaxLength(Repository.BranchNameLength)] public string BranchName { get; set; } /// <summary> /// **true** if the update succeeded; **false** otherwise. /// </summary> public bool Success { get; set; } /// <summary> /// A message describing what the subscription was trying to do. /// e.g. 'Updating dependencies from dotnet/coreclr in dotnet/corefx' /// </summary> public string Action { get; set; } /// <summary> /// The error that occured, if any. /// </summary> public string ErrorMessage { get; set; } /// <summary> /// The method that was called. /// </summary> public string Method { get; set; } /// <summary> /// The parameters to the called method. /// </summary> public string Arguments { get; set; } } }
31.128
101
0.593935
[ "MIT" ]
dagood/arcade-services
src/Maestro/Maestro.Data/Models/Repository.cs
3,891
C#
using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System; using System.Linq; using System.Threading.Tasks; using WorkflowCore.Interface; namespace WorkflowCore.WebAPI.Controllers { [Route("[controller]")] public class EventsController : Controller { private readonly IWorkflowHost _workflowHost; private readonly ILogger _logger; public EventsController(IWorkflowHost workflowHost, ILoggerFactory loggerFactory) { _workflowHost = workflowHost; _logger = loggerFactory.CreateLogger<EventsController>(); } [HttpPost("{eventName}/{eventKey}")] public async Task<IActionResult> Post(string eventName, string eventKey, [FromBody]object eventData) { await _workflowHost.PublishEvent(eventName, eventKey, eventData); return Ok(); } } }
28.83871
108
0.687919
[ "MIT" ]
ChenxiaobaoPros/workflow-core
src/extensions/WorkflowCore.WebAPI/Controllers/EventsController.cs
896
C#
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from um/winnt.h in the Windows SDK for Windows 10.0.20348.0 // Original source is Copyright © Microsoft. All rights reserved. using NUnit.Framework; using System.Runtime.InteropServices; namespace TerraFX.Interop.Windows.UnitTests; /// <summary>Provides validation of the <see cref="TRANSACTION_ENLISTMENT_PAIR" /> struct.</summary> public static unsafe partial class TRANSACTION_ENLISTMENT_PAIRTests { /// <summary>Validates that the <see cref="TRANSACTION_ENLISTMENT_PAIR" /> struct is blittable.</summary> [Test] public static void IsBlittableTest() { Assert.That(Marshal.SizeOf<TRANSACTION_ENLISTMENT_PAIR>(), Is.EqualTo(sizeof(TRANSACTION_ENLISTMENT_PAIR))); } /// <summary>Validates that the <see cref="TRANSACTION_ENLISTMENT_PAIR" /> struct has the right <see cref="LayoutKind" />.</summary> [Test] public static void IsLayoutSequentialTest() { Assert.That(typeof(TRANSACTION_ENLISTMENT_PAIR).IsLayoutSequential, Is.True); } /// <summary>Validates that the <see cref="TRANSACTION_ENLISTMENT_PAIR" /> struct has the correct size.</summary> [Test] public static void SizeOfTest() { Assert.That(sizeof(TRANSACTION_ENLISTMENT_PAIR), Is.EqualTo(32)); } }
40.085714
145
0.736992
[ "MIT" ]
IngmarBitter/terrafx.interop.windows
tests/Interop/Windows/Windows/um/winnt/TRANSACTION_ENLISTMENT_PAIRTests.cs
1,405
C#
// Copyright (c) Petabridge <https://petabridge.com/>. All rights reserved. // Licensed under the Apache 2.0 license. See LICENSE file in the project root for full license information. // See ThirdPartyNotices.txt for references to third party code used inside Helios. using System.Collections.Generic; using System.Net; using System.Net.Sockets; using System.Text; using Helios.Buffers; using Helios.Net; using Helios.Reactor.Response; using Helios.Serialization; namespace Helios.Reactor { /// <summary> /// <see cref="IReactor"/> implementation which spawns <see cref="ReactorProxyResponseChannel"/> instances for responding directly with connected clients, /// but maintains a single event loop for responding to incoming requests, rather than allowing each <see cref="ReactorProxyResponseChannel"/> to maintain /// its own independent event loop. /// /// Great for scenarios where you want to be able to set a single event loop for a server and forget about it. /// </summary> public abstract class SingleReceiveLoopProxyReactor : ProxyReactorBase { protected SingleReceiveLoopProxyReactor(IPAddress localAddress, int localPort, NetworkEventLoop eventLoop, IMessageEncoder encoder, IMessageDecoder decoder, IByteBufAllocator allocator, SocketType socketType = SocketType.Stream, ProtocolType protocol = ProtocolType.Tcp, int bufferSize = NetworkConstants.DEFAULT_BUFFER_SIZE) : base(localAddress, localPort, eventLoop, encoder, decoder, allocator, socketType, protocol, bufferSize) { } protected override void ReceivedData(NetworkData availableData, ReactorResponseChannel responseChannel) { if (EventLoop.Receive != null) { EventLoop.Receive(availableData, responseChannel); } } } }
45.878049
158
0.722488
[ "Apache-2.0" ]
Aaronontheweb/helios
src/Helios/Reactor/SingleReceiveLoopProxyReactor.cs
1,883
C#
using System; using System.Drawing; using System.Windows.Forms; using Presenter.Views; namespace View.Components { public partial class PlayerControlControl : UserControl, IPlayerControlView { private enum Status { Stopped = 0, Playing = 1, Buffering = 2, Preparing = 3 }; private Status status; public event Action Play; public event Action Stop; public event Action VolumeUp; public event Action VolumeDown; public event Action OpenOptions; public event Action Maximize; public event Action Remove; public PlayerControlControl() { InitializeComponent(); status = Status.Preparing; controlPanelR.MouseMove += (sender, args) => this.OnMouseMove(args); this.Resize += (sender, args) => this.Resized(); btnVolMinus.Click += (sender, args) => Invoke(VolumeDown); btnVolPlus.Click += (sender, args) => Invoke(VolumeUp); btnClose.Click += (sender, args) => Invoke(Remove); btnMaxMin.Click += (sender, args) => Invoke(Maximize); btnOptions.Click += (sender, args) => Invoke(OpenOptions); } private void Invoke(Action action) { action?.Invoke(); } public void SourceReset() { this.Buffering(); status = Status.Preparing; btnPlayStop.BackgroundImage = btnPlayStop.Tag == null ? RtspCameraView.Properties.Resources.btn_eject : InvertImage(RtspCameraView.Properties.Resources.btn_eject); controlPanelR.Visible = false; btnVolMinus.Visible = btnVolPlus.Visible = false; } public void SourceSet() { btnPlayStop.BackgroundImage = btnPlayStop.Tag == null ? RtspCameraView.Properties.Resources.btn_play : InvertImage(RtspCameraView.Properties.Resources.btn_play); controlPanelR.Visible = true; } private void Resized() { int clientw = this.ClientSize.Width, clienth = this.ClientSize.Height, clientm = Math.Min(clientw, clienth); int bh = clientm * 4 / 5, bm = bh / 7, bh2 = clientm * 3 / 5, bm2 = bm*2; Size bS = new Size(bh, bh), bS2 = new Size(bh2, bh2); int bs = bh + bm, bs2 = bh2 + bm; btnPlayStop.Size = bS; btnVolMinus.Size = bS; btnVolPlus.Size = bS; btnOptions.Size = bS2; btnMaxMin.Size = bS2; btnClose.Size = bS2; btnPlayStop.Location = new Point(bs, bm); btnVolMinus.Location = new Point(bs * 4, bm); btnVolPlus.Location = new Point(bs * 5, bm); btnOptions.Location = new Point(bm2, bm2); btnMaxMin.Location = new Point(bm2 + bs2, bm2); btnClose.Location = new Point(bm2 + bs2 * 2, bm2); controlPanelR.Width = bm2 * 2 + bs2 * 3; Location = new Point(0, Parent.ClientRectangle.Height - clienth); } public void Buffering() { btnPlayStop.BackgroundImage = btnPlayStop.Tag == null ? RtspCameraView.Properties.Resources.btn_wait : InvertImage(RtspCameraView.Properties.Resources.btn_wait); status = Status.Buffering; } public void Stopped() { btnPlayStop.BackgroundImage = btnPlayStop.Tag == null ? RtspCameraView.Properties.Resources.btn_play : InvertImage(RtspCameraView.Properties.Resources.btn_play); status = Status.Stopped; } public void Playing() { btnPlayStop.BackgroundImage = btnPlayStop.Tag == null ? RtspCameraView.Properties.Resources.btn_stop : InvertImage(RtspCameraView.Properties.Resources.btn_stop); status = Status.Playing; } public void SoundFound() { btnVolMinus.Visible = btnVolPlus.Visible = true; } private Bitmap InvertImage(Image source) { Bitmap newBitmap = new Bitmap(source.Width, source.Height); Graphics g = Graphics.FromImage(newBitmap); System.Drawing.Imaging.ColorMatrix colorMatrix = new System.Drawing.Imaging.ColorMatrix( new float[][] { new float[] {-1, 0, 0, 0, 0}, new float[] {0, -1, 0, 0, 0}, new float[] {0, 0, -1, 0, 0}, new float[] {0, 0, 0, 1, 0}, new float[] {1, 1, 1, 0, 1} }); colorMatrix.Matrix00 = colorMatrix.Matrix11 = colorMatrix.Matrix22 = -1f; colorMatrix.Matrix33 = colorMatrix.Matrix44 = 1f; System.Drawing.Imaging.ImageAttributes attributes = new System.Drawing.Imaging.ImageAttributes(); attributes.SetColorMatrix(colorMatrix); g.DrawImage(source, new Rectangle(0, 0, source.Width, source.Height), 0, 0, source.Width, source.Height, GraphicsUnit.Pixel, attributes); g.Dispose(); return newBitmap; } private void btn_MouseEnterLeaveInvert(object sender, EventArgs e) { Panel s = (sender as Panel); s.BackgroundImage = InvertImage(s.BackgroundImage); s.Tag = s.Tag != null ? null : sender; } private void btn_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { Point l = (sender as Panel).Location; l.X += 1; l.Y += 1; (sender as Panel).Location = l; } } private void btn_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { Point l = (sender as Panel).Location; l.X -= 1; l.Y -= 1; (sender as Panel).Location = l; } } private void btnPlayStop_MouseClick(object sender, MouseEventArgs e) { if (status == Status.Playing) { Buffering(); Invoke(Stop); } else if (status == Status.Stopped) { Buffering(); Invoke(Play); } } public void Maximized() { btnMaxMin.BackgroundImage = btnMaxMin.Tag == null ? RtspCameraView.Properties.Resources.btn_minimize : InvertImage(RtspCameraView.Properties.Resources.btn_minimize); } public void Minimized() { btnMaxMin.BackgroundImage = btnMaxMin.Tag == null ? RtspCameraView.Properties.Resources.btn_maximize : InvertImage(RtspCameraView.Properties.Resources.btn_maximize); } } }
38.320442
109
0.55421
[ "Apache-2.0" ]
fragtion/rtsp-camera-view
View/Components/PlayerControlControl.cs
6,938
C#
using System; using System.IO; namespace Jess.DotNet.ReportViewerExtension.Winforms.Tests { public class TestForReport { public string Field { get; set; } public string L { get; set; } public string C { get; set; } public byte[] image { get; set; } public TestForReport(string field) { Field = field; L = "1"; FileStream fs = new FileStream("TestReportViewer.png", FileMode.Open); byte[] b = new Byte[fs.Length]; image = new Byte[fs.Length]; StreamReader sr = new StreamReader(fs); fs.Read(image, 0, (int)fs.Length); //b.CopyTo(image, 0); fs.Close(); } } }
25.448276
82
0.53523
[ "MIT" ]
ShiJess/FastRegluar
test/Jess.DotNet.ReportViewerExtension.Winforms.Tests/TestForReport.cs
740
C#
using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Threading.Tasks; namespace Caf.Projects.CafLogisticsSampleProcessing.Core { public interface IBlobLoader { Task<bool> LoadBlobAsync( MemoryStream blobStream, string blobContainerName, string blobPathAndFilename); } }
21.882353
56
0.704301
[ "CC0-1.0" ]
cafltar/CafLogisticsSampleProcessing_DotNet_AzureFunctions_MergeExcelDetWithMasterDet
MergeExcelDetWithMasterDet/Core/IBlobUploader.cs
374
C#
// Copyright (c) Josef Pihrt. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO; namespace Orang.FileSystem { public class FileSystemFinderOptions { public static FileSystemFinderOptions Default { get; } = new FileSystemFinderOptions(); public FileSystemFinderOptions( SearchTarget searchTarget = SearchTarget.Files, bool recurseSubdirectories = true, bool returnSpecialDirectories = false, bool ignoreInaccessible = true, FileAttributes attributes = default, FileAttributes attributesToSkip = default, MatchType matchType = MatchType.Simple, MatchCasing matchCasing = MatchCasing.PlatformDefault, bool? empty = null, bool canEnumerate = true, bool partOnly = false) { SearchTarget = searchTarget; RecurseSubdirectories = recurseSubdirectories; ReturnSpecialDirectories = returnSpecialDirectories; IgnoreInaccessible = ignoreInaccessible; Attributes = attributes; AttributesToSkip = attributesToSkip; MatchType = matchType; MatchCasing = matchCasing; Empty = empty; CanEnumerate = canEnumerate; PartOnly = partOnly; } public SearchTarget SearchTarget { get; } public bool RecurseSubdirectories { get; } public bool ReturnSpecialDirectories { get; } public bool IgnoreInaccessible { get; } public FileAttributes Attributes { get; } public FileAttributes AttributesToSkip { get; } public MatchType MatchType { get; } public MatchCasing MatchCasing { get; } public bool? Empty { get; } public bool CanEnumerate { get; } public bool PartOnly { get; } } }
32.633333
160
0.635853
[ "Apache-2.0" ]
atifaziz/Orang
src/CommandLine/FileSystem/FileSystemFinderOptions.cs
1,960
C#
using System; using System.Web.UI.WebControls; using System.Xml; using Umbraco.Core.IO; namespace umbraco.cms.presentation { public class Create : BasePages.UmbracoEnsuredPage { protected Label helpText; protected TextBox rename; protected Label Label1; protected ListBox nodeType; protected PlaceHolder UI; protected override void OnLoad(EventArgs e) { base.OnLoad(e); // Load create definitions var nodeType = Request.QueryString["nodeType"]; var createDef = new XmlDocument(); var defReader = new XmlTextReader(IOHelper.MapPath(SystemFiles.CreateUiXml)); createDef.Load(defReader); defReader.Close(); // Find definition for current nodeType var def = createDef.SelectSingleNode("//nodeType [@alias = '" + nodeType + "']"); if (def == null) { throw new ArgumentException("The create dialog for \"" + nodeType + "\" does not match anything defined in the \"" + SystemFiles.CreateUiXml + "\". This could mean an incorrectly installed package or a corrupt UI file"); } try { var virtualPath = SystemDirectories.Umbraco + def.SelectSingleNode("./usercontrol").FirstChild.Value; var mainControl = LoadControl(virtualPath); UI.Controls.Add(mainControl); } catch (Exception ex) { throw new ArgumentException("ERROR CREATING CONTROL FOR NODETYPE: " + nodeType, ex); } } } }
33.632653
236
0.589806
[ "MIT" ]
filipesousa20/Umbraco-CMS-V7
src/Umbraco.Web/umbraco.presentation/umbraco/create.aspx.cs
1,650
C#
using Content.Shared.Body.Events; using Content.Shared.Body.Part; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; namespace Content.Shared.Body.Components { [RegisterComponent] public class MechanismComponent : Component, ISerializationHooks { [Dependency] private readonly IEntityManager _entMan = default!; public override string Name => "Mechanism"; private SharedBodyPartComponent? _part; public SharedBodyComponent? Body => Part?.Body; public SharedBodyPartComponent? Part { get => _part; set { if (_part == value) { return; } var old = _part; _part = value; if (old != null) { if (old.Body == null) { _entMan.EventBus.RaiseLocalEvent(Owner, new RemovedFromPartEvent(old)); } else { _entMan.EventBus.RaiseLocalEvent(Owner, new RemovedFromPartInBodyEvent(old.Body, old)); } } if (value != null) { if (value.Body == null) { _entMan.EventBus.RaiseLocalEvent(Owner, new AddedToPartEvent(value)); } else { _entMan.EventBus.RaiseLocalEvent(Owner, new AddedToPartInBodyEvent(value.Body, value)); } } } } [DataField("maxDurability")] public int MaxDurability { get; set; } = 10; [DataField("currentDurability")] public int CurrentDurability { get; set; } = 10; [DataField("destroyThreshold")] public int DestroyThreshold { get; set; } = -10; // TODO BODY: Surgery description and adding a message to the examine tooltip of the entity that owns this mechanism // TODO BODY [DataField("resistance")] public int Resistance { get; set; } = 0; // TODO BODY OnSizeChanged /// <summary> /// Determines whether this /// <see cref="MechanismComponent"/> can fit into a <see cref="SharedBodyPartComponent"/>. /// </summary> [DataField("size")] public int Size { get; set; } = 1; /// <summary> /// What kind of <see cref="SharedBodyPartComponent"/> this /// <see cref="MechanismComponent"/> can be easily installed into. /// </summary> [DataField("compatibility")] public BodyPartCompatibility Compatibility { get; set; } = BodyPartCompatibility.Universal; } }
33.8
124
0.532892
[ "MIT" ]
Antares-30XX/Antares
Content.Shared/Body/Components/MechanismComponent.cs
2,875
C#
using System.Threading; using System.Threading.Tasks; namespace BookStore.Core.Processors { public interface IProcessor { Task StartAsync(CancellationToken cancellationToken); } }
20.1
61
0.746269
[ "MIT" ]
fvilers/AspNetCqrsSample
BookStore/BookStore.Core/Processors/IProcessor.cs
203
C#
using log4net; using log4net.Config; using log4net.Repository; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; namespace WebSocket { public class LogHelper { public static ILoggerRepository Repository { get; private set; } static LogHelper() { Repository = LogManager.CreateRepository("websocket-testing"); XmlConfigurator.Configure(Repository, new FileInfo("log4net.cfg.xml")); } public static ILog GetLog(Type type) { return LogManager.GetLogger(Repository.Name, type); } } }
23.285714
83
0.66411
[ "MIT" ]
Tsual/CorefxSample
WebSocket/LogHelper.cs
654
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. /*============================================================ ** ** Interface: IDisposable ** ** ** Purpose: Interface for assisting with deterministic finalization. ** ** ===========================================================*/ namespace System { // IDisposable is an attempt at helping to solve problems with deterministic // finalization. The GC of course doesn't leave any way to deterministically // know when a finalizer will run. This forces classes that hold onto OS // resources or some sort of important state (such as a FileStream or a // network connection) to provide a Close or Dispose method so users can // run clean up code deterministically. We have formalized this into an // interface with one method. Classes may privately implement IDisposable and // provide a Close method instead, if that name is by far the expected name // for objects in that domain (ie, you don't Dispose of a FileStream, you Close // it). // // This interface could be theoretically used as a marker by a compiler to // ensure a disposable object has been cleaned up along all code paths if it's // been allocated in that method, though in practice any compiler that // draconian may tick off any number of people. Perhaps an external tool (like // like Purify or BoundsChecker) could do this. Instead, C# has added a using // clause, which will generate a try/finally statement where the resource // passed into the using clause will always have it's Dispose method called. // Syntax is using(FileStream fs = ...) { .. }; // // Dispose should meet the following conditions: // 1) Be safely callable multiple times // 2) Release any resources associated with the instance // 3) Call the base class's Dispose method, if necessary // 4) Suppress finalization of this class to help the GC by reducing the // number of objects on the finalization queue. // 5) Dispose shouldn't generally throw exceptions, except for very serious // errors that are particularly unexpected. (ie, OutOfMemoryException) // Ideally, nothing should go wrong with your object by calling Dispose. // // If possible, a class should define a finalizer that calls Dispose. // However, in many situations, this is impractical. For instance, take the // classic example of a Stream and a StreamWriter (which has an internal // buffer of data to write to the Stream). If both objects are collected // before Close or Dispose has been called on either, then the GC may run the // finalizer for the Stream first, before the StreamWriter. At that point, any // data buffered by the StreamWriter cannot be written to the Stream. In this // case, it doesn't make much sense to provide a finalizer on the StreamWriter // since you cannot solve this problem correctly. public interface IDisposable { void Dispose(); } }
52.163934
83
0.686361
[ "MIT" ]
06needhamt/runtime
src/libraries/System.Private.CoreLib/src/System/IDisposable.cs
3,182
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNextGen.HybridNetwork.Inputs { /// <summary> /// Network interface IP configuration properties. /// </summary> public sealed class NetworkInterfaceIPConfigurationArgs : Pulumi.ResourceArgs { [Input("dnsServers")] private InputList<string>? _dnsServers; /// <summary> /// The list of DNS servers IP addresses. /// </summary> public InputList<string> DnsServers { get => _dnsServers ?? (_dnsServers = new InputList<string>()); set => _dnsServers = value; } /// <summary> /// The value of the gateway. /// </summary> [Input("gateway")] public Input<string>? Gateway { get; set; } /// <summary> /// The value of the IP address. /// </summary> [Input("ipAddress")] public Input<string>? IpAddress { get; set; } /// <summary> /// IP address allocation method. /// </summary> [Input("ipAllocationMethod")] public InputUnion<string, Pulumi.AzureNextGen.HybridNetwork.IPAllocationMethod>? IpAllocationMethod { get; set; } /// <summary> /// IP address version. /// </summary> [Input("ipVersion")] public InputUnion<string, Pulumi.AzureNextGen.HybridNetwork.IPVersion>? IpVersion { get; set; } /// <summary> /// The value of the subnet. /// </summary> [Input("subnet")] public Input<string>? Subnet { get; set; } public NetworkInterfaceIPConfigurationArgs() { } } }
29.538462
121
0.589063
[ "Apache-2.0" ]
pulumi/pulumi-azure-nextgen
sdk/dotnet/HybridNetwork/Inputs/NetworkInterfaceIPConfigurationArgs.cs
1,920
C#
using HarmonyLib; using Kingmaker.Blueprints; using Kingmaker.Blueprints.Classes.Spells; using Kingmaker.Blueprints.JsonSystem; using Kingmaker.UnitLogic; namespace TabletopTweaks.NewComponents { [AllowedOn(typeof(BlueprintSpellbook), false)] [TypeId("076df57c9d7d415c81a3b968437d98ec")] public class CustomSpecialSlotAmount : BlueprintComponent { public int Amount = 1; } [HarmonyPatch(typeof(Spellbook), nameof(Spellbook.CalcSlotsLimit))] static class Spellbook_CalcSlotsLimit_CustomSpecialSlotAmount_Patch { static void Postfix(Spellbook __instance, SpellSlotType slotType, ref int __result) { if (slotType != SpellSlotType.Domain && slotType != SpellSlotType.Favorite) { return; } var customComponent = __instance.Blueprint.GetComponent<CustomSpecialSlotAmount>(); if (customComponent != null) { __result = customComponent.Amount; } } } }
38.48
99
0.718295
[ "MIT" ]
1onepower/WrathMods-TabletopTweaks
TabletopTweaks/NewComponents/CustomSpecialSlotAmount.cs
964
C#
using System.ComponentModel.DataAnnotations; namespace SimpleChat.Models { /// <summary> /// New chat message /// </summary> public sealed class ChatNewMessageModel { /// <summary> /// Chat message text /// </summary> [Required] public string Message { get; set; } } }
17.875
45
0.667832
[ "Apache-2.0" ]
hnjm/SimpleChat
SimpleChat/Models/ChatNewMessageModel.cs
288
C#
/* * Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the kinesisanalytics-2015-08-14.normal.json service model. */ using System; using System.Runtime.ExceptionServices; using System.Threading; using System.Threading.Tasks; using System.Collections.Generic; using System.Net; using Amazon.KinesisAnalytics.Model; using Amazon.KinesisAnalytics.Model.Internal.MarshallTransformations; using Amazon.KinesisAnalytics.Internal; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.KinesisAnalytics { /// <summary> /// Implementation for accessing KinesisAnalytics /// /// /// </summary> public partial class AmazonKinesisAnalyticsClient : AmazonServiceClient, IAmazonKinesisAnalytics { private static IServiceMetadata serviceMetadata = new AmazonKinesisAnalyticsMetadata(); #region Constructors #if NETSTANDARD /// <summary> /// Constructs AmazonKinesisAnalyticsClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// <code> /// &lt;?xml version="1.0" encoding="utf-8" ?&gt; /// &lt;configuration&gt; /// &lt;appSettings&gt; /// &lt;add key="AWSProfileName" value="AWS Default"/&gt; /// &lt;/appSettings&gt; /// &lt;/configuration&gt; /// </code> /// /// </summary> public AmazonKinesisAnalyticsClient() : base(FallbackCredentialsFactory.GetCredentials(), new AmazonKinesisAnalyticsConfig()) { } /// <summary> /// Constructs AmazonKinesisAnalyticsClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// <code> /// &lt;?xml version="1.0" encoding="utf-8" ?&gt; /// &lt;configuration&gt; /// &lt;appSettings&gt; /// &lt;add key="AWSProfileName" value="AWS Default"/&gt; /// &lt;/appSettings&gt; /// &lt;/configuration&gt; /// </code> /// /// </summary> /// <param name="region">The region to connect.</param> public AmazonKinesisAnalyticsClient(RegionEndpoint region) : base(FallbackCredentialsFactory.GetCredentials(), new AmazonKinesisAnalyticsConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonKinesisAnalyticsClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// <code> /// &lt;?xml version="1.0" encoding="utf-8" ?&gt; /// &lt;configuration&gt; /// &lt;appSettings&gt; /// &lt;add key="AWSProfileName" value="AWS Default"/&gt; /// &lt;/appSettings&gt; /// &lt;/configuration&gt; /// </code> /// /// </summary> /// <param name="config">The AmazonKinesisAnalyticsClient Configuration Object</param> public AmazonKinesisAnalyticsClient(AmazonKinesisAnalyticsConfig config) : base(FallbackCredentialsFactory.GetCredentials(), config) { } #endif /// <summary> /// Constructs AmazonKinesisAnalyticsClient with AWS Credentials /// </summary> /// <param name="credentials">AWS Credentials</param> public AmazonKinesisAnalyticsClient(AWSCredentials credentials) : this(credentials, new AmazonKinesisAnalyticsConfig()) { } /// <summary> /// Constructs AmazonKinesisAnalyticsClient with AWS Credentials /// </summary> /// <param name="credentials">AWS Credentials</param> /// <param name="region">The region to connect.</param> public AmazonKinesisAnalyticsClient(AWSCredentials credentials, RegionEndpoint region) : this(credentials, new AmazonKinesisAnalyticsConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonKinesisAnalyticsClient with AWS Credentials and an /// AmazonKinesisAnalyticsClient Configuration object. /// </summary> /// <param name="credentials">AWS Credentials</param> /// <param name="clientConfig">The AmazonKinesisAnalyticsClient Configuration Object</param> public AmazonKinesisAnalyticsClient(AWSCredentials credentials, AmazonKinesisAnalyticsConfig clientConfig) : base(credentials, clientConfig) { } /// <summary> /// Constructs AmazonKinesisAnalyticsClient with AWS Access Key ID and AWS Secret Key /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> public AmazonKinesisAnalyticsClient(string awsAccessKeyId, string awsSecretAccessKey) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonKinesisAnalyticsConfig()) { } /// <summary> /// Constructs AmazonKinesisAnalyticsClient with AWS Access Key ID and AWS Secret Key /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="region">The region to connect.</param> public AmazonKinesisAnalyticsClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonKinesisAnalyticsConfig() {RegionEndpoint=region}) { } /// <summary> /// Constructs AmazonKinesisAnalyticsClient with AWS Access Key ID, AWS Secret Key and an /// AmazonKinesisAnalyticsClient Configuration object. /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="clientConfig">The AmazonKinesisAnalyticsClient Configuration Object</param> public AmazonKinesisAnalyticsClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonKinesisAnalyticsConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, clientConfig) { } /// <summary> /// Constructs AmazonKinesisAnalyticsClient with AWS Access Key ID and AWS Secret Key /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="awsSessionToken">AWS Session Token</param> public AmazonKinesisAnalyticsClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonKinesisAnalyticsConfig()) { } /// <summary> /// Constructs AmazonKinesisAnalyticsClient with AWS Access Key ID and AWS Secret Key /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="awsSessionToken">AWS Session Token</param> /// <param name="region">The region to connect.</param> public AmazonKinesisAnalyticsClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonKinesisAnalyticsConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonKinesisAnalyticsClient with AWS Access Key ID, AWS Secret Key and an /// AmazonKinesisAnalyticsClient Configuration object. /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="awsSessionToken">AWS Session Token</param> /// <param name="clientConfig">The AmazonKinesisAnalyticsClient Configuration Object</param> public AmazonKinesisAnalyticsClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonKinesisAnalyticsConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig) { } #endregion #region Overrides /// <summary> /// Creates the signer for the service. /// </summary> protected override AbstractAWSSigner CreateSigner() { return new AWS4Signer(); } /// <summary> /// Capture metadata for the service. /// </summary> protected override IServiceMetadata ServiceMetadata { get { return serviceMetadata; } } #endregion #region Dispose /// <summary> /// Disposes the service client. /// </summary> protected override void Dispose(bool disposing) { base.Dispose(disposing); } #endregion #region AddApplicationCloudWatchLoggingOption internal virtual AddApplicationCloudWatchLoggingOptionResponse AddApplicationCloudWatchLoggingOption(AddApplicationCloudWatchLoggingOptionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AddApplicationCloudWatchLoggingOptionRequestMarshaller.Instance; options.ResponseUnmarshaller = AddApplicationCloudWatchLoggingOptionResponseUnmarshaller.Instance; return Invoke<AddApplicationCloudWatchLoggingOptionResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the AddApplicationCloudWatchLoggingOption operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AddApplicationCloudWatchLoggingOption operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/AddApplicationCloudWatchLoggingOption">REST API Reference for AddApplicationCloudWatchLoggingOption Operation</seealso> public virtual Task<AddApplicationCloudWatchLoggingOptionResponse> AddApplicationCloudWatchLoggingOptionAsync(AddApplicationCloudWatchLoggingOptionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AddApplicationCloudWatchLoggingOptionRequestMarshaller.Instance; options.ResponseUnmarshaller = AddApplicationCloudWatchLoggingOptionResponseUnmarshaller.Instance; return InvokeAsync<AddApplicationCloudWatchLoggingOptionResponse>(request, options, cancellationToken); } #endregion #region AddApplicationInput internal virtual AddApplicationInputResponse AddApplicationInput(AddApplicationInputRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AddApplicationInputRequestMarshaller.Instance; options.ResponseUnmarshaller = AddApplicationInputResponseUnmarshaller.Instance; return Invoke<AddApplicationInputResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the AddApplicationInput operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AddApplicationInput operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/AddApplicationInput">REST API Reference for AddApplicationInput Operation</seealso> public virtual Task<AddApplicationInputResponse> AddApplicationInputAsync(AddApplicationInputRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AddApplicationInputRequestMarshaller.Instance; options.ResponseUnmarshaller = AddApplicationInputResponseUnmarshaller.Instance; return InvokeAsync<AddApplicationInputResponse>(request, options, cancellationToken); } #endregion #region AddApplicationInputProcessingConfiguration internal virtual AddApplicationInputProcessingConfigurationResponse AddApplicationInputProcessingConfiguration(AddApplicationInputProcessingConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AddApplicationInputProcessingConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = AddApplicationInputProcessingConfigurationResponseUnmarshaller.Instance; return Invoke<AddApplicationInputProcessingConfigurationResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the AddApplicationInputProcessingConfiguration operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AddApplicationInputProcessingConfiguration operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/AddApplicationInputProcessingConfiguration">REST API Reference for AddApplicationInputProcessingConfiguration Operation</seealso> public virtual Task<AddApplicationInputProcessingConfigurationResponse> AddApplicationInputProcessingConfigurationAsync(AddApplicationInputProcessingConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AddApplicationInputProcessingConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = AddApplicationInputProcessingConfigurationResponseUnmarshaller.Instance; return InvokeAsync<AddApplicationInputProcessingConfigurationResponse>(request, options, cancellationToken); } #endregion #region AddApplicationOutput internal virtual AddApplicationOutputResponse AddApplicationOutput(AddApplicationOutputRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AddApplicationOutputRequestMarshaller.Instance; options.ResponseUnmarshaller = AddApplicationOutputResponseUnmarshaller.Instance; return Invoke<AddApplicationOutputResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the AddApplicationOutput operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AddApplicationOutput operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/AddApplicationOutput">REST API Reference for AddApplicationOutput Operation</seealso> public virtual Task<AddApplicationOutputResponse> AddApplicationOutputAsync(AddApplicationOutputRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AddApplicationOutputRequestMarshaller.Instance; options.ResponseUnmarshaller = AddApplicationOutputResponseUnmarshaller.Instance; return InvokeAsync<AddApplicationOutputResponse>(request, options, cancellationToken); } #endregion #region AddApplicationReferenceDataSource internal virtual AddApplicationReferenceDataSourceResponse AddApplicationReferenceDataSource(AddApplicationReferenceDataSourceRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AddApplicationReferenceDataSourceRequestMarshaller.Instance; options.ResponseUnmarshaller = AddApplicationReferenceDataSourceResponseUnmarshaller.Instance; return Invoke<AddApplicationReferenceDataSourceResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the AddApplicationReferenceDataSource operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AddApplicationReferenceDataSource operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/AddApplicationReferenceDataSource">REST API Reference for AddApplicationReferenceDataSource Operation</seealso> public virtual Task<AddApplicationReferenceDataSourceResponse> AddApplicationReferenceDataSourceAsync(AddApplicationReferenceDataSourceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AddApplicationReferenceDataSourceRequestMarshaller.Instance; options.ResponseUnmarshaller = AddApplicationReferenceDataSourceResponseUnmarshaller.Instance; return InvokeAsync<AddApplicationReferenceDataSourceResponse>(request, options, cancellationToken); } #endregion #region CreateApplication internal virtual CreateApplicationResponse CreateApplication(CreateApplicationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateApplicationRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateApplicationResponseUnmarshaller.Instance; return Invoke<CreateApplicationResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the CreateApplication operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateApplication operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/CreateApplication">REST API Reference for CreateApplication Operation</seealso> public virtual Task<CreateApplicationResponse> CreateApplicationAsync(CreateApplicationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateApplicationRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateApplicationResponseUnmarshaller.Instance; return InvokeAsync<CreateApplicationResponse>(request, options, cancellationToken); } #endregion #region DeleteApplication internal virtual DeleteApplicationResponse DeleteApplication(DeleteApplicationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteApplicationRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteApplicationResponseUnmarshaller.Instance; return Invoke<DeleteApplicationResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DeleteApplication operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteApplication operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/DeleteApplication">REST API Reference for DeleteApplication Operation</seealso> public virtual Task<DeleteApplicationResponse> DeleteApplicationAsync(DeleteApplicationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteApplicationRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteApplicationResponseUnmarshaller.Instance; return InvokeAsync<DeleteApplicationResponse>(request, options, cancellationToken); } #endregion #region DeleteApplicationCloudWatchLoggingOption internal virtual DeleteApplicationCloudWatchLoggingOptionResponse DeleteApplicationCloudWatchLoggingOption(DeleteApplicationCloudWatchLoggingOptionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteApplicationCloudWatchLoggingOptionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteApplicationCloudWatchLoggingOptionResponseUnmarshaller.Instance; return Invoke<DeleteApplicationCloudWatchLoggingOptionResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DeleteApplicationCloudWatchLoggingOption operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteApplicationCloudWatchLoggingOption operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/DeleteApplicationCloudWatchLoggingOption">REST API Reference for DeleteApplicationCloudWatchLoggingOption Operation</seealso> public virtual Task<DeleteApplicationCloudWatchLoggingOptionResponse> DeleteApplicationCloudWatchLoggingOptionAsync(DeleteApplicationCloudWatchLoggingOptionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteApplicationCloudWatchLoggingOptionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteApplicationCloudWatchLoggingOptionResponseUnmarshaller.Instance; return InvokeAsync<DeleteApplicationCloudWatchLoggingOptionResponse>(request, options, cancellationToken); } #endregion #region DeleteApplicationInputProcessingConfiguration internal virtual DeleteApplicationInputProcessingConfigurationResponse DeleteApplicationInputProcessingConfiguration(DeleteApplicationInputProcessingConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteApplicationInputProcessingConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteApplicationInputProcessingConfigurationResponseUnmarshaller.Instance; return Invoke<DeleteApplicationInputProcessingConfigurationResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DeleteApplicationInputProcessingConfiguration operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteApplicationInputProcessingConfiguration operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/DeleteApplicationInputProcessingConfiguration">REST API Reference for DeleteApplicationInputProcessingConfiguration Operation</seealso> public virtual Task<DeleteApplicationInputProcessingConfigurationResponse> DeleteApplicationInputProcessingConfigurationAsync(DeleteApplicationInputProcessingConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteApplicationInputProcessingConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteApplicationInputProcessingConfigurationResponseUnmarshaller.Instance; return InvokeAsync<DeleteApplicationInputProcessingConfigurationResponse>(request, options, cancellationToken); } #endregion #region DeleteApplicationOutput internal virtual DeleteApplicationOutputResponse DeleteApplicationOutput(DeleteApplicationOutputRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteApplicationOutputRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteApplicationOutputResponseUnmarshaller.Instance; return Invoke<DeleteApplicationOutputResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DeleteApplicationOutput operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteApplicationOutput operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/DeleteApplicationOutput">REST API Reference for DeleteApplicationOutput Operation</seealso> public virtual Task<DeleteApplicationOutputResponse> DeleteApplicationOutputAsync(DeleteApplicationOutputRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteApplicationOutputRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteApplicationOutputResponseUnmarshaller.Instance; return InvokeAsync<DeleteApplicationOutputResponse>(request, options, cancellationToken); } #endregion #region DeleteApplicationReferenceDataSource internal virtual DeleteApplicationReferenceDataSourceResponse DeleteApplicationReferenceDataSource(DeleteApplicationReferenceDataSourceRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteApplicationReferenceDataSourceRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteApplicationReferenceDataSourceResponseUnmarshaller.Instance; return Invoke<DeleteApplicationReferenceDataSourceResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DeleteApplicationReferenceDataSource operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteApplicationReferenceDataSource operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/DeleteApplicationReferenceDataSource">REST API Reference for DeleteApplicationReferenceDataSource Operation</seealso> public virtual Task<DeleteApplicationReferenceDataSourceResponse> DeleteApplicationReferenceDataSourceAsync(DeleteApplicationReferenceDataSourceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteApplicationReferenceDataSourceRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteApplicationReferenceDataSourceResponseUnmarshaller.Instance; return InvokeAsync<DeleteApplicationReferenceDataSourceResponse>(request, options, cancellationToken); } #endregion #region DescribeApplication internal virtual DescribeApplicationResponse DescribeApplication(DescribeApplicationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeApplicationRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeApplicationResponseUnmarshaller.Instance; return Invoke<DescribeApplicationResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DescribeApplication operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeApplication operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/DescribeApplication">REST API Reference for DescribeApplication Operation</seealso> public virtual Task<DescribeApplicationResponse> DescribeApplicationAsync(DescribeApplicationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeApplicationRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeApplicationResponseUnmarshaller.Instance; return InvokeAsync<DescribeApplicationResponse>(request, options, cancellationToken); } #endregion #region DiscoverInputSchema internal virtual DiscoverInputSchemaResponse DiscoverInputSchema(DiscoverInputSchemaRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DiscoverInputSchemaRequestMarshaller.Instance; options.ResponseUnmarshaller = DiscoverInputSchemaResponseUnmarshaller.Instance; return Invoke<DiscoverInputSchemaResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DiscoverInputSchema operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DiscoverInputSchema operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/DiscoverInputSchema">REST API Reference for DiscoverInputSchema Operation</seealso> public virtual Task<DiscoverInputSchemaResponse> DiscoverInputSchemaAsync(DiscoverInputSchemaRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DiscoverInputSchemaRequestMarshaller.Instance; options.ResponseUnmarshaller = DiscoverInputSchemaResponseUnmarshaller.Instance; return InvokeAsync<DiscoverInputSchemaResponse>(request, options, cancellationToken); } #endregion #region ListApplications internal virtual ListApplicationsResponse ListApplications(ListApplicationsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListApplicationsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListApplicationsResponseUnmarshaller.Instance; return Invoke<ListApplicationsResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the ListApplications operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListApplications operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/ListApplications">REST API Reference for ListApplications Operation</seealso> public virtual Task<ListApplicationsResponse> ListApplicationsAsync(ListApplicationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListApplicationsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListApplicationsResponseUnmarshaller.Instance; return InvokeAsync<ListApplicationsResponse>(request, options, cancellationToken); } #endregion #region StartApplication internal virtual StartApplicationResponse StartApplication(StartApplicationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = StartApplicationRequestMarshaller.Instance; options.ResponseUnmarshaller = StartApplicationResponseUnmarshaller.Instance; return Invoke<StartApplicationResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the StartApplication operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the StartApplication operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/StartApplication">REST API Reference for StartApplication Operation</seealso> public virtual Task<StartApplicationResponse> StartApplicationAsync(StartApplicationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = StartApplicationRequestMarshaller.Instance; options.ResponseUnmarshaller = StartApplicationResponseUnmarshaller.Instance; return InvokeAsync<StartApplicationResponse>(request, options, cancellationToken); } #endregion #region StopApplication internal virtual StopApplicationResponse StopApplication(StopApplicationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = StopApplicationRequestMarshaller.Instance; options.ResponseUnmarshaller = StopApplicationResponseUnmarshaller.Instance; return Invoke<StopApplicationResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the StopApplication operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the StopApplication operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/StopApplication">REST API Reference for StopApplication Operation</seealso> public virtual Task<StopApplicationResponse> StopApplicationAsync(StopApplicationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = StopApplicationRequestMarshaller.Instance; options.ResponseUnmarshaller = StopApplicationResponseUnmarshaller.Instance; return InvokeAsync<StopApplicationResponse>(request, options, cancellationToken); } #endregion #region UpdateApplication internal virtual UpdateApplicationResponse UpdateApplication(UpdateApplicationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateApplicationRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateApplicationResponseUnmarshaller.Instance; return Invoke<UpdateApplicationResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the UpdateApplication operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateApplication operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/UpdateApplication">REST API Reference for UpdateApplication Operation</seealso> public virtual Task<UpdateApplicationResponse> UpdateApplicationAsync(UpdateApplicationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateApplicationRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateApplicationResponseUnmarshaller.Instance; return InvokeAsync<UpdateApplicationResponse>(request, options, cancellationToken); } #endregion } }
52.019802
278
0.708151
[ "Apache-2.0" ]
FoxBearBear/aws-sdk-net
sdk/src/Services/KinesisAnalytics/Generated/_mobile/AmazonKinesisAnalyticsClient.cs
42,032
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using AutoMapper; using Forum.Data.Common; using Forum.Data.Common.Interfaces; using Forum.Data.DataTransferObjects; using Forum.Data.DataTransferObjects.InputModels.Post; using Forum.Data.Models; using Forum.Data.Models.Users; using Forum.Data.Services.Tests.Fake; using Forum.Services.Data; using Forum.Services.Data.Interfaces; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using Moq; using Xunit; namespace Forum.Data.Services.Tests { [TestCaseOrderer("Forum.Data.Services.Tests.PriorityOrder.PriorityOrderer", "Forum.Data.Services.Tests")] public class PostServiceTests { private readonly IRepository<Category> categoryRepository; private readonly IRepository<Post> postRepository; private readonly IRepository<User> userRepository; private readonly IPostService postService; private readonly ForumContext context; private readonly IMapper mapper; public PostServiceTests() { var options = new DbContextOptionsBuilder<ForumContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()).Options; this.context = new ForumContext(options); this.postRepository = new Repository<Post>(context); this.categoryRepository = new Repository<Category>(context); this.userRepository = new Repository<User>(context); var userStore = new UserStore<User>(context); var logger = new Mock<ILogger<PostService>>(); var mapperProfile = new MapInitialization(); var conf = new MapperConfiguration(cfg => cfg.AddProfile(mapperProfile)); this.mapper = new Mapper(conf); var fakeUserManager = new FakeUserManager(userStore); this.postService = new PostService(postRepository, categoryRepository, userRepository, fakeUserManager, logger.Object, mapper); } [Fact] public async Task ShouldReturnEmptyCollection() { var all = this.postService.All(); Assert.Empty(all); } [Theory] [InlineData(0)] public async Task ShouldFailGetPostById(int id) { var exception = Assert.Throws<Exception>(() => this.postService.GetPostById(id)); Assert.Equal($"Post with id {id} does not exist.", exception.Message); } [Theory] [InlineData(42, "Test Title", "Test description")] public async Task ShouldFailEditInvalidId(int id, string title, string body) { await this.Seed(); var categoryId = this.categoryRepository.Query().ToList().Last().Id; var exception = await Assert.ThrowsAsync<ArgumentException>(async () => await this.postService.Edit(new PostInputEditModel { Id = id, Title = title, Body = body, CategoryId = categoryId }, "admin@admin.com")); Assert.Equal($"Post with id '{id}' does not exist", exception.Message); } [Theory] [InlineData("admin@admin.com", "admin", "test title", "test description")] public async Task CreatePostSuccessfully(string email, string username, string title, string description) { await this.Seed(); var categoryId = this.categoryRepository.Query().ToList().Last().Id; var postModel = new PostInputModel { CategoryId = categoryId, Title = title, Body = description }; var post = await this.postService.Create(postModel, email); Assert.Equal(title, post.Title); Assert.Equal(username, post.Author); Assert.Equal(description, post.Body); Assert.Equal(categoryId, post.Category.Id); Assert.Equal(0, post.Comments.Count); } [Theory] [InlineData("admin@admin.com", "admin", "test title", "test description")] public async Task CreatePostFailDueToSameTitle(string email, string username, string title, string description) { await this.Seed(); var categoryId = this.categoryRepository.Query().ToList().Last().Id; var postModel = new PostInputModel { CategoryId = categoryId, Title = title, Body = description }; var post = await this.postService.Create(postModel, email); var exception = await Assert.ThrowsAsync<ArgumentException>(async () => await this.postService.Create(postModel, email)); Assert.Equal($"Post with title '{title}' already exists", exception.Message); } [Theory] [InlineData("admin@admin.com", "admin", "test title", "test description")] public async Task CreatePostFailDueToInvalidCategoryId(string email, string username, string title, string description) { await this.Seed(); var postModel = new PostInputModel { CategoryId = 42, Title = title, Body = description }; var exception = await Assert.ThrowsAsync<ArgumentException>(async () => await this.postService.Create(postModel, email)); Assert.Equal("The category provided for the creation of this post is not valid!", exception.Message); } [Theory] [InlineData("admin@admin.com", "admin", "test title", "test description", "test title 2", "test desc 2")] public async Task EditSuccessfully(string email, string username, string title, string description, string newTitle, string newDescription) { await this.Seed(); var userId = this.userRepository.Query().AsNoTracking().Last().Id; var categoryId = this.categoryRepository.Query().ToList().Last().Id; var postToBeAdded = new Post { CategoryId = categoryId, Title = title, Body = description, AuthorId = userId, CreationDate = DateTime.UtcNow }; await this.postRepository.AddAsync(postToBeAdded); await this.postRepository.SaveChangesAsync(); this.context.Entry(postToBeAdded).State = EntityState.Detached; var postModel = this.postRepository.Query().AsNoTracking().Last(); var postToEdit = new PostInputEditModel() { Id = postModel.Id, Body = newDescription, Title = newTitle, CategoryId = postModel.CategoryId }; var edittedPost = await this.postService.Edit(postToEdit, email); var post = this.postService.GetPostById(edittedPost.Id); Assert.Equal(newTitle, post.Title); Assert.Equal(newDescription, post.Body); Assert.Equal(username, post.Author); } [Theory] [InlineData("admin@admin.com", "admin", "test title", "test description", "test title 2", "test desc 2")] public async Task EditFailInvalidCategoryId(string email, string username, string title, string description, string newTitle, string newDescription) { await this.Seed(); var categoryId = this.categoryRepository.Query().ToList().Last().Id; var postModel = new PostInputEditModel { Id = 1, CategoryId = categoryId, Title = title, Body = description }; await this.postService.Create(postModel, email); postModel.CategoryId = 42; postModel.Title = newTitle; postModel.Body = newDescription; var exception = await Assert.ThrowsAsync<ArgumentException>(async () => await this.postService.Edit(postModel, email)); Assert.Equal("The category provided for the edit of this post is not valid!", exception.Message); } [Theory] [InlineData("admin@admin.com", "admin", "test title", "test description", "test title 2", "test desc 2")] public async Task EditFailInvalidAuthor(string email, string username, string title, string description, string newTitle, string newDescription) { await this.Seed(); await this.userRepository.AddAsync(new User { UserName = "test", Email = "test@test.com" }); await this.userRepository.SaveChangesAsync(); var categoryId = this.categoryRepository.Query().ToList().Last().Id; var postModel = new PostInputEditModel { Id = 1, CategoryId = categoryId, Title = title, Body = description }; await this.postService.Create(postModel, "test@test.com"); postModel.CategoryId = categoryId; postModel.Title = newTitle; postModel.Body = newDescription; var exception = await Assert.ThrowsAsync<UnauthorizedAccessException>(async () => await this.postService.Edit(postModel, email)); Assert.Equal("You are not allowed for this operation.", exception.Message); } [Theory] [InlineData("test title", "test description", "admin@admin.com")] public async Task ShouldDeleteSuccessfully(string title, string description, string email) { await this.Seed(); var categoryId = this.categoryRepository.Query().ToList().Last().Id; var postModel = new PostInputEditModel { Id = 1, CategoryId = categoryId, Title = title, Body = description }; var post = await this.postService.Create(postModel, email); var all = this.postService.All(); var deleted = await this.postService.Delete(post.Id, email); var afterDeleted = this.postService.All(); Assert.Equal(all.Count, afterDeleted.Count + 1); Assert.Equal(deleted, title); } [Theory] [InlineData("test title", "test description", "admin@admin.com")] public async Task PostDeleteFailInvalidId(string title, string description, string email) { var exception = await Assert.ThrowsAsync<ArgumentException>(async () => await this.postService.Delete(42, email)); Assert.Equal($"Post with id '{42}' does not exist", exception.Message); } [Theory] [InlineData("test title", "test description", "test", "test@test.com", "admin@admin.com")] public async Task PostDeleteFailDueToUnauthorized(string title, string description, string invalidUser, string invalidEmail, string actualEmail) { await this.Seed(); await this.userRepository.AddAsync(new User { UserName = invalidUser, Email = invalidEmail }); await this.userRepository.SaveChangesAsync(); var categoryId = this.categoryRepository.Query().ToList().Last().Id; var postModel = new PostInputEditModel { Id = 1, CategoryId = categoryId, Title = title, Body = description }; var post = await this.postService.Create(postModel, "test@test.com"); var exception = await Assert.ThrowsAsync<UnauthorizedAccessException>(async () => await this.postService.Delete(post.Id, actualEmail)); Assert.Equal("You are not allowed for this operation.", exception.Message); } private async Task Seed() { await this.SeedAdmin(); await this.SeedCategory(); } private async Task SeedAdmin() { await this.userRepository.AddAsync(new User { UserName = "admin", Email = "admin@admin.com" }); await this.userRepository.SaveChangesAsync(); } private async Task SeedCategory() { await this.categoryRepository.AddAsync(new Category { Name = "Programming" }); await this.categoryRepository.SaveChangesAsync(); } } }
39.302839
156
0.60679
[ "MIT" ]
failfmi/forum-app
ForumApi/Tests/Forum.Data.Services.Tests/PostServiceTests.cs
12,461
C#
using System; namespace UnitSystem.Examples { public class Cuboid : Shape3D { public Length A { get; } public Length B { get; } public Length C { get; } public Length Diagonal => new Length(Math.Sqrt(Math.Pow(A.Value, 2) + Math.Pow(B.Value, 2) + Math.Pow(C.Value, 2))); public override Volume Volume { get; } public Cuboid(double a, double b, double c, Length.Unit unit = Length.Unit.Meter) { this.A = new Length(a, unit); this.B = new Length(b, unit); this.C = new Length(c, unit); this.Volume = new Volume(A.Value * B.Value * C.Value); } public Cuboid(Length a, Length b, Length c) { this.A = a; this.B = b; this.C = c; this.Volume = new Volume(A.Value * B.Value * C.Value); } public Cuboid(Rectangle rectangle, Length height) { this.A = rectangle.A; this.B = rectangle.B; this.C = height; this.Volume = new Volume(A.Value * B.Value * C.Value); } } }
26.904762
124
0.515044
[ "MIT" ]
mmbrantner/PhysicalUnitSystem
UnitSystem/Examples/Cuboid.cs
1,132
C#
using System.Collections.Generic; using System.ComponentModel; using System.Linq; using Bogus; using Microsoft.Extensions.Logging.Abstractions; using Promitor.Core.Scraping.Configuration.Model; using Promitor.Core.Scraping.Configuration.Model.Metrics; using Promitor.Core.Scraping.Configuration.Model.Metrics.ResourceTypes; using Promitor.Core.Scraping.Configuration.Serialization.Core; using Xunit; namespace Promitor.Scraper.Tests.Unit.Serialization.MetricsDeclaration { [Category(category: "Unit")] public class MetricsDeclarationWithVirtualMachineYamlSerializationTests : YamlSerializationTests<VirtualMachineMetricDefinition> { [Theory] [InlineData("promitor1", @"01:00", @"2:00")] [InlineData(null, null, null)] public void YamlSerialization_SerializeAndDeserializeValidConfigForVirtualMachine_SucceedsWithIdenticalOutput(string resourceGroupName, string defaultScrapingInterval, string metricScrapingInterval) { // Arrange var azureMetadata = GenerateBogusAzureMetadata(); var virtualMachineMetricDefinition = GenerateBogusVirtualMachineMetricDefinition(resourceGroupName, metricScrapingInterval); var metricDefaults = GenerateBogusMetricDefaults(defaultScrapingInterval); var scrapingConfiguration = new Core.Scraping.Configuration.Model.MetricsDeclaration { AzureMetadata = azureMetadata, MetricDefaults = metricDefaults, Metrics = new List<MetricDefinition> { virtualMachineMetricDefinition } }; var configurationSerializer = new ConfigurationSerializer(NullLogger.Instance); // Act var serializedConfiguration = configurationSerializer.Serialize(scrapingConfiguration); var deserializedConfiguration = configurationSerializer.Deserialize(serializedConfiguration); // Assert Assert.NotNull(deserializedConfiguration); AssertAzureMetadata(deserializedConfiguration, azureMetadata); AssertMetricDefaults(deserializedConfiguration, metricDefaults); Assert.NotNull(deserializedConfiguration.Metrics); Assert.Single(deserializedConfiguration.Metrics); var deserializedMetricDefinition = deserializedConfiguration.Metrics.FirstOrDefault(); AssertMetricDefinition(deserializedMetricDefinition, virtualMachineMetricDefinition); var deserializedVirtualMachineMetricDefinition = deserializedMetricDefinition as VirtualMachineMetricDefinition; AssertVirtualMachineMetricDefinition(deserializedVirtualMachineMetricDefinition, virtualMachineMetricDefinition); } private static void AssertVirtualMachineMetricDefinition(VirtualMachineMetricDefinition deserializedVirtualMachineMetricDefinition, VirtualMachineMetricDefinition virtualMachineMetricDefinition) { Assert.NotNull(deserializedVirtualMachineMetricDefinition); Assert.Equal(virtualMachineMetricDefinition.VirtualMachineName, deserializedVirtualMachineMetricDefinition.VirtualMachineName); Assert.NotNull(deserializedVirtualMachineMetricDefinition.AzureMetricConfiguration); Assert.Equal(virtualMachineMetricDefinition.AzureMetricConfiguration.MetricName, deserializedVirtualMachineMetricDefinition.AzureMetricConfiguration.MetricName); Assert.NotNull(deserializedVirtualMachineMetricDefinition.AzureMetricConfiguration.Aggregation); Assert.Equal(virtualMachineMetricDefinition.AzureMetricConfiguration.Aggregation.Type, deserializedVirtualMachineMetricDefinition.AzureMetricConfiguration.Aggregation.Type); Assert.Equal(virtualMachineMetricDefinition.AzureMetricConfiguration.Aggregation.Interval, deserializedVirtualMachineMetricDefinition.AzureMetricConfiguration.Aggregation.Interval); } private VirtualMachineMetricDefinition GenerateBogusVirtualMachineMetricDefinition(string resourceGroupName, string metricScrapingInterval) { var bogusScrapingInterval = GenerateBogusScrapingInterval(metricScrapingInterval); var bogusAzureMetricConfiguration = GenerateBogusAzureMetricConfiguration(); var bogusGenerator = new Faker<VirtualMachineMetricDefinition>() .StrictMode(ensureRulesForAllProperties: true) .RuleFor(metricDefinition => metricDefinition.Name, faker => faker.Name.FirstName()) .RuleFor(metricDefinition => metricDefinition.Description, faker => faker.Lorem.Sentence(wordCount: 6)) .RuleFor(metricDefinition => metricDefinition.ResourceType, faker => ResourceType.VirtualMachine) .RuleFor(metricDefinition => metricDefinition.VirtualMachineName, faker => faker.Name.LastName()) .RuleFor(metricDefinition => metricDefinition.AzureMetricConfiguration, faker => bogusAzureMetricConfiguration) .RuleFor(metricDefinition => metricDefinition.ResourceGroupName, faker => resourceGroupName) .RuleFor(metricDefinition => metricDefinition.Scraping, faker => bogusScrapingInterval) .Ignore(metricDefinition => metricDefinition.ResourceGroupName); return bogusGenerator.Generate(); } } }
65.915663
207
0.746847
[ "MIT" ]
brandonh-msft/promitor
src/Promitor.Scraper.Tests.Unit/Serialization/MetricsDeclaration/MetricsDeclarationWithVirtualMachineYamlSerializationTests.cs
5,471
C#
using System; using System.Collections.Generic; using System.Linq; using Priority_Queue; using SFML.Graphics; using SFML.System; namespace QuadTree { public class BucketGrid<T> : ISpacePartitioner<T> where T : Transformable { private readonly List<T> CachedList = new List<T>(); private readonly float m_BucketWidth; private readonly float m_BucketHeight; private readonly int m_NumBucketsWidth; private readonly int m_NumBucketsHeight; private readonly Queue<T> m_PendingInsertion; private readonly Queue<T> m_PendingRemoval; private readonly FloatRect m_Region; private readonly List<T>[] m_Buckets; /// <summary> /// The number of objects contained in the <see cref="BucketGrid{T}"/> /// </summary> public int Count { get { return m_Buckets.Where(c => c != null).Sum(c => c.Count); } } // TODO: uint param type public BucketGrid(FloatRect region, int numBucketsWidth, int numBucketsHeight) { m_Region = region; m_Buckets = new List<T>[numBucketsWidth * numBucketsHeight]; m_NumBucketsWidth = numBucketsWidth; m_NumBucketsHeight = numBucketsHeight; m_BucketWidth = region.Width / m_NumBucketsWidth; m_BucketHeight = region.Height / m_NumBucketsHeight; m_PendingInsertion = new Queue<T>(); m_PendingRemoval = new Queue<T>(); } /// <summary> /// Updates the <see cref="BucketGrid{T}"/> by adding and/or /// removing any items passed to <see cref="Add"/> or <see cref="Remove"/> /// and by updating the grid to take into account objects that have moved /// </summary> public void Update() { // Make sure all objects are in the right buckets for (var i = 0; i < m_Buckets.Length; i++) { var bucket = m_Buckets[i]; if (bucket == null) continue; for (var j = bucket.Count - 1; j >= 0; j--) { var idx = FindBucketIndex(bucket[j].Position); if (idx == i) continue; if (m_Buckets[idx] == null) m_Buckets[idx] = new List<T>(); m_Buckets[idx].Add(bucket[j]); bucket.RemoveAt(j); } } lock (m_PendingInsertion) { while (m_PendingInsertion.Count > 0) { var obj = m_PendingInsertion.Dequeue(); var idx = FindBucketIndex(obj.Position); if (m_Buckets[idx] == null) m_Buckets[idx] = new List<T>(); m_Buckets[idx].Add(obj); } } lock (m_PendingRemoval) { while (m_PendingRemoval.Count > 0) { var obj = m_PendingRemoval.Dequeue(); var idx = FindBucketIndex(obj.Position); if (m_Buckets[idx] == null) m_Buckets[idx] = new List<T>(); m_Buckets[idx].Remove(obj); if (m_Buckets[idx].Count == 0) m_Buckets[idx] = null; } } } /// <summary> /// Adds the given <see cref="Transformable"/> to the BucketGrid. /// Internal BucketGrid is not updated until the next call to Update. /// </summary> public void Add(T t) { #if DEBUG if (t == null) throw new ArgumentException("Cannot add a null object to the BucketGrid"); #endif lock (m_PendingInsertion) m_PendingInsertion.Enqueue(t); } /// <summary> /// Removes the given <see cref="Transformable"/> from the BucketGrid. /// Internal BucketGrid is not updated until the next call to Update. /// </summary> public void Remove(T t) { #if DEBUG if (t == null) throw new ArgumentException("Cannot remove a null object from the BucketGrid"); #endif lock (m_PendingRemoval) m_PendingRemoval.Enqueue(t); } #region Non-Thread-Safe Queries /// <summary> /// Gets the K closest objects to a given position. /// This version of the query is not thread safe. /// </summary> public T[] GetKClosestObjects(Vector2f pos, uint k, float range = float.MaxValue) { #if DEBUG if (range < 0f) throw new ArgumentException("Range cannot be negative"); #endif FastPriorityQueue<ItemNode<T>> pq = new FastPriorityQueue<ItemNode<T>>((int) k); KNearestNeighborSearch(pos, k, range, pq); return pq.Select(node => node.Item).ToArray(); } /// <summary> /// Gets all objects within the given range of the given position. /// This version of the query is not thread safe. /// </summary> public T[] GetObjectsInRange(Vector2f pos, float range = float.MaxValue) { #if DEBUG if (range < 0f) throw new ArgumentException("Range cannot be negative"); #endif CachedList.Clear(); AllNearestNeighborSearch(pos, range, CachedList); return CachedList.ToArray(); } /// <summary> /// Gets all objects within the given <see cref="FloatRect"/>. /// This version of the query is not thread safe. /// </summary> public T[] GetObjectsInRect(FloatRect rect) { CachedList.Clear(); ObjectsInRectSearch(rect, CachedList); return CachedList.ToArray(); } #endregion #region Thread-Safe Queries /// <summary> /// Gets the closest object to the given position. /// This version of the query is thread safe as long as /// <see cref="Update"/> does not execute during the queery. /// </summary> public T GetClosestObject(Vector2f pos, float maxDistance = float.MaxValue) { #if DEBUG if (maxDistance < 0f) throw new ArgumentException("Range cannot be negative"); #endif return NearestNeighborSearch(pos, maxDistance); } /// <summary> /// Gets the K closest objects to a given position. /// This version of the query is thread safe as long as /// <see cref="Update"/> does not execute during the queery. /// </summary> public void GetKClosestObjects(Vector2f pos, uint k, float range, FastPriorityQueue<ItemNode<T>> results) { #if DEBUG if (range < 0f) throw new ArgumentException("Range cannot be negative"); if (results == null) throw new ArgumentException("Results queue cannot be null"); #endif KNearestNeighborSearch(pos, k, range, results); } /// <summary> /// Gets all objects within the given range of the given position. /// This version of the query is thread safe as long as /// <see cref="Update"/> does not execute during the queery. /// </summary> public void GetObjectsInRange(Vector2f pos, float range, IList<T> results) { #if DEBUG if (range < 0f) throw new ArgumentException("Range cannot be negative"); if (results == null) throw new ArgumentException("Results list cannot be null"); #endif AllNearestNeighborSearch(pos, range, results); } /// <summary> /// Gets all objects within the given <see cref="FloatRect"/>. /// This version of the query is thread safe as long as /// <see cref="Update"/> does not execute during the queery. /// </summary> public void GetObjectsInRect(FloatRect rect, IList<T> results) { #if DEBUG if (results == null) throw new ArgumentException("Results list cannot be null"); #endif ObjectsInRectSearch(rect, results); } #endregion private T NearestNeighborSearch(Vector2f pos, float range) { T closest = null; var idx = FindBucketIndex(pos); var bucketRangeX = (int) (range / m_BucketWidth) + 1; if (bucketRangeX < 0) bucketRangeX = m_NumBucketsWidth / 2; var bucketRangeY = (int) (range / m_BucketHeight) + 1; if (bucketRangeY < 0) bucketRangeY = m_NumBucketsHeight / 2; for (int d = 0; d <= Math.Max(bucketRangeX, bucketRangeY); d++) { int dx = Math.Min(d, bucketRangeX); int dy = Math.Min(d, bucketRangeY); foreach (int nextIdx in BucketsAtRange(idx, dx, dy)) { // If index is out of range if (nextIdx < 0 || nextIdx >= m_Buckets.Length) continue; if (m_Buckets[nextIdx] == null) continue; var bucket = m_Buckets[nextIdx]; for (int k = 0; k < bucket.Count; k++) { var ds = (bucket[k].Position - pos).SquaredLength(); if (ds < range * range) { closest = bucket[k]; range = (float)Math.Sqrt(ds); } } bucketRangeX = (int)(range / m_BucketWidth) + 1; if (bucketRangeX < 0) bucketRangeX = m_NumBucketsWidth / 2; bucketRangeY = (int)(range / m_BucketHeight) + 1; if (bucketRangeY < 0) bucketRangeY = m_NumBucketsHeight / 2; } } return closest; } private void AllNearestNeighborSearch(Vector2f pos, float range, IList<T> results) { var idx = FindBucketIndex(pos); var bucketRangeX = (int)(range / m_BucketWidth) + 1; if (bucketRangeX < 0) bucketRangeX = m_NumBucketsWidth / 2; var bucketRangeY = (int)(range / m_BucketHeight) + 1; if (bucketRangeY < 0) bucketRangeY = m_NumBucketsHeight / 2; for (int i = -bucketRangeX; i <= bucketRangeX; i++) { for (int j = -bucketRangeY; j <= bucketRangeY; j++) { var nextIdx = idx + (i + (j * m_NumBucketsWidth)); // If index is out of range if (nextIdx < 0 || nextIdx >= m_Buckets.Length) continue; if (m_Buckets[nextIdx] == null) continue; var bucket = m_Buckets[nextIdx]; for (int n = 0; n < bucket.Count; n++) { var ds = (bucket[n].Position - pos).SquaredLength(); if (ds > range * range) continue; results.Add(bucket[n]); } } } } private void KNearestNeighborSearch(Vector2f pos, uint k, float range, FastPriorityQueue<ItemNode<T>> results) { var idx = FindBucketIndex(pos); var bucketRangeX = (int)(range / m_BucketWidth) + 1; if (bucketRangeX < 0) bucketRangeX = m_NumBucketsWidth / 2; var bucketRangeY = (int)(range / m_BucketHeight) + 1; if (bucketRangeY < 0) bucketRangeY = m_NumBucketsHeight / 2; for (int d = 0; d <= Math.Max(bucketRangeX, bucketRangeY); d++) { int dx = Math.Min(d, bucketRangeX); int dy = Math.Min(d, bucketRangeY); foreach (int nextIdx in BucketsAtRange(idx, dx, dy)) { // If index is out of range if (nextIdx < 0 || nextIdx >= m_Buckets.Length) continue; if (m_Buckets[nextIdx] == null) continue; var bucket = m_Buckets[nextIdx]; for (int n = 0; n < bucket.Count; n++) { var ds = (bucket[n].Position - pos).SquaredLength(); if (ds > range * range) continue; if (results.Count < k) { results.Enqueue(new ItemNode<T>(bucket[n]), -ds); continue; } if (-ds > results.First.Priority) { results.Dequeue(); results.Enqueue(new ItemNode<T>(bucket[n]), -ds); range = (float)Math.Sqrt(-results.First.Priority); } } bucketRangeX = (int)(range / m_BucketWidth) + 1; if (bucketRangeX < 0) bucketRangeX = m_NumBucketsWidth / 2; bucketRangeY = (int)(range / m_BucketHeight) + 1; if (bucketRangeY < 0) bucketRangeY = m_NumBucketsHeight / 2; } } } private void ObjectsInRectSearch(FloatRect rect, ICollection<T> results) { var idx = FindBucketIndex(rect.Center()); var range = (rect.Center() - rect.Min()).Length(); var bucketRangeX = (int)(range / m_BucketWidth) + 1; if (bucketRangeX < 0) bucketRangeX = m_NumBucketsWidth / 2; var bucketRangeY = (int)(range / m_BucketHeight) + 1; if (bucketRangeY < 0) bucketRangeY = m_NumBucketsHeight / 2; for (int i = -bucketRangeX; i <= bucketRangeX; i++) { for (int j = -bucketRangeY; j <= bucketRangeY; j++) { var nextIdx = idx + (i + (j * m_NumBucketsWidth)); // If index is out of range if (nextIdx < 0 || nextIdx >= m_Buckets.Length) continue; if (m_Buckets[nextIdx] == null) continue; var bucket = m_Buckets[nextIdx]; for (int n = 0; n < bucket.Count; n++) { if (!rect.Contains(bucket[n].Position.X, bucket[n].Position.Y)) continue; results.Add(bucket[n]); } } } } /// <summary> /// Returns the rectangle of indices the given /// dx and dy away from the given center /// </summary> private IEnumerable<int> BucketsAtRange(int center, int dx, int dy) { // Top row for (int i = -dx; i <= dx; i++) { yield return center + (i - (dy * m_NumBucketsWidth)); } // Bottom row if (dy != 0) { for (int i = -dx; i <= dx; i++) { yield return center + (i + (dy * m_NumBucketsWidth)); } } // Left column for (int j = -dy + 1; j <= dy - 1; j++) { if (dx == 0 && j == 0) continue; yield return center + (-dx + (j * m_NumBucketsWidth)); } // right column if (dx != 0) { for (int j = -dy + 1; j <= dy - 1; j++) { if (dx == 0 && j == 0) continue; yield return center + (dx + (j * m_NumBucketsWidth)); } } } private int FindBucketIndex(Vector2f pos) { // TODO: what happens if pos is out of bounds? var fromLeft = pos.X - m_Region.Left; var x = (int)(fromLeft / m_BucketWidth); var fromTop = pos.Y - m_Region.Top; var y = (int)(fromTop / m_BucketHeight); return x + (y * m_NumBucketsWidth); } } }
36.222467
118
0.490301
[ "MIT" ]
deanljohnson/QuadTree
QuadTree/BucketGrid.cs
16,447
C#
using Budget.Database; using Budget.InputModels; using Budget.Repository; using Budget.Models; using System; using System.Linq; using System.Threading.Tasks; using Threax.AspNetCore.Tests; using Xunit; namespace Budget.Tests { public static partial class EntryTests { public class Repository : IDisposable { private Mockup mockup = new Mockup().SetupGlobal().SetupModel(); public Repository() { } public void Dispose() { mockup.Dispose(); } [Fact] async Task Add() { var repo = mockup.Get<IEntryRepository>(); var result = await repo.Add(EntryTests.CreateInput()); Assert.NotNull(result); } [Fact] async Task AddRange() { var repo = mockup.Get<IEntryRepository>(); await repo.AddRange(new EntryInput[] { EntryTests.CreateInput(), EntryTests.CreateInput(), EntryTests.CreateInput() }); } [Fact] async Task Delete() { var dbContext = mockup.Get<AppDbContext>(); var repo = mockup.Get<IEntryRepository>(); await repo.AddRange(new EntryInput[] { EntryTests.CreateInput(), EntryTests.CreateInput(), EntryTests.CreateInput() }); var result = await repo.Add(EntryTests.CreateInput()); Assert.Equal<int>(4, dbContext.Entries.Count()); await repo.Delete(result.EntryId); Assert.Equal<int>(3, dbContext.Entries.Count()); } [Fact] async Task Get() { var dbContext = mockup.Get<AppDbContext>(); var repo = mockup.Get<IEntryRepository>(); await repo.AddRange(new EntryInput[] { EntryTests.CreateInput(), EntryTests.CreateInput(), EntryTests.CreateInput() }); var result = await repo.Add(EntryTests.CreateInput()); Assert.Equal<int>(4, dbContext.Entries.Count()); var getResult = await repo.Get(result.EntryId); Assert.NotNull(getResult); } [Fact] async Task HasEntriesEmpty() { var repo = mockup.Get<IEntryRepository>(); Assert.False(await repo.HasEntries()); } [Fact] async Task HasEntries() { var repo = mockup.Get<IEntryRepository>(); await repo.AddRange(new EntryInput[] { EntryTests.CreateInput(), EntryTests.CreateInput(), EntryTests.CreateInput() }); Assert.True(await repo.HasEntries()); } [Fact] async Task List() { //This could be more complete var repo = mockup.Get<IEntryRepository>(); await repo.AddRange(new EntryInput[] { EntryTests.CreateInput(), EntryTests.CreateInput(), EntryTests.CreateInput() }); var query = new EntryQuery(); var result = await repo.List(query); Assert.Equal(query.Limit, result.Limit); Assert.Equal(query.Offset, result.Offset); Assert.Equal(3, result.Total); Assert.NotEmpty(result.Items); } [Fact] async Task Update() { var repo = mockup.Get<IEntryRepository>(); var result = await repo.Add(EntryTests.CreateInput()); Assert.NotNull(result); var updateResult = await repo.Update(result.EntryId, EntryTests.CreateInput()); Assert.NotNull(updateResult); } } } }
35.444444
135
0.529519
[ "MIT" ]
threax/Threax.Budget
Budget.Tests/Entry/EntryRepositoryTests.cs
3,828
C#
using UnityEngine; using System.Collections; public class Player : MonoBehaviour { public float speed = 90; // Update is called once per frame void Update () { transform.Rotate(new Vector3(0, 1, 0) * Time.deltaTime * speed);//Vector3.up } public void changspeed(float newspeed) { this.speed = newspeed; } }
23.266667
84
0.65043
[ "MIT" ]
Chunxiaojiu/-unity-
UGIstudy/UGIstudy1/Assets/Player.cs
351
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the license-manager-2018-08-01.normal.json service model. */ using System; using Amazon.Runtime; using Amazon.Util.Internal; namespace Amazon.LicenseManager { /// <summary> /// Configuration for accessing Amazon LicenseManager service /// </summary> public partial class AmazonLicenseManagerConfig : ClientConfig { private static readonly string UserAgentString = InternalSDKUtils.BuildUserAgentString("3.5.0.31"); private string _userAgent = UserAgentString; /// <summary> /// Default constructor /// </summary> public AmazonLicenseManagerConfig() { this.AuthenticationServiceName = "license-manager"; } /// <summary> /// The constant used to lookup in the region hash the endpoint. /// </summary> public override string RegionEndpointServiceName { get { return "license-manager"; } } /// <summary> /// Gets the ServiceVersion property. /// </summary> public override string ServiceVersion { get { return "2018-08-01"; } } /// <summary> /// Gets the value of UserAgent property. /// </summary> public override string UserAgent { get { return _userAgent; } } } }
26.5375
113
0.593029
[ "Apache-2.0" ]
Singh400/aws-sdk-net
sdk/src/Services/LicenseManager/Generated/AmazonLicenseManagerConfig.cs
2,123
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.AwsNative.EC2 { /// <summary> /// Resource Type definition for AWS::EC2::SubnetCidrBlock /// </summary> [Obsolete(@"SubnetCidrBlock is not yet supported by AWS Native, so its creation will currently fail. Please use the classic AWS provider, if possible.")] [AwsNativeResourceType("aws-native:ec2:SubnetCidrBlock")] public partial class SubnetCidrBlock : Pulumi.CustomResource { [Output("ipv6CidrBlock")] public Output<string> Ipv6CidrBlock { get; private set; } = null!; [Output("subnetId")] public Output<string> SubnetId { get; private set; } = null!; /// <summary> /// Create a SubnetCidrBlock 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 SubnetCidrBlock(string name, SubnetCidrBlockArgs args, CustomResourceOptions? options = null) : base("aws-native:ec2:SubnetCidrBlock", name, args ?? new SubnetCidrBlockArgs(), MakeResourceOptions(options, "")) { } private SubnetCidrBlock(string name, Input<string> id, CustomResourceOptions? options = null) : base("aws-native:ec2:SubnetCidrBlock", 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 SubnetCidrBlock 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 SubnetCidrBlock Get(string name, Input<string> id, CustomResourceOptions? options = null) { return new SubnetCidrBlock(name, id, options); } } public sealed class SubnetCidrBlockArgs : Pulumi.ResourceArgs { [Input("ipv6CidrBlock", required: true)] public Input<string> Ipv6CidrBlock { get; set; } = null!; [Input("subnetId", required: true)] public Input<string> SubnetId { get; set; } = null!; public SubnetCidrBlockArgs() { } } }
41.728395
157
0.643195
[ "Apache-2.0" ]
AaronFriel/pulumi-aws-native
sdk/dotnet/EC2/SubnetCidrBlock.cs
3,380
C#
using Lucene.Net.Documents; namespace Lucene.Net.Search { using Lucene.Net.Randomized.Generators; using NUnit.Framework; using Directory = Lucene.Net.Store.Directory; using DirectoryReader = Lucene.Net.Index.DirectoryReader; using Document = Documents.Document; using Field = Field; using IndexReader = Lucene.Net.Index.IndexReader; using LuceneTestCase = Lucene.Net.Util.LuceneTestCase; /* * 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. */ using MockAnalyzer = Lucene.Net.Analysis.MockAnalyzer; using RandomIndexWriter = Lucene.Net.Index.RandomIndexWriter; using Term = Lucene.Net.Index.Term; /// [TestFixture] public class TestFieldValueFilter : LuceneTestCase { [Test] public virtual void TestFieldValueFilterNoValue() { Directory directory = NewDirectory(); RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()))); int docs = AtLeast(10); int[] docStates = BuildIndex(writer, docs); int numDocsNoValue = 0; for (int i = 0; i < docStates.Length; i++) { if (docStates[i] == 0) { numDocsNoValue++; } } IndexReader reader = DirectoryReader.Open(directory); IndexSearcher searcher = NewSearcher(reader); TopDocs search = searcher.Search(new TermQuery(new Term("all", "test")), new FieldValueFilter("some", true), docs); Assert.AreEqual(search.TotalHits, numDocsNoValue); ScoreDoc[] scoreDocs = search.ScoreDocs; foreach (ScoreDoc scoreDoc in scoreDocs) { Assert.IsNull(reader.Document(scoreDoc.Doc).Get("some")); } reader.Dispose(); directory.Dispose(); } [Test] public virtual void TestFieldValueFilter_Mem() { Directory directory = NewDirectory(); RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()))); int docs = AtLeast(10); int[] docStates = BuildIndex(writer, docs); int numDocsWithValue = 0; for (int i = 0; i < docStates.Length; i++) { if (docStates[i] == 1) { numDocsWithValue++; } } IndexReader reader = DirectoryReader.Open(directory); IndexSearcher searcher = NewSearcher(reader); TopDocs search = searcher.Search(new TermQuery(new Term("all", "test")), new FieldValueFilter("some"), docs); Assert.AreEqual(search.TotalHits, numDocsWithValue); ScoreDoc[] scoreDocs = search.ScoreDocs; foreach (ScoreDoc scoreDoc in scoreDocs) { Assert.AreEqual("value", reader.Document(scoreDoc.Doc).Get("some")); } reader.Dispose(); directory.Dispose(); } private int[] BuildIndex(RandomIndexWriter writer, int docs) { int[] docStates = new int[docs]; for (int i = 0; i < docs; i++) { Document doc = new Document(); if (Random().NextBoolean()) { docStates[i] = 1; doc.Add(NewTextField("some", "value", Field.Store.YES)); } doc.Add(NewTextField("all", "test", Field.Store.NO)); doc.Add(NewTextField("id", "" + i, Field.Store.YES)); writer.AddDocument(doc); } writer.Commit(); int numDeletes = Random().Next(docs); for (int i = 0; i < numDeletes; i++) { int docID = Random().Next(docs); writer.DeleteDocuments(new Term("id", "" + docID)); docStates[docID] = 2; } writer.Dispose(); return docStates; } } }
39.677165
154
0.569359
[ "Apache-2.0" ]
BlueCurve-Team/lucenenet
src/Lucene.Net.Tests/core/Search/TestFieldValueFilter.cs
5,039
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.Configuration; namespace DG.TwitterClient.Host { public class Proxy : IWebProxy { private Uri m_proxyAddress; public Proxy() { m_proxyAddress = new Uri(ConfigurationManager.AppSettings["proxyAddress"]); Credentials = new NetworkCredential(ConfigurationManager.AppSettings["proxyUserName"], ConfigurationManager.AppSettings["proxyPassword"]); } #region IWebProxy Members public ICredentials Credentials { get; set; } public Uri GetProxy(Uri destination) { return m_proxyAddress; } public bool IsBypassed(Uri host) { return false; } #endregion } }
22.609756
151
0.574973
[ "MIT" ]
giacomelli/DG.TwitterClient
src/Host/Proxy.cs
929
C#
using Moq; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Serialization; using ShipEngineSDK; using ShipEngineSDK.Common; using ShipEngineSDK.Common.Enums; using ShipEngineSDK.CreateLabelFromShipmentDetails; using System; using System.Collections.Generic; using System.IO; using System.Net.Http; using System.Threading.Tasks; using Xunit; namespace ShipEngineTest { public class CreateLabelFromShipmentDetailsTest { Params LabelParams; public TestUtils TestUtils; public CreateLabelFromShipmentDetailsTest() { TestUtils = new TestUtils(); LabelParams = new Params() { Shipment = new Shipment() { ServiceCode = "usps_priority_mail", ShipFrom = new Address() { Name = "John Doe", AddressLine1 = "4009 Marathon Blvd", CityLocality = "Austin", StateProvince = "TX", PostalCode = "78756", CountryCode = Country.US, Phone = "512-555-5555" }, ShipTo = new Address() { Name = "Amanda Miller", AddressLine1 = "525 S Winchester Blvd", CityLocality = "San Jose", StateProvince = "CA", PostalCode = "95128", CountryCode = Country.US, Phone = "512-555-5555" }, Confirmation = DeliveryConfirmation.DeliveryMailed, Packages = new List<Package>() { new Package() { Weight = new Weight() { Value = 17, Unit = WeightUnit.Pound }, Dimensions = new Dimensions() { Length = 36, Width = 12, Height = 24, Unit = DimensionUnit.Inch, } } } }, ValidateAddress = ValidateAddress.ValidateAndClean }; } [Fact] public async void ValidCreateLabelFromShipmentDetailsTest() { var config = new Config("TEST_ycvJAgX6tLB1Awm9WGJmD8mpZ8wXiQ20WhqFowCk32s"); var mockShipEngineFixture = new MockShipEngineFixture(config); string json = File.ReadAllText(Path.Combine(Directory.GetCurrentDirectory(), "../../../HttpResponseMocks/CreateLabelFromShipmentDetails200Response.json")); mockShipEngineFixture.StubRequest(HttpMethod.Post, "/v1/labels", System.Net.HttpStatusCode.OK, json); var result = await mockShipEngineFixture.ShipEngine.CreateLabelFromShipmentDetails(LabelParams); Assert.Equal("se-76278969", result.LabelId); Assert.Equal(LabelStatus.Completed, result.Status); Assert.Equal("se-146030558", result.ShipmentId); Assert.Equal("2021-08-09T00:00:00Z", result.ShipDate); Assert.Equal("2021-08-09T14:55:37.5393659Z", result.CreatedAt); Assert.Equal(Currency.USD, result.ShipmentCost.Currency); Assert.Equal(115.51, result.ShipmentCost.Amount); Assert.Equal(0.0, result.InsuranceCost.Amount); Assert.Equal(Currency.USD, result.InsuranceCost.Currency); Assert.Equal("9405511899560337048294", result.TrackingNumber); Assert.False(result.IsReturnLabel); Assert.Null(result.RmaNumber); Assert.False(result.IsInternational); Assert.Equal("", result.BatchId); Assert.Equal("se-656171", result.CarrierId); Assert.Equal("usps_priority_mail", result.ServiceCode); Assert.Equal("package", result.PackageCode); Assert.False(result.Voided); Assert.Null(result.VoidedAt); Assert.Equal(LabelFormat.PDF, result.LabelFormat); Assert.Equal(DisplayScheme.Label, result.DisplayScheme); Assert.Equal(LabelLayout.FourBySix, result.LabelLayout); Assert.True(result.Trackable); Assert.Null(result.LabelImageId); Assert.Equal("stamps_com", result.CarrierCode); Assert.Equal(TrackingStatus.InTransit, result.TrackingStatus); Assert.Equal("https://api.shipengine.com/v1/downloads/10/9-VbKDnISUGt_z3zrjvPTw/label-76278969.pdf", result.LabelDownload.Pdf); Assert.Equal("https://api.shipengine.com/v1/downloads/10/9-VbKDnISUGt_z3zrjvPTw/label-76278969.png", result.LabelDownload.Png); Assert.Equal("https://api.shipengine.com/v1/downloads/10/9-VbKDnISUGt_z3zrjvPTw/label-76278969.zpl", result.LabelDownload.Zpl); Assert.Equal("https://api.shipengine.com/v1/downloads/10/9-VbKDnISUGt_z3zrjvPTw/label-76278969.pdf", result.LabelDownload.Href); Assert.Null(result.FormDownload); Assert.Null(result.InsuranceClaim); var package = result.Packages[0]; Assert.Equal(80938203, package.PackageId); Assert.Equal("package", package.PackageCode); Assert.Equal(17.0, package.Weight.Value); Assert.Equal(WeightUnit.Pound, package.Weight.Unit); Assert.Equal(DimensionUnit.Inch, package.Dimensions.Unit); Assert.Equal(36.0, package.Dimensions.Length); Assert.Equal(12.0, package.Dimensions.Width); Assert.Equal(24.0, package.Dimensions.Height); Assert.Equal(Currency.USD, package.InsuredValue.Currency); Assert.Equal(0.0, package.InsuredValue.Amount); Assert.Equal("9405511899560337048294", package.TrackingNumber); Assert.Null(package.LabelMessages.Reference1); Assert.Null(package.LabelMessages.Reference2); Assert.Null(package.LabelMessages.Reference3); Assert.Null(package.ExternalPackageId); Assert.Equal(1, package.Sequence); Assert.Equal(ChargeEvent.CarrierDefault, result.ChargeEvent); } [Fact] public void TestParamsSerialization() { string labelParamsString = JsonConvert.SerializeObject(LabelParams, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore, ContractResolver = new DefaultContractResolver { NamingStrategy = new SnakeCaseNamingStrategy() } }); JObject parsedJson = JObject.Parse(labelParamsString); Assert.Equal("John Doe", parsedJson["shipment"]["ship_from"]["name"]); Assert.Equal("delivery_mailed", parsedJson["shipment"]["confirmation"]); Assert.Null(parsedJson["label_layout"]); Assert.Null(parsedJson["label_format"]); } [Fact] public async void ValidateCustomSettingsAtMethodLevel() { var apiKeyString = "TEST_bTYAskEX6tD7vv6u/cZ/M4LaUSWBJ219+8S1jgFcnkk"; var config = new Config(apiKey: apiKeyString, timeout: TimeSpan.FromSeconds(1)); var mockHandler = new Mock<ShipEngine>(config); var shipEngine = mockHandler.Object; string json = File.ReadAllText(Path.Combine(Directory.GetCurrentDirectory(), "../../../HttpResponseMocks/CreateLabelFromShipmentDetails200Response.json")); var voidLabelResult = JsonConvert.DeserializeObject<Result>(json); var request = new HttpRequestMessage(HttpMethod.Post, "v1/labels"); // Verify that the client has a custom timeout of 1 second when called. mockHandler .Setup(x => x.SendHttpRequestAsync<Result> ( It.IsAny<HttpMethod>(), It.IsAny<string>(), It.IsAny<string>(), It.Is<HttpClient>(client => client.Timeout == TimeSpan.FromSeconds(1) && client.DefaultRequestHeaders.ToString().Contains("12345")), It.IsAny<Config>() )) .Returns(Task.FromResult(voidLabelResult)); var customConfig = new Config(apiKey: "12345", timeout: TimeSpan.FromSeconds(1)); await shipEngine.CreateLabelFromShipmentDetails(LabelParams, methodConfig: customConfig); mockHandler.VerifyAll(); } [Fact] public async void InvalidRetriesInMethodCall() { var apiKeyString = "TEST_bTYAskEX6tD7vv6u/cZ/M4LaUSWBJ219+8S1jgFcnkk"; var config = new Config(apiKey: apiKeyString); var mockHandler = new Mock<ShipEngine>(config); var shipEngine = mockHandler.Object; var ex = await Assert.ThrowsAsync<ShipEngineException>(async () => await shipEngine.CreateLabelFromShipmentDetails(LabelParams, methodConfig: new Config(apiKey: "12345", retries: -1))); Assert.Equal(ErrorSource.Shipengine, ex.ErrorSource); Assert.Equal(ErrorType.Validation, ex.ErrorType); Assert.Equal(ErrorCode.InvalidFieldValue, ex.ErrorCode); Assert.Equal("Retries must be greater than zero.", ex.Message); Assert.Null(ex.RequestId); } } }
42.592105
197
0.587066
[ "Apache-2.0" ]
ShipEngine/shipengine-dotnet
ShipEngine.Tests/ShipEngineMethodTests/CreateLabelFromShipmentDetailsTest.cs
9,711
C#
#pragma checksum "E:\flyjets_web\Views\App\About.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "94abb3d13410f77b4203913bc80f318dd438ce84" // <auto-generated/> #pragma warning disable 1591 [assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_App_About), @"mvc.1.0.view", @"/Views/App/About.cshtml")] [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/Views/App/About.cshtml", typeof(AspNetCore.Views_App_About))] namespace AspNetCore { #line hidden using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.ViewFeatures; #line 1 "E:\flyjets_web\Views\_ViewImports.cshtml" using FlyJetsV2.Web; #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"94abb3d13410f77b4203913bc80f318dd438ce84", @"/Views/App/About.cshtml")] [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"0ca9bdb9443bcd8845374d7c893bf6f857e97408", @"/Views/_ViewImports.cshtml")] public class Views_App_About : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic> { private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("form form--messageCenter"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("action", new global::Microsoft.AspNetCore.Html.HtmlString(""), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("method", "post", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_3 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("data-href", new global::Microsoft.AspNetCore.Html.HtmlString("/"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_4 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("data-action", new global::Microsoft.AspNetCore.Html.HtmlString("messageCenter"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_5 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("id", new global::Microsoft.AspNetCore.Html.HtmlString("messageCenterForm"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_6 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("onsubmit", new global::Microsoft.AspNetCore.Html.HtmlString("return false;"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_7 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("form form--login js-ajaxForm"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_8 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("data-href", new global::Microsoft.AspNetCore.Html.HtmlString("/json/test.json"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_9 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("data-action", new global::Microsoft.AspNetCore.Html.HtmlString("login"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_10 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("id", new global::Microsoft.AspNetCore.Html.HtmlString("loginForm"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_11 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("form form--forgotPassword js-ajaxForm"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_12 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("data-action", new global::Microsoft.AspNetCore.Html.HtmlString("forgotPassword"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_13 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("id", new global::Microsoft.AspNetCore.Html.HtmlString("forgotPasswordForm"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_14 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("form form--signUpForm js-ajaxForm"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_15 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("data-href", new global::Microsoft.AspNetCore.Html.HtmlString("#"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_16 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("data-action", new global::Microsoft.AspNetCore.Html.HtmlString("signUpFlyer"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_17 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("id", new global::Microsoft.AspNetCore.Html.HtmlString("signUpFlyerForm"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_18 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("data-action", new global::Microsoft.AspNetCore.Html.HtmlString("signUpAircraftProvider"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_19 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("id", new global::Microsoft.AspNetCore.Html.HtmlString("signUpAircraftProviderForm"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0169 private string __tagHelperStringValueBuffer; #pragma warning restore 0169 private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext __tagHelperExecutionContext; private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner __tagHelperRunner = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner(); private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __backed__tagHelperScopeManager = null; private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __tagHelperScopeManager { get { if (__backed__tagHelperScopeManager == null) { __backed__tagHelperScopeManager = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope); } return __backed__tagHelperScopeManager; } } private global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_HeadTagHelper; private global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper; private global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper; private global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper; #pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { BeginContext(0, 4, true); WriteLiteral("\r\n\r\n"); EndContext(); #line 3 "E:\flyjets_web\Views\App\About.cshtml" Layout = null; #line default #line hidden BeginContext(29, 57, true); WriteLiteral("\r\n<!DOCTYPE html>\r\n<html class=\"no-js\" lang=\"ru\">\r\n\r\n "); EndContext(); BeginContext(86, 959, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("head", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "94abb3d13410f77b4203913bc80f318dd438ce8410738", async() => { BeginContext(92, 946, true); WriteLiteral(@" <meta charset=""utf-8""> <meta http-equiv=""x-ua-compatible"" content=""ie=edge""> <title>FLYJETS</title> <meta content="""" name=""description""> <meta content="""" name=""keywords""> <meta name=""viewport"" content=""width=device-width, initial-scale=1""> <meta content=""telephone=no"" name=""format-detection""> <meta name=""HandheldFriendly"" content=""true""> <!--[if (gt IE 9)|!(IE)]><!--> <link href=""/css/main.css"" rel=""stylesheet"" type=""text/css""> <!--<![endif]--> <link rel=""icon"" type=""image/x-icon"" href=""favicon.ico""> <script> (function(H) { H.className = H.className.replace(/\bno-js\b/, 'js') })(document.documentElement) </script> <script src=""https://maps.googleapis.com/maps/api/js?key=AIzaSyDTtMUY96FwdCihu1z3Px4rEZQ6uKabQRU&amp;&amp;language=en"" async defer></script> "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_HeadTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_HeadTagHelper); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(1045, 8, true); WriteLiteral("\r\n\r\n "); EndContext(); BeginContext(1053, 70581, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("body", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "94abb3d13410f77b4203913bc80f318dd438ce8412916", async() => { BeginContext(1059, 30310, true); WriteLiteral(@" <div class=""rootBox""> <div class=""page page--main js-scrollToMap openMap--half openMap--full""> <div class=""box box--mainBlock""> <div class=""box__decor box__decor--1""></div> <div class=""box__decor box__decor--2""></div> <div class=""box__inner""> <div class=""mainBlock""> <div class=""mainBlock__header""> <div class=""mainBlock__slogan"">A jet aviation marketplace <br>and travel planning system</div> </div> <div class=""mainBlock__content""> <div class=""mainBlock__info mainBlock__info--1""> <div class=""mainBlock__info-title"">For <br>flyers</div> <div class=""mainBlock__info-text"">Search and book ai"); WriteLiteral(@"rcraft, <br>flights, hotels and more</div> </div> <div class=""mainBlock__logo js-mainLogo""> <img src=""/img/general/logo.png""> </div> <div class=""mainBlock__info mainBlock__info--2""> <div class=""mainBlock__info-title"">For aircraft providers</div> <div class=""mainBlock__info-text"">Upload aircraft and <br>availability schedules</div> </div> </div> <div class=""mainBlock__button-wr""><a class=""mainBlock__button js-popup"" href=""#loginPopup""><span class=""text"">Log in</span></a><a class=""mainBlock__button mainBlock__button--active js-popup"" href=""#signUpPopup""><span class=""text"">Sign up</span></a> "); WriteLiteral(@" </div> <div class=""mainBlock__contacts""> <div class=""mainBlock__contacts-title"">Call or email</div><a class=""mainBlock__contacts-link"" href=""tel:+12128455137"">+1 (212) 845-5137</a><a class=""mainBlock__contacts-link"" href=""mailto:FLY@flyjets.com"">FLY@flyjets.com</a> </div> <div class=""mainBlock__footer""> <div class=""mainBlock__version"">in Alpha mode</div> <div class=""mainBlock__link js-clickToMap"" data-mobile-text=""Click here or swipe for map"">Click here or scroll for map</div> </div> </div> </div> </div> <div class=""content""> <div class=""box box--header""> <div class=""box__inner""> <div class=""header""> "); WriteLiteral(@" <div class=""header__left"" style=""z-index:1;""> <a class=""header__logo goToUserHomePage"" href=""/app/main""> <img src=""/img/general/logo.png""> </a> </div> <div class=""header__center"" style=""position:absolute; margin-left:auto; margin-right:auto; left:0; right:0;""> <div class=""header__title"">About Us</div> </div> <div class=""header__button""> <div class=""dashboardMenuButton js-dashboard-menu-button""><span class=""icon icon--open""> <svg class=""icon__menu"" width=""512px"" height=""512px""> <use xlink:href=""#menu""></use> </svg> </span><span class=""icon icon--close""> <svg class=""icon__close"" width=""17px"" height=""17px""> <use"); WriteLiteral(@" xlink:href=""#close""></use> </svg> </span> </div> </div> </div> </div> </div> <div class=""content__inner""> <div class=""box box--infoBlock box--black""> <div class=""box__inner""> <div class=""infoBlock infoBlock--about""> <div class=""dashboardBlock__sidebar js-customScroll""> <div class=""dashboardBlock__nav""> <div class=""dashboardBlock__nav-item""><a class=""dashboardBlock__nav-link"" draggable=""true"" ondragstart=""return dashboardDragStart(event)"" href=""flyerDashboard.html""><span class=""dashboardBlock__nav-text"">Dashboard</span></a> </div> "); WriteLiteral(@" <div class=""dashboardBlock__nav-item""><a class=""dashboardBlock__nav-link"" draggable=""true"" ondragstart=""return dashboardDragStart(event)"" href=""profileFlyerDashboard.html""><span class=""dashboardBlock__nav-icon""> <svg class=""icon__user2"" width=""16px"" height=""16px""> <use xlink:href=""#user2""></use> </svg> </span><span class=""dashboardBlock__nav-text"">Profile</span></a> </div> <div class=""dashboardBlock__nav-item""><a class=""dashboardBlock__nav-link"" draggable=""true"" ondragstart=""return dashboardDragStart(event)"" href=""bookingListFlyerDashboard.html""><span class=""dashboardBlock__nav-icon""> <svg class=""icon__ticket"" width=""23px"" height=""23px""> <use xlink:href=""#ticket""></use> </svg> </span><span class=""dashboardBlock__nav-text"">Booking list</span></a> </div> "); WriteLiteral(@" <div class=""dashboardBlock__nav-item""><a class=""dashboardBlock__nav-link"" draggable=""true"" ondragstart=""return dashboardDragStart(event)"" href=""flightsFlyerDashboard.html""><span class=""dashboardBlock__nav-icon""> <svg class=""icon__distance"" width=""19px"" height=""19px""> <use xlink:href=""#distance""></use> </svg> </span><span class=""dashboardBlock__nav-text"">Flights<br><i>upcoming and history</i></span></a> </div> <div class=""dashboardBlock__nav-item""><a class=""dashboardBlock__nav-link"" draggable=""true"" ondragstart=""return dashboardDragStart(event)"" href=""settingsFlyerDashboard.html""><span class=""dashboardBlock__nav-icon""> <svg class=""icon__locked"" width=""17px"" height=""17px""> <use xlink:href=""#locked""></use> </svg> </span><span class=""dashboardBlock__nav-text"">Settings & security</span></a> "); WriteLiteral(@" </div> <div class=""dashboardBlock__nav-item""><a class=""dashboardBlock__nav-link"" draggable=""true"" ondragstart=""return dashboardDragStart(event)"" href=""passIdFlyerDashboard.html""><span class=""dashboardBlock__nav-icon""> <svg class=""icon__card"" width=""19px"" height=""19px""> <use xlink:href=""#card""></use> </svg> </span><span class=""dashboardBlock__nav-text"">Passenger identification</span></a> </div> <div class=""dashboardBlock__nav-item""><a class=""dashboardBlock__nav-link"" draggable=""true"" ondragstart=""return dashboardDragStart(event)"" href=""flyRewardsFlyerDashboard.html""><span class=""dashboardBlock__nav-icon""> <svg class=""icon__giftbox"" width=""18px"" height=""18px""> <use xlink:href=""#giftbox""></use> </svg> </span><span class=""dashboardBlock__nav-t"); WriteLiteral(@"ext"">FLY<b>Rewards</b></span></a> </div> <div class=""dashboardBlock__nav-item""><a class=""dashboardBlock__nav-link"" draggable=""true"" ondragstart=""return dashboardDragStart(event)"" href=""paymentFlyerDashboard.html""><span class=""dashboardBlock__nav-icon""> <svg class=""icon__wallet"" width=""18px"" height=""18px""> <use xlink:href=""#wallet""></use> </svg> </span><span class=""dashboardBlock__nav-text"">Payment information</span></a> </div> <div class=""dashboardBlock__nav-item""><a class=""dashboardBlock__nav-link"" draggable=""true"" ondragstart=""return dashboardDragStart(event)"" href=""alertsFlyerDashboard.html""><span class=""dashboardBlock__nav-icon""> <svg class=""icon__alarm"" width=""17px"" height=""17px""> <use xlink:href=""#alarm""></use> </svg> </span"); WriteLiteral(@"><span class=""dashboardBlock__nav-text"">Route alerts</span></a> </div> <div class=""dashboardBlock__nav-item""><a class=""dashboardBlock__nav-link"" draggable=""true"" ondragstart=""return dashboardDragStart(event)"" href=""messagesFlyerDashboard.html""><span class=""dashboardBlock__nav-icon""> <svg class=""icon__message"" width=""25px"" height=""25px""> <use xlink:href=""#message""></use> </svg> </span><span class=""dashboardBlock__nav-text"">Messages</span></a> </div> <div class=""dashboardBlock__nav-item""><a class=""dashboardBlock__nav-link"" draggable=""true"" ondragstart=""return dashboardDragStart(event)"" href=""requestsFlyerDashboard.html""><span class=""dashboardBlock__nav-icon""> <svg class=""icon__discuss"" width=""17px"" height=""17px""> <use xlink:href=""#discuss""></use> "); WriteLiteral(@" </svg> </span><span class=""dashboardBlock__nav-text"">Requests</span></a> </div> <div class=""dashboardBlock__nav-item""><a class=""dashboardBlock__nav-link"" draggable=""true"" ondragstart=""return dashboardDragStart(event)"" href=""auctionsFlyerDashboard.html""><span class=""dashboardBlock__nav-icon""> <svg class=""icon__auction"" width=""16px"" height=""16px""> <use xlink:href=""#auction""></use> </svg> </span><span class=""dashboardBlock__nav-text"">Auctions bids</span></a> </div> <div class=""dashboardBlock__nav-item""><a class=""dashboardBlock__nav-link"" draggable=""true"" ondragstart=""return dashboardDragStart(event)"" href=""seatsFlyerDashboard.html""><span class=""dashboardBlock__nav-icon""> <svg class=""icon__ticket"" width=""23px"" height=""23px""> <use xlink:href="); WriteLiteral(@"""#ticket""></use> </svg> </span><span class=""dashboardBlock__nav-text"">Sell seats</span></a> </div> </div> </div> <div class=""aboutInfo js-customScroll""> <div class=""aboutInfo__section""> <div class=""aboutInfo__title"">About us</div> <div class=""aboutInfo__content""> <div class=""aboutInfo__content-img""> <img src=""/img/general/logo.png"" alt=""logo""> </div> <div class=""aboutInfo__content-text js-acc-item-mobile""> <div class=""aboutInfo__content-text-preview js-a"); WriteLiteral(@"cc-preview-mobile""> <article> <p><b>FLYJETS (FLY I Corporation) is a New York State Benefit Corporation with the goal of providing access to aviation worldwide.</b> Our primary mission is to connect Flyers and Aircraft Providers.</p> <p>The FLYJETS system is an aviation marketplace, mapping engine and travel planning system. At its core, FLYJETS functions as a marketplace for things that move: the marketplace is an automated, end-to-end solution for charter aircraft and flights. FLYJETS also functions as a full-service, IATA-certified travel agency.</p> </article> </div> <div class=""aboutInfo__content-text-ful"); WriteLiteral(@"l js-acc-content-mobile""> <article> <p><b>FLYJETS (FLY I Corporation) is a New York State Benefit Corporation with the goal of providing access to aviation worldwide.</b> </p> <p>The FLYJETS system is an aviation marketplace, mapping engine and travel planning system. At its core, FLYJETS functions as a marketplace for things that move: the marketplace is an automated, end-to-end solution for charter aircraft and flights. FLYJETS also functions as a full-service, IATA-certified travel agency.</p> <p>As a benefit corporation, FLYJETS is committed to <b>doing well by doing good</b>, with all corporate duties and responsibilities directed to both shareh"); WriteLiteral(@"olders and stakeholders.</p> <p>In keeping with its mission, FLYJETS has established its FLYGreen Energy Initiative, whereby with each flight booking, FLYJETS offers additional FLYRewards - over and above the amount ordinarily granted with each flight - to those users who elect to offset a part of their trip with carbon offsets, and/or fly with some amount of Sustainable Aviation Fuel (SAF), pending availability.</p> <p>FLYJETS has also established The FLY Foundation, a non-profit with the mission of supporting aviation education, advancement in aviation and radio communication technology, and safe and sustainable flight.</p> <p>We are looking forward to working together with you!</p> "); WriteLiteral(@" </article> </div> <div class=""aboutInfo__content-link aboutInfo__content-link--mobile js-acc-title-mobile"" data-text=""hide about us"">read more</div><a class=""aboutInfo__content-link aboutInfo__content-link--desktop js-popup"" href=""#aboutPopup"" data-mod=""white-popup out-close"">read more</a> </div> </div> </div> <div class=""aboutInfo__section""> <div class=""aboutInfo__title"">Team</div> <div class=""aboutInfo__subtitle"">Click for bios</div> <div class=""aboutInfo__team""> <div class=""aboutInfo__team-item js-acc-item-mob"); WriteLiteral(@"ile js-popup js-popup--desktop"" href=""#JessicaFisherBio"" data-mod=""white-popup out-close""> <div class=""aboutInfo__team-avatar"" style=""background-image:url('/img/assets/infoBlock/about/Jessica.jpg')""> <div class=""aboutInfo__team-avatar-back""><span class=""text"">More</span> </div> </div> <div class=""aboutInfo__team-discription""> <div class=""aboutInfo__team-name"">Jessica Fisher</div> <div class=""aboutInfo__team-position"">Founder and Chief Executive Officer</div> <div class=""aboutInfo__team-bio js-acc-content-mobile""> "); WriteLiteral(@"<article> <p>Jessica Fisher is the Founder and Chief Executive Officer of FLYJETS. She is a lifetime aviation enthusiast and began training as a student pilot in 2012.</p> <p>Fisher is also a principal at Monroe Capital, where she focuses on impact investments. Previously, Jessica worked as an associate producer in CNBC’s Strategic Programming and Development division, as an analyst at MBF Asset Management, as an analyst at Goldman Sachs in the U.S. Equities Sales division and as an M.B.A summer intern at the Robin Hood Foundation.</p> <p>Jessica holds an M.B.A. from Columbia Business School, where the idea for FLYJETS was born as her Introduction to Venturing course project in the summer of 2012. She graduated cum laude with "); WriteLiteral(@" a B.A. in Economics from the University of Pennsylvania in 2008.</p> <p>Jessica participated as an Engineering Fellow in the Web Development Immersive program at General Assembly in the spring of 2017.</p> <p>Jessica began her private pilot studies and flight lessons at Danny Waizman Flight School in the spring of 2012, and completed her first solo flight in the spring of 2014.</p> <p>Jessica is also an avid runner, a tennis player, and an information and space enthusiast.</p> </article> </div> <div class=""aboutInfo__team-link aboutInfo__team-link--mobile js-acc-title-mobile"" data-text=""hide biography"""); WriteLiteral(@">read more</div> </div> </div> <div class=""aboutInfo__team-item js-acc-item-mobile js-popup js-popup--desktop"" href=""#BrianCarrollBio"" data-mod=""white-popup out-close""> <div class=""aboutInfo__team-avatar"" style=""background-image:url('/img/assets/infoBlock/about/Brian.jpg')""> <div class=""aboutInfo__team-avatar-back""><span class=""text"">More</span> </div> </div> <div class=""aboutInfo__team-discription""> <div class=""aboutInfo__team-name"">Brian Carroll</div> <div class=""aboutInfo__team-"); WriteLiteral(@"position"">Chief Technology Officer</div> <div class=""aboutInfo__team-bio js-acc-content-mobile""> <article> <p>Brian Carroll is the Chief Technology Officer of FLYJETS. A former instructional associate at General Assembly, Brian developed a passion for development upon teaching himself to code in 2017, while he was working in the Environmental Management division of construction management firm LiRo Engineers. </p> <p>In 2016, Brian received his B.A. in Philosophy with a minor in Sociology from The College of Saint Rose. He enrolled in the Web Development Immersive Program at General Assembly in 2018; shortly after, he began teaching the same course. </p> <p>Brian's preferred technology stack language"); WriteLiteral(@"s include HTML5, CSS3, JavaScript, React, Ruby, Python, C# and ASP.net.</p> </article> </div> <div class=""aboutInfo__team-link aboutInfo__team-link--mobile js-acc-title-mobile"" data-text=""hide biography"">read more</div> </div> </div> <div class=""aboutInfo__team-item js-acc-item-mobile js-popup js-popup--desktop"" href=""#MarinaButovaBio"" data-mod=""white-popup out-close""> <div class=""aboutInfo__team-avatar"" style=""background-image:url('/img/assets/infoBlock/about/Marina.jpg')""> <div class=""aboutInfo__team-avatar-back""><span class=""text"">More</span> "); WriteLiteral(@" </div> </div> <div class=""aboutInfo__team-discription""> <div class=""aboutInfo__team-name"">Marina Butova</div> <div class=""aboutInfo__team-position"">Lead Front-End Developer</div> <div class=""aboutInfo__team-bio js-acc-content-mobile""> <article> <p>Marina Butova is the Lead Front-End Developer at FLYJETS.</p> <p>Previously, Butova worked as a front-end developer at SAMEDIA web design studio.</p> <p>Marina earned her Bachelor's degree from Rostov State Economic Univer"); WriteLiteral(@"sity (RINH), Rostov-na-Donu, in 2015 with concentrations in both Computer Technology and Information Security and Applied Mathematics and Informatics.</p> <p>Marina speaks both Russian and English, in addition to: JavaScript, Vue, Ajax, jQuery, CSS3 and HTML5, among others!</p> <p>Marina's additional interests include cycling, draw portraits, rock climbing, snowboarding.</p> </article> </div> <div class=""aboutInfo__team-link aboutInfo__team-link--mobile js-acc-title-mobile"" data-text=""hide biography"">read more</div> </div> </div> "); WriteLiteral(@" <div class=""aboutInfo__team-item js-acc-item-mobile js-popup js-popup--desktop"" href=""#YanaUgluntsBio"" data-mod=""white-popup out-close""> <div class=""aboutInfo__team-avatar"" style=""background-image:url('/img/assets/infoBlock/about/Yana.jpg')""> <div class=""aboutInfo__team-avatar-back""><span class=""text"">More</span> </div> </div> <div class=""aboutInfo__team-discription""> <div class=""aboutInfo__team-name"">Yana Uglunts</div> <div class=""aboutInfo__team-position"">Art and Creative Director</div> <div class=""aboutInfo__team-bio js-acc-content-mo"); WriteLiteral(@"bile""> <article> <p>Yana Uglunts is the Art and Creative Director at FLYJETS. Yana also collaborates as an independent contractor with a variety of web studios, helping to develop unique and beautiful user interfaces and user experiences.</p> <p>Previously, Uglunts held the position of senior user interface and user experience designer at SAMEDIA web design studio. She has also worked as a web designer in various studios including WEBANT and FIRECODE.</p> <p>In 2017, Yana received her Bachelor's degree and a Diploma with Distinction from Southern Federal University with a direction of innovative technologies. In 2013, she "); WriteLiteral(@"graduated from Lyceum 14 in Stavropol with a Diploma with Distinction and a direction in physics and mathematics.</p> <p>Yana has spent time studying web design independently, performing extensive research of user and consumer marketplaces and identifying problems and solutions associated with websites and mobile applications. Her goal is to continue to translate business language into design language.</p> <p>Yana speaks both Russian and English. She is also fluent in Figma, Adobe Photoshop, Adobe After Effects and Adobe Illustrator.</p> <p>Yana's additional interests include sports, nutrition, psychology and marketing.</p> "); WriteLiteral(@" </article> </div> <div class=""aboutInfo__team-link aboutInfo__team-link--mobile js-acc-title-mobile"" data-text=""hide biography"">read more</div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div class=""messageCenter js-message-center""> <div class=""stub""><span class=""stub__icon""> <svg class=""icon__rotate-phone"" width=""392px"" height=""392px""> <use xlink:href=""#rotate-phone""></use> </svg> </span><span class=""stub__text"">Please rotate your phone to be vertical<"); WriteLiteral(@"/span> </div> <div class=""messageCenter__bg js-message-center-close""></div> <div class=""messageCenter__header""><span class=""text"">Message Center</span><span class=""icon js-message-center-close""> <svg class=""icon__close"" width=""17px"" height=""17px""> <use xlink:href=""#close""></use> </svg> </span> </div> <div class=""messageCenter__inner""> <div class=""messageCenter__chat js-customScroll"" data-outside> <div class=""messageCenter__chat-item messageCenter__chat-item--inbox""> <div class=""messageCenter__chat-header""> <div class=""messageCenter__chat-avatar"" style=""background-image:url('/img/assets/dashboardBlock/tabs/world.png')""></div> <div class=""messageCenter__chat-c"); WriteLiteral(@"aption""> <div class=""messageCenter__chat-name"">Message center</div> <div class=""messageCenter__chat-time"">3:30 PM</div> </div> </div> <div class=""messageCenter__chat-content""> <div class=""messageCenter__chat-text"">Welcome to FLYJETS! The messaging feature will be coming soon!</div> </div> </div> "); EndContext(); BeginContext(35477, 131, true); WriteLiteral(" </div>\r\n <div class=\"messageCenter__form\">\r\n "); EndContext(); BeginContext(35608, 1131, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "94abb3d13410f77b4203913bc80f318dd438ce8445512", async() => { BeginContext(35761, 971, true); WriteLiteral(@" <label class=""form__label form__label--text""> <div class=""form__field-wrapper""> <textarea class=""form__field"" type=""textarea"" name=""message"" placeholder=""Write a message..."" autocomplete=""off"" required></textarea> </div> </label> <div class=""form__label form__label--button""> <button class=""form__button"" type=""submit""> <svg class=""icon__send-button"" width=""27px"" height=""27px""> <use xlink:href=""#send-button""></use> </svg> </button> </div> "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Method = (string)__tagHelperAttribute_2.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_5); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(36739, 13880, true); WriteLiteral(@" </div> </div> </div> <div class=""box box--footer""> <div class=""box__inner""> <div class=""footer""> <div class=""footer__social""> <div class=""social""> <a class=""social__item"" href=""#""> <svg class=""icon__inst"" width=""31px"" height=""31px""> <use xlink:href=""#inst""></use> </svg> </a> <a class=""social__item"" href=""#""> <svg class=""icon__tw"" width=""31px"" height=""31px""> <use xlink:href=""#tw""></use> </svg> "); WriteLiteral(@" </a> <a class=""social__item"" href=""#""> <svg class=""icon__fb"" width=""31px"" height=""31px""> <use xlink:href=""#fb""></use> </svg> </a> </div><a class=""footer__link"" href=""startScreenLogIn.html"">FlyJets</a> </div> <div class=""footer__nav""> <div class=""nav""> <div class=""nav__item""><a class=""nav__link"" href=""/app/main"">FlyJets</a> </div> <div class=""nav__item nav__item--active""><a class=""nav__link"" href=""/app/About"">About us</a> </div> "); WriteLiteral(@" <div class=""nav__item""><a class=""nav__link"" href=""#"">Contact</a> </div> <div class=""nav__item""><a class=""nav__link"" href=""/app/Disclaimer"">Disclaimer</a> </div> <div class=""nav__item""><a class=""nav__link"" href=""/app/Privacy"">Privacy policy</a> </div> <div class=""nav__item""><a class=""nav__link"" href=""/app/Terms"">Terms and conditions</a> </div> </div> </div> <div class=""footer__message""> <div class=""messageCenterButton js-message-center-btn""> <div class=""messageCenterButton-icon""> <svg class=""icon__"); WriteLiteral(@"mail-footer"" width=""18px"" height=""18px""> <use xlink:href=""#mail-footer""></use> </svg> </div> <div class=""messageCenterButton-text"">Message center</div> </div> </div> </div> </div> </div> </div> </div> </div> <div class=""aboutPopup"" id=""aboutPopup""> <div class=""aboutPopup__inner""> <div class=""aboutPopup__img""> <img src=""/img/general/logo.png"" alt=""logo""> </div> <div class=""aboutPopup__content js-customScroll"" data-outside=""yes""> <article> <p><b>FLYJETS (FLY I Corporation) is a New York State Benefit Corporation with the"); WriteLiteral(@" goal of providing access to aviation worldwide.</b> </p> <p>The FLYJETS system is an aviation marketplace, mapping engine and travel planning system. At its core, FLYJETS functions as a marketplace for things that move: the marketplace is an automated, end-to-end solution for charter aircraft and flights. FLYJETS also functions as a full-service, IATA-certified travel agency.</p> <p>As a benefit corporation, FLYJETS is committed to <b>doing well by doing good</b>, with all corporate duties and responsibilities directed to both shareholders and stakeholders.</p> <p>In keeping with its mission, FLYJETS has established its FLYGreen Energy Initiative, whereby with each flight booking, FLYJETS offers additional FLYRewards - over and above the amount ordinarily granted with each flight - to those users who elect to offset a part of their trip with carbon offs"); WriteLiteral(@"ets, and/or fly with some amount of Sustainable Aviation Fuel (SAF), pending availability.</p> <p>FLYJETS has also established The FLY Foundation, a non-profit with the mission of supporting aviation education, advancement in aviation and radio communication technology, and safe and sustainable flight.</p> <p>We are looking forward to working together with you!</p> </article> </div> </div> </div> <div class=""teamBioPopup"" id=""JessicaFisherBio""> <div class=""teamBioPopup__inner""> <div class=""teamBioPopup__avatar""> <div class=""teamBioPopup__avatar-img"" style=""background-image:url('/img/assets/infoBlock/about/Jessica.jpg')""></div> </div> <div class=""teamBioPopup__header""> <div class=""teamBioPopup__name"">Jessica Fisher</div> <div class=""teamBioPopup__position"">Founder and "); WriteLiteral(@"Chief Executive Officer</div> <div class=""teamBioPopup__wherefrom"">New York, USA</div> </div> <div class=""teamBioPopup__content js-customScroll"" data-outside=""yes""> <article> <p>Jessica Fisher is the Founder and Chief Executive Officer of FLYJETS. She is a lifetime aviation enthusiast and began training as a student pilot in 2012.</p> <p>Fisher is also a principal at Monroe Capital, where she focuses on impact investments. Previously, Jessica worked as an associate producer in CNBC’s Strategic Programming and Development division, as an analyst at MBF Asset Management, as an analyst at Goldman Sachs in the U.S. Equities Sales division and as an M.B.A summer intern at the Robin Hood Foundation.</p> <p>Jessica holds an M.B.A. from Columbia Business School, where the idea for FLYJETS was born as her Introduction to Venturing course pro"); WriteLiteral(@"ject in the summer of 2012. She graduated cum laude with a B.A. in Economics from the University of Pennsylvania in 2008.</p> <p>Jessica participated as an Engineering Fellow in the Web Development Immersive program at General Assembly in the spring of 2017.</p> <p>Jessica began her private pilot studies and flight lessons at Danny Waizman Flight School in the spring of 2012, and completed her first solo flight in the spring of 2014.</p> <p>Jessica is also an avid runner, a tennis player, and an information and space enthusiast.</p> </article> </div> </div> </div> <div class=""teamBioPopup"" id=""BrianCarrollBio""> <div class=""teamBioPopup__inner""> <div class=""teamBioPopup__avatar""> <div class=""teamBioPopup__avatar-img"" style=""background-image:url('/img/assets/infoBlock/about/Brian.jpg')""></di"); WriteLiteral(@"v> </div> <div class=""teamBioPopup__header""> <div class=""teamBioPopup__name"">Brian Carroll</div> <div class=""teamBioPopup__position"">Chief Technology Officer</div> <div class=""teamBioPopup__wherefrom"">New York, USA</div> </div> <div class=""teamBioPopup__content js-customScroll"" data-outside=""yes""> <article> <p>Brian Carroll is the Chief Technology Officer at FLYJETS.</p> <p>A former instructional associate at General Assembly, Brian developed a passion for development upon teaching himself to code in 2017, while he was working in the Environmental division of construction management firm LiRo Engineers. </p> <p>In 2016, Brian received his B.A. in Philosophy with a minor in Sociology from The College of Saint Rose. He enrolled in the Web Development Immersive Program at General Assembly"); WriteLiteral(@" in 2018; shortly after, he began teaching the same course. </p> <p>Brian's preferred technology stack languages include HTML5, CSS3, JavaScript, React, Ruby, Python, C# and ASP.net. </p> </article> </div> </div> </div> <div class=""teamBioPopup"" id=""MarinaButovaBio""> <div class=""teamBioPopup__inner""> <div class=""teamBioPopup__avatar""> <div class=""teamBioPopup__avatar-img"" style=""background-image:url('/img/assets/infoBlock/about/Marina.jpg')""></div> </div> <div class=""teamBioPopup__header""> <div class=""teamBioPopup__name"">Marina Butova</div> <div class=""teamBioPopup__position"">Lead Front-End Developer</div> <div class=""teamBioPopup__wherefrom"">Rostov-on-Don, Russia</div> </div> <div class=""teamBioPopup__content js-customScroll"" data-outsid"); WriteLiteral(@"e=""yes""> <article> <p>Marina Butova is the Lead Front-End Developer at FLYJETS.</p> <p>Previously, Butova worked as a front-end developer at SAMEDIA web design studio.</p> <p>Marina earned her Bachelor's degree from Rostov State Economic University (RINH), Rostov-na-Donu, in 2015 with concentrations in both Computer Technology and Information Security and Applied Mathematics and Informatics.</p> <p>Marina speaks both Russian and English, in addition to: JavaScript, Vue, Ajax, jQuery, CSS3 and HTML5, among others!</p> <p>Marina's additional interests include cycling, draw portraits, rock climbing, snowboarding.</p> </article> </div> </div> </div> <div class=""teamBioPopup"" id=""YanaUgluntsBio""> <div class=""teamBioPopup__inner""> <div class=""teamBioPopup__avatar""> "); WriteLiteral(@" <div class=""teamBioPopup__avatar-img"" style=""background-image:url('/img/assets/infoBlock/about/Yana.jpg')""></div> </div> <div class=""teamBioPopup__header""> <div class=""teamBioPopup__name"">Yana Uglunts</div> <div class=""teamBioPopup__position"">Art and Creative Director</div> <div class=""teamBioPopup__wherefrom"">Rostov-on-Don, Russia</div> </div> <div class=""teamBioPopup__content js-customScroll"" data-outside=""yes""> <article> <p>Yana Uglunts is the Art and Creative Director at FLYJETS. Yana also collaborates as an independent contractor with a variety of web studios, helping to develop unique and beautiful user interfaces and user experiences.</p> <p>Previously, Uglunts held the position of senior user interface and user experience designer at SAMEDIA web design studio. She has also worked as a web de"); WriteLiteral(@"signer in various studios including WEBANT and FIRECODE.</p> <p>In 2017, Yana received her Bachelor's degree and a Diploma with Distinction from Southern Federal University with a direction of innovative technologies. In 2013, she graduated from Lyceum 14 in Stavropol with a Diploma with Distinction and a direction in physics and mathematics.</p> <p>Yana has spent time studying web design independently, performing extensive research of user and consumer marketplaces and identifying problems and solutions associated with websites and mobile applications. Her goal is to continue to translate business language into design language.</p> <p>Yana speaks both Russian and English. She is also fluent in Figma, Adobe Photoshop, Adobe After Effects and Adobe Illustrator.</p> <p>Yana's additional interests include sports, nutrition, psychology and marketing.</p> "); WriteLiteral(@" </article> </div> </div> </div> <div class=""formPopup"" id=""loginPopup""> <div class=""formPopup__inner""> <div class=""formPopup__left""> <div class=""formPopup__decor""></div> </div> <div class=""formPopup__right""> <div class=""formPopup__subtitle"">lets go!</div> <div class=""formPopup__title"">Log in</div> <div class=""formPopup__form""> "); EndContext(); BeginContext(50619, 2321, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "94abb3d13410f77b4203913bc80f318dd438ce8463367", async() => { BeginContext(50774, 2159, true); WriteLiteral(@" <div class=""spinner""> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> </div> <label class=""form__label form__label--text""> <div class=""form__caption"">Email</div> <div class=""form__field-wrapper""> <input class=""form__field"" type=""email"" autocomplete=""off"" name=""email"" placeholder=""Email address"" required> </div>"); WriteLiteral(@" </label> <label class=""form__label form__label--text""> <div class=""form__caption-wrapper""> <div class=""form__caption"">Password</div><a class=""form__link form__link--desktop js-popup"" href=""#forgotPasswordPopup"">Forgot?</a> </div> <div class=""form__field-wrapper""> <input class=""form__field"" type=""password"" autocomplete=""off"" name=""password"" placeholder=""Enter your password"" required> </div><a class=""form__link form__link--mobile js-popup"" href=""#forgotPasswordPopup"">Forgot?</a> </label> <div class=""form__label form__label--button""> <button class=""form__button"" type=""submit""><span class=""text"">Log in</span> </button><a class=""for"); WriteLiteral("m__link js-popup\" href=\"#signUpPopup\">Sign up</a>\r\n </div>\r\n "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_7); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Method = (string)__tagHelperAttribute_2.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_8); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_9); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_10); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(52940, 901, true); WriteLiteral(@" </div> </div> </div> </div> <div class=""formPopup"" id=""forgotPasswordPopup""> <div class=""formPopup__inner""> <div class=""formPopup__left""><a class=""formPopup__back js-popup"" href=""#loginPopup""><span class=""icon""> <svg class=""icon__left-arrow"" width=""24px"" height=""24px""> <use xlink:href=""#left-arrow""></use> </svg> </span><span class=""text"">Back to Log in</span></a> <div class=""formPopup__text"">New password we will send you an email</div> <div class=""formPopup__text"">Check mail</div> </div> <div class=""formPopup__right""> <div class=""formPopup__title"">Forgot password</div> <div class=""formPopup__form""> "); EndContext(); BeginContext(53841, 1820, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "94abb3d13410f77b4203913bc80f318dd438ce8468888", async() => { BeginContext(54009, 1645, true); WriteLiteral(@" <div class=""spinner""> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> </div> <label class=""form__label form__label--text""> <div class=""form__caption"">Email me</div> <div class=""form__field-wrapper""> <input class=""form__field"" type=""email"" name=""email"" autocomplete=""off"" placeholder=""Email address"" required> </d"); WriteLiteral(@"iv> </label> <div class=""formPopup__text-wr""> <div class=""formPopup__text"">New password we will send you an email</div> <div class=""formPopup__text"">Check mail</div> </div> <div class=""form__label form__label--button""> <button class=""form__button"" type=""submit""><span class=""text"">Send password</span> </button> </div> "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_11); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Method = (string)__tagHelperAttribute_2.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_12); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_13); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(55661, 1225, true); WriteLiteral(@" </div> </div> </div> </div> <div class=""formPopup formPopup--signUp"" id=""signUpPopup""> <div class=""formPopup__inner""> <div class=""formPopup__left""> <div class=""formPopup__decor""></div> </div> <div class=""formPopup__right js-tabBox""> <div class=""formPopup__header""> <div class=""formPopup__title-wr""> <div class=""formPopup__subtitle"">Hello!</div> <div class=""formPopup__title"">Sign&nbsp;up</div> </div> <div class=""formPopup__tabNav""> <div class=""formPopup__tabNav-item js-tabNavItem"" data-id=""flyer"">Flyer</div> <div class=""formPopup__tabNav-item js-tabNavItem"" data-id=""aircraftProvider"">Aircraft provider</div> </div> "); WriteLiteral(" </div>\r\n <div class=\"formPopup__tabContent\">\r\n <div class=\"formPopup__tabContent-item js-tabContentItem\" data-id=\"flyer\">\r\n "); EndContext(); BeginContext(56886, 4544, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "94abb3d13410f77b4203913bc80f318dd438ce8474198", async() => { BeginContext(57044, 4379, true); WriteLiteral(@" <div class=""spinner""> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> </div> <div class=""form__labelGroup""> <label class=""form__label form__label--text""> <div class=""form__caption"">Name</div> <div class=""form__field-wrapper""> <input class="""); WriteLiteral(@"form__field"" type=""text"" name=""firstname"" autocomplete=""off"" placeholder=""First"" required> </div> </label> <label class=""form__label form__label--text""> <div class=""form__field-wrapper""> <input class=""form__field"" type=""text"" name=""middlename"" autocomplete=""off"" placeholder=""Middle"" required> </div> </label> <label class=""form__label form__label--text""> <div class=""form__field-wrapper""> <input class=""form__field"" type=""text"" name=""lastname"" autocomplete=""off"" placeholder=""Last"" required> </div> </label> "); WriteLiteral(@" <label class=""form__label form__label--text""> <div class=""form__caption"">Email</div> <div class=""form__field-wrapper""> <input class=""form__field"" type=""email"" name=""email"" autocomplete=""off"" placeholder=""Email address"" required> </div> </label> <label class=""form__label form__label--text phone""> <div class=""form__caption"">Phone</div> <div class=""form__field-wrapper""> <input class=""form__field"" type=""text"" name=""phone"" autocomplete=""off"" placeholder=""+1 (___) ___-__-__"" required> </div> </label> <label class=""form__label form__label-"); WriteLiteral(@"-text""> <div class=""form__caption"">Password</div> <div class=""form__field-wrapper""> <input class=""form__field"" type=""password"" name=""password"" autocomplete=""off"" placeholder=""Enter your password"" required> </div> </label> <label class=""form__label form__label--text""> <div class=""form__caption"">Confirm password</div> <div class=""form__field-wrapper""> <input class=""form__field"" type=""password"" name=""confirmPassword"" autocomplete=""off"" placeholder=""Enter your password"" required> </div> </label> </div> <div cl"); WriteLiteral(@"ass=""form__label form__label--button""> <button class=""form__button form__button"" type=""submit""><span class=""text"">Complete</span> </button> </div> "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_14); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Method = (string)__tagHelperAttribute_2.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_15); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_16); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_17); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(61430, 173, true); WriteLiteral("\r\n </div>\r\n <div class=\"formPopup__tabContent-item js-tabContentItem\" data-id=\"aircraftProvider\">\r\n "); EndContext(); BeginContext(61603, 5335, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "94abb3d13410f77b4203913bc80f318dd438ce8481330", async() => { BeginContext(61783, 5148, true); WriteLiteral(@" <div class=""spinner""> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> <div class=""spinner__item""></div> </div> <div class=""form__labelGroup""> <label class=""form__label form__label--text""> <div class=""form__caption"">Name</div> <div class=""form__field-wrapper""> <input class="""); WriteLiteral(@"form__field"" type=""text"" name=""firstname"" autocomplete=""off"" placeholder=""First"" required> </div> </label> <label class=""form__label form__label--text""> <div class=""form__field-wrapper""> <input class=""form__field"" type=""text"" name=""middlename"" autocomplete=""off"" placeholder=""Middle"" required> </div> </label> <label class=""form__label form__label--text""> <div class=""form__field-wrapper""> <input class=""form__field"" type=""text"" name=""lastname"" autocomplete=""off"" placeholder=""Last"" required> </div> </label> "); WriteLiteral(@" <label class=""form__label form__label--text""> <div class=""form__caption"">Company</div> <div class=""form__field-wrapper""> <input class=""form__field"" type=""text"" name=""company"" autocomplete=""off"" placeholder=""Company name"" required> </div> </label> <label class=""form__label form__label--text phone""> <div class=""form__caption"">Phone</div> <div class=""form__field-wrapper""> <input class=""form__field"" type=""text"" name=""phone"" autocomplete=""off"" placeholder=""+1 (___) ___-__-__"" required> </div> </label> <label class=""form__label form__labe"); WriteLiteral(@"l--text""> <div class=""form__caption"">Email</div> <div class=""form__field-wrapper""> <input class=""form__field"" type=""email"" name=""email"" autocomplete=""off"" placeholder=""Email address"" required> </div> </label> <label class=""form__label form__label--text""> <div class=""form__caption"">Confirm password</div> <div class=""form__field-wrapper""> <input class=""form__field"" type=""password"" name=""confirmPassword"" autocomplete=""off"" placeholder=""Enter your password"" required> </div> </label> <label class=""form__label form__label--text""> "); WriteLiteral(@" <div class=""form__caption"">Password</div> <div class=""form__field-wrapper""> <input class=""form__field"" type=""password"" name=""password"" autocomplete=""off"" placeholder=""Enter your password"" required> </div> </label> <label class=""form__label form__label--text""> <div class=""form__info"">Message that FlyJets are checking providers. Here you can specify how many days it will take</div> </label> </div> <div class=""form__label form__label--button""> <button class=""form__button"" type=""submit""><span class=""text"">Complete</span> </button> </div> "); WriteLiteral(" "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_14); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Method = (string)__tagHelperAttribute_2.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_15); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_18); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_19); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(66938, 4689, true); WriteLiteral(@" </div> </div> </div> </div> </div> <script> var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || ""An unknown browser""; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || ""an unknown version""; this.OS = this.searchString(this.dataOS) || ""an unknown OS""; }, searchString: function (data) { for (var i=0; i<data.length; i++) { var dataString = data[i].string; var dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) != -1) return data[i].identity; } else if (d"); WriteLiteral(@"ataProp) return data[i].identity; } }, searchVersion: function (dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == -1) return; return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); }, dataBrowser: [{ string: navigator.userAgent, subString: ""Chrome"", identity: ""Chrome"" },{ string: navigator.userAgent, subString: ""OmniWeb"", versionSearch: ""OmniWeb/"", identity: ""OmniWeb"" },{ string: navigator.vendor, subString: ""Apple"", identity: ""Safari"", versionSearch: ""Version"" },{ prop: window.opera, identity: ""Opera"", versionSearch: ""Version"" "); WriteLiteral(@" },{ string: navigator.vendor, subString: ""iCab"", identity: ""iCab"" },{ string: navigator.vendor, subString: ""KDE"", identity: ""Konqueror"" },{ string: navigator.userAgent, subString: ""Firefox"", identity: ""Firefox"" },{ string: navigator.vendor, subString: ""Camino"", identity: ""Camino"" },{ /* For Newer Netscapes (6+) */ string: navigator.userAgent, subString: ""Netscape"", identity: ""Netscape"" },{ string: navigator.userAgent, subString: ""MSIE"", identity: ""Internet Explorer"", versionSearch: ""MSIE"" },{ string: navigator.userAgent, subString: ""Gecko"", identity: ""Mozilla"", "); WriteLiteral(@"versionSearch: ""rv"" },{ /* For Older Netscapes (4-) */ string: navigator.userAgent, subString: ""Mozilla"", identity: ""Netscape"", versionSearch: ""Mozilla"" }], dataOS : [{ string: navigator.platform, subString: ""Win"", identity: ""Windows"" },{ string: navigator.platform, subString: ""Mac"", identity: ""Mac"" },{ string: navigator.userAgent, subString: ""iPhone"", identity: ""iPhone/iPod"" },{ string: navigator.platform, subString: ""Linux"", identity: ""Linux"" }] }; BrowserDetect.init(); //- console.log(BrowserDetect.browser); //- console.log(BrowserDetect.version); //- console.log(inner"); WriteLiteral(@"HTML=BrowserDetect.OS); if (BrowserDetect.browser == 'Safari') document.getElementsByTagName('html')[0].classList.add('safari'); if (BrowserDetect.browser == 'Firefox') document.getElementsByTagName('html')[0].classList.add('firefox'); var isEdge = /edge\/(\d+(\.\d+)?)/i.test(navigator.userAgent); if (isEdge) document.getElementsByTagName('html')[0].classList.add('edge'); </script> <script src=""/js/separate-js/jquery-3.2.1.min.js""></script> <script src=""/js/main.js""></script> "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(71634, 11, true); WriteLiteral("\r\n\r\n</html>"); EndContext(); } #pragma warning restore 1998 [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<dynamic> Html { get; private set; } } } #pragma warning restore 1591
79.382255
377
0.519079
[ "Unlicense", "MIT" ]
expert-git/flyjets-web
obj/Debug/netcoreapp2.2/Razor/Views/App/About.cshtml.g.cs
95,739
C#
using ArkBot.Ark; using ArkBot.Configuration.Model; using ArkBot.Database; using ArkBot.Database.Model; using ArkBot.Extensions; using ArkBot.Helpers; using Discord; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace ArkBot.Voting.Handlers { public class BanVoteHandler : IVoteHandler<BanVote> { private Database.Model.BanVote _vote; public BanVoteHandler(Database.Model.Vote vote) { _vote = vote as BanVote; } public static async Task<InitiateVoteResult> Initiate(IMessageChannel channel, ArkServerContext context, IConfig config, IEfDatabaseContext db, ulong userId, string identifier, DateTime when, string reason, string targetRaw, int durationInHours) { var _rId = new Regex(@"^\s*(id|(steam\s*id))\s*\:\s*(?<id>\d+)\s*$", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.ExplicitCapture); var m = _rId.Match(targetRaw); var targets = m.Success ? context.Players.Where(x => x.Id.ToString().Equals(m.Groups["id"].Value) || x.SteamId.Equals(m.Groups["id"].Value)).ToArray() : context.Players.Where(x => (x.Name != null && x.Name.Equals(targetRaw, StringComparison.OrdinalIgnoreCase)) || (x.Name != null && x.Name.Equals(targetRaw, StringComparison.OrdinalIgnoreCase))).ToArray(); if (targets.Length == 0) { await channel.SendMessageDirectedAt(userId, $"could not find a player with that name (maybe they have not been saved yet?). Try using their steam id instead."); return null; } if (targets.Length > 1) { await channel.SendMessageDirectedAt(userId, $"there are more than one player with that name. Try using their steam id instead."); return null; } var target = targets.First(); var steamId = long.Parse(target.SteamId); var votes = db.Votes.OfType<BanVote>().Where(x => x.SteamId == steamId).ToArray(); if (votes.Any(x => x.BannedUntil.HasValue && x.BannedUntil.Value > when)) { await channel.SendMessageDirectedAt(userId, $"this player is already banned."); return null; } var unvotes = db.Votes.OfType<UnbanVote>().Where(x => x.SteamId == steamId).ToArray(); if (votes.Any(x => x.Result == VoteResult.Undecided) || unvotes.Any(x => x.Result == VoteResult.Undecided)) { await channel.SendMessageDirectedAt(userId, $"there is already an active vote to ban/unban this player."); return null; } //proceed to initiate vote var vote = new BanVote { SteamId = steamId, PlayerName = target.Name, CharacterName = target.Name, TribeName = target.TribeId.HasValue ? context.Tribes?.FirstOrDefault(x => x.Id == target.TribeId)?.Name : null, //target.TribeName, Reason = reason, Started = when, #if DEBUG Finished = when.AddSeconds(10), #else Finished = when.AddMinutes(5), #endif DurationInHours = durationInHours, Result = VoteResult.Undecided, ServerKey = context.Config.Key, Identifier = identifier }; return new InitiateVoteResult { MessageInitiator = $"the vote to ban this player have been initiated. Announcement will be made.", MessageAnnouncement = $@"**A vote to ban {vote.FullName}{(vote.DurationInHours <= (24 * 90) ? $" for {vote.DurationInHours}h" : "")} due to ""{reason}"" have been started. Please cast your vote in the next five minutes!**{Environment.NewLine}To vote use the command: **!vote {identifier} yes**/**no**", MessageRcon = $@"A vote to ban {vote.FullName}{(vote.DurationInHours <= (24 * 90) ? $" for {vote.DurationInHours}h" : "")} due to ""{reason}"" have been started. Please cast your vote on Discord using !vote {identifier} yes/no in the next five minutes!", Vote = vote }; } public VoteStateChangeResult VoteIsAboutToExpire() { if (_vote == null) return null; return new VoteStateChangeResult { MessageAnnouncement = $@"**Vote to ban {_vote.FullName} have one minute remaining...**", MessageRcon = $@"Vote to ban {_vote.FullName} have one minute remaining..." }; } public async Task<VoteStateChangeResult> VoteFinished(ArkServerContext serverContext, IConfig config, IConstants constants, IEfDatabaseContext db) { if (_vote == null) return null; if (_vote.Result == VoteResult.Passed) { _vote.BannedUntil = _vote.Started.AddHours(_vote.DurationInHours); await serverContext.Steam.SendRconCommand($"banplayer {_vote.SteamId}"); } return new VoteStateChangeResult { MessageAnnouncement = $@"{(_vote.Result == VoteResult.Passed ? ":white_check_mark:" : ":x:")} **Vote to ban {_vote.FullName} have {(_vote.Result == VoteResult.Vetoed ? "been vetoed" : _vote.Result == VoteResult.Passed ? "passed" : "failed")}**", MessageRcon = $@"Vote to ban {_vote.FullName} have {(_vote.Result == VoteResult.Vetoed ? "been vetoed" : _vote.Result == VoteResult.Passed ? "passed" : "failed")}." }; } } }
48.285714
318
0.600766
[ "MIT" ]
Betrail/ArkBot
ArkBot/Voting/Handlers/BanVoteHandler.cs
5,748
C#
using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel.DataAnnotations; using System.Globalization; using System.Reflection; using System.Runtime.Serialization; using System.Web.Http; using System.Web.Http.Description; using System.Xml.Serialization; using Newtonsoft.Json; namespace EBunnyShop.API.Areas.HelpPage.ModelDescriptions { /// <summary> /// Generates model descriptions for given types. /// </summary> public class ModelDescriptionGenerator { // Modify this to support more data annotation attributes. private readonly IDictionary<Type, Func<object, string>> AnnotationTextGenerator = new Dictionary<Type, Func<object, string>> { { typeof(RequiredAttribute), a => "Required" }, { typeof(RangeAttribute), a => { RangeAttribute range = (RangeAttribute)a; return String.Format(CultureInfo.CurrentCulture, "Range: inclusive between {0} and {1}", range.Minimum, range.Maximum); } }, { typeof(MaxLengthAttribute), a => { MaxLengthAttribute maxLength = (MaxLengthAttribute)a; return String.Format(CultureInfo.CurrentCulture, "Max length: {0}", maxLength.Length); } }, { typeof(MinLengthAttribute), a => { MinLengthAttribute minLength = (MinLengthAttribute)a; return String.Format(CultureInfo.CurrentCulture, "Min length: {0}", minLength.Length); } }, { typeof(StringLengthAttribute), a => { StringLengthAttribute strLength = (StringLengthAttribute)a; return String.Format(CultureInfo.CurrentCulture, "String length: inclusive between {0} and {1}", strLength.MinimumLength, strLength.MaximumLength); } }, { typeof(DataTypeAttribute), a => { DataTypeAttribute dataType = (DataTypeAttribute)a; return String.Format(CultureInfo.CurrentCulture, "Data type: {0}", dataType.CustomDataType ?? dataType.DataType.ToString()); } }, { typeof(RegularExpressionAttribute), a => { RegularExpressionAttribute regularExpression = (RegularExpressionAttribute)a; return String.Format(CultureInfo.CurrentCulture, "Matching regular expression pattern: {0}", regularExpression.Pattern); } }, }; // Modify this to add more default documentations. private readonly IDictionary<Type, string> DefaultTypeDocumentation = new Dictionary<Type, string> { { typeof(Int16), "integer" }, { typeof(Int32), "integer" }, { typeof(Int64), "integer" }, { typeof(UInt16), "unsigned integer" }, { typeof(UInt32), "unsigned integer" }, { typeof(UInt64), "unsigned integer" }, { typeof(Byte), "byte" }, { typeof(Char), "character" }, { typeof(SByte), "signed byte" }, { typeof(Uri), "URI" }, { typeof(Single), "decimal number" }, { typeof(Double), "decimal number" }, { typeof(Decimal), "decimal number" }, { typeof(String), "string" }, { typeof(Guid), "globally unique identifier" }, { typeof(TimeSpan), "time interval" }, { typeof(DateTime), "date" }, { typeof(DateTimeOffset), "date" }, { typeof(Boolean), "boolean" }, }; private Lazy<IModelDocumentationProvider> _documentationProvider; public ModelDescriptionGenerator(HttpConfiguration config) { if (config == null) { throw new ArgumentNullException("config"); } _documentationProvider = new Lazy<IModelDocumentationProvider>(() => config.Services.GetDocumentationProvider() as IModelDocumentationProvider); GeneratedModels = new Dictionary<string, ModelDescription>(StringComparer.OrdinalIgnoreCase); } public Dictionary<string, ModelDescription> GeneratedModels { get; private set; } private IModelDocumentationProvider DocumentationProvider { get { return _documentationProvider.Value; } } public ModelDescription GetOrCreateModelDescription(Type modelType) { if (modelType == null) { throw new ArgumentNullException("modelType"); } Type underlyingType = Nullable.GetUnderlyingType(modelType); if (underlyingType != null) { modelType = underlyingType; } ModelDescription modelDescription; string modelName = ModelNameHelper.GetModelName(modelType); if (GeneratedModels.TryGetValue(modelName, out modelDescription)) { if (modelType != modelDescription.ModelType) { throw new InvalidOperationException( String.Format( CultureInfo.CurrentCulture, "A model description could not be created. Duplicate model name '{0}' was found for types '{1}' and '{2}'. " + "Use the [ModelName] attribute to change the model name for at least one of the types so that it has a unique name.", modelName, modelDescription.ModelType.FullName, modelType.FullName)); } return modelDescription; } if (DefaultTypeDocumentation.ContainsKey(modelType)) { return GenerateSimpleTypeModelDescription(modelType); } if (modelType.IsEnum) { return GenerateEnumTypeModelDescription(modelType); } if (modelType.IsGenericType) { Type[] genericArguments = modelType.GetGenericArguments(); if (genericArguments.Length == 1) { Type enumerableType = typeof(IEnumerable<>).MakeGenericType(genericArguments); if (enumerableType.IsAssignableFrom(modelType)) { return GenerateCollectionModelDescription(modelType, genericArguments[0]); } } if (genericArguments.Length == 2) { Type dictionaryType = typeof(IDictionary<,>).MakeGenericType(genericArguments); if (dictionaryType.IsAssignableFrom(modelType)) { return GenerateDictionaryModelDescription(modelType, genericArguments[0], genericArguments[1]); } Type keyValuePairType = typeof(KeyValuePair<,>).MakeGenericType(genericArguments); if (keyValuePairType.IsAssignableFrom(modelType)) { return GenerateKeyValuePairModelDescription(modelType, genericArguments[0], genericArguments[1]); } } } if (modelType.IsArray) { Type elementType = modelType.GetElementType(); return GenerateCollectionModelDescription(modelType, elementType); } if (modelType == typeof(NameValueCollection)) { return GenerateDictionaryModelDescription(modelType, typeof(string), typeof(string)); } if (typeof(IDictionary).IsAssignableFrom(modelType)) { return GenerateDictionaryModelDescription(modelType, typeof(object), typeof(object)); } if (typeof(IEnumerable).IsAssignableFrom(modelType)) { return GenerateCollectionModelDescription(modelType, typeof(object)); } return GenerateComplexTypeModelDescription(modelType); } // Change this to provide different name for the member. private static string GetMemberName(MemberInfo member, bool hasDataContractAttribute) { JsonPropertyAttribute jsonProperty = member.GetCustomAttribute<JsonPropertyAttribute>(); if (jsonProperty != null && !String.IsNullOrEmpty(jsonProperty.PropertyName)) { return jsonProperty.PropertyName; } if (hasDataContractAttribute) { DataMemberAttribute dataMember = member.GetCustomAttribute<DataMemberAttribute>(); if (dataMember != null && !String.IsNullOrEmpty(dataMember.Name)) { return dataMember.Name; } } return member.Name; } private static bool ShouldDisplayMember(MemberInfo member, bool hasDataContractAttribute) { JsonIgnoreAttribute jsonIgnore = member.GetCustomAttribute<JsonIgnoreAttribute>(); XmlIgnoreAttribute xmlIgnore = member.GetCustomAttribute<XmlIgnoreAttribute>(); IgnoreDataMemberAttribute ignoreDataMember = member.GetCustomAttribute<IgnoreDataMemberAttribute>(); NonSerializedAttribute nonSerialized = member.GetCustomAttribute<NonSerializedAttribute>(); ApiExplorerSettingsAttribute apiExplorerSetting = member.GetCustomAttribute<ApiExplorerSettingsAttribute>(); bool hasMemberAttribute = member.DeclaringType.IsEnum ? member.GetCustomAttribute<EnumMemberAttribute>() != null : member.GetCustomAttribute<DataMemberAttribute>() != null; // Display member only if all the followings are true: // no JsonIgnoreAttribute // no XmlIgnoreAttribute // no IgnoreDataMemberAttribute // no NonSerializedAttribute // no ApiExplorerSettingsAttribute with IgnoreApi set to true // no DataContractAttribute without DataMemberAttribute or EnumMemberAttribute return jsonIgnore == null && xmlIgnore == null && ignoreDataMember == null && nonSerialized == null && (apiExplorerSetting == null || !apiExplorerSetting.IgnoreApi) && (!hasDataContractAttribute || hasMemberAttribute); } private string CreateDefaultDocumentation(Type type) { string documentation; if (DefaultTypeDocumentation.TryGetValue(type, out documentation)) { return documentation; } if (DocumentationProvider != null) { documentation = DocumentationProvider.GetDocumentation(type); } return documentation; } private void GenerateAnnotations(MemberInfo property, ParameterDescription propertyModel) { List<ParameterAnnotation> annotations = new List<ParameterAnnotation>(); IEnumerable<Attribute> attributes = property.GetCustomAttributes(); foreach (Attribute attribute in attributes) { Func<object, string> textGenerator; if (AnnotationTextGenerator.TryGetValue(attribute.GetType(), out textGenerator)) { annotations.Add( new ParameterAnnotation { AnnotationAttribute = attribute, Documentation = textGenerator(attribute) }); } } // Rearrange the annotations annotations.Sort((x, y) => { // Special-case RequiredAttribute so that it shows up on top if (x.AnnotationAttribute is RequiredAttribute) { return -1; } if (y.AnnotationAttribute is RequiredAttribute) { return 1; } // Sort the rest based on alphabetic order of the documentation return String.Compare(x.Documentation, y.Documentation, StringComparison.OrdinalIgnoreCase); }); foreach (ParameterAnnotation annotation in annotations) { propertyModel.Annotations.Add(annotation); } } private CollectionModelDescription GenerateCollectionModelDescription(Type modelType, Type elementType) { ModelDescription collectionModelDescription = GetOrCreateModelDescription(elementType); if (collectionModelDescription != null) { return new CollectionModelDescription { Name = ModelNameHelper.GetModelName(modelType), ModelType = modelType, ElementDescription = collectionModelDescription }; } return null; } private ModelDescription GenerateComplexTypeModelDescription(Type modelType) { ComplexTypeModelDescription complexModelDescription = new ComplexTypeModelDescription { Name = ModelNameHelper.GetModelName(modelType), ModelType = modelType, Documentation = CreateDefaultDocumentation(modelType) }; GeneratedModels.Add(complexModelDescription.Name, complexModelDescription); bool hasDataContractAttribute = modelType.GetCustomAttribute<DataContractAttribute>() != null; PropertyInfo[] properties = modelType.GetProperties(BindingFlags.Public | BindingFlags.Instance); foreach (PropertyInfo property in properties) { if (ShouldDisplayMember(property, hasDataContractAttribute)) { ParameterDescription propertyModel = new ParameterDescription { Name = GetMemberName(property, hasDataContractAttribute) }; if (DocumentationProvider != null) { propertyModel.Documentation = DocumentationProvider.GetDocumentation(property); } GenerateAnnotations(property, propertyModel); complexModelDescription.Properties.Add(propertyModel); propertyModel.TypeDescription = GetOrCreateModelDescription(property.PropertyType); } } FieldInfo[] fields = modelType.GetFields(BindingFlags.Public | BindingFlags.Instance); foreach (FieldInfo field in fields) { if (ShouldDisplayMember(field, hasDataContractAttribute)) { ParameterDescription propertyModel = new ParameterDescription { Name = GetMemberName(field, hasDataContractAttribute) }; if (DocumentationProvider != null) { propertyModel.Documentation = DocumentationProvider.GetDocumentation(field); } complexModelDescription.Properties.Add(propertyModel); propertyModel.TypeDescription = GetOrCreateModelDescription(field.FieldType); } } return complexModelDescription; } private DictionaryModelDescription GenerateDictionaryModelDescription(Type modelType, Type keyType, Type valueType) { ModelDescription keyModelDescription = GetOrCreateModelDescription(keyType); ModelDescription valueModelDescription = GetOrCreateModelDescription(valueType); return new DictionaryModelDescription { Name = ModelNameHelper.GetModelName(modelType), ModelType = modelType, KeyModelDescription = keyModelDescription, ValueModelDescription = valueModelDescription }; } private EnumTypeModelDescription GenerateEnumTypeModelDescription(Type modelType) { EnumTypeModelDescription enumDescription = new EnumTypeModelDescription { Name = ModelNameHelper.GetModelName(modelType), ModelType = modelType, Documentation = CreateDefaultDocumentation(modelType) }; bool hasDataContractAttribute = modelType.GetCustomAttribute<DataContractAttribute>() != null; foreach (FieldInfo field in modelType.GetFields(BindingFlags.Public | BindingFlags.Static)) { if (ShouldDisplayMember(field, hasDataContractAttribute)) { EnumValueDescription enumValue = new EnumValueDescription { Name = field.Name, Value = field.GetRawConstantValue().ToString() }; if (DocumentationProvider != null) { enumValue.Documentation = DocumentationProvider.GetDocumentation(field); } enumDescription.Values.Add(enumValue); } } GeneratedModels.Add(enumDescription.Name, enumDescription); return enumDescription; } private KeyValuePairModelDescription GenerateKeyValuePairModelDescription(Type modelType, Type keyType, Type valueType) { ModelDescription keyModelDescription = GetOrCreateModelDescription(keyType); ModelDescription valueModelDescription = GetOrCreateModelDescription(valueType); return new KeyValuePairModelDescription { Name = ModelNameHelper.GetModelName(modelType), ModelType = modelType, KeyModelDescription = keyModelDescription, ValueModelDescription = valueModelDescription }; } private ModelDescription GenerateSimpleTypeModelDescription(Type modelType) { SimpleTypeModelDescription simpleModelDescription = new SimpleTypeModelDescription { Name = ModelNameHelper.GetModelName(modelType), ModelType = modelType, Documentation = CreateDefaultDocumentation(modelType) }; GeneratedModels.Add(simpleModelDescription.Name, simpleModelDescription); return simpleModelDescription; } } }
42.321508
167
0.579033
[ "MIT" ]
pthiep/EBunnyShop
EBunnyShop.API/Areas/HelpPage/ModelDescriptions/ModelDescriptionGenerator.cs
19,087
C#
namespace FakeWebcomic.Storage.Models { public class ComicPage : AEntity { public string PageTitle { get; set; } public int PageNumber { get; set; } public byte[] Image { get; set; } public long ComicBookId { get; set; } public ComicBook ComicBook { get; set; } } }
21.4
48
0.595016
[ "MIT" ]
KevinTouch/Fake_Webcomic
Storage/FakeWebcomic.Storage/Models/ComicPage.cs
321
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using CimpleDeclaration.Models; namespace CimpleDeclaration.Interfaces { public interface IAttachmentRepository : IRepository<Attachment> { IEnumerable<Declaration> GetAllPdfAttachments(int numberOfRecords); } }
23.642857
75
0.78852
[ "MIT" ]
ehtesam4m/SimpleAPIDotNetCoreEF
CimpleDeclaration/Interfaces/IAttachmentRepository.cs
333
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Immutable; using Microsoft.CodeAnalysis.Completion.Providers; using Microsoft.CodeAnalysis.CSharp.Syntax; namespace Microsoft.CodeAnalysis.CSharp.Completion.Providers { internal sealed class InternalsVisibleToCompletionProvider : AbstractInternalsVisibleToCompletionProvider { protected override IImmutableList<SyntaxNode> GetAssemblyScopedAttributeSyntaxNodesOfDocument(SyntaxNode documentRoot) { var builder = default(ImmutableList<SyntaxNode>.Builder); if (documentRoot is CompilationUnitSyntax compilationUnit) { foreach (var attributeList in compilationUnit.AttributeLists) { // For most documents the compilationUnit.AttributeLists should be empty. // Therefore we delay initialization of the builder builder ??= ImmutableList.CreateBuilder<SyntaxNode>(); builder.AddRange(attributeList.Attributes); } } return builder == null ? ImmutableList<SyntaxNode>.Empty : builder.ToImmutable(); } protected override SyntaxNode GetConstructorArgumentOfInternalsVisibleToAttribute(SyntaxNode internalsVisibleToAttribute) { var arguments = ((AttributeSyntax)internalsVisibleToAttribute).ArgumentList.Arguments; // InternalsVisibleTo has only one constructor argument. // https://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.internalsvisibletoattribute.internalsvisibletoattribute(v=vs.110).aspx // We can assume that this is the assemblyName argument. return arguments.Count > 0 ? arguments[0].Expression : null; } } }
45.333333
158
0.678922
[ "Apache-2.0" ]
Sliptory/roslyn
src/Features/CSharp/Portable/Completion/CompletionProviders/InternalsVisibleToCompletionProvider.cs
2,042
C#
using System.Collections.Generic; using System.Linq; using Abp.Configuration; using Abp.Dependency; using Abp.Extensions; using Microsoft.AspNetCore.Mvc.Razor; using Afonsoft.Ranking.Configuration; namespace Afonsoft.Ranking.Web.Startup { /// <summary> /// That class is generated so that new areas that use default layout can use default components. /// </summary> public class RazorViewLocationExpander : IViewLocationExpander { public RazorViewLocationExpander() { } public void PopulateValues(ViewLocationExpanderContext context) { } public IEnumerable<string> ExpandViewLocations(ViewLocationExpanderContext context, IEnumerable<string> viewLocations) { var currentThemeName = IocManager.Instance.Resolve<ISettingManager>() .GetSettingValue(AppSettings.UiManagement.Theme); var locations = viewLocations.ToList(); //{0} is like "Components/{componentname}/{viewname}" locations.Add("~/Areas/App/Views/Shared/{0}.cshtml"); locations.Add("~/Areas/App/Views/Shared/Themes/" + currentThemeName.ToPascalCase() + "/{0}.cshtml"); return locations; } } }
31.243902
101
0.654957
[ "MIT" ]
afonsoft/Ranking
src/Afonsoft.Ranking.Web.Mvc/Startup/RazorViewLocationExpander.cs
1,283
C#
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using ProductOwnerSimGame.Logic; using ProductOwnerSimGame.Models.Permissions; using System.Threading.Tasks; using ProductOwnerSimGame.Dtos.GameView; namespace ProductOwnerSimGame.Controllers { [Route("api/[controller]")] [ApiController] public class GameViewController : ControllerBase { private IGameViewLogic _GameStateLogic; public GameViewController(IGameViewLogic gameStateLogic) { _GameStateLogic = gameStateLogic; } // GET: api/GameView/5 [HttpGet("{gameId}")] [Authorize(Policy = IntegratedPermissions.PermissionNameForUserAccess)] public async Task<ActionResult<GameView>> GetCurrentGameViewAsync(string gameId) { return Ok(await _GameStateLogic.GetCurrentGameViewAsync(gameId, HttpContext.User.Identity.Name).ConfigureAwait(false)); } } }
31.733333
131
0.723739
[ "MIT" ]
MD-V/ProductOwnerSimGame
Controllers/GameViewController.cs
954
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace EmuConsole { public class ConsoleCommand { private readonly Func<Task> _action; private readonly Func<bool> _canExecute; public ConsoleCommand(string key, string description, Action action, Func<bool> requires = null) : this(key, description, ConvertAction(action), requires) { } public ConsoleCommand(string key, string description, Func<Task> action, Func<bool> requires = null) : this(new[] { key }, description, action, requires) { } public ConsoleCommand(string key, string description, ConsoleProcess process, Func<bool> requires = null) : this(key, description, process, null, requires) { } public ConsoleCommand(IEnumerable<string> keys, string description, ConsoleProcess process, Func<bool> requires = null) : this(keys, description, process, null, requires) { } public ConsoleCommand(string key, string description, ConsoleProcess process, ConsoleOptions options, Func<bool> requires = null) : this(new[] { key }, description, process, options, requires) { } public ConsoleCommand(IEnumerable<string> keys, string description, ConsoleProcess process, ConsoleOptions options, Func<bool> requires = null) : this(keys, description, ConvertProcess(process, options), requires) { } public ConsoleCommand(IEnumerable<string> keys, string description, Action action, Func<bool> requires = null) : this(keys, description, ConvertAction(action), requires) { } public ConsoleCommand(IEnumerable<string> keys, string description, Func<Task> action, Func<bool> requires = null) { if (keys?.Any() != true) throw new ArgumentException("Must provide keys for the command"); if (keys.Any(x => x == null)) throw new ArgumentException("Null value key provided"); if (string.IsNullOrWhiteSpace(description)) throw new ArgumentException("Command description must be populated"); if (action == null) throw new ArgumentException("Console action is invalid"); Keys = keys.OrderBy(x => x.Length).ThenBy(x => x).Distinct().ToArray(); Description = description; _action = action; _canExecute = requires ?? (() => true); } public string Description { get; } public string[] Keys { get; } public bool CanExecute() => _canExecute(); public Task Execute() => _action(); private static Func<Task> ConvertAction(Action action) { if (action == null) return null; return () => { action?.Invoke(); return Task.CompletedTask; }; } private static Func<Task> ConvertProcess(ConsoleProcess process, ConsoleOptions options) { return process == null ? (Func<Task>)null : (() => process.RunAsync(options)); } } }
34.663158
151
0.595809
[ "MIT" ]
hjbwallace/EmuConsole
src/EmuConsole/ConsoleCommand.cs
3,295
C#
using AngleSharp.Html.Parser; using DisCatSharp.Entities; using MikuSharp.Entities; using Newtonsoft.Json; using NYoutubeDL; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; namespace MikuSharp.Utilities { public class Bilibili { public static async Task<MemoryStream> GetBilibili(string s, DiscordMessage msg) { try { await msg.ModifyAsync("Downloading video(this may take up to 5 min)"); var youtubeDl = new YoutubeDL(@"youtube-dl"); youtubeDl.Options.FilesystemOptions.Output = $@"{s}.mp4"; youtubeDl.Options.PostProcessingOptions.ExtractAudio = true; youtubeDl.Options.PostProcessingOptions.FfmpegLocation = @"ffmpeg"; youtubeDl.Options.PostProcessingOptions.AudioFormat = NYoutubeDL.Helpers.Enums.AudioFormat.mp3; youtubeDl.Options.PostProcessingOptions.AddMetadata = true; youtubeDl.Options.PostProcessingOptions.KeepVideo = false; youtubeDl.StandardOutputEvent += (e,f) => { Console.WriteLine(f); }; youtubeDl.StandardErrorEvent += (e, f) => { Console.WriteLine(f); }; youtubeDl.VideoUrl = "https://www.bilibili.com/video/" + s; await youtubeDl.DownloadAsync(); var ms = new MemoryStream(); if (File.Exists($@"{s}.mp3")) { var song = File.Open($@"{s}.mp3", FileMode.Open); await song.CopyToAsync(ms); ms.Position = 0; song.Close(); File.Delete($@"{s}.mp3"); } return ms; } catch (Exception ex) { Console.WriteLine(ex); return null; } } } }
34.650794
111
0.551535
[ "MIT" ]
Lulalaby/MikuSharp
MikuSharp/Utilities/Bilibili.cs
2,185
C#
using System; using System.Configuration; using System.Linq; using System.Threading.Tasks; using Moq; using NEStore.MongoDb.UndispatchedStrategies; namespace NEStore.MongoDb.Tests { public class MongoDbEventStoreFixture<T> : IDisposable { public string BucketName { get; } public MongoDbEventStore<T> EventStore { get; } public MongoDbBucket<T> Bucket { get; } public Mock<IDispatcher<T>> Dispatcher { get; } public MongoDbEventStoreFixture(int? seed = null, int dispatchDelay = 50, string bucketName = null) { BucketName = bucketName ?? RandomString((seed ?? 0) + (int)DateTime.Now.Ticks, 10); EventStore = CreateTarget(); EventStore.UndispatchedStrategy = new UndispatchAllStrategy<T>() { // Reduce the autodispatch wait time to have a short test AutoDispatchWaitTime = TimeSpan.FromMilliseconds(2000), AutoDispatchCheckInterval = TimeSpan.FromMilliseconds(100) }; Dispatcher = new Mock<IDispatcher<T>>(); Dispatcher.Setup(p => p.DispatchAsync(It.IsAny<string>(), It.IsAny<CommitData<T>>())) .Returns<string, CommitData<T>>((b, c) => Task.Delay(dispatchDelay)); EventStore.RegisterDispatchers(Dispatcher.Object); Bucket = EventStore.Bucket(BucketName) as MongoDbBucket<T>; } public void Dispose() { CleanUp(); } public void CleanUp() { EventStore.DeleteBucketAsync(BucketName).Wait(); } private static MongoDbEventStore<T> CreateTarget() { var cns = ConfigurationManager.ConnectionStrings["mongoTest"].ConnectionString; return new MongoDbEventStore<T>(cns); } private static string RandomString(int seed, int length) { const string chars = "abcdefghijklmnopqrstuvwxyz"; var random = new Random(seed); return new string(Enumerable.Repeat(chars, length) .Select(s => s[random.Next(s.Length)]).ToArray()); } } }
29.063492
101
0.722556
[ "MIT" ]
deltatre-webplu/NEStore
NEStore.MongoDb.Tests/MongoDbEventStoreFixture.cs
1,833
C#
/* * Marketplace * * API Cloud Loyalty LTM - Webpremios * * OpenAPI spec version: 1.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ using System; using System.Linq; using System.IO; using System.Text; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Runtime.Serialization; using Newtonsoft.Json; namespace IO.Swagger.Models { /// <summary> /// /// </summary> [DataContract] public partial class ProductDetail : IEquatable<ProductDetail> { /// <summary> /// Initializes a new instance of the <see cref="ProductDetail" /> class. /// </summary> /// <param name="Id">Identificador do produto.</param> /// <param name="OriginalId">Identificador do produto no parceiro.</param> /// <param name="Name">Nome do produto.</param> /// <param name="Description">Descrição do produto.</param> /// <param name="Sections">Categorização.</param> /// <param name="Skus">SKUs.</param> /// <param name="Features">Características.</param> /// <param name="Vendor">Vendor.</param> public ProductDetail(string Id = default(string), string OriginalId = default(string), string Name = default(string), string Description = default(string), List<Sections> Sections = default(List<Sections>), List<ProductSKUDetail> Skus = default(List<ProductSKUDetail>), List<Features> Features = default(List<Features>), ProductDetailVendor Vendor = default(ProductDetailVendor)) { this.Id = Id; this.OriginalId = OriginalId; this.Name = Name; this.Description = Description; this.Sections = Sections; this.Skus = Skus; this.Features = Features; this.Vendor = Vendor; } /// <summary> /// Identificador do produto /// </summary> /// <value>Identificador do produto</value> [DataMember(Name="id")] public string Id { get; set; } /// <summary> /// Identificador do produto no parceiro /// </summary> /// <value>Identificador do produto no parceiro</value> [DataMember(Name="originalId")] public string OriginalId { get; set; } /// <summary> /// Nome do produto /// </summary> /// <value>Nome do produto</value> [DataMember(Name="name")] public string Name { get; set; } /// <summary> /// Descrição do produto /// </summary> /// <value>Descrição do produto</value> [DataMember(Name="description")] public string Description { get; set; } /// <summary> /// Categorização /// </summary> /// <value>Categorização</value> [DataMember(Name="sections")] public List<Sections> Sections { get; set; } /// <summary> /// SKUs /// </summary> /// <value>SKUs</value> [DataMember(Name="skus")] public List<ProductSKUDetail> Skus { get; set; } /// <summary> /// Características /// </summary> /// <value>Características</value> [DataMember(Name="features")] public List<Features> Features { get; set; } /// <summary> /// Gets or Sets Vendor /// </summary> [DataMember(Name="vendor")] public ProductDetailVendor Vendor { get; set; } /// <summary> /// Returns the string presentation of the object /// </summary> /// <returns>String presentation of the object</returns> public override string ToString() { var sb = new StringBuilder(); sb.Append("class ProductDetail {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" OriginalId: ").Append(OriginalId).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Description: ").Append(Description).Append("\n"); sb.Append(" Sections: ").Append(Sections).Append("\n"); sb.Append(" Skus: ").Append(Skus).Append("\n"); sb.Append(" Features: ").Append(Features).Append("\n"); sb.Append(" Vendor: ").Append(Vendor).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// <summary> /// Returns the JSON string presentation of the object /// </summary> /// <returns>JSON string presentation of the object</returns> public string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } /// <summary> /// Returns true if objects are equal /// </summary> /// <param name="obj">Object to be compared</param> /// <returns>Boolean</returns> public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; if (obj.GetType() != GetType()) return false; return Equals((ProductDetail)obj); } /// <summary> /// Returns true if ProductDetail instances are equal /// </summary> /// <param name="other">Instance of ProductDetail to be compared</param> /// <returns>Boolean</returns> public bool Equals(ProductDetail other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return ( this.Id == other.Id || this.Id != null && this.Id.Equals(other.Id) ) && ( this.OriginalId == other.OriginalId || this.OriginalId != null && this.OriginalId.Equals(other.OriginalId) ) && ( this.Name == other.Name || this.Name != null && this.Name.Equals(other.Name) ) && ( this.Description == other.Description || this.Description != null && this.Description.Equals(other.Description) ) && ( this.Sections == other.Sections || this.Sections != null && this.Sections.SequenceEqual(other.Sections) ) && ( this.Skus == other.Skus || this.Skus != null && this.Skus.SequenceEqual(other.Skus) ) && ( this.Features == other.Features || this.Features != null && this.Features.SequenceEqual(other.Features) ) && ( this.Vendor == other.Vendor || this.Vendor != null && this.Vendor.Equals(other.Vendor) ); } /// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { int hash = 41; // Suitable nullity checks etc, of course :) if (this.Id != null) hash = hash * 59 + this.Id.GetHashCode(); if (this.OriginalId != null) hash = hash * 59 + this.OriginalId.GetHashCode(); if (this.Name != null) hash = hash * 59 + this.Name.GetHashCode(); if (this.Description != null) hash = hash * 59 + this.Description.GetHashCode(); if (this.Sections != null) hash = hash * 59 + this.Sections.GetHashCode(); if (this.Skus != null) hash = hash * 59 + this.Skus.GetHashCode(); if (this.Features != null) hash = hash * 59 + this.Features.GetHashCode(); if (this.Vendor != null) hash = hash * 59 + this.Vendor.GetHashCode(); return hash; } } #region Operators public static bool operator ==(ProductDetail left, ProductDetail right) { return Equals(left, right); } public static bool operator !=(ProductDetail left, ProductDetail right) { return !Equals(left, right); } #endregion Operators } }
36.052846
387
0.507611
[ "MIT" ]
ltm-arquitetura/webpremios-csharp-sdks
src/IO.Swagger/Models/ProductDetail.cs
8,884
C#
using IdentityUtils.Api.Controllers.Authentication.Services; using IdentityUtils.Api.Models.Authentication; using Microsoft.Extensions.Logging; namespace IdentityUtils.Api.Controllers { public class AuthenticationControllerApi : AuthenticationControllerApiBase<UserProfile> { public AuthenticationControllerApi( IIdentityUtilsAuthService identityUtilsAuthService, ILogger<AuthenticationControllerApi> logger) : base(identityUtilsAuthService, logger) { } } }
34.6
97
0.766859
[ "MIT" ]
intellegens-hr/utils-identity
dotnetcore/IdentityUtils.Api.Controllers.Auth/AuthenticationControllerApi.cs
521
C#
/* * ORY Keto * * Ory Keto is a cloud native access control server providing best-practice patterns (RBAC, ABAC, ACL, AWS IAM Policies, Kubernetes Roles, ...) via REST APIs. * * The version of the OpenAPI document: v0.6.0-alpha.5 * Contact: hi@ory.sh * Generated by: https://github.com/openapitools/openapi-generator.git */ using System; namespace Ory.Keto.Client.Client { /// <summary> /// API Exception /// </summary> public class ApiException : Exception { /// <summary> /// Gets or sets the error code (HTTP status code) /// </summary> /// <value>The error code (HTTP status code).</value> public int ErrorCode { get; set; } /// <summary> /// Gets or sets the error content (body json object) /// </summary> /// <value>The error content (Http response body).</value> public object ErrorContent { get; private set; } /// <summary> /// Gets or sets the HTTP headers /// </summary> /// <value>HTTP headers</value> public Multimap<string, string> Headers { get; private set; } /// <summary> /// Initializes a new instance of the <see cref="ApiException"/> class. /// </summary> public ApiException() { } /// <summary> /// Initializes a new instance of the <see cref="ApiException"/> class. /// </summary> /// <param name="errorCode">HTTP status code.</param> /// <param name="message">Error message.</param> public ApiException(int errorCode, string message) : base(message) { this.ErrorCode = errorCode; } /// <summary> /// Initializes a new instance of the <see cref="ApiException"/> class. /// </summary> /// <param name="errorCode">HTTP status code.</param> /// <param name="message">Error message.</param> /// <param name="errorContent">Error content.</param> /// <param name="headers">HTTP Headers.</param> public ApiException(int errorCode, string message, object errorContent = null, Multimap<string, string> headers = null) : base(message) { this.ErrorCode = errorCode; this.ErrorContent = errorContent; this.Headers = headers; } } }
33.257143
158
0.582904
[ "Apache-2.0" ]
extraymond/sdk
clients/keto/dotnet/src/Ory.Keto.Client/Client/ApiException.cs
2,328
C#
//=================================================================================== // Microsoft patterns & practices // Composite Application Guidance for Windows Presentation Foundation and Silverlight //=================================================================================== // Copyright (c) Microsoft Corporation. All rights reserved. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND // FITNESS FOR A PARTICULAR PURPOSE. //=================================================================================== // The example companies, organizations, products, domain names, // e-mail addresses, logos, people, places, and events depicted // herein are fictitious. No association with any real company, // organization, product, domain name, email address, logo, person, // places, or events is intended or should be inferred. //=================================================================================== using Microsoft.Practices.Prism.Modularity; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Microsoft.Practices.Prism.Tests.Modularity { [TestClass] public class ModuleAttributeFixture { [TestMethod] public void StartupLoadedDefaultsToTrue() { var moduleAttribute = new ModuleAttribute(); Assert.AreEqual(false, moduleAttribute.OnDemand); } [TestMethod] public void CanGetAndSetProperties() { var moduleAttribute = new ModuleAttribute(); moduleAttribute.ModuleName = "Test"; moduleAttribute.OnDemand = true; Assert.AreEqual("Test", moduleAttribute.ModuleName); Assert.AreEqual(true, moduleAttribute.OnDemand); } [TestMethod] public void ModuleDependencyAttributeStoresModuleName() { var moduleDependencyAttribute = new ModuleDependencyAttribute("Test"); Assert.AreEqual("Test", moduleDependencyAttribute.ModuleName); } } }
41.980769
86
0.574897
[ "MIT" ]
cointoss1973/Prism4.1-WPF
PrismLibrary/Desktop/Prism.Tests/Modularity/ModuleAttributeFixture.Desktop.cs
2,183
C#
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="WrongViewModelTypeException.cs" company="Catel development team"> // Copyright (c) 2008 - 2014 Catel development team. All rights reserved. // </copyright> // -------------------------------------------------------------------------------------------------------------------- namespace Catel.MVVM { using System; /// <summary> /// Exception in case that a wrong type is used for a view model. /// </summary> public class WrongViewModelTypeException : Exception { /// <summary> /// Initializes a new instance of the <see cref="WrongViewModelTypeException"/> class. /// </summary> /// <param name="actualType">The actual type.</param> /// <param name="expectedType">The expected type.</param> public WrongViewModelTypeException(Type actualType, Type expectedType) : base(string.Format(ResourceHelper.GetString("WrongViewModelType"), expectedType, actualType)) { ActualType = actualType; ExpectedType = expectedType; } /// <summary> /// Gets the actual type. /// </summary> /// <value>The actual type.</value> public Type ActualType { get; private set; } /// <summary> /// Gets the expected type. /// </summary> /// <value>The expected type.</value> public Type ExpectedType { get; private set; } } }
38.8
120
0.512887
[ "MIT" ]
IvanKupriyanov/Catel
src/Catel.MVVM/Catel.MVVM.Shared/MVVM/Exceptions/WrongViewModelTypeException.cs
1,554
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace NuGetGallery.Authentication { public class AuthenticatedUser { public User User { get; private set; } public Credential CredentialUsed { get; private set; } public AuthenticatedUser(User user, Credential cred) { if (user == null) { throw new ArgumentNullException("user"); } if (cred == null) { throw new ArgumentNullException("cred"); } User = user; CredentialUsed = cred; } } }
22.433333
62
0.534918
[ "ECL-2.0", "Apache-2.0" ]
JetBrains/ReSharperGallery
src/NuGetGallery/Authentication/AuthenticatedUser.cs
675
C#
#pragma checksum "C:\Users\Terry\Downloads\BeautySalon\Web\BeautyBooking.Web\Areas\Identity\Pages\Account\LoginWithRecoveryCode.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "b1c7112e66ece0d953d7175ef030cacdf28cad94" // <auto-generated/> #pragma warning disable 1591 [assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Areas_Identity_Pages_Account_LoginWithRecoveryCode), @"mvc.1.0.razor-page", @"/Areas/Identity/Pages/Account/LoginWithRecoveryCode.cshtml")] namespace AspNetCore { #line hidden using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore #line 1 "C:\Users\Terry\Downloads\BeautySalon\Web\BeautyBooking.Web\Areas\Identity\Pages\_ViewImports.cshtml" using Microsoft.AspNetCore.Identity; #line default #line hidden #nullable disable #nullable restore #line 2 "C:\Users\Terry\Downloads\BeautySalon\Web\BeautyBooking.Web\Areas\Identity\Pages\_ViewImports.cshtml" using BeautyBooking.Web.Areas.Identity; #line default #line hidden #nullable disable #nullable restore #line 3 "C:\Users\Terry\Downloads\BeautySalon\Web\BeautyBooking.Web\Areas\Identity\Pages\_ViewImports.cshtml" using BeautyBooking.Web.Areas.Identity.Pages; #line default #line hidden #nullable disable #nullable restore #line 5 "C:\Users\Terry\Downloads\BeautySalon\Web\BeautyBooking.Web\Areas\Identity\Pages\_ViewImports.cshtml" using BeautyBooking.Data.Models; #line default #line hidden #nullable disable #nullable restore #line 1 "C:\Users\Terry\Downloads\BeautySalon\Web\BeautyBooking.Web\Areas\Identity\Pages\Account\_ViewImports.cshtml" using BeautyBooking.Web.Areas.Identity.Pages.Account; #line default #line hidden #nullable disable [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"b1c7112e66ece0d953d7175ef030cacdf28cad94", @"/Areas/Identity/Pages/Account/LoginWithRecoveryCode.cshtml")] [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"cac1ae637842e6dee8d196303894c7b5a77948fb", @"/Areas/Identity/Pages/_ViewImports.cshtml")] [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"d5345555094acb99427bb46d677d6d4b4761575c", @"/Areas/Identity/Pages/Account/_ViewImports.cshtml")] public class Areas_Identity_Pages_Account_LoginWithRecoveryCode : global::Microsoft.AspNetCore.Mvc.RazorPages.Page { private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("text-danger"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("form-control"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("autocomplete", new global::Microsoft.AspNetCore.Html.HtmlString("off"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_3 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("method", "post", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_4 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("name", "_ValidationScriptsPartial", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0649 private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext __tagHelperExecutionContext; #pragma warning restore 0649 private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner __tagHelperRunner = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner(); #pragma warning disable 0169 private string __tagHelperStringValueBuffer; #pragma warning restore 0169 private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __backed__tagHelperScopeManager = null; private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __tagHelperScopeManager { get { if (__backed__tagHelperScopeManager == null) { __backed__tagHelperScopeManager = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope); } return __backed__tagHelperScopeManager; } } private global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper; private global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper; private global::Microsoft.AspNetCore.Mvc.TagHelpers.ValidationSummaryTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationSummaryTagHelper; private global::Microsoft.AspNetCore.Mvc.TagHelpers.LabelTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper; private global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper; private global::Microsoft.AspNetCore.Mvc.TagHelpers.ValidationMessageTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper; private global::Microsoft.AspNetCore.Mvc.TagHelpers.PartialTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper; #pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 3 "C:\Users\Terry\Downloads\BeautySalon\Web\BeautyBooking.Web\Areas\Identity\Pages\Account\LoginWithRecoveryCode.cshtml" ViewData["Title"] = "Recovery code verification"; #line default #line hidden #nullable disable WriteLiteral("\n<h1>"); #nullable restore #line 7 "C:\Users\Terry\Downloads\BeautySalon\Web\BeautyBooking.Web\Areas\Identity\Pages\Account\LoginWithRecoveryCode.cshtml" Write(ViewData["Title"]); #line default #line hidden #nullable disable WriteLiteral("</h1>\n<hr />\n<p>\n You have requested to log in with a recovery code. This login will not be remembered until you provide\n an authenticator app code at log in or disable 2FA and log in again.\n</p>\n<div class=\"row\">\n <div class=\"col-md-4\">\n "); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "b1c7112e66ece0d953d7175ef030cacdf28cad947485", async() => { WriteLiteral("\n "); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "b1c7112e66ece0d953d7175ef030cacdf28cad947753", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationSummaryTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.ValidationSummaryTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_ValidationSummaryTagHelper); #nullable restore #line 16 "C:\Users\Terry\Downloads\BeautySalon\Web\BeautyBooking.Web\Areas\Identity\Pages\Account\LoginWithRecoveryCode.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationSummaryTagHelper.ValidationSummary = global::Microsoft.AspNetCore.Mvc.Rendering.ValidationSummary.All; #line default #line hidden #nullable disable __tagHelperExecutionContext.AddTagHelperAttribute("asp-validation-summary", __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationSummaryTagHelper.ValidationSummary, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\n <div class=\"form-group\">\n "); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("label", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "b1c7112e66ece0d953d7175ef030cacdf28cad949505", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.LabelTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper); #nullable restore #line 18 "C:\Users\Terry\Downloads\BeautySalon\Web\BeautyBooking.Web\Areas\Identity\Pages\Account\LoginWithRecoveryCode.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Input.RecoveryCode); #line default #line hidden #nullable disable __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\n "); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "b1c7112e66ece0d953d7175ef030cacdf28cad9411059", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper); #nullable restore #line 19 "C:\Users\Terry\Downloads\BeautySalon\Web\BeautyBooking.Web\Areas\Identity\Pages\Account\LoginWithRecoveryCode.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Input.RecoveryCode); #line default #line hidden #nullable disable __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\n "); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("span", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "b1c7112e66ece0d953d7175ef030cacdf28cad9412782", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.ValidationMessageTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper); #nullable restore #line 20 "C:\Users\Terry\Downloads\BeautySalon\Web\BeautyBooking.Web\Areas\Identity\Pages\Account\LoginWithRecoveryCode.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Input.RecoveryCode); #line default #line hidden #nullable disable __tagHelperExecutionContext.AddTagHelperAttribute("asp-validation-for", __Microsoft_AspNetCore_Mvc_TagHelpers_ValidationMessageTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\n </div>\n <button type=\"submit\" class=\"btn btn-primary\">Log in</button>\n "); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Method = (string)__tagHelperAttribute_3.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\n </div>\n</div>\n\n"); DefineSection("Scripts", async() => { WriteLiteral("\n "); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("partial", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "b1c7112e66ece0d953d7175ef030cacdf28cad9415874", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.PartialTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.Name = (string)__tagHelperAttribute_4.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\n"); } ); } #pragma warning restore 1998 [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<LoginWithRecoveryCodeModel> Html { get; private set; } public global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<LoginWithRecoveryCodeModel> ViewData => (global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<LoginWithRecoveryCodeModel>)PageContext?.ViewData; public LoginWithRecoveryCodeModel Model => ViewData.Model; } } #pragma warning restore 1591
72.682731
350
0.757266
[ "MIT" ]
DiePathologie/BeautySalon
Web/BeautyBooking.Web/obj/Debug/netcoreapp3.1/Razor/Areas/Identity/Pages/Account/LoginWithRecoveryCode.cshtml.g.cs
18,098
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 // 제어됩니다. 어셈블리와 관련된 정보를 수정하려면 // 이러한 특성 값을 변경하세요. [assembly: AssemblyTitle("Contacts")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Contacts")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에 // 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면 // 해당 형식에 대해 ComVisible 특성을 true로 설정하세요. [assembly: ComVisible(false)] // 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다. [assembly: Guid("20c56292-d5cd-4d87-b330-4c1da26f1e86")] // 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다. // // 주 버전 // 부 버전 // 빌드 번호 // 수정 버전 // // 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호가 자동으로 // 지정되도록 할 수 있습니다. // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
28.486486
56
0.695446
[ "MIT" ]
totalintelli/Contacts
Contacts/Properties/AssemblyInfo.cs
1,495
C#
using System; using System.Collections.Generic; /// <summary> /// System.Collections.Generic.Dictionary.ValueCollection.Enumerator.Current /// </summary> public class DictionaryValueCollectionEnumeratorCurrent { public static int Main() { DictionaryValueCollectionEnumeratorCurrent dicValCollectEnumCurrent = new DictionaryValueCollectionEnumeratorCurrent(); TestLibrary.TestFramework.BeginTestCase("DictionaryValueCollectionEnumeratorCurrent"); if (dicValCollectEnumCurrent.RunTests()) { TestLibrary.TestFramework.EndTestCase(); TestLibrary.TestFramework.LogInformation("PASS"); return 100; } else { TestLibrary.TestFramework.EndTestCase(); TestLibrary.TestFramework.LogInformation("FAIL"); return 0; } } public bool RunTests() { bool retVal = true; TestLibrary.TestFramework.LogInformation("[Positive]"); retVal = PosTest1() && retVal; retVal = PosTest2() && retVal; return retVal; } #region PositiveTest public bool PosTest1() { bool retVal = true; TestLibrary.TestFramework.BeginScenario("PosTest1:Return the property Current in Dictionary ValueCollection Enumerator 1"); try { Dictionary<string, string>.ValueCollection.Enumerator valEnumer = new Dictionary<string, string>.ValueCollection.Enumerator(); if (valEnumer.Current != null) { TestLibrary.TestFramework.LogError("001", "the ExpectResult is not the ActualResult"); retVal = false; } valEnumer.Dispose(); } catch (Exception e) { TestLibrary.TestFramework.LogError("002", "Unexpect exception:" + e); retVal = false; } return retVal; } public bool PosTest2() { bool retVal = true; TestLibrary.TestFramework.BeginScenario("PosTest2:Return the property Current in Dictionary ValueCollection Enumerator 2"); try { Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add("1", "test1"); Dictionary<string, string>.ValueCollection.Enumerator valEnumer = new Dictionary<string, string>.ValueCollection(dic).GetEnumerator(); while (valEnumer.MoveNext()) { if (valEnumer.Current != "test1") { TestLibrary.TestFramework.LogError("003", "the ExpectResult is not the ActualResult"); retVal = false; } } valEnumer.Dispose(); } catch (Exception e) { TestLibrary.TestFramework.LogError("004", "Unexpect exception:" + e); retVal = false; } return retVal; } #endregion }
35.621951
146
0.600479
[ "MIT" ]
CyberSys/coreclr-mono
tests/src/CoreMangLib/cti/system/collections/generic/dictkeycollenum/dictionaryvaluecollectionenumeratorcurrent.cs
2,921
C#
using Abp.Domain.Uow; using Abp.EntityFrameworkCore; using Abp.MultiTenancy; using Abp.Zero.EntityFrameworkCore; namespace Concise_CMS.EntityFrameworkCore { public class AbpZeroDbMigrator : AbpZeroDbMigrator<Concise_CMSDbContext> { public AbpZeroDbMigrator( IUnitOfWorkManager unitOfWorkManager, IDbPerTenantConnectionStringResolver connectionStringResolver, IDbContextResolver dbContextResolver) : base( unitOfWorkManager, connectionStringResolver, dbContextResolver) { } } }
27.727273
76
0.678689
[ "MIT" ]
xhl592576605/Concise_CMS
src/concise_cms-aspnet-core/src/Concise_CMS.EntityFrameworkCore/EntityFrameworkCore/AbpZeroDbMigrator.cs
610
C#
using System; using System.IO; using NAudio.Wave; namespace NAudioDemo.NetworkChatDemo { class NetworkAudioSender : IDisposable { private readonly INetworkChatCodec codec; private readonly IAudioSender audioSender; private readonly WaveIn waveIn; private AES256 aes; public NetworkAudioSender(INetworkChatCodec codec, int inputDeviceNumber, IAudioSender audioSender, AES256 aes) { this.aes = aes; this.codec = codec; this.audioSender = audioSender; waveIn = new WaveIn(); waveIn.BufferMilliseconds = 50; waveIn.DeviceNumber = inputDeviceNumber; waveIn.WaveFormat = codec.RecordFormat; waveIn.DataAvailable += OnAudioCaptured; waveIn.StartRecording(); } void OnAudioCaptured(object sender, WaveInEventArgs e) { byte[] encoded = codec.Encode(e.Buffer, 0, e.BytesRecorded); File.AppendAllText(@"C:\Users\User\Desktop\NAudio\bytes.txt", ByteArrayToString(encoded)); encoded = aes.ToAes256(encoded); audioSender.Send(encoded); } public static string ByteArrayToString(byte[] ba) { return BitConverter.ToString(ba).Replace("-", ""); } public void Dispose() { waveIn.DataAvailable -= OnAudioCaptured; waveIn.StopRecording(); waveIn.Dispose(); waveIn?.Dispose(); audioSender?.Dispose(); } } }
31.795918
119
0.60077
[ "MIT" ]
sanea010/NAudio
NAudioDemo/NetworkChatDemo/NetworkAudioSender.cs
1,560
C#
using GPdotNet.Core; using GPdotNet.Data; using GPdotNet.MathStuff; using System; using System.Collections.Generic; using System.Drawing; using System.Globalization; using System.Windows.Forms; namespace GPdotNet.Wnd.GUI.Dialogs { public partial class MModelEvaluation : Form { string[] m_Classes; double[] m_yobs = null; double[] m_ypre = null; double[] m_yobst = null; double[] m_ypret = null; public MModelEvaluation() { InitializeComponent(); this.Icon = Extensions.LoadIconFromName("GPdotNet.Wnd.Dll.Images.gpdotnet.ico"); Load += BModelEvaluation_Load; } private int[] convertToIntAray(double[] y) { int[] retVal = new int[y.Length]; for (int i = 0; i < y.Length; i++) { retVal[i] = (int)y[i]; } return retVal; } private void BModelEvaluation_Load(object sender, EventArgs e) { comboBox1.SelectedIndex = 0; // constructConfusionMatric(comboBox1.SelectedIndex < 1); } public void loadClasses(string[] classes) { m_Classes = classes; } public void loadData(double[] y1, double[] ytr, double[] y2, double[] yts) { m_yobs = y1; m_ypre = ytr; m_yobst = y2; m_ypret = yts; } private void constructConfusionMatric(bool isTrainingData) { var y = m_yobs; var yp = m_ypre; if (!isTrainingData) { y = m_yobst; yp = m_ypret; } //add extra point var o = convertToIntAray(y); var p = convertToIntAray(yp); var cm = new ConfusionMatrix(o, p, m_Classes.Length); listView1.Clear(); var colHeader = new ColumnHeader(); colHeader.Text = " "; colHeader.Width = 250; listView1.Columns.Add(colHeader); for (int i = 0; i < m_Classes.Length; i++) { // listView1 colHeader = new ColumnHeader(); colHeader.Text = m_Classes[i]; colHeader.Width = 150; listView1.Columns.Add(colHeader); } //add total column colHeader = new ColumnHeader(); colHeader.Text = "Totals"; colHeader.Width = 150; listView1.Columns.Add(colHeader); // for (int i = 0; i < m_Classes.Length; i++) { var LVI1 = listView1.Items.Add($"Actual\\Predicted"); LVI1.BackColor = SystemColors.ControlDark; LVI1.UseItemStyleForSubItems = false; for (int j = 0; j < m_Classes.Length; j++) { System.Windows.Forms.ListViewItem.ListViewSubItem itm = new ListViewItem.ListViewSubItem(); itm.BackColor = SystemColors.ControlDark; //itm.ForeColor = Color.Red; itm.Text = $"{m_Classes[j]}"; LVI1.SubItems.Add(itm); } //add total System.Windows.Forms.ListViewItem.ListViewSubItem itm1 = new ListViewItem.ListViewSubItem(); itm1.BackColor = SystemColors.ControlDark; itm1.Text = "Totals"; LVI1.SubItems.Add(itm1); } //insert data for (int i = 0; i < m_Classes.Length; i++) { var LVI2 = listView1.Items.Add(m_Classes[i]); LVI2.UseItemStyleForSubItems = false; LVI2.BackColor = SystemColors.ControlDark; //LVI2.ForeColor = Color.Red; int total = 0; for (int j = 0; j < m_Classes.Length; j++) { var itm = new ListViewItem.ListViewSubItem(); //itm.BackColor = SystemColors.ControlLight; itm.Text = $"{cm.Matrix[i][j]}"; total += cm.Matrix[i][j]; LVI2.SubItems.Add(itm); } var itm1 = new ListViewItem.ListViewSubItem(); //itm1.BackColor = SystemColors.ControlDark; itm1.Text = $"{total}"; LVI2.SubItems.Add(itm1); } //insert total row var LVI = listView1.Items.Add("Total"); LVI.UseItemStyleForSubItems = false; LVI.BackColor = SystemColors.ControlDark; for (int i = 0; i < m_Classes.Length; i++) { int total = 0; for (int j = 0; j < m_Classes.Length; j++) total += cm.Matrix[j][i]; var itm = new ListViewItem.ListViewSubItem(); itm.Text = $"{total}"; LVI.SubItems.Add(itm); } //last cell var itm11 = new ListViewItem.ListViewSubItem(); itm11.Text = $"n={yp.Length}"; LVI.SubItems.Add(itm11); setConfusionMatrix(cm, isTrainingData); } private void setConfusionMatrix(ConfusionMatrix cm, bool isTrainingData) { int rowCount = isTrainingData ? m_yobs.Length : m_yobst.Length; ////confusion matrix for MCC txOAccuracy.Text = ConfusionMatrix.OAC(cm.Matrix).ToString("F3"); txAAccuracy.Text = (ConfusionMatrix.AAC(cm.Matrix)).ToString("F3"); txMiPrecision.Text = ConfusionMatrix.MicroPrecision(cm.Matrix).ToString("F3"); txMaPrecision.Text = ConfusionMatrix.MacroPrecision(cm.Matrix).ToString("F3"); txMiRecall.Text = ConfusionMatrix.MicroRecall(cm.Matrix).ToString("F3"); txMaRecall.Text = ConfusionMatrix.MacroRecall(cm.Matrix).ToString("F3"); txHSS.Text =ConfusionMatrix.HSS(cm.Matrix, rowCount).ToString("F3"); txPSS.Text = ConfusionMatrix.PSS(cm.Matrix, rowCount).ToString("F3"); } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox1.SelectedIndex > 0 && m_yobst != null) { constructConfusionMatric(false); } else { constructConfusionMatric(true); } } } }
32.192118
111
0.511094
[ "MIT" ]
bhrnjica/gpdotnet
Net/GPdotNET.Wnd.Dll/Dialogs/MModelEvaluation.cs
6,537
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. * */ using System; using System.Web; using ASC.Projects.Core.Domain; using ASC.Projects.Core.Domain.Reports; using ASC.Web.Projects.Classes; using ASC.Web.Projects.Resources; using ASC.Web.Studio.Utility; using Report = ASC.Web.Projects.Classes.Report; namespace ASC.Web.Projects.Controls.Reports { public partial class ReportView : BaseUserControl { public Report Report { get; private set; } protected void Page_Load(object sender, EventArgs e) { reportTemplateContainer.Options.IsPopup = true; InitReport(); Page.Title = HeaderStringHelper.GetPageTitle(string.Format(ReportResource.ReportPageTitle, Report.ReportInfo.Title)); } private void InitReport() { var filter = TaskFilter.FromUri(HttpContext.Current.Request.GetUrlRewriter()); var reportType = Request["reportType"]; if (string.IsNullOrEmpty(reportType)) return; Report = Report.CreateNewReport((ReportType)int.Parse(reportType), filter); var filters = (ReportFilters)LoadControl(PathProvider.GetFileStaticRelativePath("Reports/ReportFilters.ascx")); filters.Report = Report; _filter.Controls.Add(filters); } } }
34.127273
129
0.701119
[ "ECL-2.0", "Apache-2.0", "MIT" ]
ONLYOFFICE/CommunityServer
web/studio/ASC.Web.Studio/Products/Projects/Controls/Reports/ReportView.ascx.cs
1,877
C#
using System; namespace WebApplication1.Data.Models { public class Order { public Guid Id { get; set; } = Guid.NewGuid(); public string Name { get; set; } = ""; } }
14.142857
54
0.565657
[ "Apache-2.0" ]
dotnetcore/sharding-core
samples/Samples.DynamicDb.Npgsql/WebApplication1.Data/Models/Order.cs
200
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a Codezu. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Collections.Generic; namespace Mozu.Api.Urls.Commerce.Catalog.Admin.Attributedefinition { public partial class AttributeUrl { /// <summary> /// Get Resource Url for GetAttributes /// </summary> /// <param name="filter">A set of filter expressions representing the search parameters for a query. This parameter is optional. Refer to [Sorting and Filtering](../../../../Developer/api-guides/sorting-filtering.htm) for a list of supported filters.</param> /// <param name="pageSize">When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with this parameter set to 25, to get the 51st through the 75th items, set startIndex to 50.</param> /// <param name="responseFields">Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.</param> /// <param name="sortBy">The element to sort the results by and the channel in which the results appear. Either ascending (a-z) or descending (z-a) channel. Optional. Refer to [Sorting and Filtering](../../../../Developer/api-guides/sorting-filtering.htm) for more information.</param> /// <param name="startIndex">When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with pageSize set to 25, to get the 51st through the 75th items, set this parameter to 50.</param> /// <returns> /// String - Resource Url /// </returns> public static MozuUrl GetAttributesUrl(int? startIndex = null, int? pageSize = null, string sortBy = null, string filter = null, string responseFields = null) { var url = "/api/commerce/catalog/admin/attributedefinition/attributes/?startIndex={startIndex}&pageSize={pageSize}&sortBy={sortBy}&filter={filter}&responseFields={responseFields}"; var mozuUrl = new MozuUrl(url, MozuUrl.UrlLocation.TENANT_POD, false) ; mozuUrl.FormatUrl( "filter", filter); mozuUrl.FormatUrl( "pageSize", pageSize); mozuUrl.FormatUrl( "responseFields", responseFields); mozuUrl.FormatUrl( "sortBy", sortBy); mozuUrl.FormatUrl( "startIndex", startIndex); return mozuUrl; } /// <summary> /// Get Resource Url for GetAttribute /// </summary> /// <param name="attributeFQN">Fully qualified name for an attribute.</param> /// <param name="responseFields">Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.</param> /// <returns> /// String - Resource Url /// </returns> public static MozuUrl GetAttributeUrl(string attributeFQN, string responseFields = null) { var url = "/api/commerce/catalog/admin/attributedefinition/attributes/{attributeFQN}?responseFields={responseFields}"; var mozuUrl = new MozuUrl(url, MozuUrl.UrlLocation.TENANT_POD, false) ; mozuUrl.FormatUrl( "attributeFQN", attributeFQN); mozuUrl.FormatUrl( "responseFields", responseFields); return mozuUrl; } /// <summary> /// Get Resource Url for AddAttribute /// </summary> /// <param name="responseFields">Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.</param> /// <returns> /// String - Resource Url /// </returns> public static MozuUrl AddAttributeUrl(string responseFields = null) { var url = "/api/commerce/catalog/admin/attributedefinition/attributes/?responseFields={responseFields}"; var mozuUrl = new MozuUrl(url, MozuUrl.UrlLocation.TENANT_POD, false) ; mozuUrl.FormatUrl( "responseFields", responseFields); return mozuUrl; } /// <summary> /// Get Resource Url for UpdateAttribute /// </summary> /// <param name="attributeFQN">Fully qualified name for an attribute.</param> /// <param name="responseFields">Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.</param> /// <returns> /// String - Resource Url /// </returns> public static MozuUrl UpdateAttributeUrl(string attributeFQN, string responseFields = null) { var url = "/api/commerce/catalog/admin/attributedefinition/attributes/{attributeFQN}?responseFields={responseFields}"; var mozuUrl = new MozuUrl(url, MozuUrl.UrlLocation.TENANT_POD, false) ; mozuUrl.FormatUrl( "attributeFQN", attributeFQN); mozuUrl.FormatUrl( "responseFields", responseFields); return mozuUrl; } /// <summary> /// Get Resource Url for DeleteAttribute /// </summary> /// <param name="attributeFQN">Fully qualified name for an attribute.</param> /// <returns> /// String - Resource Url /// </returns> public static MozuUrl DeleteAttributeUrl(string attributeFQN) { var url = "/api/commerce/catalog/admin/attributedefinition/attributes/{attributeFQN}"; var mozuUrl = new MozuUrl(url, MozuUrl.UrlLocation.TENANT_POD, false) ; mozuUrl.FormatUrl( "attributeFQN", attributeFQN); return mozuUrl; } } }
55.809091
295
0.685128
[ "MIT" ]
GaryWayneSmith/mozu-dotnet
Mozu.Api/Urls/Commerce/Catalog/Admin/Attributedefinition/AttributeUrl.cs
6,139
C#
using System.Threading.Tasks; using TestExtensions; using TestGrainInterfaces; using Xunit; namespace DefaultCluster.Tests.GeoClusterTests { public class SimpleGlobalSingleInstanceGrainTests : HostedTestClusterEnsureDefaultStarted { private const string SimpleGrainNamePrefix = "UnitTests.Grains.SimpleG"; public SimpleGlobalSingleInstanceGrainTests(DefaultClusterFixture fixture) : base(fixture) { } public ISimpleGlobalSingleInstanceGrain GetGlobalSingleInstanceGrain() { return this.GrainFactory.GetGrain<ISimpleGlobalSingleInstanceGrain>(GetRandomGrainId(), SimpleGrainNamePrefix); } [Fact, TestCategory("BVT"), TestCategory("Functional"), TestCategory("GeoCluster")] public async Task SimpleGlobalSingleInstanceGrainTest() { int i = 0; while (i++ < 100) { ISimpleGlobalSingleInstanceGrain grain = GetGlobalSingleInstanceGrain(); int r1 = random.Next(0, 100); int r2 = random.Next(0, 100); await grain.SetA(r1); await grain.SetB(r2); int result = await grain.GetAxB(); Assert.Equal(r1 * r2, result); } } } }
33.894737
123
0.636646
[ "MIT" ]
1007lu/orleans
test/DefaultCluster.Tests/GeoClusterTests/SimpleGlobalSingleInstanceGrainTests.cs
1,288
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using IdentityServer4.Models; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer { internal class ConfigureClients : IConfigureOptions<ApiAuthorizationOptions> { private const string DefaultLocalSPARelativeRedirectUri = "/authentication/login-callback"; private const string DefaultLocalSPARelativePostLogoutRedirectUri = "/authentication/logout-callback"; private readonly IConfiguration _configuration; private readonly ILogger<ConfigureClients> _logger; public ConfigureClients(IConfiguration configuration, ILogger<ConfigureClients> logger) { _configuration = configuration; _logger = logger; } public void Configure(ApiAuthorizationOptions options) { foreach (var client in GetClients()) { options.Clients.Add(client); } } internal IEnumerable<Client> GetClients() { var data = _configuration.Get<Dictionary<string, ClientDefinition>>(); if (data != null) { foreach (var kvp in data) { _logger.LogInformation( LoggerEventIds.ConfiguringClient, "Configuring client '{ClientName}'.", kvp.Key ); var name = kvp.Key; var definition = kvp.Value; switch (definition.Profile) { case ApplicationProfiles.SPA: yield return GetSPA(name, definition); break; case ApplicationProfiles.IdentityServerSPA: yield return GetLocalSPA(name, definition); break; case ApplicationProfiles.NativeApp: yield return GetNativeApp(name, definition); break; default: throw new InvalidOperationException( $"Type '{definition.Profile}' is not supported." ); } } } } private Client GetSPA(string name, ClientDefinition definition) { if ( definition.RedirectUri == null || !Uri.TryCreate(definition.RedirectUri, UriKind.Absolute, out var redirectUri) ) { throw new InvalidOperationException( $"The redirect uri " + $"'{definition.RedirectUri}' for '{name}' is invalid. " + $"The redirect URI must be an absolute url." ); } if ( definition.LogoutUri == null || !Uri.TryCreate(definition.LogoutUri, UriKind.Absolute, out var postLogouturi) ) { throw new InvalidOperationException( $"The logout uri " + $"'{definition.LogoutUri}' for '{name}' is invalid. " + $"The logout URI must be an absolute url." ); } if ( !string.Equals( redirectUri.GetLeftPart(UriPartial.Authority), postLogouturi.GetLeftPart(UriPartial.Authority), StringComparison.Ordinal ) ) { throw new InvalidOperationException( $"The redirect uri and the logout uri " + $"for '{name}' have a different scheme, host or port." ); } var client = ClientBuilder .SPA(name) .WithRedirectUri(definition.RedirectUri) .WithLogoutRedirectUri(definition.LogoutUri) .WithAllowedOrigins(redirectUri.GetLeftPart(UriPartial.Authority)) .FromConfiguration(); return client.Build(); } private Client GetNativeApp(string name, ClientDefinition definition) { var client = ClientBuilder.NativeApp(name).FromConfiguration(); return client.Build(); } private Client GetLocalSPA(string name, ClientDefinition definition) { var client = ClientBuilder .IdentityServerSPA(name) .WithRedirectUri(definition.RedirectUri ?? DefaultLocalSPARelativeRedirectUri) .WithLogoutRedirectUri( definition.LogoutUri ?? DefaultLocalSPARelativePostLogoutRedirectUri ) .WithAllowedOrigins() .FromConfiguration(); return client.Build(); } } }
37.105634
111
0.525906
[ "Apache-2.0" ]
belav/aspnetcore
src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureClients.cs
5,269
C#
using System; using System.Collections.Generic; using System.Text; using System.IO.Compression; using System.IO; using System.Xml; class TwbxDataSourceEditor { private readonly string _pathToTwbx; private readonly string _pathToWorkIn; private readonly TaskStatusLogs _statusLog; private readonly ITableauServerSiteInfo _serverInfo; /// <summary> /// Constructor /// </summary> /// <param name="pathTwbx">TWBX we are going to unpack</param> /// <param name="workingDirectory"></param> public TwbxDataSourceEditor(string pathTwbx, string workingDirectory, ITableauServerSiteInfo serverInfo, TaskStatusLogs statusLog) { _pathToTwbx = pathTwbx; _pathToWorkIn = workingDirectory; _statusLog = statusLog; _serverInfo = serverInfo; if (!File.Exists(_pathToTwbx)) { throw new ArgumentException("Original file does not exist " + _pathToTwbx); } } /// <summary> /// The subdirectory we are unzipping to /// </summary> public string UnzipDirectory { get { return Path.Combine(_pathToWorkIn, "unzipped"); } } /// <summary> /// The path to the output /// </summary> public string OutputDirectory { get { return Path.Combine(_pathToWorkIn, "output"); } } /// <summary> /// The name and path of the TWBX file we are generating /// </summary> public string OutputFileWithPath { get { return Path.Combine(OutputDirectory, TwbxFileName); } } /// <summary> /// The filename /// </summary> public string TwbxFileName { get { return Path.GetFileName(_pathToTwbx); } } /// <summary> /// There should only be one *.twb file in the unzipped set of files /// </summary> /// <returns></returns> private string GetPathToUnzippedTwb() { var twbFiles = Directory.EnumerateFiles(this.UnzipDirectory, "*.twb"); foreach (var twb in twbFiles) { return twb; } _statusLog.AddError("Twb editor; no twb file found"); return null; } private static bool CreateDirectoryIfNeeded(string path) { if(Directory.Exists(path)) return false; Directory.CreateDirectory(path); return true; } /// <summary> /// /// </summary> /// <returns>Path to the ZIPed fixed up TWBX</returns> public string Execute() { //1. Create temp directory to decompress file to // - Create subdirectories for 'unzipped', 're-zipped' //Create the directories we nee CreateDirectoryIfNeeded(_pathToWorkIn); CreateDirectoryIfNeeded(this.UnzipDirectory); CreateDirectoryIfNeeded(this.OutputDirectory); //2. Unzip file ZipFile.ExtractToDirectory(_pathToTwbx, this.UnzipDirectory); //3. Look for *.twb file in uncompressed directory (does not need to have maching name) string twbFile = GetPathToUnzippedTwb(); //4. Remap server-path to point to correct server/site (replaces existing file) var twbMapper = new TwbDataSourceEditor(twbFile, twbFile, _serverInfo, _statusLog); twbMapper.Execute(); //5. Recreate the TWBX File string filenameTwbx = Path.GetFileName(_pathToTwbx); string outputPath = Path.Combine(this.OutputDirectory, filenameTwbx); ZipFile.CreateFromDirectory(this.UnzipDirectory, outputPath); //Return the path to the remapped/re-zipped *.twbx file return outputPath; } }
27.058394
134
0.621527
[ "MIT" ]
BiniamD/TabMigrate
TabRESTMigrate/WorkbookTransforms/TwbxDataSourceEditor.cs
3,709
C#
using BrokeredMessaging.Messaging.Features; using System; using System.Threading; using System.Threading.Tasks; namespace BrokeredMessaging.Messaging { /// <summary> /// The default receive context which provides access to the received message and related /// functions using listener features. /// </summary> public class DefaultReceiveContext : ReceiveContext { private static readonly Func<IReceiveLifetimeFeature> ReceiveLifetimeFeatureFactory = () => new ReceiveLifetimeFeatureStub(); private static readonly Func<IServiceProvidersFeature> ServiceProvidersFeatureFactory = () => new ServiceProvidersFeatureStub(); private readonly ReceivedMessage _receivedMessage; private readonly DefaultDeliveryAcknowlegement _deliveryAcknowedgement; private FeatureAccessor<ContextFeatures> _features; public DefaultReceiveContext() : this(new FeatureCollection()) { } public DefaultReceiveContext(IFeatureCollection features) { if (features == null) { throw new ArgumentNullException(nameof(features)); } _features = new FeatureAccessor<ContextFeatures>(features); _receivedMessage = new DefaultReceivedMessage(this); _deliveryAcknowedgement = new DefaultDeliveryAcknowlegement(this); } public override IFeatureCollection Features => _features.Collection; private IReceiveLifetimeFeature ReceiveLifetimeFeature => _features.Get(ref _features.Cache.ReceiveLifetime, ReceiveLifetimeFeatureFactory); private IServiceProvidersFeature ServiceProvidersFeature => _features.Get(ref _features.Cache.ServiceProviders, ServiceProvidersFeatureFactory); public override CancellationToken ReceiveAborted => ReceiveLifetimeFeature.ReceiveAborted; public override ReceivedMessage ReceivedMessage => _receivedMessage; public override DeliveryAcknowledgement DeliveryAcknowledgement => _deliveryAcknowedgement; public override IServiceProvider RecieveServices => ServiceProvidersFeature.ReceiveServices; private struct ContextFeatures { public IReceiveLifetimeFeature ReceiveLifetime; public IServiceProvidersFeature ServiceProviders; } } /// <summary> /// The default delivery acknowledgement implementation, using listener features to perform /// delivery acknowledgment. /// </summary> public class DefaultDeliveryAcknowlegement : DeliveryAcknowledgement { private static readonly Func<IDeliveryAcknowledgementFeature> DeliveryAcknowledgementFeatureFactory = () => new DeliveryAcknowledgementFeatureStub(); private FeatureAccessor<AcknowledgementFeatures> _features; public DefaultDeliveryAcknowlegement(ReceiveContext receiveContext) { ReceiveContext = receiveContext ?? throw new ArgumentNullException(nameof(receiveContext)); _features = new FeatureAccessor<AcknowledgementFeatures>(receiveContext.Features); } private IDeliveryAcknowledgementFeature DeliveryAcknowledgementFeature => _features.Get(ref _features.Cache.DeliveryAcknowledgement, DeliveryAcknowledgementFeatureFactory); public override ReceiveContext ReceiveContext { get; } public override bool Sent => DeliveryAcknowledgementFeature.Sent; public override DeliveryStatus Status { get => DeliveryAcknowledgementFeature.Status; set => DeliveryAcknowledgementFeature.Status = value; } public override string StatusReason { get => DeliveryAcknowledgementFeature.StatusReason; set => DeliveryAcknowledgementFeature.StatusReason = value; } public override void OnCompleted(Func<Task, object> callback, object state) => DeliveryAcknowledgementFeature.OnCompleted(callback, state); public override void OnStarting(Func<Task, object> callback, object state) => DeliveryAcknowledgementFeature.OnStarting(callback, state); public override Task SendAsync() => DeliveryAcknowledgementFeature.SendAsync(); private struct AcknowledgementFeatures { public IDeliveryAcknowledgementFeature DeliveryAcknowledgement; } } }
37.983051
113
0.710843
[ "MIT" ]
BrokeredMessaging/MessagingAbstractions
src/BrokeredMessaging.Messaging/DefaultReceiveContext.cs
4,484
C#
using Dal; using Dto; using System; using System.Collections.Generic; namespace Bll { public class clsUberBll { private clsUberDal _uber; /* Método construtor (Fundamentos POO) */ public clsUberBll() { /* Instanciando o objeto _cidades * desta forma não será necessário * instancia-lo em cada método. */ _uber = new clsUberDal(); } public void Inserir(clsUberDto uberDto) { try { if (uberDto.DatadaCorridas.ToString() == String.Empty) { throw new Exception("O campo Data é obrigatório!"); } _uber.Inserir(uberDto); } catch (Exception ex) { /* Tratamento de erro que identifica a camada, * muito interessante ser utilizado em proje- * tos em camadas */ throw new Exception("BLL: " + ex.Message); } } public void Alterar(clsUberDto uberDto) { try { if (uberDto.DatadaCorridas.ToString() == String.Empty) { throw new Exception("O campo Nome é obrigatório!"); } _uber.Alterar(uberDto); } catch (Exception ex) { /* Tratamento de erro que identifica a camada, * muito interessante ser utilizado em proje- * tos em camadas */ throw new Exception("BLL: " + ex.Message); } } public void Excluir(int uberDto) { try { if (uberDto <= 0) { throw new Exception("O campo Código não pode ser zero ou negativo."); } _uber.Excluir(uberDto); } catch (Exception ex) { throw new Exception("BLL: " + ex.Message); } } public List<clsUberDto> ObterDados(int tipo, String filtro) { clsUberDal _uberDal = new clsUberDal(); try { if ((tipo == 0) || (tipo == 1)) { return _uberDal.obterDados(tipo, filtro); } else { throw new Exception("A informação do Tipo para a consulta não foi fornecedida!"); } } catch (Exception) { throw; } } public List<clsUberDto> obterDados(String filtro) { clsUberDal _uberDal = new clsUberDal(); try { if (filtro == "DATA") { return _uberDal.obterDados(2, filtro); } else { throw new Exception("Não foi possivel realizar a busca"); } } catch (Exception) { return null; throw; } } } }
25.626984
101
0.419325
[ "Unlicense" ]
EricDamasc/PROJETO-PAI
Fontes/Bll/clsUberBll.cs
3,246
C#
using EasyRpc.AspNetCore.DataAnnotations.Impl; namespace EasyRpc.AspNetCore.DataAnnotations { /// <summary> /// Static class for C# extentions /// </summary> public static class ApiConfigurationExtensions { /// <summary> /// Use data annotations for validation /// </summary> /// <param name="configuration"></param> /// <returns></returns> public static IApiConfiguration UseDataAnnotations(this IApiConfiguration configuration) { var provider = new DataAnnotationFilterProvider(); configuration.ApplyFilter(provider.ProvideFilters); return configuration; } } }
27.64
96
0.633864
[ "MIT" ]
JTOne123/EasyRpc
src/EasyRpc.AspNetCore.DataAnnotations/ApiConfigurationExtensions.cs
693
C#
// Patterns: 2 // Matches: Foo.cs, Baz.cs // NotMatches: FooBar.cs using Microsoft.Extensions.DependencyInjection; using TestApplication.Types; namespace TestApplication.AspNetCore { public class AddTransientGenericStatementLambdaMultiple { public AddTransientGenericStatementLambdaMultiple() { var container = new ServiceCollection(); container.AddTransient<IFoo>(provider => { if (new object() == null) { return new Foo(); } else { return new Baz(); } }); } } }
24.5
59
0.517493
[ "MIT" ]
ERNICommunity/AgentMulder
src/Test/Data/AspNetCore/AddTransientGenericStatementLambdaMultiple.cs
688
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Accounts; namespace Assignment5 { public partial class Member : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //State management with Session object if (Session["memberLoggedIn"] == null) { Response.Redirect("Default.aspx", false); } else { //show user their subscription key Account account = new Account(); Label1.Text = "Subscription Key: " + account.getSubKey(Session["email"].ToString()); } } } }
27.642857
100
0.563307
[ "MIT" ]
IanParkison/CSE445_598
Assignment5 CSE598Parkison/Assignment 5 Parkison LocalHost/Assignment5/Member.aspx.cs
776
C#
using System.IO; namespace sensor_msgs.msg { /** * * Topic data type of the struct "Image" defined in "Image.idl". Use this class to provide the TopicDataType to a Participant. * * This file was automatically generated from Image.idl by com.halodi.idl.generator.IDLCSharpGenerator. * Do not update this file directly, edit Image.idl instead. * */ public class ImagePubSubType : Halodi.CDR.TopicDataType<Image> { public override string Name => "sensor_msgs::msg::dds_::Image_"; public override void serialize(sensor_msgs.msg.Image data, MemoryStream stream) { using(BinaryWriter writer = new BinaryWriter(stream)) { Halodi.CDR.CDRSerializer cdr = new Halodi.CDR.CDRSerializer(writer); write(data, cdr); } } public override void deserialize(MemoryStream stream, sensor_msgs.msg.Image data) { using(BinaryReader reader = new BinaryReader(stream)) { Halodi.CDR.CDRDeserializer cdr = new Halodi.CDR.CDRDeserializer(reader); read(data, cdr); } } public static int getCdrSerializedSize(sensor_msgs.msg.Image data) { return getCdrSerializedSize(data, 0); } public static int getCdrSerializedSize(sensor_msgs.msg.Image data, int current_alignment) { int initial_alignment = current_alignment; current_alignment += std_msgs.msg.HeaderPubSubType.getCdrSerializedSize(data.header, current_alignment); current_alignment += 4 + Halodi.CDR.CDRCommon.alignment(current_alignment, 4); current_alignment += 4 + Halodi.CDR.CDRCommon.alignment(current_alignment, 4); current_alignment += 4 + Halodi.CDR.CDRCommon.alignment(current_alignment, 4) + data.encoding.Length + 1; current_alignment += 1 + Halodi.CDR.CDRCommon.alignment(current_alignment, 1); current_alignment += 4 + Halodi.CDR.CDRCommon.alignment(current_alignment, 4); current_alignment += 4 + Halodi.CDR.CDRCommon.alignment(current_alignment, 4); current_alignment += (data.data.Count * 1) + Halodi.CDR.CDRCommon.alignment(current_alignment, 1); return current_alignment - initial_alignment; } public static void write(sensor_msgs.msg.Image data, Halodi.CDR.CDRSerializer cdr) { std_msgs.msg.HeaderPubSubType.write(data.header, cdr); cdr.write_type_4(data.height); cdr.write_type_4(data.width); cdr.write_type_d(data.encoding); cdr.write_type_9(data.is_bigendian); cdr.write_type_4(data.step); if(data.data == null) { cdr.write_type_2(0); } else { int data_length = data.data.Count; cdr.write_type_2(data_length); for (int i0 = 0; i0 < data_length; i0++) { cdr.write_type_9(data.data[i0]); } } } public static void read(sensor_msgs.msg.Image data, Halodi.CDR.CDRDeserializer cdr) { data.header = std_msgs.msg.HeaderPubSubType.Create(); std_msgs.msg.HeaderPubSubType.read(data.header, cdr); data.height=cdr.read_type_4(); data.width=cdr.read_type_4(); data.encoding = cdr.read_type_d(); data.is_bigendian=cdr.read_type_9(); data.step=cdr.read_type_4(); int data_length = cdr.read_type_2(); data.data = new System.Collections.Generic.List<byte>(data_length); for(int i = 0; i < data_length; i++) { data.data.Add(cdr.read_type_9()); } } public static void Copy(sensor_msgs.msg.Image src, sensor_msgs.msg.Image target) { target.Set(src); } } }
26.244604
126
0.660088
[ "Apache-2.0" ]
AHGOverbeek/halodi-messages
halodi-messages-unity-support/Packages/halodi-messages/Runtime/sensor_msgs/msg/ImagePubSubType.cs
3,648
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.Diagnostics; using System.Drawing; using System.Globalization; using System.Text; using static Interop; namespace System.Windows.Forms { public partial class DataGridViewRow { protected class DataGridViewRowAccessibleObject : AccessibleObject { private int[] runtimeId; private DataGridViewRow owner; private DataGridViewSelectedRowCellsAccessibleObject selectedCellsAccessibilityObject; public DataGridViewRowAccessibleObject() { } public DataGridViewRowAccessibleObject(DataGridViewRow owner) { this.owner = owner; } public override Rectangle Bounds { get { if (owner is null) { throw new InvalidOperationException(SR.DataGridViewRowAccessibleObject_OwnerNotSet); } if (owner.DataGridView is null || !owner.DataGridView.IsHandleCreated) { return Rectangle.Empty; } Rectangle rowRect = owner.DataGridView.RectangleToScreen(owner.DataGridView.GetRowDisplayRectangle(owner.Index, false /*cutOverflow*/)); int horizontalScrollBarHeight = 0; if (owner.DataGridView.HorizontalScrollBarVisible) { horizontalScrollBarHeight = owner.DataGridView.HorizontalScrollBarHeight; } Rectangle dataGridViewRect = ParentPrivate.Bounds; int columnHeadersHeight = 0; if (owner.DataGridView.ColumnHeadersVisible) { columnHeadersHeight = owner.DataGridView.ColumnHeadersHeight; } int rowRectBottom = rowRect.Bottom; if ((dataGridViewRect.Bottom - horizontalScrollBarHeight) < rowRectBottom) { rowRectBottom = dataGridViewRect.Bottom - owner.DataGridView.BorderWidth - horizontalScrollBarHeight; } if ((dataGridViewRect.Top + columnHeadersHeight) > rowRect.Top) { rowRect.Height = 0; } else { rowRect.Height = rowRectBottom - rowRect.Top; } return rowRect; } } public override string Name { get { if (owner is null) { throw new InvalidOperationException(SR.DataGridViewRowAccessibleObject_OwnerNotSet); } return string.Format(SR.DataGridView_AccRowName, owner.Index.ToString(CultureInfo.CurrentCulture)); } } public DataGridViewRow Owner { get => owner; set { if (owner is not null) { throw new InvalidOperationException(SR.DataGridViewRowAccessibleObject_OwnerAlreadySet); } owner = value; } } public override AccessibleObject Parent => ParentPrivate; private AccessibleObject ParentPrivate { get { if (owner is null) { throw new InvalidOperationException(SR.DataGridViewRowAccessibleObject_OwnerNotSet); } return owner.DataGridView?.AccessibilityObject; } } public override AccessibleRole Role => AccessibleRole.Row; internal override int[] RuntimeId => runtimeId ??= new int[] { RuntimeIDFirstItem, // first item is static - 0x2a Parent.GetHashCode(), GetHashCode() }; private AccessibleObject SelectedCellsAccessibilityObject { get { if (owner is null) { throw new InvalidOperationException(SR.DataGridViewRowAccessibleObject_OwnerNotSet); } if (selectedCellsAccessibilityObject is null) { selectedCellsAccessibilityObject = new DataGridViewSelectedRowCellsAccessibleObject(owner); } return selectedCellsAccessibilityObject; } } public override AccessibleStates State { get { if (owner is null) { throw new InvalidOperationException(SR.DataGridViewRowAccessibleObject_OwnerNotSet); } AccessibleStates accState = AccessibleStates.Selectable; bool allCellsAreSelected = true; if (owner.Selected) { allCellsAreSelected = true; } else { for (int i = 0; i < owner.Cells.Count; i++) { if (!owner.Cells[i].Selected) { allCellsAreSelected = false; break; } } } if (allCellsAreSelected) { accState |= AccessibleStates.Selected; } if (owner.DataGridView is not null && owner.DataGridView.IsHandleCreated) { Rectangle rowBounds = owner.DataGridView.GetRowDisplayRectangle(owner.Index, true /*cutOverflow*/); if (!rowBounds.IntersectsWith(owner.DataGridView.ClientRectangle)) { accState |= AccessibleStates.Offscreen; } } return accState; } } public override string Value { get { if (owner is null) { throw new InvalidOperationException(SR.DataGridViewRowAccessibleObject_OwnerNotSet); } if (owner.DataGridView is not null && owner.DataGridView.AllowUserToAddRows && owner.Index == owner.DataGridView.NewRowIndex) { return SR.DataGridView_AccRowCreateNew; } StringBuilder sb = new StringBuilder(1024); int childCount = GetChildCount(); // filter out the row header acc object even when DataGridView::RowHeadersVisible is turned on int startIndex = owner.DataGridView is not null && owner.DataGridView.RowHeadersVisible ? 1 : 0; for (int i = startIndex; i < childCount; i++) { AccessibleObject cellAccObj = GetChild(i); if (cellAccObj is not null) { sb.Append(cellAccObj.Value); } if (i != childCount - 1) { sb.Append(';'); } } return sb.ToString(); } } public override AccessibleObject GetChild(int index) { if (index < 0) { throw new ArgumentOutOfRangeException(nameof(index)); } if (owner is null) { throw new InvalidOperationException(SR.DataGridViewRowAccessibleObject_OwnerNotSet); } if (owner.DataGridView is null) { return null; } if (index == 0 && owner.DataGridView.RowHeadersVisible) { return owner.HeaderCell.AccessibilityObject; } else { // decrement the index because the first child is the RowHeaderCell AccessibilityObject if (owner.DataGridView.RowHeadersVisible) { index--; } Debug.Assert(index >= 0); int columnIndex = owner.DataGridView.Columns.ActualDisplayIndexToColumnIndex(index, DataGridViewElementStates.Visible); return owner.Cells[columnIndex].AccessibilityObject; } } public override int GetChildCount() { if (owner is null) { throw new InvalidOperationException(SR.DataGridViewRowAccessibleObject_OwnerNotSet); } if (owner.DataGridView is null) { return 0; } int result = owner.DataGridView.Columns.GetColumnCount(DataGridViewElementStates.Visible); if (owner.DataGridView.RowHeadersVisible) { // + 1 comes from the row header cell accessibility object result++; } return result; } public override AccessibleObject GetSelected() => SelectedCellsAccessibilityObject; public override AccessibleObject GetFocused() { if (owner is null) { throw new InvalidOperationException(SR.DataGridViewRowAccessibleObject_OwnerNotSet); } if (owner.DataGridView is not null && owner.DataGridView.Focused && owner.DataGridView.CurrentCell is not null && owner.DataGridView.CurrentCell.RowIndex == owner.Index) { return owner.DataGridView.CurrentCell.AccessibilityObject; } else { return null; } } public override AccessibleObject Navigate(AccessibleNavigation navigationDirection) { if (owner is null) { throw new InvalidOperationException(SR.DataGridViewRowAccessibleObject_OwnerNotSet); } if (owner.DataGridView is null) { return null; } switch (navigationDirection) { case AccessibleNavigation.Down: case AccessibleNavigation.Next: if (owner.Index != owner.DataGridView.Rows.GetLastRow(DataGridViewElementStates.Visible)) { int nextVisibleRow = owner.DataGridView.Rows.GetNextRow(owner.Index, DataGridViewElementStates.Visible); int actualDisplayIndex = owner.DataGridView.Rows.GetRowCount(DataGridViewElementStates.Visible, 0, nextVisibleRow); if (owner.DataGridView.ColumnHeadersVisible) { return owner.DataGridView.AccessibilityObject.GetChild(actualDisplayIndex + 1); } else { return owner.DataGridView.AccessibilityObject.GetChild(actualDisplayIndex); } } else { return null; } case AccessibleNavigation.Up: case AccessibleNavigation.Previous: if (owner.Index != owner.DataGridView.Rows.GetFirstRow(DataGridViewElementStates.Visible)) { int previousVisibleRow = owner.DataGridView.Rows.GetPreviousRow(owner.Index, DataGridViewElementStates.Visible); int actualDisplayIndex = owner.DataGridView.Rows.GetRowCount(DataGridViewElementStates.Visible, 0, previousVisibleRow); if (owner.DataGridView.ColumnHeadersVisible) { return owner.DataGridView.AccessibilityObject.GetChild(actualDisplayIndex + 1); } else { return owner.DataGridView.AccessibilityObject.GetChild(actualDisplayIndex); } } else if (owner.DataGridView.ColumnHeadersVisible) { // return the top row header acc obj return ParentPrivate.GetChild(0); } else { // if this is the first row and the DataGridView RowHeaders are not visible return null; return null; } case AccessibleNavigation.FirstChild: if (GetChildCount() == 0) { return null; } else { return GetChild(0); } case AccessibleNavigation.LastChild: int childCount = GetChildCount(); if (childCount == 0) { return null; } else { return GetChild(childCount - 1); } default: return null; } } public override void Select(AccessibleSelection flags) { if (owner is null) { throw new InvalidOperationException(SR.DataGridViewRowAccessibleObject_OwnerNotSet); } DataGridView dataGridView = owner.DataGridView; if (dataGridView is null || !dataGridView.IsHandleCreated) { return; } if ((flags & AccessibleSelection.TakeFocus) == AccessibleSelection.TakeFocus) { dataGridView.Focus(); } if ((flags & AccessibleSelection.TakeSelection) == AccessibleSelection.TakeSelection) { if (owner.Cells.Count > 0) { if (dataGridView.CurrentCell is not null && dataGridView.CurrentCell.OwningColumn is not null) { dataGridView.CurrentCell = owner.Cells[dataGridView.CurrentCell.OwningColumn.Index]; // Do not change old selection } else { int firstVisibleCell = dataGridView.Columns.GetFirstColumn(DataGridViewElementStates.Visible).Index; if (firstVisibleCell > -1) { dataGridView.CurrentCell = owner.Cells[firstVisibleCell]; // Do not change old selection } } } } if ((flags & AccessibleSelection.AddSelection) == AccessibleSelection.AddSelection && (flags & AccessibleSelection.TakeSelection) == 0) { if (dataGridView.SelectionMode == DataGridViewSelectionMode.FullRowSelect || dataGridView.SelectionMode == DataGridViewSelectionMode.RowHeaderSelect) { owner.Selected = true; } } if ((flags & AccessibleSelection.RemoveSelection) == AccessibleSelection.RemoveSelection && (flags & (AccessibleSelection.AddSelection | AccessibleSelection.TakeSelection)) == 0) { owner.Selected = false; } } internal override UiaCore.IRawElementProviderFragment FragmentNavigate(UiaCore.NavigateDirection direction) { { if (Owner is null) { throw new InvalidOperationException(SR.DataGridViewRowAccessibleObject_OwnerNotSet); } switch (direction) { case UiaCore.NavigateDirection.Parent: return Parent; case UiaCore.NavigateDirection.NextSibling: return Navigate(AccessibleNavigation.Next); case UiaCore.NavigateDirection.PreviousSibling: return Navigate(AccessibleNavigation.Previous); case UiaCore.NavigateDirection.FirstChild: return Navigate(AccessibleNavigation.FirstChild); case UiaCore.NavigateDirection.LastChild: return Navigate(AccessibleNavigation.LastChild); default: return null; } } } internal override UiaCore.IRawElementProviderFragmentRoot FragmentRoot { get { return ParentPrivate; } } internal override bool IsPatternSupported(UiaCore.UIA patternId) { return patternId.Equals(UiaCore.UIA.LegacyIAccessiblePatternId); } internal override bool IsReadOnly => owner.ReadOnly; internal override object GetPropertyValue(UiaCore.UIA propertyId) { switch (propertyId) { case UiaCore.UIA.NamePropertyId: return Name; case UiaCore.UIA.IsEnabledPropertyId: return Owner?.DataGridView?.Enabled ?? false; case UiaCore.UIA.HelpTextPropertyId: return Help ?? string.Empty; case UiaCore.UIA.IsKeyboardFocusablePropertyId: case UiaCore.UIA.HasKeyboardFocusPropertyId: case UiaCore.UIA.IsPasswordPropertyId: return false; case UiaCore.UIA.IsOffscreenPropertyId: return (State & AccessibleStates.Offscreen) == AccessibleStates.Offscreen; case UiaCore.UIA.AccessKeyPropertyId: return string.Empty; } return base.GetPropertyValue(propertyId); } } } }
38.605769
169
0.465903
[ "MIT" ]
Danil-Andrianov/winforms
src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewRow.DataGridViewRowAccessibleObject.cs
20,077
C#
/* * Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the macie2-2020-01-01.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.Macie2.Model { /// <summary> /// The account-level and bucket-level permissions settings for an S3 bucket, or the bucket /// that contains an object. /// </summary> public partial class BucketPermissionConfiguration { private AccountLevelPermissions _accountLevelPermissions; private BucketLevelPermissions _bucketLevelPermissions; /// <summary> /// Gets and sets the property AccountLevelPermissions. /// <para> /// The account-level permissions settings that apply to the bucket. /// </para> /// </summary> public AccountLevelPermissions AccountLevelPermissions { get { return this._accountLevelPermissions; } set { this._accountLevelPermissions = value; } } // Check to see if AccountLevelPermissions property is set internal bool IsSetAccountLevelPermissions() { return this._accountLevelPermissions != null; } /// <summary> /// Gets and sets the property BucketLevelPermissions. /// <para> /// The bucket-level permissions settings for the bucket. /// </para> /// </summary> public BucketLevelPermissions BucketLevelPermissions { get { return this._bucketLevelPermissions; } set { this._bucketLevelPermissions = value; } } // Check to see if BucketLevelPermissions property is set internal bool IsSetBucketLevelPermissions() { return this._bucketLevelPermissions != null; } } }
32.727273
104
0.664683
[ "Apache-2.0" ]
JeffAshton/aws-sdk-net
sdk/src/Services/Macie2/Generated/Model/BucketPermissionConfiguration.cs
2,520
C#
using System; using FsCheck; using FsCheck.Xunit; using NRealbit.Tests.Generators; using Xunit; namespace NRealbit.Tests.PropertyTest { public class AddressTest { public AddressTest() { Arb.Register<AddressGenerator>(); Arb.Register<ChainParamsGenerator>(); } [Property] [Trait("UnitTest", "UnitTest")] public bool CanSerializeAsymmetric(Tuple<RealbitAddress, Network> testcase) { var addrstr = testcase.Item1.ToString(); var network = testcase.Item2; var addr2 = RealbitAddress.Create(addrstr, network); return addrstr == addr2.ToString(); } } }
20.241379
77
0.725724
[ "MIT" ]
maren7/NRealbit
NRealbit.Tests/PropertyTest/AddressTest.cs
587
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.Azure.StreamAnalytics { /// <summary> /// Manages a Stream Analytics Stream Input EventHub. /// /// ## Example Usage /// /// ```csharp /// using Pulumi; /// using Azure = Pulumi.Azure; /// /// class MyStack : Stack /// { /// public MyStack() /// { /// var exampleResourceGroup = Output.Create(Azure.Core.GetResourceGroup.InvokeAsync(new Azure.Core.GetResourceGroupArgs /// { /// Name = "example-resources", /// })); /// var exampleJob = Output.Create(Azure.StreamAnalytics.GetJob.InvokeAsync(new Azure.StreamAnalytics.GetJobArgs /// { /// Name = "example-job", /// ResourceGroupName = azurerm_resource_group.Example.Name, /// })); /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new Azure.EventHub.EventHubNamespaceArgs /// { /// Location = exampleResourceGroup.Apply(exampleResourceGroup =&gt; exampleResourceGroup.Location), /// ResourceGroupName = exampleResourceGroup.Apply(exampleResourceGroup =&gt; exampleResourceGroup.Name), /// Sku = "Standard", /// Capacity = 1, /// }); /// var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new Azure.EventHub.EventHubArgs /// { /// NamespaceName = exampleEventHubNamespace.Name, /// ResourceGroupName = exampleResourceGroup.Apply(exampleResourceGroup =&gt; exampleResourceGroup.Name), /// PartitionCount = 2, /// MessageRetention = 1, /// }); /// var exampleConsumerGroup = new Azure.EventHub.ConsumerGroup("exampleConsumerGroup", new Azure.EventHub.ConsumerGroupArgs /// { /// NamespaceName = exampleEventHubNamespace.Name, /// EventhubName = exampleEventHub.Name, /// ResourceGroupName = exampleResourceGroup.Apply(exampleResourceGroup =&gt; exampleResourceGroup.Name), /// }); /// var exampleStreamInputEventHub = new Azure.StreamAnalytics.StreamInputEventHub("exampleStreamInputEventHub", new Azure.StreamAnalytics.StreamInputEventHubArgs /// { /// StreamAnalyticsJobName = exampleJob.Apply(exampleJob =&gt; exampleJob.Name), /// ResourceGroupName = exampleJob.Apply(exampleJob =&gt; exampleJob.ResourceGroupName), /// EventhubConsumerGroupName = exampleConsumerGroup.Name, /// EventhubName = exampleEventHub.Name, /// ServicebusNamespace = exampleEventHubNamespace.Name, /// SharedAccessPolicyKey = exampleEventHubNamespace.DefaultPrimaryKey, /// SharedAccessPolicyName = "RootManageSharedAccessKey", /// Serialization = new Azure.StreamAnalytics.Inputs.StreamInputEventHubSerializationArgs /// { /// Type = "Json", /// Encoding = "UTF8", /// }, /// }); /// } /// /// } /// ``` /// /// ## Import /// /// Stream Analytics Stream Input EventHub's can be imported using the `resource id`, e.g. /// /// ```sh /// $ pulumi import azure:streamanalytics/streamInputEventHub:StreamInputEventHub example /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/group1/providers/Microsoft.StreamAnalytics/streamingjobs/job1/inputs/input1 /// ``` /// </summary> [AzureResourceType("azure:streamanalytics/streamInputEventHub:StreamInputEventHub")] public partial class StreamInputEventHub : Pulumi.CustomResource { /// <summary> /// The name of an Event Hub Consumer Group that should be used to read events from the Event Hub. Specifying distinct consumer group names for multiple inputs allows each of those inputs to receive the same events from the Event Hub. If not set the input will use the Event Hub's default consumer group. /// </summary> [Output("eventhubConsumerGroupName")] public Output<string?> EventhubConsumerGroupName { get; private set; } = null!; /// <summary> /// The name of the Event Hub. /// </summary> [Output("eventhubName")] public Output<string> EventhubName { get; private set; } = null!; /// <summary> /// The name of the Stream Input EventHub. Changing this forces a new resource to be created. /// </summary> [Output("name")] public Output<string> Name { get; private set; } = null!; /// <summary> /// The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created. /// </summary> [Output("resourceGroupName")] public Output<string> ResourceGroupName { get; private set; } = null!; /// <summary> /// A `serialization` block as defined below. /// </summary> [Output("serialization")] public Output<Outputs.StreamInputEventHubSerialization> Serialization { get; private set; } = null!; /// <summary> /// The namespace that is associated with the desired Event Hub, Service Bus Queue, Service Bus Topic, etc. /// </summary> [Output("servicebusNamespace")] public Output<string> ServicebusNamespace { get; private set; } = null!; /// <summary> /// The shared access policy key for the specified shared access policy. /// </summary> [Output("sharedAccessPolicyKey")] public Output<string> SharedAccessPolicyKey { get; private set; } = null!; /// <summary> /// The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc. /// </summary> [Output("sharedAccessPolicyName")] public Output<string> SharedAccessPolicyName { get; private set; } = null!; /// <summary> /// The name of the Stream Analytics Job. Changing this forces a new resource to be created. /// </summary> [Output("streamAnalyticsJobName")] public Output<string> StreamAnalyticsJobName { get; private set; } = null!; /// <summary> /// Create a StreamInputEventHub 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 StreamInputEventHub(string name, StreamInputEventHubArgs args, CustomResourceOptions? options = null) : base("azure:streamanalytics/streamInputEventHub:StreamInputEventHub", name, args ?? new StreamInputEventHubArgs(), MakeResourceOptions(options, "")) { } private StreamInputEventHub(string name, Input<string> id, StreamInputEventHubState? state = null, CustomResourceOptions? options = null) : base("azure:streamanalytics/streamInputEventHub:StreamInputEventHub", name, state, 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 StreamInputEventHub 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="state">Any extra arguments used during the lookup.</param> /// <param name="options">A bag of options that control this resource's behavior</param> public static StreamInputEventHub Get(string name, Input<string> id, StreamInputEventHubState? state = null, CustomResourceOptions? options = null) { return new StreamInputEventHub(name, id, state, options); } } public sealed class StreamInputEventHubArgs : Pulumi.ResourceArgs { /// <summary> /// The name of an Event Hub Consumer Group that should be used to read events from the Event Hub. Specifying distinct consumer group names for multiple inputs allows each of those inputs to receive the same events from the Event Hub. If not set the input will use the Event Hub's default consumer group. /// </summary> [Input("eventhubConsumerGroupName")] public Input<string>? EventhubConsumerGroupName { get; set; } /// <summary> /// The name of the Event Hub. /// </summary> [Input("eventhubName", required: true)] public Input<string> EventhubName { get; set; } = null!; /// <summary> /// The name of the Stream Input EventHub. Changing this forces a new resource to be created. /// </summary> [Input("name")] public Input<string>? Name { get; set; } /// <summary> /// The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created. /// </summary> [Input("resourceGroupName", required: true)] public Input<string> ResourceGroupName { get; set; } = null!; /// <summary> /// A `serialization` block as defined below. /// </summary> [Input("serialization", required: true)] public Input<Inputs.StreamInputEventHubSerializationArgs> Serialization { get; set; } = null!; /// <summary> /// The namespace that is associated with the desired Event Hub, Service Bus Queue, Service Bus Topic, etc. /// </summary> [Input("servicebusNamespace", required: true)] public Input<string> ServicebusNamespace { get; set; } = null!; /// <summary> /// The shared access policy key for the specified shared access policy. /// </summary> [Input("sharedAccessPolicyKey", required: true)] public Input<string> SharedAccessPolicyKey { get; set; } = null!; /// <summary> /// The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc. /// </summary> [Input("sharedAccessPolicyName", required: true)] public Input<string> SharedAccessPolicyName { get; set; } = null!; /// <summary> /// The name of the Stream Analytics Job. Changing this forces a new resource to be created. /// </summary> [Input("streamAnalyticsJobName", required: true)] public Input<string> StreamAnalyticsJobName { get; set; } = null!; public StreamInputEventHubArgs() { } } public sealed class StreamInputEventHubState : Pulumi.ResourceArgs { /// <summary> /// The name of an Event Hub Consumer Group that should be used to read events from the Event Hub. Specifying distinct consumer group names for multiple inputs allows each of those inputs to receive the same events from the Event Hub. If not set the input will use the Event Hub's default consumer group. /// </summary> [Input("eventhubConsumerGroupName")] public Input<string>? EventhubConsumerGroupName { get; set; } /// <summary> /// The name of the Event Hub. /// </summary> [Input("eventhubName")] public Input<string>? EventhubName { get; set; } /// <summary> /// The name of the Stream Input EventHub. Changing this forces a new resource to be created. /// </summary> [Input("name")] public Input<string>? Name { get; set; } /// <summary> /// The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created. /// </summary> [Input("resourceGroupName")] public Input<string>? ResourceGroupName { get; set; } /// <summary> /// A `serialization` block as defined below. /// </summary> [Input("serialization")] public Input<Inputs.StreamInputEventHubSerializationGetArgs>? Serialization { get; set; } /// <summary> /// The namespace that is associated with the desired Event Hub, Service Bus Queue, Service Bus Topic, etc. /// </summary> [Input("servicebusNamespace")] public Input<string>? ServicebusNamespace { get; set; } /// <summary> /// The shared access policy key for the specified shared access policy. /// </summary> [Input("sharedAccessPolicyKey")] public Input<string>? SharedAccessPolicyKey { get; set; } /// <summary> /// The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc. /// </summary> [Input("sharedAccessPolicyName")] public Input<string>? SharedAccessPolicyName { get; set; } /// <summary> /// The name of the Stream Analytics Job. Changing this forces a new resource to be created. /// </summary> [Input("streamAnalyticsJobName")] public Input<string>? StreamAnalyticsJobName { get; set; } public StreamInputEventHubState() { } } }
46.836066
312
0.622191
[ "ECL-2.0", "Apache-2.0" ]
ScriptBox99/pulumi-azure
sdk/dotnet/StreamAnalytics/StreamInputEventHub.cs
14,285
C#
using API; using System.Collections.Generic; namespace PxStat.Data { internal class GeoLayer_ADO { /// <summary> /// ADO class parameter /// </summary> private ADO ado; internal GeoLayer_ADO(ADO ado) { this.ado = ado; } internal int Create(GeoLayer_DTO_Create dto, string userName) { var inputParams = new List<ADO_inputParams>() { new ADO_inputParams() {name ="@GlrName",value=dto.GlrName }, new ADO_inputParams() {name ="@CcnUsername",value= userName}, }; var returnParam = new ADO_returnParam() { name = "@ReturnVal", value = 0 }; ado.ExecuteNonQueryProcedure("Data_GeoLayer_Create", inputParams, ref returnParam); return (int)returnParam.value; } /// <summary> /// Reads one or more GeoLayer /// </summary> /// <param name="dto"></param> /// <returns></returns> internal List<dynamic> Read(GeoLayer_DTO_Read dto) { var inputParams = new List<ADO_inputParams>(); if (dto.GlrCode != null) inputParams.Add(new ADO_inputParams() { name = "@GlrCode", value = dto.GlrCode }); if (dto.GlrName != null) inputParams.Add(new ADO_inputParams() { name = "@GlrName", value = dto.GlrName }); return ado.ExecuteReaderProcedure("Data_GeoLayer_Read", inputParams).data; } internal int Update(GeoLayer_DTO_Update dto, string userName) { var inputParams = new List<ADO_inputParams>() { new ADO_inputParams() {name ="@GlrCode",value= dto.GlrCode }, new ADO_inputParams() {name ="@GlrName",value=dto.GlrName }, new ADO_inputParams() {name ="@CcnUsername",value= userName}, }; var returnParam = new ADO_returnParam() { name = "@ReturnVal", value = 0 }; ado.ExecuteNonQueryProcedure("Data_GeoLayer_Update", inputParams, ref returnParam); return (int)returnParam.value; } internal int Delete(GeoLayer_DTO_Delete dto, string userName) { var inputParams = new List<ADO_inputParams>() { new ADO_inputParams() {name ="@GlrCode",value= dto.GlrCode }, new ADO_inputParams() {name ="@CcnUsername",value= userName} }; var returnParam = new ADO_returnParam() { name = "@ReturnVal", value = 0 }; ado.ExecuteNonQueryProcedure("Data_GeoLayer_Delete", inputParams, ref returnParam); return (int)returnParam.value; } } }
31.382022
98
0.552811
[ "MIT" ]
CSOIreland/PxStat
server/PxStat/Entities/Data/GeoLayer/GeoLayer_ADO.cs
2,795
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.OpenStack.Identity.Outputs { [OutputType] public sealed class ApplicationCredentialAccessRule { /// <summary> /// The ID of the existing access rule. The access rule ID of /// another application credential can be provided. /// </summary> public readonly string? Id; /// <summary> /// The request method that the application credential is /// permitted to use for a given API endpoint. Allowed values: `POST`, `GET`, /// `HEAD`, `PATCH`, `PUT` and `DELETE`. /// </summary> public readonly string Method; /// <summary> /// The API path that the application credential is permitted /// to access. May use named wildcards such as **{tag}** or the unnamed wildcard /// **\*** to match against any string in the path up to a **/**, or the recursive /// wildcard **\*\*** to include **/** in the matched path. /// </summary> public readonly string Path; /// <summary> /// The service type identifier for the service that the /// application credential is granted to access. Must be a service type that is /// listed in the service catalog and not a code name for a service. E.g. /// **identity**, **compute**, **volumev3**, **image**, **network**, /// **object-store**, **sharev2**, **dns**, **key-manager**, **monitoring**, etc. /// </summary> public readonly string Service; [OutputConstructor] private ApplicationCredentialAccessRule( string? id, string method, string path, string service) { Id = id; Method = method; Path = path; Service = service; } } }
35.716667
90
0.587961
[ "ECL-2.0", "Apache-2.0" ]
ederst/pulumi-openstack
sdk/dotnet/Identity/Outputs/ApplicationCredentialAccessRule.cs
2,143
C#
/* * YtelAPIV3.Standard * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ using System; using System.Linq; using System.Collections.Generic; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using YtelAPIV3.Standard; using YtelAPIV3.Standard.Utilities; namespace YtelAPIV3.Standard.Models { [JsonConverter(typeof(StringValuedEnumConverter))] public enum Direction4Enum { ENUM_IN, //TODO: Write general description for this method ENUM_OUT, //TODO: Write general description for this method BOTH, //TODO: Write general description for this method } /// <summary> /// Helper for the enum type Direction4Enum /// </summary> public static class Direction4EnumHelper { //string values corresponding the enum elements private static List<string> stringValues = new List<string> { "in", "out", "both" }; /// <summary> /// Converts a Direction4Enum value to a corresponding string value /// </summary> /// <param name="enumValue">The Direction4Enum value to convert</param> /// <returns>The representative string value</returns> public static string ToValue(Direction4Enum enumValue) { switch(enumValue) { //only valid enum elements can be used //this is necessary to avoid errors case Direction4Enum.ENUM_IN: case Direction4Enum.ENUM_OUT: case Direction4Enum.BOTH: return stringValues[(int)enumValue]; //an invalid enum value was requested default: return null; } } /// <summary> /// Convert a list of Direction4Enum values to a list of strings /// </summary> /// <param name="enumValues">The list of Direction4Enum values to convert</param> /// <returns>The list of representative string values</returns> public static List<string> ToValue(List<Direction4Enum> enumValues) { if (null == enumValues) return null; return enumValues.Select(eVal => ToValue(eVal)).ToList(); } /// <summary> /// Converts a string value into Direction4Enum value /// </summary> /// <param name="value">The string value to parse</param> /// <returns>The parsed Direction4Enum value</returns> public static Direction4Enum ParseString(string value) { int index = stringValues.IndexOf(value); if(index < 0) throw new InvalidCastException(string.Format("Unable to cast value: {0} to type Direction4Enum", value)); return (Direction4Enum) index; } } }
35.864198
122
0.594492
[ "MIT" ]
mgrofsky/Ytel-API-.NET
YtelAPIV3.Standard/Models/Direction4Enum.cs
2,905
C#
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // 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("interfacebased")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("interfacebased")] [assembly: AssemblyCopyright("Copyright © 2019")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // 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")]
41.943396
96
0.758884
[ "MIT" ]
NolwennR/xaml-code-experiences
xaml.experiences/architecture/communication/interfacebased/Properties/AssemblyInfo.cs
2,226
C#
namespace ESFA.DC.ILR1819.ReportService.Stateless.Configuration { public sealed class ServiceBusOptions { public string AuditQueueName { get; set; } public string ServiceBusConnectionString { get; set; } public string TopicName { get; set; } public string ReportingSubscriptionName { get; set; } } }
24.857143
64
0.681034
[ "MIT" ]
SkillsFundingAgency/DC-ILR-1819-ReportService
src/ESFA.DC.ILR.ReportService.Stateless/Configuration/ServiceBusOptions.cs
350
C#
using System; using System.Windows.Forms; namespace Pixiv.Utilities.Ugoira.Convert.WebP { static class Program { /// <summary> /// 해당 응용 프로그램의 주 진입점입니다. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); } } }
21.7
65
0.571429
[ "MIT" ]
uhm0311/Ugoira-to-WebP-Converter
Workspace/CSharp/Application/Ugoira to WebP Convertor/Program.cs
468
C#
namespace BeatTogether.MasterServer.Kernel.Abstractions.Providers { public interface IRequestIdProvider { uint GetNextRequestId(); } }
19.5
66
0.724359
[ "MIT" ]
raftario/BeatTogether.MasterServer
BeatTogether.MasterServer.Kernel/Abstractions/Providers/IRequestIdProvider.cs
158
C#
#pragma warning disable 1591 //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.34014 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ [assembly: global::Android.Runtime.ResourceDesignerAttribute("Demo.Resource", IsApplication=true)] namespace Demo { [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] public partial class Resource { static Resource() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } public static void UpdateIdValues() { global::WakefulIntentService.Resource.String.ApplicationName = global::Demo.Resource.String.ApplicationName; global::WakefulIntentService.Resource.String.Hello = global::Demo.Resource.String.Hello; global::WakefulIntentService.Resource.Xml.wakeful = global::Demo.Resource.Xml.wakeful; } public partial class Attribute { static Attribute() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Attribute() { } } public partial class Drawable { // aapt resource value: 0x7f020000 public const int Icon = 2130837504; static Drawable() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Drawable() { } } public partial class Id { // aapt resource value: 0x7f060000 public const int MyButton = 2131099648; static Id() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Id() { } } public partial class Layout { // aapt resource value: 0x7f030000 public const int Main = 2130903040; static Layout() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Layout() { } } public partial class String { // aapt resource value: 0x7f050001 public const int ApplicationName = 2131034113; // aapt resource value: 0x7f050000 public const int Hello = 2131034112; static String() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private String() { } } public partial class Xml { // aapt resource value: 0x7f040000 public const int wakeful = 2130968576; static Xml() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Xml() { } } } } #pragma warning restore 1591
20.265152
111
0.625794
[ "Apache-2.0" ]
JonDouglas/xamarin-android-tutorials
Wakeful/Demo/Resources/Resource.Designer.cs
2,675
C#
 namespace Binance.Net.Enums { /// <summary> /// Margin level status /// </summary> public enum MarginLevelStatus { /// <summary> /// Excessive /// </summary> Excessive, /// <summary> /// Normal /// </summary> Normal, /// <summary> /// Margin call /// </summary> MarginCall, /// <summary> /// Pre-liquidation /// </summary> PreLiquidation, /// <summary> /// Force liquidation /// </summary> ForceLiquidation } }
19.258065
33
0.438861
[ "MIT" ]
Andres-MMG/Binance.Net
Binance.Net/Enums/MarginLevelStatus.cs
599
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("IsValidDnaSequence")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] [assembly: System.Reflection.AssemblyProductAttribute("IsValidDnaSequence")] [assembly: System.Reflection.AssemblyTitleAttribute("IsValidDnaSequence")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] // Generated by the MSBuild WriteCodeFragment class.
42.791667
81
0.640701
[ "MIT" ]
CirjaAdriana/tap2021-e02
CirjaAdriana/src/ClassLibrary1/IsValidDnaSequence/obj/Debug/netstandard2.0/IsValidDnaSequence.AssemblyInfo.cs
1,027
C#
using System; namespace Xamarin.Android.Prepare { partial class Configurables { partial class Urls { public static readonly Uri Corretto = new Uri ($"{Corretto_BaseUri}{CorrettoUrlPathVersion}/amazon-corretto-{CorrettoDistVersion}-macosx-x64.tar.gz"); public static readonly Uri MonoPackage = new Uri ("https://download.mono-project.com/archive/6.4.0/macos-10-universal/MonoFramework-MDK-6.4.0.198.macos10.xamarin.universal.pkg"); } partial class Defaults { public const string MacOSDeploymentTarget = "10.11"; public const string NativeLibraryExtension = ".dylib"; } partial class Paths { const string LibMonoSgenBaseName = "libmonosgen-2.0"; public const string MonoCrossRuntimeInstallPath = "Darwin"; public const string NdkToolchainOSTag = "darwin-x86_64"; public static readonly string UnstrippedLibMonoSgenName = $"{LibMonoSgenBaseName}.d{Defaults.NativeLibraryExtension}"; public static readonly string StrippedLibMonoSgenName = $"{LibMonoSgenBaseName}{Defaults.NativeLibraryExtension}"; } } }
35.1
181
0.765432
[ "MIT" ]
cherry003/xamarin-android
build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.MacOS.cs
1,053
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.ObjectModel; using System.Net.Http; using System.Web.Http.Controllers; namespace System.Web.Http { /// <summary> /// Specifies that an action supports the PATCH HTTP method. /// </summary> [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] public sealed class HttpPatchAttribute : Attribute, IActionHttpMethodProvider { private static readonly Collection<HttpMethod> _supportedMethods = new Collection<HttpMethod>(new HttpMethod[] { new HttpMethod("PATCH") }); public Collection<HttpMethod> HttpMethods { get { return _supportedMethods; } } } }
34.28
111
0.70245
[ "Apache-2.0" ]
belav/AspNetWebStack
src/System.Web.Http/HttpPatchAttribute.cs
859
C#
#pragma warning disable 108 // new keyword hiding #pragma warning disable 114 // new keyword hiding namespace Windows.Devices.SmartCards { #if __ANDROID__ || __IOS__ || NET46 || __WASM__ [global::Uno.NotImplemented] #endif public partial class SmartCardPinResetRequest { #if __ANDROID__ || __IOS__ || NET46 || __WASM__ [global::Uno.NotImplemented] public global::Windows.Storage.Streams.IBuffer Challenge { get { throw new global::System.NotImplementedException("The member IBuffer SmartCardPinResetRequest.Challenge is not implemented in Uno."); } } #endif #if __ANDROID__ || __IOS__ || NET46 || __WASM__ [global::Uno.NotImplemented] public global::System.DateTimeOffset Deadline { get { throw new global::System.NotImplementedException("The member DateTimeOffset SmartCardPinResetRequest.Deadline is not implemented in Uno."); } } #endif // Forced skipping of method Windows.Devices.SmartCards.SmartCardPinResetRequest.Challenge.get // Forced skipping of method Windows.Devices.SmartCards.SmartCardPinResetRequest.Deadline.get #if __ANDROID__ || __IOS__ || NET46 || __WASM__ [global::Uno.NotImplemented] public global::Windows.Devices.SmartCards.SmartCardPinResetDeferral GetDeferral() { throw new global::System.NotImplementedException("The member SmartCardPinResetDeferral SmartCardPinResetRequest.GetDeferral() is not implemented in Uno."); } #endif #if __ANDROID__ || __IOS__ || NET46 || __WASM__ [global::Uno.NotImplemented] public void SetResponse( global::Windows.Storage.Streams.IBuffer response) { global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.Devices.SmartCards.SmartCardPinResetRequest", "void SmartCardPinResetRequest.SetResponse(IBuffer response)"); } #endif } }
37.729167
195
0.764771
[ "Apache-2.0" ]
nv-ksavaria/Uno
src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.SmartCards/SmartCardPinResetRequest.cs
1,811
C#
// Copyright (c) Microsoft. 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 Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.Test.Utilities; using System; using Xunit; namespace Microsoft.CodeAnalysis.CSharp.UnitTests { public class SyntaxTriviaListTests : CSharpTestBase { [Fact] public void Equality() { var node1 = SyntaxFactory.Token(SyntaxKind.AbstractKeyword); var node2 = SyntaxFactory.Token(SyntaxKind.VirtualKeyword); EqualityTesting.AssertEqual(default(SyntaxTriviaList), default(SyntaxTriviaList)); EqualityTesting.AssertEqual(new SyntaxTriviaList(node1, node1.Node, 0, 0), new SyntaxTriviaList(node1, node1.Node, 0, 0)); EqualityTesting.AssertNotEqual(new SyntaxTriviaList(node1, node1.Node, 0, 1), new SyntaxTriviaList(node1, node1.Node, 0, 0)); EqualityTesting.AssertNotEqual(new SyntaxTriviaList(node1, node2.Node, 0, 0), new SyntaxTriviaList(node1, node1.Node, 0, 0)); EqualityTesting.AssertNotEqual(new SyntaxTriviaList(node2, node1.Node, 0, 0), new SyntaxTriviaList(node1, node1.Node, 0, 0)); // position not considered: EqualityTesting.AssertEqual(new SyntaxTriviaList(node1, node1.Node, 1, 0), new SyntaxTriviaList(node1, node1.Node, 0, 0)); } [Fact] public void Reverse_Equality() { var node1 = SyntaxFactory.Token(SyntaxKind.AbstractKeyword); var node2 = SyntaxFactory.Token(SyntaxKind.VirtualKeyword); EqualityTesting.AssertEqual(default(SyntaxTriviaList.Reversed), default(SyntaxTriviaList.Reversed)); EqualityTesting.AssertEqual(new SyntaxTriviaList(node1, node1.Node, 0, 0).Reverse(), new SyntaxTriviaList(node1, node1.Node, 0, 0).Reverse()); EqualityTesting.AssertNotEqual(new SyntaxTriviaList(node1, node1.Node, 0, 1).Reverse(), new SyntaxTriviaList(node1, node1.Node, 0, 0).Reverse()); EqualityTesting.AssertNotEqual(new SyntaxTriviaList(node1, node2.Node, 0, 0).Reverse(), new SyntaxTriviaList(node1, node1.Node, 0, 0).Reverse()); EqualityTesting.AssertNotEqual(new SyntaxTriviaList(node2, node1.Node, 0, 0).Reverse(), new SyntaxTriviaList(node1, node1.Node, 0, 0).Reverse()); // position not considered: EqualityTesting.AssertEqual(new SyntaxTriviaList(node1, node1.Node, 1, 0).Reverse(), new SyntaxTriviaList(node1, node1.Node, 0, 0).Reverse()); } [Fact] public void TestAddInsertRemoveReplace() { var list = SyntaxFactory.ParseLeadingTrivia("/*A*//*B*//*C*/"); Assert.Equal(3, list.Count); Assert.Equal("/*A*/", list[0].ToString()); Assert.Equal("/*B*/", list[1].ToString()); Assert.Equal("/*C*/", list[2].ToString()); Assert.Equal("/*A*//*B*//*C*/", list.ToFullString()); var elementA = list[0]; var elementB = list[1]; var elementC = list[2]; Assert.Equal(0, list.IndexOf(elementA)); Assert.Equal(1, list.IndexOf(elementB)); Assert.Equal(2, list.IndexOf(elementC)); var triviaD = SyntaxFactory.ParseLeadingTrivia("/*D*/")[0]; var triviaE = SyntaxFactory.ParseLeadingTrivia("/*E*/")[0]; var newList = list.Add(triviaD); Assert.Equal(4, newList.Count); Assert.Equal("/*A*//*B*//*C*//*D*/", newList.ToFullString()); newList = list.AddRange(new[] { triviaD, triviaE }); Assert.Equal(5, newList.Count); Assert.Equal("/*A*//*B*//*C*//*D*//*E*/", newList.ToFullString()); newList = list.Insert(0, triviaD); Assert.Equal(4, newList.Count); Assert.Equal("/*D*//*A*//*B*//*C*/", newList.ToFullString()); newList = list.Insert(1, triviaD); Assert.Equal(4, newList.Count); Assert.Equal("/*A*//*D*//*B*//*C*/", newList.ToFullString()); newList = list.Insert(2, triviaD); Assert.Equal(4, newList.Count); Assert.Equal("/*A*//*B*//*D*//*C*/", newList.ToFullString()); newList = list.Insert(3, triviaD); Assert.Equal(4, newList.Count); Assert.Equal("/*A*//*B*//*C*//*D*/", newList.ToFullString()); newList = list.InsertRange(0, new[] { triviaD, triviaE }); Assert.Equal(5, newList.Count); Assert.Equal("/*D*//*E*//*A*//*B*//*C*/", newList.ToFullString()); newList = list.InsertRange(1, new[] { triviaD, triviaE }); Assert.Equal(5, newList.Count); Assert.Equal("/*A*//*D*//*E*//*B*//*C*/", newList.ToFullString()); newList = list.InsertRange(2, new[] { triviaD, triviaE }); Assert.Equal(5, newList.Count); Assert.Equal("/*A*//*B*//*D*//*E*//*C*/", newList.ToFullString()); newList = list.InsertRange(3, new[] { triviaD, triviaE }); Assert.Equal(5, newList.Count); Assert.Equal("/*A*//*B*//*C*//*D*//*E*/", newList.ToFullString()); newList = list.RemoveAt(0); Assert.Equal(2, newList.Count); Assert.Equal("/*B*//*C*/", newList.ToFullString()); newList = list.RemoveAt(list.Count - 1); Assert.Equal(2, newList.Count); Assert.Equal("/*A*//*B*/", newList.ToFullString()); newList = list.Remove(elementA); Assert.Equal(2, newList.Count); Assert.Equal("/*B*//*C*/", newList.ToFullString()); newList = list.Remove(elementB); Assert.Equal(2, newList.Count); Assert.Equal("/*A*//*C*/", newList.ToFullString()); newList = list.Remove(elementC); Assert.Equal(2, newList.Count); Assert.Equal("/*A*//*B*/", newList.ToFullString()); newList = list.Replace(elementA, triviaD); Assert.Equal(3, newList.Count); Assert.Equal("/*D*//*B*//*C*/", newList.ToFullString()); newList = list.Replace(elementB, triviaD); Assert.Equal(3, newList.Count); Assert.Equal("/*A*//*D*//*C*/", newList.ToFullString()); newList = list.Replace(elementC, triviaD); Assert.Equal(3, newList.Count); Assert.Equal("/*A*//*B*//*D*/", newList.ToFullString()); newList = list.ReplaceRange(elementA, new[] { triviaD, triviaE }); Assert.Equal(4, newList.Count); Assert.Equal("/*D*//*E*//*B*//*C*/", newList.ToFullString()); newList = list.ReplaceRange(elementB, new[] { triviaD, triviaE }); Assert.Equal(4, newList.Count); Assert.Equal("/*A*//*D*//*E*//*C*/", newList.ToFullString()); newList = list.ReplaceRange(elementC, new[] { triviaD, triviaE }); Assert.Equal(4, newList.Count); Assert.Equal("/*A*//*B*//*D*//*E*/", newList.ToFullString()); newList = list.ReplaceRange(elementA, new SyntaxTrivia[] { }); Assert.Equal(2, newList.Count); Assert.Equal("/*B*//*C*/", newList.ToFullString()); newList = list.ReplaceRange(elementB, new SyntaxTrivia[] { }); Assert.Equal(2, newList.Count); Assert.Equal("/*A*//*C*/", newList.ToFullString()); newList = list.ReplaceRange(elementC, new SyntaxTrivia[] { }); Assert.Equal(2, newList.Count); Assert.Equal("/*A*//*B*/", newList.ToFullString()); Assert.Equal(-1, list.IndexOf(triviaD)); Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(-1, triviaD)); Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(list.Count + 1, triviaD)); Assert.Throws<ArgumentOutOfRangeException>(() => list.InsertRange(-1, new[] { triviaD })); Assert.Throws<ArgumentOutOfRangeException>(() => list.InsertRange(list.Count + 1, new[] { triviaD })); Assert.Throws<ArgumentOutOfRangeException>(() => list.RemoveAt(-1)); Assert.Throws<ArgumentOutOfRangeException>(() => list.RemoveAt(list.Count)); Assert.Throws<ArgumentException>(() => list.Add(default(SyntaxTrivia))); Assert.Throws<ArgumentException>(() => list.Insert(0, default(SyntaxTrivia))); Assert.Throws<ArgumentNullException>(() => list.AddRange((IEnumerable<SyntaxTrivia>)null)); Assert.Throws<ArgumentNullException>(() => list.InsertRange(0, (IEnumerable<SyntaxTrivia>)null)); Assert.Throws<ArgumentNullException>(() => list.ReplaceRange(elementA, (IEnumerable<SyntaxTrivia>)null)); } [Fact] public void TestAddInsertRemoveReplaceOnEmptyList() { DoTestAddInsertRemoveReplaceOnEmptyList(SyntaxFactory.ParseLeadingTrivia("/*A*/").RemoveAt(0)); DoTestAddInsertRemoveReplaceOnEmptyList(default(SyntaxTriviaList)); } private void DoTestAddInsertRemoveReplaceOnEmptyList(SyntaxTriviaList list) { Assert.Equal(0, list.Count); var triviaD = SyntaxFactory.ParseLeadingTrivia("/*D*/")[0]; var triviaE = SyntaxFactory.ParseLeadingTrivia("/*E*/")[0]; var newList = list.Add(triviaD); Assert.Equal(1, newList.Count); Assert.Equal("/*D*/", newList.ToFullString()); newList = list.AddRange(new[] { triviaD, triviaE }); Assert.Equal(2, newList.Count); Assert.Equal("/*D*//*E*/", newList.ToFullString()); newList = list.Insert(0, triviaD); Assert.Equal(1, newList.Count); Assert.Equal("/*D*/", newList.ToFullString()); newList = list.InsertRange(0, new[] { triviaD, triviaE }); Assert.Equal(2, newList.Count); Assert.Equal("/*D*//*E*/", newList.ToFullString()); newList = list.Remove(triviaD); Assert.Equal(0, newList.Count); Assert.Equal(-1, list.IndexOf(triviaD)); Assert.Throws<ArgumentOutOfRangeException>(() => list.RemoveAt(0)); Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(1, triviaD)); Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(-1, triviaD)); Assert.Throws<ArgumentOutOfRangeException>(() => list.InsertRange(1, new[] { triviaD })); Assert.Throws<ArgumentOutOfRangeException>(() => list.InsertRange(-1, new[] { triviaD })); Assert.Throws<ArgumentException>(() => list.Replace(triviaD, triviaE)); Assert.Throws<ArgumentException>(() => list.ReplaceRange(triviaD, new[] { triviaE })); Assert.Throws<ArgumentException>(() => list.Add(default(SyntaxTrivia))); Assert.Throws<ArgumentException>(() => list.Insert(0, default(SyntaxTrivia))); Assert.Throws<ArgumentNullException>(() => list.AddRange((IEnumerable<SyntaxTrivia>)null)); Assert.Throws<ArgumentNullException>(() => list.InsertRange(0, (IEnumerable<SyntaxTrivia>)null)); } [Fact] public void Extensions() { var list = SyntaxFactory.ParseLeadingTrivia("/*A*//*B*//*C*/"); Assert.Equal(0, list.IndexOf(SyntaxKind.MultiLineCommentTrivia)); Assert.True(list.Any(SyntaxKind.MultiLineCommentTrivia)); Assert.Equal(-1, list.IndexOf(SyntaxKind.SingleLineCommentTrivia)); Assert.False(list.Any(SyntaxKind.SingleLineCommentTrivia)); } } }
49.327731
161
0.598211
[ "Apache-2.0" ]
DavidKarlas/roslyn
src/Compilers/CSharp/Test/Syntax/Syntax/SyntaxTriviaListTests.cs
11,742
C#
using System.Security.Principal; namespace ShellyBrowserApp { public static class Utils { public static bool IsAdministrator() { return (new WindowsPrincipal(WindowsIdentity.GetCurrent())) .IsInRole(WindowsBuiltInRole.Administrator); } } }
21.642857
71
0.643564
[ "MIT" ]
bpetrikovics/ShellyBrowser
ShellyBrowser.App/Utils.cs
305
C#
/* Copyright (C) 2019 Alex Watt (alexwatt@hotmail.com) This file is part of Highlander Project https://github.com/alexanderwatt/Highlander.Net Highlander is free software: you can redistribute it and/or modify it under the terms of the Highlander license. You should have received a copy of the license along with this program; if not, license is available at <https://github.com/alexanderwatt/Highlander.Net/blob/develop/LICENSE>. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. */ using System; namespace Orion.Analytics.LinearAlgebra { /// <summary>LU Decomposition.</summary> /// <remarks> /// For an m-by-n matrix A with m >= n, the LU decomposition is an m-by-n /// unit lower triangular matrix L, an n-by-n upper triangular matrix U, /// and a permutation vector piv of length m so that A(piv,:) = L*U. /// <c> If m &lt; n, then L is m-by-m and U is m-by-n. </c> /// The LU decompostion with pivoting always exists, even if the matrix is /// singular, so the constructor will never fail. The primary use of the /// LU decomposition is in the solution of square systems of simultaneous /// linear equations. This will fail if IsNonSingular() returns false. /// </remarks> [Serializable] public class LUDecomposition { #region Class variables /// <summary>Array for internal storage of decomposition.</summary> private readonly Matrix _lu; /// <summary>Row dimensions.</summary> private int m => _lu.RowCount; /// <summary>Column dimensions.</summary> private int n => _lu.ColumnCount; /// <summary>Pivot sign.</summary> private readonly int _pivsign; /// <summary>Internal storage of pivot vector.</summary> private readonly int[] _piv; #endregion #region Constructor /// <summary>LU Decomposition</summary> /// <param name="A"> Rectangular matrix /// </param> /// <returns> Structure to access L, U and piv. /// </returns> public LUDecomposition(Matrix A) { // Use a "left-looking", dot-product, Crout/Doolittle algorithm. _lu = A.Clone(); _piv = new int[m]; for (int i = 0; i < m; i++) { _piv[i] = i; } _pivsign = 1; //double[] LUrowi; var LUcolj = new double[m]; // Outer loop. for (int j = 0; j < n; j++) { // Make a copy of the j-th column to localize references. for (int i = 0; i < m; i++) { LUcolj[i] = _lu[i, j]; } // Apply previous transformations. for (int i = 0; i < m; i++) { //LUrowi = LU[i]; // Most of the time is spent in the following dot product. int kmax = Math.Min(i, j); double s = 0.0; for (int k = 0; k < kmax; k++) { s += _lu[i,k] * LUcolj[k]; } _lu[i,j] = LUcolj[i] -= s; } // Find pivot and exchange if necessary. int p = j; for (int i = j + 1; i < m; i++) { if (Math.Abs(LUcolj[i]) > Math.Abs(LUcolj[p])) { p = i; } } if (p != j) { for (int k = 0; k < n; k++) { double t = _lu[p, k]; _lu[p, k] = _lu[j, k]; _lu[j, k] = t; } int k2 = _piv[p]; _piv[p] = _piv[j]; _piv[j] = k2; _pivsign = - _pivsign; } // Compute multipliers. if (j < m & _lu[j, j] != 0.0) { for (int i = j + 1; i < m; i++) { _lu[i, j] /= _lu[j, j]; } } } } #endregion // Constructor #region Public Properties /// <summary>Indicates whether the matrix is nonsingular.</summary> /// <returns><c>true</c> if U, and hence A, is nonsingular.</returns> public bool IsNonSingular { get { for (int j = 0; j < n; j++) if (_lu[j, j] == 0) return false; return true; } } /// <summary>Gets lower triangular factor.</summary> public Matrix L { get { // TODO: bad behavior of this property // this property does not always return the same matrix var X = new Matrix(m, n); Matrix L = X; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (i > j) { L[i, j] = _lu[i, j]; } else L[i, j] = i == j ? 1.0 : 0.0; } } return X; } } /// <summary>Gets upper triangular factor.</summary> public Matrix U { get { // TODO: bad behavior of this property // this property does not always return the same matrix var X = new Matrix(n, n); Matrix U = X; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { U[i, j] = i <= j ? _lu[i, j] : 0.0; } } return X; } } /// <summary>Gets pivot permutation vector</summary> public int[] Pivot { get { // TODO: bad behavior of this property // this property does not always return the same matrix var p = new int[m]; for (int i = 0; i < m; i++) { p[i] = _piv[i]; } return p; } } /// <summary>Returns pivot permutation vector as a one-dimensional double array.</summary> public double[] DoublePivot { get { // TODO: bad behavior of this property // this property does not always return the same matrix var vals = new double[m]; for (int i = 0; i < m; i++) { vals[i] = _piv[i]; } return vals; } } #endregion #region Public Methods /// <summary>Determinant</summary> /// <returns>det(A)</returns> /// <exception cref="System.ArgumentException">Matrix must be square</exception> public double Determinant() { if (m != n) { throw new ArgumentException("Matrix must be square."); } double d = _pivsign; for (int j = 0; j < n; j++) { d *= _lu[j, j]; } return d; } /// <summary>Solve A*X = B</summary> /// <param name="B">A Matrix with as many rows as A and any number of columns.</param> /// <returns>X so that L*U*X = B(piv,:)</returns> /// <exception cref="System.ArgumentException">Matrix row dimensions must agree.</exception> /// <exception cref="System.SystemException">Matrix is singular.</exception> public Matrix Solve(Matrix B) { if (B.RowCount != m) { throw new ArgumentException("Matrix row dimensions must agree."); } if (!IsNonSingular) { throw new SystemException("Matrix is singular."); } // Copy right hand side with pivoting int nx = B.ColumnCount; Matrix Xmat = B.GetMatrix(_piv, 0, nx - 1); Matrix X = Xmat; // Solve L*Y = B(piv,:) for (int k = 0; k < n; k++) { for (int i = k + 1; i < n; i++) { for (int j = 0; j < nx; j++) { X[i, j] -= X[k, j] * _lu[i, k]; } } } // Solve U*X = Y; for (int k = n - 1; k >= 0; k--) { for (int j = 0; j < nx; j++) { X[k, j] /= _lu[k, k]; } for (int i = 0; i < k; i++) { for (int j = 0; j < nx; j++) { X[i, j] -= X[k, j] * _lu[i, k]; } } } return Xmat; } #endregion // Public Methods } }
31.304918
100
0.41527
[ "BSD-3-Clause" ]
mmrath/Highlander.Net
Metadata/FpML.V5r3/FpML.V5r3.Reporting.Analytics/LinearAlgebra/LUDecomposition.cs
9,548
C#
using Microsoft.SqlServer.Server; using SInvader_Core.i8080; using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; using System.Reflection.Emit; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace i8080_Disassembler.BusinessLayer { public class BusinessManager { byte[] buffer = new byte[64 * 1024]; Instructions _instructions = Instructions.Get(); public bool LoadFileInMemoryAt(string path, long offset) { bool response = true; try { long startingAddress = offset; using (FileStream stream = new FileStream(path, FileMode.Open)) { int numBytesToRead = (int)stream.Length; buffer = new byte[numBytesToRead + offset]; if (numBytesToRead > 0) { do { byte value = (byte)stream.ReadByte(); buffer[startingAddress] = value; numBytesToRead -= 1; startingAddress += 1; } while (numBytesToRead > 0); } } } catch { response = false; } //PUTTING A RET TO RETURN FROM BDOS CALL buffer[0x05] = 0xC9; return response; } public void Disassembly(string inputFullPath, string outputFullPath, int offset) { int programCounter = offset; if (LoadFileInMemoryAt(inputFullPath, offset)) { using (StreamWriter sw = new StreamWriter(outputFullPath)) { for (int count = offset; count < buffer.Length; count++) { byte opcode = buffer[count]; Instruction instruction; if (_instructions.TryGetValue(opcode, out instruction)) { string parsedInstruction = ParseMnemonic(instruction, count); switch (instruction.length) { case 1: sw.WriteLine("{0:X4} {1:X2} {2}", count, buffer[count], parsedInstruction); break; case 2: sw.WriteLine("{0:X4} {1:X2} {2:X2} {3}", count, buffer[count], buffer[count + 1], parsedInstruction); count += 1; break; case 3: sw.WriteLine("{0:X4} {1:X2} {2:X2} {3:X2} {4}", count, buffer[count], buffer[count + 1], buffer[count + 2], parsedInstruction); count += 2; break; } } else { throw new Exception("Unimplemented instruction"); } } } } } public string ParseMnemonic(Instruction instruction, int count) { string response = instruction.mnemonic; List<string> splitted = instruction.mnemonic.Split(',').ToList(); if (splitted.Count > 1) { if (splitted.Contains("d8")) response = String.Format("{0},{1:X2}", splitted[0], buffer[count + 1]); else if (splitted.Contains("a16")) response = String.Format("{0},{1:X4}", splitted[0], (buffer[count + 2] << 8 | buffer[count + 1])); } else { if (instruction.mnemonic.Contains("d8")) response = instruction.mnemonic.Replace("d8", buffer[count + 1].ToString("X2")); else if (instruction.mnemonic.Contains("a16")) response = instruction.mnemonic.Replace("a16", ((buffer[count + 2] << 8) | buffer[count + 1]).ToString("X4")); } return response; } } }
37.536585
172
0.424518
[ "MIT" ]
Miguelito79/SpaceInvaders
i8080_Disassembler/BusinessLayer/BusinessManager.cs
4,619
C#
namespace GokoSite.Services.Data { using System; using System.Collections.Generic; using RiotSharp.Endpoints.MatchEndpoint; public class TeamsService : ITeamsService { public long GetTotalGoldByPlayers(List<ParticipantIdentity> participantIdentities, List<Participant> participants, int teamId) { if (participantIdentities == null) { throw new ArgumentNullException("participantIdentities", "The participants identities must not be null."); } if (participants == null) { throw new ArgumentNullException("participants", "The participants must not be null."); } if (teamId != 100 && teamId != 200) { throw new ArgumentException("Invalid Team Id. It must be 100(first team) or 200(second team)!"); } long totalGold = 0; for (int i = 0; i < participants.Count; i++) { if (teamId == participants[i].TeamId && participants[i].ParticipantId == participantIdentities[i].ParticipantId) { totalGold += participants[i].Stats.GoldEarned; } } return totalGold; } } }
31.560976
134
0.562597
[ "MIT" ]
NikolaViktorov/GOKO-Community-website
Services/GokoSite.Services.Data/TeamsService.cs
1,296
C#
using System.Reflection; using System.Runtime.CompilerServices; using Android.App; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("Fizzly.Droid")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("${AuthorCopyright}")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion("1.0.0")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")]
36.25
82
0.744828
[ "MIT" ]
bryce-klinker/fizz-xamarin
Native/src/Droid/Properties/AssemblyInfo.cs
1,017
C#
/// Generated - Do Not Edit namespace BABYLON { using System; using System.Collections.Generic; using System.Text.Json.Serialization; using System.Threading.Tasks; using EventHorizon.Blazor.Interop; using EventHorizon.Blazor.Interop.Callbacks; using EventHorizon.Blazor.Interop.ResultCallbacks; using Microsoft.JSInterop; [JsonConverter(typeof(CachedEntityConverter<EventState>))] public class EventState : CachedEntityObject { #region Static Accessors #endregion #region Static Properties #endregion #region Static Methods #endregion #region Accessors #endregion #region Properties public bool skipNextObservers { get { return EventHorizonBlazorInterop.Get<bool>( this.___guid, "skipNextObservers" ); } set { EventHorizonBlazorInterop.Set( this.___guid, "skipNextObservers", value ); } } public decimal mask { get { return EventHorizonBlazorInterop.Get<decimal>( this.___guid, "mask" ); } set { EventHorizonBlazorInterop.Set( this.___guid, "mask", value ); } } public CachedEntity target { get { return EventHorizonBlazorInterop.GetClass<CachedEntity>( this.___guid, "target", (entity) => { return new CachedEntity() { ___guid = entity.___guid }; } ); } set { EventHorizonBlazorInterop.Set( this.___guid, "target", value ); } } public CachedEntity currentTarget { get { return EventHorizonBlazorInterop.GetClass<CachedEntity>( this.___guid, "currentTarget", (entity) => { return new CachedEntity() { ___guid = entity.___guid }; } ); } set { EventHorizonBlazorInterop.Set( this.___guid, "currentTarget", value ); } } public CachedEntity lastReturnValue { get { return EventHorizonBlazorInterop.GetClass<CachedEntity>( this.___guid, "lastReturnValue", (entity) => { return new CachedEntity() { ___guid = entity.___guid }; } ); } set { EventHorizonBlazorInterop.Set( this.___guid, "lastReturnValue", value ); } } public CachedEntity userInfo { get { return EventHorizonBlazorInterop.GetClass<CachedEntity>( this.___guid, "userInfo", (entity) => { return new CachedEntity() { ___guid = entity.___guid }; } ); } set { EventHorizonBlazorInterop.Set( this.___guid, "userInfo", value ); } } #endregion #region Constructor public EventState() : base() { } public EventState( ICachedEntity entity ) : base(entity) { ___guid = entity.___guid; } public EventState( decimal mask, System.Nullable<bool> skipNextObservers = null, object target = null, object currentTarget = null ) { var entity = EventHorizonBlazorInterop.New( new string[] { "BABYLON", "EventState" }, mask, skipNextObservers, target, currentTarget ); ___guid = entity.___guid; } #endregion #region Methods public EventState initalize(decimal mask, System.Nullable<bool> skipNextObservers = null, object target = null, object currentTarget = null) { return EventHorizonBlazorInterop.FuncClass<EventState>( entity => new EventState() { ___guid = entity.___guid }, new object[] { new string[] { this.___guid, "initalize" }, mask, skipNextObservers, target, currentTarget } ); } #endregion } }
25.258216
148
0.419703
[ "MIT" ]
badcommandorfilename/EventHorizon.Blazor.TypeScript.Interop.Generator
Sample/_generated/EventHorizon.Blazor.BabylonJS.WASM/EventState.cs
5,380
C#
/* * Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the cloudtrail-2013-11-01.normal.json service model. */ using System; using System.Runtime.ExceptionServices; using System.Threading; using System.Threading.Tasks; using System.Collections.Generic; using Amazon.CloudTrail.Model; using Amazon.CloudTrail.Model.Internal.MarshallTransformations; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.CloudTrail { /// <summary> /// Implementation for accessing CloudTrail /// /// AWS CloudTrail /// <para> /// This is the CloudTrail API Reference. It provides descriptions of actions, data types, /// common parameters, and common errors for CloudTrail. /// </para> /// /// <para> /// CloudTrail is a web service that records AWS API calls for your AWS account and delivers /// log files to an Amazon S3 bucket. The recorded information includes the identity of /// the user, the start time of the AWS API call, the source IP address, the request parameters, /// and the response elements returned by the service. /// </para> /// <note> /// <para> /// As an alternative to the API, you can use one of the AWS SDKs, which consist of libraries /// and sample code for various programming languages and platforms (Java, Ruby, .NET, /// iOS, Android, etc.). The SDKs provide a convenient way to create programmatic access /// to AWSCloudTrail. For example, the SDKs take care of cryptographically signing requests, /// managing errors, and retrying requests automatically. For information about the AWS /// SDKs, including how to download and install them, see the <a href="http://aws.amazon.com/tools/">Tools /// for Amazon Web Services page</a>. /// </para> /// </note> /// <para> /// See the <a href="http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html">AWS /// CloudTrail User Guide</a> for information about the data that is included with each /// AWS API call listed in the log files. /// </para> /// </summary> public partial class AmazonCloudTrailClient : AmazonServiceClient, IAmazonCloudTrail { #region Constructors #if CORECLR /// <summary> /// Constructs AmazonCloudTrailClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// <code> /// &lt;?xml version="1.0" encoding="utf-8" ?&gt; /// &lt;configuration&gt; /// &lt;appSettings&gt; /// &lt;add key="AWSProfileName" value="AWS Default"/&gt; /// &lt;/appSettings&gt; /// &lt;/configuration&gt; /// </code> /// /// </summary> public AmazonCloudTrailClient() : base(FallbackCredentialsFactory.GetCredentials(), new AmazonCloudTrailConfig()) { } /// <summary> /// Constructs AmazonCloudTrailClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// <code> /// &lt;?xml version="1.0" encoding="utf-8" ?&gt; /// &lt;configuration&gt; /// &lt;appSettings&gt; /// &lt;add key="AWSProfileName" value="AWS Default"/&gt; /// &lt;/appSettings&gt; /// &lt;/configuration&gt; /// </code> /// /// </summary> /// <param name="region">The region to connect.</param> public AmazonCloudTrailClient(RegionEndpoint region) : base(FallbackCredentialsFactory.GetCredentials(), new AmazonCloudTrailConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonCloudTrailClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// <code> /// &lt;?xml version="1.0" encoding="utf-8" ?&gt; /// &lt;configuration&gt; /// &lt;appSettings&gt; /// &lt;add key="AWSProfileName" value="AWS Default"/&gt; /// &lt;/appSettings&gt; /// &lt;/configuration&gt; /// </code> /// /// </summary> /// <param name="config">The AmazonCloudTrailClient Configuration Object</param> public AmazonCloudTrailClient(AmazonCloudTrailConfig config) : base(FallbackCredentialsFactory.GetCredentials(), config) { } #endif /// <summary> /// Constructs AmazonCloudTrailClient with AWS Credentials /// </summary> /// <param name="credentials">AWS Credentials</param> public AmazonCloudTrailClient(AWSCredentials credentials) : this(credentials, new AmazonCloudTrailConfig()) { } /// <summary> /// Constructs AmazonCloudTrailClient with AWS Credentials /// </summary> /// <param name="credentials">AWS Credentials</param> /// <param name="region">The region to connect.</param> public AmazonCloudTrailClient(AWSCredentials credentials, RegionEndpoint region) : this(credentials, new AmazonCloudTrailConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonCloudTrailClient with AWS Credentials and an /// AmazonCloudTrailClient Configuration object. /// </summary> /// <param name="credentials">AWS Credentials</param> /// <param name="clientConfig">The AmazonCloudTrailClient Configuration Object</param> public AmazonCloudTrailClient(AWSCredentials credentials, AmazonCloudTrailConfig clientConfig) : base(credentials, clientConfig) { } /// <summary> /// Constructs AmazonCloudTrailClient with AWS Access Key ID and AWS Secret Key /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> public AmazonCloudTrailClient(string awsAccessKeyId, string awsSecretAccessKey) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonCloudTrailConfig()) { } /// <summary> /// Constructs AmazonCloudTrailClient with AWS Access Key ID and AWS Secret Key /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="region">The region to connect.</param> public AmazonCloudTrailClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonCloudTrailConfig() {RegionEndpoint=region}) { } /// <summary> /// Constructs AmazonCloudTrailClient with AWS Access Key ID, AWS Secret Key and an /// AmazonCloudTrailClient Configuration object. /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="clientConfig">The AmazonCloudTrailClient Configuration Object</param> public AmazonCloudTrailClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonCloudTrailConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, clientConfig) { } /// <summary> /// Constructs AmazonCloudTrailClient with AWS Access Key ID and AWS Secret Key /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="awsSessionToken">AWS Session Token</param> public AmazonCloudTrailClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonCloudTrailConfig()) { } /// <summary> /// Constructs AmazonCloudTrailClient with AWS Access Key ID and AWS Secret Key /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="awsSessionToken">AWS Session Token</param> /// <param name="region">The region to connect.</param> public AmazonCloudTrailClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonCloudTrailConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonCloudTrailClient with AWS Access Key ID, AWS Secret Key and an /// AmazonCloudTrailClient Configuration object. /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="awsSessionToken">AWS Session Token</param> /// <param name="clientConfig">The AmazonCloudTrailClient Configuration Object</param> public AmazonCloudTrailClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonCloudTrailConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig) { } #endregion #region Overrides /// <summary> /// Creates the signer for the service. /// </summary> protected override AbstractAWSSigner CreateSigner() { return new AWS4Signer(); } #endregion #region Dispose /// <summary> /// Disposes the service client. /// </summary> protected override void Dispose(bool disposing) { base.Dispose(disposing); } #endregion #region AddTags internal virtual AddTagsResponse AddTags(AddTagsRequest request) { var marshaller = new AddTagsRequestMarshaller(); var unmarshaller = AddTagsResponseUnmarshaller.Instance; return Invoke<AddTagsRequest,AddTagsResponse>(request, marshaller, unmarshaller); } /// <summary> /// Initiates the asynchronous execution of the AddTags operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AddTags operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/AddTags">REST API Reference for AddTags Operation</seealso> public virtual Task<AddTagsResponse> AddTagsAsync(AddTagsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AddTagsRequestMarshaller(); var unmarshaller = AddTagsResponseUnmarshaller.Instance; return InvokeAsync<AddTagsRequest,AddTagsResponse>(request, marshaller, unmarshaller, cancellationToken); } #endregion #region CreateTrail internal virtual CreateTrailResponse CreateTrail(CreateTrailRequest request) { var marshaller = new CreateTrailRequestMarshaller(); var unmarshaller = CreateTrailResponseUnmarshaller.Instance; return Invoke<CreateTrailRequest,CreateTrailResponse>(request, marshaller, unmarshaller); } /// <summary> /// Initiates the asynchronous execution of the CreateTrail operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateTrail operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateTrail">REST API Reference for CreateTrail Operation</seealso> public virtual Task<CreateTrailResponse> CreateTrailAsync(CreateTrailRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateTrailRequestMarshaller(); var unmarshaller = CreateTrailResponseUnmarshaller.Instance; return InvokeAsync<CreateTrailRequest,CreateTrailResponse>(request, marshaller, unmarshaller, cancellationToken); } #endregion #region DeleteTrail internal virtual DeleteTrailResponse DeleteTrail(DeleteTrailRequest request) { var marshaller = new DeleteTrailRequestMarshaller(); var unmarshaller = DeleteTrailResponseUnmarshaller.Instance; return Invoke<DeleteTrailRequest,DeleteTrailResponse>(request, marshaller, unmarshaller); } /// <summary> /// Initiates the asynchronous execution of the DeleteTrail operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteTrail operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteTrail">REST API Reference for DeleteTrail Operation</seealso> public virtual Task<DeleteTrailResponse> DeleteTrailAsync(DeleteTrailRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteTrailRequestMarshaller(); var unmarshaller = DeleteTrailResponseUnmarshaller.Instance; return InvokeAsync<DeleteTrailRequest,DeleteTrailResponse>(request, marshaller, unmarshaller, cancellationToken); } #endregion #region DescribeTrails internal virtual DescribeTrailsResponse DescribeTrails() { return DescribeTrails(new DescribeTrailsRequest()); } internal virtual DescribeTrailsResponse DescribeTrails(DescribeTrailsRequest request) { var marshaller = new DescribeTrailsRequestMarshaller(); var unmarshaller = DescribeTrailsResponseUnmarshaller.Instance; return Invoke<DescribeTrailsRequest,DescribeTrailsResponse>(request, marshaller, unmarshaller); } /// <summary> /// Retrieves settings for the trail associated with the current region for your account. /// </summary> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DescribeTrails service method, as returned by CloudTrail.</returns> /// <exception cref="Amazon.CloudTrail.Model.OperationNotPermittedException"> /// This exception is thrown when the requested operation is not permitted. /// </exception> /// <exception cref="Amazon.CloudTrail.Model.UnsupportedOperationException"> /// This exception is thrown when the requested operation is not supported. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DescribeTrails">REST API Reference for DescribeTrails Operation</seealso> public virtual Task<DescribeTrailsResponse> DescribeTrailsAsync(System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { return DescribeTrailsAsync(new DescribeTrailsRequest(), cancellationToken); } /// <summary> /// Initiates the asynchronous execution of the DescribeTrails operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeTrails operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DescribeTrails">REST API Reference for DescribeTrails Operation</seealso> public virtual Task<DescribeTrailsResponse> DescribeTrailsAsync(DescribeTrailsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeTrailsRequestMarshaller(); var unmarshaller = DescribeTrailsResponseUnmarshaller.Instance; return InvokeAsync<DescribeTrailsRequest,DescribeTrailsResponse>(request, marshaller, unmarshaller, cancellationToken); } #endregion #region GetEventSelectors internal virtual GetEventSelectorsResponse GetEventSelectors(GetEventSelectorsRequest request) { var marshaller = new GetEventSelectorsRequestMarshaller(); var unmarshaller = GetEventSelectorsResponseUnmarshaller.Instance; return Invoke<GetEventSelectorsRequest,GetEventSelectorsResponse>(request, marshaller, unmarshaller); } /// <summary> /// Initiates the asynchronous execution of the GetEventSelectors operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetEventSelectors operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetEventSelectors">REST API Reference for GetEventSelectors Operation</seealso> public virtual Task<GetEventSelectorsResponse> GetEventSelectorsAsync(GetEventSelectorsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new GetEventSelectorsRequestMarshaller(); var unmarshaller = GetEventSelectorsResponseUnmarshaller.Instance; return InvokeAsync<GetEventSelectorsRequest,GetEventSelectorsResponse>(request, marshaller, unmarshaller, cancellationToken); } #endregion #region GetTrailStatus internal virtual GetTrailStatusResponse GetTrailStatus(GetTrailStatusRequest request) { var marshaller = new GetTrailStatusRequestMarshaller(); var unmarshaller = GetTrailStatusResponseUnmarshaller.Instance; return Invoke<GetTrailStatusRequest,GetTrailStatusResponse>(request, marshaller, unmarshaller); } /// <summary> /// Initiates the asynchronous execution of the GetTrailStatus operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetTrailStatus operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrailStatus">REST API Reference for GetTrailStatus Operation</seealso> public virtual Task<GetTrailStatusResponse> GetTrailStatusAsync(GetTrailStatusRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new GetTrailStatusRequestMarshaller(); var unmarshaller = GetTrailStatusResponseUnmarshaller.Instance; return InvokeAsync<GetTrailStatusRequest,GetTrailStatusResponse>(request, marshaller, unmarshaller, cancellationToken); } #endregion #region ListPublicKeys internal virtual ListPublicKeysResponse ListPublicKeys(ListPublicKeysRequest request) { var marshaller = new ListPublicKeysRequestMarshaller(); var unmarshaller = ListPublicKeysResponseUnmarshaller.Instance; return Invoke<ListPublicKeysRequest,ListPublicKeysResponse>(request, marshaller, unmarshaller); } /// <summary> /// Initiates the asynchronous execution of the ListPublicKeys operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListPublicKeys operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListPublicKeys">REST API Reference for ListPublicKeys Operation</seealso> public virtual Task<ListPublicKeysResponse> ListPublicKeysAsync(ListPublicKeysRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ListPublicKeysRequestMarshaller(); var unmarshaller = ListPublicKeysResponseUnmarshaller.Instance; return InvokeAsync<ListPublicKeysRequest,ListPublicKeysResponse>(request, marshaller, unmarshaller, cancellationToken); } #endregion #region ListTags internal virtual ListTagsResponse ListTags(ListTagsRequest request) { var marshaller = new ListTagsRequestMarshaller(); var unmarshaller = ListTagsResponseUnmarshaller.Instance; return Invoke<ListTagsRequest,ListTagsResponse>(request, marshaller, unmarshaller); } /// <summary> /// Initiates the asynchronous execution of the ListTags operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListTags operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTags">REST API Reference for ListTags Operation</seealso> public virtual Task<ListTagsResponse> ListTagsAsync(ListTagsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ListTagsRequestMarshaller(); var unmarshaller = ListTagsResponseUnmarshaller.Instance; return InvokeAsync<ListTagsRequest,ListTagsResponse>(request, marshaller, unmarshaller, cancellationToken); } #endregion #region LookupEvents internal virtual LookupEventsResponse LookupEvents(LookupEventsRequest request) { var marshaller = new LookupEventsRequestMarshaller(); var unmarshaller = LookupEventsResponseUnmarshaller.Instance; return Invoke<LookupEventsRequest,LookupEventsResponse>(request, marshaller, unmarshaller); } /// <summary> /// Initiates the asynchronous execution of the LookupEvents operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the LookupEvents operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/LookupEvents">REST API Reference for LookupEvents Operation</seealso> public virtual Task<LookupEventsResponse> LookupEventsAsync(LookupEventsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new LookupEventsRequestMarshaller(); var unmarshaller = LookupEventsResponseUnmarshaller.Instance; return InvokeAsync<LookupEventsRequest,LookupEventsResponse>(request, marshaller, unmarshaller, cancellationToken); } #endregion #region PutEventSelectors internal virtual PutEventSelectorsResponse PutEventSelectors(PutEventSelectorsRequest request) { var marshaller = new PutEventSelectorsRequestMarshaller(); var unmarshaller = PutEventSelectorsResponseUnmarshaller.Instance; return Invoke<PutEventSelectorsRequest,PutEventSelectorsResponse>(request, marshaller, unmarshaller); } /// <summary> /// Initiates the asynchronous execution of the PutEventSelectors operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PutEventSelectors operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutEventSelectors">REST API Reference for PutEventSelectors Operation</seealso> public virtual Task<PutEventSelectorsResponse> PutEventSelectorsAsync(PutEventSelectorsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PutEventSelectorsRequestMarshaller(); var unmarshaller = PutEventSelectorsResponseUnmarshaller.Instance; return InvokeAsync<PutEventSelectorsRequest,PutEventSelectorsResponse>(request, marshaller, unmarshaller, cancellationToken); } #endregion #region RemoveTags internal virtual RemoveTagsResponse RemoveTags(RemoveTagsRequest request) { var marshaller = new RemoveTagsRequestMarshaller(); var unmarshaller = RemoveTagsResponseUnmarshaller.Instance; return Invoke<RemoveTagsRequest,RemoveTagsResponse>(request, marshaller, unmarshaller); } /// <summary> /// Initiates the asynchronous execution of the RemoveTags operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RemoveTags operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RemoveTags">REST API Reference for RemoveTags Operation</seealso> public virtual Task<RemoveTagsResponse> RemoveTagsAsync(RemoveTagsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RemoveTagsRequestMarshaller(); var unmarshaller = RemoveTagsResponseUnmarshaller.Instance; return InvokeAsync<RemoveTagsRequest,RemoveTagsResponse>(request, marshaller, unmarshaller, cancellationToken); } #endregion #region StartLogging internal virtual StartLoggingResponse StartLogging(StartLoggingRequest request) { var marshaller = new StartLoggingRequestMarshaller(); var unmarshaller = StartLoggingResponseUnmarshaller.Instance; return Invoke<StartLoggingRequest,StartLoggingResponse>(request, marshaller, unmarshaller); } /// <summary> /// Initiates the asynchronous execution of the StartLogging operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the StartLogging operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartLogging">REST API Reference for StartLogging Operation</seealso> public virtual Task<StartLoggingResponse> StartLoggingAsync(StartLoggingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new StartLoggingRequestMarshaller(); var unmarshaller = StartLoggingResponseUnmarshaller.Instance; return InvokeAsync<StartLoggingRequest,StartLoggingResponse>(request, marshaller, unmarshaller, cancellationToken); } #endregion #region StopLogging internal virtual StopLoggingResponse StopLogging(StopLoggingRequest request) { var marshaller = new StopLoggingRequestMarshaller(); var unmarshaller = StopLoggingResponseUnmarshaller.Instance; return Invoke<StopLoggingRequest,StopLoggingResponse>(request, marshaller, unmarshaller); } /// <summary> /// Initiates the asynchronous execution of the StopLogging operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the StopLogging operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StopLogging">REST API Reference for StopLogging Operation</seealso> public virtual Task<StopLoggingResponse> StopLoggingAsync(StopLoggingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new StopLoggingRequestMarshaller(); var unmarshaller = StopLoggingResponseUnmarshaller.Instance; return InvokeAsync<StopLoggingRequest,StopLoggingResponse>(request, marshaller, unmarshaller, cancellationToken); } #endregion #region UpdateTrail internal virtual UpdateTrailResponse UpdateTrail(UpdateTrailRequest request) { var marshaller = new UpdateTrailRequestMarshaller(); var unmarshaller = UpdateTrailResponseUnmarshaller.Instance; return Invoke<UpdateTrailRequest,UpdateTrailResponse>(request, marshaller, unmarshaller); } /// <summary> /// Initiates the asynchronous execution of the UpdateTrail operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateTrail operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateTrail">REST API Reference for UpdateTrail Operation</seealso> public virtual Task<UpdateTrailResponse> UpdateTrailAsync(UpdateTrailRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateTrailRequestMarshaller(); var unmarshaller = UpdateTrailResponseUnmarshaller.Instance; return InvokeAsync<UpdateTrailRequest,UpdateTrailResponse>(request, marshaller, unmarshaller, cancellationToken); } #endregion } }
47.230245
194
0.67332
[ "Apache-2.0" ]
Murcho/aws-sdk-net
sdk/src/Services/CloudTrail/Generated/_mobile/AmazonCloudTrailClient.cs
34,667
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using YC.Core.Autofac; namespace YC.Core { public interface ITenant: IDependencyInjectionSupport { public int TenantId { get; set; } public int TenantDbType { get; set; } public string TenantDbString{ get; set; } } }
20.833333
56
0.690667
[ "Apache-2.0" ]
boozzh/yc.boilerplate
src/Backstage/BasicLayer/YC.Core/Tenant/ITenant.cs
377
C#
namespace AAWebSmartHouse.WebApi.Models.User.ResponseModels { using System.Collections.Generic; using System.Linq; using AAWebSmartHouse.Data.Models; using AAWebSmartHouse.WebApi.Infrastructure.Mappings; using AutoMapper; public class RoomDetailsResponseModel : IMapFrom<Room>, IHaveCustomMappings { public int RoomId { get; set; } public string RoomName { get; set; } public string RoomDescription { get; set; } public int HouseId { get; set; } public IEnumerable<int> SensorsIds { get; set; } public void CreateMappings(IConfiguration config) { config.CreateMap<Room, RoomDetailsResponseModel>() .ForMember(m => m.SensorsIds, opts => opts.MapFrom(r => r.Sensors.Select(s => s.SensorId))); } } }
28.586207
108
0.655006
[ "MIT" ]
Obelixx/AASmartHouse
AAWebSmartHouse/WebApi/AAWebSmartHouse.WebApi/Models/User/ResponseModels/RoomDetailsResponseModel.cs
831
C#
using System; namespace Neo.VM { public class CatchableException : Exception { public CatchableException(string message) : base(message) { } } }
15.166667
65
0.60989
[ "MIT" ]
Ashuaidehao/neo-vm
src/neo-vm/CatchableException.cs
182
C#
using System.Reflection; using System.Runtime.InteropServices; // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 // アセンブリに関連付けられている情報を変更するには、 // これらの属性値を変更してください。 [assembly: AssemblyTitle("NHK4Net.Console")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("NHK4Net.Console")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // ComVisible を false に設定すると、このアセンブリ内の型は COM コンポーネントから // 参照できなくなります。COM からこのアセンブリ内の型にアクセスする必要がある場合は、 // その型の ComVisible 属性を true に設定してください。 [assembly: ComVisible(false)] // このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります [assembly: Guid("27ba9eaf-ec18-4dac-b519-ef58e0967824")] // アセンブリのバージョン情報は次の 4 つの値で構成されています: // // メジャー バージョン // マイナー バージョン // ビルド番号 // Revision // // すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます // 既定値にすることができます: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
29.166667
56
0.746667
[ "MIT" ]
monmaru/NHK4Net
NHK4Net.Console/Properties/AssemblyInfo.cs
1,637
C#
// ============================================================================================================== // Microsoft patterns & practices // CQRS Journey project // ============================================================================================================== // ©2012 Microsoft. All rights reserved. Certain content used with permission from contributors // http://cqrsjourney.github.com/contributors/members // 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 Infrastructure.Azure.Utils { using System; using System.Threading; using System.Threading.Tasks; internal class TaskEx { /// <summary> /// Starts a Task that will complete after the specified due time. /// </summary> /// <param name="dueTime">The delay in milliseconds before the returned task completes.</param> /// <returns> /// The timed Task. /// </returns> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "Timer is disposed in the timer callback")] public static Task Delay(int dueTime) { if (dueTime <= 0) throw new ArgumentOutOfRangeException("dueTime"); var tcs = new TaskCompletionSource<bool>(); var timer = new Timer(self => { ((Timer)self).Dispose(); tcs.TrySetResult(true); }); timer.Change(dueTime, Timeout.Infinite); return tcs.Task; } } }
49.222222
188
0.549436
[ "Apache-2.0" ]
jdom/cqrs-journey-code
source/Infrastructure/Azure/Infrastructure.Azure/Utils/TaskEx.cs
2,218
C#
namespace etcetera { public class EtcdMachineResponse { public string Name { get; set; } public string State { get; set; } public string ClientUrl { get; set; } public string PeerUrl { get; set; } } }
25.4
46
0.566929
[ "Apache-2.0" ]
drusellers/etcetera
etcetera/Machines/EtcdMachineResponse.cs
256
C#