content
stringlengths
5
1.04M
avg_line_length
float64
1.75
12.9k
max_line_length
int64
2
244k
alphanum_fraction
float64
0
0.98
licenses
list
repository_name
stringlengths
7
92
path
stringlengths
3
249
size
int64
5
1.04M
lang
stringclasses
2 values
using System; using System.Collections.Generic; using Assets.Scripts.Controller; using Assets.Scripts.Lib.Net; using Assets.Scripts.Proto; namespace Assets.Scripts.Controller { public class ChatController : Controller { private static ChatController instance; public static ChatController GetInstance() { if (instance == null) instance = new ChatController(); return instance; } protected override void RegistListener() { } public void SendGMMessage(string cmd) { C2S_GM_CMD msg = new C2S_GM_CMD(); msg.protocolID = (byte)KC2S_Protocol.c2s_gm_cmd; msg.command = cmd; SendMessage(msg); } } }
24.25
60
0.601804
[ "MIT" ]
moto2002/DinaGameClient
Assets/Scripts/Controller/ChatController.cs
778
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class EventTester : MonoBehaviour { public void TestDualVector(Vector3 a, Vector3 b) { Debug.Log($"a: {a} || b: {b}"); } public void TestEmpty() { Debug.Log("Event Called!"); } public void TestVectorBoolean(Vector3 a, bool b) { Debug.Log($"a: {a} || b: {b}"); } }
19.090909
52
0.580952
[ "MIT" ]
Polygon-us/PruebaTecnicaPlantillaTechArt
Assets/EventTester.cs
420
C#
namespace Contoso.App { partial class MainForm { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.mainUserControl = new MainUserControl(this); //((System.ComponentModel.ISupportInitialize)(this.mainUserControl)).BeginInit(); this.SuspendLayout(); // // mainUserControl // this.mainUserControl.Dock = System.Windows.Forms.DockStyle.Fill; this.mainUserControl.Location = new System.Drawing.Point(0, 0); this.mainUserControl.Name = "mainUserControl"; this.mainUserControl.Size = new System.Drawing.Size(1194, 474); this.mainUserControl.TabIndex = 0; this.mainUserControl.TabStop = false; // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 30F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1194, 474); this.Controls.Add(this.mainUserControl); this.Name = "MainForm"; this.Text = "Main Form"; //((System.ComponentModel.ISupportInitialize)(this.mainUserControl)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Control mainUserControl; } }
34.8125
107
0.573609
[ "MIT" ]
Bhaskers-Blu-Org2/Xaml-Islands-Samples
Standalone_Samples/Contoso/App/MainForm.Designer.cs
2,230
C#
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.ServiceModel.Web; using System.Text; namespace TC3BasicHttpTransportMessageCredUserName { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together. [ServiceContract] public interface IService1 { [OperationContract] string GetData(int value); [OperationContract] CompositeType GetDataUsingDataContract(CompositeType composite); // TODO: Add your service operations here } // Use a data contract as illustrated in the sample below to add composite types to service operations. [DataContract] public class CompositeType { bool boolValue = true; string stringValue = "Hello "; [DataMember] public bool BoolValue { get { return boolValue; } set { boolValue = value; } } [DataMember] public string StringValue { get { return stringValue; } set { stringValue = value; } } } }
25.333333
148
0.648026
[ "MIT" ]
kanikaul-amazon/TestProjects
net472/WCFSupportTestSuite/TC3BasicHttpTransportMessageCredUserName/IService1.cs
1,218
C#
using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("LVK.AppCore.Windows.Wpf.Tests")]
34.333333
63
0.825243
[ "MIT" ]
FeatureToggleStudy/LVK
src/LVK.AppCore.Windows.Wpf/AssemblyAttributes.cs
103
C#
// The MIT License (MIT) // // Copyright (c) Andrew Armstrong/FacticiusVir 2019 // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // This file was automatically generated and should not be edited directly. using System; namespace SharpVk.Interop.Multivendor { /// <summary> /// /// </summary> public unsafe delegate SharpVk.Result VkDeviceCreateValidationCacheDelegate(SharpVk.Interop.Device device, SharpVk.Interop.Multivendor.ValidationCacheCreateInfo* createInfo, SharpVk.Interop.AllocationCallbacks* allocator, SharpVk.Interop.Multivendor.ValidationCache* validationCache); }
47.911765
288
0.771025
[ "MIT" ]
Y-Less/SharpVk
src/SharpVk/Interop/Multivendor/VkDeviceCreateValidationCacheDelegate.gen.cs
1,629
C#
// Copyright ©2017 Copper Mountain Technologies // // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR // ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH // THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("HotKeys")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Copper Mountain Technologies")] [assembly: AssemblyProduct("HotKeys")] [assembly: AssemblyCopyright("Copyright © 2017 Copper Mountain Technologies. All Rights Reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("bceae2d0-f941-4b9e-9ded-b3dc439793a1")] // 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.1.0.0")] [assembly: AssemblyFileVersion("1.1.0.0")]
52.285714
149
0.766979
[ "MIT" ]
Copper-Mountain-Technologies/HotKeys-Plugin
HotKeys/Properties/AssemblyInfo.cs
2,566
C#
///////////////////////////////////////////////////////////////////// // Copyright (c) Autodesk, Inc. All rights reserved // Written by Forge Design Automation team for Inventor // // Permission to use, copy, modify, and distribute this software in // object code form for any purpose and without fee is hereby granted, // provided that the above copyright notice appears in all copies and // that both that copyright notice and the limited warranty and // restricted rights notice below appear in all supporting // documentation. // // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE // UNINTERRUPTED OR ERROR FREE. ///////////////////////////////////////////////////////////////////// using System.Collections.Generic; using System.IO; using System.Threading.Tasks; using Autodesk.Forge.Core; using Autodesk.Forge.Model; namespace webapplication.Services { public enum ObjectAccess { Read, Write, ReadWrite } public interface IForgeOSS { /// <summary> /// Forge configuration. /// </summary> ForgeConfiguration Configuration { get; } Task<List<ObjectDetails>> GetBucketObjectsAsync(string bucketKey, string? beginsWith = null); Task<List<string>> GetBucketsAsync(); Task CreateBucketAsync(string bucketKey); Task DeleteBucketAsync(string bucketKey); Task UploadObjectAsync(string bucketKey, string objectName, Stream stream); Task UploadChunkAsync(string bucketKey, string objectName, string contentRange, string sessionId, Stream stream); /// <summary> /// Generate a signed URL to OSS object. /// NOTE: An empty object created if not exists. /// </summary> /// <param name="bucketKey">Bucket key.</param> /// <param name="objectName">Object name.</param> /// <param name="access">Requested access to the object.</param> /// <param name="minutesExpiration">Minutes while the URL is valid. Default is 30 minutes.</param> /// <returns>Signed URL</returns> Task<string> CreateSignedUrlAsync(string bucketKey, string objectName, ObjectAccess access = ObjectAccess.Read, int minutesExpiration = 30); /// <summary> /// Rename object. /// </summary> /// <param name="bucketKey">Bucket key.</param> /// <param name="oldName">Old object name.</param> /// <param name="newName">New object name.</param> Task RenameObjectAsync(string bucketKey, string oldName, string newName); Task<Autodesk.Forge.Client.ApiResponse<dynamic>> GetObjectAsync(string bucketKey, string objectName); /// <summary> /// Copy OSS object. /// </summary> Task CopyAsync(string bucketKey, string fromName, string toName); /// <summary> /// Delete OSS object. /// </summary> Task DeleteAsync(string bucketKey, string objectName); /// <summary> /// Download OSS file. /// </summary> Task DownloadFileAsync(string bucketKey, string objectName, string localFullName); /// <summary> /// Get profile for the user with the access token. /// </summary> /// <param name="token">Oxygen access token.</param> /// <returns>Dynamic object with User Profile</returns> /// <remarks> /// User Profile fields: https://forge.autodesk.com/en/docs/oauth/v2/reference/http/users-@me-GET/#body-structure-200 /// </remarks> Task<dynamic> GetProfileAsync(string token); } }
39.663158
148
0.63535
[ "MIT" ]
Developer-Autodesk/forge-configurator-inventor
WebApplication/Services/IForgeOSS.cs
3,768
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("MVC_Intro")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("MVC_Intro")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("f7cf9601-6ab5-4d9f-885f-b2c5e4e10e8c")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
37.527778
84
0.747594
[ "MIT" ]
lynnsamuelson/MVC_Intro
MVC_Intro/MVC_Intro/Properties/AssemblyInfo.cs
1,354
C#
/* * Copyright 2012-2017 The Pkcs11Interop Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * Written for the Pkcs11Interop project by: * Jaroslav IMRICH <jimrich@jimrich.sk> */ using System.Collections.Generic; using Net.Pkcs11Interop.Common; using Net.Pkcs11Interop.HighLevelAPI40; using NUnit.Framework; using NativeULong = System.UInt32; namespace Net.Pkcs11Interop.Tests.HighLevelAPI40 { /// <summary> /// CreateObject, DestroyObject, CopyObject and GetObjectSize tests. /// </summary> [TestFixture()] public class _15_CreateCopyDestroyObjectTest { /// <summary> /// CreateObject and DestroyObject test. /// </summary> [Test()] public void _01_CreateDestroyObjectTest() { Helpers.CheckPlatform(); using (Pkcs11 pkcs11 = new Pkcs11(Settings.Pkcs11LibraryPath, Settings.AppType)) { // Find first slot with token present Slot slot = Helpers.GetUsableSlot(pkcs11); // Open RW session using (Session session = slot.OpenSession(SessionType.ReadWrite)) { // Login as normal user session.Login(CKU.CKU_USER, Settings.NormalUserPin); // Prepare attribute template of new data object List<ObjectAttribute> objectAttributes = new List<ObjectAttribute>(); objectAttributes.Add(new ObjectAttribute(CKA.CKA_CLASS, CKO.CKO_DATA)); objectAttributes.Add(new ObjectAttribute(CKA.CKA_TOKEN, true)); objectAttributes.Add(new ObjectAttribute(CKA.CKA_APPLICATION, Settings.ApplicationName)); objectAttributes.Add(new ObjectAttribute(CKA.CKA_LABEL, Settings.ApplicationName)); objectAttributes.Add(new ObjectAttribute(CKA.CKA_VALUE, "Data object content")); // Create object ObjectHandle objectHandle = session.CreateObject(objectAttributes); // Do something interesting with new object // Destroy object session.DestroyObject(objectHandle); session.Logout(); } } } /// <summary> /// CopyObject test. /// </summary> [Test()] public void _02_CopyObjectTest() { Helpers.CheckPlatform(); using (Pkcs11 pkcs11 = new Pkcs11(Settings.Pkcs11LibraryPath, Settings.AppType)) { // Find first slot with token present Slot slot = Helpers.GetUsableSlot(pkcs11); // Open RW session using (Session session = slot.OpenSession(SessionType.ReadWrite)) { // Login as normal user session.Login(CKU.CKU_USER, Settings.NormalUserPin); // Create object that can be copied ObjectHandle objectHandle = Helpers.CreateDataObject(session); // Copy object ObjectHandle copiedObjectHandle = session.CopyObject(objectHandle, null); // Do something interesting with new object session.DestroyObject(copiedObjectHandle); session.DestroyObject(objectHandle); session.Logout(); } } } /// <summary> /// GetObjectSize test. /// </summary> [Test()] public void _03_GetObjectSizeTest() { Helpers.CheckPlatform(); using (Pkcs11 pkcs11 = new Pkcs11(Settings.Pkcs11LibraryPath, Settings.AppType)) { // Find first slot with token present Slot slot = Helpers.GetUsableSlot(pkcs11); // Open RW session using (Session session = slot.OpenSession(SessionType.ReadWrite)) { // Login as normal user session.Login(CKU.CKU_USER, Settings.NormalUserPin); // Create object ObjectHandle objectHandle = Helpers.CreateDataObject(session); // Determine object size NativeULong objectSize = session.GetObjectSize(objectHandle); // Do something interesting with object size Assert.IsTrue(objectSize > 0); session.DestroyObject(objectHandle); session.Logout(); } } } } }
36.744828
109
0.557995
[ "Apache-2.0" ]
arkkadin/pkcs11Interop
src/Pkcs11Interop/Pkcs11InteropTests/HighLevelAPI40/_15_CreateCopyDestroyObjectTest.cs
5,328
C#
using System.Reflection; using NSubstitute; using Xunit.v3; namespace Xunit.Runner.MSBuild.Visitors { public class TeamCityDisplayNameFormatterTests { public TeamCityDisplayNameFormatter ClassUnderTest = new TeamCityDisplayNameFormatter(); public class DisplayName_Test : TeamCityDisplayNameFormatterTests { [Fact] public void UsesDisplayName() { var test = Substitute.For<_ITest>(); test.DisplayName.Returns("Display Name"); var result = ClassUnderTest.DisplayName(test); Assert.Equal("Display Name", result); } } public class DisplayName_TestCollection : TeamCityDisplayNameFormatterTests { [Fact] public void UsesAssemblyIndex() { var firstCollection = Mocks.TestCollection(Assembly.GetExecutingAssembly(), displayName: "Display Name"); var secondCollection = Mocks.TestCollection(typeof(int).Assembly, displayName: "Display Name"); var firstResult = ClassUnderTest.DisplayName(firstCollection); var secondResult = ClassUnderTest.DisplayName(secondCollection); Assert.Equal("Display Name (1)", firstResult); Assert.Equal("Display Name (2)", secondResult); } } } }
27.52381
109
0.74827
[ "Apache-2.0" ]
MichaelTrikergiotis/xun
src/xunit.v3.runner.msbuild.tests/Utility/TeamCityDisplayNameFormatterTests.cs
1,158
C#
using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Data.Migrations { public partial class CourierIdNullableInOrder : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Orders_Couriers_CourierId", table: "Orders"); migrationBuilder.AlterColumn<int>( name: "CourierId", table: "Orders", type: "int", nullable: true, oldClrType: typeof(int), oldType: "int"); migrationBuilder.AddForeignKey( name: "FK_Orders_Couriers_CourierId", table: "Orders", column: "CourierId", principalTable: "Couriers", principalColumn: "Id"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Orders_Couriers_CourierId", table: "Orders"); migrationBuilder.AlterColumn<int>( name: "CourierId", table: "Orders", type: "int", nullable: false, defaultValue: 0, oldClrType: typeof(int), oldType: "int", oldNullable: true); migrationBuilder.AddForeignKey( name: "FK_Orders_Couriers_CourierId", table: "Orders", column: "CourierId", principalTable: "Couriers", principalColumn: "Id", onDelete: ReferentialAction.Restrict); } } }
30.754386
71
0.517969
[ "MIT" ]
AchoVasilev/BgAirsoft
serverAPI/AirsoftServer/Data/Migrations/20220415154027_CourierIdNullableInOrder.cs
1,755
C#
using System; using System.Threading.Tasks; using System.Windows.Forms; using AltoControls; using AntDeployWinform.Util; namespace AntDeployWinform.Models { public enum ServerType { IIS, DOCKER, WINSERVICE, LINUXSERVICE } public class ProgressBox : GroupBox { public static bool IsEnableGroup = false; public CircularProgressBar.CircularProgressBar progress_iis_build; public CircularProgressBar.CircularProgressBar progress_iis_package; public CircularProgressBar.CircularProgressBar progress_iis_upload; public CircularProgressBar.CircularProgressBar progress_iis_deploy; private System.Windows.Forms.Button b_build_end; private System.Windows.Forms.Button b_package_end; private System.Windows.Forms.Button b_upload_end; private System.Windows.Forms.Label label29; private System.Windows.Forms.TextBox FireUrlText; public System.Windows.Forms.CheckBox CheckBox; private AltoControls.AltoButton HostoryButton; public ServerType ServerType { get; set; } public BaseServer Server { get; set; } public ProgressBox(System.Drawing.Point location, BaseServer server, ServerType serverType,Action<ServerType,BaseServer> LoadHistoryAction) { this.ServerType = serverType; this.Server = server; this.Location = location; var Progressheight = 36; var buttonHeight = Progressheight + 31; this.Size = new System.Drawing.Size(546, 130); this.TabStop = false; this.SuspendLayout(); this.label29 = new System.Windows.Forms.Label(); this.progress_iis_build = new CircularProgressBar.CircularProgressBar(); this.progress_iis_package = new CircularProgressBar.CircularProgressBar(); this.progress_iis_upload = new CircularProgressBar.CircularProgressBar(); this.progress_iis_deploy = new CircularProgressBar.CircularProgressBar(); this.b_build_end = new System.Windows.Forms.Button(); this.b_package_end = new System.Windows.Forms.Button(); this.b_upload_end = new System.Windows.Forms.Button(); this.FireUrlText = new System.Windows.Forms.TextBox(); this.CheckBox = new System.Windows.Forms.CheckBox(); HostoryButton = new AltoButton(); this.CheckBox.Location = new System.Drawing.Point(10, Progressheight - 20); this.CheckBox.Size = new System.Drawing.Size(20, 20); this.CheckBox.Checked = false; this.CheckBox.Visible = IsEnableGroup; // // label29 // this.label29.AutoSize = true; this.label29.Location = new System.Drawing.Point(42, Progressheight - 15); this.label29.Size = new System.Drawing.Size(107, 12); this.label29.Text = "Fire Url:"; // // txt_iis_website_url // this.FireUrlText.Location = new System.Drawing.Point(120, Progressheight - 20); this.FireUrlText.Size = new System.Drawing.Size(322, 21); if (serverType.Equals(ServerType.IIS)) { this.FireUrlText.Text = server.IIsFireUrl; } if (serverType.Equals(ServerType.DOCKER)) { this.FireUrlText.Text = server.DockerFireUrl; } if (serverType.Equals(ServerType.LINUXSERVICE)) { this.FireUrlText.Text = server.LinuxServiceFireUrl; } if (serverType.Equals(ServerType.WINSERVICE)) { this.FireUrlText.Text = server.WindowsServiceFireUrl; } // // progress_iis_build // this.progress_iis_build.Anchor = System.Windows.Forms.AnchorStyles.None; this.progress_iis_build.AnimationFunction = WinFormAnimation.KnownAnimationFunctions.Liner; this.progress_iis_build.AnimationSpeed = 500; this.progress_iis_build.BackColor = System.Drawing.Color.Transparent; this.progress_iis_build.Font = new System.Drawing.Font("Arial", 13F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(178))); this.progress_iis_build.ForeColor = System.Drawing.Color.Red; this.progress_iis_build.InnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.progress_iis_build.InnerMargin = 0; this.progress_iis_build.InnerWidth = -1; this.progress_iis_build.Location = new System.Drawing.Point(42, Progressheight); this.progress_iis_build.MarqueeAnimationSpeed = 2000; this.progress_iis_build.OuterColor = System.Drawing.Color.Gray; this.progress_iis_build.OuterMargin = -25; this.progress_iis_build.OuterWidth = 22; this.progress_iis_build.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_build.ProgressWidth = 15; this.progress_iis_build.SecondaryFont = new System.Drawing.Font("Microsoft Sans Serif", 10F); this.progress_iis_build.Size = new System.Drawing.Size(84, 77); this.progress_iis_build.StartAngle = 270; this.progress_iis_build.SubscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_build.SubscriptMargin = new System.Windows.Forms.Padding(0); this.progress_iis_build.SubscriptText = ""; this.progress_iis_build.SuperscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_build.SuperscriptMargin = new System.Windows.Forms.Padding(-23, 0, 0, 0); this.progress_iis_build.SuperscriptText = "Wait"; this.progress_iis_build.TabIndex = 9; this.progress_iis_build.Text = "Build"; this.progress_iis_build.TextMargin = new System.Windows.Forms.Padding(10, 8, 0, 0); this.progress_iis_build.Style = System.Windows.Forms.ProgressBarStyle.Marquee; this.progress_iis_build.Value = 0; // // progress_iis_package // this.progress_iis_package.Anchor = System.Windows.Forms.AnchorStyles.None; this.progress_iis_package.AnimationFunction = WinFormAnimation.KnownAnimationFunctions.Liner; this.progress_iis_package.AnimationSpeed = 500; this.progress_iis_package.BackColor = System.Drawing.Color.Transparent; this.progress_iis_package.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(178))); this.progress_iis_package.ForeColor = System.Drawing.Color.Red; this.progress_iis_package.InnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.progress_iis_package.InnerMargin = 0; this.progress_iis_package.InnerWidth = -1; this.progress_iis_package.Location = new System.Drawing.Point(162, Progressheight); this.progress_iis_package.MarqueeAnimationSpeed = 2000; this.progress_iis_package.OuterColor = System.Drawing.Color.Gray; this.progress_iis_package.OuterMargin = -25; this.progress_iis_package.OuterWidth = 22; this.progress_iis_package.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_package.ProgressWidth = 15; this.progress_iis_package.SecondaryFont = new System.Drawing.Font("Microsoft Sans Serif", 10F); this.progress_iis_package.Size = new System.Drawing.Size(84, 77); this.progress_iis_package.StartAngle = 270; this.progress_iis_package.SubscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_package.SubscriptMargin = new System.Windows.Forms.Padding(0); this.progress_iis_package.SubscriptText = ""; this.progress_iis_package.SuperscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_package.SuperscriptMargin = new System.Windows.Forms.Padding(-26, 0, 0, 0); this.progress_iis_package.SuperscriptText = "0%"; this.progress_iis_package.TabIndex = 10; this.progress_iis_package.Text = "Package"; this.progress_iis_package.TextMargin = new System.Windows.Forms.Padding(10, 8, 0, 0); this.progress_iis_package.Style = System.Windows.Forms.ProgressBarStyle.Marquee; this.progress_iis_package.Value = 0; // // progress_iis_upload // this.progress_iis_upload.Anchor = System.Windows.Forms.AnchorStyles.None; this.progress_iis_upload.AnimationFunction = WinFormAnimation.KnownAnimationFunctions.Liner; this.progress_iis_upload.AnimationSpeed = 500; this.progress_iis_upload.BackColor = System.Drawing.Color.Transparent; this.progress_iis_upload.Font = new System.Drawing.Font("Arial", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(178))); this.progress_iis_upload.ForeColor = System.Drawing.Color.Red; this.progress_iis_upload.InnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.progress_iis_upload.InnerMargin = 0; this.progress_iis_upload.InnerWidth = -1; this.progress_iis_upload.Location = new System.Drawing.Point(282, Progressheight); this.progress_iis_upload.MarqueeAnimationSpeed = 2000; this.progress_iis_upload.OuterColor = System.Drawing.Color.Gray; this.progress_iis_upload.OuterMargin = -25; this.progress_iis_upload.OuterWidth = 22; this.progress_iis_upload.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_upload.ProgressWidth = 15; this.progress_iis_upload.SecondaryFont = new System.Drawing.Font("Microsoft Sans Serif", 10F); this.progress_iis_upload.Size = new System.Drawing.Size(84, 77); this.progress_iis_upload.StartAngle = 270; this.progress_iis_upload.SubscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_upload.SubscriptMargin = new System.Windows.Forms.Padding(0); this.progress_iis_upload.SubscriptText = ""; this.progress_iis_upload.SuperscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_upload.SuperscriptMargin = new System.Windows.Forms.Padding(-26, 0, 0, 0); this.progress_iis_upload.SuperscriptText = "0%"; this.progress_iis_upload.TabIndex = 11; this.progress_iis_upload.Text = "Upload"; this.progress_iis_upload.TextMargin = new System.Windows.Forms.Padding(10, 8, 0, 0); this.progress_iis_upload.Style = System.Windows.Forms.ProgressBarStyle.Marquee; this.progress_iis_upload.Value = 0; // // progress_iis_deploy // this.progress_iis_deploy.Anchor = System.Windows.Forms.AnchorStyles.None; this.progress_iis_deploy.AnimationFunction = WinFormAnimation.KnownAnimationFunctions.Liner; this.progress_iis_deploy.AnimationSpeed = 500; this.progress_iis_deploy.BackColor = System.Drawing.Color.Transparent; this.progress_iis_deploy.Font = new System.Drawing.Font("Arial", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(178))); this.progress_iis_deploy.ForeColor = System.Drawing.Color.Red; this.progress_iis_deploy.InnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.progress_iis_deploy.InnerMargin = 0; this.progress_iis_deploy.InnerWidth = -1; this.progress_iis_deploy.Location = new System.Drawing.Point(402, Progressheight); this.progress_iis_deploy.MarqueeAnimationSpeed = 2000; this.progress_iis_deploy.OuterColor = System.Drawing.Color.Gray; this.progress_iis_deploy.OuterMargin = -25; this.progress_iis_deploy.OuterWidth = 22; this.progress_iis_deploy.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_deploy.ProgressWidth = 15; this.progress_iis_deploy.SecondaryFont = new System.Drawing.Font("Microsoft Sans Serif", 10F); this.progress_iis_deploy.Size = new System.Drawing.Size(92, 77); this.progress_iis_deploy.StartAngle = 270; this.progress_iis_deploy.SubscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_deploy.SubscriptMargin = new System.Windows.Forms.Padding(0); this.progress_iis_deploy.SubscriptText = ""; this.progress_iis_deploy.SuperscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_deploy.SuperscriptMargin = new System.Windows.Forms.Padding(-28, 0, 0, 0); this.progress_iis_deploy.SuperscriptText = "Wait"; this.progress_iis_deploy.TabIndex = 12; this.progress_iis_deploy.Text = "Deploy"; this.progress_iis_deploy.TextMargin = new System.Windows.Forms.Padding(12, 8, 0, 0); this.progress_iis_deploy.Style = System.Windows.Forms.ProgressBarStyle.Marquee; this.progress_iis_deploy.Value = 0; // // b_build_end // this.b_build_end.Location = new System.Drawing.Point(113, buttonHeight); this.b_build_end.BackColor = System.Drawing.Color.LightGray; this.b_build_end.Size = new System.Drawing.Size(76, 19); this.b_build_end.TabIndex = 17; this.b_build_end.UseVisualStyleBackColor = true; // // b_package_end // this.b_package_end.Location = new System.Drawing.Point(234, buttonHeight); this.b_package_end.BackColor = System.Drawing.Color.LightGray; this.b_package_end.Size = new System.Drawing.Size(76, 19); this.b_package_end.TabIndex = 18; this.b_package_end.UseVisualStyleBackColor = true; // // b_upload_end // this.b_upload_end.Location = new System.Drawing.Point(358, buttonHeight); this.b_upload_end.BackColor = System.Drawing.Color.LightGray; this.b_upload_end.Size = new System.Drawing.Size(76, 19); this.b_upload_end.TabIndex = 19; this.b_upload_end.UseVisualStyleBackColor = true; this.HostoryButton.Location = new System.Drawing.Point(this.FireUrlText.Location.X+ this.FireUrlText.Width+20, Progressheight - 20); this.HostoryButton.Size = new System.Drawing.Size(60, 20); this.HostoryButton.Text = "Histroy"; this.HostoryButton.Active1 = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(168)))), ((int)(((byte)(183))))); this.HostoryButton.Active2 = System.Drawing.Color.FromArgb(((int)(((byte)(36)))), ((int)(((byte)(164)))), ((int)(((byte)(183))))); this.HostoryButton.BackColor = System.Drawing.Color.Transparent; this.HostoryButton.DialogResult = System.Windows.Forms.DialogResult.OK; this.HostoryButton.ForeColor = System.Drawing.Color.Black; this.HostoryButton.Inactive1 = System.Drawing.Color.LightGray; this.HostoryButton.Inactive2 = System.Drawing.Color.LightGray; this.HostoryButton.Name = "b_windows_service_rollback"; this.HostoryButton.Radius = 10; this.HostoryButton.Stroke = false; this.HostoryButton.StrokeColor = System.Drawing.Color.Gray; this.HostoryButton.Transparency = false; this.HostoryButton.Click += (sender, args) => { LoadHistoryAction(this.ServerType,this.Server); }; // // groupBox_iis_progress // this.Controls.Add(this.CheckBox); this.Controls.Add(this.label29); this.Controls.Add(this.FireUrlText); this.Controls.Add(this.HostoryButton); this.Controls.Add(this.progress_iis_build); this.Controls.Add(this.b_build_end); this.Controls.Add(this.progress_iis_package); this.Controls.Add(this.b_package_end); this.Controls.Add(this.progress_iis_upload); this.Controls.Add(this.b_upload_end); this.Controls.Add(this.progress_iis_deploy); this.b_build_end.SendToBack(); this.b_package_end.SendToBack(); this.b_upload_end.SendToBack(); } protected override void Dispose(bool disposing) { Action action = () => { try { if (ServerType.Equals(ServerType.IIS)) { Server.IIsFireUrl = this.FireUrlText.Text; } if (ServerType.Equals(ServerType.DOCKER)) { Server.DockerFireUrl = this.FireUrlText.Text; } if (ServerType.Equals(ServerType.LINUXSERVICE)) { Server.LinuxServiceFireUrl = this.FireUrlText.Text; } if (ServerType.Equals(ServerType.WINSERVICE)) { Server.WindowsServiceFireUrl = this.FireUrlText.Text; } progress_iis_build.Dispose(); progress_iis_package.Dispose(); progress_iis_upload.Dispose(); progress_iis_deploy.Dispose(); HostoryButton.Dispose(); base.Dispose(disposing); } catch (Exception) { } }; if (this.InvokeRequired) { this.BeginInvoke(action, null); } else { action(); } } public void StartBuild() { progress_iis_build.Value = 20; } public void UpdateBuildProgress(int value) { if (value > 0 && progress_iis_build.Value == 0) { progress_iis_build.Value = 20; } if (value >= 100) { progress_iis_build.Value = 100; BuildEnd(); } } public void UpdatePackageProgress(int value) { if (value > 0 && progress_iis_package.Value == 0) { progress_iis_package.Value = 20; } this.progress_iis_package.SuperscriptText = value + "%"; if (value >= 100) { progress_iis_package.Value = 100; PackageEnd(); progress_iis_upload.Value = 20; } } public void UpdateUploadProgress(int value) { if (progress_iis_upload.Value >= 100) return; if (value > 0 && progress_iis_upload.Value == 0) { progress_iis_upload.Value = 20; } this.progress_iis_upload.SuperscriptText = value + "%"; if (value >= 100) { progress_iis_upload.Value = 100; UploadEnd(); StartDeploy(); } } public void StartDeploy() { progress_iis_deploy.Value = 20; } public void UpdateDeployProgress(bool value) { if (value) { this.progress_iis_deploy.SuperscriptText = "Success"; this.progress_iis_deploy.SuperscriptMargin = new System.Windows.Forms.Padding(-25, 0, 0, 0); } else { this.progress_iis_deploy.SuperscriptText = "Fail"; this.progress_iis_deploy.ProgressColor = System.Drawing.Color.Red; } this.progress_iis_deploy.Value = 100; } public void BuildEnd() { progress_iis_build.Value = 100; progress_iis_build.SuperscriptText = "√"; b_build_end.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); progress_iis_package.Value = 20; } public void BuildError() { progress_iis_build.Value = 100; progress_iis_build.SuperscriptText = "Error"; this.progress_iis_build.ProgressColor = System.Drawing.Color.Red; } public void PackageError() { progress_iis_package.Value = 100; progress_iis_package.SuperscriptText = "Error"; this.progress_iis_package.ProgressColor = System.Drawing.Color.Red; } public void UploadError() { if (progress_iis_upload.Value >= 100) return; progress_iis_upload.Value = 100; progress_iis_upload.SuperscriptText = "Error"; this.progress_iis_upload.ProgressColor = System.Drawing.Color.Red; } public void UploadReset() { progress_iis_upload.Value = 20; this.progress_iis_upload.SuperscriptText = "0%"; this.progress_iis_upload.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_deploy.SuperscriptMargin = new System.Windows.Forms.Padding(-28, 0, 0, 0); this.progress_iis_deploy.SuperscriptText = "Wait"; progress_iis_deploy.Value = 0; this.b_upload_end.BackColor = System.Drawing.Color.LightGray; this.progress_iis_deploy.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); } public void PackageEnd() { b_package_end.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); } public void UploadEnd() { b_upload_end.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); } public void Enable(bool flag) { this.FireUrlText.Enabled = flag; this.HostoryButton.Enabled = flag; this.CheckBox.Enabled = flag; } public BaseServer GetServer() { //当是需要人选的 且有被选 才认为是要发布的服务器 if (this.CheckBox.Checked) { return Server; } return null; } public bool CheckFireUrl() { //当是需要人选的 但是没有被选 那就不去check if (!this.CheckBox.Checked) { return true; } var url = this.FireUrlText.Text.ToLower(); if (!string.IsNullOrEmpty(url) && !url.StartsWith("http")) { return false; } if (ServerType.Equals(ServerType.IIS)) { Server.IIsFireUrl = this.FireUrlText.Text; } if (ServerType.Equals(ServerType.DOCKER)) { Server.DockerFireUrl = this.FireUrlText.Text; } if (ServerType.Equals(ServerType.LINUXSERVICE)) { Server.LinuxServiceFireUrl = this.FireUrlText.Text; } if (ServerType.Equals(ServerType.WINSERVICE)) { Server.WindowsServiceFireUrl = this.FireUrlText.Text; } return true; } } }
47.740458
166
0.599816
[ "Apache-2.0" ]
Run2948/AntDeploy
AntDeployWinform/Models/ProgressBox.cs
25,098
C#
using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Abstract.EventSourcing; namespace System.Abstract.AbstractTests { [TestClass] public abstract class AbstractAggregateRootSnapshotStoreTest { protected IAggregateRootSnapshotStore AggregateRootSnapshotStore { get; private set; } protected abstract IAggregateRootSnapshotStore CreateAggregateRootSnapshotStore(); public AbstractAggregateRootSnapshotStoreTest() => AggregateRootSnapshotStore = CreateAggregateRootSnapshotStore(); [TestMethod] public virtual void CreateMessage_Should_Return_Valid_Instance() { } } }
31.8
89
0.789308
[ "MIT" ]
BclEx/System.Abstract
src/System.Abstract.AbstractTests/EventSource/AbstractAggregateRootSnapshotStoreTest.cs
638
C#
using System; namespace API.Dtos.Identity { public class PersonalInformationDto { public string FirstName { get; set; } public string LastName { get; set; } public DateTimeOffset BirthDate { get; set; } } }
22.090909
53
0.641975
[ "MIT" ]
ZakariaDjebbes/DzTechly
API/Dtos/Identity/PersonalInformationDto.cs
243
C#
// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. // 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 full license information. using System; using System.Reactive.Concurrency; using System.Reactive.Linq; using System.Threading.Tasks; using System.Windows.Input; namespace ReactiveUI { /// <summary> /// A base class for generic reactive commands. /// </summary> /// <remarks> /// <para> /// This class extends <see cref="ReactiveCommand"/> and adds generic type parameters for the parameter values passed /// into command execution, and the return values of command execution. /// </para> /// <para> /// Because the result type is known by this class, it can implement <see cref="IObservable{T}"/>. However, the implementation /// is defined as abstract, so subclasses must provide it. /// </para> /// <para> /// Reactive commands encapsulate the behavior of running some execution logic and then surfacing the results on the UI /// thread. Importantly, no scheduling is performed against input observables (the <c>canExecute</c> and execution pipelines). /// </para> /// <para> /// To create an instance of <c>ReactiveCommand</c>, call one of the static creation methods defined by this class. /// <see cref="ReactiveCommand.Create"/> can be used when your execution logic is synchronous. /// <see cref="ReactiveCommand.CreateFromObservable{TResult}(Func{IObservable{TResult}}, IObservable{bool}, IScheduler)"/> and /// <see cref="ReactiveCommand.CreateFromTask(Func{Task}, IObservable{bool}, IScheduler)"/> (and overloads) can be used for asynchronous /// execution logic. Optionally, you can provide an observable that governs the availability of the command for execution, /// as well as a scheduler to which events will be delivered. /// </para> /// <para> /// The <see cref="CanExecute"/> property provides an observable that can be used to determine whether the command is /// eligible for execution. The value of this observable is determined by both the <c>canExecute</c> observable provided /// during command creation, and the current execution status of the command. A command that is already executing will /// yield <c>false</c> from its <see cref="CanExecute"/> observable regardless of the <c>canExecute</c> observable provided /// during command creation. /// </para> /// <para> /// The <see cref="IsExecuting"/> property provides an observable whose value indicates whether the command is currently /// executing. This can be a useful means of triggering UI, such as displaying an activity indicator whilst a command is /// executing. /// </para> /// <para> /// As discussed above, you are under no obligation to somehow incorporate this into your <c>canExecute</c> observable /// because that is taken care of for you. That is, if the value of <c>IsExecuting</c> is <c>true</c>, the value of /// <c>CanExecute</c> will be <c>false</c>. However, if the value of <c>CanExecute</c> is <c>false</c>, that does not imply /// the value of <c>IsExecuting</c> is <c>true</c>. /// </para> /// <para> /// Any errors in your command's execution logic (including any <c>canExecute</c> observable you choose to provide) will be /// surfaced via the <see cref="ThrownExceptions"/> observable. This gives you the opportunity to handle the error before /// it triggers a default handler that tears down the application. For example, you might use this as a means of alerting /// the user that something has gone wrong executing the command. /// </para> /// <para> /// For the sake of convenience, all <c>ReactiveCommand</c> instances are also implementations of <see cref="ICommand"/>. /// This allows you to easily integrate instances of <c>ReactiveCommand</c> into platforms that understands <c>ICommand</c> /// natively (such as WPF and UWP). /// </para> /// </remarks> /// <typeparam name="TParam"> /// The type of parameter values passed in during command execution. /// </typeparam> /// <typeparam name="TResult"> /// The type of the values that are the result of command execution. /// </typeparam> public abstract class ReactiveCommandBase<TParam, TResult> : IObservable<TResult>, ICommand, IReactiveCommand { private EventHandler? _canExecuteChanged; private bool _canExecuteValue; /// <inheritdoc/> event EventHandler ICommand.CanExecuteChanged { add => _canExecuteChanged += value; remove => _canExecuteChanged -= value; } /// <summary> /// Gets an observable whose value indicates whether the command can currently execute. /// </summary> /// <remarks> /// The value provided by this observable is governed both by any <c>canExecute</c> observable provided during /// command creation, as well as the current execution status of the command. A command that is currently executing /// will always yield <c>false</c> from this observable, even if the <c>canExecute</c> pipeline is currently <c>true</c>. /// </remarks> public abstract IObservable<bool> CanExecute { get; } /// <summary> /// Gets an observable whose value indicates whether the command is currently executing. /// </summary> /// <remarks> /// This observable can be particularly useful for updating UI, such as showing an activity indicator whilst a command /// is executing. /// </remarks> public abstract IObservable<bool> IsExecuting { get; } /// <summary> /// Gets an observable that ticks any exceptions in command execution logic. /// </summary> /// <remarks> /// Any exceptions that are not observed via this observable will propagate out and cause the application to be torn /// down. Therefore, you will always want to subscribe to this observable if you expect errors could occur (e.g. if /// your command execution includes network activity). /// </remarks> public abstract IObservable<Exception> ThrownExceptions { get; } /// <inheritdoc /> public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } /// <inheritdoc/> bool ICommand.CanExecute(object parameter) { return ICommandCanExecute(parameter); } /// <inheritdoc/> void ICommand.Execute(object parameter) { ICommandExecute(parameter); } /// <summary> /// Subscribes to execution results from this command. /// </summary> /// <param name="observer"> /// The observer. /// </param> /// <returns> /// An <see cref="IDisposable"/> that, when disposed, will unsubscribe the observer. /// </returns> public abstract IDisposable Subscribe(IObserver<TResult> observer); /// <summary> /// Gets an observable that, when subscribed, executes this command. /// </summary> /// <remarks> /// <para> /// Invoking this method will return a cold (lazy) observable that, when subscribed, will execute the logic /// encapsulated by the command. It is worth restating that the returned observable is lazy. Nothing will /// happen if you call <c>Execute</c> and neglect to subscribe (directly or indirectly) to the returned observable. /// </para> /// <para> /// If no parameter value is provided, a default value of type <typeparamref name="TParam"/> will be passed into /// the execution logic. /// </para> /// <para> /// Any number of subscribers can subscribe to a given execution observable and the execution logic will only /// run once. That is, the result is broadcast to those subscribers. /// </para> /// <para> /// In those cases where execution fails, there will be no result value. Instead, the failure will tick through the /// <see cref="ThrownExceptions"/> observable. /// </para> /// </remarks> /// <param name="parameter"> /// The parameter to pass into command execution. /// </param> /// <returns> /// An observable that will tick the single result value if and when it becomes available. /// </returns> public abstract IObservable<TResult> Execute(TParam parameter = default(TParam)); /// <summary> /// Disposes of the managed resources. /// </summary> /// <param name="disposing">If its getting called by the Dispose() method.</param> protected abstract void Dispose(bool disposing); /// <summary> /// Will trigger a event when the CanExecute condition has changed. /// </summary> /// <param name="newValue">The new value of the execute.</param> protected void OnCanExecuteChanged(bool newValue) { _canExecuteValue = newValue; _canExecuteChanged?.Invoke(this, EventArgs.Empty); } /// <summary> /// Will be called by the methods from the ICommand interface. /// This method is called when the Command should evaluate if it can execute. /// </summary> /// <param name="parameter">The parameter being passed to the ICommand.</param> /// <returns>If the command can be executed.</returns> protected virtual bool ICommandCanExecute(object parameter) { return _canExecuteValue; } /// <summary> /// Will be called by the methods from the ICommand interface. /// This method is called when the Command should execute. /// </summary> /// <param name="parameter">The parameter being passed to the ICommand.</param> protected virtual void ICommandExecute(object? parameter) { // ensure that null is coerced to default(TParam) so that commands taking value types will use a sensible default if no parameter is supplied if (parameter == null) { parameter = default(TParam); } if (parameter != null && !(parameter is TParam)) { throw new InvalidOperationException( $"Command requires parameters of type {typeof(TParam).FullName}, but received parameter of type {parameter.GetType().FullName}."); } Execute((TParam)parameter!) .Catch(Observable<TResult>.Empty) .Subscribe(); } } }
46.70339
153
0.633823
[ "MIT" ]
Noggog/ReactiveUI
src/ReactiveUI/ReactiveCommand/ReactiveCommandBase.cs
11,024
C#
using System; using System.Linq; namespace FunWithSequencesPartSix { class FunWithSequencesPartSix { static void Main() { Helpers.ConsoleHelper.RedirectInputToFile(); var line = Console.ReadLine(); while (!string.IsNullOrEmpty(line)) { var firstArray = Array.ConvertAll(Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries), int.Parse); Console.ReadLine(); var secondArray = Array.ConvertAll(Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries), int.Parse); var firstSum = firstArray.Sum(); var secondSum = secondArray.Sum(); string answer; if (firstSum > secondSum) { answer = string.Join(" ", firstArray); } else { answer = string.Join(" ", secondArray); } Console.WriteLine(answer); line = Console.ReadLine(); } } } }
36.6
120
0.517304
[ "MIT" ]
Katarzyna-Kadziolka/SPOJproblems
FunWithSequencesPartSix/FunWithSequencesPartSix.cs
1,100
C#
using Splaak.Core.Values; using Splaak.Core.Values.Misc; using Splaak.Core.Values.Types; namespace Splaak.Core.CoreSyntax.BinOps { /// <summary> /// Represents a pair in core syntax. /// </summary> /// <seealso cref="ExprC" /> public class PairC : ExprC { /// <summary> /// The elements of the pair. /// </summary> public readonly ExprC Left, Right; /// <summary> /// Initializes a new instance of the <see cref="PairC"/> class. /// </summary> /// <param name="left">The left argument of this pair.</param> /// <param name="right">The right argument of this pair.</param> public PairC(ExprC left, ExprC right) { Left = left; Right = right; } /// <summary> /// Interprets this core expression with an environment. /// </summary> /// <param name="env">The env.</param> /// <returns> /// Resulting value. /// </returns> public override Value Interpret(Environment env) { return new PairV(new ThunkV(Left, env), new ThunkV(Right, env)); } /// <summary> /// Returns a <see cref="string" /> that represents this instance. /// </summary> /// <returns> /// A <see cref="string" /> that represents this instance. /// </returns> public override string ToString() => $"PairC({Left}, {Right})"; /// <summary> /// Determines whether the specified <see cref="object" />, is equal to this instance. /// </summary> /// <param name="obj">The <see cref="object" /> to compare with this instance.</param> /// <returns> /// <c>true</c> if the specified <see cref="object" /> is equal to this instance; otherwise, <c>false</c>. /// </returns> public override bool Equals(object obj) { if (obj is PairC that) { return that.Left.Equals(Left) && that.Right.Equals(Right); } return false; } /// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns> /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. /// </returns> public override int GetHashCode() { return GetType().GetHashCode() * Left.GetHashCode() * Right.GetHashCode() ^ 2; } } }
32.922078
121
0.533333
[ "MIT" ]
CptWesley/Splaak
core/src/CoreSyntax/BinOps/PairC.cs
2,537
C#
using System.Collections.Generic; using System.Linq; using CppSharp.AST; using CppSharp.AST.Extensions; using CppSharp.Internal; namespace CppSharp.Passes { public class HandleDefaultParamValuesPass : TranslationUnitPass { private readonly Dictionary<DeclarationContext, List<Function>> overloads = new Dictionary<DeclarationContext, List<Function>>(); public HandleDefaultParamValuesPass() => VisitOptions.ResetFlags(VisitFlags.ClassMethods); public override bool VisitTranslationUnit(TranslationUnit unit) { if (!unit.IsGenerated) return false; var result = base.VisitTranslationUnit(unit); foreach (var overload in overloads) overload.Key.Declarations.AddRange(overload.Value); overloads.Clear(); return result; } public override bool VisitFunctionDecl(Function function) { if (!base.VisitFunctionDecl(function) || function.Ignore) return false; var overloadIndices = new List<int>(function.Parameters.Count); foreach (var parameter in function.Parameters.Where(p => p.DefaultArgument != null)) { Type type = parameter.Type.Desugar(resolveTemplateSubstitution: false); type = (type.GetFinalPointee() ?? type).Desugar( resolveTemplateSubstitution: false); if (type is TemplateParameterSubstitutionType || type.IsDependent) { parameter.DefaultArgument = null; continue; } var result = parameter.DefaultArgument.String; if (ExpressionHelper.PrintExpression(Context, function, parameter.Type, parameter.OriginalDefaultArgument, allowDefaultLiteral: true, ref result) == null) overloadIndices.Add(function.Parameters.IndexOf(parameter)); if (string.IsNullOrEmpty(result)) { parameter.DefaultArgument = null; foreach (var p in function.Parameters.TakeWhile(p => p != parameter)) p.DefaultArgument = null; } else parameter.DefaultArgument.String = result; } GenerateOverloads(function, overloadIndices); return true; } private void GenerateOverloads(Function function, List<int> overloadIndices) { foreach (var overloadIndex in overloadIndices) { var method = function as Method; Function overload = method != null ? new Method(method) : new Function(function); overload.OriginalFunction = function; overload.SynthKind = FunctionSynthKind.DefaultValueOverload; for (int i = overloadIndex; i < function.Parameters.Count; ++i) overload.Parameters[i].GenerationKind = GenerationKind.None; var indices = overloadIndices.Where(i => i < overloadIndex).ToList(); if (indices.Any()) for (int i = 0; i <= indices.Last(); i++) if (i != overloadIndex) overload.Parameters[i].DefaultArgument = null; if (method != null) ((Class) function.Namespace).Methods.Add((Method) overload); else { List<Function> functions; if (overloads.ContainsKey(function.Namespace)) functions = overloads[function.Namespace]; else overloads.Add(function.Namespace, functions = new List<Function>()); functions.Add(overload); } for (int i = 0; i <= overloadIndex; i++) function.Parameters[i].DefaultArgument = null; } } } }
40.67
106
0.559872
[ "MIT" ]
AnandEmbold/CppSharp
src/Generator/Passes/HandleDefaultParamValuesPass.cs
4,069
C#
namespace NorthwindWindowsStore.Service { using NorthwindWindowsStore.DAL.Model; using NorthwindWindowsStore.ViewModel; public class SupplierService : BaseService<Supplier, SupplierViewModel> { public SupplierService(string path) : base(path) { } } }
22
75
0.672078
[ "MIT" ]
krzysztofkolek/NorthwindWindowsStore
NorthwindWindowsStoreService/NorthwindWindowsStore.Service/SupplierService.cs
308
C#
using System; using System.Collections.Generic; using System.Linq; using UniGLTF; using UnityEngine; namespace VRM { public class VRMExporter : gltfExporter { public VRMExporter(glTF_VRM gltf) : base(gltf) { } public static glTF Export(GameObject go, string path = null, Action<glTF_VRM> callback=null) { var gltf = new glTF_VRM(); gltf.asset.generator = string.Format("UniVRM-{0}.{1}", VRMVersion.MAJOR, VRMVersion.MINOR); using (var exporter = new VRMExporter(gltf) { #if VRM_EXPORTER_USE_SPARSE // experimental UseSparseAccessorForBlendShape=true #endif }) { _Export(gltf, exporter, go); if (callback != null) { callback(gltf); } if (!string.IsNullOrEmpty(path)) { exporter.WriteTo(path); } } return gltf; } public static void _Export(glTF_VRM gltf, VRMExporter exporter, GameObject go) { exporter.Prepare(go); exporter.Export(); // avatar var animator = go.GetComponent<Animator>(); if (animator != null) { var humanoid = go.GetComponent<VRMHumanoidDescription>(); UniHumanoid.AvatarDescription description = null; var nodes = go.transform.Traverse().Skip(1).ToList(); { var isCreated = false; if (humanoid != null) { description = humanoid.GetDescription(out isCreated); } if (description != null) { // use description gltf.extensions.VRM.humanoid.Apply(description, nodes); } if (isCreated) { GameObject.DestroyImmediate(description); } } { // set humanoid bone mapping var avatar = animator.avatar; foreach (HumanBodyBones key in Enum.GetValues(typeof(HumanBodyBones))) { if (key == HumanBodyBones.LastBone) { break; } var transform = animator.GetBoneTransform(key); if (transform != null) { gltf.extensions.VRM.humanoid.SetNodeIndex(key, nodes.IndexOf(transform)); } } } } // morph var master = go.GetComponent<VRMBlendShapeProxy>(); if (master != null) { var avatar = master.BlendShapeAvatar; if (avatar != null) { var meshes = exporter.Meshes; foreach (var x in avatar.Clips) { gltf.extensions.VRM.blendShapeMaster.Add(x, exporter.Copy.transform, meshes); } } } // secondary VRMSpringUtility.ExportSecondary(exporter.Copy.transform, exporter.Nodes, x => gltf.extensions.VRM.secondaryAnimation.colliderGroups.Add(x), x => gltf.extensions.VRM.secondaryAnimation.boneGroups.Add(x) ); // meta(obsolete) { var meta = exporter.Copy.GetComponent<VRMMetaInformation>(); if (meta != null) { gltf.extensions.VRM.meta.author = meta.Author; gltf.extensions.VRM.meta.contactInformation = meta.ContactInformation; gltf.extensions.VRM.meta.title = meta.Title; if (meta.Thumbnail != null) { gltf.extensions.VRM.meta.texture = gltfExporter.ExportTexture(gltf, gltf.buffers.Count - 1, meta.Thumbnail); } gltf.extensions.VRM.meta.licenseType = meta.LicenseType; gltf.extensions.VRM.meta.otherLicenseUrl = meta.OtherLicenseUrl; gltf.extensions.VRM.meta.reference = meta.Reference; } } // meta { var _meta = exporter.Copy.GetComponent<VRMMeta>(); if (_meta != null && _meta.Meta != null) { var meta = _meta.Meta; // info gltf.extensions.VRM.meta.version = meta.Version; gltf.extensions.VRM.meta.author = meta.Author; gltf.extensions.VRM.meta.contactInformation = meta.ContactInformation; gltf.extensions.VRM.meta.reference = meta.Reference; gltf.extensions.VRM.meta.title = meta.Title; if (meta.Thumbnail != null) { gltf.extensions.VRM.meta.texture = gltfExporter.ExportTexture(gltf, gltf.buffers.Count - 1, meta.Thumbnail); } // ussage pemission gltf.extensions.VRM.meta.allowedUser = meta.AllowedUser; gltf.extensions.VRM.meta.violentUssage = meta.ViolentUssage; gltf.extensions.VRM.meta.sexualUssage = meta.SexualUssage; gltf.extensions.VRM.meta.commercialUssage = meta.CommercialUssage; gltf.extensions.VRM.meta.otherPermissionUrl = meta.OtherPermissionUrl; // distribution license gltf.extensions.VRM.meta.licenseType = meta.LicenseType; if (meta.LicenseType == LicenseType.Other) { gltf.extensions.VRM.meta.otherLicenseUrl = meta.OtherLicenseUrl; } } } // firstPerson var firstPerson = exporter.Copy.GetComponent<VRMFirstPerson>(); if (firstPerson != null) { if (firstPerson.FirstPersonBone != null) { gltf.extensions.VRM.firstPerson.firstPersonBone = exporter.Nodes.IndexOf(firstPerson.FirstPersonBone); gltf.extensions.VRM.firstPerson.firstPersonBoneOffset = firstPerson.FirstPersonOffset; gltf.extensions.VRM.firstPerson.meshAnnotations = firstPerson.Renderers.Select(x => new glTF_VRM_MeshAnnotation { mesh = exporter.Meshes.IndexOf(x.SharedMesh), firstPersonFlag = x.FirstPersonFlag.ToString(), }).ToList(); } // lookAt { var lookAtHead = exporter.Copy.GetComponent<VRMLookAtHead>(); var lookAt = exporter.Copy.GetComponent<VRMLookAt>(); if (lookAtHead != null) { var boneApplyer = exporter.Copy.GetComponent<VRMLookAtBoneApplyer>(); var blendShapeApplyer = exporter.Copy.GetComponent<VRMLookAtBlendShapeApplyer>(); if (boneApplyer != null) { gltf.extensions.VRM.firstPerson.lookAtType = LookAtType.Bone; gltf.extensions.VRM.firstPerson.lookAtHorizontalInner.Apply(boneApplyer.HorizontalInner); gltf.extensions.VRM.firstPerson.lookAtHorizontalOuter.Apply(boneApplyer.HorizontalOuter); gltf.extensions.VRM.firstPerson.lookAtVerticalDown.Apply(boneApplyer.VerticalDown); gltf.extensions.VRM.firstPerson.lookAtVerticalUp.Apply(boneApplyer.VerticalUp); } else if (blendShapeApplyer != null) { gltf.extensions.VRM.firstPerson.lookAtType = LookAtType.BlendShape; gltf.extensions.VRM.firstPerson.lookAtHorizontalOuter.Apply(blendShapeApplyer.Horizontal); gltf.extensions.VRM.firstPerson.lookAtVerticalDown.Apply(blendShapeApplyer.VerticalDown); gltf.extensions.VRM.firstPerson.lookAtVerticalUp.Apply(blendShapeApplyer.VerticalUp); } } else if (lookAt != null) { gltf.extensions.VRM.firstPerson.lookAtHorizontalInner.Apply(lookAt.HorizontalInner); gltf.extensions.VRM.firstPerson.lookAtHorizontalOuter.Apply(lookAt.HorizontalOuter); gltf.extensions.VRM.firstPerson.lookAtVerticalDown.Apply(lookAt.VerticalDown); gltf.extensions.VRM.firstPerson.lookAtVerticalUp.Apply(lookAt.VerticalUp); } } } // materials foreach (var m in exporter.Materials) { gltf.extensions.VRM.materialProperties.Add(glTF_VRM_Material.CreateFromMaterial(m, exporter.Textures)); } } } }
43.904977
133
0.492116
[ "MIT" ]
karukaru808/UniVRM
Scripts/Format/VRMExporter.cs
9,705
C#
using System; using System.Collections.Concurrent; using System.Reflection; using FluentAssertions; using Xunit; namespace MyNihongo.Expressions.Tests.PropertyOfTests { public sealed class GetShould { [Fact] public void GetPropertyValueNonGeneric() { const string text = nameof(text); var input = new TestRecord { Text = text }; var result = PropertyOf.Get<string>(input, nameof(TestRecord.Text)); result .Should() .Be(text); } [Fact] public void GetPropertyValueGeneric() { const string text = nameof(text); var input = new TestRecord { Text = text }; var result = PropertyOf<TestRecord>.Get<string>(input, nameof(TestRecord.Text)); result .Should() .Be(text); } [Fact] public void SaveExpressionsInCacheFromNonGeneric() { var item = new GetCacheTest1 { Prop = "text123" }; const string prop = nameof(item.Prop); var key = new Tuple<Type, string>(item.GetType(), prop); var dictionary = (ConcurrentDictionary<Tuple<Type, string>, Lazy<Delegate>>)typeof(ExpressionCache) .GetField(nameof(ExpressionCache.PropertyGetters), BindingFlags.Static | BindingFlags.NonPublic) !.GetValue(null); dictionary .Should() .NotContainKey(key); PropertyOf.Get(item, prop); dictionary .Should() .ContainKey(key); } [Fact] public void SaveExpressionsInCacheFromGeneric() { var item = new GetCacheTest2 { Prop = "text123" }; const string prop = nameof(item.Prop); var key = new Tuple<Type, string>(item.GetType(), prop); var dictionary = (ConcurrentDictionary<Tuple<Type, string>, Lazy<Delegate>>)typeof(ExpressionCache) .GetField(nameof(ExpressionCache.PropertyGetters), BindingFlags.Static | BindingFlags.NonPublic) !.GetValue(null); dictionary .Should() .NotContainKey(key); PropertyOf<GetCacheTest2>.Get<string>(item, prop); dictionary .Should() .ContainKey(key); } [Fact] public void ThrowExceptionIfPropertyNotFoundNonGeneric() { var input = new TestRecord(); Action action = () => PropertyOf.Get(input, "NotPresent"); action .Should() .ThrowExactly<ArgumentException>(); } [Fact] public void ThrowExceptionIfPropertyNotFoundGeneric() { var input = new TestRecord(); Action action = () => PropertyOf<TestRecord>.Get<string>(input, "NotPresent"); action .Should() .ThrowExactly<ArgumentException>(); } [Fact] public void ThrowExceptionIfInvalidTypeNonGeneric() { var input = new TestRecord(); Action action = () => PropertyOf.Get<int>(input, nameof(TestRecord.Text)); action .Should() .ThrowExactly<InvalidCastException>(); } [Fact] public void ThrowExceptionIfInvalidTypeGeneric() { var input = new TestRecord(); Action action = () => PropertyOf<TestRecord>.Get<int>(input, nameof(TestRecord.Text)); action .Should() .ThrowExactly<InvalidCastException>(); } } }
21.478261
102
0.680499
[ "MIT" ]
MyNihongo/Expressions
tests/MyNihongo.Expressions.Tests/PropertyOfTests/GetShould.cs
2,966
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using ClearCanvas.Common; [assembly: Plugin] // 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("Hibernate")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Hibernate")] [assembly: AssemblyCopyright("Copyright © 2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("bbaaecc5-54ef-4f9d-af36-a174b1912590")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
37.794872
85
0.726594
[ "Apache-2.0" ]
SNBnani/Xian
Healthcare/Extended/Hibernate/Properties/AssemblyInfo.cs
1,477
C#
// --------------------------------------------------------------- // Copyright (c) Coalition of the Good-Hearted Engineers // FREE TO USE TO CONNECT THE WORLD // --------------------------------------------------------------- using System; using Xeptions; namespace Taarafo.Portal.Web.Models.Comments.Exceptions { public class CommentValidationException : Xeption { public CommentValidationException(Exception innerException) : base(message: "Comment validation error ocurred, please try again.", innerException) { } } }
30.684211
82
0.531732
[ "MIT" ]
ElbekDeveloper/Taarafo.Web
Taarafo.Portal.Web/Models/Comments/Exceptions/CommentValidationException.cs
585
C#
/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * * This source code is subject to terms and conditions of the Microsoft Public License. A * copy of the license can be found in the License.html file at the root of this distribution. If * you cannot locate the Microsoft Public License, please send an email to * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound * by the terms of the Microsoft Public License. * * You must not remove this notice, or any other, from this software. * * * ***************************************************************************/ using System.Collections; using System.Globalization; using System.Linq; using System.Linq.Expressions; using System.CodeDom.Compiler; using System.Collections.Concurrent; using System.Collections.Generic; using System.Management.Automation.Language; using System.Reflection; namespace System.Management.Automation { using DynamicNull = System.Management.Automation.LanguagePrimitives.Null; internal abstract class MutableTuple { private const int MaxSize = 128; private static readonly Dictionary<Type, int> s_sizeDict = new Dictionary<Type, int>(); private int _size; protected BitArray _valuesSet; private Dictionary<string, int> _nameToIndexMap; internal bool IsValueSet(int index) { if (_size < MutableTuple.MaxSize) { // fast path return _valuesSet[index]; } // slow path MutableTuple nestedTuple = this; var accessPath = GetAccessPath(_size, index).ToArray(); int length = accessPath.Length; for (int i = 0; i < length - 1; ++i) { nestedTuple = (MutableTuple)nestedTuple.GetValueImpl(accessPath[i]); } return nestedTuple._valuesSet[accessPath[length - 1]]; } internal void SetAutomaticVariable(AutomaticVariable auto, object value, ExecutionContext context) { if (context._debuggingMode > 0) { context.Debugger.CheckVariableWrite(SpecialVariables.AutomaticVariables[(int)auto]); } SetValue((int)auto, value); } internal object GetAutomaticVariable(AutomaticVariable auto) { return GetValue((int)auto); } internal void SetPreferenceVariable(PreferenceVariable pref, object value) { SetValue((int)pref, value); } internal bool TryGetLocalVariable(string name, bool fromNewOrSet, out PSVariable result) { int index; name = VariableAnalysis.GetUnaliasedVariableName(name); if (_nameToIndexMap.TryGetValue(name, out index) && (fromNewOrSet || IsValueSet(index))) { result = new LocalVariable(name, this, index); return true; } result = null; return false; } internal bool TrySetParameter(string name, object value) { int index; name = VariableAnalysis.GetUnaliasedVariableName(name); if (_nameToIndexMap.TryGetValue(name, out index)) { SetValue(index, value); return true; } return false; } internal PSVariable TrySetVariable(string name, object value) { int index; name = VariableAnalysis.GetUnaliasedVariableName(name); if (_nameToIndexMap.TryGetValue(name, out index)) { SetValue(index, value); return new LocalVariable(name, this, index); } return null; } internal void GetVariableTable(Dictionary<string, PSVariable> result, bool includePrivate) { // We could cache this array if it was a perf problem. var orderedNames = (from keyValuePairs in _nameToIndexMap orderby keyValuePairs.Value select keyValuePairs.Key).ToArray(); for (int i = 0; i < orderedNames.Length; ++i) { var name = orderedNames[i]; if (IsValueSet(i) && !result.ContainsKey(name)) { result.Add(name, new LocalVariable(name, this, i)); if (SpecialVariables.IsUnderbar(name)) { result.Add(SpecialVariables.PSItem, new LocalVariable(SpecialVariables.PSItem, this, i)); } } } } public object GetValue(int index) { return GetNestedValue(_size, index); } public void SetValue(int index, object value) { SetNestedValue(_size, index, value); } protected abstract object GetValueImpl(int index); protected abstract void SetValueImpl(int index, object value); /// <summary> /// Sets the value at the given index for a tuple of the given size. This set supports /// walking through nested tuples to get the correct final index. /// </summary> private void SetNestedValue(int size, int index, object value) { if (size < MutableTuple.MaxSize) { // fast path SetValueImpl(index, value); } else { // slow path MutableTuple res = this; int lastAccess = -1; foreach (int i in GetAccessPath(size, index)) { if (lastAccess != -1) { res = (MutableTuple)res.GetValueImpl(lastAccess); } lastAccess = i; } res.SetValueImpl(lastAccess, value); } } /// <summary> /// Gets the value at the given index for a tuple of the given size. This get /// supports walking through nested tuples to get the correct final index. /// </summary> private object GetNestedValue(int size, int index) { if (size < MutableTuple.MaxSize) { // fast path return GetValueImpl(index); } else { // slow path object res = this; foreach (int i in GetAccessPath(size, index)) { res = ((MutableTuple)res).GetValueImpl(i); } return res; } } /// <summary> /// Gets the unbound generic Tuple type which has at lease size slots or null if a large enough tuple is not available. /// </summary> private static Type GetTupleType(int size) { #region Generated Tuple Get From Size // *** BEGIN GENERATED CODE *** // generated by function: gen_get_size from: generate_tuples.py if (size <= MutableTuple.MaxSize) { if (size <= 1) { return typeof(MutableTuple<>); } else if (size <= 2) { return typeof(MutableTuple<,>); } else if (size <= 4) { return typeof(MutableTuple<,,,>); } else if (size <= 8) { return typeof(MutableTuple<,,,,,,,>); } else if (size <= 16) { return typeof(MutableTuple<,,,,,,,,,,,,,,,>); } else if (size <= 32) { return typeof(MutableTuple<,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,>); } else if (size <= 64) { return typeof(MutableTuple<,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,>); } else { return typeof(MutableTuple<,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,>); } } // *** END GENERATED CODE *** #endregion return null; } /// <summary> /// Creates a generic tuple with the specified types. /// /// If the number of slots fits within the maximum tuple size then we simply /// create a single tuple. If it's greater then we create nested tuples /// (e.g. a Tuple`2 which contains a Tuple`128 and a Tuple`8 if we had a size of 136). /// </summary> public static Type MakeTupleType(params Type[] types) { // ContractUtils.RequiresNotNull(types, "types"); return MakeTupleType(types, 0, types.Length); } /// <summary> /// Gets the number of usable slots in the provided Tuple type including slots available in nested tuples. /// </summary> public static int GetSize(Type tupleType) { // ContractUtils.RequiresNotNull(tupleType, "tupleType"); int count = 0; lock (s_sizeDict) if (s_sizeDict.TryGetValue(tupleType, out count)) return count; Stack<Type> types = new Stack<Type>(tupleType.GetGenericArguments()); while (types.Count != 0) { Type t = types.Pop(); if (typeof(MutableTuple).IsAssignableFrom(t)) { foreach (Type subtype in t.GetGenericArguments()) { types.Push(subtype); } continue; } if (t == typeof(DynamicNull)) continue; count++; } lock (s_sizeDict) s_sizeDict[tupleType] = count; return count; } private static readonly ConcurrentDictionary<Type, Func<MutableTuple>> s_tupleCreators = new ConcurrentDictionary<Type, Func<MutableTuple>>(concurrencyLevel: 3, capacity: 100); public static Func<MutableTuple> TupleCreator(Type type) { return s_tupleCreators.GetOrAdd(type, t => { var newExpr = Expression.New(t); return Expression.Lambda<Func<MutableTuple>>(newExpr.Cast(typeof(MutableTuple))).Compile(); }); } /// <summary> /// Creates a new instance of tupleType with the specified args. If the tuple is a nested /// tuple the values are added in their nested forms. /// </summary> public static MutableTuple MakeTuple(Type tupleType, Dictionary<string, int> nameToIndexMap, Func<MutableTuple> creator = null) { // ContractUtils.RequiresNotNull(tupleType, "tupleType"); // ContractUtils.RequiresNotNull(args, "args"); int size = GetSize(tupleType); var bitArray = new BitArray(size); MutableTuple res = MakeTuple(creator, tupleType, size, bitArray); res._nameToIndexMap = nameToIndexMap; return res; } /// <summary> /// Gets the values from a tuple including unpacking nested values. /// </summary> public static object[] GetTupleValues(MutableTuple tuple) { // ContractUtils.RequiresNotNull(tuple, "tuple"); List<object> res = new List<object>(); GetTupleValues(tuple, res); return res.ToArray(); } /// <summary> /// Gets the series of properties that needs to be accessed to access a logical item in a potentially nested tuple. /// </summary> public static IEnumerable<PropertyInfo> GetAccessPath(Type tupleType, int index) { return GetAccessProperties(tupleType, GetSize(tupleType), index); } /// <summary> /// Gets the series of properties that needs to be accessed to access a logical item in a potentially nested tuple. /// </summary> internal static IEnumerable<PropertyInfo> GetAccessProperties(Type tupleType, int size, int index) { // ContractUtils.RequiresNotNull(tupleType, "tupleType"); if (index < 0 || index >= size) throw new ArgumentException("index"); foreach (int curIndex in GetAccessPath(size, index)) { PropertyInfo pi = tupleType.GetProperty("Item" + string.Format(CultureInfo.InvariantCulture, "{0:D3}", curIndex)); Diagnostics.Assert(pi != null, "reflection should always find Item"); yield return pi; tupleType = pi.PropertyType; } } internal static IEnumerable<int> GetAccessPath(int size, int index) { // We get the final index by breaking the index into groups of bits. The more significant bits // represent the indexes into the outermost tuples and the least significant bits index into the // inner most tuples. The mask is initialized to mask the upper bits and adjust is initialized // and adjust is the value we need to divide by to get the index in the least significant bits. // As we go through we shift the mask and adjust down each loop to pull out the inner slot. Logically // everything in here is shifting bits (not multiplying or dividing) because NewTuple.MaxSize is a // power of 2. int depth = 0; int mask = MutableTuple.MaxSize - 1; int adjust = 1; int count = size; while (count > MutableTuple.MaxSize) { depth++; count /= MutableTuple.MaxSize; mask *= MutableTuple.MaxSize; adjust *= MutableTuple.MaxSize; } while (depth-- >= 0) { Diagnostics.Assert(mask != 0, "mask should never be 0."); int curIndex = (index & mask) / adjust; yield return curIndex; mask /= MutableTuple.MaxSize; adjust /= MutableTuple.MaxSize; } } private static void GetTupleValues(MutableTuple tuple, List<object> args) { Type[] types = tuple.GetType().GetGenericArguments(); for (int i = 0; i < types.Length; i++) { if (typeof(MutableTuple).IsAssignableFrom(types[i])) { GetTupleValues((MutableTuple)tuple.GetValue(i), args); } else if (types[i] != typeof(DynamicNull)) { args.Add(tuple.GetValue(i)); } } } private static MutableTuple MakeTuple(Func<MutableTuple> creator, Type tupleType, int size, BitArray bitArray) { MutableTuple res = (creator ?? MutableTuple.TupleCreator(tupleType))(); res._size = size; res._valuesSet = bitArray; if (size > MutableTuple.MaxSize) { while (size > MutableTuple.MaxSize) { size = (size + MutableTuple.MaxSize - 1) / MutableTuple.MaxSize; } for (int i = 0; i < size; i++) { PropertyInfo pi = tupleType.GetProperty("Item" + string.Format(CultureInfo.InvariantCulture, "{0:D3}", i)); res.SetValueImpl(i, MakeTuple(pi.PropertyType, null, null)); } } return res; } private static Type MakeTupleType(Type[] types, int start, int end) { int size = end - start; Type type = GetTupleType(size); if (type != null) { Type[] typeArr = new Type[type.GetGenericArguments().Length]; int index = 0; for (int i = start; i < end; i++) { typeArr[index++] = types[i]; } while (index < typeArr.Length) { typeArr[index++] = typeof(DynamicNull); } return type.MakeGenericType(typeArr); } int multiplier = 1; while (size > MutableTuple.MaxSize) { size = (size + MutableTuple.MaxSize - 1) / MutableTuple.MaxSize; multiplier *= MutableTuple.MaxSize; } type = MutableTuple.GetTupleType(size); Diagnostics.Assert(type != null, "type cannot be null"); Type[] nestedTypes = new Type[type.GetGenericArguments().Length]; for (int i = 0; i < size; i++) { int newStart = start + (i * multiplier); int newEnd = System.Math.Min(end, start + ((i + 1) * multiplier)); nestedTypes[i] = MakeTupleType(types, newStart, newEnd); } for (int i = size; i < nestedTypes.Length; i++) { nestedTypes[i] = typeof(DynamicNull); } return type.MakeGenericType(nestedTypes); } public abstract int Capacity { get; } /// <summary> /// Provides an expression for creating a tuple with the specified values. /// </summary> public static Expression Create(params Expression[] values) { return CreateNew(MakeTupleType(values.Select(static x => x.Type).ToArray()), 0, values.Length, values); } private static int PowerOfTwoRound(int value) { int res = 1; while (value > res) { res <<= 1; } return res; } internal static Expression CreateNew(Type tupleType, int start, int end, Expression[] values) { int size = end - start; Diagnostics.Assert(tupleType != null, "tupleType cannot be null"); Diagnostics.Assert(tupleType.IsSubclassOf(typeof(MutableTuple)), "tupleType must be derived from MutableTuple"); Expression[] newValues; if (size > MutableTuple.MaxSize) { int multiplier = 1; while (size > MutableTuple.MaxSize) { size = (size + MutableTuple.MaxSize - 1) / MutableTuple.MaxSize; multiplier *= MutableTuple.MaxSize; } newValues = new Expression[PowerOfTwoRound(size)]; for (int i = 0; i < size; i++) { int newStart = start + (i * multiplier); int newEnd = System.Math.Min(end, start + ((i + 1) * multiplier)); PropertyInfo pi = tupleType.GetProperty("Item" + string.Format(CultureInfo.InvariantCulture, "{0:D3}", i)); newValues[i] = CreateNew(pi.PropertyType, newStart, newEnd, values); } for (int i = size; i < newValues.Length; i++) { newValues[i] = Expression.Constant(null, typeof(DynamicNull)); } } else { newValues = new Expression[PowerOfTwoRound(size)]; for (int i = 0; i < size; i++) { newValues[i] = values[i + start]; } for (int i = size; i < newValues.Length; i++) { newValues[i] = Expression.Constant(null, typeof(DynamicNull)); } } return Expression.New(tupleType.GetConstructor(newValues.Select(static x => x.Type).ToArray()), newValues); } } #region Generated Tuples // *** BEGIN GENERATED CODE *** // generated by function: gen_tuples from: generate_tuples.py [GeneratedCode("DLR", "2.0")] internal class MutableTuple<T0> : MutableTuple { public MutableTuple() { } public MutableTuple(T0 item0) : base() { _item0 = item0; } private T0 _item0; public T0 Item000 { get { return _item0; } set { _item0 = value; _valuesSet[0] = true; } } protected override object GetValueImpl(int index) { switch (index) { case 0: return Item000; default: throw new ArgumentOutOfRangeException("index"); } } protected override void SetValueImpl(int index, object value) { switch (index) { case 0: Item000 = LanguagePrimitives.ConvertTo<T0>(value); break; default: throw new ArgumentOutOfRangeException("index"); } } public override int Capacity { get { return 1; } } } [GeneratedCode("DLR", "2.0")] internal class MutableTuple<T0, T1> : MutableTuple<T0> { public MutableTuple() { } public MutableTuple(T0 item0, T1 item1) : base(item0) { _item1 = item1; } private T1 _item1; public T1 Item001 { get { return _item1; } set { _item1 = value; _valuesSet[1] = true; } } protected override object GetValueImpl(int index) { switch (index) { case 0: return Item000; case 1: return Item001; default: throw new ArgumentOutOfRangeException("index"); } } protected override void SetValueImpl(int index, object value) { switch (index) { case 0: Item000 = LanguagePrimitives.ConvertTo<T0>(value); break; case 1: Item001 = LanguagePrimitives.ConvertTo<T1>(value); break; default: throw new ArgumentOutOfRangeException("index"); } } public override int Capacity { get { return 2; } } } [GeneratedCode("DLR", "2.0")] internal class MutableTuple<T0, T1, T2, T3> : MutableTuple<T0, T1> { public MutableTuple() { } public MutableTuple(T0 item0, T1 item1, T2 item2, T3 item3) : base(item0, item1) { _item2 = item2; _item3 = item3; } private T2 _item2; private T3 _item3; public T2 Item002 { get { return _item2; } set { _item2 = value; _valuesSet[2] = true; } } public T3 Item003 { get { return _item3; } set { _item3 = value; _valuesSet[3] = true; } } protected override object GetValueImpl(int index) { switch (index) { case 0: return Item000; case 1: return Item001; case 2: return Item002; case 3: return Item003; default: throw new ArgumentOutOfRangeException("index"); } } protected override void SetValueImpl(int index, object value) { switch (index) { case 0: Item000 = LanguagePrimitives.ConvertTo<T0>(value); break; case 1: Item001 = LanguagePrimitives.ConvertTo<T1>(value); break; case 2: Item002 = LanguagePrimitives.ConvertTo<T2>(value); break; case 3: Item003 = LanguagePrimitives.ConvertTo<T3>(value); break; default: throw new ArgumentOutOfRangeException("index"); } } public override int Capacity { get { return 4; } } } [GeneratedCode("DLR", "2.0")] internal class MutableTuple<T0, T1, T2, T3, T4, T5, T6, T7> : MutableTuple<T0, T1, T2, T3> { public MutableTuple() { } public MutableTuple(T0 item0, T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7) : base(item0, item1, item2, item3) { _item4 = item4; _item5 = item5; _item6 = item6; _item7 = item7; } private T4 _item4; private T5 _item5; private T6 _item6; private T7 _item7; public T4 Item004 { get { return _item4; } set { _item4 = value; _valuesSet[4] = true; } } public T5 Item005 { get { return _item5; } set { _item5 = value; _valuesSet[5] = true; } } public T6 Item006 { get { return _item6; } set { _item6 = value; _valuesSet[6] = true; } } public T7 Item007 { get { return _item7; } set { _item7 = value; _valuesSet[7] = true; } } protected override object GetValueImpl(int index) { switch (index) { case 0: return Item000; case 1: return Item001; case 2: return Item002; case 3: return Item003; case 4: return Item004; case 5: return Item005; case 6: return Item006; case 7: return Item007; default: throw new ArgumentOutOfRangeException("index"); } } protected override void SetValueImpl(int index, object value) { switch (index) { case 0: Item000 = LanguagePrimitives.ConvertTo<T0>(value); break; case 1: Item001 = LanguagePrimitives.ConvertTo<T1>(value); break; case 2: Item002 = LanguagePrimitives.ConvertTo<T2>(value); break; case 3: Item003 = LanguagePrimitives.ConvertTo<T3>(value); break; case 4: Item004 = LanguagePrimitives.ConvertTo<T4>(value); break; case 5: Item005 = LanguagePrimitives.ConvertTo<T5>(value); break; case 6: Item006 = LanguagePrimitives.ConvertTo<T6>(value); break; case 7: Item007 = LanguagePrimitives.ConvertTo<T7>(value); break; default: throw new ArgumentOutOfRangeException("index"); } } public override int Capacity { get { return 8; } } } [GeneratedCode("DLR", "2.0")] internal class MutableTuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> : MutableTuple<T0, T1, T2, T3, T4, T5, T6, T7> { public MutableTuple() { } public MutableTuple(T0 item0, T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12, T13 item13, T14 item14, T15 item15) : base(item0, item1, item2, item3, item4, item5, item6, item7) { _item8 = item8; _item9 = item9; _item10 = item10; _item11 = item11; _item12 = item12; _item13 = item13; _item14 = item14; _item15 = item15; } private T8 _item8; private T9 _item9; private T10 _item10; private T11 _item11; private T12 _item12; private T13 _item13; private T14 _item14; private T15 _item15; public T8 Item008 { get { return _item8; } set { _item8 = value; _valuesSet[8] = true; } } public T9 Item009 { get { return _item9; } set { _item9 = value; _valuesSet[9] = true; } } public T10 Item010 { get { return _item10; } set { _item10 = value; _valuesSet[10] = true; } } public T11 Item011 { get { return _item11; } set { _item11 = value; _valuesSet[11] = true; } } public T12 Item012 { get { return _item12; } set { _item12 = value; _valuesSet[12] = true; } } public T13 Item013 { get { return _item13; } set { _item13 = value; _valuesSet[13] = true; } } public T14 Item014 { get { return _item14; } set { _item14 = value; _valuesSet[14] = true; } } public T15 Item015 { get { return _item15; } set { _item15 = value; _valuesSet[15] = true; } } protected override object GetValueImpl(int index) { switch (index) { case 0: return Item000; case 1: return Item001; case 2: return Item002; case 3: return Item003; case 4: return Item004; case 5: return Item005; case 6: return Item006; case 7: return Item007; case 8: return Item008; case 9: return Item009; case 10: return Item010; case 11: return Item011; case 12: return Item012; case 13: return Item013; case 14: return Item014; case 15: return Item015; default: throw new ArgumentOutOfRangeException("index"); } } protected override void SetValueImpl(int index, object value) { switch (index) { case 0: Item000 = LanguagePrimitives.ConvertTo<T0>(value); break; case 1: Item001 = LanguagePrimitives.ConvertTo<T1>(value); break; case 2: Item002 = LanguagePrimitives.ConvertTo<T2>(value); break; case 3: Item003 = LanguagePrimitives.ConvertTo<T3>(value); break; case 4: Item004 = LanguagePrimitives.ConvertTo<T4>(value); break; case 5: Item005 = LanguagePrimitives.ConvertTo<T5>(value); break; case 6: Item006 = LanguagePrimitives.ConvertTo<T6>(value); break; case 7: Item007 = LanguagePrimitives.ConvertTo<T7>(value); break; case 8: Item008 = LanguagePrimitives.ConvertTo<T8>(value); break; case 9: Item009 = LanguagePrimitives.ConvertTo<T9>(value); break; case 10: Item010 = LanguagePrimitives.ConvertTo<T10>(value); break; case 11: Item011 = LanguagePrimitives.ConvertTo<T11>(value); break; case 12: Item012 = LanguagePrimitives.ConvertTo<T12>(value); break; case 13: Item013 = LanguagePrimitives.ConvertTo<T13>(value); break; case 14: Item014 = LanguagePrimitives.ConvertTo<T14>(value); break; case 15: Item015 = LanguagePrimitives.ConvertTo<T15>(value); break; default: throw new ArgumentOutOfRangeException("index"); } } public override int Capacity { get { return 16; } } } [GeneratedCode("DLR", "2.0")] internal class MutableTuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31> : MutableTuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> { public MutableTuple() { } public MutableTuple(T0 item0, T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12, T13 item13, T14 item14, T15 item15, T16 item16, T17 item17, T18 item18, T19 item19, T20 item20, T21 item21, T22 item22, T23 item23, T24 item24, T25 item25, T26 item26, T27 item27, T28 item28, T29 item29, T30 item30, T31 item31) : base(item0, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15) { _item16 = item16; _item17 = item17; _item18 = item18; _item19 = item19; _item20 = item20; _item21 = item21; _item22 = item22; _item23 = item23; _item24 = item24; _item25 = item25; _item26 = item26; _item27 = item27; _item28 = item28; _item29 = item29; _item30 = item30; _item31 = item31; } private T16 _item16; private T17 _item17; private T18 _item18; private T19 _item19; private T20 _item20; private T21 _item21; private T22 _item22; private T23 _item23; private T24 _item24; private T25 _item25; private T26 _item26; private T27 _item27; private T28 _item28; private T29 _item29; private T30 _item30; private T31 _item31; public T16 Item016 { get { return _item16; } set { _item16 = value; _valuesSet[16] = true; } } public T17 Item017 { get { return _item17; } set { _item17 = value; _valuesSet[17] = true; } } public T18 Item018 { get { return _item18; } set { _item18 = value; _valuesSet[18] = true; } } public T19 Item019 { get { return _item19; } set { _item19 = value; _valuesSet[19] = true; } } public T20 Item020 { get { return _item20; } set { _item20 = value; _valuesSet[20] = true; } } public T21 Item021 { get { return _item21; } set { _item21 = value; _valuesSet[21] = true; } } public T22 Item022 { get { return _item22; } set { _item22 = value; _valuesSet[22] = true; } } public T23 Item023 { get { return _item23; } set { _item23 = value; _valuesSet[23] = true; } } public T24 Item024 { get { return _item24; } set { _item24 = value; _valuesSet[24] = true; } } public T25 Item025 { get { return _item25; } set { _item25 = value; _valuesSet[25] = true; } } public T26 Item026 { get { return _item26; } set { _item26 = value; _valuesSet[26] = true; } } public T27 Item027 { get { return _item27; } set { _item27 = value; _valuesSet[27] = true; } } public T28 Item028 { get { return _item28; } set { _item28 = value; _valuesSet[28] = true; } } public T29 Item029 { get { return _item29; } set { _item29 = value; _valuesSet[29] = true; } } public T30 Item030 { get { return _item30; } set { _item30 = value; _valuesSet[30] = true; } } public T31 Item031 { get { return _item31; } set { _item31 = value; _valuesSet[31] = true; } } protected override object GetValueImpl(int index) { switch (index) { case 0: return Item000; case 1: return Item001; case 2: return Item002; case 3: return Item003; case 4: return Item004; case 5: return Item005; case 6: return Item006; case 7: return Item007; case 8: return Item008; case 9: return Item009; case 10: return Item010; case 11: return Item011; case 12: return Item012; case 13: return Item013; case 14: return Item014; case 15: return Item015; case 16: return Item016; case 17: return Item017; case 18: return Item018; case 19: return Item019; case 20: return Item020; case 21: return Item021; case 22: return Item022; case 23: return Item023; case 24: return Item024; case 25: return Item025; case 26: return Item026; case 27: return Item027; case 28: return Item028; case 29: return Item029; case 30: return Item030; case 31: return Item031; default: throw new ArgumentOutOfRangeException("index"); } } protected override void SetValueImpl(int index, object value) { switch (index) { case 0: Item000 = LanguagePrimitives.ConvertTo<T0>(value); break; case 1: Item001 = LanguagePrimitives.ConvertTo<T1>(value); break; case 2: Item002 = LanguagePrimitives.ConvertTo<T2>(value); break; case 3: Item003 = LanguagePrimitives.ConvertTo<T3>(value); break; case 4: Item004 = LanguagePrimitives.ConvertTo<T4>(value); break; case 5: Item005 = LanguagePrimitives.ConvertTo<T5>(value); break; case 6: Item006 = LanguagePrimitives.ConvertTo<T6>(value); break; case 7: Item007 = LanguagePrimitives.ConvertTo<T7>(value); break; case 8: Item008 = LanguagePrimitives.ConvertTo<T8>(value); break; case 9: Item009 = LanguagePrimitives.ConvertTo<T9>(value); break; case 10: Item010 = LanguagePrimitives.ConvertTo<T10>(value); break; case 11: Item011 = LanguagePrimitives.ConvertTo<T11>(value); break; case 12: Item012 = LanguagePrimitives.ConvertTo<T12>(value); break; case 13: Item013 = LanguagePrimitives.ConvertTo<T13>(value); break; case 14: Item014 = LanguagePrimitives.ConvertTo<T14>(value); break; case 15: Item015 = LanguagePrimitives.ConvertTo<T15>(value); break; case 16: Item016 = LanguagePrimitives.ConvertTo<T16>(value); break; case 17: Item017 = LanguagePrimitives.ConvertTo<T17>(value); break; case 18: Item018 = LanguagePrimitives.ConvertTo<T18>(value); break; case 19: Item019 = LanguagePrimitives.ConvertTo<T19>(value); break; case 20: Item020 = LanguagePrimitives.ConvertTo<T20>(value); break; case 21: Item021 = LanguagePrimitives.ConvertTo<T21>(value); break; case 22: Item022 = LanguagePrimitives.ConvertTo<T22>(value); break; case 23: Item023 = LanguagePrimitives.ConvertTo<T23>(value); break; case 24: Item024 = LanguagePrimitives.ConvertTo<T24>(value); break; case 25: Item025 = LanguagePrimitives.ConvertTo<T25>(value); break; case 26: Item026 = LanguagePrimitives.ConvertTo<T26>(value); break; case 27: Item027 = LanguagePrimitives.ConvertTo<T27>(value); break; case 28: Item028 = LanguagePrimitives.ConvertTo<T28>(value); break; case 29: Item029 = LanguagePrimitives.ConvertTo<T29>(value); break; case 30: Item030 = LanguagePrimitives.ConvertTo<T30>(value); break; case 31: Item031 = LanguagePrimitives.ConvertTo<T31>(value); break; default: throw new ArgumentOutOfRangeException("index"); } } public override int Capacity { get { return 32; } } } [GeneratedCode("DLR", "2.0")] internal class MutableTuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50, T51, T52, T53, T54, T55, T56, T57, T58, T59, T60, T61, T62, T63> : MutableTuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31> { public MutableTuple() { } public MutableTuple(T0 item0, T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12, T13 item13, T14 item14, T15 item15, T16 item16, T17 item17, T18 item18, T19 item19, T20 item20, T21 item21, T22 item22, T23 item23, T24 item24, T25 item25, T26 item26, T27 item27, T28 item28, T29 item29, T30 item30, T31 item31, T32 item32, T33 item33, T34 item34, T35 item35, T36 item36, T37 item37, T38 item38, T39 item39, T40 item40, T41 item41, T42 item42, T43 item43, T44 item44, T45 item45, T46 item46, T47 item47, T48 item48, T49 item49, T50 item50, T51 item51, T52 item52, T53 item53, T54 item54, T55 item55, T56 item56, T57 item57, T58 item58, T59 item59, T60 item60, T61 item61, T62 item62, T63 item63) : base(item0, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18, item19, item20, item21, item22, item23, item24, item25, item26, item27, item28, item29, item30, item31) { _item32 = item32; _item33 = item33; _item34 = item34; _item35 = item35; _item36 = item36; _item37 = item37; _item38 = item38; _item39 = item39; _item40 = item40; _item41 = item41; _item42 = item42; _item43 = item43; _item44 = item44; _item45 = item45; _item46 = item46; _item47 = item47; _item48 = item48; _item49 = item49; _item50 = item50; _item51 = item51; _item52 = item52; _item53 = item53; _item54 = item54; _item55 = item55; _item56 = item56; _item57 = item57; _item58 = item58; _item59 = item59; _item60 = item60; _item61 = item61; _item62 = item62; _item63 = item63; } private T32 _item32; private T33 _item33; private T34 _item34; private T35 _item35; private T36 _item36; private T37 _item37; private T38 _item38; private T39 _item39; private T40 _item40; private T41 _item41; private T42 _item42; private T43 _item43; private T44 _item44; private T45 _item45; private T46 _item46; private T47 _item47; private T48 _item48; private T49 _item49; private T50 _item50; private T51 _item51; private T52 _item52; private T53 _item53; private T54 _item54; private T55 _item55; private T56 _item56; private T57 _item57; private T58 _item58; private T59 _item59; private T60 _item60; private T61 _item61; private T62 _item62; private T63 _item63; public T32 Item032 { get { return _item32; } set { _item32 = value; _valuesSet[32] = true; } } public T33 Item033 { get { return _item33; } set { _item33 = value; _valuesSet[33] = true; } } public T34 Item034 { get { return _item34; } set { _item34 = value; _valuesSet[34] = true; } } public T35 Item035 { get { return _item35; } set { _item35 = value; _valuesSet[35] = true; } } public T36 Item036 { get { return _item36; } set { _item36 = value; _valuesSet[36] = true; } } public T37 Item037 { get { return _item37; } set { _item37 = value; _valuesSet[37] = true; } } public T38 Item038 { get { return _item38; } set { _item38 = value; _valuesSet[38] = true; } } public T39 Item039 { get { return _item39; } set { _item39 = value; _valuesSet[39] = true; } } public T40 Item040 { get { return _item40; } set { _item40 = value; _valuesSet[40] = true; } } public T41 Item041 { get { return _item41; } set { _item41 = value; _valuesSet[41] = true; } } public T42 Item042 { get { return _item42; } set { _item42 = value; _valuesSet[42] = true; } } public T43 Item043 { get { return _item43; } set { _item43 = value; _valuesSet[43] = true; } } public T44 Item044 { get { return _item44; } set { _item44 = value; _valuesSet[44] = true; } } public T45 Item045 { get { return _item45; } set { _item45 = value; _valuesSet[45] = true; } } public T46 Item046 { get { return _item46; } set { _item46 = value; _valuesSet[46] = true; } } public T47 Item047 { get { return _item47; } set { _item47 = value; _valuesSet[47] = true; } } public T48 Item048 { get { return _item48; } set { _item48 = value; _valuesSet[48] = true; } } public T49 Item049 { get { return _item49; } set { _item49 = value; _valuesSet[49] = true; } } public T50 Item050 { get { return _item50; } set { _item50 = value; _valuesSet[50] = true; } } public T51 Item051 { get { return _item51; } set { _item51 = value; _valuesSet[51] = true; } } public T52 Item052 { get { return _item52; } set { _item52 = value; _valuesSet[52] = true; } } public T53 Item053 { get { return _item53; } set { _item53 = value; _valuesSet[53] = true; } } public T54 Item054 { get { return _item54; } set { _item54 = value; _valuesSet[54] = true; } } public T55 Item055 { get { return _item55; } set { _item55 = value; _valuesSet[55] = true; } } public T56 Item056 { get { return _item56; } set { _item56 = value; _valuesSet[56] = true; } } public T57 Item057 { get { return _item57; } set { _item57 = value; _valuesSet[57] = true; } } public T58 Item058 { get { return _item58; } set { _item58 = value; _valuesSet[58] = true; } } public T59 Item059 { get { return _item59; } set { _item59 = value; _valuesSet[59] = true; } } public T60 Item060 { get { return _item60; } set { _item60 = value; _valuesSet[60] = true; } } public T61 Item061 { get { return _item61; } set { _item61 = value; _valuesSet[61] = true; } } public T62 Item062 { get { return _item62; } set { _item62 = value; _valuesSet[62] = true; } } public T63 Item063 { get { return _item63; } set { _item63 = value; _valuesSet[63] = true; } } protected override object GetValueImpl(int index) { switch (index) { case 0: return Item000; case 1: return Item001; case 2: return Item002; case 3: return Item003; case 4: return Item004; case 5: return Item005; case 6: return Item006; case 7: return Item007; case 8: return Item008; case 9: return Item009; case 10: return Item010; case 11: return Item011; case 12: return Item012; case 13: return Item013; case 14: return Item014; case 15: return Item015; case 16: return Item016; case 17: return Item017; case 18: return Item018; case 19: return Item019; case 20: return Item020; case 21: return Item021; case 22: return Item022; case 23: return Item023; case 24: return Item024; case 25: return Item025; case 26: return Item026; case 27: return Item027; case 28: return Item028; case 29: return Item029; case 30: return Item030; case 31: return Item031; case 32: return Item032; case 33: return Item033; case 34: return Item034; case 35: return Item035; case 36: return Item036; case 37: return Item037; case 38: return Item038; case 39: return Item039; case 40: return Item040; case 41: return Item041; case 42: return Item042; case 43: return Item043; case 44: return Item044; case 45: return Item045; case 46: return Item046; case 47: return Item047; case 48: return Item048; case 49: return Item049; case 50: return Item050; case 51: return Item051; case 52: return Item052; case 53: return Item053; case 54: return Item054; case 55: return Item055; case 56: return Item056; case 57: return Item057; case 58: return Item058; case 59: return Item059; case 60: return Item060; case 61: return Item061; case 62: return Item062; case 63: return Item063; default: throw new ArgumentOutOfRangeException("index"); } } protected override void SetValueImpl(int index, object value) { switch (index) { case 0: Item000 = LanguagePrimitives.ConvertTo<T0>(value); break; case 1: Item001 = LanguagePrimitives.ConvertTo<T1>(value); break; case 2: Item002 = LanguagePrimitives.ConvertTo<T2>(value); break; case 3: Item003 = LanguagePrimitives.ConvertTo<T3>(value); break; case 4: Item004 = LanguagePrimitives.ConvertTo<T4>(value); break; case 5: Item005 = LanguagePrimitives.ConvertTo<T5>(value); break; case 6: Item006 = LanguagePrimitives.ConvertTo<T6>(value); break; case 7: Item007 = LanguagePrimitives.ConvertTo<T7>(value); break; case 8: Item008 = LanguagePrimitives.ConvertTo<T8>(value); break; case 9: Item009 = LanguagePrimitives.ConvertTo<T9>(value); break; case 10: Item010 = LanguagePrimitives.ConvertTo<T10>(value); break; case 11: Item011 = LanguagePrimitives.ConvertTo<T11>(value); break; case 12: Item012 = LanguagePrimitives.ConvertTo<T12>(value); break; case 13: Item013 = LanguagePrimitives.ConvertTo<T13>(value); break; case 14: Item014 = LanguagePrimitives.ConvertTo<T14>(value); break; case 15: Item015 = LanguagePrimitives.ConvertTo<T15>(value); break; case 16: Item016 = LanguagePrimitives.ConvertTo<T16>(value); break; case 17: Item017 = LanguagePrimitives.ConvertTo<T17>(value); break; case 18: Item018 = LanguagePrimitives.ConvertTo<T18>(value); break; case 19: Item019 = LanguagePrimitives.ConvertTo<T19>(value); break; case 20: Item020 = LanguagePrimitives.ConvertTo<T20>(value); break; case 21: Item021 = LanguagePrimitives.ConvertTo<T21>(value); break; case 22: Item022 = LanguagePrimitives.ConvertTo<T22>(value); break; case 23: Item023 = LanguagePrimitives.ConvertTo<T23>(value); break; case 24: Item024 = LanguagePrimitives.ConvertTo<T24>(value); break; case 25: Item025 = LanguagePrimitives.ConvertTo<T25>(value); break; case 26: Item026 = LanguagePrimitives.ConvertTo<T26>(value); break; case 27: Item027 = LanguagePrimitives.ConvertTo<T27>(value); break; case 28: Item028 = LanguagePrimitives.ConvertTo<T28>(value); break; case 29: Item029 = LanguagePrimitives.ConvertTo<T29>(value); break; case 30: Item030 = LanguagePrimitives.ConvertTo<T30>(value); break; case 31: Item031 = LanguagePrimitives.ConvertTo<T31>(value); break; case 32: Item032 = LanguagePrimitives.ConvertTo<T32>(value); break; case 33: Item033 = LanguagePrimitives.ConvertTo<T33>(value); break; case 34: Item034 = LanguagePrimitives.ConvertTo<T34>(value); break; case 35: Item035 = LanguagePrimitives.ConvertTo<T35>(value); break; case 36: Item036 = LanguagePrimitives.ConvertTo<T36>(value); break; case 37: Item037 = LanguagePrimitives.ConvertTo<T37>(value); break; case 38: Item038 = LanguagePrimitives.ConvertTo<T38>(value); break; case 39: Item039 = LanguagePrimitives.ConvertTo<T39>(value); break; case 40: Item040 = LanguagePrimitives.ConvertTo<T40>(value); break; case 41: Item041 = LanguagePrimitives.ConvertTo<T41>(value); break; case 42: Item042 = LanguagePrimitives.ConvertTo<T42>(value); break; case 43: Item043 = LanguagePrimitives.ConvertTo<T43>(value); break; case 44: Item044 = LanguagePrimitives.ConvertTo<T44>(value); break; case 45: Item045 = LanguagePrimitives.ConvertTo<T45>(value); break; case 46: Item046 = LanguagePrimitives.ConvertTo<T46>(value); break; case 47: Item047 = LanguagePrimitives.ConvertTo<T47>(value); break; case 48: Item048 = LanguagePrimitives.ConvertTo<T48>(value); break; case 49: Item049 = LanguagePrimitives.ConvertTo<T49>(value); break; case 50: Item050 = LanguagePrimitives.ConvertTo<T50>(value); break; case 51: Item051 = LanguagePrimitives.ConvertTo<T51>(value); break; case 52: Item052 = LanguagePrimitives.ConvertTo<T52>(value); break; case 53: Item053 = LanguagePrimitives.ConvertTo<T53>(value); break; case 54: Item054 = LanguagePrimitives.ConvertTo<T54>(value); break; case 55: Item055 = LanguagePrimitives.ConvertTo<T55>(value); break; case 56: Item056 = LanguagePrimitives.ConvertTo<T56>(value); break; case 57: Item057 = LanguagePrimitives.ConvertTo<T57>(value); break; case 58: Item058 = LanguagePrimitives.ConvertTo<T58>(value); break; case 59: Item059 = LanguagePrimitives.ConvertTo<T59>(value); break; case 60: Item060 = LanguagePrimitives.ConvertTo<T60>(value); break; case 61: Item061 = LanguagePrimitives.ConvertTo<T61>(value); break; case 62: Item062 = LanguagePrimitives.ConvertTo<T62>(value); break; case 63: Item063 = LanguagePrimitives.ConvertTo<T63>(value); break; default: throw new ArgumentOutOfRangeException("index"); } } public override int Capacity { get { return 64; } } } [GeneratedCode("DLR", "2.0")] internal class MutableTuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50, T51, T52, T53, T54, T55, T56, T57, T58, T59, T60, T61, T62, T63, T64, T65, T66, T67, T68, T69, T70, T71, T72, T73, T74, T75, T76, T77, T78, T79, T80, T81, T82, T83, T84, T85, T86, T87, T88, T89, T90, T91, T92, T93, T94, T95, T96, T97, T98, T99, T100, T101, T102, T103, T104, T105, T106, T107, T108, T109, T110, T111, T112, T113, T114, T115, T116, T117, T118, T119, T120, T121, T122, T123, T124, T125, T126, T127> : MutableTuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50, T51, T52, T53, T54, T55, T56, T57, T58, T59, T60, T61, T62, T63> { public MutableTuple() { } public MutableTuple(T0 item0, T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12, T13 item13, T14 item14, T15 item15, T16 item16, T17 item17, T18 item18, T19 item19, T20 item20, T21 item21, T22 item22, T23 item23, T24 item24, T25 item25, T26 item26, T27 item27, T28 item28, T29 item29, T30 item30, T31 item31, T32 item32, T33 item33, T34 item34, T35 item35, T36 item36, T37 item37, T38 item38, T39 item39, T40 item40, T41 item41, T42 item42, T43 item43, T44 item44, T45 item45, T46 item46, T47 item47, T48 item48, T49 item49, T50 item50, T51 item51, T52 item52, T53 item53, T54 item54, T55 item55, T56 item56, T57 item57, T58 item58, T59 item59, T60 item60, T61 item61, T62 item62, T63 item63, T64 item64, T65 item65, T66 item66, T67 item67, T68 item68, T69 item69, T70 item70, T71 item71, T72 item72, T73 item73, T74 item74, T75 item75, T76 item76, T77 item77, T78 item78, T79 item79, T80 item80, T81 item81, T82 item82, T83 item83, T84 item84, T85 item85, T86 item86, T87 item87, T88 item88, T89 item89, T90 item90, T91 item91, T92 item92, T93 item93, T94 item94, T95 item95, T96 item96, T97 item97, T98 item98, T99 item99, T100 item100, T101 item101, T102 item102, T103 item103, T104 item104, T105 item105, T106 item106, T107 item107, T108 item108, T109 item109, T110 item110, T111 item111, T112 item112, T113 item113, T114 item114, T115 item115, T116 item116, T117 item117, T118 item118, T119 item119, T120 item120, T121 item121, T122 item122, T123 item123, T124 item124, T125 item125, T126 item126, T127 item127) : base(item0, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18, item19, item20, item21, item22, item23, item24, item25, item26, item27, item28, item29, item30, item31, item32, item33, item34, item35, item36, item37, item38, item39, item40, item41, item42, item43, item44, item45, item46, item47, item48, item49, item50, item51, item52, item53, item54, item55, item56, item57, item58, item59, item60, item61, item62, item63) { _item64 = item64; _item65 = item65; _item66 = item66; _item67 = item67; _item68 = item68; _item69 = item69; _item70 = item70; _item71 = item71; _item72 = item72; _item73 = item73; _item74 = item74; _item75 = item75; _item76 = item76; _item77 = item77; _item78 = item78; _item79 = item79; _item80 = item80; _item81 = item81; _item82 = item82; _item83 = item83; _item84 = item84; _item85 = item85; _item86 = item86; _item87 = item87; _item88 = item88; _item89 = item89; _item90 = item90; _item91 = item91; _item92 = item92; _item93 = item93; _item94 = item94; _item95 = item95; _item96 = item96; _item97 = item97; _item98 = item98; _item99 = item99; _item100 = item100; _item101 = item101; _item102 = item102; _item103 = item103; _item104 = item104; _item105 = item105; _item106 = item106; _item107 = item107; _item108 = item108; _item109 = item109; _item110 = item110; _item111 = item111; _item112 = item112; _item113 = item113; _item114 = item114; _item115 = item115; _item116 = item116; _item117 = item117; _item118 = item118; _item119 = item119; _item120 = item120; _item121 = item121; _item122 = item122; _item123 = item123; _item124 = item124; _item125 = item125; _item126 = item126; _item127 = item127; } private T64 _item64; private T65 _item65; private T66 _item66; private T67 _item67; private T68 _item68; private T69 _item69; private T70 _item70; private T71 _item71; private T72 _item72; private T73 _item73; private T74 _item74; private T75 _item75; private T76 _item76; private T77 _item77; private T78 _item78; private T79 _item79; private T80 _item80; private T81 _item81; private T82 _item82; private T83 _item83; private T84 _item84; private T85 _item85; private T86 _item86; private T87 _item87; private T88 _item88; private T89 _item89; private T90 _item90; private T91 _item91; private T92 _item92; private T93 _item93; private T94 _item94; private T95 _item95; private T96 _item96; private T97 _item97; private T98 _item98; private T99 _item99; private T100 _item100; private T101 _item101; private T102 _item102; private T103 _item103; private T104 _item104; private T105 _item105; private T106 _item106; private T107 _item107; private T108 _item108; private T109 _item109; private T110 _item110; private T111 _item111; private T112 _item112; private T113 _item113; private T114 _item114; private T115 _item115; private T116 _item116; private T117 _item117; private T118 _item118; private T119 _item119; private T120 _item120; private T121 _item121; private T122 _item122; private T123 _item123; private T124 _item124; private T125 _item125; private T126 _item126; private T127 _item127; public T64 Item064 { get { return _item64; } set { _item64 = value; _valuesSet[64] = true; } } public T65 Item065 { get { return _item65; } set { _item65 = value; _valuesSet[65] = true; } } public T66 Item066 { get { return _item66; } set { _item66 = value; _valuesSet[66] = true; } } public T67 Item067 { get { return _item67; } set { _item67 = value; _valuesSet[67] = true; } } public T68 Item068 { get { return _item68; } set { _item68 = value; _valuesSet[68] = true; } } public T69 Item069 { get { return _item69; } set { _item69 = value; _valuesSet[69] = true; } } public T70 Item070 { get { return _item70; } set { _item70 = value; _valuesSet[70] = true; } } public T71 Item071 { get { return _item71; } set { _item71 = value; _valuesSet[71] = true; } } public T72 Item072 { get { return _item72; } set { _item72 = value; _valuesSet[72] = true; } } public T73 Item073 { get { return _item73; } set { _item73 = value; _valuesSet[73] = true; } } public T74 Item074 { get { return _item74; } set { _item74 = value; _valuesSet[74] = true; } } public T75 Item075 { get { return _item75; } set { _item75 = value; _valuesSet[75] = true; } } public T76 Item076 { get { return _item76; } set { _item76 = value; _valuesSet[76] = true; } } public T77 Item077 { get { return _item77; } set { _item77 = value; _valuesSet[77] = true; } } public T78 Item078 { get { return _item78; } set { _item78 = value; _valuesSet[78] = true; } } public T79 Item079 { get { return _item79; } set { _item79 = value; _valuesSet[79] = true; } } public T80 Item080 { get { return _item80; } set { _item80 = value; _valuesSet[80] = true; } } public T81 Item081 { get { return _item81; } set { _item81 = value; _valuesSet[81] = true; } } public T82 Item082 { get { return _item82; } set { _item82 = value; _valuesSet[82] = true; } } public T83 Item083 { get { return _item83; } set { _item83 = value; _valuesSet[83] = true; } } public T84 Item084 { get { return _item84; } set { _item84 = value; _valuesSet[84] = true; } } public T85 Item085 { get { return _item85; } set { _item85 = value; _valuesSet[85] = true; } } public T86 Item086 { get { return _item86; } set { _item86 = value; _valuesSet[86] = true; } } public T87 Item087 { get { return _item87; } set { _item87 = value; _valuesSet[87] = true; } } public T88 Item088 { get { return _item88; } set { _item88 = value; _valuesSet[88] = true; } } public T89 Item089 { get { return _item89; } set { _item89 = value; _valuesSet[89] = true; } } public T90 Item090 { get { return _item90; } set { _item90 = value; _valuesSet[90] = true; } } public T91 Item091 { get { return _item91; } set { _item91 = value; _valuesSet[91] = true; } } public T92 Item092 { get { return _item92; } set { _item92 = value; _valuesSet[92] = true; } } public T93 Item093 { get { return _item93; } set { _item93 = value; _valuesSet[93] = true; } } public T94 Item094 { get { return _item94; } set { _item94 = value; _valuesSet[94] = true; } } public T95 Item095 { get { return _item95; } set { _item95 = value; _valuesSet[95] = true; } } public T96 Item096 { get { return _item96; } set { _item96 = value; _valuesSet[96] = true; } } public T97 Item097 { get { return _item97; } set { _item97 = value; _valuesSet[97] = true; } } public T98 Item098 { get { return _item98; } set { _item98 = value; _valuesSet[98] = true; } } public T99 Item099 { get { return _item99; } set { _item99 = value; _valuesSet[99] = true; } } public T100 Item100 { get { return _item100; } set { _item100 = value; _valuesSet[100] = true; } } public T101 Item101 { get { return _item101; } set { _item101 = value; _valuesSet[101] = true; } } public T102 Item102 { get { return _item102; } set { _item102 = value; _valuesSet[102] = true; } } public T103 Item103 { get { return _item103; } set { _item103 = value; _valuesSet[103] = true; } } public T104 Item104 { get { return _item104; } set { _item104 = value; _valuesSet[104] = true; } } public T105 Item105 { get { return _item105; } set { _item105 = value; _valuesSet[105] = true; } } public T106 Item106 { get { return _item106; } set { _item106 = value; _valuesSet[106] = true; } } public T107 Item107 { get { return _item107; } set { _item107 = value; _valuesSet[107] = true; } } public T108 Item108 { get { return _item108; } set { _item108 = value; _valuesSet[108] = true; } } public T109 Item109 { get { return _item109; } set { _item109 = value; _valuesSet[109] = true; } } public T110 Item110 { get { return _item110; } set { _item110 = value; _valuesSet[110] = true; } } public T111 Item111 { get { return _item111; } set { _item111 = value; _valuesSet[111] = true; } } public T112 Item112 { get { return _item112; } set { _item112 = value; _valuesSet[112] = true; } } public T113 Item113 { get { return _item113; } set { _item113 = value; _valuesSet[113] = true; } } public T114 Item114 { get { return _item114; } set { _item114 = value; _valuesSet[114] = true; } } public T115 Item115 { get { return _item115; } set { _item115 = value; _valuesSet[115] = true; } } public T116 Item116 { get { return _item116; } set { _item116 = value; _valuesSet[116] = true; } } public T117 Item117 { get { return _item117; } set { _item117 = value; _valuesSet[117] = true; } } public T118 Item118 { get { return _item118; } set { _item118 = value; _valuesSet[118] = true; } } public T119 Item119 { get { return _item119; } set { _item119 = value; _valuesSet[119] = true; } } public T120 Item120 { get { return _item120; } set { _item120 = value; _valuesSet[120] = true; } } public T121 Item121 { get { return _item121; } set { _item121 = value; _valuesSet[121] = true; } } public T122 Item122 { get { return _item122; } set { _item122 = value; _valuesSet[122] = true; } } public T123 Item123 { get { return _item123; } set { _item123 = value; _valuesSet[123] = true; } } public T124 Item124 { get { return _item124; } set { _item124 = value; _valuesSet[124] = true; } } public T125 Item125 { get { return _item125; } set { _item125 = value; _valuesSet[125] = true; } } public T126 Item126 { get { return _item126; } set { _item126 = value; _valuesSet[126] = true; } } public T127 Item127 { get { return _item127; } set { _item127 = value; _valuesSet[127] = true; } } protected override object GetValueImpl(int index) { switch (index) { case 0: return Item000; case 1: return Item001; case 2: return Item002; case 3: return Item003; case 4: return Item004; case 5: return Item005; case 6: return Item006; case 7: return Item007; case 8: return Item008; case 9: return Item009; case 10: return Item010; case 11: return Item011; case 12: return Item012; case 13: return Item013; case 14: return Item014; case 15: return Item015; case 16: return Item016; case 17: return Item017; case 18: return Item018; case 19: return Item019; case 20: return Item020; case 21: return Item021; case 22: return Item022; case 23: return Item023; case 24: return Item024; case 25: return Item025; case 26: return Item026; case 27: return Item027; case 28: return Item028; case 29: return Item029; case 30: return Item030; case 31: return Item031; case 32: return Item032; case 33: return Item033; case 34: return Item034; case 35: return Item035; case 36: return Item036; case 37: return Item037; case 38: return Item038; case 39: return Item039; case 40: return Item040; case 41: return Item041; case 42: return Item042; case 43: return Item043; case 44: return Item044; case 45: return Item045; case 46: return Item046; case 47: return Item047; case 48: return Item048; case 49: return Item049; case 50: return Item050; case 51: return Item051; case 52: return Item052; case 53: return Item053; case 54: return Item054; case 55: return Item055; case 56: return Item056; case 57: return Item057; case 58: return Item058; case 59: return Item059; case 60: return Item060; case 61: return Item061; case 62: return Item062; case 63: return Item063; case 64: return Item064; case 65: return Item065; case 66: return Item066; case 67: return Item067; case 68: return Item068; case 69: return Item069; case 70: return Item070; case 71: return Item071; case 72: return Item072; case 73: return Item073; case 74: return Item074; case 75: return Item075; case 76: return Item076; case 77: return Item077; case 78: return Item078; case 79: return Item079; case 80: return Item080; case 81: return Item081; case 82: return Item082; case 83: return Item083; case 84: return Item084; case 85: return Item085; case 86: return Item086; case 87: return Item087; case 88: return Item088; case 89: return Item089; case 90: return Item090; case 91: return Item091; case 92: return Item092; case 93: return Item093; case 94: return Item094; case 95: return Item095; case 96: return Item096; case 97: return Item097; case 98: return Item098; case 99: return Item099; case 100: return Item100; case 101: return Item101; case 102: return Item102; case 103: return Item103; case 104: return Item104; case 105: return Item105; case 106: return Item106; case 107: return Item107; case 108: return Item108; case 109: return Item109; case 110: return Item110; case 111: return Item111; case 112: return Item112; case 113: return Item113; case 114: return Item114; case 115: return Item115; case 116: return Item116; case 117: return Item117; case 118: return Item118; case 119: return Item119; case 120: return Item120; case 121: return Item121; case 122: return Item122; case 123: return Item123; case 124: return Item124; case 125: return Item125; case 126: return Item126; case 127: return Item127; default: throw new ArgumentOutOfRangeException("index"); } } protected override void SetValueImpl(int index, object value) { switch (index) { case 0: Item000 = LanguagePrimitives.ConvertTo<T0>(value); break; case 1: Item001 = LanguagePrimitives.ConvertTo<T1>(value); break; case 2: Item002 = LanguagePrimitives.ConvertTo<T2>(value); break; case 3: Item003 = LanguagePrimitives.ConvertTo<T3>(value); break; case 4: Item004 = LanguagePrimitives.ConvertTo<T4>(value); break; case 5: Item005 = LanguagePrimitives.ConvertTo<T5>(value); break; case 6: Item006 = LanguagePrimitives.ConvertTo<T6>(value); break; case 7: Item007 = LanguagePrimitives.ConvertTo<T7>(value); break; case 8: Item008 = LanguagePrimitives.ConvertTo<T8>(value); break; case 9: Item009 = LanguagePrimitives.ConvertTo<T9>(value); break; case 10: Item010 = LanguagePrimitives.ConvertTo<T10>(value); break; case 11: Item011 = LanguagePrimitives.ConvertTo<T11>(value); break; case 12: Item012 = LanguagePrimitives.ConvertTo<T12>(value); break; case 13: Item013 = LanguagePrimitives.ConvertTo<T13>(value); break; case 14: Item014 = LanguagePrimitives.ConvertTo<T14>(value); break; case 15: Item015 = LanguagePrimitives.ConvertTo<T15>(value); break; case 16: Item016 = LanguagePrimitives.ConvertTo<T16>(value); break; case 17: Item017 = LanguagePrimitives.ConvertTo<T17>(value); break; case 18: Item018 = LanguagePrimitives.ConvertTo<T18>(value); break; case 19: Item019 = LanguagePrimitives.ConvertTo<T19>(value); break; case 20: Item020 = LanguagePrimitives.ConvertTo<T20>(value); break; case 21: Item021 = LanguagePrimitives.ConvertTo<T21>(value); break; case 22: Item022 = LanguagePrimitives.ConvertTo<T22>(value); break; case 23: Item023 = LanguagePrimitives.ConvertTo<T23>(value); break; case 24: Item024 = LanguagePrimitives.ConvertTo<T24>(value); break; case 25: Item025 = LanguagePrimitives.ConvertTo<T25>(value); break; case 26: Item026 = LanguagePrimitives.ConvertTo<T26>(value); break; case 27: Item027 = LanguagePrimitives.ConvertTo<T27>(value); break; case 28: Item028 = LanguagePrimitives.ConvertTo<T28>(value); break; case 29: Item029 = LanguagePrimitives.ConvertTo<T29>(value); break; case 30: Item030 = LanguagePrimitives.ConvertTo<T30>(value); break; case 31: Item031 = LanguagePrimitives.ConvertTo<T31>(value); break; case 32: Item032 = LanguagePrimitives.ConvertTo<T32>(value); break; case 33: Item033 = LanguagePrimitives.ConvertTo<T33>(value); break; case 34: Item034 = LanguagePrimitives.ConvertTo<T34>(value); break; case 35: Item035 = LanguagePrimitives.ConvertTo<T35>(value); break; case 36: Item036 = LanguagePrimitives.ConvertTo<T36>(value); break; case 37: Item037 = LanguagePrimitives.ConvertTo<T37>(value); break; case 38: Item038 = LanguagePrimitives.ConvertTo<T38>(value); break; case 39: Item039 = LanguagePrimitives.ConvertTo<T39>(value); break; case 40: Item040 = LanguagePrimitives.ConvertTo<T40>(value); break; case 41: Item041 = LanguagePrimitives.ConvertTo<T41>(value); break; case 42: Item042 = LanguagePrimitives.ConvertTo<T42>(value); break; case 43: Item043 = LanguagePrimitives.ConvertTo<T43>(value); break; case 44: Item044 = LanguagePrimitives.ConvertTo<T44>(value); break; case 45: Item045 = LanguagePrimitives.ConvertTo<T45>(value); break; case 46: Item046 = LanguagePrimitives.ConvertTo<T46>(value); break; case 47: Item047 = LanguagePrimitives.ConvertTo<T47>(value); break; case 48: Item048 = LanguagePrimitives.ConvertTo<T48>(value); break; case 49: Item049 = LanguagePrimitives.ConvertTo<T49>(value); break; case 50: Item050 = LanguagePrimitives.ConvertTo<T50>(value); break; case 51: Item051 = LanguagePrimitives.ConvertTo<T51>(value); break; case 52: Item052 = LanguagePrimitives.ConvertTo<T52>(value); break; case 53: Item053 = LanguagePrimitives.ConvertTo<T53>(value); break; case 54: Item054 = LanguagePrimitives.ConvertTo<T54>(value); break; case 55: Item055 = LanguagePrimitives.ConvertTo<T55>(value); break; case 56: Item056 = LanguagePrimitives.ConvertTo<T56>(value); break; case 57: Item057 = LanguagePrimitives.ConvertTo<T57>(value); break; case 58: Item058 = LanguagePrimitives.ConvertTo<T58>(value); break; case 59: Item059 = LanguagePrimitives.ConvertTo<T59>(value); break; case 60: Item060 = LanguagePrimitives.ConvertTo<T60>(value); break; case 61: Item061 = LanguagePrimitives.ConvertTo<T61>(value); break; case 62: Item062 = LanguagePrimitives.ConvertTo<T62>(value); break; case 63: Item063 = LanguagePrimitives.ConvertTo<T63>(value); break; case 64: Item064 = LanguagePrimitives.ConvertTo<T64>(value); break; case 65: Item065 = LanguagePrimitives.ConvertTo<T65>(value); break; case 66: Item066 = LanguagePrimitives.ConvertTo<T66>(value); break; case 67: Item067 = LanguagePrimitives.ConvertTo<T67>(value); break; case 68: Item068 = LanguagePrimitives.ConvertTo<T68>(value); break; case 69: Item069 = LanguagePrimitives.ConvertTo<T69>(value); break; case 70: Item070 = LanguagePrimitives.ConvertTo<T70>(value); break; case 71: Item071 = LanguagePrimitives.ConvertTo<T71>(value); break; case 72: Item072 = LanguagePrimitives.ConvertTo<T72>(value); break; case 73: Item073 = LanguagePrimitives.ConvertTo<T73>(value); break; case 74: Item074 = LanguagePrimitives.ConvertTo<T74>(value); break; case 75: Item075 = LanguagePrimitives.ConvertTo<T75>(value); break; case 76: Item076 = LanguagePrimitives.ConvertTo<T76>(value); break; case 77: Item077 = LanguagePrimitives.ConvertTo<T77>(value); break; case 78: Item078 = LanguagePrimitives.ConvertTo<T78>(value); break; case 79: Item079 = LanguagePrimitives.ConvertTo<T79>(value); break; case 80: Item080 = LanguagePrimitives.ConvertTo<T80>(value); break; case 81: Item081 = LanguagePrimitives.ConvertTo<T81>(value); break; case 82: Item082 = LanguagePrimitives.ConvertTo<T82>(value); break; case 83: Item083 = LanguagePrimitives.ConvertTo<T83>(value); break; case 84: Item084 = LanguagePrimitives.ConvertTo<T84>(value); break; case 85: Item085 = LanguagePrimitives.ConvertTo<T85>(value); break; case 86: Item086 = LanguagePrimitives.ConvertTo<T86>(value); break; case 87: Item087 = LanguagePrimitives.ConvertTo<T87>(value); break; case 88: Item088 = LanguagePrimitives.ConvertTo<T88>(value); break; case 89: Item089 = LanguagePrimitives.ConvertTo<T89>(value); break; case 90: Item090 = LanguagePrimitives.ConvertTo<T90>(value); break; case 91: Item091 = LanguagePrimitives.ConvertTo<T91>(value); break; case 92: Item092 = LanguagePrimitives.ConvertTo<T92>(value); break; case 93: Item093 = LanguagePrimitives.ConvertTo<T93>(value); break; case 94: Item094 = LanguagePrimitives.ConvertTo<T94>(value); break; case 95: Item095 = LanguagePrimitives.ConvertTo<T95>(value); break; case 96: Item096 = LanguagePrimitives.ConvertTo<T96>(value); break; case 97: Item097 = LanguagePrimitives.ConvertTo<T97>(value); break; case 98: Item098 = LanguagePrimitives.ConvertTo<T98>(value); break; case 99: Item099 = LanguagePrimitives.ConvertTo<T99>(value); break; case 100: Item100 = LanguagePrimitives.ConvertTo<T100>(value); break; case 101: Item101 = LanguagePrimitives.ConvertTo<T101>(value); break; case 102: Item102 = LanguagePrimitives.ConvertTo<T102>(value); break; case 103: Item103 = LanguagePrimitives.ConvertTo<T103>(value); break; case 104: Item104 = LanguagePrimitives.ConvertTo<T104>(value); break; case 105: Item105 = LanguagePrimitives.ConvertTo<T105>(value); break; case 106: Item106 = LanguagePrimitives.ConvertTo<T106>(value); break; case 107: Item107 = LanguagePrimitives.ConvertTo<T107>(value); break; case 108: Item108 = LanguagePrimitives.ConvertTo<T108>(value); break; case 109: Item109 = LanguagePrimitives.ConvertTo<T109>(value); break; case 110: Item110 = LanguagePrimitives.ConvertTo<T110>(value); break; case 111: Item111 = LanguagePrimitives.ConvertTo<T111>(value); break; case 112: Item112 = LanguagePrimitives.ConvertTo<T112>(value); break; case 113: Item113 = LanguagePrimitives.ConvertTo<T113>(value); break; case 114: Item114 = LanguagePrimitives.ConvertTo<T114>(value); break; case 115: Item115 = LanguagePrimitives.ConvertTo<T115>(value); break; case 116: Item116 = LanguagePrimitives.ConvertTo<T116>(value); break; case 117: Item117 = LanguagePrimitives.ConvertTo<T117>(value); break; case 118: Item118 = LanguagePrimitives.ConvertTo<T118>(value); break; case 119: Item119 = LanguagePrimitives.ConvertTo<T119>(value); break; case 120: Item120 = LanguagePrimitives.ConvertTo<T120>(value); break; case 121: Item121 = LanguagePrimitives.ConvertTo<T121>(value); break; case 122: Item122 = LanguagePrimitives.ConvertTo<T122>(value); break; case 123: Item123 = LanguagePrimitives.ConvertTo<T123>(value); break; case 124: Item124 = LanguagePrimitives.ConvertTo<T124>(value); break; case 125: Item125 = LanguagePrimitives.ConvertTo<T125>(value); break; case 126: Item126 = LanguagePrimitives.ConvertTo<T126>(value); break; case 127: Item127 = LanguagePrimitives.ConvertTo<T127>(value); break; default: throw new ArgumentOutOfRangeException("index"); } } public override int Capacity { get { return 128; } } } // *** END GENERATED CODE *** #endregion }
35.720553
1,599
0.526562
[ "MIT" ]
10088/PowerShell
src/System.Management.Automation/engine/runtime/MutableTuple.cs
90,373
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Finbook.BuildingBlocks.EventBus.Abstractions; using Finbook.BuildingBlocks.EventBus.Events; namespace Projects.API.Application.IntegrationEvents { public class ProjectIntegrationEventService : IProjectIntegrationEventService { private readonly IEventBus _eventBus; public ProjectIntegrationEventService(IEventBus eventBus) { _eventBus = eventBus; } /// <summary> /// 发送集成事件至RabbitMQ /// </summary> /// <param name="evt"></param> /// <returns></returns> public Task PublishThroughEventBusAsync(IntegrationEvent evt) { _eventBus.Publish(evt); return Task.CompletedTask; } } }
28.37931
81
0.664642
[ "Apache-2.0" ]
xiaowu351/Finbook
src/Projects/Projects.API/Application/IntegrationEvents/ProjectIntegrationEventService.cs
839
C#
// <auto-generated /> using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using StoredProcedureDemo.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; namespace StoredProcedureDemo.Migrations { [DbContext(typeof(StoredProcedureDemoMigrationsDbContext))] partial class StoredProcedureDemoMigrationsDbContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) .HasAnnotation("ProductVersion", "3.1.6") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("ApplicationName") .HasColumnName("ApplicationName") .HasColumnType("nvarchar(96)") .HasMaxLength(96); b.Property<string>("BrowserInfo") .HasColumnName("BrowserInfo") .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property<string>("ClientId") .HasColumnName("ClientId") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("ClientIpAddress") .HasColumnName("ClientIpAddress") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("ClientName") .HasColumnName("ClientName") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("Comments") .HasColumnName("Comments") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnName("ConcurrencyStamp") .HasColumnType("nvarchar(40)") .HasMaxLength(40); b.Property<string>("CorrelationId") .HasColumnName("CorrelationId") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("Exceptions") .HasColumnName("Exceptions") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<int>("ExecutionDuration") .HasColumnName("ExecutionDuration") .HasColumnType("int"); b.Property<DateTime>("ExecutionTime") .HasColumnType("datetime2"); b.Property<string>("ExtraProperties") .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); b.Property<string>("HttpMethod") .HasColumnName("HttpMethod") .HasColumnType("nvarchar(16)") .HasMaxLength(16); b.Property<int?>("HttpStatusCode") .HasColumnName("HttpStatusCode") .HasColumnType("int"); b.Property<Guid?>("ImpersonatorTenantId") .HasColumnName("ImpersonatorTenantId") .HasColumnType("uniqueidentifier"); b.Property<Guid?>("ImpersonatorUserId") .HasColumnName("ImpersonatorUserId") .HasColumnType("uniqueidentifier"); b.Property<Guid?>("TenantId") .HasColumnName("TenantId") .HasColumnType("uniqueidentifier"); b.Property<string>("TenantName") .HasColumnType("nvarchar(max)"); b.Property<string>("Url") .HasColumnName("Url") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<Guid?>("UserId") .HasColumnName("UserId") .HasColumnType("uniqueidentifier"); b.Property<string>("UserName") .HasColumnName("UserName") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.HasKey("Id"); b.HasIndex("TenantId", "ExecutionTime"); b.HasIndex("TenantId", "UserId", "ExecutionTime"); b.ToTable("AbpAuditLogs"); }); modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<Guid>("AuditLogId") .HasColumnName("AuditLogId") .HasColumnType("uniqueidentifier"); b.Property<int>("ExecutionDuration") .HasColumnName("ExecutionDuration") .HasColumnType("int"); b.Property<DateTime>("ExecutionTime") .HasColumnName("ExecutionTime") .HasColumnType("datetime2"); b.Property<string>("ExtraProperties") .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); b.Property<string>("MethodName") .HasColumnName("MethodName") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("Parameters") .HasColumnName("Parameters") .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); b.Property<string>("ServiceName") .HasColumnName("ServiceName") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<Guid?>("TenantId") .HasColumnName("TenantId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.HasIndex("AuditLogId"); b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); b.ToTable("AbpAuditLogActions"); }); modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<Guid>("AuditLogId") .HasColumnName("AuditLogId") .HasColumnType("uniqueidentifier"); b.Property<DateTime>("ChangeTime") .HasColumnName("ChangeTime") .HasColumnType("datetime2"); b.Property<byte>("ChangeType") .HasColumnName("ChangeType") .HasColumnType("tinyint"); b.Property<string>("EntityId") .IsRequired() .HasColumnName("EntityId") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<Guid?>("EntityTenantId") .HasColumnType("uniqueidentifier"); b.Property<string>("EntityTypeFullName") .IsRequired() .HasColumnName("EntityTypeFullName") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("ExtraProperties") .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); b.Property<Guid?>("TenantId") .HasColumnName("TenantId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.HasIndex("AuditLogId"); b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); b.ToTable("AbpEntityChanges"); }); modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<Guid>("EntityChangeId") .HasColumnType("uniqueidentifier"); b.Property<string>("NewValue") .HasColumnName("NewValue") .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property<string>("OriginalValue") .HasColumnName("OriginalValue") .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property<string>("PropertyName") .IsRequired() .HasColumnName("PropertyName") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("PropertyTypeFullName") .IsRequired() .HasColumnName("PropertyTypeFullName") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<Guid?>("TenantId") .HasColumnName("TenantId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.HasIndex("EntityChangeId"); b.ToTable("AbpEntityPropertyChanges"); }); modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnName("ConcurrencyStamp") .HasColumnType("nvarchar(40)") .HasMaxLength(40); b.Property<DateTime>("CreationTime") .HasColumnName("CreationTime") .HasColumnType("datetime2"); b.Property<string>("ExtraProperties") .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); b.Property<bool>("IsAbandoned") .ValueGeneratedOnAdd() .HasColumnType("bit") .HasDefaultValue(false); b.Property<string>("JobArgs") .IsRequired() .HasColumnType("nvarchar(max)") .HasMaxLength(1048576); b.Property<string>("JobName") .IsRequired() .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<DateTime?>("LastTryTime") .HasColumnType("datetime2"); b.Property<DateTime>("NextTryTime") .HasColumnType("datetime2"); b.Property<byte>("Priority") .ValueGeneratedOnAdd() .HasColumnType("tinyint") .HasDefaultValue((byte)15); b.Property<short>("TryCount") .ValueGeneratedOnAdd() .HasColumnType("smallint") .HasDefaultValue((short)0); b.HasKey("Id"); b.HasIndex("IsAbandoned", "NextTryTime"); b.ToTable("AbpBackgroundJobs"); }); modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("Name") .IsRequired() .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("ProviderKey") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("ProviderName") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("Value") .IsRequired() .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.HasKey("Id"); b.HasIndex("Name", "ProviderName", "ProviderKey"); b.ToTable("AbpFeatureValues"); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnName("ConcurrencyStamp") .HasColumnType("nvarchar(40)") .HasMaxLength(40); b.Property<string>("Description") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("ExtraProperties") .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); b.Property<bool>("IsStatic") .HasColumnType("bit"); b.Property<string>("Name") .IsRequired() .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("Regex") .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property<string>("RegexDescription") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<bool>("Required") .HasColumnType("bit"); b.Property<int>("ValueType") .HasColumnType("int"); b.HasKey("Id"); b.ToTable("AbpClaimTypes"); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnName("ConcurrencyStamp") .HasColumnType("nvarchar(40)") .HasMaxLength(40); b.Property<string>("ExtraProperties") .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); b.Property<bool>("IsDefault") .HasColumnName("IsDefault") .HasColumnType("bit"); b.Property<bool>("IsPublic") .HasColumnName("IsPublic") .HasColumnType("bit"); b.Property<bool>("IsStatic") .HasColumnName("IsStatic") .HasColumnType("bit"); b.Property<string>("Name") .IsRequired() .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("NormalizedName") .IsRequired() .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<Guid?>("TenantId") .HasColumnName("TenantId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.HasIndex("NormalizedName"); b.ToTable("AbpRoles"); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => { b.Property<Guid>("Id") .HasColumnType("uniqueidentifier"); b.Property<string>("ClaimType") .IsRequired() .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("ClaimValue") .HasColumnType("nvarchar(1024)") .HasMaxLength(1024); b.Property<Guid>("RoleId") .HasColumnType("uniqueidentifier"); b.Property<Guid?>("TenantId") .HasColumnName("TenantId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.HasIndex("RoleId"); b.ToTable("AbpRoleClaims"); }); modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("Action") .HasColumnType("nvarchar(96)") .HasMaxLength(96); b.Property<string>("ApplicationName") .HasColumnType("nvarchar(96)") .HasMaxLength(96); b.Property<string>("BrowserInfo") .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property<string>("ClientId") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("ClientIpAddress") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnName("ConcurrencyStamp") .HasColumnType("nvarchar(40)") .HasMaxLength(40); b.Property<string>("CorrelationId") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<string>("ExtraProperties") .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); b.Property<string>("Identity") .HasColumnType("nvarchar(96)") .HasMaxLength(96); b.Property<Guid?>("TenantId") .HasColumnName("TenantId") .HasColumnType("uniqueidentifier"); b.Property<string>("TenantName") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<Guid?>("UserId") .HasColumnType("uniqueidentifier"); b.Property<string>("UserName") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.HasKey("Id"); b.HasIndex("TenantId", "Action"); b.HasIndex("TenantId", "ApplicationName"); b.HasIndex("TenantId", "Identity"); b.HasIndex("TenantId", "UserId"); b.ToTable("AbpSecurityLogs"); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<int>("AccessFailedCount") .ValueGeneratedOnAdd() .HasColumnName("AccessFailedCount") .HasColumnType("int") .HasDefaultValue(0); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnName("ConcurrencyStamp") .HasColumnType("nvarchar(40)") .HasMaxLength(40); b.Property<DateTime>("CreationTime") .HasColumnName("CreationTime") .HasColumnType("datetime2"); b.Property<Guid?>("CreatorId") .HasColumnName("CreatorId") .HasColumnType("uniqueidentifier"); b.Property<Guid?>("DeleterId") .HasColumnName("DeleterId") .HasColumnType("uniqueidentifier"); b.Property<DateTime?>("DeletionTime") .HasColumnName("DeletionTime") .HasColumnType("datetime2"); b.Property<string>("Email") .IsRequired() .HasColumnName("Email") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<bool>("EmailConfirmed") .ValueGeneratedOnAdd() .HasColumnName("EmailConfirmed") .HasColumnType("bit") .HasDefaultValue(false); b.Property<string>("ExtraProperties") .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); b.Property<bool>("IsDeleted") .ValueGeneratedOnAdd() .HasColumnName("IsDeleted") .HasColumnType("bit") .HasDefaultValue(false); b.Property<bool>("IsExternal") .ValueGeneratedOnAdd() .HasColumnName("IsExternal") .HasColumnType("bit") .HasDefaultValue(false); b.Property<DateTime?>("LastModificationTime") .HasColumnName("LastModificationTime") .HasColumnType("datetime2"); b.Property<Guid?>("LastModifierId") .HasColumnName("LastModifierId") .HasColumnType("uniqueidentifier"); b.Property<bool>("LockoutEnabled") .ValueGeneratedOnAdd() .HasColumnName("LockoutEnabled") .HasColumnType("bit") .HasDefaultValue(false); b.Property<DateTimeOffset?>("LockoutEnd") .HasColumnType("datetimeoffset"); b.Property<string>("Name") .HasColumnName("Name") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("NormalizedEmail") .IsRequired() .HasColumnName("NormalizedEmail") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("NormalizedUserName") .IsRequired() .HasColumnName("NormalizedUserName") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("PasswordHash") .HasColumnName("PasswordHash") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("PhoneNumber") .HasColumnName("PhoneNumber") .HasColumnType("nvarchar(16)") .HasMaxLength(16); b.Property<bool>("PhoneNumberConfirmed") .ValueGeneratedOnAdd() .HasColumnName("PhoneNumberConfirmed") .HasColumnType("bit") .HasDefaultValue(false); b.Property<string>("SecurityStamp") .IsRequired() .HasColumnName("SecurityStamp") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("Surname") .HasColumnName("Surname") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<Guid?>("TenantId") .HasColumnName("TenantId") .HasColumnType("uniqueidentifier"); b.Property<bool>("TwoFactorEnabled") .ValueGeneratedOnAdd() .HasColumnName("TwoFactorEnabled") .HasColumnType("bit") .HasDefaultValue(false); b.Property<string>("UserName") .IsRequired() .HasColumnName("UserName") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.HasKey("Id"); b.HasIndex("Email"); b.HasIndex("NormalizedEmail"); b.HasIndex("NormalizedUserName"); b.HasIndex("UserName"); b.ToTable("AbpUsers"); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => { b.Property<Guid>("Id") .HasColumnType("uniqueidentifier"); b.Property<string>("ClaimType") .IsRequired() .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("ClaimValue") .HasColumnType("nvarchar(1024)") .HasMaxLength(1024); b.Property<Guid?>("TenantId") .HasColumnName("TenantId") .HasColumnType("uniqueidentifier"); b.Property<Guid>("UserId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("AbpUserClaims"); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => { b.Property<Guid>("UserId") .HasColumnType("uniqueidentifier"); b.Property<string>("LoginProvider") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("ProviderDisplayName") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("ProviderKey") .IsRequired() .HasColumnType("nvarchar(196)") .HasMaxLength(196); b.Property<Guid?>("TenantId") .HasColumnName("TenantId") .HasColumnType("uniqueidentifier"); b.HasKey("UserId", "LoginProvider"); b.HasIndex("LoginProvider", "ProviderKey"); b.ToTable("AbpUserLogins"); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => { b.Property<Guid>("OrganizationUnitId") .HasColumnType("uniqueidentifier"); b.Property<Guid>("UserId") .HasColumnType("uniqueidentifier"); b.Property<DateTime>("CreationTime") .HasColumnName("CreationTime") .HasColumnType("datetime2"); b.Property<Guid?>("CreatorId") .HasColumnName("CreatorId") .HasColumnType("uniqueidentifier"); b.Property<Guid?>("TenantId") .HasColumnName("TenantId") .HasColumnType("uniqueidentifier"); b.HasKey("OrganizationUnitId", "UserId"); b.HasIndex("UserId", "OrganizationUnitId"); b.ToTable("AbpUserOrganizationUnits"); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => { b.Property<Guid>("UserId") .HasColumnType("uniqueidentifier"); b.Property<Guid>("RoleId") .HasColumnType("uniqueidentifier"); b.Property<Guid?>("TenantId") .HasColumnName("TenantId") .HasColumnType("uniqueidentifier"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId", "UserId"); b.ToTable("AbpUserRoles"); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => { b.Property<Guid>("UserId") .HasColumnType("uniqueidentifier"); b.Property<string>("LoginProvider") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("Name") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<Guid?>("TenantId") .HasColumnName("TenantId") .HasColumnType("uniqueidentifier"); b.Property<string>("Value") .HasColumnType("nvarchar(max)"); b.HasKey("UserId", "LoginProvider", "Name"); b.ToTable("AbpUserTokens"); }); modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("Code") .IsRequired() .HasColumnName("Code") .HasColumnType("nvarchar(95)") .HasMaxLength(95); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnName("ConcurrencyStamp") .HasColumnType("nvarchar(40)") .HasMaxLength(40); b.Property<DateTime>("CreationTime") .HasColumnName("CreationTime") .HasColumnType("datetime2"); b.Property<Guid?>("CreatorId") .HasColumnName("CreatorId") .HasColumnType("uniqueidentifier"); b.Property<Guid?>("DeleterId") .HasColumnName("DeleterId") .HasColumnType("uniqueidentifier"); b.Property<DateTime?>("DeletionTime") .HasColumnName("DeletionTime") .HasColumnType("datetime2"); b.Property<string>("DisplayName") .IsRequired() .HasColumnName("DisplayName") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("ExtraProperties") .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); b.Property<bool>("IsDeleted") .ValueGeneratedOnAdd() .HasColumnName("IsDeleted") .HasColumnType("bit") .HasDefaultValue(false); b.Property<DateTime?>("LastModificationTime") .HasColumnName("LastModificationTime") .HasColumnType("datetime2"); b.Property<Guid?>("LastModifierId") .HasColumnName("LastModifierId") .HasColumnType("uniqueidentifier"); b.Property<Guid?>("ParentId") .HasColumnType("uniqueidentifier"); b.Property<Guid?>("TenantId") .HasColumnName("TenantId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.HasIndex("Code"); b.HasIndex("ParentId"); b.ToTable("AbpOrganizationUnits"); }); modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => { b.Property<Guid>("OrganizationUnitId") .HasColumnType("uniqueidentifier"); b.Property<Guid>("RoleId") .HasColumnType("uniqueidentifier"); b.Property<DateTime>("CreationTime") .HasColumnName("CreationTime") .HasColumnType("datetime2"); b.Property<Guid?>("CreatorId") .HasColumnName("CreatorId") .HasColumnType("uniqueidentifier"); b.Property<Guid?>("TenantId") .HasColumnName("TenantId") .HasColumnType("uniqueidentifier"); b.HasKey("OrganizationUnitId", "RoleId"); b.HasIndex("RoleId", "OrganizationUnitId"); b.ToTable("AbpOrganizationUnitRoles"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnName("ConcurrencyStamp") .HasColumnType("nvarchar(40)") .HasMaxLength(40); b.Property<DateTime>("CreationTime") .HasColumnName("CreationTime") .HasColumnType("datetime2"); b.Property<Guid?>("CreatorId") .HasColumnName("CreatorId") .HasColumnType("uniqueidentifier"); b.Property<Guid?>("DeleterId") .HasColumnName("DeleterId") .HasColumnType("uniqueidentifier"); b.Property<DateTime?>("DeletionTime") .HasColumnName("DeletionTime") .HasColumnType("datetime2"); b.Property<string>("Description") .HasColumnType("nvarchar(1000)") .HasMaxLength(1000); b.Property<string>("DisplayName") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<bool>("Enabled") .HasColumnType("bit"); b.Property<string>("ExtraProperties") .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); b.Property<bool>("IsDeleted") .ValueGeneratedOnAdd() .HasColumnName("IsDeleted") .HasColumnType("bit") .HasDefaultValue(false); b.Property<DateTime?>("LastModificationTime") .HasColumnName("LastModificationTime") .HasColumnType("datetime2"); b.Property<Guid?>("LastModifierId") .HasColumnName("LastModifierId") .HasColumnType("uniqueidentifier"); b.Property<string>("Name") .IsRequired() .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<string>("Properties") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.ToTable("IdentityServerApiResources"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => { b.Property<Guid>("ApiResourceId") .HasColumnType("uniqueidentifier"); b.Property<string>("Type") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.HasKey("ApiResourceId", "Type"); b.ToTable("IdentityServerApiClaims"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => { b.Property<Guid>("ApiResourceId") .HasColumnType("uniqueidentifier"); b.Property<string>("Name") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<string>("Description") .HasColumnType("nvarchar(1000)") .HasMaxLength(1000); b.Property<string>("DisplayName") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<bool>("Emphasize") .HasColumnType("bit"); b.Property<bool>("Required") .HasColumnType("bit"); b.Property<bool>("ShowInDiscoveryDocument") .HasColumnType("bit"); b.HasKey("ApiResourceId", "Name"); b.ToTable("IdentityServerApiScopes"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => { b.Property<Guid>("ApiResourceId") .HasColumnType("uniqueidentifier"); b.Property<string>("Name") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<string>("Type") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.HasKey("ApiResourceId", "Name", "Type"); b.ToTable("IdentityServerApiScopeClaims"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => { b.Property<Guid>("ApiResourceId") .HasColumnType("uniqueidentifier"); b.Property<string>("Type") .HasColumnType("nvarchar(250)") .HasMaxLength(250); b.Property<string>("Value") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<string>("Description") .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); b.Property<DateTime?>("Expiration") .HasColumnType("datetime2"); b.HasKey("ApiResourceId", "Type", "Value"); b.ToTable("IdentityServerApiSecrets"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<int>("AbsoluteRefreshTokenLifetime") .HasColumnType("int"); b.Property<int>("AccessTokenLifetime") .HasColumnType("int"); b.Property<int>("AccessTokenType") .HasColumnType("int"); b.Property<bool>("AllowAccessTokensViaBrowser") .HasColumnType("bit"); b.Property<bool>("AllowOfflineAccess") .HasColumnType("bit"); b.Property<bool>("AllowPlainTextPkce") .HasColumnType("bit"); b.Property<bool>("AllowRememberConsent") .HasColumnType("bit"); b.Property<bool>("AlwaysIncludeUserClaimsInIdToken") .HasColumnType("bit"); b.Property<bool>("AlwaysSendClientClaims") .HasColumnType("bit"); b.Property<int>("AuthorizationCodeLifetime") .HasColumnType("int"); b.Property<bool>("BackChannelLogoutSessionRequired") .HasColumnType("bit"); b.Property<string>("BackChannelLogoutUri") .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); b.Property<string>("ClientClaimsPrefix") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<string>("ClientId") .IsRequired() .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<string>("ClientName") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<string>("ClientUri") .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnName("ConcurrencyStamp") .HasColumnType("nvarchar(40)") .HasMaxLength(40); b.Property<int?>("ConsentLifetime") .HasColumnType("int"); b.Property<DateTime>("CreationTime") .HasColumnName("CreationTime") .HasColumnType("datetime2"); b.Property<Guid?>("CreatorId") .HasColumnName("CreatorId") .HasColumnType("uniqueidentifier"); b.Property<Guid?>("DeleterId") .HasColumnName("DeleterId") .HasColumnType("uniqueidentifier"); b.Property<DateTime?>("DeletionTime") .HasColumnName("DeletionTime") .HasColumnType("datetime2"); b.Property<string>("Description") .HasColumnType("nvarchar(1000)") .HasMaxLength(1000); b.Property<int>("DeviceCodeLifetime") .HasColumnType("int"); b.Property<bool>("EnableLocalLogin") .HasColumnType("bit"); b.Property<bool>("Enabled") .HasColumnType("bit"); b.Property<string>("ExtraProperties") .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); b.Property<bool>("FrontChannelLogoutSessionRequired") .HasColumnType("bit"); b.Property<string>("FrontChannelLogoutUri") .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); b.Property<int>("IdentityTokenLifetime") .HasColumnType("int"); b.Property<bool>("IncludeJwtId") .HasColumnType("bit"); b.Property<bool>("IsDeleted") .ValueGeneratedOnAdd() .HasColumnName("IsDeleted") .HasColumnType("bit") .HasDefaultValue(false); b.Property<DateTime?>("LastModificationTime") .HasColumnName("LastModificationTime") .HasColumnType("datetime2"); b.Property<Guid?>("LastModifierId") .HasColumnName("LastModifierId") .HasColumnType("uniqueidentifier"); b.Property<string>("LogoUri") .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); b.Property<string>("PairWiseSubjectSalt") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<string>("ProtocolType") .IsRequired() .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<int>("RefreshTokenExpiration") .HasColumnType("int"); b.Property<int>("RefreshTokenUsage") .HasColumnType("int"); b.Property<bool>("RequireClientSecret") .HasColumnType("bit"); b.Property<bool>("RequireConsent") .HasColumnType("bit"); b.Property<bool>("RequirePkce") .HasColumnType("bit"); b.Property<int>("SlidingRefreshTokenLifetime") .HasColumnType("int"); b.Property<bool>("UpdateAccessTokenClaimsOnRefresh") .HasColumnType("bit"); b.Property<string>("UserCodeType") .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property<int?>("UserSsoLifetime") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("IdentityServerClients"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => { b.Property<Guid>("ClientId") .HasColumnType("uniqueidentifier"); b.Property<string>("Type") .HasColumnType("nvarchar(250)") .HasMaxLength(250); b.Property<string>("Value") .HasColumnType("nvarchar(250)") .HasMaxLength(250); b.HasKey("ClientId", "Type", "Value"); b.ToTable("IdentityServerClientClaims"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => { b.Property<Guid>("ClientId") .HasColumnType("uniqueidentifier"); b.Property<string>("Origin") .HasColumnType("nvarchar(150)") .HasMaxLength(150); b.HasKey("ClientId", "Origin"); b.ToTable("IdentityServerClientCorsOrigins"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => { b.Property<Guid>("ClientId") .HasColumnType("uniqueidentifier"); b.Property<string>("GrantType") .HasColumnType("nvarchar(250)") .HasMaxLength(250); b.HasKey("ClientId", "GrantType"); b.ToTable("IdentityServerClientGrantTypes"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => { b.Property<Guid>("ClientId") .HasColumnType("uniqueidentifier"); b.Property<string>("Provider") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.HasKey("ClientId", "Provider"); b.ToTable("IdentityServerClientIdPRestrictions"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => { b.Property<Guid>("ClientId") .HasColumnType("uniqueidentifier"); b.Property<string>("PostLogoutRedirectUri") .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); b.HasKey("ClientId", "PostLogoutRedirectUri"); b.ToTable("IdentityServerClientPostLogoutRedirectUris"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => { b.Property<Guid>("ClientId") .HasColumnType("uniqueidentifier"); b.Property<string>("Key") .HasColumnType("nvarchar(250)") .HasMaxLength(250); b.Property<string>("Value") .IsRequired() .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); b.HasKey("ClientId", "Key"); b.ToTable("IdentityServerClientProperties"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => { b.Property<Guid>("ClientId") .HasColumnType("uniqueidentifier"); b.Property<string>("RedirectUri") .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); b.HasKey("ClientId", "RedirectUri"); b.ToTable("IdentityServerClientRedirectUris"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => { b.Property<Guid>("ClientId") .HasColumnType("uniqueidentifier"); b.Property<string>("Scope") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.HasKey("ClientId", "Scope"); b.ToTable("IdentityServerClientScopes"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => { b.Property<Guid>("ClientId") .HasColumnType("uniqueidentifier"); b.Property<string>("Type") .HasColumnType("nvarchar(250)") .HasMaxLength(250); b.Property<string>("Value") .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property<string>("Description") .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); b.Property<DateTime?>("Expiration") .HasColumnType("datetime2"); b.HasKey("ClientId", "Type", "Value"); b.ToTable("IdentityServerClientSecrets"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("ClientId") .IsRequired() .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnName("ConcurrencyStamp") .HasColumnType("nvarchar(40)") .HasMaxLength(40); b.Property<DateTime>("CreationTime") .HasColumnName("CreationTime") .HasColumnType("datetime2"); b.Property<Guid?>("CreatorId") .HasColumnName("CreatorId") .HasColumnType("uniqueidentifier"); b.Property<string>("Data") .IsRequired() .HasColumnType("nvarchar(max)") .HasMaxLength(50000); b.Property<string>("DeviceCode") .IsRequired() .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<DateTime?>("Expiration") .IsRequired() .HasColumnType("datetime2"); b.Property<string>("ExtraProperties") .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); b.Property<string>("SubjectId") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<string>("UserCode") .IsRequired() .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.HasKey("Id"); b.HasIndex("DeviceCode") .IsUnique(); b.HasIndex("Expiration"); b.HasIndex("UserCode") .IsUnique(); b.ToTable("IdentityServerDeviceFlowCodes"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => { b.Property<string>("Key") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<string>("ClientId") .IsRequired() .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnName("ConcurrencyStamp") .HasColumnType("nvarchar(40)") .HasMaxLength(40); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); b.Property<string>("Data") .IsRequired() .HasColumnType("nvarchar(max)") .HasMaxLength(50000); b.Property<DateTime?>("Expiration") .HasColumnType("datetime2"); b.Property<string>("ExtraProperties") .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); b.Property<Guid>("Id") .HasColumnType("uniqueidentifier"); b.Property<string>("SubjectId") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<string>("Type") .IsRequired() .HasColumnType("nvarchar(50)") .HasMaxLength(50); b.HasKey("Key"); b.HasIndex("Expiration"); b.HasIndex("SubjectId", "ClientId", "Type"); b.ToTable("IdentityServerPersistedGrants"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => { b.Property<Guid>("IdentityResourceId") .HasColumnType("uniqueidentifier"); b.Property<string>("Type") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.HasKey("IdentityResourceId", "Type"); b.ToTable("IdentityServerIdentityClaims"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnName("ConcurrencyStamp") .HasColumnType("nvarchar(40)") .HasMaxLength(40); b.Property<DateTime>("CreationTime") .HasColumnName("CreationTime") .HasColumnType("datetime2"); b.Property<Guid?>("CreatorId") .HasColumnName("CreatorId") .HasColumnType("uniqueidentifier"); b.Property<Guid?>("DeleterId") .HasColumnName("DeleterId") .HasColumnType("uniqueidentifier"); b.Property<DateTime?>("DeletionTime") .HasColumnName("DeletionTime") .HasColumnType("datetime2"); b.Property<string>("Description") .HasColumnType("nvarchar(1000)") .HasMaxLength(1000); b.Property<string>("DisplayName") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<bool>("Emphasize") .HasColumnType("bit"); b.Property<bool>("Enabled") .HasColumnType("bit"); b.Property<string>("ExtraProperties") .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); b.Property<bool>("IsDeleted") .ValueGeneratedOnAdd() .HasColumnName("IsDeleted") .HasColumnType("bit") .HasDefaultValue(false); b.Property<DateTime?>("LastModificationTime") .HasColumnName("LastModificationTime") .HasColumnType("datetime2"); b.Property<Guid?>("LastModifierId") .HasColumnName("LastModifierId") .HasColumnType("uniqueidentifier"); b.Property<string>("Name") .IsRequired() .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<string>("Properties") .HasColumnType("nvarchar(max)"); b.Property<bool>("Required") .HasColumnType("bit"); b.Property<bool>("ShowInDiscoveryDocument") .HasColumnType("bit"); b.HasKey("Id"); b.ToTable("IdentityServerIdentityResources"); }); modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("Name") .IsRequired() .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("ProviderKey") .IsRequired() .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("ProviderName") .IsRequired() .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<Guid?>("TenantId") .HasColumnName("TenantId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.HasIndex("Name", "ProviderName", "ProviderKey"); b.ToTable("AbpPermissionGrants"); }); modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("Name") .IsRequired() .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("ProviderKey") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("ProviderName") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("Value") .IsRequired() .HasColumnType("nvarchar(2048)") .HasMaxLength(2048); b.HasKey("Id"); b.HasIndex("Name", "ProviderName", "ProviderKey"); b.ToTable("AbpSettings"); }); modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnName("ConcurrencyStamp") .HasColumnType("nvarchar(40)") .HasMaxLength(40); b.Property<DateTime>("CreationTime") .HasColumnName("CreationTime") .HasColumnType("datetime2"); b.Property<Guid?>("CreatorId") .HasColumnName("CreatorId") .HasColumnType("uniqueidentifier"); b.Property<Guid?>("DeleterId") .HasColumnName("DeleterId") .HasColumnType("uniqueidentifier"); b.Property<DateTime?>("DeletionTime") .HasColumnName("DeletionTime") .HasColumnType("datetime2"); b.Property<string>("ExtraProperties") .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); b.Property<bool>("IsDeleted") .ValueGeneratedOnAdd() .HasColumnName("IsDeleted") .HasColumnType("bit") .HasDefaultValue(false); b.Property<DateTime?>("LastModificationTime") .HasColumnName("LastModificationTime") .HasColumnType("datetime2"); b.Property<Guid?>("LastModifierId") .HasColumnName("LastModifierId") .HasColumnType("uniqueidentifier"); b.Property<string>("Name") .IsRequired() .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.HasKey("Id"); b.HasIndex("Name"); b.ToTable("AbpTenants"); }); modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => { b.Property<Guid>("TenantId") .HasColumnType("uniqueidentifier"); b.Property<string>("Name") .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property<string>("Value") .IsRequired() .HasColumnType("nvarchar(1024)") .HasMaxLength(1024); b.HasKey("TenantId", "Name"); b.ToTable("AbpTenantConnectionStrings"); }); modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => { b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) .WithMany("Actions") .HasForeignKey("AuditLogId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => { b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) .WithMany("EntityChanges") .HasForeignKey("AuditLogId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => { b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) .WithMany("PropertyChanges") .HasForeignKey("EntityChangeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => { b.HasOne("Volo.Abp.Identity.IdentityRole", null) .WithMany("Claims") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => { b.HasOne("Volo.Abp.Identity.IdentityUser", null) .WithMany("Claims") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => { b.HasOne("Volo.Abp.Identity.IdentityUser", null) .WithMany("Logins") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => { b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) .WithMany() .HasForeignKey("OrganizationUnitId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Volo.Abp.Identity.IdentityUser", null) .WithMany("OrganizationUnits") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => { b.HasOne("Volo.Abp.Identity.IdentityRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Volo.Abp.Identity.IdentityUser", null) .WithMany("Roles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => { b.HasOne("Volo.Abp.Identity.IdentityUser", null) .WithMany("Tokens") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => { b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) .WithMany() .HasForeignKey("ParentId"); }); modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => { b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) .WithMany("Roles") .HasForeignKey("OrganizationUnitId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Volo.Abp.Identity.IdentityRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => { b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) .WithMany("UserClaims") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => { b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) .WithMany("Scopes") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => { b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope", null) .WithMany("UserClaims") .HasForeignKey("ApiResourceId", "Name") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => { b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) .WithMany("Secrets") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => { b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) .WithMany("Claims") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => { b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) .WithMany("AllowedCorsOrigins") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => { b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) .WithMany("AllowedGrantTypes") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => { b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) .WithMany("IdentityProviderRestrictions") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => { b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) .WithMany("PostLogoutRedirectUris") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => { b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) .WithMany("Properties") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => { b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) .WithMany("RedirectUris") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => { b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) .WithMany("AllowedScopes") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => { b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) .WithMany("ClientSecrets") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => { b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) .WithMany("UserClaims") .HasForeignKey("IdentityResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => { b.HasOne("Volo.Abp.TenantManagement.Tenant", null) .WithMany("ConnectionStrings") .HasForeignKey("TenantId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); #pragma warning restore 612, 618 } } }
38.746305
117
0.441599
[ "MIT" ]
OzBob/abp-samples
StoredProcedureDemo/src/StoredProcedureDemo.EntityFrameworkCore.DbMigrations/Migrations/StoredProcedureDemoMigrationsDbContextModelSnapshot.cs
78,657
C#
using System; using Windows.UI.Xaml; namespace Telerik.UI.Xaml.Controls.Chart { /// <summary> /// Represents a class that allows for context-based <see cref="ChartSeriesDescriptor"/> selection within a <see cref="ChartSeriesProvider"/> instance. /// </summary> public partial class ChartSeriesDescriptorSelector : DependencyObject { /// <summary> /// Selects the desired descriptor, depending on the context specified and the owning <see cref="ChartSeriesProvider"/> instance. /// </summary> public virtual ChartSeriesDescriptor SelectDescriptor(ChartSeriesProvider provider, object context) { return null; } } }
34.95
155
0.682403
[ "Apache-2.0" ]
HaoLife/Uno.Telerik.UI-For-UWP
Controls/Chart/Chart.UWP/Visualization/DataBinding/DynamicSeries/ChartSeriesDescriptorSelector.cs
701
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Psi.Runtime; using Array = Psi.Runtime.Array; using Boolean = Psi.Runtime.Boolean; namespace Runtime { class Program { void Run() { var @void = VoidType.Instance; var @int = IntegerType.Instance; var @bool = BooleanType.Instance; var @char = CharacterType.Instance; var @string = new ArrayType(@char); var setType = new FunctionType(new Parameter("dst", @int, ParameterFlags.Out), new Parameter("src", @int)); var mainType = new FunctionType(); var printIntType = new FunctionType(new Parameter("value", @int)); var printStringType = new FunctionType(new Parameter("value", @string)); var intBinOpType = new FunctionType(@int, new Parameter("lhs", @int), new Parameter("rhs", @int)); var intRelOpType = new FunctionType(@bool, new Parameter("lhs", @int), new Parameter("rhs", @int)); var intAssOpType = new FunctionType(@int, new Parameter("dst", @int, ParameterFlags.Out), new Parameter("val", @int)); var limitType = new FunctionType(@int); var stringLiteral0 = new Array(@string, "i = ".Select(c => new Character(c))); var stringLiteral1 = new Array(@string, "\n".Select(c => new Character(c))); var @set = new UserFunction(setType, new Statement[] { new Statement.Call(new GlobalReference(6, false), new NullReference(), new StackFrameReference(0, false), new StackFrameReference(1, true)) { Location = "set:0" }, new Statement.Exit() { Location = "set:1" } , }); var @print = new UserFunction(mainType, new Statement[] { new Statement.Call(new GlobalReference(3, false), new GlobalReference(8, true)) { Location = "print:0" }, new Statement.Call(new GlobalReference(2, false), new CreationFrameReference(0, true)) { Location = "print:1" }, new Statement.Call(new GlobalReference(3, false), new GlobalReference(9, true)) { Location = "print:2" }, new Statement.Exit() { Location = "print:3" }, }); var @limit = new UserFunction(limitType, new Statement[] { new Statement.Call(new GlobalReference(6, false), new NullReference(), new StackFrameReference(0, false), new GlobalReference(10, true)) { Location = "limit:0" }, new Statement.Exit() { Location = "limit:1" }, }); var @main = new UserFunction(mainType, new Statement[] { // 0: call g[0] SF[0] *g[7] /* set(i,42) */ new Statement.Call(new GlobalReference(0, false), new StackFrameReference(0, false), new GlobalReference(7, true)) { Location = "main:0" }, // 1: call g[12] SF[3] /* tmp1 = limit() */ new Statement.Call(new GlobalReference(12, false), new StackFrameReference(3, false)) { Location = "main:1" }, // 2: call g[5] SF[2] *SF[0] *SF[3] /* tmp0 = (i > tmp1) */ new Statement.Call(new GlobalReference(5, false), new StackFrameReference(2, false), new StackFrameReference(0, true), new StackFrameReference(3, true)) { Location = "main:2" }, // 3: jmpifn 7 SF[2] /* while(tmp0) { */ new Statement.ConditionalJump(new StackFrameReference(2, false), 7, JumpBehaviour.WhenFalse) { Location = "main:3" }, // 4: call g[4] SF[3] *SF[0] *g[11] /* tmp1 = i - 1 */ new Statement.Call(new GlobalReference(4, false), new StackFrameReference(3, false), new StackFrameReference(0, true), new GlobalReference(11, true)) { Location = "main:4" }, // 5: call g[6] SF[0] *SF[3] /* i = tmp1 */ new Statement.Call(new GlobalReference(6, false), new NullReference(), new StackFrameReference(0, false), new StackFrameReference(3, true)) { Location = "main:5" }, // 6: jmp 1 /* } */ new Statement.Jump(1) { Location = "main:6" }, // 7: newfun SF[1] f[1] /* print = f[1](SF) */ new Statement.CreateClosure(new StackFrameReference(1, false), @print) { Location = "main:7" }, // 8: call SF[1] /* print() */ new Statement.Call(new StackFrameReference(1, false)) { Location = "main:8" }, // 9: exit /* return */ new Statement.Exit() { Location = "main:9" } }, @int, mainType, @bool, @int ); var @printInt = new BuiltinFunction(@printIntType, (args) => { Console.Write("{0}", args[0].Value as Integer); return null; }); var @printString = new BuiltinFunction(@printIntType, (args) => { var value = args[0].Value as Array; var text = string.Join<string>("", value.Select(v => char.ConvertFromUtf32((v as Character).Value))); Console.Write("{0}", text); return null; }); var @intAss = new BuiltinFunction(intAssOpType, (args) => { args[0].Value = args[1].Value; return null; }); var @intSub = new BuiltinFunction(intBinOpType, (args) => { return new Integer((args[0].Value as Integer) - (args[1].Value as Integer)); }); var @intMoreThan = new BuiltinFunction(intBinOpType, (args) => { return new Boolean((args[0].Value as Integer) > (args[1].Value as Integer)); }); var literalMain = new Function(@main); var globals = new StorageContext(13); { globals[0] = new ValueStore(new Function(@set)); // set : t[1] = f[0](nil) globals[1] = new ValueStore(literalMain); // main : t[2] = f[2](nil) globals[2] = new ValueStore(new Function(@printInt)); // print : t[3] = f[5](nil) globals[3] = new ValueStore(new Function(@printString)); // print : t[5] = f[4](nil) globals[4] = new ValueStore(new Function(@intSub)); // '-' : t[6] = f[6](nil) globals[5] = new ValueStore(new Function(@intMoreThan)); // '>' : t[7] = f[7](nil) globals[6] = new ValueStore(new Function(@intAss)); // '=' : t[8] = f[3](nil) globals[7] = new ValueStore(new Integer(42)); // 42 : int globals[8] = new ValueStore(stringLiteral0); // "i = " : array<char> globals[9] = new ValueStore(stringLiteral1); // "\n" : array<char> globals[10] = new ValueStore(new Integer(38)); // 38 : int globals[11] = new ValueStore(new Integer(1)); // 1 : int globals[12] = new ValueStore(new Function(@limit)); // limit : t[10] = f[8](nil) } literalMain.Call(globals); } static void Main(string[] args) { var pgm = new Program(); pgm.Run(); Console.ReadLine(); } } }
43.693878
181
0.613888
[ "MIT" ]
MasterQ32/psi
Prototypes/Runtime/Program.cs
6,425
C#
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using TabMonConfigBuilder.Helpers; namespace TabMonConfigBuilder { public sealed class TabMonConfigBuilder { private readonly CommandLineOptions commandLineOptions; private readonly string currentWorkingDirectory; public TabMonConfigBuilder(CommandLineOptions commandLineOptions, string currentWorkingDirectory) { this.commandLineOptions = commandLineOptions; this.currentWorkingDirectory = currentWorkingDirectory; } #region Public Methods /// <summary> /// Sets up and issues the LogsharkRequest to the LogsharkController. /// </summary> public void Execute() { try { Console.WriteLine("Parsing topology file for process entries.."); var hosts = ParseTopologyAndUpdateHosts(commandLineOptions.Target); Console.WriteLine(string.Format("Writing config section and instructions to {0}..", commandLineOptions.Output)); WriteToFile(commandLineOptions.Output, hosts); } catch (Exception ex) { throw ex; } Console.WriteLine("Done writing config section.."); } #endregion Public Methods #region Private Methods private static Dictionary<string, Host> ParseTopologyAndUpdateHosts(string target) { string line; int index = 0; Regex spaceRegex = new Regex(@"\s+"); var hosts = new Dictionary<string, Host>(); Console.WriteLine("Building config section.."); var input = new StreamReader(target); while ((line = input.ReadLine()) != null) { // Check if index is not 0 to skip the first line. if (index != 0) { var splitLine = spaceRegex.Split(line); var process = splitLine[1].Split(':')[0]; var portType = splitLine[1].Split(':')[1]; if (portType == "jmx" && StringHelpers.ProcessLookupDict.ContainsKey(process)) { UpdateHosts(hosts, splitLine[0], process, Int32.Parse(splitLine[2]), Int32.Parse(splitLine[3])); } } index++; } input.Close(); return hosts; } private static void UpdateHosts(Dictionary<string, Host> hosts, string nodeName, string processName, int processNum, int portNum) { if (!hosts.ContainsKey(nodeName)) { hosts.Add(nodeName, new Host(nodeName, StringHelpers.ProcessLookupDict[processName], processName, processNum, portNum)); } else { hosts[nodeName].Add(StringHelpers.ProcessLookupDict[processName], processName, processNum, portNum); } } private static string CreateConfigString(Dictionary<string, Host> hosts) { StringBuilder sb = new StringBuilder(); foreach (string line in StringHelpers.InstructionSet) { sb.AppendLine(line); } foreach (Host host in hosts.Values) { sb.AppendLine(host.CreateString()); } return sb.ToString(); } private static void WriteToFile(string outputTarget, Dictionary<string, Host> hosts) { File.WriteAllText(outputTarget, CreateConfigString(hosts)); } #endregion Private Methods } }
33.876106
137
0.571055
[ "MIT" ]
yuhonghong66/TabMon
TabMonConfigBuilder/TabMonConfigBuilder.cs
3,830
C#
using System.Collections; using System.Collections.Generic; using TMPro; using UnityEditor; using UnityEngine; using UnityEngine.UI; namespace PSDUINewImporter { public sealed class ImageComponentImport : BaseComponentImport<Image> { public ImageComponentImport(PSDComponentImportCtrl ctrl) : base(ctrl) { } protected override void DrawTargetLayer(Layer layer, Image target, GameObject parent,int posSizeLayerIndex) { var targetComp = target.GetComponent<Image>(); layer.target = targetComp; RectTransform rectTransform = target.GetComponent<RectTransform>(); PSDImportUtility.SetAnchorMiddleCenter(rectTransform); targetComp.sprite = LoadSpriteRes(layer, null); targetComp.raycastTarget = false; targetComp.maskable = false; SetImageProperties(targetComp, layer); rectTransform.sizeDelta = new Vector2(layer.size.width, layer.size.height); // rectTransform.anchoredPosition = GetLocalAnchoredPosition(layer.position, rectTransform); //layer.position - parentAnchoredPosition; rectTransform.localPosition = GetLocalPosition(layer.position, rectTransform); // ctrl.DrawLayers(layer.layers, null, target.gameObject); } protected override void CheckAddBinder(Layer layer, Image image) { if (layer.TagContains(PSDImportUtility.DynamicTag)) { var binder = PSDImportUtility.AddMissingComponent<Hugula.Databinding.Binder.ImageBinder>(image.gameObject); if (binder != null) { var binding = binder.GetBinding("spriteName"); if (binding == null) { binding = new Hugula.Databinding.Binding(); binding.propertyName = "spriteName"; binder.AddBinding(binding); } binding.path = layer.name; } } } } }
35.542373
147
0.611826
[ "MIT" ]
tenvick/hugula
Client/Assets/Third/PSD2UGUI/Editor/ComponentImport/ImageComponentImport.cs
2,097
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Teknik.Areas.Podcast.Models { public class PodcastFile { public int PodcastFileId { get; set; } public int PodcastId { get; set; } public virtual Podcast Podcast { get; set; } public string FileName { get; set; } public string Path { get; set; } public string ContentType { get; set; } public int ContentLength { get; set; } public int Size { get; set; } } }
20.692308
52
0.618959
[ "BSD-3-Clause" ]
PradeepTheDev/Teknik
Teknik/Areas/Podcast/Models/PodcastFile.cs
540
C#
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; using System.Web; namespace WebApplication2 { class WeatherDataReader { public static WeatherDataModel ReadData() { string url = "https://opendata.cwb.gov.tw/fileapi/v1/opendataapi/F-B0053-037?Authorization=CWB-2A43E1CB-AA48-4E1E-A5AE-1C28D9E85F35&downloadType=WEB&format=JSON"; WebClient client = new WebClient(); byte[] sourceByte = client.DownloadData(url); string jsonText = Encoding.UTF8.GetString(sourceByte); Rootobject obj = Newtonsoft.Json.JsonConvert.DeserializeObject<Rootobject>(jsonText); var locationList = obj.cwbopendata.dataset.locations.location; var retObject = new WeatherDataModel(); retObject.Name = "太魯閣國家公園太魯閣遊客中心"; foreach (var item in locationList) { if (string.Compare("太魯閣國家公園太魯閣遊客中心", item.locationName, true) == 0) { foreach (var weatherItem in item.weatherElement) { if (weatherItem.elementName == "T") { var eleVal = weatherItem.time[0].elementValue; var tJsonText = Newtonsoft.Json.JsonConvert.SerializeObject(eleVal); MeasureObject measure = Newtonsoft.Json.JsonConvert.DeserializeObject<MeasureObject>(tJsonText); retObject.T = Convert.ToInt32(measure.value); } if (weatherItem.elementName == "PoP24h") { var eleVal = weatherItem.time[0].elementValue; var tJsonText = Newtonsoft.Json.JsonConvert.SerializeObject(eleVal); MeasureObject measure = Newtonsoft.Json.JsonConvert.DeserializeObject<MeasureObject>(tJsonText); retObject.Pop = Convert.ToInt32(measure.value); } } } } return retObject; //Console.WriteLine(jsonText); } } public class MeasureObject { public string value { get; set; } public string measures { get; set; } } public class Rootobject { public Cwbopendata cwbopendata { get; set; } } public class Cwbopendata { public string xmlns { get; set; } public string identifier { get; set; } public string sender { get; set; } public DateTime sent { get; set; } public string status { get; set; } public string scope { get; set; } public string msgType { get; set; } public string dataid { get; set; } public string source { get; set; } public Dataset dataset { get; set; } } public class Dataset { public Datasetinfo datasetInfo { get; set; } public Locations locations { get; set; } } public class Datasetinfo { public string datasetDescription { get; set; } public string datasetLanguage { get; set; } public DateTime issueTime { get; set; } public Validtime validTime { get; set; } public DateTime update { get; set; } } public class Validtime { public DateTime startTime { get; set; } public DateTime endTime { get; set; } } public class Locations { public string[] locationsName { get; set; } public Location[] location { get; set; } } public class Location { public string locationName { get; set; } public string geocode { get; set; } public string lat { get; set; } public string lon { get; set; } public Parameterset parameterSet { get; set; } public Weatherelement[] weatherElement { get; set; } } public class Parameterset { public Parameter parameter { get; set; } } public class Parameter { public string parameterName { get; set; } public string parameterValue { get; set; } } public class Weatherelement { public string elementName { get; set; } public string description { get; set; } public Time[] time { get; set; } } public class Time { public DateTime startTime { get; set; } public DateTime endTime { get; set; } public object elementValue { get; set; } } }
31.136054
174
0.565436
[ "MIT" ]
dplayerd/WebformMiniSample
WebformMiniSample/WebApplication2/WeatherDataReader.cs
4,635
C#
using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; namespace Fabric.Databus.Domain.Jobs { using Fabric.Databus.Shared; public class InMemoryJobHistoryStore : IJobHistoryStore { private static readonly ConcurrentBag<JobHistoryItem> Items = new ConcurrentBag<JobHistoryItem>(); public IList<JobHistoryItem> GetJobHistory(string jobName) { return Items.Where(j => j.Name == jobName).ToList(); } public IList<JobHistoryItem> GetMostRecentJobs(int numberOfJobs) { return Items .OrderByDescending(jobHistory => jobHistory.StartDateTimeUtc) .Take(numberOfJobs) .ToList(); } public JobHistoryItem GetLatestJobHistoryItem(string jobName) { var latestJobHistoryItem = Items.Where(j => j.Name == jobName) .OrderByDescending(jobHistory => jobHistory.StartDateTimeUtc) .FirstOrDefault(); AddCurrentLogsToJobHistoryItem(latestJobHistoryItem); return latestJobHistoryItem; } public void AddJobHistoryItem(JobHistoryItem item) { Items.Add(item); } public void UpdateJobHistoryItem(JobHistoryItem item) { //do nothing since this is an in memory store } public JobHistoryItem GetJobHistoryItem(Guid executionId) { var item = Items.FirstOrDefault(jh => jh.Id == executionId); if (item != null) { AddCurrentLogsToJobHistoryItem(item); } return item; } private void AddCurrentLogsToJobHistoryItem(JobHistoryItem item) { item.ProgressLogItems = item.ProgressMonitor.GetSnapshotOfProgressItems(); } } }
29.061538
106
0.61567
[ "Apache-2.0" ]
HealthCatalyst/Fabric.Databus
Fabric.Databus.Domain/Jobs/InMemoryJobHistoryStore.cs
1,889
C#
using System; using System.Collections.Generic; using System.Text; namespace Naruto.Redis.Config { /// <summary> /// redis的key的前缀 /// </summary> public class RedisPrefixKey { /// <summary> /// string类型的前缀 (默认string:) /// </summary> public string StringPrefixKey { get; set; } = "string:"; /// <summary> /// List 类型的前缀 (默认list:) /// </summary> public string ListPrefixKey { get; set; } = "list:"; /// <summary> /// Set类型的前缀 (默认ids:) /// </summary> public string SetPrefixKey { get; set; } = "ids:"; /// <summary> /// Hash 类型的前缀 (默认hash:) /// </summary> public string HashPrefixKey { get; set; } = "hash:"; /// <summary> /// 有序集合的前缀 (默认sortedset:) /// </summary> public string SortedSetKey { get; set; } = "sortedset:"; /// <summary> /// 锁的前缀key /// </summary> public string LockPrefixKey { get; set; } = "lock:"; } }
27.315789
64
0.5
[ "MIT" ]
zhanghaiboshiwo/Naruto.Data
src/Naruto.Redis/Config/RedisPrefixKey.cs
1,130
C#
//-------------------------------------- // TR2Chaingun //-------------------------------------- //-------------------------------------------------------------------------- // Force-Feedback Effects //-------------------------------------- datablock EffectProfile(TR2ChaingunSwitchEffect) { effectname = "weapons/TR2Chaingun_activate"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(TR2ChaingunFireEffect) { effectname = "weapons/TR2Chaingun_fire"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(TR2ChaingunSpinUpEffect) { effectname = "weapons/TR2Chaingun_spinup"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(TR2ChaingunSpinDownEffect) { effectname = "weapons/TR2Chaingun_spindown"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(TR2ChaingunDryFire) { effectname = "weapons/TR2Chaingun_dryfire"; minDistance = 2.5; maxDistance = 2.5; }; //-------------------------------------------------------------------------- // Sounds //-------------------------------------- datablock AudioProfile(TR2ChaingunSwitchSound) { filename = "fx/weapons/chaingun_activate.wav"; description = AudioClosest3d; preload = true; effect = TR2ChaingunSwitchEffect; }; datablock AudioProfile(TR2ChaingunFireSound) { filename = "fx/weapons/chaingun_fire.wav"; description = AudioDefaultLooping3d; preload = true; effect = TR2ChaingunFireEffect; }; datablock AudioProfile(TR2ChaingunProjectile) { filename = "fx/weapons/chaingun_projectile.wav"; description = ProjectileLooping3d; preload = true; }; datablock AudioProfile(TR2ChaingunImpact) { filename = "fx/weapons/chaingun_impact.WAV"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(TR2ChaingunSpinDownSound) { filename = "fx/weapons/chaingun_spindown.wav"; description = AudioClosest3d; preload = true; effect = TR2ChaingunSpinDownEffect; }; datablock AudioProfile(TR2ChaingunSpinUpSound) { filename = "fx/weapons/chaingun_spinup.wav"; description = AudioClosest3d; preload = true; effect = TR2ChaingunSpinUpEffect; }; datablock AudioProfile(TR2ChaingunDryFireSound) { filename = "fx/weapons/chaingun_dryfire.wav"; description = AudioClose3d; preload = true; effect = TR2ChaingunDryFire; }; datablock AudioProfile(ShrikeBlasterProjectileSound) { filename = "fx/vehicles/shrike_blaster_projectile.wav"; description = ProjectileLooping3d; preload = true; }; //-------------------------------------------------------------------------- // Splash //-------------------------------------------------------------------------- datablock ParticleData(TR2ChaingunSplashParticle) { dragCoefficient = 1; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -1.4; lifetimeMS = 300; lifetimeVarianceMS = 0; textureName = "special/droplet"; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.05; sizes[1] = 0.2; sizes[2] = 0.2; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(TR2ChaingunSplashEmitter) { ejectionPeriodMS = 4; periodVarianceMS = 0; ejectionVelocity = 3; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 50; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 100; particles = "TR2ChaingunSplashParticle"; }; datablock SplashData(TR2ChaingunSplash) { numSegments = 10; ejectionFreq = 10; ejectionAngle = 20; ringLifetime = 0.4; lifetimeMS = 400; velocity = 3.0; startRadius = 0.0; acceleration = -3.0; texWrap = 5.0; texture = "special/water2"; emitter[0] = TR2ChaingunSplashEmitter; colors[0] = "0.7 0.8 1.0 0.0"; colors[1] = "0.7 0.8 1.0 1.0"; colors[2] = "0.7 0.8 1.0 0.0"; colors[3] = "0.7 0.8 1.0 0.0"; times[0] = 0.0; times[1] = 0.4; times[2] = 0.8; times[3] = 1.0; }; //-------------------------------------------------------------------------- // Particle Effects //-------------------------------------- datablock ParticleData(TR2ChaingunFireParticle) { dragCoefficient = 2.75; gravityCoefficient = 0.1; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 550; lifetimeVarianceMS = 0; textureName = "particleTest"; colors[0] = "0.46 0.36 0.26 1.0"; colors[1] = "0.46 0.36 0.26 0.0"; sizes[0] = 0.25; sizes[1] = 0.20; }; datablock ParticleEmitterData(TR2ChaingunFireEmitter) { ejectionPeriodMS = 6; periodVarianceMS = 0; ejectionVelocity = 10; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 12; phiReferenceVel = 0; phiVariance = 360; overrideAdvance = true; particles = "TR2ChaingunFireParticle"; }; //-------------------------------------------------------------------------- // Explosions //-------------------------------------- datablock ParticleData(TR2ChaingunExplosionParticle1) { dragCoefficient = 0.65; gravityCoefficient = 0.3; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 500; lifetimeVarianceMS = 150; textureName = "particleTest"; colors[0] = "0.56 0.36 0.26 1.0"; colors[1] = "0.56 0.36 0.26 0.0"; sizes[0] = 0.0625; sizes[1] = 0.2; }; datablock ParticleEmitterData(TR2ChaingunExplosionEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 0.75; velocityVariance = 0.25; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 60; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "TR2ChaingunExplosionParticle1"; }; datablock ParticleData(TR2ChaingunImpactSmokeParticle) { dragCoefficient = 0.0; gravityCoefficient = -0.2; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 1000; lifetimeVarianceMS = 200; useInvAlpha = true; spinRandomMin = -90.0; spinRandomMax = 90.0; textureName = "particleTest"; colors[0] = "0.7 0.7 0.7 0.0"; colors[1] = "0.7 0.7 0.7 0.4"; colors[2] = "0.7 0.7 0.7 0.0"; sizes[0] = 0.5; sizes[1] = 0.5; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(TR2ChaingunImpactSmoke) { ejectionPeriodMS = 8; periodVarianceMS = 1; ejectionVelocity = 1.0; velocityVariance = 0.5; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 35; overrideAdvances = false; particles = "TR2ChaingunImpactSmokeParticle"; lifetimeMS = 50; }; datablock ParticleData(TR2ChaingunSparks) { dragCoefficient = 1; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 300; lifetimeVarianceMS = 0; textureName = "special/spark00"; colors[0] = "0.56 0.36 0.26 1.0"; colors[1] = "0.56 0.36 0.26 1.0"; colors[2] = "1.0 0.36 0.26 0.0"; sizes[0] = 0.6; sizes[1] = 0.2; sizes[2] = 0.05; times[0] = 0.0; times[1] = 0.2; times[2] = 1.0; }; datablock ParticleEmitterData(TR2ChaingunSparkEmitter) { ejectionPeriodMS = 4; periodVarianceMS = 0; ejectionVelocity = 4; velocityVariance = 2.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 50; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 100; particles = "TR2ChaingunSparks"; }; datablock ExplosionData(TR2ChaingunExplosion) { soundProfile = TR2ChaingunImpact; emitter[0] = TR2ChaingunImpactSmoke; emitter[1] = TR2ChaingunSparkEmitter; faceViewer = false; }; datablock ShockwaveData(ScoutTR2ChaingunHit) { width = 0.5; numSegments = 13; numVertSegments = 1; velocity = 0.5; acceleration = 2.0; lifetimeMS = 900; height = 0.1; verticalCurve = 0.5; mapToTerrain = false; renderBottom = false; orientToNormal = true; texture[0] = "special/shockwave5"; texture[1] = "special/gradient"; texWrap = 3.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; colors[0] = "0.6 0.6 1.0 1.0"; colors[1] = "0.6 0.3 1.0 0.5"; colors[2] = "0.0 0.0 1.0 0.0"; }; datablock ParticleData(ScoutTR2ChaingunExplosionParticle1) { dragCoefficient = 2; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 000; textureName = "special/crescent4"; colors[0] = "0.6 0.6 1.0 1.0"; colors[1] = "0.6 0.3 1.0 1.0"; colors[2] = "0.0 0.0 1.0 0.0"; sizes[0] = 0.25; sizes[1] = 0.5; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(ScoutTR2ChaingunExplosionEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 2; velocityVariance = 1.5; ejectionOffset = 0.0; thetaMin = 80; thetaMax = 90; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 200; particles = "ScoutTR2ChaingunExplosionParticle1"; }; datablock ExplosionData(ScoutTR2ChaingunExplosion) { soundProfile = blasterExpSound; shockwave = ScoutTR2ChaingunHit; emitter[0] = ScoutTR2ChaingunExplosionEmitter; }; //-------------------------------------------------------------------------- // Particle effects //-------------------------------------- datablock DebrisData(TR2ShellDebris) { shapeName = "weapon_chaingun_ammocasing.dts"; lifetime = 3.0; minSpinSpeed = 300.0; maxSpinSpeed = 400.0; elasticity = 0.5; friction = 0.2; numBounces = 3; fade = true; staticOnMaxBounce = true; snapOnMaxBounce = true; }; //-------------------------------------------------------------------------- // Projectile //-------------------------------------- datablock DecalData(TR2ChaingunDecal1) { sizeX = 0.05; sizeY = 0.05; textureName = "special/bullethole1"; }; datablock DecalData(TR2ChaingunDecal2) : TR2ChaingunDecal1 { textureName = "special/bullethole2"; }; datablock DecalData(TR2ChaingunDecal3) : TR2ChaingunDecal1 { textureName = "special/bullethole3"; }; datablock DecalData(TR2ChaingunDecal4) : TR2ChaingunDecal1 { textureName = "special/bullethole4"; }; datablock DecalData(TR2ChaingunDecal5) : TR2ChaingunDecal1 { textureName = "special/bullethole5"; }; datablock DecalData(TR2ChaingunDecal6) : TR2ChaingunDecal1 { textureName = "special/bullethole6"; }; datablock TracerProjectileData(TR2ChaingunBullet) { doDynamicClientHits = true; directDamage = 0.065; directDamageType = $DamageType::Bullet; explosion = "TR2ChaingunExplosion"; splash = TR2ChaingunSplash; kickBackStrength = 0.0; sound = TR2ChaingunProjectile; dryVelocity = 750.0; wetVelocity = 280.0; velInheritFactor = 1.0; fizzleTimeMS = 3000; lifetimeMS = 3000; explodeOnDeath = false; reflectOnWaterImpactAngle = 0.0; explodeOnWaterImpact = false; deflectionOnWaterImpact = 0.0; fizzleUnderwaterMS = 3000; tracerLength = 30.0;//15.0; tracerAlpha = false; tracerMinPixels = 6; tracerColor = 211.0/255.0 @ " " @ 215.0/255.0 @ " " @ 120.0/255.0 @ " 0.75"; //211.0/255.0 @ " " @ 215.0/255.0 @ " " @ 120.0/255.0 @ " 0.75"; tracerTex[0] = "special/tracer00"; tracerTex[1] = "special/tracercross"; tracerWidth = 0.20;//0.10; crossSize = 0.20; crossViewAng = 0.990; renderCross = true; decalData[0] = TR2ChaingunDecal1; decalData[1] = TR2ChaingunDecal2; decalData[2] = TR2ChaingunDecal3; decalData[3] = TR2ChaingunDecal4; decalData[4] = TR2ChaingunDecal5; decalData[5] = TR2ChaingunDecal6; }; //-------------------------------------------------------------------------- // Scout Projectile //-------------------------------------- datablock TracerProjectileData(ScoutTR2ChaingunBullet) { doDynamicClientHits = true; directDamage = 0.125; explosion = "ScoutTR2ChaingunExplosion"; splash = TR2ChaingunSplash; directDamageType = $DamageType::ShrikeBlaster; kickBackStrength = 0.0; sound = ShrikeBlasterProjectileSound; dryVelocity = 400.0; wetVelocity = 100.0; velInheritFactor = 1.0; fizzleTimeMS = 1000; lifetimeMS = 1000; explodeOnDeath = false; reflectOnWaterImpactAngle = 0.0; explodeOnWaterImpact = false; deflectionOnWaterImpact = 0.0; fizzleUnderwaterMS = 3000; tracerLength = 45.0; tracerAlpha = false; tracerMinPixels = 6; tracerColor = "1.0 1.0 1.0 1.0"; tracerTex[0] = "special/shrikeBolt"; tracerTex[1] = "special/shrikeBoltCross"; tracerWidth = 0.55; crossSize = 0.99; crossViewAng = 0.990; renderCross = true; }; //-------------------------------------------------------------------------- // Ammo //-------------------------------------- datablock ItemData(TR2ChaingunAmmo) { className = Ammo; catagory = "Ammo"; shapeFile = "ammo_chaingun.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "some chaingun ammo"; computeCRC = false; }; //-------------------------------------------------------------------------- // Weapon //-------------------------------------- datablock ShapeBaseImageData(TR2ChaingunImage) { className = WeaponImage; shapeFile = "TR2weapon_chaingun.dts"; item = TR2Chaingun; ammo = TR2ChaingunAmmo; projectile = TR2ChaingunBullet; projectileType = TracerProjectile; emap = true; casing = TR2ShellDebris; shellExitDir = "1.0 0.3 1.0"; shellExitOffset = "0.15 -0.56 -0.1"; shellExitVariance = 18.0; shellVelocity = 4.0; projectileSpread = 5.5 / 1000.0; //-------------------------------------- stateName[0] = "Activate"; stateSequence[0] = "Activate"; stateSound[0] = TR2ChaingunSwitchSound; stateAllowImageChange[0] = false; // stateTimeoutValue[0] = 0.5; stateTransitionOnTimeout[0] = "Ready"; stateTransitionOnNoAmmo[0] = "NoAmmo"; //-------------------------------------- stateName[1] = "Ready"; stateSpinThread[1] = Stop; // stateTransitionOnTriggerDown[1] = "Spinup"; stateTransitionOnNoAmmo[1] = "NoAmmo"; //-------------------------------------- stateName[2] = "NoAmmo"; stateTransitionOnAmmo[2] = "Ready"; stateSpinThread[2] = Stop; stateTransitionOnTriggerDown[2] = "DryFire"; //-------------------------------------- stateName[3] = "Spinup"; stateSpinThread[3] = SpinUp; stateSound[3] = TR2ChaingunSpinupSound; // stateTimeoutValue[3] = 0.5; stateWaitForTimeout[3] = false; stateTransitionOnTimeout[3] = "Fire"; stateTransitionOnTriggerUp[3] = "Spindown"; //-------------------------------------- stateName[4] = "Fire"; stateSequence[4] = "Fire"; stateSequenceRandomFlash[4] = true; stateSpinThread[4] = FullSpeed; stateSound[4] = TR2ChaingunFireSound; //stateRecoil[4] = LightRecoil; stateAllowImageChange[4] = false; stateScript[4] = "onFire"; stateFire[4] = true; stateEjectShell[4] = true; // stateTimeoutValue[4] = 0.15; stateTransitionOnTimeout[4] = "Fire"; stateTransitionOnTriggerUp[4] = "Spindown"; stateTransitionOnNoAmmo[4] = "EmptySpindown"; //-------------------------------------- stateName[5] = "Spindown"; stateSound[5] = TR2ChaingunSpinDownSound; stateSpinThread[5] = SpinDown; // stateTimeoutValue[5] = 0.4;//1.0; stateWaitForTimeout[5] = false;//true; stateTransitionOnTimeout[5] = "Ready"; stateTransitionOnTriggerDown[5] = "Spinup"; //-------------------------------------- stateName[6] = "EmptySpindown"; stateSound[6] = TR2ChaingunSpinDownSound; stateSpinThread[6] = SpinDown; // stateTimeoutValue[6] = 0.5; stateTransitionOnTimeout[6] = "NoAmmo"; //-------------------------------------- stateName[7] = "DryFire"; stateSound[7] = TR2ChaingunDryFireSound; stateTimeoutValue[7] = 0.5; stateTransitionOnTimeout[7] = "NoAmmo"; }; datablock ItemData(TR2Chaingun) { className = Weapon; catagory = "Spawn Items"; shapeFile = "TR2weapon_chaingun.dts"; image = TR2ChaingunImage; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "a chaingun"; computeCRC = true; emap = true; };
26.925037
87
0.551478
[ "MIT" ]
jdknight/t2ds
GameData/base/scripts/weapons/TR2chaingun.cs
17,959
C#
using System; using Abp.Dependency; namespace Test.MyProject.Timing { public class AppTimes : ISingletonDependency { /// <summary> /// Gets the startup time of the application. /// </summary> public DateTime StartupTime { get; set; } } }
20.285714
53
0.616197
[ "MIT" ]
Ferglezcasillas/DEMO-ASP.NET-Boilerplate
aspnet-core/src/Test.MyProject.Core/Timing/AppTimes.cs
286
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace FeedMe.Controllers { public class AboutController : Controller { // GET: About public ActionResult Index() { return View(); } } }
17.882353
45
0.621711
[ "MIT" ]
rabianur412/FeedMe
FeedMe/Controllers/AboutController.cs
306
C#
using EPiServer.Core; using EPiServer.Reference.Commerce.Site.Features.Product.ViewModels; using EPiServer.Reference.Commerce.Site.Features.Shared.Extensions; using EPiServer.Reference.Commerce.Site.Features.Shared.Services; using EPiServer.ServiceLocation; using EPiServer.Web.Routing; using Mediachase.Commerce; using System; using System.Collections.Generic; using System.Linq; using System.Web.Mvc; using EPiServer.Reference.Commerce.Shared.Models.Products; namespace EPiServer.Reference.Commerce.Site.Features.Product.ViewModelFactories { [ServiceConfiguration(Lifecycle = ServiceInstanceScope.Singleton)] public class CatalogEntryViewModelFactory { private readonly IContentLoader _contentLoader; private readonly IPricingService _pricingService; private readonly UrlResolver _urlResolver; private readonly CatalogContentService _catalogContentService; public CatalogEntryViewModelFactory( IContentLoader contentLoader, IPricingService pricingService, UrlResolver urlResolver, CatalogContentService catalogContentService) { _contentLoader = contentLoader; _pricingService = pricingService; _urlResolver = urlResolver; _catalogContentService = catalogContentService; } public virtual FashionProductViewModel Create(FashionProduct currentContent, string variationCode) { var variants = _catalogContentService.GetVariants<FashionVariant>(currentContent).ToList(); FashionVariant variant; if (!TryGetFashionVariant(variants, variationCode, out variant)) { return new FashionProductViewModel { Product = currentContent, Images = currentContent.GetAssets<IContentImage>(_contentLoader, _urlResolver) }; } variationCode = variant.Code; var defaultPrice = _pricingService.GetDefaultPrice(variationCode); var discountedPrice = defaultPrice != null ? _pricingService.GetDiscountPrice(variationCode).UnitPrice : (Money?)null; return new FashionProductViewModel { Product = currentContent, Variant = variant, ListingPrice = defaultPrice?.UnitPrice ?? _pricingService.GetMoney(0), DiscountedPrice = discountedPrice, Colors = variants .Where(x => x.Size != null) .GroupBy(x => x.Color) .Select(g => new SelectListItem { Selected = false, Text = g.Key, Value = g.Key }) .ToList(), Sizes = variants .Where(x => x.Color != null && x.Color.Equals(variant.Color, StringComparison.OrdinalIgnoreCase)) .Select(x => new SelectListItem { Selected = false, Text = x.Size, Value = x.Size }) .ToList(), Color = variant.Color, Size = variant.Size, Images = variant.GetAssets<IContentImage>(_contentLoader, _urlResolver), IsAvailable = defaultPrice != null }; } public virtual FashionPackageViewModel Create(FashionPackage currentContent) { var defaultPrice = _pricingService.GetDefaultPrice(currentContent.Code); var discountedPrice = defaultPrice != null ? _pricingService.GetDiscountPrice(defaultPrice.CatalogKey.CatalogEntryCode).UnitPrice : (Money?)null; return new FashionPackageViewModel { Package = currentContent, ListingPrice = defaultPrice?.UnitPrice ?? _pricingService.GetMoney(0), DiscountedPrice = discountedPrice, Images = currentContent.GetAssets<IContentImage>(_contentLoader, _urlResolver), IsAvailable = defaultPrice != null, Entries = _catalogContentService.GetVariants<FashionVariant>(currentContent).ToList() }; } public virtual FashionBundleViewModel Create(FashionBundle currentContent) { return new FashionBundleViewModel { Bundle = currentContent, Images = currentContent.GetAssets<IContentImage>(_contentLoader, _urlResolver), Entries = _catalogContentService.GetVariants<FashionVariant>(currentContent).ToList() }; } public virtual FashionVariant SelectVariant(FashionProduct currentContent, string color, string size) { var variants = _catalogContentService.GetVariants<FashionVariant>(currentContent).ToList(); FashionVariant variant; if (TryGetFashionVariantByColorAndSize(variants, color, size, out variant) || TryGetFashionVariantByColorAndSize(variants, color, string.Empty, out variant))//if we cannot find variation with exactly both color and size then we will try to get variant by color only { return variant; } return null; } private static bool TryGetFashionVariant(IEnumerable<FashionVariant> variations, string variationCode, out FashionVariant variation) { variation = !string.IsNullOrEmpty(variationCode) ? variations.FirstOrDefault(x => x.Code == variationCode) : variations.FirstOrDefault(); return variation != null; } private static bool TryGetFashionVariantByColorAndSize(IEnumerable<FashionVariant> variants, string color, string size, out FashionVariant variant) { variant = variants.FirstOrDefault(x => (string.IsNullOrEmpty(color) || x.Color.Equals(color, StringComparison.OrdinalIgnoreCase)) && (string.IsNullOrEmpty(size) || x.Size.Equals(size, StringComparison.OrdinalIgnoreCase))); return variant != null; } } }
43.205479
206
0.618897
[ "Apache-2.0" ]
makingwaves/epi-commerce-to-vue-storefront
Quicksilver/EPiServer.Reference.Commerce.Site/Features/Product/ViewModelFactories/CatalogEntryViewModelFactory.cs
6,310
C#
// Isomorophic MIDI Keyboard // // Copyright © Sergey A Kryukov, 2017 // http://www.SAKryukov.org // https://www.codeproject.com/Members/SAKryukov // // Original publication: // "Musical Study with Isomorphic Computer Keyboard" // https://www.codeproject.com/Articles/1201737/Musical-Study-with-Isomorphic-Computer-Keyboard // namespace WPF.Main { using System; using System.Windows; using System.Reflection; using StringList = System.Collections.Generic.List<string>; using PublicationList = System.Collections.Generic.List<AssemblyPublicationAttribute>; using IStringList = System.Collections.Generic.IList<string>; using StringBuilder = System.Text.StringBuilder; using ImageSource = System.Windows.Media.ImageSource; class TheApplication : Application { internal TheApplication() { DispatcherUnhandledException += (sender, eventArgs) => { ShowException(eventArgs.Exception); eventArgs.Handled = true; }; //DispatcherUnhandledException } //TheApplication internal static new TheApplication Current; protected override void OnStartup(StartupEventArgs e) { this.ShutdownMode = ShutdownMode.OnMainWindowClose; MainWindow = new Ui.MainWindow(); MainWindow.Title = ProductName; MainWindow.Show(); startupComplete = true; } //OnStartup void ShowException(Exception e) { Func<Exception, string> exceptionTextFinder = (ex) => { Action<Exception, IStringList> exceptionTextCollector = null; // for recursiveness exceptionTextCollector = (exc, aList) => { aList.Add(string.Format(WPF.Resources.Exceptions.ExceptionFormat, exc.GetType().FullName, exc.Message)); if (exc.InnerException != null) exceptionTextCollector(exc.InnerException, aList); }; //exceptionTextCollector IStringList list = new StringList(); exceptionTextCollector(ex, list); StringBuilder sb = new StringBuilder(); bool first = true; foreach (string item in list) if (first) { sb.Append(item); first = false; } else sb.Append(WPF.Resources.Exceptions.ExceptionStackItemDelimiter + item); return sb.ToString(); }; //exceptionTextFinder MessageBox.Show( exceptionTextFinder(e), ProductName, MessageBoxButton.OK, MessageBoxImage.Error); if (!startupComplete) Shutdown(); } //ShowException [STAThread] static void Main() { using (var iconStream = new System.IO.MemoryStream()) { TheApplication app = new TheApplication(); Current = app; WPF.Resources.Main.IconMain.Save(iconStream); iconStream.Seek(0, System.IO.SeekOrigin.Begin); app.ApplicationIcon = System.Windows.Media.Imaging.BitmapFrame.Create(iconStream); app.Run(); } //using } //Main internal string ProductName { get { if (productName == null) { object[] attributes = TheAssembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false); if (attributes == null) return null; if (attributes.Length < 1) return null; productName = ((AssemblyProductAttribute)attributes[0]).Product; } //if return productName; } //get ProductName } //ProductName internal string Copyright { get { if (copyright == null) { object[] attributes = TheAssembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); if (attributes == null) return null; if (attributes.Length < 1) return null; copyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright; } //if return copyright; } //get Copyright } //Copyright internal string Company { get { if (company == null) { object[] attributes = TheAssembly.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); if (attributes == null) return null; if (attributes.Length < 1) return null; company = ((AssemblyCompanyAttribute)attributes[0]).Company; } //if return company; } //get Company } //Company internal string[] PersonalUri { get { if (personalUri == null) { object[] attributes = TheAssembly.GetCustomAttributes(typeof(AssemblyPersonalUriAttribute), false); if (attributes == null) return null; if (attributes.Length < 1) return null; StringList list = new StringList(); foreach (var attribute in attributes) list.Add(((AssemblyPersonalUriAttribute)attribute).Value); personalUri = list.ToArray(); } //if return personalUri; } //get PersonalUri } //PersonalUri internal AssemblyPublicationAttribute[] Publications { get { if (publications == null) { object[] attributes = TheAssembly.GetCustomAttributes(typeof(AssemblyPublicationAttribute), false); if (attributes == null) return null; if (attributes.Length < 1) return null; var list = new PublicationList(); foreach (var attribute in attributes) list.Add(((AssemblyPublicationAttribute)attribute)); return list.ToArray(); } //if return publications; } //get Publications } //Publications internal Version AssemblyVersion { get { if (assemblyVersion == null) { object[] attributes = TheAssembly.GetCustomAttributes(typeof(AssemblyFileVersionAttribute), false); if (attributes == null) return null; if (attributes.Length < 1) return null; assemblyVersion = new Version(((AssemblyFileVersionAttribute)attributes[0]).Version); } //if return assemblyVersion; } //get AssemblyVersion } //AssemblyVersion internal Version AssemblyInformationalVersion { get { if (assemblyVersion == null) { object[] attributes = TheAssembly.GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false); if (attributes == null) return null; if (attributes.Length < 1) return null; assemblyVersion = new Version(((AssemblyInformationalVersionAttribute)attributes[0]).InformationalVersion); } //if return assemblyVersion; } //get AssemblyVersion } //AssemblyVersion Assembly TheAssembly { get { if (assembly == null) assembly = Assembly.GetEntryAssembly(); return assembly; } //get TheAssembly } //TheAssembly bool startupComplete; Assembly assembly; string productName, copyright, company; string[] personalUri; AssemblyPublicationAttribute[] publications; Version assemblyVersion; internal ImageSource ApplicationIcon { get; private set; } } //class TheApplication } //namespace WPF.Main
35.646739
114
0.689739
[ "MIT" ]
SAKryukov/isomorphic-midi-keyboard
code/WPF/Main/TheApplication.cs
6,562
C#
namespace EA.Iws.Core.ImportMovement { using System; [Serializable] public class ImportCancelMovementData { public Guid Id { get; set; } public int Number { get; set; } public Guid NotificationId { get; set; } } }
18.642857
48
0.609195
[ "Unlicense" ]
DEFRA/prsd-iws
src/EA.Iws.Core/ImportMovement/ImportCancelMovementData.cs
263
C#
using System; using System.Collections.Generic; using System.Text; namespace OldestFamilyMember { public class Person { private string name; private int age; public Person(string name, int age) { this.name = name; this.age = age; } public string Name { get { return this.name; } set { this.name = value; } } public int Age { get { return this.age; } set { this.age = value; } } } }
18.032258
43
0.484794
[ "Apache-2.0" ]
Vladimir-Dodnikov/CSharp---Advanced
06. Defining classes - Exercise/Person.cs
561
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> //------------------------------------------------------------------------------ namespace WPFConvertor.Properties { /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if ((resourceMan == null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WPFConvertor.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } } }
38.625
178
0.60338
[ "Unlicense" ]
vb2ae/WPFIValueConverter
WPFConvertor/Properties/Resources.Designer.cs
2,783
C#
using System; using System.Collections.Generic; using LilyPath; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace LilyPathDemo.TestSheets { [TestName("Water Lily")] public class WaterLilySheet : TestSheet { private Vector2 _origin = new Vector2(200, 200); private float _startAngle = (float)(Math.PI / 16) * 25; // 11:20 private float _arcLength = (float)(Math.PI / 16) * 30; private GraphicsPath _lilyOuterFlower; private GraphicsPath _lilyInnerFlower; public override void Setup (GraphicsDevice device) { Pen penOuterFlower = new Pen(Color.White * 0.75f, 15) { Alignment = PenAlignment.Outset }; _lilyOuterFlower = CreateFlowerGP(penOuterFlower, _origin, 8, 120, 100, (float)(Math.PI / 8)); Pen penInnerFlower = new Pen(Color.MediumPurple * 0.5f, 10) { Alignment = PenAlignment.Outset }; _lilyInnerFlower = CreateFlowerGP(penInnerFlower, _origin, 16, 105, 60, 0); } public override void Draw (DrawBatch drawBatch) { drawBatch.FillCircle(new SolidColorBrush(Color.SkyBlue), _origin, 175); drawBatch.FillArc(new SolidColorBrush(Color.LimeGreen), _origin, 150, _startAngle, _arcLength, ArcType.Sector); drawBatch.DrawClosedArc(new Pen(Color.Green, 15), _origin, 150, _startAngle, _arcLength, ArcType.Sector); drawBatch.DrawPath(_lilyOuterFlower); drawBatch.DrawPath(_lilyInnerFlower); } private GraphicsPath CreateFlowerGP (Pen pen, Vector2 center, int petalCount, float petalLength, float petalWidth, float rotation) { List<Vector2> points = StarPoints(center, petalCount / 2, petalLength, petalLength, rotation, false); PathBuilder builder = new PathBuilder(); builder.AddPoint(center); foreach (Vector2 point in points) { builder.AddArcByPoint(point, petalWidth / 2); builder.AddArcByPoint(center, petalWidth / 2); } return builder.Stroke(pen, PathType.Closed); } } }
40.584906
138
0.655044
[ "MIT" ]
jaquadro/LilyPath
LilyPathDemo/TestSheets/WaterLilly.cs
2,153
C#
// Copyright (c) 2017 Trevor Redfern // // This software is released under the MIT License. // https://opensource.org/licenses/MIT namespace SilverNeedle.Actions.CharacterGeneration.Background { using System; using SilverNeedle.Characters; using SilverNeedle.Characters.Background; using SilverNeedle.Serialization; public class ClassOriginStoryCreator : ICharacterDesignStep { EntityGateway<ClassOriginGroup> classOrigins; public ClassOriginStoryCreator(EntityGateway<ClassOriginGroup> classOrigins) { this.classOrigins = classOrigins; } public ClassOriginStoryCreator() { this.classOrigins = GatewayProvider.Get<ClassOriginGroup>(); } public ClassOrigin CreateStory(string cls) { var origins = classOrigins.FindOrNull(cls); if(origins == null) return new ClassOrigin(); return origins.Origins.ChooseRandomly(); } public void ExecuteStep(CharacterSheet character) { character.History.ClassOriginStory = CreateStory(character.Class.Name); } } }
28.238095
84
0.652614
[ "MIT" ]
shortlegstudio/silverneedle-web
silverneedle/lib/Actions/CharacterGeneration/Background/ClassOriginStoryCreator.cs
1,188
C#
/*# This file is part of adp-api-library. # https://github.com/adplabs/adp-connection-NET # Copyright © 2015-2016 ADP, LLC. # 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; namespace ADPClient { /// <summary> /// /// </summary> public class ADPApiConnectionFactory { /// <summary> /// /// </summary> public ADPApiConnectionFactory() { } /// <summary> /// /// </summary> /// <param name="connectionCfg"></param> /// <returns></returns> public static ADPApiConnection createConnection(ConnectionConfiguration connectionCfg) { if (connectionCfg is AuthorizationCodeConfiguration) { return new AuthorizationCodeConnection(connectionCfg); } else if (connectionCfg is ClientCredentialConfiguration) { return new ClientCredentialConnection(connectionCfg); } else { throw new Exception("Grant type / Configuration type not implemented."); } } } }
27.316667
94
0.61928
[ "Apache-2.0" ]
adplabs/adp-connection-NET
ADPClient/Connection/ADPApiConnectionFactory.cs
1,650
C#
using System; using System.Collections.Generic; using System.Linq; using PostSharp.Patterns.Contracts; using ThreatsManager.Interfaces.ObjectModel; using ThreatsManager.Interfaces.ObjectModel.Properties; using ThreatsManager.Utilities; namespace ThreatsManager.Quality { /// <summary> /// Utility class to perform quality analysis of Threat Models. /// </summary> public class QualityAnalyzersManager { private static readonly IEnumerable<IQualityAnalyzer> _analyzers; static QualityAnalyzersManager() { _analyzers = ExtensionUtils.GetExtensions<IQualityAnalyzer>(); } /// <summary> /// Get the list of configured Quality Analyzers. /// </summary> public static IEnumerable<IQualityAnalyzer> QualityAnalyzers => _analyzers; /// <summary> /// Calculate the Normalized Threat Model Health Index. /// </summary> /// <param name="model">Model to be analyzed.</param> /// <param name="isFalsePositive">Function that evaluates an object to decide if it has already been marked as a False Positive.</param> /// <param name="outcomes">Health of the analysis.</param> /// <returns>Normalized Threat Model Health Index.</returns> /// <remarks>For the normalized 30 represents perfect health.</remarks> public double Analyze([NotNull] IThreatModel model, Func<IQualityAnalyzer, IPropertiesContainer, bool> isFalsePositive, out IEnumerable<QualityAnalyzerResult> outcomes) { double result = 0; outcomes = null; if (_analyzers?.Any() ?? false) { double calculated = 0.0; List<QualityAnalyzerResult> results = new List<QualityAnalyzerResult>(); foreach (var analyzer in _analyzers) { var analyzerResult = new QualityAnalyzerResult(analyzer, isFalsePositive, model); results.Add(analyzerResult); calculated += analyzerResult.Health; } outcomes = results.ToArray(); result = calculated * 30.0 / GetMaxAssessment(); } return result; } /// <summary> /// Calculates the de /// </summary> /// <param name="healthIndex"></param> /// <returns></returns> public static string GetHealthIndexDescription(double healthIndex) { string result; if (healthIndex <= 10) result = "Poor"; else if (healthIndex <= 20) result = "Insufficient"; else if (healthIndex <= 24) result = "Sufficient"; else if (healthIndex <= 27) result = "Good"; else if (healthIndex <= 29) result = "Great"; else result = "Best"; return result; } private static double GetMaxAssessment() { return _analyzers?.Sum(x => x.MultiplicationFactor * 2.0) ?? 0.0; } } }
34.150538
144
0.573992
[ "MIT" ]
simonec73/threatsmanager
Sources/Extensions/ThreatsManager.Quality/QualityAnalyzersManager.cs
3,178
C#
/* * Copyright © Kahath 2015 * Licensed under MIT license. */ using KNetFramework.Attributes.Core; using KNetFramework.Commands.Base; using KNetFramework.Enums; using KNetFramework.Managers; using KNetFramework.Network.Session; namespace KNetFramework.Commands.Handlers { [Command("assembly", CommandLevel.Ten, "")] public class AssemblyCommands : CommandHandlerBase { #region Methods #region GetCommand protected override Command GetCommand() { Command retVal = null; Command[] AssemblyCommands = { new Command("load", CommandLevel.Ten, null, AssemblyLoadHandler, ""), }; retVal = new Command(Name, Level, AssemblyCommands, null, Description); return retVal; } #endregion #region Handlers #region AssemblyLoadHandler private static bool AssemblyLoadHandler(Client client, params string[] args) { string path = args[0]; Manager.AssemblyManager.Load(path); return true; } #endregion #endregion #endregion } }
17.45614
78
0.718593
[ "MIT" ]
Kahath/Framework
KNetFramework/Commands/Handlers/AssemblyCommands.cs
998
C#
using System.Net; using Moq; using NUnit.Framework; using TestNinja.Mocking; namespace TestNinja.UnitTests.Mocking { [TestFixture()] public class InstallerHelperTests { private InstallerHelper _helper; private Mock<IClient> _client; public InstallerHelperTests() { _client = new Mock<IClient>(); _helper = new InstallerHelper(_client.Object); } [TestCase()] //[Ignore("To save time")] public void DownloadInstaller_WhenThrowException_ReturnFalse() { // Arrange _client.Setup(c => c.DownloadFile(It.IsAny<string>(), It.IsAny<string>())).Throws(new WebException()); // Act var result = _helper.DownloadInstaller("customer", "installer"); // Assert Assert.That(result, Is.False); } [TestCase()] //[Ignore("To save time")] public void DownloadInstaller_Completes_ReturnTrue() { // Arrange // Act var result = _helper.DownloadInstaller("http://local/", "p.txt"); // Assert Assert.That(result, Is.True); } } }
27.883721
114
0.564637
[ "MIT" ]
daviddongguo/c-_NunitTest_Mock
TestNinja-david/TestNinja.UnitTests/Mocking/InstallerHelperTests.cs
1,201
C#
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Rebus.AmazonSQS")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Rebus.AmazonSQS")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("586dc77b-804e-4b66-8a2f-33ce49362a27")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
37.888889
84
0.741202
[ "MIT" ]
lucasantarelli/rebus
Rebus.AmazonSQS/Properties/AssemblyInfo.cs
1,367
C#
#pragma warning disable 108 // new keyword hiding #pragma warning disable 114 // new keyword hiding namespace Windows.UI.Xaml.Controls { #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__ [global::Uno.NotImplemented] #endif public partial class ContentDialogOpenedEventArgs { } }
24.916667
62
0.752508
[ "Apache-2.0" ]
dansiegel/Uno
src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml.Controls/ContentDialogOpenedEventArgs.cs
299
C#
using System; using System.Globalization; using Newtonsoft.Json; namespace SURA.Models { public class ReciboPolizaModel { [JsonProperty("numeroPoliza", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] public string NumeroPoliza { get; set; } [JsonProperty("numeroRecibo", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] public string NumeroRecibo { get; set; } [JsonProperty("montoPoliza", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] public double MontoPoliza { get; set; } public string MontoPolizaString { get { return MontoPoliza.ToString("C", new CultureInfo("es-PA")); } } [JsonProperty("solucion", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] public string Solucion { get; set; } } }
32.866667
118
0.6643
[ "MIT" ]
fabiangothman/xamarinApp
SURA/SURA/Models/ReciboPolizaModel.cs
988
C#
/* * Original author: Nicholas Shulman <nicksh .at. u.washington.edu>, * MacCoss Lab, Department of Genome Sciences, UW * * Copyright 2019 University of Washington - Seattle, WA * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.Collections.Generic; using Microsoft.VisualStudio.TestTools.UnitTesting; using pwiz.Common.DataBinding; using pwiz.Common.DataBinding.Controls.Editor; using pwiz.Skyline.Controls.Databinding; using pwiz.Skyline.Controls.Graphs.Calibration; using pwiz.Skyline.Model.Databinding.Collections; using pwiz.Skyline.Model.Databinding.Entities; using pwiz.Skyline.Model.DocSettings.AbsoluteQuantification; using pwiz.Skyline.Properties; using pwiz.SkylineTestUtil; using Peptide = pwiz.Skyline.Model.Databinding.Entities.Peptide; namespace pwiz.SkylineTestFunctional { [TestClass] public class BatchCalibrationTest : AbstractFunctionalTest { private const string BatchNamesView = "BatchNames"; [TestMethod] public void TestBatchCalibration() { TestFilesZip = @"TestFunctional\BatchCalibrationTest.zip"; RunFunctionalTest(); } protected override void DoTest() { RunUI(()=> { SkylineWindow.OpenFile(TestFilesDir.GetTestPath("BatchCalibrationTest.sky")); SkylineWindow.ShowDocumentGrid(true); SkylineWindow.ShowCalibrationForm(); }); VerifyQuantificationResults(false); SetBatchNames(); VerifyQuantificationResults(true); } private void SetBatchNames() { var documentGrid = FindOpenForm<DocumentGridForm>(); RunUI(() => documentGrid.DataboundGridControl.ChooseView( ViewGroup.BUILT_IN.Id.ViewName(Resources.SkylineViewContext_GetDocumentGridRowSources_Replicates))); WaitForConditionUI(() => documentGrid.IsComplete); var viewEditor = ShowDialog<ViewEditor>(documentGrid.NavBar.CustomizeView); var filesPropertyPath = PropertyPath.Root.Property(nameof(SkylineDocument.Replicates)).LookupAllItems() .Property(nameof(Replicate.Files)).LookupAllItems(); RunUI(() => { viewEditor.ChooseColumnsTab.AddColumn(PropertyPath.Root.Property(nameof(SkylineDocument.Replicates)).LookupAllItems().Property(nameof(Replicate.BatchName))); viewEditor.ChooseColumnsTab.AddColumn(filesPropertyPath.Property(nameof(ResultFile.TicArea))); viewEditor.ChooseColumnsTab.AddColumn(filesPropertyPath.Property(nameof(ResultFile.ExplicitGlobalStandardArea))); viewEditor.ViewName = BatchNamesView; }); OkDialog(viewEditor, viewEditor.OkDialog); WaitForConditionUI(() => documentGrid.IsComplete); var colReplicate = documentGrid.FindColumn(PropertyPath.Root); RunUI(() => { for (int iRow = 0; iRow < documentGrid.RowCount; iRow++) { var replicate = (Replicate) documentGrid.DataGridView.Rows[iRow].Cells[colReplicate.Index].Value; if (replicate.Name == "PooledGlomeruliSample") { replicate.BatchName = "glomeruli"; Assert.AreEqual(SampleType.STANDARD, replicate.SampleType); Assert.AreEqual(1, replicate.AnalyteConcentration); } else if (replicate.Name == "PooledCortexSample") { replicate.BatchName = "cortex"; Assert.AreEqual(SampleType.STANDARD, replicate.SampleType); Assert.AreEqual(1, replicate.AnalyteConcentration); } else if (replicate.Name.StartsWith("glom-")) { replicate.BatchName = "glomeruli"; Assert.AreEqual(SampleType.UNKNOWN, replicate.SampleType); Assert.IsNull(replicate.AnalyteConcentration); } else if (replicate.Name.StartsWith("cort-")) { replicate.BatchName = "cortex"; Assert.AreEqual(SampleType.UNKNOWN, replicate.SampleType); Assert.IsNull(replicate.AnalyteConcentration); } else { Assert.Fail("Unexpected replicate name {0}", replicate.Name); } Assert.AreEqual(1, replicate.Files.Count); var file = replicate.Files[0]; Assert.AreEqual(file.TicArea, file.ExplicitGlobalStandardArea); } }); } private void VerifyQuantificationResults(bool hasBatchNames) { var documentGrid = FindOpenForm<DocumentGridForm>(); RunUI(()=>documentGrid.ChooseView("PeptideQuantificationResults")); WaitForConditionUI(() => documentGrid.IsComplete); var propertyPathResults = PropertyPath.Root .Property(nameof(Peptide.Results)).LookupAllItems() .Property(nameof(KeyValuePair<ResultKey, PeptideResult>.Value)); var colPeptide = documentGrid.FindColumn(PropertyPath.Root); var colReplicate = documentGrid.FindColumn(propertyPathResults .Property(nameof(PeptideResult.ResultFile)) .Property(nameof(ResultFile.Replicate))); var colCalibrationCurve = documentGrid.FindColumn(PropertyPath.Root.Property(nameof(Peptide.CalibrationCurve))); var colReplicateCalibrationCurve = documentGrid.FindColumn(propertyPathResults.Property(nameof(PeptideResult.ReplicateCalibrationCurve))); var colQuantification = documentGrid.FindColumn(propertyPathResults.Property(nameof(PeptideResult.Quantification))); for (int iRow = 0; iRow < documentGrid.RowCount; iRow++) { Peptide peptide = null; Replicate replicate = null; var calibrationCurve = default(LinkValue<CalibrationCurve>); var replicateCalibrationCurve = default(LinkValue<CalibrationCurve>); RunUI(() => { var row = documentGrid.DataGridView.Rows[iRow]; peptide = (Peptide)row.Cells[colPeptide.Index].Value; replicate = (Replicate)row.Cells[colReplicate.Index].Value; calibrationCurve = (LinkValue<CalibrationCurve>)row.Cells[colCalibrationCurve.Index].Value; replicateCalibrationCurve = (LinkValue<CalibrationCurve>)row.Cells[colReplicateCalibrationCurve.Index].Value; }); if (hasBatchNames) { Assert.AreNotEqual(calibrationCurve.Value.PointCount, replicateCalibrationCurve.Value.PointCount); } else { Assert.AreEqual(calibrationCurve.Value.PointCount, replicateCalibrationCurve.Value.PointCount); Assert.AreEqual(calibrationCurve.Value.Slope, replicateCalibrationCurve.Value.Slope); } int selectedResultsIndexOld = SkylineWindow.SelectedResultsIndex; RunUI(()=>calibrationCurve.ClickEventHandler(new object(), new EventArgs())); var calibrationForm = FindOpenForm<CalibrationForm>(); Assert.IsNotNull(calibrationForm); WaitForGraphs(); Assert.AreEqual(peptide.IdentityPath, SkylineWindow.SelectedPath); Assert.AreEqual(selectedResultsIndexOld, SkylineWindow.SelectedResultsIndex); RunUI(()=>replicateCalibrationCurve.ClickEventHandler(new object(), new EventArgs())); Assert.AreEqual(peptide.IdentityPath, SkylineWindow.SelectedPath); Assert.AreEqual(replicate.ReplicateIndex, SkylineWindow.SelectedResultsIndex); } } } }
50.325714
173
0.618599
[ "Apache-2.0" ]
CSi-Studio/pwiz
pwiz_tools/Skyline/TestFunctional/BatchCalibrationTest.cs
8,809
C#
#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Collections; using System.Collections.Generic; namespace WEFInternal.Newtonsoft.Json.Bson { internal abstract class BsonToken { public abstract BsonType Type { get; } public BsonToken Parent { get; set; } public int CalculatedSize { get; set; } } internal class BsonObject : BsonToken, IEnumerable<BsonProperty> { private readonly List<BsonProperty> _children = new List<BsonProperty>(); public void Add(string name, BsonToken token) { _children.Add(new BsonProperty { Name = new BsonString(name, false), Value = token }); token.Parent = this; } public override BsonType Type { get { return BsonType.Object; } } public IEnumerator<BsonProperty> GetEnumerator() { return _children.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } internal class BsonArray : BsonToken, IEnumerable<BsonToken> { private readonly List<BsonToken> _children = new List<BsonToken>(); public void Add(BsonToken token) { _children.Add(token); token.Parent = this; } public override BsonType Type { get { return BsonType.Array; } } public IEnumerator<BsonToken> GetEnumerator() { return _children.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } internal class BsonValue : BsonToken { private readonly object _value; private readonly BsonType _type; public BsonValue(object value, BsonType type) { _value = value; _type = type; } public object Value { get { return _value; } } public override BsonType Type { get { return _type; } } } internal class BsonString : BsonValue { public int ByteCount { get; set; } public bool IncludeLength { get; set; } public BsonString(object value, bool includeLength) : base(value, BsonType.String) { IncludeLength = includeLength; } } internal class BsonBinary : BsonValue { public BsonBinaryType BinaryType { get; set; } public BsonBinary(byte[] value, BsonBinaryType binaryType) : base(value, BsonType.Binary) { BinaryType = binaryType; } } internal class BsonRegex : BsonToken { public BsonString Pattern { get; set; } public BsonString Options { get; set; } public BsonRegex(string pattern, string options) { Pattern = new BsonString(pattern, false); Options = new BsonString(options, false); } public override BsonType Type { get { return BsonType.Regex; } } } internal class BsonProperty { public BsonString Name { get; set; } public BsonToken Value { get; set; } } }
27.828025
98
0.615244
[ "Apache-2.0" ]
yswenli/WEF
WEF.Core/Common/Newtonsoft.Json/Bson/BsonToken.cs
4,369
C#
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using uniPark.Main.Forms.Landing; namespace uniPark.Main.Forms.Loading { public partial class frmLoading : Form { public frmLoading() { InitializeComponent(); } private void tmrLoading_Tick(object sender, EventArgs e) { /* Checks to see if the loading value is not 10 * if it is timer stops */ bool bFlag = false; if (matpgbLoading.Value != 2) { matpgbLoading.Value++; } else { tmrLoading.Stop(); bFlag = true; } if (bFlag == true) { frmLanding landing = new frmLanding(); frmLoading loading = this; landing.Show(); loading.Hide(); } } private void frmLoading_Load(object sender, EventArgs e) { /* Configuration of timer */ tmrLoading.Enabled = true; tmrLoading.Start(); tmrLoading.Interval = 1000; matpgbLoading.Maximum = 2; } } }
24.875
64
0.511845
[ "MIT" ]
DieWindpomp/DragonCode
uniPark/Main/Forms/Loading/frmLoading.cs
1,395
C#
#region using using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq.Expressions; using System.Reflection; using log4net; #endregion namespace NetAppCommon.Cache.Attributes { /// <summary> /// Rozszerzenia programowania zorientowanego na aspekty - Atrybut wartości domyślnej pamięci podręcznej /// Aspect Oriented Programming Extensions Memory Cache Default Value Attribute /// </summary> public static class MemoryCacheDefaultValueAttribute { /// <summary> /// Dictionary to hold type initialization methods' cache /// </summary> private static readonly Dictionary<Type, Action<object>> TypesInitializers = new(); #region private readonly log4net.ILog log4net /// <summary> /// Instancja do klasy Log4netLogger /// Instance to Log4netLogger class /// </summary> private static readonly ILog _log4Net = Log4NetLogger.Log4NetLogger.GetLog4NetInstance(MethodBase.GetCurrentMethod()?.DeclaringType); #endregion /// <summary> /// Implements precompiled setters with embedded constant values from DefaultValueAttributes /// </summary> public static void ApplyDefaultValues(this object @this) { try { // Attempt to get it from cache if (!TypesInitializers.TryGetValue(@this.GetType(), out Action<object> setter)) { // If no initializers are added do nothing setter = o => { }; // Iterate through each property ParameterExpression parameterExpression = Expression.Parameter(typeof(object), "this"); foreach (PropertyInfo prop in @this.GetType() .GetProperties(BindingFlags.Public | BindingFlags.Instance)) { if (prop.CanWrite && prop.GetCustomAttributes(typeof(DefaultValueAttribute), false) is DefaultValueAttribute[] attr && attr.Length > 0) { Expression expressionConvert = Expression.Convert(Expression.Constant(attr[0].Value), prop.PropertyType); Expression expressionCall = Expression.Call(Expression.TypeAs(parameterExpression, @this.GetType()), prop.GetSetMethod(), expressionConvert); var expressionLambda = Expression.Lambda<Action<object>>(expressionCall, parameterExpression); // Add this action to multicast delegate setter += expressionLambda.Compile(); } } if (true) { try { // Save in the type cache TypesInitializers.Add(@this.GetType(), setter); setter(@this); } catch (Exception e) { Console.WriteLine(e); } } } } catch (Exception e) { Console.WriteLine(e); } } /// <summary> /// Implements cache of ResetValue delegates /// </summary> public static void ResetDefaultValues(this object @this) { try { // Attempt to get it from cache if (!TypesInitializers.TryGetValue(@this.GetType(), out Action<object> setter)) { // Init delegate with empty body, // If no initializers are added do nothing setter = o => { }; // Go through each property and compile Reset delegates foreach (PropertyDescriptor prop in TypeDescriptor.GetProperties(@this)) { // Add only these which values can be reset if (prop.CanResetValue(@this)) { setter += prop.ResetValue; } } // Save in the type cache TypesInitializers.Add(@this.GetType(), setter); } // Initialize member properties setter(@this); } catch (Exception e) { Console.WriteLine(e); } } } }
38.234375
117
0.483245
[ "Apache-2.0" ]
paulpiotr/NetAppCommon
NetAppCommon/Cache/Attributes/MemoryCacheDefaultValueAttribute.cs
4,898
C#
using APICatalogo.Context; using APICatalogo.DTOs.Mappings; using APICatalogo.Extensions; using APICatalogo.Repository; using AutoMapper; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.IdentityModel.Tokens; using Microsoft.OpenApi.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace APICatalogo { public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddCors(options => { options.AddPolicy("PermitirApiRequest", builder => builder.WithOrigins("https://www.apirequest.io/").WithMethods("GET")); // Via Atributo }); var mappingConfig = new MapperConfiguration(mc => { mc.AddProfile(new MappingProfile()); }); IMapper mapper = mappingConfig.CreateMapper(); services.AddSingleton(mapper); services.AddScoped<IUnitOfWork, UnitOfWork>(); //services.AddDbContext<AppDbContext>(options => options.UseMySql(Configuration.GetConnectionString("DefaultConnection"))); //services.AddDbContext<AppDbContext>(options => options.UseMySql(Configuration.GetConnectionString("DefaultConnection"), new MySqlServerVersion(new Version()))); string mySqlConnection = Configuration.GetConnectionString("DefaultConnection"); services.AddDbContext<AppDbContext>(options => options.UseMySql(mySqlConnection, ServerVersion.AutoDetect(mySqlConnection))); services.AddIdentity<IdentityUser, IdentityRole>().AddEntityFrameworkStores<AppDbContext>().AddDefaultTokenProviders(); //JWT //adiciona o manipulador de autenticacao e define o //esquema de autenticacao usado : Bearer //valida o emissor, a audiencia e a chave //usando a chave secreta valida a assinatura services.AddAuthentication( JwtBearerDefaults.AuthenticationScheme). AddJwtBearer(options => options.TokenValidationParameters = new TokenValidationParameters { ValidateIssuer = true, ValidateAudience = true, ValidateLifetime = true, ValidAudience = Configuration["TokenConfiguration:Audience"], ValidIssuer = Configuration["TokenConfiguration:Issuer"], ValidateIssuerSigningKey = true, IssuerSigningKey = new SymmetricSecurityKey( Encoding.UTF8.GetBytes(Configuration["Jwt:key"])) }); services.AddApiVersioning(options => { options.AssumeDefaultVersionWhenUnspecified = true; options.DefaultApiVersion = new ApiVersion(1, 0); options.ReportApiVersions = true; }); services.AddControllers().AddNewtonsoftJson(options => options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore); services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "APICatalogo", Version = "v1" }); }); //services.AddScoped<ApiLoggingFilter>(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseSwagger(); app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "APICatalogo v1")); } app.ConfigureExceptionHandler(); app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); //app.UseCors(opt => opt.WithOrigins("https://www.apirequest.io/").WithMethods("GET")); //Via Middleware app.UseCors(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); } } }
38.859375
174
0.635505
[ "Apache-2.0" ]
lucasMontagnani/API_Catalogo_ASP.NET_Core
APICatalogo/Startup.cs
4,974
C#
using System; using Serilog; using Serilog.Configuration; using Serilog.Formatting.Compact; namespace EventStore.Common.Log { internal static class LoggerSinkConfigurationExtensions { public static LoggerConfiguration RollingFile(this LoggerSinkConfiguration configuration, string logFileName) { if (configuration == null) throw new ArgumentNullException(nameof(configuration)); return configuration.File( new CompactJsonFormatter(), logFileName, buffered: false, rollOnFileSizeLimit: true); } } }
27.789474
113
0.787879
[ "Apache-2.0", "CC0-1.0" ]
01100010011001010110010101110000/EventStore
src/EventStore.Common/Log/LoggerSinkConfigurationExtensions.cs
528
C#
/******************************************************************************* * Copyright 2012-2019 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. * ***************************************************************************** * * AWS Tools for Windows (TM) PowerShell (TM) * */ using System; using System.Collections.Generic; using System.Linq; using System.Management.Automation; using System.Text; using Amazon.PowerShell.Common; using Amazon.Runtime; using Amazon.WorkLink; using Amazon.WorkLink.Model; namespace Amazon.PowerShell.Cmdlets.WL { /// <summary> /// Updates the identity provider configuration for the fleet. /// </summary> [Cmdlet("Update", "WLIdentityProviderConfiguration", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)] [OutputType("None")] [AWSCmdlet("Calls the Amazon WorkLink UpdateIdentityProviderConfiguration API operation.", Operation = new[] {"UpdateIdentityProviderConfiguration"}, SelectReturnType = typeof(Amazon.WorkLink.Model.UpdateIdentityProviderConfigurationResponse))] [AWSCmdletOutput("None or Amazon.WorkLink.Model.UpdateIdentityProviderConfigurationResponse", "This cmdlet does not generate any output." + "The service response (type Amazon.WorkLink.Model.UpdateIdentityProviderConfigurationResponse) can be referenced from properties attached to the cmdlet entry in the $AWSHistory stack." )] public partial class UpdateWLIdentityProviderConfigurationCmdlet : AmazonWorkLinkClientCmdlet, IExecutor { #region Parameter FleetArn /// <summary> /// <para> /// <para>The ARN of the fleet.</para> /// </para> /// </summary> #if !MODULAR [System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true)] #else [System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true, Mandatory = true)] [System.Management.Automation.AllowEmptyString] [System.Management.Automation.AllowNull] #endif [Amazon.PowerShell.Common.AWSRequiredParameter] public System.String FleetArn { get; set; } #endregion #region Parameter IdentityProviderSamlMetadata /// <summary> /// <para> /// <para>The SAML metadata document provided by the customer’s identity provider. The existing /// IdentityProviderSamlMetadata is unset if null is passed.</para> /// </para> /// </summary> [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String IdentityProviderSamlMetadata { get; set; } #endregion #region Parameter IdentityProviderType /// <summary> /// <para> /// <para>The type of identity provider.</para> /// </para> /// </summary> #if !MODULAR [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] #else [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)] [System.Management.Automation.AllowNull] #endif [Amazon.PowerShell.Common.AWSRequiredParameter] [AWSConstantClassSource("Amazon.WorkLink.IdentityProviderType")] public Amazon.WorkLink.IdentityProviderType IdentityProviderType { get; set; } #endregion #region Parameter Select /// <summary> /// Use the -Select parameter to control the cmdlet output. The cmdlet doesn't have a return value by default. /// Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.WorkLink.Model.UpdateIdentityProviderConfigurationResponse). /// Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value. /// </summary> [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public string Select { get; set; } = "*"; #endregion #region Parameter PassThru /// <summary> /// Changes the cmdlet behavior to return the value passed to the FleetArn parameter. /// The -PassThru parameter is deprecated, use -Select '^FleetArn' instead. This parameter will be removed in a future version. /// </summary> [System.Obsolete("The -PassThru parameter is deprecated, use -Select '^FleetArn' instead. This parameter will be removed in a future version.")] [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public SwitchParameter PassThru { get; set; } #endregion #region Parameter Force /// <summary> /// This parameter overrides confirmation prompts to force /// the cmdlet to continue its operation. This parameter should always /// be used with caution. /// </summary> [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public SwitchParameter Force { get; set; } #endregion protected override void ProcessRecord() { base.ProcessRecord(); var resourceIdentifiersText = FormatParameterValuesForConfirmationMsg(nameof(this.FleetArn), MyInvocation.BoundParameters); if (!ConfirmShouldProceed(this.Force.IsPresent, resourceIdentifiersText, "Update-WLIdentityProviderConfiguration (UpdateIdentityProviderConfiguration)")) { return; } var context = new CmdletContext(); // allow for manipulation of parameters prior to loading into context PreExecutionContextLoad(context); #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute if (ParameterWasBound(nameof(this.Select))) { context.Select = CreateSelectDelegate<Amazon.WorkLink.Model.UpdateIdentityProviderConfigurationResponse, UpdateWLIdentityProviderConfigurationCmdlet>(Select) ?? throw new System.ArgumentException("Invalid value for -Select parameter.", nameof(this.Select)); if (this.PassThru.IsPresent) { throw new System.ArgumentException("-PassThru cannot be used when -Select is specified.", nameof(this.Select)); } } else if (this.PassThru.IsPresent) { context.Select = (response, cmdlet) => this.FleetArn; } #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute context.FleetArn = this.FleetArn; #if MODULAR if (this.FleetArn == null && ParameterWasBound(nameof(this.FleetArn))) { WriteWarning("You are passing $null as a value for parameter FleetArn which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues."); } #endif context.IdentityProviderSamlMetadata = this.IdentityProviderSamlMetadata; context.IdentityProviderType = this.IdentityProviderType; #if MODULAR if (this.IdentityProviderType == null && ParameterWasBound(nameof(this.IdentityProviderType))) { WriteWarning("You are passing $null as a value for parameter IdentityProviderType which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues."); } #endif // allow further manipulation of loaded context prior to processing PostExecutionContextLoad(context); var output = Execute(context) as CmdletOutput; ProcessOutput(output); } #region IExecutor Members public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.WorkLink.Model.UpdateIdentityProviderConfigurationRequest(); if (cmdletContext.FleetArn != null) { request.FleetArn = cmdletContext.FleetArn; } if (cmdletContext.IdentityProviderSamlMetadata != null) { request.IdentityProviderSamlMetadata = cmdletContext.IdentityProviderSamlMetadata; } if (cmdletContext.IdentityProviderType != null) { request.IdentityProviderType = cmdletContext.IdentityProviderType; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return output; } public ExecutorContext CreateContext() { return new CmdletContext(); } #endregion #region AWS Service Operation Call private Amazon.WorkLink.Model.UpdateIdentityProviderConfigurationResponse CallAWSServiceOperation(IAmazonWorkLink client, Amazon.WorkLink.Model.UpdateIdentityProviderConfigurationRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon WorkLink", "UpdateIdentityProviderConfiguration"); try { #if DESKTOP return client.UpdateIdentityProviderConfiguration(request); #elif CORECLR return client.UpdateIdentityProviderConfigurationAsync(request).GetAwaiter().GetResult(); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } } #endregion internal partial class CmdletContext : ExecutorContext { public System.String FleetArn { get; set; } public System.String IdentityProviderSamlMetadata { get; set; } public Amazon.WorkLink.IdentityProviderType IdentityProviderType { get; set; } public System.Func<Amazon.WorkLink.Model.UpdateIdentityProviderConfigurationResponse, UpdateWLIdentityProviderConfigurationCmdlet, object> Select { get; set; } = (response, cmdlet) => null; } } }
46.793103
291
0.628265
[ "Apache-2.0" ]
5u5hma/aws-tools-for-powershell
modules/AWSPowerShell/Cmdlets/WorkLink/Basic/Update-WLIdentityProviderConfiguration-Cmdlet.cs
12,215
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.18010 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace GeolocationSample { public partial class Resource { public partial class Attribute { private Attribute() { } } public partial class Drawable { // aapt resource value: 0x7f020000 public const int Icon = 2130837504; private Drawable() { } } public partial class Id { // aapt resource value: 0x7f050001 public const int cancelPositionButton = 2131034113; // aapt resource value: 0x7f050000 public const int getPositionButton = 2131034112; // aapt resource value: 0x7f050008 public const int lAccuracy = 2131034120; // aapt resource value: 0x7f05000a public const int lLatitude = 2131034122; // aapt resource value: 0x7f050009 public const int lLongitude = 2131034121; // aapt resource value: 0x7f050007 public const int listenStatus = 2131034119; // aapt resource value: 0x7f050003 public const int pAccuracy = 2131034115; // aapt resource value: 0x7f050005 public const int pLatitude = 2131034117; // aapt resource value: 0x7f050004 public const int pLongitude = 2131034116; // aapt resource value: 0x7f050002 public const int status = 2131034114; // aapt resource value: 0x7f050006 public const int toggleListeningButton = 2131034118; private Id() { } } public partial class Layout { // aapt resource value: 0x7f030000 public const int Main = 2130903040; private Layout() { } } public partial class String { // aapt resource value: 0x7f040004 public const int app_name = 2130968580; // aapt resource value: 0x7f040001 public const int cancelPosition = 2130968577; // aapt resource value: 0x7f040000 public const int getPosition = 2130968576; // aapt resource value: 0x7f040002 public const int startListening = 2130968578; // aapt resource value: 0x7f040003 public const int stopListening = 2130968579; private String() { } } } }
21.530973
80
0.621866
[ "Apache-2.0" ]
arthurll/mobile-samples
SoMA/Components/xamarin.social-1.0.1/samples/Xamarin.Social.Sample.Android/Components/xamarin.mobile-0.6.2/samples/Xamarin.Mobile.Android.Samples/GeolocationSample/Resources/Resource.designer.cs
2,433
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("ChatterServer")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ChatterServer")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //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")]
42.392857
98
0.709773
[ "MIT" ]
Joben28/WPFChat
ChatterServer/Properties/AssemblyInfo.cs
2,377
C#
using System; using System.Threading.Tasks; using Dapper; using MySql.Data.MySqlClient; using Xunit; namespace SideBySide { public class Transaction : IClassFixture<TransactionFixture> { public Transaction(TransactionFixture database) { m_database = database; m_connection = m_database.Connection; } [Fact] public void NestedTransactions() { using (m_connection.BeginTransaction()) { Assert.Throws<InvalidOperationException>(() => m_connection.BeginTransaction()); } } [Fact] public void Commit() { m_connection.Execute("delete from transactions_test"); using (var trans = m_connection.BeginTransaction()) { m_connection.Execute("insert into transactions_test values(1), (2)", transaction: trans); trans.Commit(); } var results = m_connection.Query<int>(@"select value from transactions_test order by value;"); Assert.Equal(new[] { 1, 2 }, results); } #if !BASELINE [Fact] public async Task CommitAsync() { await m_connection.ExecuteAsync("delete from transactions_test").ConfigureAwait(false); using (var trans = await m_connection.BeginTransactionAsync().ConfigureAwait(false)) { await m_connection.ExecuteAsync("insert into transactions_test values(1), (2)", transaction: trans).ConfigureAwait(false); await trans.CommitAsync().ConfigureAwait(false); } var results = await m_connection.QueryAsync<int>(@"select value from transactions_test order by value;").ConfigureAwait(false); Assert.Equal(new[] { 1, 2 }, results); } #endif [Fact] public void Rollback() { m_connection.Execute("delete from transactions_test"); using (var trans = m_connection.BeginTransaction()) { m_connection.Execute("insert into transactions_test values(1), (2)", transaction: trans); trans.Rollback(); } var results = m_connection.Query<int>(@"select value from transactions_test order by value;"); Assert.Equal(new int[0], results); } #if !BASELINE [Fact] public async Task RollbackAsync() { await m_connection.ExecuteAsync("delete from transactions_test").ConfigureAwait(false); using (var trans = await m_connection.BeginTransactionAsync().ConfigureAwait(false)) { await m_connection.ExecuteAsync("insert into transactions_test values(1), (2)", transaction: trans).ConfigureAwait(false); await trans.RollbackAsync().ConfigureAwait(false); } var results = await m_connection.QueryAsync<int>(@"select value from transactions_test order by value;").ConfigureAwait(false); Assert.Equal(new int[0], results); } #endif [Fact] public void NoCommit() { m_connection.Execute("delete from transactions_test"); using (var trans = m_connection.BeginTransaction()) { m_connection.Execute("insert into transactions_test values(1), (2)", transaction: trans); } var results = m_connection.Query<int>(@"select value from transactions_test order by value;"); Assert.Equal(new int[0], results); } readonly TransactionFixture m_database; readonly MySqlConnection m_connection; } }
31.204082
130
0.725311
[ "MIT" ]
ddunkin/MySqlConnector
tests/SideBySide/Transaction.cs
3,060
C#
using System; using SFML.Graphics; using SharpDX.Direct3D9; namespace ManiacEditor.Events { public delegate void RenderEventHandler(object sender, DeviceEventArgs e); public delegate void CreateDeviceEventHandler(object sender, DeviceEventArgs e); public delegate void RenderEventHandlerSFML(object sender, DeviceEventArgsSFML e); public delegate void CreateDeviceEventHandlerSFML(object sender, DeviceEventArgsSFML e); public class DeviceEventArgs : EventArgs { private Device _device; public Device Device { get { return _device; } } public DeviceEventArgs(Device device) { _device = device; } } public class DeviceEventArgsSFML : EventArgs { private RenderWindow _device; public RenderWindow Device { get { return _device; } } public DeviceEventArgsSFML(RenderWindow device) { _device = device; } } }
19.981818
92
0.596906
[ "MIT" ]
CarJem/ManiacEditor
ManiacED-Core/Events/DeviceEventArgs.cs
1,101
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace DataParallelism.cs { public static class PrimeNumbers { public static long PrimeSumSequential() { int len = 10000000; long total = 0; Func<int, bool> isPrime = n => { if (n == 1) return false; if (n == 2) return true; var boundary = (int)Math.Floor(Math.Sqrt(n)); for (int i = 2; i <= boundary; ++i) if (n % i == 0) return false; return true; }; for (var i=1; i<=len; ++i) { if (isPrime(i)) total += i; } return total; } public static long PrimeSumParallel() { // Listing 4.4 Parallel sum of prime numbers in a collection using Parallel.For loop construct int len = 10000000; long total = 0; //#A Func<int, bool> isPrime = n => //#B { if (n == 1) return false; if (n == 2) return true; var boundary = (int) Math.Floor(Math.Sqrt(n)); for (int i = 2; i <= boundary; ++i) if (n%i == 0) return false; return true; }; Parallel.For(0, len, i => //#C { if (isPrime(i)) //#D total += i; //#D }); return total; } public static long PrimeSumParallelThreadLocal() { int len = 10000000; long total = 0; Func<int, bool> isPrime = n => { if (n == 1) return false; if (n == 2) return true; var boundary = (int)Math.Floor(Math.Sqrt(n)); for (int i = 2; i <= boundary; ++i) if (n % i == 0) return false; return true; }; // Listing 4.5 Thread-safe parallel sum using Parallel.For and ThreadLocal Parallel.For(0, len, () => 0, //#A (int i, ParallelLoopState loopState, long tlsValue) //#B => isPrime(i) ? tlsValue += i : tlsValue, value => Interlocked.Add(ref total, value)); //#C return total; } public static long PrimeSumParallelLINQ() { int len = 10000000; Func<int, bool> isPrime = n => { if (n == 1) return false; if (n == 2) return true; var boundary = (int)Math.Floor(Math.Sqrt(n)); for (int i = 2; i <= boundary; ++i) if (n % i == 0) return false; return true; }; // Listing 4.7 Parallel sum of a collection using declarative PLINQ long total = Enumerable.Range(0, len).AsParallel().Where(isPrime).Sum(x => (long)x); //#B return total; } } }
31.93
106
0.43063
[ "MIT" ]
devbrsa/fConcBook
Chapter.04/DataParallelism.Part1.cs/PrimeNumbers.cs
3,195
C#
using System; using System.Diagnostics; using System.IO; using System.Text; namespace GvasFormat.Serialization.UETypes { [DebuggerDisplay("{Value}", Name = "{Name}")] public sealed class UETextProperty : UEProperty { private static readonly Encoding Utf8 = new UTF8Encoding(false); public UETextProperty() { } public UETextProperty(BinaryReader reader, long valueLength) { var terminator = reader.ReadByte(); if (terminator != 0) throw new FormatException($"Offset: 0x{reader.BaseStream.Position - 1:x8}. Expected terminator (0x00), but was (0x{terminator:x2})"); // valueLength starts here Flags = reader.ReadInt64(); /* if (Flags != 0) throw new FormatException($"Offset: 0x{reader.BaseStream.Position - 8:x8}. Expected text ??? {0x00}, but was {Flags:x16}"); */ terminator = reader.ReadByte(); if (terminator != 0) throw new FormatException($"Offset: 0x{reader.BaseStream.Position - 1:x8}. Expected terminator (0x00), but was (0x{terminator:x2})"); Id = reader.ReadUEString(); Value = reader.ReadUEString(); } public override void Serialize(BinaryWriter writer) => throw new NotImplementedException(); public long Flags; public string Id; public string Value; } }
34.585366
149
0.616361
[ "MIT" ]
13xforever/gvas-converter
GvasFormat/Serialization/UETypes/UETextProperty.cs
1,420
C#
using Arduino.Firmata; using Arduino.Firmata.Extend; using System.Linq; namespace System.Linq { /// <summary> /// https://github.com/firmata/protocol/blob/master/encoder.md /// </summary> public static class EncoderProtocol { public const byte ENCODER_DATA = 0x61; // ENCODER_DATA(0x61) public static void 附加编码器(this ArduinoSession session, int encoderNumber,int encoderPinA, int encoderPinB) { if (encoderNumber < 0 || encoderNumber > 5) throw new ArgumentOutOfRangeException(nameof(encoderNumber), "Encoder number must be between 0 and 5."); if (encoderPinA < 0 || encoderPinA > 127) throw new ArgumentOutOfRangeException(nameof(encoderPinA), "Pin number must be between 0 and 127."); if (encoderPinB < 0 || encoderPinB > 127) throw new ArgumentOutOfRangeException(nameof(encoderPinB), "Pin number must be between 0 and 127."); var command = new[] { Utility.SysExStart, ENCODER_DATA,//ENCODER_DATA(0x61) (byte)0x00,//ENCODER_ATTACH(0x00) (byte)encoderNumber,//encoder # ([0 - MAX_ENCODERS-1]) (byte)encoderPinA,//4 pin A #(first pin) (byte)encoderPinB,//5 pin B #(second pin) Utility.SysExEnd }; session.Write(command, 0, command.Length); } } }
40.777778
120
0.591962
[ "BSD-2-Clause" ]
mccj/Arduino.Firmata
src/Arduino.Firmata/Protocol/Encoder/EncoderProtocol.cs
1,492
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by \generate-code.bat. // // Changes to this file will be lost when the code is regenerated. // The build server regenerates the code before each build and a pre-build // step will regenerate the code on each local build. // // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. // Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // </auto-generated> //------------------------------------------------------------------------------ // Licensed under MIT No Attribution, see LICENSE file at the root. // Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. using System; using System.Globalization; using System.Linq; using System.Threading; using UnitsNet.Tests.TestsBase; using UnitsNet.Units; using Xunit; // Disable build warning CS1718: Comparison made to same variable; did you mean to compare something else? #pragma warning disable 1718 // ReSharper disable once CheckNamespace namespace UnitsNet.Tests { /// <summary> /// Test of MassConcentration. /// </summary> // ReSharper disable once PartialTypeWithSinglePart public abstract partial class MassConcentrationTestsBase : QuantityTestsBase { protected abstract double CentigramsPerDeciliterInOneKilogramPerCubicMeter { get; } protected abstract double CentigramsPerLiterInOneKilogramPerCubicMeter { get; } protected abstract double CentigramsPerMicroliterInOneKilogramPerCubicMeter { get; } protected abstract double CentigramsPerMilliliterInOneKilogramPerCubicMeter { get; } protected abstract double DecigramsPerDeciliterInOneKilogramPerCubicMeter { get; } protected abstract double DecigramsPerLiterInOneKilogramPerCubicMeter { get; } protected abstract double DecigramsPerMicroliterInOneKilogramPerCubicMeter { get; } protected abstract double DecigramsPerMilliliterInOneKilogramPerCubicMeter { get; } protected abstract double GramsPerCubicCentimeterInOneKilogramPerCubicMeter { get; } protected abstract double GramsPerCubicMeterInOneKilogramPerCubicMeter { get; } protected abstract double GramsPerCubicMillimeterInOneKilogramPerCubicMeter { get; } protected abstract double GramsPerDeciliterInOneKilogramPerCubicMeter { get; } protected abstract double GramsPerLiterInOneKilogramPerCubicMeter { get; } protected abstract double GramsPerMicroliterInOneKilogramPerCubicMeter { get; } protected abstract double GramsPerMilliliterInOneKilogramPerCubicMeter { get; } protected abstract double KilogramsPerCubicCentimeterInOneKilogramPerCubicMeter { get; } protected abstract double KilogramsPerCubicMeterInOneKilogramPerCubicMeter { get; } protected abstract double KilogramsPerCubicMillimeterInOneKilogramPerCubicMeter { get; } protected abstract double KilogramsPerLiterInOneKilogramPerCubicMeter { get; } protected abstract double KilopoundsPerCubicFootInOneKilogramPerCubicMeter { get; } protected abstract double KilopoundsPerCubicInchInOneKilogramPerCubicMeter { get; } protected abstract double MicrogramsPerCubicMeterInOneKilogramPerCubicMeter { get; } protected abstract double MicrogramsPerDeciliterInOneKilogramPerCubicMeter { get; } protected abstract double MicrogramsPerLiterInOneKilogramPerCubicMeter { get; } protected abstract double MicrogramsPerMicroliterInOneKilogramPerCubicMeter { get; } protected abstract double MicrogramsPerMilliliterInOneKilogramPerCubicMeter { get; } protected abstract double MilligramsPerCubicMeterInOneKilogramPerCubicMeter { get; } protected abstract double MilligramsPerDeciliterInOneKilogramPerCubicMeter { get; } protected abstract double MilligramsPerLiterInOneKilogramPerCubicMeter { get; } protected abstract double MilligramsPerMicroliterInOneKilogramPerCubicMeter { get; } protected abstract double MilligramsPerMilliliterInOneKilogramPerCubicMeter { get; } protected abstract double NanogramsPerDeciliterInOneKilogramPerCubicMeter { get; } protected abstract double NanogramsPerLiterInOneKilogramPerCubicMeter { get; } protected abstract double NanogramsPerMicroliterInOneKilogramPerCubicMeter { get; } protected abstract double NanogramsPerMilliliterInOneKilogramPerCubicMeter { get; } protected abstract double OuncesPerImperialGallonInOneKilogramPerCubicMeter { get; } protected abstract double OuncesPerUSGallonInOneKilogramPerCubicMeter { get; } protected abstract double PicogramsPerDeciliterInOneKilogramPerCubicMeter { get; } protected abstract double PicogramsPerLiterInOneKilogramPerCubicMeter { get; } protected abstract double PicogramsPerMicroliterInOneKilogramPerCubicMeter { get; } protected abstract double PicogramsPerMilliliterInOneKilogramPerCubicMeter { get; } protected abstract double PoundsPerCubicFootInOneKilogramPerCubicMeter { get; } protected abstract double PoundsPerCubicInchInOneKilogramPerCubicMeter { get; } protected abstract double PoundsPerImperialGallonInOneKilogramPerCubicMeter { get; } protected abstract double PoundsPerUSGallonInOneKilogramPerCubicMeter { get; } protected abstract double SlugsPerCubicFootInOneKilogramPerCubicMeter { get; } protected abstract double TonnesPerCubicCentimeterInOneKilogramPerCubicMeter { get; } protected abstract double TonnesPerCubicMeterInOneKilogramPerCubicMeter { get; } protected abstract double TonnesPerCubicMillimeterInOneKilogramPerCubicMeter { get; } // ReSharper disable VirtualMemberNeverOverriden.Global protected virtual double CentigramsPerDeciliterTolerance { get { return 1e-5; } } protected virtual double CentigramsPerLiterTolerance { get { return 1e-5; } } protected virtual double CentigramsPerMicroliterTolerance { get { return 1e-5; } } protected virtual double CentigramsPerMilliliterTolerance { get { return 1e-5; } } protected virtual double DecigramsPerDeciliterTolerance { get { return 1e-5; } } protected virtual double DecigramsPerLiterTolerance { get { return 1e-5; } } protected virtual double DecigramsPerMicroliterTolerance { get { return 1e-5; } } protected virtual double DecigramsPerMilliliterTolerance { get { return 1e-5; } } protected virtual double GramsPerCubicCentimeterTolerance { get { return 1e-5; } } protected virtual double GramsPerCubicMeterTolerance { get { return 1e-5; } } protected virtual double GramsPerCubicMillimeterTolerance { get { return 1e-5; } } protected virtual double GramsPerDeciliterTolerance { get { return 1e-5; } } protected virtual double GramsPerLiterTolerance { get { return 1e-5; } } protected virtual double GramsPerMicroliterTolerance { get { return 1e-5; } } protected virtual double GramsPerMilliliterTolerance { get { return 1e-5; } } protected virtual double KilogramsPerCubicCentimeterTolerance { get { return 1e-5; } } protected virtual double KilogramsPerCubicMeterTolerance { get { return 1e-5; } } protected virtual double KilogramsPerCubicMillimeterTolerance { get { return 1e-5; } } protected virtual double KilogramsPerLiterTolerance { get { return 1e-5; } } protected virtual double KilopoundsPerCubicFootTolerance { get { return 1e-5; } } protected virtual double KilopoundsPerCubicInchTolerance { get { return 1e-5; } } protected virtual double MicrogramsPerCubicMeterTolerance { get { return 1e-5; } } protected virtual double MicrogramsPerDeciliterTolerance { get { return 1e-5; } } protected virtual double MicrogramsPerLiterTolerance { get { return 1e-5; } } protected virtual double MicrogramsPerMicroliterTolerance { get { return 1e-5; } } protected virtual double MicrogramsPerMilliliterTolerance { get { return 1e-5; } } protected virtual double MilligramsPerCubicMeterTolerance { get { return 1e-5; } } protected virtual double MilligramsPerDeciliterTolerance { get { return 1e-5; } } protected virtual double MilligramsPerLiterTolerance { get { return 1e-5; } } protected virtual double MilligramsPerMicroliterTolerance { get { return 1e-5; } } protected virtual double MilligramsPerMilliliterTolerance { get { return 1e-5; } } protected virtual double NanogramsPerDeciliterTolerance { get { return 1e-5; } } protected virtual double NanogramsPerLiterTolerance { get { return 1e-5; } } protected virtual double NanogramsPerMicroliterTolerance { get { return 1e-5; } } protected virtual double NanogramsPerMilliliterTolerance { get { return 1e-5; } } protected virtual double OuncesPerImperialGallonTolerance { get { return 1e-5; } } protected virtual double OuncesPerUSGallonTolerance { get { return 1e-5; } } protected virtual double PicogramsPerDeciliterTolerance { get { return 1e-5; } } protected virtual double PicogramsPerLiterTolerance { get { return 1e-5; } } protected virtual double PicogramsPerMicroliterTolerance { get { return 1e-5; } } protected virtual double PicogramsPerMilliliterTolerance { get { return 1e-5; } } protected virtual double PoundsPerCubicFootTolerance { get { return 1e-5; } } protected virtual double PoundsPerCubicInchTolerance { get { return 1e-5; } } protected virtual double PoundsPerImperialGallonTolerance { get { return 1e-5; } } protected virtual double PoundsPerUSGallonTolerance { get { return 1e-5; } } protected virtual double SlugsPerCubicFootTolerance { get { return 1e-5; } } protected virtual double TonnesPerCubicCentimeterTolerance { get { return 1e-5; } } protected virtual double TonnesPerCubicMeterTolerance { get { return 1e-5; } } protected virtual double TonnesPerCubicMillimeterTolerance { get { return 1e-5; } } // ReSharper restore VirtualMemberNeverOverriden.Global [Fact] public void Ctor_WithUndefinedUnit_ThrowsArgumentException() { Assert.Throws<ArgumentException>(() => new MassConcentration((double)0.0, MassConcentrationUnit.Undefined)); } [Fact] public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit() { var quantity = new MassConcentration(); Assert.Equal(0, quantity.Value); Assert.Equal(MassConcentrationUnit.KilogramPerCubicMeter, quantity.Unit); } [Fact] public void Ctor_WithInfinityValue_ThrowsArgumentException() { Assert.Throws<ArgumentException>(() => new MassConcentration(double.PositiveInfinity, MassConcentrationUnit.KilogramPerCubicMeter)); Assert.Throws<ArgumentException>(() => new MassConcentration(double.NegativeInfinity, MassConcentrationUnit.KilogramPerCubicMeter)); } [Fact] public void Ctor_WithNaNValue_ThrowsArgumentException() { Assert.Throws<ArgumentException>(() => new MassConcentration(double.NaN, MassConcentrationUnit.KilogramPerCubicMeter)); } [Fact] public void Ctor_NullAsUnitSystem_ThrowsArgumentNullException() { Assert.Throws<ArgumentNullException>(() => new MassConcentration(value: 1, unitSystem: null)); } [Fact] public void Ctor_SIUnitSystem_ThrowsArgumentExceptionIfNotSupported() { Func<object> TestCode = () => new MassConcentration(value: 1, unitSystem: UnitSystem.SI); if (SupportsSIUnitSystem) { var quantity = (MassConcentration) TestCode(); Assert.Equal(1, quantity.Value); } else { Assert.Throws<ArgumentException>(TestCode); } } [Fact] public void MassConcentration_QuantityInfo_ReturnsQuantityInfoDescribingQuantity() { var quantity = new MassConcentration(1, MassConcentrationUnit.KilogramPerCubicMeter); QuantityInfo<MassConcentrationUnit> quantityInfo = quantity.QuantityInfo; Assert.Equal(MassConcentration.Zero, quantityInfo.Zero); Assert.Equal("MassConcentration", quantityInfo.Name); Assert.Equal(QuantityType.MassConcentration, quantityInfo.QuantityType); var units = EnumUtils.GetEnumValues<MassConcentrationUnit>().Except(new[] {MassConcentrationUnit.Undefined}).ToArray(); var unitNames = units.Select(x => x.ToString()); // Obsolete members Assert.Equal(units, quantityInfo.Units); Assert.Equal(unitNames, quantityInfo.UnitNames); } [Fact] public void KilogramPerCubicMeterToMassConcentrationUnits() { MassConcentration kilogrampercubicmeter = MassConcentration.FromKilogramsPerCubicMeter(1); AssertEx.EqualTolerance(CentigramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.CentigramsPerDeciliter, CentigramsPerDeciliterTolerance); AssertEx.EqualTolerance(CentigramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.CentigramsPerLiter, CentigramsPerLiterTolerance); AssertEx.EqualTolerance(CentigramsPerMicroliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.CentigramsPerMicroliter, CentigramsPerMicroliterTolerance); AssertEx.EqualTolerance(CentigramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.CentigramsPerMilliliter, CentigramsPerMilliliterTolerance); AssertEx.EqualTolerance(DecigramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.DecigramsPerDeciliter, DecigramsPerDeciliterTolerance); AssertEx.EqualTolerance(DecigramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.DecigramsPerLiter, DecigramsPerLiterTolerance); AssertEx.EqualTolerance(DecigramsPerMicroliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.DecigramsPerMicroliter, DecigramsPerMicroliterTolerance); AssertEx.EqualTolerance(DecigramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.DecigramsPerMilliliter, DecigramsPerMilliliterTolerance); AssertEx.EqualTolerance(GramsPerCubicCentimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.GramsPerCubicCentimeter, GramsPerCubicCentimeterTolerance); AssertEx.EqualTolerance(GramsPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.GramsPerCubicMeter, GramsPerCubicMeterTolerance); AssertEx.EqualTolerance(GramsPerCubicMillimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.GramsPerCubicMillimeter, GramsPerCubicMillimeterTolerance); AssertEx.EqualTolerance(GramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.GramsPerDeciliter, GramsPerDeciliterTolerance); AssertEx.EqualTolerance(GramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.GramsPerLiter, GramsPerLiterTolerance); AssertEx.EqualTolerance(GramsPerMicroliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.GramsPerMicroliter, GramsPerMicroliterTolerance); AssertEx.EqualTolerance(GramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.GramsPerMilliliter, GramsPerMilliliterTolerance); AssertEx.EqualTolerance(KilogramsPerCubicCentimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.KilogramsPerCubicCentimeter, KilogramsPerCubicCentimeterTolerance); AssertEx.EqualTolerance(KilogramsPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.KilogramsPerCubicMeter, KilogramsPerCubicMeterTolerance); AssertEx.EqualTolerance(KilogramsPerCubicMillimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.KilogramsPerCubicMillimeter, KilogramsPerCubicMillimeterTolerance); AssertEx.EqualTolerance(KilogramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.KilogramsPerLiter, KilogramsPerLiterTolerance); AssertEx.EqualTolerance(KilopoundsPerCubicFootInOneKilogramPerCubicMeter, kilogrampercubicmeter.KilopoundsPerCubicFoot, KilopoundsPerCubicFootTolerance); AssertEx.EqualTolerance(KilopoundsPerCubicInchInOneKilogramPerCubicMeter, kilogrampercubicmeter.KilopoundsPerCubicInch, KilopoundsPerCubicInchTolerance); AssertEx.EqualTolerance(MicrogramsPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MicrogramsPerCubicMeter, MicrogramsPerCubicMeterTolerance); AssertEx.EqualTolerance(MicrogramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MicrogramsPerDeciliter, MicrogramsPerDeciliterTolerance); AssertEx.EqualTolerance(MicrogramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MicrogramsPerLiter, MicrogramsPerLiterTolerance); AssertEx.EqualTolerance(MicrogramsPerMicroliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MicrogramsPerMicroliter, MicrogramsPerMicroliterTolerance); AssertEx.EqualTolerance(MicrogramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MicrogramsPerMilliliter, MicrogramsPerMilliliterTolerance); AssertEx.EqualTolerance(MilligramsPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MilligramsPerCubicMeter, MilligramsPerCubicMeterTolerance); AssertEx.EqualTolerance(MilligramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MilligramsPerDeciliter, MilligramsPerDeciliterTolerance); AssertEx.EqualTolerance(MilligramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MilligramsPerLiter, MilligramsPerLiterTolerance); AssertEx.EqualTolerance(MilligramsPerMicroliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MilligramsPerMicroliter, MilligramsPerMicroliterTolerance); AssertEx.EqualTolerance(MilligramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MilligramsPerMilliliter, MilligramsPerMilliliterTolerance); AssertEx.EqualTolerance(NanogramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.NanogramsPerDeciliter, NanogramsPerDeciliterTolerance); AssertEx.EqualTolerance(NanogramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.NanogramsPerLiter, NanogramsPerLiterTolerance); AssertEx.EqualTolerance(NanogramsPerMicroliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.NanogramsPerMicroliter, NanogramsPerMicroliterTolerance); AssertEx.EqualTolerance(NanogramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.NanogramsPerMilliliter, NanogramsPerMilliliterTolerance); AssertEx.EqualTolerance(OuncesPerImperialGallonInOneKilogramPerCubicMeter, kilogrampercubicmeter.OuncesPerImperialGallon, OuncesPerImperialGallonTolerance); AssertEx.EqualTolerance(OuncesPerUSGallonInOneKilogramPerCubicMeter, kilogrampercubicmeter.OuncesPerUSGallon, OuncesPerUSGallonTolerance); AssertEx.EqualTolerance(PicogramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.PicogramsPerDeciliter, PicogramsPerDeciliterTolerance); AssertEx.EqualTolerance(PicogramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.PicogramsPerLiter, PicogramsPerLiterTolerance); AssertEx.EqualTolerance(PicogramsPerMicroliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.PicogramsPerMicroliter, PicogramsPerMicroliterTolerance); AssertEx.EqualTolerance(PicogramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.PicogramsPerMilliliter, PicogramsPerMilliliterTolerance); AssertEx.EqualTolerance(PoundsPerCubicFootInOneKilogramPerCubicMeter, kilogrampercubicmeter.PoundsPerCubicFoot, PoundsPerCubicFootTolerance); AssertEx.EqualTolerance(PoundsPerCubicInchInOneKilogramPerCubicMeter, kilogrampercubicmeter.PoundsPerCubicInch, PoundsPerCubicInchTolerance); AssertEx.EqualTolerance(PoundsPerImperialGallonInOneKilogramPerCubicMeter, kilogrampercubicmeter.PoundsPerImperialGallon, PoundsPerImperialGallonTolerance); AssertEx.EqualTolerance(PoundsPerUSGallonInOneKilogramPerCubicMeter, kilogrampercubicmeter.PoundsPerUSGallon, PoundsPerUSGallonTolerance); AssertEx.EqualTolerance(SlugsPerCubicFootInOneKilogramPerCubicMeter, kilogrampercubicmeter.SlugsPerCubicFoot, SlugsPerCubicFootTolerance); AssertEx.EqualTolerance(TonnesPerCubicCentimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.TonnesPerCubicCentimeter, TonnesPerCubicCentimeterTolerance); AssertEx.EqualTolerance(TonnesPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.TonnesPerCubicMeter, TonnesPerCubicMeterTolerance); AssertEx.EqualTolerance(TonnesPerCubicMillimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.TonnesPerCubicMillimeter, TonnesPerCubicMillimeterTolerance); } [Fact] public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit() { var quantity00 = MassConcentration.From(1, MassConcentrationUnit.CentigramPerDeciliter); AssertEx.EqualTolerance(1, quantity00.CentigramsPerDeciliter, CentigramsPerDeciliterTolerance); Assert.Equal(MassConcentrationUnit.CentigramPerDeciliter, quantity00.Unit); var quantity01 = MassConcentration.From(1, MassConcentrationUnit.CentigramPerLiter); AssertEx.EqualTolerance(1, quantity01.CentigramsPerLiter, CentigramsPerLiterTolerance); Assert.Equal(MassConcentrationUnit.CentigramPerLiter, quantity01.Unit); var quantity02 = MassConcentration.From(1, MassConcentrationUnit.CentigramPerMicroliter); AssertEx.EqualTolerance(1, quantity02.CentigramsPerMicroliter, CentigramsPerMicroliterTolerance); Assert.Equal(MassConcentrationUnit.CentigramPerMicroliter, quantity02.Unit); var quantity03 = MassConcentration.From(1, MassConcentrationUnit.CentigramPerMilliliter); AssertEx.EqualTolerance(1, quantity03.CentigramsPerMilliliter, CentigramsPerMilliliterTolerance); Assert.Equal(MassConcentrationUnit.CentigramPerMilliliter, quantity03.Unit); var quantity04 = MassConcentration.From(1, MassConcentrationUnit.DecigramPerDeciliter); AssertEx.EqualTolerance(1, quantity04.DecigramsPerDeciliter, DecigramsPerDeciliterTolerance); Assert.Equal(MassConcentrationUnit.DecigramPerDeciliter, quantity04.Unit); var quantity05 = MassConcentration.From(1, MassConcentrationUnit.DecigramPerLiter); AssertEx.EqualTolerance(1, quantity05.DecigramsPerLiter, DecigramsPerLiterTolerance); Assert.Equal(MassConcentrationUnit.DecigramPerLiter, quantity05.Unit); var quantity06 = MassConcentration.From(1, MassConcentrationUnit.DecigramPerMicroliter); AssertEx.EqualTolerance(1, quantity06.DecigramsPerMicroliter, DecigramsPerMicroliterTolerance); Assert.Equal(MassConcentrationUnit.DecigramPerMicroliter, quantity06.Unit); var quantity07 = MassConcentration.From(1, MassConcentrationUnit.DecigramPerMilliliter); AssertEx.EqualTolerance(1, quantity07.DecigramsPerMilliliter, DecigramsPerMilliliterTolerance); Assert.Equal(MassConcentrationUnit.DecigramPerMilliliter, quantity07.Unit); var quantity08 = MassConcentration.From(1, MassConcentrationUnit.GramPerCubicCentimeter); AssertEx.EqualTolerance(1, quantity08.GramsPerCubicCentimeter, GramsPerCubicCentimeterTolerance); Assert.Equal(MassConcentrationUnit.GramPerCubicCentimeter, quantity08.Unit); var quantity09 = MassConcentration.From(1, MassConcentrationUnit.GramPerCubicMeter); AssertEx.EqualTolerance(1, quantity09.GramsPerCubicMeter, GramsPerCubicMeterTolerance); Assert.Equal(MassConcentrationUnit.GramPerCubicMeter, quantity09.Unit); var quantity10 = MassConcentration.From(1, MassConcentrationUnit.GramPerCubicMillimeter); AssertEx.EqualTolerance(1, quantity10.GramsPerCubicMillimeter, GramsPerCubicMillimeterTolerance); Assert.Equal(MassConcentrationUnit.GramPerCubicMillimeter, quantity10.Unit); var quantity11 = MassConcentration.From(1, MassConcentrationUnit.GramPerDeciliter); AssertEx.EqualTolerance(1, quantity11.GramsPerDeciliter, GramsPerDeciliterTolerance); Assert.Equal(MassConcentrationUnit.GramPerDeciliter, quantity11.Unit); var quantity12 = MassConcentration.From(1, MassConcentrationUnit.GramPerLiter); AssertEx.EqualTolerance(1, quantity12.GramsPerLiter, GramsPerLiterTolerance); Assert.Equal(MassConcentrationUnit.GramPerLiter, quantity12.Unit); var quantity13 = MassConcentration.From(1, MassConcentrationUnit.GramPerMicroliter); AssertEx.EqualTolerance(1, quantity13.GramsPerMicroliter, GramsPerMicroliterTolerance); Assert.Equal(MassConcentrationUnit.GramPerMicroliter, quantity13.Unit); var quantity14 = MassConcentration.From(1, MassConcentrationUnit.GramPerMilliliter); AssertEx.EqualTolerance(1, quantity14.GramsPerMilliliter, GramsPerMilliliterTolerance); Assert.Equal(MassConcentrationUnit.GramPerMilliliter, quantity14.Unit); var quantity15 = MassConcentration.From(1, MassConcentrationUnit.KilogramPerCubicCentimeter); AssertEx.EqualTolerance(1, quantity15.KilogramsPerCubicCentimeter, KilogramsPerCubicCentimeterTolerance); Assert.Equal(MassConcentrationUnit.KilogramPerCubicCentimeter, quantity15.Unit); var quantity16 = MassConcentration.From(1, MassConcentrationUnit.KilogramPerCubicMeter); AssertEx.EqualTolerance(1, quantity16.KilogramsPerCubicMeter, KilogramsPerCubicMeterTolerance); Assert.Equal(MassConcentrationUnit.KilogramPerCubicMeter, quantity16.Unit); var quantity17 = MassConcentration.From(1, MassConcentrationUnit.KilogramPerCubicMillimeter); AssertEx.EqualTolerance(1, quantity17.KilogramsPerCubicMillimeter, KilogramsPerCubicMillimeterTolerance); Assert.Equal(MassConcentrationUnit.KilogramPerCubicMillimeter, quantity17.Unit); var quantity18 = MassConcentration.From(1, MassConcentrationUnit.KilogramPerLiter); AssertEx.EqualTolerance(1, quantity18.KilogramsPerLiter, KilogramsPerLiterTolerance); Assert.Equal(MassConcentrationUnit.KilogramPerLiter, quantity18.Unit); var quantity19 = MassConcentration.From(1, MassConcentrationUnit.KilopoundPerCubicFoot); AssertEx.EqualTolerance(1, quantity19.KilopoundsPerCubicFoot, KilopoundsPerCubicFootTolerance); Assert.Equal(MassConcentrationUnit.KilopoundPerCubicFoot, quantity19.Unit); var quantity20 = MassConcentration.From(1, MassConcentrationUnit.KilopoundPerCubicInch); AssertEx.EqualTolerance(1, quantity20.KilopoundsPerCubicInch, KilopoundsPerCubicInchTolerance); Assert.Equal(MassConcentrationUnit.KilopoundPerCubicInch, quantity20.Unit); var quantity21 = MassConcentration.From(1, MassConcentrationUnit.MicrogramPerCubicMeter); AssertEx.EqualTolerance(1, quantity21.MicrogramsPerCubicMeter, MicrogramsPerCubicMeterTolerance); Assert.Equal(MassConcentrationUnit.MicrogramPerCubicMeter, quantity21.Unit); var quantity22 = MassConcentration.From(1, MassConcentrationUnit.MicrogramPerDeciliter); AssertEx.EqualTolerance(1, quantity22.MicrogramsPerDeciliter, MicrogramsPerDeciliterTolerance); Assert.Equal(MassConcentrationUnit.MicrogramPerDeciliter, quantity22.Unit); var quantity23 = MassConcentration.From(1, MassConcentrationUnit.MicrogramPerLiter); AssertEx.EqualTolerance(1, quantity23.MicrogramsPerLiter, MicrogramsPerLiterTolerance); Assert.Equal(MassConcentrationUnit.MicrogramPerLiter, quantity23.Unit); var quantity24 = MassConcentration.From(1, MassConcentrationUnit.MicrogramPerMicroliter); AssertEx.EqualTolerance(1, quantity24.MicrogramsPerMicroliter, MicrogramsPerMicroliterTolerance); Assert.Equal(MassConcentrationUnit.MicrogramPerMicroliter, quantity24.Unit); var quantity25 = MassConcentration.From(1, MassConcentrationUnit.MicrogramPerMilliliter); AssertEx.EqualTolerance(1, quantity25.MicrogramsPerMilliliter, MicrogramsPerMilliliterTolerance); Assert.Equal(MassConcentrationUnit.MicrogramPerMilliliter, quantity25.Unit); var quantity26 = MassConcentration.From(1, MassConcentrationUnit.MilligramPerCubicMeter); AssertEx.EqualTolerance(1, quantity26.MilligramsPerCubicMeter, MilligramsPerCubicMeterTolerance); Assert.Equal(MassConcentrationUnit.MilligramPerCubicMeter, quantity26.Unit); var quantity27 = MassConcentration.From(1, MassConcentrationUnit.MilligramPerDeciliter); AssertEx.EqualTolerance(1, quantity27.MilligramsPerDeciliter, MilligramsPerDeciliterTolerance); Assert.Equal(MassConcentrationUnit.MilligramPerDeciliter, quantity27.Unit); var quantity28 = MassConcentration.From(1, MassConcentrationUnit.MilligramPerLiter); AssertEx.EqualTolerance(1, quantity28.MilligramsPerLiter, MilligramsPerLiterTolerance); Assert.Equal(MassConcentrationUnit.MilligramPerLiter, quantity28.Unit); var quantity29 = MassConcentration.From(1, MassConcentrationUnit.MilligramPerMicroliter); AssertEx.EqualTolerance(1, quantity29.MilligramsPerMicroliter, MilligramsPerMicroliterTolerance); Assert.Equal(MassConcentrationUnit.MilligramPerMicroliter, quantity29.Unit); var quantity30 = MassConcentration.From(1, MassConcentrationUnit.MilligramPerMilliliter); AssertEx.EqualTolerance(1, quantity30.MilligramsPerMilliliter, MilligramsPerMilliliterTolerance); Assert.Equal(MassConcentrationUnit.MilligramPerMilliliter, quantity30.Unit); var quantity31 = MassConcentration.From(1, MassConcentrationUnit.NanogramPerDeciliter); AssertEx.EqualTolerance(1, quantity31.NanogramsPerDeciliter, NanogramsPerDeciliterTolerance); Assert.Equal(MassConcentrationUnit.NanogramPerDeciliter, quantity31.Unit); var quantity32 = MassConcentration.From(1, MassConcentrationUnit.NanogramPerLiter); AssertEx.EqualTolerance(1, quantity32.NanogramsPerLiter, NanogramsPerLiterTolerance); Assert.Equal(MassConcentrationUnit.NanogramPerLiter, quantity32.Unit); var quantity33 = MassConcentration.From(1, MassConcentrationUnit.NanogramPerMicroliter); AssertEx.EqualTolerance(1, quantity33.NanogramsPerMicroliter, NanogramsPerMicroliterTolerance); Assert.Equal(MassConcentrationUnit.NanogramPerMicroliter, quantity33.Unit); var quantity34 = MassConcentration.From(1, MassConcentrationUnit.NanogramPerMilliliter); AssertEx.EqualTolerance(1, quantity34.NanogramsPerMilliliter, NanogramsPerMilliliterTolerance); Assert.Equal(MassConcentrationUnit.NanogramPerMilliliter, quantity34.Unit); var quantity35 = MassConcentration.From(1, MassConcentrationUnit.OuncePerImperialGallon); AssertEx.EqualTolerance(1, quantity35.OuncesPerImperialGallon, OuncesPerImperialGallonTolerance); Assert.Equal(MassConcentrationUnit.OuncePerImperialGallon, quantity35.Unit); var quantity36 = MassConcentration.From(1, MassConcentrationUnit.OuncePerUSGallon); AssertEx.EqualTolerance(1, quantity36.OuncesPerUSGallon, OuncesPerUSGallonTolerance); Assert.Equal(MassConcentrationUnit.OuncePerUSGallon, quantity36.Unit); var quantity37 = MassConcentration.From(1, MassConcentrationUnit.PicogramPerDeciliter); AssertEx.EqualTolerance(1, quantity37.PicogramsPerDeciliter, PicogramsPerDeciliterTolerance); Assert.Equal(MassConcentrationUnit.PicogramPerDeciliter, quantity37.Unit); var quantity38 = MassConcentration.From(1, MassConcentrationUnit.PicogramPerLiter); AssertEx.EqualTolerance(1, quantity38.PicogramsPerLiter, PicogramsPerLiterTolerance); Assert.Equal(MassConcentrationUnit.PicogramPerLiter, quantity38.Unit); var quantity39 = MassConcentration.From(1, MassConcentrationUnit.PicogramPerMicroliter); AssertEx.EqualTolerance(1, quantity39.PicogramsPerMicroliter, PicogramsPerMicroliterTolerance); Assert.Equal(MassConcentrationUnit.PicogramPerMicroliter, quantity39.Unit); var quantity40 = MassConcentration.From(1, MassConcentrationUnit.PicogramPerMilliliter); AssertEx.EqualTolerance(1, quantity40.PicogramsPerMilliliter, PicogramsPerMilliliterTolerance); Assert.Equal(MassConcentrationUnit.PicogramPerMilliliter, quantity40.Unit); var quantity41 = MassConcentration.From(1, MassConcentrationUnit.PoundPerCubicFoot); AssertEx.EqualTolerance(1, quantity41.PoundsPerCubicFoot, PoundsPerCubicFootTolerance); Assert.Equal(MassConcentrationUnit.PoundPerCubicFoot, quantity41.Unit); var quantity42 = MassConcentration.From(1, MassConcentrationUnit.PoundPerCubicInch); AssertEx.EqualTolerance(1, quantity42.PoundsPerCubicInch, PoundsPerCubicInchTolerance); Assert.Equal(MassConcentrationUnit.PoundPerCubicInch, quantity42.Unit); var quantity43 = MassConcentration.From(1, MassConcentrationUnit.PoundPerImperialGallon); AssertEx.EqualTolerance(1, quantity43.PoundsPerImperialGallon, PoundsPerImperialGallonTolerance); Assert.Equal(MassConcentrationUnit.PoundPerImperialGallon, quantity43.Unit); var quantity44 = MassConcentration.From(1, MassConcentrationUnit.PoundPerUSGallon); AssertEx.EqualTolerance(1, quantity44.PoundsPerUSGallon, PoundsPerUSGallonTolerance); Assert.Equal(MassConcentrationUnit.PoundPerUSGallon, quantity44.Unit); var quantity45 = MassConcentration.From(1, MassConcentrationUnit.SlugPerCubicFoot); AssertEx.EqualTolerance(1, quantity45.SlugsPerCubicFoot, SlugsPerCubicFootTolerance); Assert.Equal(MassConcentrationUnit.SlugPerCubicFoot, quantity45.Unit); var quantity46 = MassConcentration.From(1, MassConcentrationUnit.TonnePerCubicCentimeter); AssertEx.EqualTolerance(1, quantity46.TonnesPerCubicCentimeter, TonnesPerCubicCentimeterTolerance); Assert.Equal(MassConcentrationUnit.TonnePerCubicCentimeter, quantity46.Unit); var quantity47 = MassConcentration.From(1, MassConcentrationUnit.TonnePerCubicMeter); AssertEx.EqualTolerance(1, quantity47.TonnesPerCubicMeter, TonnesPerCubicMeterTolerance); Assert.Equal(MassConcentrationUnit.TonnePerCubicMeter, quantity47.Unit); var quantity48 = MassConcentration.From(1, MassConcentrationUnit.TonnePerCubicMillimeter); AssertEx.EqualTolerance(1, quantity48.TonnesPerCubicMillimeter, TonnesPerCubicMillimeterTolerance); Assert.Equal(MassConcentrationUnit.TonnePerCubicMillimeter, quantity48.Unit); } [Fact] public void FromKilogramsPerCubicMeter_WithInfinityValue_ThrowsArgumentException() { Assert.Throws<ArgumentException>(() => MassConcentration.FromKilogramsPerCubicMeter(double.PositiveInfinity)); Assert.Throws<ArgumentException>(() => MassConcentration.FromKilogramsPerCubicMeter(double.NegativeInfinity)); } [Fact] public void FromKilogramsPerCubicMeter_WithNanValue_ThrowsArgumentException() { Assert.Throws<ArgumentException>(() => MassConcentration.FromKilogramsPerCubicMeter(double.NaN)); } [Fact] public void As() { var kilogrampercubicmeter = MassConcentration.FromKilogramsPerCubicMeter(1); AssertEx.EqualTolerance(CentigramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.CentigramPerDeciliter), CentigramsPerDeciliterTolerance); AssertEx.EqualTolerance(CentigramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.CentigramPerLiter), CentigramsPerLiterTolerance); AssertEx.EqualTolerance(CentigramsPerMicroliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.CentigramPerMicroliter), CentigramsPerMicroliterTolerance); AssertEx.EqualTolerance(CentigramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.CentigramPerMilliliter), CentigramsPerMilliliterTolerance); AssertEx.EqualTolerance(DecigramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.DecigramPerDeciliter), DecigramsPerDeciliterTolerance); AssertEx.EqualTolerance(DecigramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.DecigramPerLiter), DecigramsPerLiterTolerance); AssertEx.EqualTolerance(DecigramsPerMicroliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.DecigramPerMicroliter), DecigramsPerMicroliterTolerance); AssertEx.EqualTolerance(DecigramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.DecigramPerMilliliter), DecigramsPerMilliliterTolerance); AssertEx.EqualTolerance(GramsPerCubicCentimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.GramPerCubicCentimeter), GramsPerCubicCentimeterTolerance); AssertEx.EqualTolerance(GramsPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.GramPerCubicMeter), GramsPerCubicMeterTolerance); AssertEx.EqualTolerance(GramsPerCubicMillimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.GramPerCubicMillimeter), GramsPerCubicMillimeterTolerance); AssertEx.EqualTolerance(GramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.GramPerDeciliter), GramsPerDeciliterTolerance); AssertEx.EqualTolerance(GramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.GramPerLiter), GramsPerLiterTolerance); AssertEx.EqualTolerance(GramsPerMicroliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.GramPerMicroliter), GramsPerMicroliterTolerance); AssertEx.EqualTolerance(GramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.GramPerMilliliter), GramsPerMilliliterTolerance); AssertEx.EqualTolerance(KilogramsPerCubicCentimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.KilogramPerCubicCentimeter), KilogramsPerCubicCentimeterTolerance); AssertEx.EqualTolerance(KilogramsPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.KilogramPerCubicMeter), KilogramsPerCubicMeterTolerance); AssertEx.EqualTolerance(KilogramsPerCubicMillimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.KilogramPerCubicMillimeter), KilogramsPerCubicMillimeterTolerance); AssertEx.EqualTolerance(KilogramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.KilogramPerLiter), KilogramsPerLiterTolerance); AssertEx.EqualTolerance(KilopoundsPerCubicFootInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.KilopoundPerCubicFoot), KilopoundsPerCubicFootTolerance); AssertEx.EqualTolerance(KilopoundsPerCubicInchInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.KilopoundPerCubicInch), KilopoundsPerCubicInchTolerance); AssertEx.EqualTolerance(MicrogramsPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.MicrogramPerCubicMeter), MicrogramsPerCubicMeterTolerance); AssertEx.EqualTolerance(MicrogramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.MicrogramPerDeciliter), MicrogramsPerDeciliterTolerance); AssertEx.EqualTolerance(MicrogramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.MicrogramPerLiter), MicrogramsPerLiterTolerance); AssertEx.EqualTolerance(MicrogramsPerMicroliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.MicrogramPerMicroliter), MicrogramsPerMicroliterTolerance); AssertEx.EqualTolerance(MicrogramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.MicrogramPerMilliliter), MicrogramsPerMilliliterTolerance); AssertEx.EqualTolerance(MilligramsPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.MilligramPerCubicMeter), MilligramsPerCubicMeterTolerance); AssertEx.EqualTolerance(MilligramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.MilligramPerDeciliter), MilligramsPerDeciliterTolerance); AssertEx.EqualTolerance(MilligramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.MilligramPerLiter), MilligramsPerLiterTolerance); AssertEx.EqualTolerance(MilligramsPerMicroliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.MilligramPerMicroliter), MilligramsPerMicroliterTolerance); AssertEx.EqualTolerance(MilligramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.MilligramPerMilliliter), MilligramsPerMilliliterTolerance); AssertEx.EqualTolerance(NanogramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.NanogramPerDeciliter), NanogramsPerDeciliterTolerance); AssertEx.EqualTolerance(NanogramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.NanogramPerLiter), NanogramsPerLiterTolerance); AssertEx.EqualTolerance(NanogramsPerMicroliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.NanogramPerMicroliter), NanogramsPerMicroliterTolerance); AssertEx.EqualTolerance(NanogramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.NanogramPerMilliliter), NanogramsPerMilliliterTolerance); AssertEx.EqualTolerance(OuncesPerImperialGallonInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.OuncePerImperialGallon), OuncesPerImperialGallonTolerance); AssertEx.EqualTolerance(OuncesPerUSGallonInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.OuncePerUSGallon), OuncesPerUSGallonTolerance); AssertEx.EqualTolerance(PicogramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.PicogramPerDeciliter), PicogramsPerDeciliterTolerance); AssertEx.EqualTolerance(PicogramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.PicogramPerLiter), PicogramsPerLiterTolerance); AssertEx.EqualTolerance(PicogramsPerMicroliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.PicogramPerMicroliter), PicogramsPerMicroliterTolerance); AssertEx.EqualTolerance(PicogramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.PicogramPerMilliliter), PicogramsPerMilliliterTolerance); AssertEx.EqualTolerance(PoundsPerCubicFootInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.PoundPerCubicFoot), PoundsPerCubicFootTolerance); AssertEx.EqualTolerance(PoundsPerCubicInchInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.PoundPerCubicInch), PoundsPerCubicInchTolerance); AssertEx.EqualTolerance(PoundsPerImperialGallonInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.PoundPerImperialGallon), PoundsPerImperialGallonTolerance); AssertEx.EqualTolerance(PoundsPerUSGallonInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.PoundPerUSGallon), PoundsPerUSGallonTolerance); AssertEx.EqualTolerance(SlugsPerCubicFootInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.SlugPerCubicFoot), SlugsPerCubicFootTolerance); AssertEx.EqualTolerance(TonnesPerCubicCentimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.TonnePerCubicCentimeter), TonnesPerCubicCentimeterTolerance); AssertEx.EqualTolerance(TonnesPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.TonnePerCubicMeter), TonnesPerCubicMeterTolerance); AssertEx.EqualTolerance(TonnesPerCubicMillimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(MassConcentrationUnit.TonnePerCubicMillimeter), TonnesPerCubicMillimeterTolerance); } [Fact] public void As_SIUnitSystem_ThrowsArgumentExceptionIfNotSupported() { var quantity = new MassConcentration(value: 1, unit: MassConcentration.BaseUnit); Func<object> AsWithSIUnitSystem = () => quantity.As(UnitSystem.SI); if (SupportsSIUnitSystem) { var value = (double) AsWithSIUnitSystem(); Assert.Equal(1, value); } else { Assert.Throws<ArgumentException>(AsWithSIUnitSystem); } } [Fact] public void ToUnit() { var kilogrampercubicmeter = MassConcentration.FromKilogramsPerCubicMeter(1); var centigramperdeciliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.CentigramPerDeciliter); AssertEx.EqualTolerance(CentigramsPerDeciliterInOneKilogramPerCubicMeter, (double)centigramperdeciliterQuantity.Value, CentigramsPerDeciliterTolerance); Assert.Equal(MassConcentrationUnit.CentigramPerDeciliter, centigramperdeciliterQuantity.Unit); var centigramperliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.CentigramPerLiter); AssertEx.EqualTolerance(CentigramsPerLiterInOneKilogramPerCubicMeter, (double)centigramperliterQuantity.Value, CentigramsPerLiterTolerance); Assert.Equal(MassConcentrationUnit.CentigramPerLiter, centigramperliterQuantity.Unit); var centigrampermicroliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.CentigramPerMicroliter); AssertEx.EqualTolerance(CentigramsPerMicroliterInOneKilogramPerCubicMeter, (double)centigrampermicroliterQuantity.Value, CentigramsPerMicroliterTolerance); Assert.Equal(MassConcentrationUnit.CentigramPerMicroliter, centigrampermicroliterQuantity.Unit); var centigrampermilliliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.CentigramPerMilliliter); AssertEx.EqualTolerance(CentigramsPerMilliliterInOneKilogramPerCubicMeter, (double)centigrampermilliliterQuantity.Value, CentigramsPerMilliliterTolerance); Assert.Equal(MassConcentrationUnit.CentigramPerMilliliter, centigrampermilliliterQuantity.Unit); var decigramperdeciliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.DecigramPerDeciliter); AssertEx.EqualTolerance(DecigramsPerDeciliterInOneKilogramPerCubicMeter, (double)decigramperdeciliterQuantity.Value, DecigramsPerDeciliterTolerance); Assert.Equal(MassConcentrationUnit.DecigramPerDeciliter, decigramperdeciliterQuantity.Unit); var decigramperliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.DecigramPerLiter); AssertEx.EqualTolerance(DecigramsPerLiterInOneKilogramPerCubicMeter, (double)decigramperliterQuantity.Value, DecigramsPerLiterTolerance); Assert.Equal(MassConcentrationUnit.DecigramPerLiter, decigramperliterQuantity.Unit); var decigrampermicroliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.DecigramPerMicroliter); AssertEx.EqualTolerance(DecigramsPerMicroliterInOneKilogramPerCubicMeter, (double)decigrampermicroliterQuantity.Value, DecigramsPerMicroliterTolerance); Assert.Equal(MassConcentrationUnit.DecigramPerMicroliter, decigrampermicroliterQuantity.Unit); var decigrampermilliliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.DecigramPerMilliliter); AssertEx.EqualTolerance(DecigramsPerMilliliterInOneKilogramPerCubicMeter, (double)decigrampermilliliterQuantity.Value, DecigramsPerMilliliterTolerance); Assert.Equal(MassConcentrationUnit.DecigramPerMilliliter, decigrampermilliliterQuantity.Unit); var grampercubiccentimeterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.GramPerCubicCentimeter); AssertEx.EqualTolerance(GramsPerCubicCentimeterInOneKilogramPerCubicMeter, (double)grampercubiccentimeterQuantity.Value, GramsPerCubicCentimeterTolerance); Assert.Equal(MassConcentrationUnit.GramPerCubicCentimeter, grampercubiccentimeterQuantity.Unit); var grampercubicmeterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.GramPerCubicMeter); AssertEx.EqualTolerance(GramsPerCubicMeterInOneKilogramPerCubicMeter, (double)grampercubicmeterQuantity.Value, GramsPerCubicMeterTolerance); Assert.Equal(MassConcentrationUnit.GramPerCubicMeter, grampercubicmeterQuantity.Unit); var grampercubicmillimeterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.GramPerCubicMillimeter); AssertEx.EqualTolerance(GramsPerCubicMillimeterInOneKilogramPerCubicMeter, (double)grampercubicmillimeterQuantity.Value, GramsPerCubicMillimeterTolerance); Assert.Equal(MassConcentrationUnit.GramPerCubicMillimeter, grampercubicmillimeterQuantity.Unit); var gramperdeciliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.GramPerDeciliter); AssertEx.EqualTolerance(GramsPerDeciliterInOneKilogramPerCubicMeter, (double)gramperdeciliterQuantity.Value, GramsPerDeciliterTolerance); Assert.Equal(MassConcentrationUnit.GramPerDeciliter, gramperdeciliterQuantity.Unit); var gramperliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.GramPerLiter); AssertEx.EqualTolerance(GramsPerLiterInOneKilogramPerCubicMeter, (double)gramperliterQuantity.Value, GramsPerLiterTolerance); Assert.Equal(MassConcentrationUnit.GramPerLiter, gramperliterQuantity.Unit); var grampermicroliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.GramPerMicroliter); AssertEx.EqualTolerance(GramsPerMicroliterInOneKilogramPerCubicMeter, (double)grampermicroliterQuantity.Value, GramsPerMicroliterTolerance); Assert.Equal(MassConcentrationUnit.GramPerMicroliter, grampermicroliterQuantity.Unit); var grampermilliliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.GramPerMilliliter); AssertEx.EqualTolerance(GramsPerMilliliterInOneKilogramPerCubicMeter, (double)grampermilliliterQuantity.Value, GramsPerMilliliterTolerance); Assert.Equal(MassConcentrationUnit.GramPerMilliliter, grampermilliliterQuantity.Unit); var kilogrampercubiccentimeterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.KilogramPerCubicCentimeter); AssertEx.EqualTolerance(KilogramsPerCubicCentimeterInOneKilogramPerCubicMeter, (double)kilogrampercubiccentimeterQuantity.Value, KilogramsPerCubicCentimeterTolerance); Assert.Equal(MassConcentrationUnit.KilogramPerCubicCentimeter, kilogrampercubiccentimeterQuantity.Unit); var kilogrampercubicmeterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.KilogramPerCubicMeter); AssertEx.EqualTolerance(KilogramsPerCubicMeterInOneKilogramPerCubicMeter, (double)kilogrampercubicmeterQuantity.Value, KilogramsPerCubicMeterTolerance); Assert.Equal(MassConcentrationUnit.KilogramPerCubicMeter, kilogrampercubicmeterQuantity.Unit); var kilogrampercubicmillimeterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.KilogramPerCubicMillimeter); AssertEx.EqualTolerance(KilogramsPerCubicMillimeterInOneKilogramPerCubicMeter, (double)kilogrampercubicmillimeterQuantity.Value, KilogramsPerCubicMillimeterTolerance); Assert.Equal(MassConcentrationUnit.KilogramPerCubicMillimeter, kilogrampercubicmillimeterQuantity.Unit); var kilogramperliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.KilogramPerLiter); AssertEx.EqualTolerance(KilogramsPerLiterInOneKilogramPerCubicMeter, (double)kilogramperliterQuantity.Value, KilogramsPerLiterTolerance); Assert.Equal(MassConcentrationUnit.KilogramPerLiter, kilogramperliterQuantity.Unit); var kilopoundpercubicfootQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.KilopoundPerCubicFoot); AssertEx.EqualTolerance(KilopoundsPerCubicFootInOneKilogramPerCubicMeter, (double)kilopoundpercubicfootQuantity.Value, KilopoundsPerCubicFootTolerance); Assert.Equal(MassConcentrationUnit.KilopoundPerCubicFoot, kilopoundpercubicfootQuantity.Unit); var kilopoundpercubicinchQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.KilopoundPerCubicInch); AssertEx.EqualTolerance(KilopoundsPerCubicInchInOneKilogramPerCubicMeter, (double)kilopoundpercubicinchQuantity.Value, KilopoundsPerCubicInchTolerance); Assert.Equal(MassConcentrationUnit.KilopoundPerCubicInch, kilopoundpercubicinchQuantity.Unit); var microgrampercubicmeterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.MicrogramPerCubicMeter); AssertEx.EqualTolerance(MicrogramsPerCubicMeterInOneKilogramPerCubicMeter, (double)microgrampercubicmeterQuantity.Value, MicrogramsPerCubicMeterTolerance); Assert.Equal(MassConcentrationUnit.MicrogramPerCubicMeter, microgrampercubicmeterQuantity.Unit); var microgramperdeciliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.MicrogramPerDeciliter); AssertEx.EqualTolerance(MicrogramsPerDeciliterInOneKilogramPerCubicMeter, (double)microgramperdeciliterQuantity.Value, MicrogramsPerDeciliterTolerance); Assert.Equal(MassConcentrationUnit.MicrogramPerDeciliter, microgramperdeciliterQuantity.Unit); var microgramperliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.MicrogramPerLiter); AssertEx.EqualTolerance(MicrogramsPerLiterInOneKilogramPerCubicMeter, (double)microgramperliterQuantity.Value, MicrogramsPerLiterTolerance); Assert.Equal(MassConcentrationUnit.MicrogramPerLiter, microgramperliterQuantity.Unit); var microgrampermicroliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.MicrogramPerMicroliter); AssertEx.EqualTolerance(MicrogramsPerMicroliterInOneKilogramPerCubicMeter, (double)microgrampermicroliterQuantity.Value, MicrogramsPerMicroliterTolerance); Assert.Equal(MassConcentrationUnit.MicrogramPerMicroliter, microgrampermicroliterQuantity.Unit); var microgrampermilliliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.MicrogramPerMilliliter); AssertEx.EqualTolerance(MicrogramsPerMilliliterInOneKilogramPerCubicMeter, (double)microgrampermilliliterQuantity.Value, MicrogramsPerMilliliterTolerance); Assert.Equal(MassConcentrationUnit.MicrogramPerMilliliter, microgrampermilliliterQuantity.Unit); var milligrampercubicmeterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.MilligramPerCubicMeter); AssertEx.EqualTolerance(MilligramsPerCubicMeterInOneKilogramPerCubicMeter, (double)milligrampercubicmeterQuantity.Value, MilligramsPerCubicMeterTolerance); Assert.Equal(MassConcentrationUnit.MilligramPerCubicMeter, milligrampercubicmeterQuantity.Unit); var milligramperdeciliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.MilligramPerDeciliter); AssertEx.EqualTolerance(MilligramsPerDeciliterInOneKilogramPerCubicMeter, (double)milligramperdeciliterQuantity.Value, MilligramsPerDeciliterTolerance); Assert.Equal(MassConcentrationUnit.MilligramPerDeciliter, milligramperdeciliterQuantity.Unit); var milligramperliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.MilligramPerLiter); AssertEx.EqualTolerance(MilligramsPerLiterInOneKilogramPerCubicMeter, (double)milligramperliterQuantity.Value, MilligramsPerLiterTolerance); Assert.Equal(MassConcentrationUnit.MilligramPerLiter, milligramperliterQuantity.Unit); var milligrampermicroliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.MilligramPerMicroliter); AssertEx.EqualTolerance(MilligramsPerMicroliterInOneKilogramPerCubicMeter, (double)milligrampermicroliterQuantity.Value, MilligramsPerMicroliterTolerance); Assert.Equal(MassConcentrationUnit.MilligramPerMicroliter, milligrampermicroliterQuantity.Unit); var milligrampermilliliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.MilligramPerMilliliter); AssertEx.EqualTolerance(MilligramsPerMilliliterInOneKilogramPerCubicMeter, (double)milligrampermilliliterQuantity.Value, MilligramsPerMilliliterTolerance); Assert.Equal(MassConcentrationUnit.MilligramPerMilliliter, milligrampermilliliterQuantity.Unit); var nanogramperdeciliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.NanogramPerDeciliter); AssertEx.EqualTolerance(NanogramsPerDeciliterInOneKilogramPerCubicMeter, (double)nanogramperdeciliterQuantity.Value, NanogramsPerDeciliterTolerance); Assert.Equal(MassConcentrationUnit.NanogramPerDeciliter, nanogramperdeciliterQuantity.Unit); var nanogramperliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.NanogramPerLiter); AssertEx.EqualTolerance(NanogramsPerLiterInOneKilogramPerCubicMeter, (double)nanogramperliterQuantity.Value, NanogramsPerLiterTolerance); Assert.Equal(MassConcentrationUnit.NanogramPerLiter, nanogramperliterQuantity.Unit); var nanogrampermicroliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.NanogramPerMicroliter); AssertEx.EqualTolerance(NanogramsPerMicroliterInOneKilogramPerCubicMeter, (double)nanogrampermicroliterQuantity.Value, NanogramsPerMicroliterTolerance); Assert.Equal(MassConcentrationUnit.NanogramPerMicroliter, nanogrampermicroliterQuantity.Unit); var nanogrampermilliliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.NanogramPerMilliliter); AssertEx.EqualTolerance(NanogramsPerMilliliterInOneKilogramPerCubicMeter, (double)nanogrampermilliliterQuantity.Value, NanogramsPerMilliliterTolerance); Assert.Equal(MassConcentrationUnit.NanogramPerMilliliter, nanogrampermilliliterQuantity.Unit); var ounceperimperialgallonQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.OuncePerImperialGallon); AssertEx.EqualTolerance(OuncesPerImperialGallonInOneKilogramPerCubicMeter, (double)ounceperimperialgallonQuantity.Value, OuncesPerImperialGallonTolerance); Assert.Equal(MassConcentrationUnit.OuncePerImperialGallon, ounceperimperialgallonQuantity.Unit); var ounceperusgallonQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.OuncePerUSGallon); AssertEx.EqualTolerance(OuncesPerUSGallonInOneKilogramPerCubicMeter, (double)ounceperusgallonQuantity.Value, OuncesPerUSGallonTolerance); Assert.Equal(MassConcentrationUnit.OuncePerUSGallon, ounceperusgallonQuantity.Unit); var picogramperdeciliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.PicogramPerDeciliter); AssertEx.EqualTolerance(PicogramsPerDeciliterInOneKilogramPerCubicMeter, (double)picogramperdeciliterQuantity.Value, PicogramsPerDeciliterTolerance); Assert.Equal(MassConcentrationUnit.PicogramPerDeciliter, picogramperdeciliterQuantity.Unit); var picogramperliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.PicogramPerLiter); AssertEx.EqualTolerance(PicogramsPerLiterInOneKilogramPerCubicMeter, (double)picogramperliterQuantity.Value, PicogramsPerLiterTolerance); Assert.Equal(MassConcentrationUnit.PicogramPerLiter, picogramperliterQuantity.Unit); var picogrampermicroliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.PicogramPerMicroliter); AssertEx.EqualTolerance(PicogramsPerMicroliterInOneKilogramPerCubicMeter, (double)picogrampermicroliterQuantity.Value, PicogramsPerMicroliterTolerance); Assert.Equal(MassConcentrationUnit.PicogramPerMicroliter, picogrampermicroliterQuantity.Unit); var picogrampermilliliterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.PicogramPerMilliliter); AssertEx.EqualTolerance(PicogramsPerMilliliterInOneKilogramPerCubicMeter, (double)picogrampermilliliterQuantity.Value, PicogramsPerMilliliterTolerance); Assert.Equal(MassConcentrationUnit.PicogramPerMilliliter, picogrampermilliliterQuantity.Unit); var poundpercubicfootQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.PoundPerCubicFoot); AssertEx.EqualTolerance(PoundsPerCubicFootInOneKilogramPerCubicMeter, (double)poundpercubicfootQuantity.Value, PoundsPerCubicFootTolerance); Assert.Equal(MassConcentrationUnit.PoundPerCubicFoot, poundpercubicfootQuantity.Unit); var poundpercubicinchQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.PoundPerCubicInch); AssertEx.EqualTolerance(PoundsPerCubicInchInOneKilogramPerCubicMeter, (double)poundpercubicinchQuantity.Value, PoundsPerCubicInchTolerance); Assert.Equal(MassConcentrationUnit.PoundPerCubicInch, poundpercubicinchQuantity.Unit); var poundperimperialgallonQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.PoundPerImperialGallon); AssertEx.EqualTolerance(PoundsPerImperialGallonInOneKilogramPerCubicMeter, (double)poundperimperialgallonQuantity.Value, PoundsPerImperialGallonTolerance); Assert.Equal(MassConcentrationUnit.PoundPerImperialGallon, poundperimperialgallonQuantity.Unit); var poundperusgallonQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.PoundPerUSGallon); AssertEx.EqualTolerance(PoundsPerUSGallonInOneKilogramPerCubicMeter, (double)poundperusgallonQuantity.Value, PoundsPerUSGallonTolerance); Assert.Equal(MassConcentrationUnit.PoundPerUSGallon, poundperusgallonQuantity.Unit); var slugpercubicfootQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.SlugPerCubicFoot); AssertEx.EqualTolerance(SlugsPerCubicFootInOneKilogramPerCubicMeter, (double)slugpercubicfootQuantity.Value, SlugsPerCubicFootTolerance); Assert.Equal(MassConcentrationUnit.SlugPerCubicFoot, slugpercubicfootQuantity.Unit); var tonnepercubiccentimeterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.TonnePerCubicCentimeter); AssertEx.EqualTolerance(TonnesPerCubicCentimeterInOneKilogramPerCubicMeter, (double)tonnepercubiccentimeterQuantity.Value, TonnesPerCubicCentimeterTolerance); Assert.Equal(MassConcentrationUnit.TonnePerCubicCentimeter, tonnepercubiccentimeterQuantity.Unit); var tonnepercubicmeterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.TonnePerCubicMeter); AssertEx.EqualTolerance(TonnesPerCubicMeterInOneKilogramPerCubicMeter, (double)tonnepercubicmeterQuantity.Value, TonnesPerCubicMeterTolerance); Assert.Equal(MassConcentrationUnit.TonnePerCubicMeter, tonnepercubicmeterQuantity.Unit); var tonnepercubicmillimeterQuantity = kilogrampercubicmeter.ToUnit(MassConcentrationUnit.TonnePerCubicMillimeter); AssertEx.EqualTolerance(TonnesPerCubicMillimeterInOneKilogramPerCubicMeter, (double)tonnepercubicmillimeterQuantity.Value, TonnesPerCubicMillimeterTolerance); Assert.Equal(MassConcentrationUnit.TonnePerCubicMillimeter, tonnepercubicmillimeterQuantity.Unit); } [Fact] public void ToBaseUnit_ReturnsQuantityWithBaseUnit() { var quantityInBaseUnit = MassConcentration.FromKilogramsPerCubicMeter(1).ToBaseUnit(); Assert.Equal(MassConcentration.BaseUnit, quantityInBaseUnit.Unit); } [Fact] public void ConversionRoundTrip() { MassConcentration kilogrampercubicmeter = MassConcentration.FromKilogramsPerCubicMeter(1); AssertEx.EqualTolerance(1, MassConcentration.FromCentigramsPerDeciliter(kilogrampercubicmeter.CentigramsPerDeciliter).KilogramsPerCubicMeter, CentigramsPerDeciliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromCentigramsPerLiter(kilogrampercubicmeter.CentigramsPerLiter).KilogramsPerCubicMeter, CentigramsPerLiterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromCentigramsPerMicroliter(kilogrampercubicmeter.CentigramsPerMicroliter).KilogramsPerCubicMeter, CentigramsPerMicroliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromCentigramsPerMilliliter(kilogrampercubicmeter.CentigramsPerMilliliter).KilogramsPerCubicMeter, CentigramsPerMilliliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromDecigramsPerDeciliter(kilogrampercubicmeter.DecigramsPerDeciliter).KilogramsPerCubicMeter, DecigramsPerDeciliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromDecigramsPerLiter(kilogrampercubicmeter.DecigramsPerLiter).KilogramsPerCubicMeter, DecigramsPerLiterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromDecigramsPerMicroliter(kilogrampercubicmeter.DecigramsPerMicroliter).KilogramsPerCubicMeter, DecigramsPerMicroliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromDecigramsPerMilliliter(kilogrampercubicmeter.DecigramsPerMilliliter).KilogramsPerCubicMeter, DecigramsPerMilliliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromGramsPerCubicCentimeter(kilogrampercubicmeter.GramsPerCubicCentimeter).KilogramsPerCubicMeter, GramsPerCubicCentimeterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromGramsPerCubicMeter(kilogrampercubicmeter.GramsPerCubicMeter).KilogramsPerCubicMeter, GramsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromGramsPerCubicMillimeter(kilogrampercubicmeter.GramsPerCubicMillimeter).KilogramsPerCubicMeter, GramsPerCubicMillimeterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromGramsPerDeciliter(kilogrampercubicmeter.GramsPerDeciliter).KilogramsPerCubicMeter, GramsPerDeciliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromGramsPerLiter(kilogrampercubicmeter.GramsPerLiter).KilogramsPerCubicMeter, GramsPerLiterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromGramsPerMicroliter(kilogrampercubicmeter.GramsPerMicroliter).KilogramsPerCubicMeter, GramsPerMicroliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromGramsPerMilliliter(kilogrampercubicmeter.GramsPerMilliliter).KilogramsPerCubicMeter, GramsPerMilliliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromKilogramsPerCubicCentimeter(kilogrampercubicmeter.KilogramsPerCubicCentimeter).KilogramsPerCubicMeter, KilogramsPerCubicCentimeterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromKilogramsPerCubicMeter(kilogrampercubicmeter.KilogramsPerCubicMeter).KilogramsPerCubicMeter, KilogramsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromKilogramsPerCubicMillimeter(kilogrampercubicmeter.KilogramsPerCubicMillimeter).KilogramsPerCubicMeter, KilogramsPerCubicMillimeterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromKilogramsPerLiter(kilogrampercubicmeter.KilogramsPerLiter).KilogramsPerCubicMeter, KilogramsPerLiterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromKilopoundsPerCubicFoot(kilogrampercubicmeter.KilopoundsPerCubicFoot).KilogramsPerCubicMeter, KilopoundsPerCubicFootTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromKilopoundsPerCubicInch(kilogrampercubicmeter.KilopoundsPerCubicInch).KilogramsPerCubicMeter, KilopoundsPerCubicInchTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromMicrogramsPerCubicMeter(kilogrampercubicmeter.MicrogramsPerCubicMeter).KilogramsPerCubicMeter, MicrogramsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromMicrogramsPerDeciliter(kilogrampercubicmeter.MicrogramsPerDeciliter).KilogramsPerCubicMeter, MicrogramsPerDeciliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromMicrogramsPerLiter(kilogrampercubicmeter.MicrogramsPerLiter).KilogramsPerCubicMeter, MicrogramsPerLiterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromMicrogramsPerMicroliter(kilogrampercubicmeter.MicrogramsPerMicroliter).KilogramsPerCubicMeter, MicrogramsPerMicroliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromMicrogramsPerMilliliter(kilogrampercubicmeter.MicrogramsPerMilliliter).KilogramsPerCubicMeter, MicrogramsPerMilliliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromMilligramsPerCubicMeter(kilogrampercubicmeter.MilligramsPerCubicMeter).KilogramsPerCubicMeter, MilligramsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromMilligramsPerDeciliter(kilogrampercubicmeter.MilligramsPerDeciliter).KilogramsPerCubicMeter, MilligramsPerDeciliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromMilligramsPerLiter(kilogrampercubicmeter.MilligramsPerLiter).KilogramsPerCubicMeter, MilligramsPerLiterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromMilligramsPerMicroliter(kilogrampercubicmeter.MilligramsPerMicroliter).KilogramsPerCubicMeter, MilligramsPerMicroliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromMilligramsPerMilliliter(kilogrampercubicmeter.MilligramsPerMilliliter).KilogramsPerCubicMeter, MilligramsPerMilliliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromNanogramsPerDeciliter(kilogrampercubicmeter.NanogramsPerDeciliter).KilogramsPerCubicMeter, NanogramsPerDeciliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromNanogramsPerLiter(kilogrampercubicmeter.NanogramsPerLiter).KilogramsPerCubicMeter, NanogramsPerLiterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromNanogramsPerMicroliter(kilogrampercubicmeter.NanogramsPerMicroliter).KilogramsPerCubicMeter, NanogramsPerMicroliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromNanogramsPerMilliliter(kilogrampercubicmeter.NanogramsPerMilliliter).KilogramsPerCubicMeter, NanogramsPerMilliliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromOuncesPerImperialGallon(kilogrampercubicmeter.OuncesPerImperialGallon).KilogramsPerCubicMeter, OuncesPerImperialGallonTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromOuncesPerUSGallon(kilogrampercubicmeter.OuncesPerUSGallon).KilogramsPerCubicMeter, OuncesPerUSGallonTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromPicogramsPerDeciliter(kilogrampercubicmeter.PicogramsPerDeciliter).KilogramsPerCubicMeter, PicogramsPerDeciliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromPicogramsPerLiter(kilogrampercubicmeter.PicogramsPerLiter).KilogramsPerCubicMeter, PicogramsPerLiterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromPicogramsPerMicroliter(kilogrampercubicmeter.PicogramsPerMicroliter).KilogramsPerCubicMeter, PicogramsPerMicroliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromPicogramsPerMilliliter(kilogrampercubicmeter.PicogramsPerMilliliter).KilogramsPerCubicMeter, PicogramsPerMilliliterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromPoundsPerCubicFoot(kilogrampercubicmeter.PoundsPerCubicFoot).KilogramsPerCubicMeter, PoundsPerCubicFootTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromPoundsPerCubicInch(kilogrampercubicmeter.PoundsPerCubicInch).KilogramsPerCubicMeter, PoundsPerCubicInchTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromPoundsPerImperialGallon(kilogrampercubicmeter.PoundsPerImperialGallon).KilogramsPerCubicMeter, PoundsPerImperialGallonTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromPoundsPerUSGallon(kilogrampercubicmeter.PoundsPerUSGallon).KilogramsPerCubicMeter, PoundsPerUSGallonTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromSlugsPerCubicFoot(kilogrampercubicmeter.SlugsPerCubicFoot).KilogramsPerCubicMeter, SlugsPerCubicFootTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromTonnesPerCubicCentimeter(kilogrampercubicmeter.TonnesPerCubicCentimeter).KilogramsPerCubicMeter, TonnesPerCubicCentimeterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromTonnesPerCubicMeter(kilogrampercubicmeter.TonnesPerCubicMeter).KilogramsPerCubicMeter, TonnesPerCubicMeterTolerance); AssertEx.EqualTolerance(1, MassConcentration.FromTonnesPerCubicMillimeter(kilogrampercubicmeter.TonnesPerCubicMillimeter).KilogramsPerCubicMeter, TonnesPerCubicMillimeterTolerance); } [Fact] public void ArithmeticOperators() { MassConcentration v = MassConcentration.FromKilogramsPerCubicMeter(1); AssertEx.EqualTolerance(-1, -v.KilogramsPerCubicMeter, KilogramsPerCubicMeterTolerance); AssertEx.EqualTolerance(2, (MassConcentration.FromKilogramsPerCubicMeter(3)-v).KilogramsPerCubicMeter, KilogramsPerCubicMeterTolerance); AssertEx.EqualTolerance(2, (v + v).KilogramsPerCubicMeter, KilogramsPerCubicMeterTolerance); AssertEx.EqualTolerance(10, (v*10).KilogramsPerCubicMeter, KilogramsPerCubicMeterTolerance); AssertEx.EqualTolerance(10, (10*v).KilogramsPerCubicMeter, KilogramsPerCubicMeterTolerance); AssertEx.EqualTolerance(2, (MassConcentration.FromKilogramsPerCubicMeter(10)/5).KilogramsPerCubicMeter, KilogramsPerCubicMeterTolerance); AssertEx.EqualTolerance(2, MassConcentration.FromKilogramsPerCubicMeter(10)/MassConcentration.FromKilogramsPerCubicMeter(5), KilogramsPerCubicMeterTolerance); } [Fact] public void ComparisonOperators() { MassConcentration oneKilogramPerCubicMeter = MassConcentration.FromKilogramsPerCubicMeter(1); MassConcentration twoKilogramsPerCubicMeter = MassConcentration.FromKilogramsPerCubicMeter(2); Assert.True(oneKilogramPerCubicMeter < twoKilogramsPerCubicMeter); Assert.True(oneKilogramPerCubicMeter <= twoKilogramsPerCubicMeter); Assert.True(twoKilogramsPerCubicMeter > oneKilogramPerCubicMeter); Assert.True(twoKilogramsPerCubicMeter >= oneKilogramPerCubicMeter); Assert.False(oneKilogramPerCubicMeter > twoKilogramsPerCubicMeter); Assert.False(oneKilogramPerCubicMeter >= twoKilogramsPerCubicMeter); Assert.False(twoKilogramsPerCubicMeter < oneKilogramPerCubicMeter); Assert.False(twoKilogramsPerCubicMeter <= oneKilogramPerCubicMeter); } [Fact] public void CompareToIsImplemented() { MassConcentration kilogrampercubicmeter = MassConcentration.FromKilogramsPerCubicMeter(1); Assert.Equal(0, kilogrampercubicmeter.CompareTo(kilogrampercubicmeter)); Assert.True(kilogrampercubicmeter.CompareTo(MassConcentration.Zero) > 0); Assert.True(MassConcentration.Zero.CompareTo(kilogrampercubicmeter) < 0); } [Fact] public void CompareToThrowsOnTypeMismatch() { MassConcentration kilogrampercubicmeter = MassConcentration.FromKilogramsPerCubicMeter(1); Assert.Throws<ArgumentException>(() => kilogrampercubicmeter.CompareTo(new object())); } [Fact] public void CompareToThrowsOnNull() { MassConcentration kilogrampercubicmeter = MassConcentration.FromKilogramsPerCubicMeter(1); Assert.Throws<ArgumentNullException>(() => kilogrampercubicmeter.CompareTo(null)); } [Fact] public void EqualityOperators() { var a = MassConcentration.FromKilogramsPerCubicMeter(1); var b = MassConcentration.FromKilogramsPerCubicMeter(2); #pragma warning disable CS8073 // ReSharper disable EqualExpressionComparison Assert.True(a == a); Assert.False(a != a); Assert.True(a != b); Assert.False(a == b); Assert.False(a == null); Assert.False(null == a); // ReSharper restore EqualExpressionComparison #pragma warning restore CS8073 } [Fact] public void Equals_SameType_IsImplemented() { var a = MassConcentration.FromKilogramsPerCubicMeter(1); var b = MassConcentration.FromKilogramsPerCubicMeter(2); Assert.True(a.Equals(a)); Assert.False(a.Equals(b)); } [Fact] public void Equals_QuantityAsObject_IsImplemented() { object a = MassConcentration.FromKilogramsPerCubicMeter(1); object b = MassConcentration.FromKilogramsPerCubicMeter(2); Assert.True(a.Equals(a)); Assert.False(a.Equals(b)); Assert.False(a.Equals((object)null)); } [Fact] public void Equals_RelativeTolerance_IsImplemented() { var v = MassConcentration.FromKilogramsPerCubicMeter(1); Assert.True(v.Equals(MassConcentration.FromKilogramsPerCubicMeter(1), KilogramsPerCubicMeterTolerance, ComparisonType.Relative)); Assert.False(v.Equals(MassConcentration.Zero, KilogramsPerCubicMeterTolerance, ComparisonType.Relative)); } [Fact] public void Equals_NegativeRelativeTolerance_ThrowsArgumentOutOfRangeException() { var v = MassConcentration.FromKilogramsPerCubicMeter(1); Assert.Throws<ArgumentOutOfRangeException>(() => v.Equals(MassConcentration.FromKilogramsPerCubicMeter(1), -1, ComparisonType.Relative)); } [Fact] public void EqualsReturnsFalseOnTypeMismatch() { MassConcentration kilogrampercubicmeter = MassConcentration.FromKilogramsPerCubicMeter(1); Assert.False(kilogrampercubicmeter.Equals(new object())); } [Fact] public void EqualsReturnsFalseOnNull() { MassConcentration kilogrampercubicmeter = MassConcentration.FromKilogramsPerCubicMeter(1); Assert.False(kilogrampercubicmeter.Equals(null)); } [Fact] public void UnitsDoesNotContainUndefined() { Assert.DoesNotContain(MassConcentrationUnit.Undefined, MassConcentration.Units); } [Fact] public void HasAtLeastOneAbbreviationSpecified() { var units = Enum.GetValues(typeof(MassConcentrationUnit)).Cast<MassConcentrationUnit>(); foreach(var unit in units) { if(unit == MassConcentrationUnit.Undefined) continue; var defaultAbbreviation = UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit); } } [Fact] public void BaseDimensionsShouldNeverBeNull() { Assert.False(MassConcentration.BaseDimensions is null); } [Fact] public void ToString_ReturnsValueAndUnitAbbreviationInCurrentCulture() { var prevCulture = Thread.CurrentThread.CurrentUICulture; Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US"); try { Assert.Equal("1 cg/dL", new MassConcentration(1, MassConcentrationUnit.CentigramPerDeciliter).ToString()); Assert.Equal("1 cg/L", new MassConcentration(1, MassConcentrationUnit.CentigramPerLiter).ToString()); Assert.Equal("1 cg/μL", new MassConcentration(1, MassConcentrationUnit.CentigramPerMicroliter).ToString()); Assert.Equal("1 cg/mL", new MassConcentration(1, MassConcentrationUnit.CentigramPerMilliliter).ToString()); Assert.Equal("1 dg/dL", new MassConcentration(1, MassConcentrationUnit.DecigramPerDeciliter).ToString()); Assert.Equal("1 dg/L", new MassConcentration(1, MassConcentrationUnit.DecigramPerLiter).ToString()); Assert.Equal("1 dg/μL", new MassConcentration(1, MassConcentrationUnit.DecigramPerMicroliter).ToString()); Assert.Equal("1 dg/mL", new MassConcentration(1, MassConcentrationUnit.DecigramPerMilliliter).ToString()); Assert.Equal("1 g/cm³", new MassConcentration(1, MassConcentrationUnit.GramPerCubicCentimeter).ToString()); Assert.Equal("1 g/m³", new MassConcentration(1, MassConcentrationUnit.GramPerCubicMeter).ToString()); Assert.Equal("1 g/mm³", new MassConcentration(1, MassConcentrationUnit.GramPerCubicMillimeter).ToString()); Assert.Equal("1 g/dL", new MassConcentration(1, MassConcentrationUnit.GramPerDeciliter).ToString()); Assert.Equal("1 g/L", new MassConcentration(1, MassConcentrationUnit.GramPerLiter).ToString()); Assert.Equal("1 g/μL", new MassConcentration(1, MassConcentrationUnit.GramPerMicroliter).ToString()); Assert.Equal("1 g/mL", new MassConcentration(1, MassConcentrationUnit.GramPerMilliliter).ToString()); Assert.Equal("1 kg/cm³", new MassConcentration(1, MassConcentrationUnit.KilogramPerCubicCentimeter).ToString()); Assert.Equal("1 kg/m³", new MassConcentration(1, MassConcentrationUnit.KilogramPerCubicMeter).ToString()); Assert.Equal("1 kg/mm³", new MassConcentration(1, MassConcentrationUnit.KilogramPerCubicMillimeter).ToString()); Assert.Equal("1 kg/L", new MassConcentration(1, MassConcentrationUnit.KilogramPerLiter).ToString()); Assert.Equal("1 kip/ft³", new MassConcentration(1, MassConcentrationUnit.KilopoundPerCubicFoot).ToString()); Assert.Equal("1 kip/in³", new MassConcentration(1, MassConcentrationUnit.KilopoundPerCubicInch).ToString()); Assert.Equal("1 µg/m³", new MassConcentration(1, MassConcentrationUnit.MicrogramPerCubicMeter).ToString()); Assert.Equal("1 µg/dL", new MassConcentration(1, MassConcentrationUnit.MicrogramPerDeciliter).ToString()); Assert.Equal("1 µg/L", new MassConcentration(1, MassConcentrationUnit.MicrogramPerLiter).ToString()); Assert.Equal("1 µg/μL", new MassConcentration(1, MassConcentrationUnit.MicrogramPerMicroliter).ToString()); Assert.Equal("1 µg/mL", new MassConcentration(1, MassConcentrationUnit.MicrogramPerMilliliter).ToString()); Assert.Equal("1 mg/m³", new MassConcentration(1, MassConcentrationUnit.MilligramPerCubicMeter).ToString()); Assert.Equal("1 mg/dL", new MassConcentration(1, MassConcentrationUnit.MilligramPerDeciliter).ToString()); Assert.Equal("1 mg/L", new MassConcentration(1, MassConcentrationUnit.MilligramPerLiter).ToString()); Assert.Equal("1 mg/μL", new MassConcentration(1, MassConcentrationUnit.MilligramPerMicroliter).ToString()); Assert.Equal("1 mg/mL", new MassConcentration(1, MassConcentrationUnit.MilligramPerMilliliter).ToString()); Assert.Equal("1 ng/dL", new MassConcentration(1, MassConcentrationUnit.NanogramPerDeciliter).ToString()); Assert.Equal("1 ng/L", new MassConcentration(1, MassConcentrationUnit.NanogramPerLiter).ToString()); Assert.Equal("1 ng/μL", new MassConcentration(1, MassConcentrationUnit.NanogramPerMicroliter).ToString()); Assert.Equal("1 ng/mL", new MassConcentration(1, MassConcentrationUnit.NanogramPerMilliliter).ToString()); Assert.Equal("1 oz/gal (imp.)", new MassConcentration(1, MassConcentrationUnit.OuncePerImperialGallon).ToString()); Assert.Equal("1 oz/gal (U.S.)", new MassConcentration(1, MassConcentrationUnit.OuncePerUSGallon).ToString()); Assert.Equal("1 pg/dL", new MassConcentration(1, MassConcentrationUnit.PicogramPerDeciliter).ToString()); Assert.Equal("1 pg/L", new MassConcentration(1, MassConcentrationUnit.PicogramPerLiter).ToString()); Assert.Equal("1 pg/μL", new MassConcentration(1, MassConcentrationUnit.PicogramPerMicroliter).ToString()); Assert.Equal("1 pg/mL", new MassConcentration(1, MassConcentrationUnit.PicogramPerMilliliter).ToString()); Assert.Equal("1 lb/ft³", new MassConcentration(1, MassConcentrationUnit.PoundPerCubicFoot).ToString()); Assert.Equal("1 lb/in³", new MassConcentration(1, MassConcentrationUnit.PoundPerCubicInch).ToString()); Assert.Equal("1 ppg (imp.)", new MassConcentration(1, MassConcentrationUnit.PoundPerImperialGallon).ToString()); Assert.Equal("1 ppg (U.S.)", new MassConcentration(1, MassConcentrationUnit.PoundPerUSGallon).ToString()); Assert.Equal("1 slug/ft³", new MassConcentration(1, MassConcentrationUnit.SlugPerCubicFoot).ToString()); Assert.Equal("1 t/cm³", new MassConcentration(1, MassConcentrationUnit.TonnePerCubicCentimeter).ToString()); Assert.Equal("1 t/m³", new MassConcentration(1, MassConcentrationUnit.TonnePerCubicMeter).ToString()); Assert.Equal("1 t/mm³", new MassConcentration(1, MassConcentrationUnit.TonnePerCubicMillimeter).ToString()); } finally { Thread.CurrentThread.CurrentUICulture = prevCulture; } } [Fact] public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCultureSinceThereAreNoMappings() { // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); Assert.Equal("1 cg/dL", new MassConcentration(1, MassConcentrationUnit.CentigramPerDeciliter).ToString(swedishCulture)); Assert.Equal("1 cg/L", new MassConcentration(1, MassConcentrationUnit.CentigramPerLiter).ToString(swedishCulture)); Assert.Equal("1 cg/μL", new MassConcentration(1, MassConcentrationUnit.CentigramPerMicroliter).ToString(swedishCulture)); Assert.Equal("1 cg/mL", new MassConcentration(1, MassConcentrationUnit.CentigramPerMilliliter).ToString(swedishCulture)); Assert.Equal("1 dg/dL", new MassConcentration(1, MassConcentrationUnit.DecigramPerDeciliter).ToString(swedishCulture)); Assert.Equal("1 dg/L", new MassConcentration(1, MassConcentrationUnit.DecigramPerLiter).ToString(swedishCulture)); Assert.Equal("1 dg/μL", new MassConcentration(1, MassConcentrationUnit.DecigramPerMicroliter).ToString(swedishCulture)); Assert.Equal("1 dg/mL", new MassConcentration(1, MassConcentrationUnit.DecigramPerMilliliter).ToString(swedishCulture)); Assert.Equal("1 g/cm³", new MassConcentration(1, MassConcentrationUnit.GramPerCubicCentimeter).ToString(swedishCulture)); Assert.Equal("1 g/m³", new MassConcentration(1, MassConcentrationUnit.GramPerCubicMeter).ToString(swedishCulture)); Assert.Equal("1 g/mm³", new MassConcentration(1, MassConcentrationUnit.GramPerCubicMillimeter).ToString(swedishCulture)); Assert.Equal("1 g/dL", new MassConcentration(1, MassConcentrationUnit.GramPerDeciliter).ToString(swedishCulture)); Assert.Equal("1 g/L", new MassConcentration(1, MassConcentrationUnit.GramPerLiter).ToString(swedishCulture)); Assert.Equal("1 g/μL", new MassConcentration(1, MassConcentrationUnit.GramPerMicroliter).ToString(swedishCulture)); Assert.Equal("1 g/mL", new MassConcentration(1, MassConcentrationUnit.GramPerMilliliter).ToString(swedishCulture)); Assert.Equal("1 kg/cm³", new MassConcentration(1, MassConcentrationUnit.KilogramPerCubicCentimeter).ToString(swedishCulture)); Assert.Equal("1 kg/m³", new MassConcentration(1, MassConcentrationUnit.KilogramPerCubicMeter).ToString(swedishCulture)); Assert.Equal("1 kg/mm³", new MassConcentration(1, MassConcentrationUnit.KilogramPerCubicMillimeter).ToString(swedishCulture)); Assert.Equal("1 kg/L", new MassConcentration(1, MassConcentrationUnit.KilogramPerLiter).ToString(swedishCulture)); Assert.Equal("1 kip/ft³", new MassConcentration(1, MassConcentrationUnit.KilopoundPerCubicFoot).ToString(swedishCulture)); Assert.Equal("1 kip/in³", new MassConcentration(1, MassConcentrationUnit.KilopoundPerCubicInch).ToString(swedishCulture)); Assert.Equal("1 µg/m³", new MassConcentration(1, MassConcentrationUnit.MicrogramPerCubicMeter).ToString(swedishCulture)); Assert.Equal("1 µg/dL", new MassConcentration(1, MassConcentrationUnit.MicrogramPerDeciliter).ToString(swedishCulture)); Assert.Equal("1 µg/L", new MassConcentration(1, MassConcentrationUnit.MicrogramPerLiter).ToString(swedishCulture)); Assert.Equal("1 µg/μL", new MassConcentration(1, MassConcentrationUnit.MicrogramPerMicroliter).ToString(swedishCulture)); Assert.Equal("1 µg/mL", new MassConcentration(1, MassConcentrationUnit.MicrogramPerMilliliter).ToString(swedishCulture)); Assert.Equal("1 mg/m³", new MassConcentration(1, MassConcentrationUnit.MilligramPerCubicMeter).ToString(swedishCulture)); Assert.Equal("1 mg/dL", new MassConcentration(1, MassConcentrationUnit.MilligramPerDeciliter).ToString(swedishCulture)); Assert.Equal("1 mg/L", new MassConcentration(1, MassConcentrationUnit.MilligramPerLiter).ToString(swedishCulture)); Assert.Equal("1 mg/μL", new MassConcentration(1, MassConcentrationUnit.MilligramPerMicroliter).ToString(swedishCulture)); Assert.Equal("1 mg/mL", new MassConcentration(1, MassConcentrationUnit.MilligramPerMilliliter).ToString(swedishCulture)); Assert.Equal("1 ng/dL", new MassConcentration(1, MassConcentrationUnit.NanogramPerDeciliter).ToString(swedishCulture)); Assert.Equal("1 ng/L", new MassConcentration(1, MassConcentrationUnit.NanogramPerLiter).ToString(swedishCulture)); Assert.Equal("1 ng/μL", new MassConcentration(1, MassConcentrationUnit.NanogramPerMicroliter).ToString(swedishCulture)); Assert.Equal("1 ng/mL", new MassConcentration(1, MassConcentrationUnit.NanogramPerMilliliter).ToString(swedishCulture)); Assert.Equal("1 oz/gal (imp.)", new MassConcentration(1, MassConcentrationUnit.OuncePerImperialGallon).ToString(swedishCulture)); Assert.Equal("1 oz/gal (U.S.)", new MassConcentration(1, MassConcentrationUnit.OuncePerUSGallon).ToString(swedishCulture)); Assert.Equal("1 pg/dL", new MassConcentration(1, MassConcentrationUnit.PicogramPerDeciliter).ToString(swedishCulture)); Assert.Equal("1 pg/L", new MassConcentration(1, MassConcentrationUnit.PicogramPerLiter).ToString(swedishCulture)); Assert.Equal("1 pg/μL", new MassConcentration(1, MassConcentrationUnit.PicogramPerMicroliter).ToString(swedishCulture)); Assert.Equal("1 pg/mL", new MassConcentration(1, MassConcentrationUnit.PicogramPerMilliliter).ToString(swedishCulture)); Assert.Equal("1 lb/ft³", new MassConcentration(1, MassConcentrationUnit.PoundPerCubicFoot).ToString(swedishCulture)); Assert.Equal("1 lb/in³", new MassConcentration(1, MassConcentrationUnit.PoundPerCubicInch).ToString(swedishCulture)); Assert.Equal("1 ppg (imp.)", new MassConcentration(1, MassConcentrationUnit.PoundPerImperialGallon).ToString(swedishCulture)); Assert.Equal("1 ppg (U.S.)", new MassConcentration(1, MassConcentrationUnit.PoundPerUSGallon).ToString(swedishCulture)); Assert.Equal("1 slug/ft³", new MassConcentration(1, MassConcentrationUnit.SlugPerCubicFoot).ToString(swedishCulture)); Assert.Equal("1 t/cm³", new MassConcentration(1, MassConcentrationUnit.TonnePerCubicCentimeter).ToString(swedishCulture)); Assert.Equal("1 t/m³", new MassConcentration(1, MassConcentrationUnit.TonnePerCubicMeter).ToString(swedishCulture)); Assert.Equal("1 t/mm³", new MassConcentration(1, MassConcentrationUnit.TonnePerCubicMillimeter).ToString(swedishCulture)); } [Fact] public void ToString_SFormat_FormatsNumberWithGivenDigitsAfterRadixForCurrentCulture() { var oldCulture = CultureInfo.CurrentUICulture; try { CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture; Assert.Equal("0.1 kg/m³", new MassConcentration(0.123456, MassConcentrationUnit.KilogramPerCubicMeter).ToString("s1")); Assert.Equal("0.12 kg/m³", new MassConcentration(0.123456, MassConcentrationUnit.KilogramPerCubicMeter).ToString("s2")); Assert.Equal("0.123 kg/m³", new MassConcentration(0.123456, MassConcentrationUnit.KilogramPerCubicMeter).ToString("s3")); Assert.Equal("0.1235 kg/m³", new MassConcentration(0.123456, MassConcentrationUnit.KilogramPerCubicMeter).ToString("s4")); } finally { CultureInfo.CurrentUICulture = oldCulture; } } [Fact] public void ToString_SFormatAndCulture_FormatsNumberWithGivenDigitsAfterRadixForGivenCulture() { var culture = CultureInfo.InvariantCulture; Assert.Equal("0.1 kg/m³", new MassConcentration(0.123456, MassConcentrationUnit.KilogramPerCubicMeter).ToString("s1", culture)); Assert.Equal("0.12 kg/m³", new MassConcentration(0.123456, MassConcentrationUnit.KilogramPerCubicMeter).ToString("s2", culture)); Assert.Equal("0.123 kg/m³", new MassConcentration(0.123456, MassConcentrationUnit.KilogramPerCubicMeter).ToString("s3", culture)); Assert.Equal("0.1235 kg/m³", new MassConcentration(0.123456, MassConcentrationUnit.KilogramPerCubicMeter).ToString("s4", culture)); } [Fact] public void ToString_NullFormat_ThrowsArgumentNullException() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Throws<ArgumentNullException>(() => quantity.ToString(null, null, null)); } [Fact] public void ToString_NullArgs_ThrowsArgumentNullException() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Throws<ArgumentNullException>(() => quantity.ToString(null, "g", null)); } [Fact] public void ToString_NullProvider_EqualsCurrentUICulture() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal(quantity.ToString(CultureInfo.CurrentUICulture, "g"), quantity.ToString(null, "g")); } [Fact] public void Convert_ToBool_ThrowsInvalidCastException() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Throws<InvalidCastException>(() => Convert.ToBoolean(quantity)); } [Fact] public void Convert_ToByte_EqualsValueAsSameType() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal((byte)quantity.Value, Convert.ToByte(quantity)); } [Fact] public void Convert_ToChar_ThrowsInvalidCastException() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Throws<InvalidCastException>(() => Convert.ToChar(quantity)); } [Fact] public void Convert_ToDateTime_ThrowsInvalidCastException() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Throws<InvalidCastException>(() => Convert.ToDateTime(quantity)); } [Fact] public void Convert_ToDecimal_EqualsValueAsSameType() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal((decimal)quantity.Value, Convert.ToDecimal(quantity)); } [Fact] public void Convert_ToDouble_EqualsValueAsSameType() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal((double)quantity.Value, Convert.ToDouble(quantity)); } [Fact] public void Convert_ToInt16_EqualsValueAsSameType() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal((short)quantity.Value, Convert.ToInt16(quantity)); } [Fact] public void Convert_ToInt32_EqualsValueAsSameType() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal((int)quantity.Value, Convert.ToInt32(quantity)); } [Fact] public void Convert_ToInt64_EqualsValueAsSameType() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal((long)quantity.Value, Convert.ToInt64(quantity)); } [Fact] public void Convert_ToSByte_EqualsValueAsSameType() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal((sbyte)quantity.Value, Convert.ToSByte(quantity)); } [Fact] public void Convert_ToSingle_EqualsValueAsSameType() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal((float)quantity.Value, Convert.ToSingle(quantity)); } [Fact] public void Convert_ToString_EqualsToString() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal(quantity.ToString(), Convert.ToString(quantity)); } [Fact] public void Convert_ToUInt16_EqualsValueAsSameType() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal((ushort)quantity.Value, Convert.ToUInt16(quantity)); } [Fact] public void Convert_ToUInt32_EqualsValueAsSameType() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal((uint)quantity.Value, Convert.ToUInt32(quantity)); } [Fact] public void Convert_ToUInt64_EqualsValueAsSameType() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal((ulong)quantity.Value, Convert.ToUInt64(quantity)); } [Fact] public void Convert_ChangeType_SelfType_EqualsSelf() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal(quantity, Convert.ChangeType(quantity, typeof(MassConcentration))); } [Fact] public void Convert_ChangeType_UnitType_EqualsUnit() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal(quantity.Unit, Convert.ChangeType(quantity, typeof(MassConcentrationUnit))); } [Fact] public void Convert_ChangeType_QuantityType_EqualsQuantityType() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal(QuantityType.MassConcentration, Convert.ChangeType(quantity, typeof(QuantityType))); } [Fact] public void Convert_ChangeType_QuantityInfo_EqualsQuantityInfo() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal(MassConcentration.Info, Convert.ChangeType(quantity, typeof(QuantityInfo))); } [Fact] public void Convert_ChangeType_BaseDimensions_EqualsBaseDimensions() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal(MassConcentration.BaseDimensions, Convert.ChangeType(quantity, typeof(BaseDimensions))); } [Fact] public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Throws<InvalidCastException>(() => Convert.ChangeType(quantity, typeof(QuantityFormatter))); } [Fact] public void GetHashCode_Equals() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); Assert.Equal(new {MassConcentration.Info.Name, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); } [Theory] [InlineData(1.0)] [InlineData(-1.0)] public void NegationOperator_ReturnsQuantity_WithNegatedValue(double value) { var quantity = MassConcentration.FromKilogramsPerCubicMeter(value); Assert.Equal(MassConcentration.FromKilogramsPerCubicMeter(-value), -quantity); } } }
79.498845
205
0.772788
[ "MIT-feh" ]
Angerxzer/UnitsNet
UnitsNet.Tests/GeneratedCode/TestsBase/MassConcentrationTestsBase.g.cs
103,333
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Общие сведения об этой сборке предоставляются следующим набором // набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения, // связанные со сборкой. [assembly: AssemblyTitle("tASK08")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("tASK08")] [assembly: AssemblyCopyright("Copyright © 2019")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми // для компонентов COM. Если необходимо обратиться к типу в этой сборке через // COM, задайте атрибуту ComVisible значение TRUE для этого типа. [assembly: ComVisible(false)] // Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM [assembly: Guid("c2f7b2f7-bec3-4d59-ad62-936e955035a2")] // Сведения о версии сборки состоят из следующих четырех значений: // // Основной номер версии // Дополнительный номер версии // Номер сборки // Редакция // // Можно задать все значения или принять номер сборки и номер редакции по умолчанию. // используя "*", как показано ниже: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
38.243243
99
0.761837
[ "MIT" ]
hse-programming-CSharp2019-2020/CSharp2019-2020
03 module/02 seminar/code/Seminar02/tASK08/Properties/AssemblyInfo.cs
1,995
C#
using PinBot2.Common; using PinBot2.Model; using PinBot2.Model.Configurations; using PinBot2.Model.PinterestObjects; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Web; namespace PinBot2.Algorithms.Scraping { internal class ScrapePins_BoardFeedResource : ScrapePins { internal ScrapePins_BoardFeedResource(string query, http request, IAccount account, IConfiguration config) : base (query,request,account, config) { baseUsername = query.Split('/')[1]; boardName = query.Split('/')[2]; this.resource = PinterestObjectResources.BoardFeedResource; } protected override void SetUrlAndRef() { Referer = baseUrl + "/" + baseUsername + "/boards/"; if (FirstRequest) { Url = baseUrl + "/" + baseUsername + "/" + boardName + "/"; } else { if (boardId == null || boardId.Length == 0) boardId = SetBoardId(); if (boardId == null || boardId.Length == 0) { FirstRequest = true; return; } Url = baseUrl + GetData(); } } protected override string GetData() { string str = "/resource/BoardFeedResource/get/?source_url=" + HttpUtility.UrlEncode("/" + baseUsername + "/" + boardName + "/") + "&data=" + HttpUtility.UrlEncode("{\"options\":{\"board_id\":\"" + boardId + "\",\"board_url\":\"/" + baseUsername + "/" + boardName + "/\",\"board_layout\":\"default\",\"prepend\":true,\"page_size\":null,\"access\":[],\"bookmarks\":[\"" + Bookmark + "\"]},\"context\":{}}") + "&module_path=" + HttpUtility.UrlEncode( "UserProfilePage(resource=UserResource(username=" + baseUsername + "))" + ">UserProfileContent(resource=UserResource(username=" + baseUsername + "))" + ">UserBoards()>Grid(resource=ProfileBoardsResource(username=" + baseUsername + "))" + ">GridItems(resource=ProfileBoardsResource(username=" + baseUsername + "))" + ">Board(show_board_context=false, view_type=boardCoverImage, component_type=1, show_user_icon=false, resource=BoardResource(board_id=" + boardId + "))") + "&_=" + GetTime(); str = Regex.Replace(str, "%\\d(\\w)", m => m.ToString().ToUpper()); return str; } } }
40.828571
289
0.516445
[ "MIT" ]
inevolin/PinBot-2
PinBot2.Algorithms/Scraping/Scraping/ScrapePins_BoardFeedResource.cs
2,860
C#
using System.IO; using System.Windows; using Bloom.Domain.Models; using Bloom.State.Data.Respositories; using Bloom.State.Domain.Models; using Microsoft.Practices.Unity; using NUnit.Framework; namespace Bloom.State.Data.Tests.Repositories { /// <summary> /// Tests the player state repository class. /// </summary> [TestFixture] public class PlayerStateRespositoryTests { private const string TestFileName = "PlayerStateRespositoryTests.blms"; private StateDataSource _dataSource; private IUnityContainer _container; private IPlayerStateRepository _playerStateRepository; private User _user; /// <summary> /// Sets up the tests by creating a test data source and adding data. /// </summary> [OneTimeSetUp] public void SetUp() { _user = User.Create(Person.Create("Test User")); _container = new UnityContainer(); _dataSource = new StateDataSource(_container); var connectionRepository = new LibraryConnectionRepository(_dataSource); _playerStateRepository = new PlayerStateRepository(_dataSource, connectionRepository); var testFolder = Bloom.Data.Settings.TestsDataPath; if (!Directory.Exists(testFolder)) Directory.CreateDirectory(testFolder); var testFilePath = Path.Combine(testFolder, TestFileName); if (File.Exists(testFilePath)) File.Delete(testFilePath); _dataSource.Create(testFilePath); Assert.IsFalse(_playerStateRepository.PlayerStateExists(_user)); PopulateDataSource(); } /// <summary> /// Populates the data source. /// </summary> private void PopulateDataSource() { var playerState = new PlayerState { ProcessName = "Player", SkinName = "Skin", RecentWidth = 100, UpcomingWidth = 200, WindowState = WindowState.Maximized, UserId = _user.PersonId, User = _user }; _playerStateRepository.AddPlayerState(playerState); _dataSource.Save(); } /// <summary> /// Tests the get player state method. /// </summary> [Test] public void GetPlayerStateTest() { var playerState = _playerStateRepository.GetPlayerState(_user); Assert.NotNull(playerState); Assert.AreEqual("Player", playerState.ProcessName); Assert.AreEqual("Skin", playerState.SkinName); Assert.AreEqual(100, playerState.RecentWidth); Assert.AreEqual(200, playerState.UpcomingWidth); Assert.AreEqual(WindowState.Maximized, playerState.WindowState); Assert.AreEqual(_user.PersonId, playerState.UserId); } /// <summary> /// Tests the player state exists method. /// </summary> [Test] public void PlayerStateExistsTest() { Assert.IsTrue(_playerStateRepository.PlayerStateExists(_user)); } } }
34.106383
98
0.607299
[ "Apache-2.0" ]
RobDixonIII/Bloom
Shared/Tests/Bloom.State.Data.Tests/Repositories/PlayerStateRespositoryTests.cs
3,208
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("StudentsByFirstAndLastName")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("StudentsByFirstAndLastName")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("e55b3a90-1f44-401e-a5be-f38b2e36932d")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
38.513514
84
0.750175
[ "MIT" ]
sholev/SoftUni
C#-WebDeveloper-3.0/Advanced-C#-May-2016/Exercises/Linq/StudentsByFirstAndLastName/Properties/AssemblyInfo.cs
1,428
C#
namespace ByteBee.Framework.Tests.Converting.Standard.StringCastingTests { public sealed partial class StringCastingTest { } }
21.142857
73
0.722973
[ "MIT" ]
ByteBee/ByteBee
tests/converting/Standard/StringCastingTests/ConvertFrom.cs
150
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("ImageuploadingDemo")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ImageuploadingDemo")] [assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("1b1a40f7-478f-49dc-86ca-60e0b746fa75")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
38.027778
84
0.750913
[ "MIT" ]
vicavelly/ImageuploadingDemo
Properties/AssemblyInfo.cs
1,372
C#
using System; using System.Collections.Generic; using System.Drawing.Imaging; using System.IO; using System.Linq; using AssetStudio; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace UnityLive2DExtractor { class Program { static void Main(string[] args) { if (args.Length != 1) return; if (!Directory.Exists(args[0])) return; Console.WriteLine($"Loading..."); var assetsManager = new AssetsManager(); assetsManager.LoadFolder(args[0]); if (assetsManager.assetsFileList.Count == 0) return; var containers = new Dictionary<AssetStudio.Object, string>(); var cubismMocs = new List<MonoBehaviour>(); foreach (var assetsFile in assetsManager.assetsFileList) { foreach (var asset in assetsFile.Objects) { switch (asset) { case MonoBehaviour m_MonoBehaviour: if (m_MonoBehaviour.m_Script.TryGet(out var m_Script)) { if (m_Script.m_ClassName == "CubismMoc") { cubismMocs.Add(m_MonoBehaviour); } } break; case AssetBundle m_AssetBundle: foreach (var m_Container in m_AssetBundle.m_Container) { var preloadIndex = m_Container.Value.preloadIndex; var preloadSize = m_Container.Value.preloadSize; var preloadEnd = preloadIndex + preloadSize; for (int k = preloadIndex; k < preloadEnd; k++) { var pptr = m_AssetBundle.m_PreloadTable[k]; if (pptr.TryGet(out var obj)) { containers[obj] = m_Container.Key; } } } break; } } } var basePathList = new List<string>(); foreach (var cubismMoc in cubismMocs) { var container = containers[cubismMoc]; var basePath = container.Substring(0, container.LastIndexOf("/")); basePathList.Add(basePath); } var lookup = containers.ToLookup(x => basePathList.Find(b => x.Value.Contains(b)), x => x.Key); var baseDestPath = Path.Combine(Path.GetDirectoryName(args[0]), "Live2DOutput"); foreach (var assets in lookup) { var key = assets.Key; if (key == null) continue; var name = key.Substring(key.LastIndexOf("/") + 1); Console.WriteLine($"Extract {name}"); var destPath = Path.Combine(baseDestPath, name) + Path.DirectorySeparatorChar; var destTexturePath = Path.Combine(destPath, "textures") + Path.DirectorySeparatorChar; var destAnimationPath = Path.Combine(destPath, "motions") + Path.DirectorySeparatorChar; Directory.CreateDirectory(destPath); Directory.CreateDirectory(destTexturePath); Directory.CreateDirectory(destAnimationPath); var monoBehaviours = new List<MonoBehaviour>(); var texture2Ds = new List<Texture2D>(); var gameObjects = new List<GameObject>(); var animationClips = new List<AnimationClip>(); foreach (var asset in assets) { if (asset is MonoBehaviour m_MonoBehaviour) { monoBehaviours.Add(m_MonoBehaviour); } else if (asset is Texture2D m_Texture2D) { texture2Ds.Add(m_Texture2D); } else if (asset is GameObject m_GameObject) { gameObjects.Add(m_GameObject); } else if (asset is AnimationClip m_AnimationClip) { animationClips.Add(m_AnimationClip); } } //physics var physics = monoBehaviours.FirstOrDefault(x => { if (x.m_Script.TryGet(out var m_Script)) { return m_Script.m_ClassName == "CubismPhysicsController"; } return false; }); if (physics != null) { File.WriteAllText($"{destPath}{name}.physics3.json", ParsePhysics(physics)); } //moc var moc = monoBehaviours.First(x => { if (x.m_Script.TryGet(out var m_Script)) { return m_Script.m_ClassName == "CubismMoc"; } return false; }); File.WriteAllBytes($"{destPath}{name}.moc3", ParseMoc(moc)); //texture var textures = new SortedSet<string>(); foreach (var texture2D in texture2Ds) { using (var bitmap = new Texture2DConverter(texture2D).ConvertToBitmap(true)) { textures.Add($"textures/{texture2D.m_Name}.png"); bitmap.Save($"{destTexturePath}{texture2D.m_Name}.png", ImageFormat.Png); } } //motion var motions = new List<string>(); var rootTransform = gameObjects[0].m_Transform; while (rootTransform.m_Father.TryGet(out var m_Father)) { rootTransform = m_Father; } rootTransform.m_GameObject.TryGet(out var rootGameObject); var converter = new CubismMotion3Converter(rootGameObject, animationClips.ToArray()); foreach (ImportedKeyframedAnimation animation in converter.AnimationList) { var json = new CubismMotion3Json { Version = 3, Meta = new CubismMotion3Json.SerializableMeta { Duration = animation.Duration, Fps = animation.SampleRate, Loop = true, AreBeziersRestricted = true, CurveCount = animation.TrackList.Count, UserDataCount = animation.Events.Count }, Curves = new CubismMotion3Json.SerializableCurve[animation.TrackList.Count] }; int totalSegmentCount = 1; int totalPointCount = 1; for (int i = 0; i < animation.TrackList.Count; i++) { var track = animation.TrackList[i]; json.Curves[i] = new CubismMotion3Json.SerializableCurve { Target = track.Target, Id = track.Name, Segments = new List<float> { 0f, track.Curve[0].value } }; for (var j = 1; j < track.Curve.Count; j++) { var curve = track.Curve[j]; var preCurve = track.Curve[j - 1]; if (Math.Abs(curve.time - preCurve.time - 0.01f) < 0.0001f) //InverseSteppedSegment { var nextCurve = track.Curve[j + 1]; if (nextCurve.value == curve.value) { json.Curves[i].Segments.Add(3f); json.Curves[i].Segments.Add(nextCurve.time); json.Curves[i].Segments.Add(nextCurve.value); j += 1; totalPointCount += 1; totalSegmentCount++; continue; } } if (float.IsPositiveInfinity(curve.inSlope)) //SteppedSegment { json.Curves[i].Segments.Add(2f); json.Curves[i].Segments.Add(curve.time); json.Curves[i].Segments.Add(curve.value); totalPointCount += 1; } else if (preCurve.outSlope == 0f && Math.Abs(curve.inSlope) < 0.0001f) //LinearSegment { json.Curves[i].Segments.Add(0f); json.Curves[i].Segments.Add(curve.time); json.Curves[i].Segments.Add(curve.value); totalPointCount += 1; } else //BezierSegment { var tangentLength = (curve.time - preCurve.time) / 3f; json.Curves[i].Segments.Add(1f); json.Curves[i].Segments.Add(preCurve.time + tangentLength); json.Curves[i].Segments.Add(preCurve.outSlope * tangentLength + preCurve.value); json.Curves[i].Segments.Add(curve.time - tangentLength); json.Curves[i].Segments.Add(curve.value - curve.inSlope * tangentLength); json.Curves[i].Segments.Add(curve.time); json.Curves[i].Segments.Add(curve.value); totalPointCount += 3; } totalSegmentCount++; } } json.Meta.TotalSegmentCount = totalSegmentCount; json.Meta.TotalPointCount = totalPointCount; json.UserData = new CubismMotion3Json.SerializableUserData[animation.Events.Count]; var totalUserDataSize = 0; for (var i = 0; i < animation.Events.Count; i++) { var @event = animation.Events[i]; json.UserData[i] = new CubismMotion3Json.SerializableUserData { Time = @event.time, Value = @event.value }; totalUserDataSize += @event.value.Length; } json.Meta.TotalUserDataSize = totalUserDataSize; motions.Add($"motions/{animation.Name}.motion3.json"); File.WriteAllText($"{destAnimationPath}{animation.Name}.motion3.json", JsonConvert.SerializeObject(json, Formatting.Indented, new MyJsonConverter())); } //model var job = new JObject(); var jarray = new JArray(); foreach (var motion in motions) { var tempjob = new JObject(); tempjob["File"] = motion; jarray.Add(tempjob); } job[""] = jarray; var groups = new List<CubismModel3Json.SerializableGroup>(); var eyeBlinkParameters = monoBehaviours.Where(x => { x.m_Script.TryGet(out var m_Script); return m_Script.m_ClassName == "CubismEyeBlinkParameter"; }).Select(x => { x.m_GameObject.TryGet(out var m_GameObject); return m_GameObject.m_Name; }).ToArray(); if (eyeBlinkParameters.Length > 0) { groups.Add(new CubismModel3Json.SerializableGroup { Target = "Parameter", Name = "EyeBlink", Ids = eyeBlinkParameters }); } var lipSyncParameters = monoBehaviours.Where(x => { x.m_Script.TryGet(out var m_Script); return m_Script.m_ClassName == "CubismMouthParameter"; }).Select(x => { x.m_GameObject.TryGet(out var m_GameObject); return m_GameObject.m_Name; }).ToArray(); if (lipSyncParameters.Length > 0) { groups.Add(new CubismModel3Json.SerializableGroup { Target = "Parameter", Name = "LipSync", Ids = lipSyncParameters }); } var model3 = new CubismModel3Json { Version = 3, FileReferences = new CubismModel3Json.SerializableFileReferences { Moc = $"{name}.moc3", Textures = textures.ToArray(), //Physics = $"{name}.physics3.json", Motions = job }, Groups = groups.ToArray() }; if (physics != null) { model3.FileReferences.Physics = $"{name}.physics3.json"; } File.WriteAllText($"{destPath}{name}.model3.json", JsonConvert.SerializeObject(model3, Formatting.Indented)); } Console.WriteLine("Done!"); Console.Read(); } private static string ParsePhysics(MonoBehaviour physics) { var reader = physics.reader; reader.Reset(); reader.Position += 28; //PPtr<GameObject> m_GameObject, m_Enabled, PPtr<MonoScript> reader.ReadAlignedString(); //m_Name var cubismPhysicsRig = new CubismPhysicsRig(reader); var physicsSettings = new CubismPhysics3Json.SerializablePhysicsSettings[cubismPhysicsRig.SubRigs.Length]; for (int i = 0; i < physicsSettings.Length; i++) { var subRigs = cubismPhysicsRig.SubRigs[i]; physicsSettings[i] = new CubismPhysics3Json.SerializablePhysicsSettings { Id = $"PhysicsSetting{i + 1}", Input = new CubismPhysics3Json.SerializableInput[subRigs.Input.Length], Output = new CubismPhysics3Json.SerializableOutput[subRigs.Output.Length], Vertices = new CubismPhysics3Json.SerializableVertex[subRigs.Particles.Length], Normalization = new CubismPhysics3Json.SerializableNormalization { Position = new CubismPhysics3Json.SerializableNormalizationValue { Minimum = subRigs.Normalization.Position.Minimum, Default = subRigs.Normalization.Position.Default, Maximum = subRigs.Normalization.Position.Maximum }, Angle = new CubismPhysics3Json.SerializableNormalizationValue { Minimum = subRigs.Normalization.Angle.Minimum, Default = subRigs.Normalization.Angle.Default, Maximum = subRigs.Normalization.Angle.Maximum } } }; for (int j = 0; j < subRigs.Input.Length; j++) { var input = subRigs.Input[j]; physicsSettings[i].Input[j] = new CubismPhysics3Json.SerializableInput { Source = new CubismPhysics3Json.SerializableParameter { Target = "Parameter", //同名GameObject父节点的名称 Id = input.SourceId }, Weight = input.Weight, Type = Enum.GetName(typeof(CubismPhysicsSourceComponent), input.SourceComponent), Reflect = input.IsInverted }; } for (int j = 0; j < subRigs.Output.Length; j++) { var output = subRigs.Output[j]; physicsSettings[i].Output[j] = new CubismPhysics3Json.SerializableOutput { Destination = new CubismPhysics3Json.SerializableParameter { Target = "Parameter", //同名GameObject父节点的名称 Id = output.DestinationId }, VertexIndex = output.ParticleIndex, Scale = output.AngleScale, Weight = output.Weight, Type = Enum.GetName(typeof(CubismPhysicsSourceComponent), output.SourceComponent), Reflect = output.IsInverted }; } for (int j = 0; j < subRigs.Particles.Length; j++) { var particles = subRigs.Particles[j]; physicsSettings[i].Vertices[j] = new CubismPhysics3Json.SerializableVertex { Position = new CubismPhysics3Json.SerializableVector2 { X = particles.InitialPosition.X, Y = particles.InitialPosition.Y }, Mobility = particles.Mobility, Delay = particles.Delay, Acceleration = particles.Acceleration, Radius = particles.Radius }; } } var physicsDictionary = new CubismPhysics3Json.SerializablePhysicsDictionary[physicsSettings.Length]; for (int i = 0; i < physicsSettings.Length; i++) { physicsDictionary[i] = new CubismPhysics3Json.SerializablePhysicsDictionary { Id = $"PhysicsSetting{i + 1}", Name = $"Dummy{i + 1}" }; } var physicsJson = new CubismPhysics3Json { Version = 3, Meta = new CubismPhysics3Json.SerializableMeta { PhysicsSettingCount = cubismPhysicsRig.SubRigs.Length, TotalInputCount = cubismPhysicsRig.SubRigs.Sum(x => x.Input.Length), TotalOutputCount = cubismPhysicsRig.SubRigs.Sum(x => x.Output.Length), VertexCount = cubismPhysicsRig.SubRigs.Sum(x => x.Particles.Length), EffectiveForces = new CubismPhysics3Json.SerializableEffectiveForces { Gravity = new CubismPhysics3Json.SerializableVector2 { X = 0, Y = -1 }, Wind = new CubismPhysics3Json.SerializableVector2 { X = 0, Y = 0 } }, PhysicsDictionary = physicsDictionary }, PhysicsSettings = physicsSettings }; return JsonConvert.SerializeObject(physicsJson, Formatting.Indented, new MyJsonConverter2()); } private static byte[] ParseMoc(MonoBehaviour moc) { var reader = moc.reader; reader.Reset(); reader.Position += 28; //PPtr<GameObject> m_GameObject, m_Enabled, PPtr<MonoScript> reader.ReadAlignedString(); //m_Name return reader.ReadBytes(reader.ReadInt32()); } } }
47.053571
170
0.445968
[ "MIT" ]
Perfare/UnityLive2DExtractor
UnityLive2DExtractor/Program.cs
21,114
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine; [Serializable] public class ADInfo { //*****Copyright MAPLELEAF3659***** public int num; public string name; public bool isVideo,isPlayed; public Sprite adSprite; public int reason, angry, concerned; //public ADInfo(Sprite adSprite,float reasonValue,float angryValue,float concernedValue) //{ // this.adSprite = adSprite; // this.reasonValue = reasonValue; // this.angryValue = angryValue; // this.concernedValue = concernedValue; //} }
24.576923
92
0.691706
[ "MIT" ]
MAPLELEAF3659/The-Controlled
Assets/Scripts/Game Scene/ADInfo.cs
641
C#
#region Cumulocity GmbH // /* // * Copyright (C) 2015-2018 // * // * Permission is hereby granted, free of charge, to any person obtaining a copy of // * this software and associated documentation files (the "Software"), // * to deal in the Software without restriction, including without limitation the rights to use, // * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, // * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: // * // * The above copyright notice and this permission notice shall be // * included in all copies or substantial portions of the Software. // * // * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, // * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // */ #endregion using System; using System.Collections.Generic; using System.Linq; using System.Runtime.ExceptionServices; using System.Text; using System.Threading.Tasks; using Cumulocity.MQTT.Enums; using Cumulocity.MQTT.Interfaces; using Cumulocity.MQTT.Model; using MQTTnet; using MQTTnet.Client; using MQTTnet.Protocol; using Serilog; namespace Cumulocity.MQTT { /// <summary> /// Lightweight client for talking to an MQTT server /// </summary> /// <seealso cref="Cumulocity.MQTT.Interfaces.IClient" /> public class MqttCustomSmartRest : IMqttCustomSmartRest { private readonly IMqttClient _mqttClient; public MqttCustomSmartRest(IMqttClient cl) { _mqttClient = cl; } /// <summary> /// Checks the template collection exists. /// </summary> /// <param name="templateCollectionName">Name of the template collection.</param> /// <param name="errorHandlerAsync">The error handler asynchronous.</param> /// <returns></returns> /// <exception cref="ArgumentException">templateCollectionName</exception> public async Task<bool> CheckTemplateCollectionExists(string templateCollectionName, Func<Exception, Task<bool>> errorHandlerAsync) { ExceptionDispatchInfo capturedException = null; if (string.IsNullOrEmpty(templateCollectionName)) throw new ArgumentException(nameof(templateCollectionName)); try { var checkTemplateCollectionExistsMsg = new MqttApplicationMessage { Topic = string.Format("s/ut/{0}", templateCollectionName), Payload = new byte[0], QualityOfServiceLevel = MqttQualityOfServiceLevel.AtLeastOnce, Retain = false }; await _mqttClient.PublishAsync(checkTemplateCollectionExistsMsg); } catch (Exception ex) { capturedException = ExceptionDispatchInfo.Capture(ex); } if (capturedException != null) { var needsThrow = await errorHandlerAsync(capturedException.SourceException).ConfigureAwait(false); if (needsThrow) capturedException.Throw(); return false; } return true; } /// <summary> /// Creates the template data asynchronous. /// </summary> /// <param name="collectionName">Name of the collection.</param> /// <param name="requests">The requests.</param> /// <param name="responses">The responses.</param> /// <param name="processingMode">The processing mode.</param> /// <returns></returns> public async Task<bool> CreateTemplateDataAsync(string collectionName, IEnumerable<Request> requests, IEnumerable<Response> responses, ProcessingMode? processingMode = null) { ExceptionDispatchInfo capturedException = null; try { var stringProcessingMode = GetProcessingMode(processingMode); var messageBody = GetMessageBody(requests, responses); var createPostDataMsg = new MqttApplicationMessage { Topic = string.Format("{0}/ut/{1}", stringProcessingMode, collectionName), Payload = Encoding.UTF8.GetBytes(messageBody), QualityOfServiceLevel = MqttQualityOfServiceLevel.AtLeastOnce, Retain = false }; await _mqttClient.PublishAsync(createPostDataMsg); } catch (Exception ex) { capturedException = ExceptionDispatchInfo.Capture(ex); } if (capturedException != null) { Log.Fatal(capturedException.SourceException, "CreateTemplateDataAsync terminated unexpectedly."); return false; } return true; } /// <summary> /// Sends the request data asynchronous. /// </summary> /// <param name="collectionName">Name of the collection.</param> /// <param name="msgId">The MSG identifier.</param> /// <param name="parameters">The parameters.</param> /// <param name="processingMode">The processing mode.</param> /// <returns></returns> public async Task<bool> SendRequestDataAsync(string collectionName, string msgId, IEnumerable<string> parameters, ProcessingMode? processingMode = null) { ExceptionDispatchInfo capturedException = null; try { var stringProcessingMode = GetProcessingMode(processingMode); var msg = string.Format("{0},{1}", msgId, string.Join(",", parameters.ToArray())); var getInventoryDataMsg = new MqttApplicationMessage { Topic = string.Format("{0}/ut/{1}", stringProcessingMode, collectionName), Payload = Encoding.UTF8.GetBytes(msg), QualityOfServiceLevel = MqttQualityOfServiceLevel.AtLeastOnce, Retain = false }; await _mqttClient.PublishAsync(getInventoryDataMsg); } catch (Exception ex) { capturedException = ExceptionDispatchInfo.Capture(ex); } if (capturedException != null) { Log.Fatal(capturedException.SourceException, "SendRequestDataAsync terminated unexpectedly."); return false; } return true; } /// <summary> /// Subscribes the smart rest asynchronous. /// </summary> /// <param name="collectionName">Name of the collection.</param> /// <returns></returns> public async Task<bool> SubscribeSmartRestAsync(string collectionName) { ExceptionDispatchInfo capturedException = null; try { await _mqttClient.SubscribeAsync(new List<TopicFilter> { new TopicFilter(string.Format("s/dc/{0}", collectionName), MqttQualityOfServiceLevel.AtMostOnce) }); } catch (Exception ex) { capturedException = ExceptionDispatchInfo.Capture(ex); } if (capturedException != null) { Log.Fatal(capturedException.SourceException, "SubscribeSmartRestAsync terminated unexpectedly."); return false; } return true; } /// <summary> /// Creates the get inventory data asynchronous. /// </summary> /// <param name="collectionName">Name of the collection.</param> /// <param name="requests">The requests.</param> /// <param name="responses">The responses.</param> /// <param name="processingMode">The processing mode.</param> /// <returns></returns> public async Task<bool> CreateGetInventoryDataAsync(string collectionName, IEnumerable<Request> requests, IEnumerable<Response> responses, ProcessingMode? processingMode = null) { ExceptionDispatchInfo capturedException = null; try { var stringProcessingMode = GetProcessingMode(processingMode); var messageBody = GetMessageBody(requests, responses); var createInventoryDataMsg = new MqttApplicationMessage { Topic = string.Format("{0}/ut/{1}", stringProcessingMode, collectionName), Payload = Encoding.UTF8.GetBytes(messageBody), QualityOfServiceLevel = MqttQualityOfServiceLevel.AtLeastOnce, Retain = false }; await _mqttClient.PublishAsync(createInventoryDataMsg); } catch (Exception ex) { capturedException = ExceptionDispatchInfo.Capture(ex); } if (capturedException != null) { Log.Fatal(capturedException.SourceException, "CreateGetInventoryDataAsync terminated unexpectedly."); return false; } return true; } private static string GetMessageBody(IEnumerable<Request> requests, IEnumerable<Response> responses) { var requestsMsg = new StringBuilder(); if (requests != null && requests.Any()) foreach (var req in requests) requestsMsg.Append(string.Concat("\r\n", req.RequestTemplate())); var responsesMsg = new StringBuilder(); if (responses != null && responses.Any()) foreach (var resp in responses) responsesMsg.Append(string.Concat("\r\n", "11,", resp.Id, ",", resp.Base, ",", resp.Cond, ",", string.Join(", ", resp.Values.ToArray()))); var messageBody = string.Concat(requestsMsg.ToString(), responsesMsg.ToString()); return messageBody; } private static string GetProcessingMode(ProcessingMode? processingMode) { var stringProcessingMode = "s"; if (processingMode.HasValue && processingMode.Value.Equals(ProcessingMode.TRANSIENT)) stringProcessingMode = "t"; return stringProcessingMode; } } }
39.689781
117
0.593103
[ "MIT" ]
SoftwareAG/cumulocity-sdk-cs
MQTT-SDK/src/MQTT.Client.NetStandard/Client_SmartREST.cs
10,877
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // <auto-generated/> #nullable disable using System.Collections.Generic; using Azure.Core; namespace Azure.Management.Network.Models { /// <summary> Response for ListExpressRouteCircuit API service call. </summary> public partial class ExpressRouteCircuitListResult { /// <summary> Initializes a new instance of ExpressRouteCircuitListResult. </summary> internal ExpressRouteCircuitListResult() { Value = new ChangeTrackingList<ExpressRouteCircuit>(); } /// <summary> Initializes a new instance of ExpressRouteCircuitListResult. </summary> /// <param name="value"> A list of ExpressRouteCircuits in a resource group. </param> /// <param name="nextLink"> The URL to get the next set of results. </param> internal ExpressRouteCircuitListResult(IReadOnlyList<ExpressRouteCircuit> value, string nextLink) { Value = value; NextLink = nextLink; } /// <summary> A list of ExpressRouteCircuits in a resource group. </summary> public IReadOnlyList<ExpressRouteCircuit> Value { get; } /// <summary> The URL to get the next set of results. </summary> public string NextLink { get; } } }
36.27027
105
0.675112
[ "MIT" ]
AbelHu/azure-sdk-for-net
sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/ExpressRouteCircuitListResult.cs
1,342
C#
using System.Globalization; namespace JsonScribe { public sealed class JsonLiteral: JsonElement { private object _literal; public NumberType NumberType { get; private set; } = NumberType.None; private void Init(object literal, JsonType type, NumberType numType = NumberType.None) { _literal = literal ?? throw new JsonException("Literal cannot be null."); Type = type; NumberType = numType; } public static JsonLiteral FromValue(object value) { return new JsonLiteral(value); } public JsonLiteral(object value) { switch (value) { case int i: Init(i, JsonType.Number, NumberType.Integer); break; case double d: Init(d, JsonType.Number, NumberType.Double); break; case string s: Init(s, JsonType.String); break; case bool b: Init(b, JsonType.Boolean); break; default: throw new JsonException("object value is not a valid JSON literal."); } } public JsonLiteral(string value) => Init(value, JsonType.String); public JsonLiteral(int value) => Init(value, JsonType.Number, NumberType.Integer); public JsonLiteral(double value) => Init(value, JsonType.Number, NumberType.Double); public JsonLiteral(bool value) => Init(value, JsonType.Boolean); public string AsString() => (string) _literal; public int AsInt() => (int) _literal; public double AsDouble() => (double) _literal; public bool AsBoolean() => (bool) _literal; public object AsValue() => _literal; public override string ToString() { if(Type == JsonType.String) return (string)_literal; if(Type == JsonType.Boolean) return ((bool) _literal).ToString().ToLower(); if(NumberType == NumberType.Integer) return ((int) _literal).ToString(); return ((double) _literal).ToString(CultureInfo.InvariantCulture); } public override bool Equals(object obj) { if (!(obj is JsonLiteral other)) return false; if (ReferenceEquals(this, other)) return true; if (other.Type != Type) return false; if (other.Type != JsonType.Number || Type != JsonType.Number) return other.AsValue() != _literal; if(other.NumberType != NumberType) return false; return other._literal != _literal; } } }
34.225
109
0.55588
[ "MIT" ]
DallasP9124/JsonLite
JsonScribe/JsonLiteral.cs
2,740
C#
using System; using System.Threading.Tasks; using LeagueOfNews.Core.Interface; using LeagueOfNews.Forms.Interfaces; using MvvmCross.Navigation; using MvvmCross.ViewModels; namespace LeagueOfNews.Forms.ViewModels { public class TabbedRootViewModel : MvxViewModel { private bool _tabsLoaded = false; private readonly ITabsInitService _tabsInitService; private readonly IMvxNavigationService _navigationService; public TabbedRootViewModel(ITabsInitService tabsInitService, IMvxNavigationService navigationService) { _tabsInitService = tabsInitService; _navigationService = navigationService; } public override void ViewAppeared() { base.ViewAppeared(); if (!_tabsLoaded) { MvxNotifyTask.Create(async () => await InitializeViewModels()); } } private async Task InitializeViewModels() { await _navigationService.Navigate<NewsfeedCategoryListViewModel, NewsCategory>(NewsCategory.SurrenderHome); await _navigationService.Navigate<NewsfeedCategoryListViewModel, NewsCategory>(NewsCategory.PBE); await _navigationService.Navigate<NewsfeedCategoryListViewModel, NewsCategory>(NewsCategory.Releases); await _navigationService.Navigate<NewsfeedCategoryListViewModel, NewsCategory>(NewsCategory.RedPosts); await _navigationService.Navigate<NewsfeedCategoryListViewModel, NewsCategory>(NewsCategory.Rotations); await _navigationService.Navigate<NewsfeedCategoryListViewModel, NewsCategory>(NewsCategory.ESports); _tabsLoaded = true; _tabsInitService.TabsLoaded.Invoke(this, EventArgs.Empty); } } }
39.622222
119
0.713965
[ "MIT" ]
MohairApps/SurrenderAt20
LeagueOfNews.Forms/ViewModels/CategoryViewModels/TabbedRootViewModel.cs
1,785
C#
// Plato.NET // Copyright (c) 2017 ReflectSoftware Inc. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using RabbitMQ.Client; using RabbitMQ.Client.Events; using RabbitMQ.Util; using System.IO; namespace Plato.Messaging.RMQ { /// <summary> /// /// </summary> /// <seealso cref="RabbitMQ.Client.DefaultBasicConsumer" /> /// <seealso cref="RabbitMQ.Client.IQueueingBasicConsumer" /> public class RMQBasicConsumer : DefaultBasicConsumer, IQueueingBasicConsumer { /// <summary> /// Creates a fresh <see cref="RMQBasicConsumer" />, /// initializing the <see cref="DefaultBasicConsumer.Model" /> property to null /// and the <see cref="Queue" /> property to a fresh <see cref="SharedQueue" />. /// </summary> public RMQBasicConsumer() : this(null) { } /// <summary> /// Creates a fresh <see cref="RMQBasicConsumer"/>, with <see cref="DefaultBasicConsumer.Model"/> /// set to the argument, and <see cref="Queue"/> set to a fresh <see cref="SharedQueue"/>. /// </summary> public RMQBasicConsumer(IModel model) : this(model, new SharedQueue<BasicDeliverEventArgs>()) { } /// <summary> /// Creates a fresh <see cref="RMQBasicConsumer"/>, /// initializing the <see cref="DefaultBasicConsumer.Model"/> /// and <see cref="Queue"/> properties to the given values. /// </summary> public RMQBasicConsumer(IModel model, SharedQueue<BasicDeliverEventArgs> queue) : base(model) { Queue = queue; } /// <summary> /// Retrieves the <see cref="SharedQueue"/> that messages arrive on. /// </summary> public SharedQueue<BasicDeliverEventArgs> Queue { get; protected set; } /// <summary> /// Overrides <see cref="DefaultBasicConsumer"/>'s <see cref="HandleBasicDeliver"/> implementation, /// building a <see cref="BasicDeliverEventArgs"/> instance and placing it in the Queue. /// </summary> public override void HandleBasicDeliver(string consumerTag, ulong deliveryTag, bool redelivered, string exchange, string routingKey, IBasicProperties properties, byte[] body) { var eventArgs = new BasicDeliverEventArgs { ConsumerTag = consumerTag, DeliveryTag = deliveryTag, Redelivered = redelivered, Exchange = exchange, RoutingKey = routingKey, BasicProperties = properties, Body = body }; try { Queue.Enqueue(eventArgs); } catch(EndOfStreamException) { Queue.Close(); } } /// <summary> /// Overrides <see cref="DefaultBasicConsumer"/>'s OnCancel implementation, /// extending it to call the Close() method of the <see cref="SharedQueue"/>. /// </summary> public override void OnCancel() { base.OnCancel(); Queue.Close(); } } }
34.319588
112
0.564133
[ "Apache-2.0" ]
reflectsoftware/Plato.NET
src/Plato.Messaging.RMQ/RMQBasicConsumer.cs
3,331
C#
/*********************************************************** **项目名称: NPlatform.IServices **功能描述: PositionServices 的摘要说明 **作 者: 此代码由CodeSmith生成。 **版 本 号: 1.0 **创建日期: 2021-11-19 10:36 **修改历史: ************************************************************/ namespace NPlatform.Domains.Services.Sys { using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using NPlatform.Domains.Entity.Sys; using NPlatform.Domains.IService.Sys; using NPlatform.Domains.Service; using NPlatform.DTO.Sys; /// <summary> /// Position 业务层 /// </summary> public partial class PositionService : BaseService< Position,string>,IPositionService { } }
32.821429
98
0.451578
[ "Apache-2.0" ]
Dongliang-y/NMicroAPP
service/NPlatform.Domains/Services/Sys/PositionService.cs
997
C#
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Newtonsoft.Json; namespace Azure.SignalRBench.Messages { public abstract class Message { [JsonProperty(Required = Required.Always)] public string Sender { get; set; } = string.Empty; } }
26.785714
101
0.706667
[ "MIT" ]
Azure/azure-signalr-bench
src/Libs/Messages/Messages/Message.cs
377
C#
using System; using System.Net; using System.Net.Sockets; using System.Threading.Tasks; namespace Kerberos.NET.Server { public class ListenerOptions { public EndPoint ListeningOn { get; set; } public int QueueLength { get; set; } = 1000; public TimeSpan ReceiveTimeout { get; set; } = TimeSpan.FromSeconds(30); public TimeSpan AcceptTimeout { get; set; } = TimeSpan.FromSeconds(30); public int MaxReadBufferSize { get; set; } = 1024 * 1024; public int MaxWriteBufferSize { get; set; } = 64 * 1024; public ILogger Log { get; set; } = new DebugLogger(); public string DefaultRealm { get; set; } public bool IsDebug { get; set; } public Func<string, Task<IRealmService>> RealmLocator { get; set; } } }
25.870968
80
0.638404
[ "MIT" ]
DamirAinullin/Kerberos.NET
Kerberos.NET/Server/ListenerOptions.cs
804
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> //------------------------------------------------------------------------------ namespace Blish_HUD.Properties { using System; /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Blish_HUD.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// </summary> internal static System.Drawing.Icon Ico2039771 { get { object obj = ResourceManager.GetObject("Ico2039771", resourceCulture); return ((System.Drawing.Icon)(obj)); } } } }
42.783784
175
0.602653
[ "MIT" ]
Denrage/Blish-HUD
Blish HUD/Properties/Resources.Designer.cs
3,168
C#
namespace DemoSite.Models.Pages { using System; using System.Collections.Generic; using System.Web; using Business.FakeStore; using KalikoCMS; using KalikoCMS.Attributes; using KalikoCMS.ContentProvider; using KalikoCMS.Core; using KalikoCMS.Mvc; using KalikoCMS.PropertyType; using Lucene.Net.Search; /// <summary> /// This is our product list. Since we want to present products from our already existing /// product database without also storing them in the CMS we us the page extender functionality. /// This is done by implementing IPageExtender and will allow us to handle all calls that are /// "below" our page, like "/products/my-product/" if "products" is our page. /// </summary> [PageType("ProductList", "Product list page", PreviewImage = "/Assets/Images/productlist.png")] public class ProductListPage : CmsPage, IPageExtender { [Property("Headline")] public virtual StringProperty Headline { get; set; } [Property("Main body")] public virtual HtmlProperty MainBody { get; set; } /// <summary> /// This function is required for implementing the IPageExtender interface and will /// be called in order to verify that the requested Url is a part of the extended /// page or not. /// </summary> /// <param name="pageId">The id of the page being extended</param> /// <param name="remainingSegments">The remaining Url segments from the page and on</param> /// <returns></returns> public bool HandleRequest(Guid pageId, string[] remainingSegments) { // We only handle one level of additional paths in this extender if (remainingSegments.Length != 1) { return false; } // Check if this was a called for a valid product in our product database if (FakeProductDatabase.IsValidProduct(remainingSegments[0])) { // It was, so lets execute the Product action in our page controller // (ProductListPageController). The product list page will be passed // to the action by default, but we also need to attach the product id. // This is done by adding it to a dictionary of route values. var page = PageFactory.GetPage(pageId); var additionalRouteData = new Dictionary<string, object> {{"productId", remainingSegments[0]}}; RouteUtils.RedirectToController(page, "product", additionalRouteData); return true; } // Tell the request handler that the requested Url is unknown return false; } } }
45.816667
111
0.636595
[ "MIT" ]
KalikoCMS/DemoSite.Mvc
Models/Pages/ProductListPage.cs
2,751
C#
using System; using System.Collections.Generic; using System.IO; 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; using Sklad_v1_001.Control.FlexMenu; using Sklad_v1_001.FormUsers; using Sklad_v1_001.FormUsers.SupplyDocument; using Sklad_v1_001.FormUsers.Tovar; using Sklad_v1_001.FormUsers.Zacupca; namespace Sklad_v1_001 { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { frameMenu _pageframeMenuLevel1; TovarZona tovarZona; TovarInZona tovarInZona; ZacupcaGrid zacupcaGrid; SupplyDocumentGrid supplyDocumentGrid; NewSupplyDocumentGrid newSupplyDocumentGrid; //public static WorkZona AppWindow; //public MainWindow mailWindows1; public static MainWindow AppWindow; private string path = "log.txt"; public frameMenu PageframeMenuLevel { get { return _pageframeMenuLevel1; } set { _pageframeMenuLevel1 = value; } } public MainWindow() { InitializeComponent(); AppWindow = this; PageframeMenuLevel = new frameMenu(); this.frameMenuLevel1.Navigate(PageframeMenuLevel); //продукты PageframeMenuLevel.ButtonProductOpen += new Action(ButtonProductOpen); PageframeMenuLevel.ButtonProductEditOpen += new Action(ButtonProductEditOpen); //продажи PageframeMenuLevel.ButtonNewSaleDocumentOpen += new Action(ButtonNewSaleDocumentOpen); PageframeMenuLevel.ButtonListSaleDocumentOpen += new Action(ButtonListSaleDocumentOpen); //перемещение PageframeMenuLevel.ButtonTransferDocumentOpen += new Action(ButtonTransferDocumentOpen); //поставки PageframeMenuLevel.ButtonDeliveryOpen += new Action(ButtonDeliveryOpen); //настройки PageframeMenuLevel.ButtonSettingsOpen += new Action(ButtonSettingsOpen); //выход PageframeMenuLevel.ButtonExiteOpen += new Action(ButtonExiteOpen); } #region Product public void ButtonProductOpen() { tovarZona = new TovarZona(); frameWorkArea.Navigate(tovarZona); // открытие страницы } public void ButtonProductEditOpen() { tovarInZona = new TovarInZona(); this.frameWorkArea.Navigate(tovarInZona); } public void ButtonProductEditOpenF(FormUsers.Tovar.LocalRow _localRow) { tovarInZona = new TovarInZona(); tovarInZona.LocalRow = _localRow; this.frameWorkArea.Navigate(tovarInZona); } #endregion #region Продажи public void ButtonNewSaleDocumentOpen() { } private void ButtonListSaleDocumentOpen() { } #endregion #region перемещение public void ButtonTransferDocumentOpen() { } #endregion #region поставки private void ButtonDeliveryOpen() { // zacupcaGrid = new ZacupcaGrid(); supplyDocumentGrid = new SupplyDocumentGrid(); frameWorkArea.Navigate(supplyDocumentGrid); // открытие страницы } public void ButtonNewSupplyDocument(FormUsers.SupplyDocument.LocalRow document) { newSupplyDocumentGrid = new NewSupplyDocumentGrid(); newSupplyDocumentGrid.Document = document; this.frameWorkArea.Navigate(newSupplyDocumentGrid); } #endregion #region настройки private void ButtonSettingsOpen() { } #endregion #region выход private void ButtonExiteOpen() { } #endregion private void MainWindows_Loaded(object sender, RoutedEventArgs e) { Log("Loaded"); } private void MainWindows_Closing(object sender, System.ComponentModel.CancelEventArgs e) { Log("Closing"); } private void MainWindows_Closed(object sender, EventArgs e) { Log("Closed"); } private void Log(string eventName) { using (StreamWriter Logger = new StreamWriter(path, true)) { Logger.WriteLine(DateTime.Now.ToLongTimeString() + " - " + eventName); } } private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { } private void Open_Click(object sender, RoutedEventArgs e) { ////Osnovnou.Content=new FormUsers.Form2(); //this.Height = 961; //this.Width = 1241; //this.Main.Margin = new Thickness(1, 1, 1, 1); //Autorizaciy.Visibility = Visibility.Collapsed; //Main.Content = new WorkZona(); //Main.NavigationService.Navigate(new Uri("WorkZona.xaml", UriKind.Relative)); //Main.Content = new Page1(); } private void Main_Navigated(object sender, NavigationEventArgs e) { } private void frameWorkArea_Navigating(object sender, NavigatingCancelEventArgs e) { } } }
28.565
100
0.609312
[ "BSD-2-Clause" ]
AlexeyPostika/Sklad
Sklad_v1_001/MainWindow.xaml.cs
5,835
C#
// <copyright file="ISearch.cs" company="Automate The Planet Ltd."> // Copyright 2018 Automate The Planet Ltd. // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. // You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // </copyright> // <author>Anton Angelov</author> // <site>http://automatetheplanet.com/</site> namespace HybridTestFramework.UITests.Core.Controls { public interface ISearch : IContentElement { string Text { get; set; } void SimulateRealTyping(string valueToBeTyped); } }
39.875
85
0.736677
[ "Apache-2.0" ]
FrancielleWN/AutomateThePlanet-Learning-Series
Design-Architecture-Series/HybridTestFramework.UITests.Core/Controls/ISearch.cs
959
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Repository")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Repository")] [assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("0cd552c5-4bbb-4471-878a-4866fc27831c")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
37.513514
84
0.747118
[ "Unlicense" ]
gywerd/ClientServer
Client/Repository/Properties/AssemblyInfo.cs
1,391
C#
namespace LocalStorage { public interface IDataTransform : IDataTransformSync, IDataTransformAsync { } public interface IDataTransformSync { byte[] Apply(byte[] data); byte[] Reverse(byte[] data); } public interface IDataTransformAsync { #if !DISABLE_UNITASK_SUPPORT && UNITASK_SUPPORT Cysharp.Threading.Tasks.UniTask<byte[]> ApplyAsync(byte[] data); #else System.Threading.Tasks.Task<byte[]> ApplyAsync(byte[] data); #endif #if !DISABLE_UNITASK_SUPPORT && UNITASK_SUPPORT Cysharp.Threading.Tasks.UniTask<byte[]> ReverseAsync(byte[] data); #else System.Threading.Tasks.Task<byte[]> ReverseAsync(byte[] data); #endif } }
26.964286
77
0.64106
[ "MIT" ]
CorundumGames/LocalStorage
Packages/LocalStorage/Runtime/IDataTransform.cs
755
C#
using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Threading.Tasks; using SeqCli.PlainText; using SeqCli.PlainText.Framing; using SeqCli.PlainText.Parsers; using Superpower; using Superpower.Model; using Superpower.Parsers; using Xunit; namespace SeqCli.Tests.PlainText { public class FrameReaderTests { [Fact] public async Task SplitsLinesIntoFrames() { var source = new StringBuilder(); source.AppendLine("first"); source.AppendLine("second"); var reader = new FrameReader( new StringReader(source.ToString()), SpanEx.MatchedBy(Character.Letter), TimeSpan.FromMilliseconds(1)); var first = await reader.TryReadAsync(); Assert.True(first.HasValue); Assert.Equal("first" + Environment.NewLine, first.Value); var second = await reader.TryReadAsync(); Assert.True(second.HasValue); Assert.Equal("second" + Environment.NewLine, second.Value); var empty = await reader.TryReadAsync(); Assert.False(empty.HasValue); } [Fact] public async Task TerminatesWhenNoLinesArePresent() { var reader = new FrameReader( new StringReader(""), SpanEx.MatchedBy(Character.Letter), TimeSpan.FromMilliseconds(1)); var none = await reader.TryReadAsync(); Assert.False(none.HasValue); } [Fact] public async Task CollectsTrailingLines() { var source = new StringBuilder(); source.AppendLine("first"); source.AppendLine(" some more"); source.AppendLine(" and more"); source.AppendLine("second"); source.AppendLine("third"); source.AppendLine(" and yet more"); var frames = await ReadAllFrames(source.ToString(), SpanEx.MatchedBy(Character.Letter)); Assert.Equal(3, frames.Length); Assert.StartsWith("first", frames[0].Value); Assert.EndsWith("and more" + Environment.NewLine, frames[0].Value); } static async Task<Frame[]> ReadAllFrames(string source, TextParser<TextSpan> frameStart) { var reader = new FrameReader( new StringReader(source), frameStart, TimeSpan.FromMilliseconds(10)); var result = new List<Frame>(); var frame = await reader.TryReadAsync(); while (frame.HasValue) { result.Add(frame); frame = await reader.TryReadAsync(); } return result.ToArray(); } } }
32.088889
100
0.561288
[ "Apache-2.0" ]
nblumhardt/seqcli
test/SeqCli.Tests/PlainText/FrameReaderTests.cs
2,890
C#
using Polygon.Entities; namespace Polygon.Models { /// <summary> /// The model class for judging run summary. /// </summary> public class RunSummary { /// <summary> /// The judging ID /// </summary> public int JudgingId { get; set; } /// <summary> /// The final verdict /// </summary> public Verdict FinalVerdict { get; set; } /// <summary> /// The encountered testcases /// </summary> public int Testcases { get; set; } /// <summary> /// The highest execution memory /// </summary> public int HighestMemory { get; set; } /// <summary> /// The longest running time /// </summary> public int LongestTime { get; set; } /// <summary> /// The total score /// </summary> public int TotalScore { get; set; } } }
22.658537
49
0.496233
[ "MIT" ]
namofun/polygon
src/Abstraction/Models/RunSummary.cs
931
C#
using ChoETL.NACHA; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ChoETL.NACHATest { class Program { static void Main(string[] args) { ChoETLFrxBootstrap.TraceLevel = System.Diagnostics.TraceLevel.Verbose; ReadACHFile(); } static void ReadACHFile() { foreach (var r in new ChoNACHAReader("20151027B0000327P018CHK.ACH")) { Console.WriteLine(r.ToStringEx()); } } static void WriteACHFile() { ChoETLFrxBootstrap.TraceLevel = System.Diagnostics.TraceLevel.Verbose; ChoNACHAConfiguration config = new ChoNACHAConfiguration(); config.DestinationBankRoutingNumber = " 123456789"; config.OriginatingCompanyId = "1234567890"; config.DestinationBankName = "PNC Bank"; config.OriginatingCompanyName = "Microsoft Inc."; config.ReferenceCode = "Internal Use Only."; //config.TurnOffOriginatingCompanyIdValidation = true; config.ErrorMode = ChoErrorMode.ThrowAndStop; //config.BlockingFactor = 20; using (var nachaWriter = new ChoNACHAWriter(@"C:\Temp\ACH.txt", config) ) { using (var bw1 = nachaWriter.CreateBatch(200)) { //using (var entry1 = bw1.CreateDebitEntryDetail(22, "123456789", "1313131313", 22.505M, null, "ID Name", "Desc Data")) //{ // entry1.CreateAddendaRecord("Monthly bill"); //} //using (var entry2 = bw1.CreateCreditEntryDetail(22, "123456789", "1313131313", 22.505M, null, "ID Name", "Desc Data")) //{ //} //using (var entry1 = bw1.CreateDebitEntryDetail(22, "123456789", "1313131313", 22.505M, null, "ID Name", "Desc Data")) //{ // entry1.CreateAddendaRecord("Monthly bill"); //} using (var entry2 = bw1.CreateCreditEntryDetail(22, "123456789", "1313131313", 10M, null, "ID Name", "Desc Data")) { } //using (var entry1 = bw1.CreateDebitEntryDetail(22, "123456789", "1313131313", 22.505M, null, "ID Name", "Desc Data")) //{ // entry1.CreateAddendaRecord("Monthly bill"); //} using (var entry2 = bw1.CreateCreditEntryDetail(22, "123456789", "1313131313", 20M, null, "ID Name", "Desc Data")) { } //Create offset record using (var entry2 = bw1.CreateDebitEntryDetail(27, "123456789", "1313131313", 30M, null, "OFFSET", "")) { } using (var entry2 = bw1.CreateDebitEntryDetail(27, "123456789", "1313131313", 30M, null, "OFFSET", "")) { } using (var entry2 = bw1.CreateDebitEntryDetail(27, "123456789", "1313131313", 30M, null, "OFFSET", "")) { } using (var entry2 = bw1.CreateDebitEntryDetail(27, "123456789", "1313131313", 30M, null, "OFFSET", "")) { } using (var entry2 = bw1.CreateDebitEntryDetail(27, "123456789", "1313131313", 30M, null, "OFFSET", "")) { } using (var entry2 = bw1.CreateDebitEntryDetail(27, "123456789", "1313131313", 30M, null, "OFFSET", "")) { } using (var entry2 = bw1.CreateDebitEntryDetail(27, "123456789", "1313131313", 30M, null, "OFFSET", "")) { } using (var entry2 = bw1.CreateDebitEntryDetail(27, "123456789", "1313131313", 30M, null, "OFFSET", "")) { } using (var entry2 = bw1.CreateDebitEntryDetail(27, "123456789", "1313131313", 30M, null, "OFFSET", "")) { } } //using (var bw2 = nachaWriter.CreateBatch(200)) //{ //} } } } }
39.086957
140
0.488988
[ "MIT" ]
ECody/ChoETL.NACHA
ChoETL.NACHATest/Program.cs
4,497
C#
using System; using System.Runtime.InteropServices; // Make no promises to maintain public services. [assembly: ComVisible(false)] // Roller is an API consumer, not an API provider, so CLS Compliance is not needed. [assembly: CLSCompliant(false)]
27.666667
83
0.7751
[ "MIT" ]
mxashlynn/Scribe
Roller/AssemblyInfo.cs
249
C#
namespace UblTr.Common { [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace = "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2")] [System.Xml.Serialization.XmlRootAttribute("ExchangeRate", Namespace = "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2", IsNullable = false)] public partial class ExchangeRateType { private SourceCurrencyCodeType sourceCurrencyCodeField; private TargetCurrencyCodeType targetCurrencyCodeField; private CalculationRateType calculationRateField; private DateType1 dateField; /// <remarks/> [System.Xml.Serialization.XmlElementAttribute(Namespace = "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2")] public SourceCurrencyCodeType SourceCurrencyCode { get { return this.sourceCurrencyCodeField; } set { this.sourceCurrencyCodeField = value; } } /// <remarks/> [System.Xml.Serialization.XmlElementAttribute(Namespace = "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2")] public TargetCurrencyCodeType TargetCurrencyCode { get { return this.targetCurrencyCodeField; } set { this.targetCurrencyCodeField = value; } } /// <remarks/> [System.Xml.Serialization.XmlElementAttribute(Namespace = "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2")] public CalculationRateType CalculationRate { get { return this.calculationRateField; } set { this.calculationRateField = value; } } /// <remarks/> [System.Xml.Serialization.XmlElementAttribute(Namespace = "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2")] public DateType1 Date { get { return this.dateField; } set { this.dateField = value; } } } }
32.733333
171
0.599593
[ "MIT" ]
enisgurkann/UblTr
Ubl-Tr/Common/CommonAggregateComponents/ExchangeRateType.cs
2,455
C#
using System; using System.Linq; namespace Xamarin.Forms { [Xaml.ProvideCompiled("Xamarin.Forms.Core.XamlC.ColorTypeConverter")] public class ColorTypeConverter : TypeConverter { public override object ConvertFromInvariantString(string value) { if (value != null) { if (value.Trim().StartsWith("#", StringComparison.Ordinal)) return Color.FromHex(value); string[] parts = value.Split('.'); if (parts.Length == 1 || (parts.Length == 2 && parts[0] == "Color")) { string color = parts[parts.Length - 1]; switch (color) { case "Default": return Color.Default; case "Accent": return Color.Accent; case "AliceBlue": return Color.AliceBlue; case "AntiqueWhite": return Color.AntiqueWhite; case "Aqua": return Color.Aqua; case "Aquamarine": return Color.Aquamarine; case "Azure": return Color.Azure; case "Beige": return Color.Beige; case "Bisque": return Color.Bisque; case "Black": return Color.Black; case "BlanchedAlmond": return Color.BlanchedAlmond; case "Blue": return Color.Blue; case "BlueViolet": return Color.BlueViolet; case "Brown": return Color.Brown; case "BurlyWood": return Color.BurlyWood; case "CadetBlue": return Color.CadetBlue; case "Chartreuse": return Color.Chartreuse; case "Chocolate": return Color.Chocolate; case "Coral": return Color.Coral; case "CornflowerBlue": return Color.CornflowerBlue; case "Cornsilk": return Color.Cornsilk; case "Crimson": return Color.Crimson; case "Cyan": return Color.Cyan; case "DarkBlue": return Color.DarkBlue; case "DarkCyan": return Color.DarkCyan; case "DarkGoldenrod": return Color.DarkGoldenrod; case "DarkGray": return Color.DarkGray; case "DarkGreen": return Color.DarkGreen; case "DarkKhaki": return Color.DarkKhaki; case "DarkMagenta": return Color.DarkMagenta; case "DarkOliveGreen": return Color.DarkOliveGreen; case "DarkOrange": return Color.DarkOrange; case "DarkOrchid": return Color.DarkOrchid; case "DarkRed": return Color.DarkRed; case "DarkSalmon": return Color.DarkSalmon; case "DarkSeaGreen": return Color.DarkSeaGreen; case "DarkSlateBlue": return Color.DarkSlateBlue; case "DarkSlateGray": return Color.DarkSlateGray; case "DarkTurquoise": return Color.DarkTurquoise; case "DarkViolet": return Color.DarkViolet; case "DeepPink": return Color.DeepPink; case "DeepSkyBlue": return Color.DeepSkyBlue; case "DimGray": return Color.DimGray; case "DodgerBlue": return Color.DodgerBlue; case "Firebrick": return Color.Firebrick; case "FloralWhite": return Color.FloralWhite; case "ForestGreen": return Color.ForestGreen; case "Fuchsia": return Color.Fuchsia; case "Gainsboro": return Color.Gainsboro; case "GhostWhite": return Color.GhostWhite; case "Gold": return Color.Gold; case "Goldenrod": return Color.Goldenrod; case "Gray": return Color.Gray; case "Green": return Color.Green; case "GreenYellow": return Color.GreenYellow; case "Honeydew": return Color.Honeydew; case "HotPink": return Color.HotPink; case "IndianRed": return Color.IndianRed; case "Indigo": return Color.Indigo; case "Ivory": return Color.Ivory; case "Khaki": return Color.Khaki; case "Lavender": return Color.Lavender; case "LavenderBlush": return Color.LavenderBlush; case "LawnGreen": return Color.LawnGreen; case "LemonChiffon": return Color.LemonChiffon; case "LightBlue": return Color.LightBlue; case "LightCoral": return Color.LightCoral; case "LightCyan": return Color.LightCyan; case "LightGoldenrodYellow": return Color.LightGoldenrodYellow; case "LightGray": return Color.LightGray; case "LightGreen": return Color.LightGreen; case "LightPink": return Color.LightPink; case "LightSalmon": return Color.LightSalmon; case "LightSeaGreen": return Color.LightSeaGreen; case "LightSkyBlue": return Color.LightSkyBlue; case "LightSlateGray": return Color.LightSlateGray; case "LightSteelBlue": return Color.LightSteelBlue; case "LightYellow": return Color.LightYellow; case "Lime": return Color.Lime; case "LimeGreen": return Color.LimeGreen; case "Linen": return Color.Linen; case "Magenta": return Color.Magenta; case "Maroon": return Color.Maroon; case "MediumAquamarine": return Color.MediumAquamarine; case "MediumBlue": return Color.MediumBlue; case "MediumOrchid": return Color.MediumOrchid; case "MediumPurple": return Color.MediumPurple; case "MediumSeaGreen": return Color.MediumSeaGreen; case "MediumSlateBlue": return Color.MediumSlateBlue; case "MediumSpringGreen": return Color.MediumSpringGreen; case "MediumTurquoise": return Color.MediumTurquoise; case "MediumVioletRed": return Color.MediumVioletRed; case "MidnightBlue": return Color.MidnightBlue; case "MintCream": return Color.MintCream; case "MistyRose": return Color.MistyRose; case "Moccasin": return Color.Moccasin; case "NavajoWhite": return Color.NavajoWhite; case "Navy": return Color.Navy; case "OldLace": return Color.OldLace; case "Olive": return Color.Olive; case "OliveDrab": return Color.OliveDrab; case "Orange": return Color.Orange; case "OrangeRed": return Color.OrangeRed; case "Orchid": return Color.Orchid; case "PaleGoldenrod": return Color.PaleGoldenrod; case "PaleGreen": return Color.PaleGreen; case "PaleTurquoise": return Color.PaleTurquoise; case "PaleVioletRed": return Color.PaleVioletRed; case "PapayaWhip": return Color.PapayaWhip; case "PeachPuff": return Color.PeachPuff; case "Peru": return Color.Peru; case "Pink": return Color.Pink; case "Plum": return Color.Plum; case "PowderBlue": return Color.PowderBlue; case "Purple": return Color.Purple; case "Red": return Color.Red; case "RosyBrown": return Color.RosyBrown; case "RoyalBlue": return Color.RoyalBlue; case "SaddleBrown": return Color.SaddleBrown; case "Salmon": return Color.Salmon; case "SandyBrown": return Color.SandyBrown; case "SeaGreen": return Color.SeaGreen; case "SeaShell": return Color.SeaShell; case "Sienna": return Color.Sienna; case "Silver": return Color.Silver; case "SkyBlue": return Color.SkyBlue; case "SlateBlue": return Color.SlateBlue; case "SlateGray": return Color.SlateGray; case "Snow": return Color.Snow; case "SpringGreen": return Color.SpringGreen; case "SteelBlue": return Color.SteelBlue; case "Tan": return Color.Tan; case "Teal": return Color.Teal; case "Thistle": return Color.Thistle; case "Tomato": return Color.Tomato; case "Transparent": return Color.Transparent; case "Turquoise": return Color.Turquoise; case "Violet": return Color.Violet; case "Wheat": return Color.Wheat; case "White": return Color.White; case "WhiteSmoke": return Color.WhiteSmoke; case "Yellow": return Color.Yellow; case "YellowGreen": return Color.YellowGreen; } var field = typeof(Color).GetFields().FirstOrDefault(fi => fi.IsStatic && fi.Name == color); if (field != null) return (Color)field.GetValue(null); var property = typeof(Color).GetProperties().FirstOrDefault(pi => pi.Name == color && pi.CanRead && pi.GetMethod.IsStatic); if (property != null) return (Color)property.GetValue(null, null); } } throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(Color)}"); } } }
43.965909
128
0.694107
[ "MIT" ]
johot/Xamarin.Forms.2.3.4
Xamarin.Forms.Core/ColorTypeConverter.cs
7,738
C#
// Copyright (c) 2013 SIL International // This software is licensed under the MIT license (http://opensource.org/licenses/MIT) using System; namespace Icu.Collation { /// <summary> /// When turned on, this attribute positions Hiragana before all /// non-ignorables on quaternary level This is a sneaky way to produce JIS /// sort order /// </summary> [Obsolete("ICU 50 Implementation detail, cannot be set via API, was removed from implementation.")] public enum HiraganaQuaternary { /// <summary> /// Default value, does nothing. /// </summary> Default = -1, /// <summary> /// Turns off ability to position Hiragana before all non-ignorables on /// quaternary level. /// </summary> Off = 16, /// <summary> /// positions Hiragana before all non-ignorables on quaternary level. /// </summary> On = 17 } }
27.193548
100
0.685647
[ "MIT" ]
atlastodor/icu-dotnet
source/icu.net/Collation/HiraganaQuaternary.cs
845
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("DAL")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DAL")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("ce2df787-8e35-4412-b953-4496e21bd0df")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
37.27027
84
0.741842
[ "MIT" ]
e11en/WFDemo
WF 4.5 Demo/DAL/Properties/AssemblyInfo.cs
1,382
C#
namespace PROProtocol { public class InventoryItem { public string Name { get; } public int Id { get; } public int Quantity { get; } public int Scope { get; } public InventoryItem(int id, int quantity, int scope) { Name = ItemsDatabase.Instance.GetItemName(id); Id = id; Quantity = quantity; Scope = scope; } public bool CanBeHeld => Scope != 6 && Scope != 7 && Scope != 10 && (Scope != 9 || !Name.StartsWith("HM")); public bool CanBeUsedOutsideOfBattle => Scope == 8 || Scope == 10 || Scope == 15; public bool CanBeUsedOnPokemonOutsideOfBattle => Scope == 2 || Scope == 3 || Scope == 9 || Scope == 13 || Scope == 14 || Scope == 17; public bool CanBeUsedInBattle => Scope == 5; public bool CanBeUsedOnPokemonInBattle => Scope == 2 || Scope == 17; } }
32.482759
142
0.53397
[ "MIT" ]
DubsCheckum/proshine
PROProtocol/InventoryItem.cs
944
C#
using System.Collections.Generic; using Microsoft.Rest.Azure; using Microsoft.Rest.Azure.OData; using Microsoft.Azure.Management.Media; using Microsoft.Azure.Management.Media.Models; namespace AzureSkyMedia.PlatformServices { internal partial class MediaClient { public int GetEntityCount<T>(MediaEntity entityType) where T : Resource { T[] entities = GetAllEntities<T>(entityType); return entities.Length; } public int GetEntityCount<T1, T2>(MediaEntity entityType, MediaEntity parentType) where T1 : Resource where T2 : Resource { T1[] entities = GetAllEntities<T1, T2>(entityType, parentType); return entities.Length; } public T1[] GetAllEntities<T1, T2>(MediaEntity entityType, MediaEntity parentType) where T1 : Resource where T2 : Resource { List<T1> allEntities = new List<T1>(); IPage<T2> parentEntities = GetEntities<T2>(parentType); while (parentEntities != null) { foreach (T2 parentEntity in parentEntities) { T1[] childEntities = GetAllEntities<T1>(entityType, parentEntity.Name); allEntities.AddRange(childEntities); } parentEntities = NextEntities(entityType, parentEntities); } return allEntities.ToArray(); } public T[] GetAllEntities<T>(MediaEntity entityType, string parentName = null, string queryFilter = null) where T : Resource { List<T> allEntities = new List<T>(); IPage<T> entities = GetEntities<T>(entityType, parentName, queryFilter); while (entities != null) { allEntities.AddRange(entities); entities = NextEntities(entityType, entities); } return allEntities.ToArray(); } public IPage<T> GetEntities<T>(MediaEntity entityType, string parentName = null, string queryFilter = null) where T : Resource { IPage<T> entities = null; switch (entityType) { case MediaEntity.Asset: ODataQuery<Asset> assetQuery = new ODataQuery<Asset>() { Filter = queryFilter }; entities = (IPage<T>)_media.Assets.List(MediaAccount.ResourceGroupName, MediaAccount.Name, assetQuery); break; case MediaEntity.Transform: ODataQuery<Transform> transformQuery = new ODataQuery<Transform>() { Filter = queryFilter }; entities = (IPage<T>)_media.Transforms.List(MediaAccount.ResourceGroupName, MediaAccount.Name, transformQuery); break; case MediaEntity.TransformJob: ODataQuery<Job> transformJobQuery = new ODataQuery<Job>() { Filter = queryFilter }; entities = (IPage<T>)_media.Jobs.List(MediaAccount.ResourceGroupName, MediaAccount.Name, parentName, transformJobQuery); break; case MediaEntity.ContentKeyPolicy: ODataQuery<ContentKeyPolicy> contentKeyPolicyQuery = new ODataQuery<ContentKeyPolicy>() { Filter = queryFilter }; entities = (IPage<T>)_media.ContentKeyPolicies.List(MediaAccount.ResourceGroupName, MediaAccount.Name, contentKeyPolicyQuery); break; case MediaEntity.StreamingPolicy: ODataQuery<StreamingPolicy> streamingPolicyQuery = new ODataQuery<StreamingPolicy>() { Filter = queryFilter }; entities = (IPage<T>)_media.StreamingPolicies.List(MediaAccount.ResourceGroupName, MediaAccount.Name, streamingPolicyQuery); break; case MediaEntity.StreamingEndpoint: entities = (IPage<T>)_media.StreamingEndpoints.List(MediaAccount.ResourceGroupName, MediaAccount.Name); break; case MediaEntity.StreamingLocator: ODataQuery<StreamingLocator> streamingLocatorQuery = new ODataQuery<StreamingLocator>() { Filter = queryFilter }; entities = (IPage<T>)_media.StreamingLocators.List(MediaAccount.ResourceGroupName, MediaAccount.Name, streamingLocatorQuery); break; case MediaEntity.StreamingFilterAccount: entities = (IPage<T>)_media.AccountFilters.List(MediaAccount.ResourceGroupName, MediaAccount.Name); break; case MediaEntity.StreamingFilterAsset: entities = (IPage<T>)_media.AssetFilters.List(MediaAccount.ResourceGroupName, MediaAccount.Name, parentName); break; case MediaEntity.LiveEvent: entities = (IPage<T>)_media.LiveEvents.List(MediaAccount.ResourceGroupName, MediaAccount.Name); break; case MediaEntity.LiveEventOutput: entities = (IPage<T>)_media.LiveOutputs.List(MediaAccount.ResourceGroupName, MediaAccount.Name, parentName); break; } return entities; } public IPage<T> NextEntities<T>(MediaEntity entityType, IPage<T> currentPage) { IPage<T> entities = null; if (!string.IsNullOrEmpty(currentPage.NextPageLink)) { switch (entityType) { case MediaEntity.Asset: entities = (IPage<T>)_media.Assets.ListNext(currentPage.NextPageLink); break; case MediaEntity.Transform: entities = (IPage<T>)_media.Transforms.ListNext(currentPage.NextPageLink); break; case MediaEntity.TransformJob: entities = (IPage<T>)_media.Jobs.ListNext(currentPage.NextPageLink); break; case MediaEntity.ContentKeyPolicy: entities = (IPage<T>)_media.ContentKeyPolicies.ListNext(currentPage.NextPageLink); break; case MediaEntity.StreamingPolicy: entities = (IPage<T>)_media.StreamingPolicies.ListNext(currentPage.NextPageLink); break; case MediaEntity.StreamingEndpoint: entities = (IPage<T>)_media.StreamingEndpoints.ListNext(currentPage.NextPageLink); break; case MediaEntity.StreamingLocator: entities = (IPage<T>)_media.StreamingLocators.ListNext(currentPage.NextPageLink); break; case MediaEntity.StreamingFilterAccount: entities = (IPage<T>)_media.AccountFilters.ListNext(currentPage.NextPageLink); break; case MediaEntity.StreamingFilterAsset: entities = (IPage<T>)_media.AssetFilters.ListNext(currentPage.NextPageLink); break; case MediaEntity.LiveEvent: entities = (IPage<T>)_media.LiveEvents.ListNext(currentPage.NextPageLink); break; case MediaEntity.LiveEventOutput: entities = (IPage<T>)_media.LiveOutputs.ListNext(currentPage.NextPageLink); break; } } return entities; } public T GetEntity<T>(MediaEntity entityType, string entityName, string parentName = null) where T : Resource { T entity = default(T); switch (entityType) { case MediaEntity.Asset: entity = _media.Assets.Get(MediaAccount.ResourceGroupName, MediaAccount.Name, entityName) as T; break; case MediaEntity.Transform: entity = _media.Transforms.Get(MediaAccount.ResourceGroupName, MediaAccount.Name, entityName) as T; break; case MediaEntity.TransformJob: entity = _media.Jobs.Get(MediaAccount.ResourceGroupName, MediaAccount.Name, parentName, entityName) as T; break; case MediaEntity.ContentKeyPolicy: entity = _media.ContentKeyPolicies.Get(MediaAccount.ResourceGroupName, MediaAccount.Name, entityName) as T; break; case MediaEntity.StreamingPolicy: entity = _media.StreamingPolicies.Get(MediaAccount.ResourceGroupName, MediaAccount.Name, entityName) as T; break; case MediaEntity.StreamingEndpoint: entity = _media.StreamingEndpoints.Get(MediaAccount.ResourceGroupName, MediaAccount.Name, entityName) as T; break; case MediaEntity.StreamingLocator: entity = _media.StreamingLocators.Get(MediaAccount.ResourceGroupName, MediaAccount.Name, entityName) as T; break; case MediaEntity.StreamingFilterAccount: entity = _media.AccountFilters.Get(MediaAccount.ResourceGroupName, MediaAccount.Name, entityName) as T; break; case MediaEntity.StreamingFilterAsset: entity = _media.AssetFilters.Get(MediaAccount.ResourceGroupName, MediaAccount.Name, parentName, entityName) as T; break; case MediaEntity.LiveEvent: entity = _media.LiveEvents.Get(MediaAccount.ResourceGroupName, MediaAccount.Name, entityName) as T; break; case MediaEntity.LiveEventOutput: entity = _media.LiveOutputs.Get(MediaAccount.ResourceGroupName, MediaAccount.Name, parentName, entityName) as T; break; } return entity; } public void DeleteEntity(MediaEntity entityType, string entityName, string parentName = null) { switch (entityType) { case MediaEntity.Asset: _media.Assets.Delete(MediaAccount.ResourceGroupName, MediaAccount.Name, entityName); using (DatabaseClient databaseClient = new DatabaseClient(true)) { string collectionId = Constant.Database.Collection.MediaAssets; databaseClient.DeleteDocument(collectionId, entityName); } break; case MediaEntity.Transform: Job[] jobs = GetAllEntities<Job>(MediaEntity.TransformJob, entityName); foreach (Job job in jobs) { DeleteEntity(MediaEntity.TransformJob, job.Name, entityName); } _media.Transforms.Delete(MediaAccount.ResourceGroupName, MediaAccount.Name, entityName); break; case MediaEntity.TransformJob: _media.Jobs.Delete(MediaAccount.ResourceGroupName, MediaAccount.Name, parentName, entityName); break; case MediaEntity.ContentKeyPolicy: _media.ContentKeyPolicies.Delete(MediaAccount.ResourceGroupName, MediaAccount.Name, entityName); break; case MediaEntity.StreamingPolicy: _media.StreamingPolicies.Delete(MediaAccount.ResourceGroupName, MediaAccount.Name, entityName); break; case MediaEntity.StreamingEndpoint: _media.StreamingEndpoints.Delete(MediaAccount.ResourceGroupName, MediaAccount.Name, entityName); break; case MediaEntity.StreamingLocator: _media.StreamingLocators.Delete(MediaAccount.ResourceGroupName, MediaAccount.Name, entityName); break; case MediaEntity.StreamingFilterAccount: _media.AccountFilters.Delete(MediaAccount.ResourceGroupName, MediaAccount.Name, entityName); break; case MediaEntity.StreamingFilterAsset: _media.AssetFilters.Delete(MediaAccount.ResourceGroupName, MediaAccount.Name, parentName, entityName); break; case MediaEntity.LiveEvent: LiveEvent liveEvent = GetEntity<LiveEvent>(MediaEntity.LiveEvent, entityName); if (liveEvent != null) { LiveOutput[] liveOutputs = GetAllEntities<LiveOutput>(MediaEntity.LiveEventOutput, entityName); foreach (LiveOutput liveOutput in liveOutputs) { _media.LiveOutputs.Delete(MediaAccount.ResourceGroupName, MediaAccount.Name, entityName, liveOutput.Name); } _media.LiveEvents.Delete(MediaAccount.ResourceGroupName, MediaAccount.Name, entityName); } break; case MediaEntity.LiveEventOutput: _media.LiveOutputs.Delete(MediaAccount.ResourceGroupName, MediaAccount.Name, parentName, entityName); break; } } } }
52.666667
146
0.565665
[ "MIT" ]
Akash76/SkyMedia
PlatformServices/Clients/MediaClientEntity.cs
13,906
C#
/* * 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 System.Collections.Generic; using Aliyun.Acs.Core; using Aliyun.Acs.Core.Http; using Aliyun.Acs.Core.Transform; using Aliyun.Acs.Core.Utils; using Aliyun.Acs.Ecs.Transform; using Aliyun.Acs.Ecs.Transform.V20140526; namespace Aliyun.Acs.Ecs.Model.V20140526 { public class DescribeTaskAttributeRequest : RpcAcsRequest<DescribeTaskAttributeResponse> { public DescribeTaskAttributeRequest() : base("Ecs", "2014-05-26", "DescribeTaskAttribute", "ecs", "openAPI") { if (this.GetType().GetProperty("ProductEndpointMap") != null && this.GetType().GetProperty("ProductEndpointType") != null) { this.GetType().GetProperty("ProductEndpointMap").SetValue(this, Endpoint.endpointMap, null); this.GetType().GetProperty("ProductEndpointType").SetValue(this, Endpoint.endpointRegionalType, null); } } private long? resourceOwnerId; private string taskId; private string resourceOwnerAccount; private long? ownerId; public long? ResourceOwnerId { get { return resourceOwnerId; } set { resourceOwnerId = value; DictionaryUtil.Add(QueryParameters, "ResourceOwnerId", value.ToString()); } } public string TaskId { get { return taskId; } set { taskId = value; DictionaryUtil.Add(QueryParameters, "TaskId", value); } } public string ResourceOwnerAccount { get { return resourceOwnerAccount; } set { resourceOwnerAccount = value; DictionaryUtil.Add(QueryParameters, "ResourceOwnerAccount", value); } } public long? OwnerId { get { return ownerId; } set { ownerId = value; DictionaryUtil.Add(QueryParameters, "OwnerId", value.ToString()); } } public override DescribeTaskAttributeResponse GetResponse(UnmarshallerContext unmarshallerContext) { return DescribeTaskAttributeResponseUnmarshaller.Unmarshall(unmarshallerContext); } } }
26.87963
134
0.67723
[ "Apache-2.0" ]
bbs168/aliyun-openapi-net-sdk
aliyun-net-sdk-ecs/Ecs/Model/V20140526/DescribeTaskAttributeRequest.cs
2,903
C#