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.IO; using Cottle.Values; namespace Cottle.Documents.Simple.Nodes { abstract class AssignNode : INode { #region Attributes private readonly StoreMode mode; private readonly string name; #endregion #region Constructors protected AssignNode (string name, StoreMode mode) { this.mode = mode; this.name = name; } #endregion #region Methods / Abstract protected abstract Value Evaluate (IStore store, TextWriter output); protected abstract void SourceSymbol (string name, TextWriter output); protected abstract void SourceValue (ISetting setting, TextWriter output); #endregion #region Methods / Public public override int GetHashCode () { unchecked { return (this.mode.GetHashCode () & (int)0xFFFF0000) | (this.name.GetHashCode () & (int)0x0000FFFF); } } public bool Render (IStore store, TextWriter output, out Value result) { store.Set (this.name, this.Evaluate (store, output), this.mode); result = VoidValue.Instance; return false; } public void Source (ISetting setting, TextWriter output) { string keyword; string link; switch (this.mode) { case StoreMode.Local: keyword = "declare"; link = "as"; break; default: keyword = "set"; link = "to"; break; } output.Write (setting.BlockBegin); output.Write (keyword); output.Write (' '); this.SourceSymbol (name, output); output.Write (' '); output.Write (link); this.SourceValue (setting, output); output.Write (setting.BlockEnd); } public override string ToString () { return this.name; } #endregion } }
17.83
77
0.626472
[ "MIT" ]
nicotruchi/cottle
Cottle/src/Documents/Simple/Nodes/AssignNode.cs
1,785
C#
/* * Copyright (c) 2018 THL A29 Limited, a Tencent company. 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. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ namespace TencentCloud.Yunjing.V20180228.Models { using Newtonsoft.Json; using System.Collections.Generic; using TencentCloud.Common; public class DeleteTagsResponse : AbstractModel { /// <summary> /// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 /// </summary> [JsonProperty("RequestId")] public string RequestId{ get; set; } /// <summary> /// For internal usage only. DO NOT USE IT. /// </summary> internal override void ToMap(Dictionary<string, string> map, string prefix) { this.SetParamSimple(map, prefix + "RequestId", this.RequestId); } } }
30.272727
83
0.664414
[ "Apache-2.0" ]
ImEdisonJiang/tencentcloud-sdk-dotnet
TencentCloud/Yunjing/V20180228/Models/DeleteTagsResponse.cs
1,390
C#
using Kickstart.Pass2.CModel.Code; namespace Kickstart.Interface { public interface ICInterfaceVisitor { ICodeWriter CodeWriter { get; } void Visit(IVisitor visitor, CInterface cclass); } }
20
56
0.695455
[ "MIT" ]
videa-tv/kickstart
src/Kickstart/Kickstart.Core/Interface/ICInterfaceVisitor.cs
222
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.34209 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace ISSBNG.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 ("ISSBNG.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; } } } }
42.825397
174
0.617494
[ "BSD-3-Clause" ]
brainling/shibang
src/ShIBANG/Properties/Resources.Designer.cs
2,700
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ModLibrary; namespace CloneDroneModdedMultiplayer.Patches { public class GetLevelDescriptionsPatches { public static void Prefix(ref Tuple<GameMode, bool> __state) { GameMode currentGameMode = Accessor.GetPrivateField<GameFlowManager, GameMode>("_gameMode", GameFlowManager.Instance); bool cond = currentGameMode == Main.MODDED_MULTIPLAYER_TEST_GAMEMODE; if(cond) { __state = new Tuple<GameMode, bool>(currentGameMode, cond); Accessor.SetPrivateField("_gameMode", GameFlowManager.Instance, GameMode.Story); } } public static List<LevelDescription> Postfix(List<LevelDescription> __result, Tuple<GameMode, bool> __state) { if(__state == null) { //debug.Log("__state is null"); return __result; } if (__state.Item2) { //debug.Log("returning newReturnValue"); Accessor.SetPrivateField("_gameMode", GameFlowManager.Instance, __state.Item1); return NewReturnValue; } //debug.Log("returning defualt"); return __result; } static List<LevelDescription> NewReturnValue { get { string[] paths = PathUtils.GetModdedLevels(); List<LevelDescription> levels = new List<LevelDescription>(); for(int i = 0; i < paths.Length; i++) { string[] splitPath = paths[i].Split("/\\".ToCharArray()); levels.Add(new LevelDescription { LevelJSONPath = paths[i], LevelID = splitPath[splitPath.Length-1], LevelTags = new List<LevelTags>() }); } return levels; } } } public class GetCurrentGameDataPatches { public static GameData Postpatch(GameData __result) { if (GameModeManager.Is(Main.MODDED_MULTIPLAYER_TEST_GAMEMODE)) { return Internal.ServerRunner.CurrentGameData; } return __result; } } public class GameModeManagerAllowsLevelsWithNoEnemiesPatch { public static bool PostPatch(bool __result) { if(GameModeManager.Is(Main.MODDED_MULTIPLAYER_TEST_GAMEMODE)) return true; return __result; } } }
30.21978
130
0.542909
[ "MIT" ]
X606/CloneDroneModdedMultiplayer
CloneDroneModdedMultiplayer/Patches.cs
2,752
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See the LICENSE file in the project root for more information. using ILSpy.Host.Providers; using Microsoft.AspNetCore.Http; using System.Reflection.Metadata.Ecma335; namespace ILSpy.Host { public class ListMembersMiddleware : BaseMiddleware { public ListMembersMiddleware(RequestDelegate next, IDecompilationProvider decompilationProvider) : base(next, decompilationProvider) { } public override string EndpointName => MsilDecompilerEndpoints.ListMembers; public override object Handle(HttpContext httpContext) { var requestObject = JsonHelper.DeserializeRequestObject(httpContext.Request.Body) .ToObject<ListMembersRequest>(); var members = _decompilationProvider.GetMembers(requestObject.AssemblyPath, MetadataTokens.TypeDefinitionHandle(requestObject.Handle)); var data = new ListMembersResponse { Members = members }; return data; } } }
37.482759
147
0.715731
[ "MIT" ]
crazyrex/ilspy-vscode
backend/src/ILSpy.Host/MiddleWare/Endpoints/ListMembersMiddleware.cs
1,089
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Entity { public class Order { public int OrderID { get; set; } public string OrderNumber { get; set; } public int UserID { get; set; } public int RehersalSpaceID { get; set; } } }
20.705882
48
0.647727
[ "Unlicense" ]
fhrr-sht/Rehersal_Reservation
Entity/Order.cs
354
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data.Entity; using System.Data.Entity.ModelConfiguration; using System.Data.Entity.ModelConfiguration.Conventions; using APPBASE.Helpers; using APPBASE.Models; namespace APPBASE.Models { public partial class DBMAINContext : DbContext { public DbSet<Summary_sell_info> Summary_sell_infos { get; set; } } //End public class DBMAINContext : DbContext } //End namespace APPBASE.Models
29.411765
72
0.782
[ "MIT" ]
arinsuga/posup
APPBASE/BASEStock/Support/Summary_sell/Models/APPContext_stok.cs
502
C#
using System.Collections.Generic; using Newtonsoft.Json; namespace ProjBobcat.Class.Model.YggdrasilAuth { public class UserInfoModel { [JsonProperty("id")] public string Id { get; set; } [JsonProperty("username")] public string UserName { get; set; } [JsonProperty("properties")] public List<PropertyModel> Properties { get; set; } } }
26.785714
88
0.68
[ "MIT" ]
mcoo/ProjBobcat
ProjBobcat/ProjBobcat/Class/Model/YggdrasilAuth/UserInfoModel.cs
377
C#
using System; using System.Diagnostics; using System.Security.Principal; using System.Web; using Newtonsoft.Json; using SFA.DAS.Support.Portal.ApplicationServices.Services; using SFA.DAS.Support.Portal.Core.Services; using SFA.DAS.Support.Portal.Web.Models; using SFA.DAS.Support.Portal.Web.Settings; namespace SFA.DAS.Support.Portal.Web.Services { public class PermissionCookieProvider : ICheckPermissions, IGrantPermissions { private readonly string _cookieFormat = "Elevate[{0}]"; private readonly ICrypto _crypto; private readonly IRoleSettings _roleSettings; private readonly IChallengeSettings _challengeSettings; public PermissionCookieProvider(ICrypto crypto, IChallengeSettings settings, IRoleSettings roleSettings) { _crypto = crypto; _challengeSettings = settings; _roleSettings = roleSettings; } public bool HasPermissions(HttpRequestBase request, HttpResponseBase response, IPrincipal user, string id) { var debugModeT2 = Debugger.IsAttached && _roleSettings.ForceT2UserLocally; var t2User = user.Identity.IsAuthenticated && user.IsInRole(_roleSettings.T2Role); if (debugModeT2 || t2User) return true; var httpCookie = request.Cookies.Get(string.Format(_cookieFormat, id.ToLower())); if (httpCookie == null) return false; var payload = GetPayload(httpCookie.Value); if (payload != null && payload.EndDate > DateTime.UtcNow && string.Equals(id, payload.Id, StringComparison.InvariantCultureIgnoreCase)) { GivePermissions(response, user, id); return true; } return false; } public void GivePermissions(HttpResponseBase response, IPrincipal user, string id) { var payload = CreatePayload(id, user); var name = string.Format(_cookieFormat, id.ToLower()); var httpCookie = response.Cookies.Get(name); if (httpCookie == null) httpCookie = new HttpCookie(name, payload); else httpCookie.Value = payload; response.Cookies.Add(httpCookie); } public string CreatePayload(string id, IPrincipal user) { var model = new PermissionCookieModel { Id = id, EndDate = DateTime.UtcNow.AddMinutes(_challengeSettings.ChallengeTimeoutMinutes) }; var json = JsonConvert.SerializeObject(model, new JsonSerializerSettings {NullValueHandling = NullValueHandling.Ignore}); return _crypto.EncryptStringAES(json); } public PermissionCookieModel GetPayload(string payload) { var json = _crypto.DecryptStringAES(payload); return JsonConvert.DeserializeObject<PermissionCookieModel>(json); } } }
35.458824
114
0.639681
[ "MIT" ]
SkillsFundingAgency/das-support-portal
src/SFA.DAS.Support.Portal.Web/Services/PermissionCookieProvider.cs
3,016
C#
using NHapi.Base.Parser; using NHapi.Base; using NHapi.Base.Log; using System; using System.Collections.Generic; using NHapi.Model.V251.Segment; using NHapi.Model.V251.Datatype; using NHapi.Base.Model; namespace NHapi.Model.V251.Group { ///<summary> ///Represents the MFN_M04_MF_CDM Group. A Group is an ordered collection of message /// segments that can repeat together or be optionally in/excluded together. /// This Group contains the following elements: ///<ol> ///<li>0: MFE (Master File Entry) </li> ///<li>1: CDM (Charge Description Master) </li> ///<li>2: PRC (Pricing) optional repeating</li> ///</ol> ///</summary> [Serializable] public class MFN_M04_MF_CDM : AbstractGroup { ///<summary> /// Creates a new MFN_M04_MF_CDM Group. ///</summary> public MFN_M04_MF_CDM(IGroup parent, IModelClassFactory factory) : base(parent, factory){ try { this.add(typeof(MFE), true, false); this.add(typeof(CDM), true, false); this.add(typeof(PRC), false, true); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error creating MFN_M04_MF_CDM - this is probably a bug in the source code generator.", e); } } ///<summary> /// Returns MFE (Master File Entry) - creates it if necessary ///</summary> public MFE MFE { get{ MFE ret = null; try { ret = (MFE)this.GetStructure("MFE"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } } ///<summary> /// Returns CDM (Charge Description Master) - creates it if necessary ///</summary> public CDM CDM { get{ CDM ret = null; try { ret = (CDM)this.GetStructure("CDM"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } } ///<summary> /// Returns first repetition of PRC (Pricing) - creates it if necessary ///</summary> public PRC GetPRC() { PRC ret = null; try { ret = (PRC)this.GetStructure("PRC"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } ///<summary> ///Returns a specific repetition of PRC /// * (Pricing) - creates it if necessary /// throws HL7Exception if the repetition requested is more than one /// greater than the number of existing repetitions. ///</summary> public PRC GetPRC(int rep) { return (PRC)this.GetStructure("PRC", rep); } /** * Returns the number of existing repetitions of PRC */ public int PRCRepetitionsUsed { get{ int reps = -1; try { reps = this.GetAll("PRC").Length; } catch (HL7Exception e) { string message = "Unexpected error accessing data - this is probably a bug in the source code generator."; HapiLogFactory.GetHapiLog(GetType()).Error(message, e); throw new System.Exception(message); } return reps; } } /** * Enumerate over the PRC results */ public IEnumerable<PRC> PRCs { get { for (int rep = 0; rep < PRCRepetitionsUsed; rep++) { yield return (PRC)this.GetStructure("PRC", rep); } } } ///<summary> ///Adds a new PRC ///</summary> public PRC AddPRC() { return this.AddStructure("PRC") as PRC; } ///<summary> ///Removes the given PRC ///</summary> public void RemovePRC(PRC toRemove) { this.RemoveStructure("PRC", toRemove); } ///<summary> ///Removes the PRC at the given index ///</summary> public void RemovePRCAt(int index) { this.RemoveRepetition("PRC", index); } } }
26.609272
152
0.655799
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
AMCN41R/nHapi
src/NHapi.Model.V251/Group/MFN_M04_MF_CDM.cs
4,018
C#
using RedFolder.ActivityTracker.BeyondPod.Converters.Handlers; using RedFolder.ActivityTracker.Models.BeyondPod; using Xunit; namespace RedFolder.ActivityTracker.BeyondPod.UnitTests.Converters.Handlers { public class ReactRoundUpUnitTests { private readonly ReactRoundup _sut; private readonly PodCastTableEntity _sample; public ReactRoundUpUnitTests() { _sut = new ReactRoundup(); _sut.AddInner(new BaseHandler()); _sample = new PodCastTableEntity { FeedName = "React Round Up", EpisodeName = "RRU 062: Image Lazy Loading in React", EpisodeUrl = "https://media.devchat.tv/reactroundup/RRU_062_Image_Lazy_Loading_in_React.mp3", EpisodePostUrl = "https://devchat.tv/react-round-up/rru-062-image-lazy-loading-in-react/" }; } [Fact] public void SetsCategory() { var result = _sut.Convert(_sample); Assert.Equal("React & Redux", result.Category); } [Fact] public void SetsEpisodeUrl() { var result = _sut.Convert(_sample); Assert.Equal("https://devchat.tv/react-round-up/rru-062-image-lazy-loading-in-react/", result.EpisodeUrl); } } }
30.883721
118
0.613705
[ "MIT" ]
Red-Folder/activity-tracker-azure-function
RedFolder.ActivityTracker.BeyondPod.UnitTests/Converters/Handlers/ReactRoundupUnitTests.cs
1,330
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Models.Api20211001Preview { using static Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Extensions; public partial class AzureDataExplorerSystemScanRuleset { /// <summary> /// <c>AfterFromJson</c> will be called after the json deserialization has finished, allowing customization of the object /// before it is returned. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="json">The JsonNode that should be deserialized into this object.</param> partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonObject json); /// <summary> /// <c>AfterToJson</c> will be called after the json erialization has finished, allowing customization of the <see cref="Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonObject" /// /> before it is returned. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="container">The JSON container that the serialization result will be placed in.</param> partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonObject container); /// <summary> /// <c>BeforeFromJson</c> will be called before the json deserialization has commenced, allowing complete customization of /// the object before it is deserialized. /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter. /// Implement this method in a partial class to enable this behavior. /// </summary> /// <param name="json">The JsonNode that should be deserialized into this object.</param> /// <param name="returnNow">Determines if the rest of the deserialization should be processed, or if the method should return /// instantly.</param> partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonObject json, ref bool returnNow); /// <summary> /// <c>BeforeToJson</c> will be called before the json serialization has commenced, allowing complete customization of the /// object before it is serialized. /// If you wish to disable the default serialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter. /// Implement this method in a partial class to enable this behavior. /// </summary> /// <param name="container">The JSON container that the serialization result will be placed in.</param> /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return /// instantly.</param> partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonObject container, ref bool returnNow); /// <summary> /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonObject into a new instance of <see cref="AzureDataExplorerSystemScanRuleset" />. /// </summary> /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonObject instance to deserialize from.</param> internal AzureDataExplorerSystemScanRuleset(Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } __systemScanRuleset = new Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Models.Api20211001Preview.SystemScanRuleset(json); {_property = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonObject>("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Models.Api20211001Preview.AzureDataExplorerScanRulesetProperties.FromJson(__jsonProperties) : Property;} AfterFromJson(json); } /// <summary> /// Deserializes a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonNode"/> into an instance of Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Models.Api20211001Preview.IAzureDataExplorerSystemScanRuleset. /// </summary> /// <param name="node">a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonNode" /> to deserialize from.</param> /// <returns> /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Models.Api20211001Preview.IAzureDataExplorerSystemScanRuleset. /// </returns> public static Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Models.Api20211001Preview.IAzureDataExplorerSystemScanRuleset FromJson(Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonObject json ? new AzureDataExplorerSystemScanRuleset(json) : null; } /// <summary> /// Serializes this instance of <see cref="AzureDataExplorerSystemScanRuleset" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonNode" /// />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param> /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="AzureDataExplorerSystemScanRuleset" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return container; } __systemScanRuleset?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Purviewdata.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AfterToJson(ref container); return container; } } }
68.953704
312
0.700013
[ "MIT" ]
Agazoth/azure-powershell
src/Purview/Purviewdata.Autorest/generated/api/Models/Api20211001Preview/AzureDataExplorerSystemScanRuleset.json.cs
7,340
C#
using System; using System.Collections.Generic; using System.Text; namespace Payment.Events { public class PaymentFailedEvent { } }
13.272727
35
0.726027
[ "Unlicense" ]
jasprem/adlibris
src/contracts/Payment.Events/PaymentFailedEvent.cs
148
C#
using Microsoft.EntityFrameworkCore.Migrations; namespace Ordering.Infrastructure.Persistence.Migrations { public partial class OrderingQuantity : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_requirements_Orders_OrderId", schema: "ordering", table: "requirements"); migrationBuilder.DropForeignKey( name: "FK_Resolutions_Orders_OrderId1", schema: "ordering", table: "Resolutions"); migrationBuilder.DropForeignKey( name: "FK_State_Orders_OrderId", schema: "ordering", table: "State"); migrationBuilder.DropIndex( name: "IX_Resolutions_OrderId1", schema: "ordering", table: "Resolutions"); migrationBuilder.DropPrimaryKey( name: "PK_requirements", schema: "ordering", table: "requirements"); migrationBuilder.DropIndex( name: "IX_Orders_OrderNumber", schema: "ordering", table: "Orders"); migrationBuilder.DropPrimaryKey( name: "PK_State", schema: "ordering", table: "State"); migrationBuilder.DropColumn( name: "OrderId1", schema: "ordering", table: "Resolutions"); migrationBuilder.RenameTable( name: "requirements", schema: "ordering", newName: "Requirements", newSchema: "ordering"); migrationBuilder.RenameTable( name: "State", schema: "ordering", newName: "OrderStates", newSchema: "ordering"); migrationBuilder.RenameIndex( name: "IX_requirements_OrderId", schema: "ordering", table: "Requirements", newName: "IX_Requirements_OrderId"); migrationBuilder.RenameIndex( name: "IX_State_OrderId", schema: "ordering", table: "OrderStates", newName: "IX_OrderStates_OrderId"); migrationBuilder.AlterColumn<int>( name: "BuyerId", schema: "ordering", table: "Orders", type: "int", nullable: false, defaultValue: 0, oldClrType: typeof(int), oldType: "int", oldNullable: true); migrationBuilder.AddColumn<int>( name: "Quantity", schema: "ordering", table: "Orders", type: "int", nullable: false, defaultValue: 0); migrationBuilder.AddColumn<decimal>( name: "TotalPrice", schema: "ordering", table: "Orders", type: "decimal(18,2)", nullable: false, defaultValue: 0m); migrationBuilder.AlterColumn<string>( name: "UserId", schema: "ordering", table: "Buyers", type: "nvarchar(450)", nullable: false, oldClrType: typeof(string), oldType: "nvarchar(max)"); migrationBuilder.AddPrimaryKey( name: "PK_Requirements", schema: "ordering", table: "Requirements", column: "Id"); migrationBuilder.AddUniqueConstraint( name: "AK_Orders_OrderNumber", schema: "ordering", table: "Orders", column: "OrderNumber") .Annotation("SqlServer:Clustered", false); migrationBuilder.AddUniqueConstraint( name: "AK_Buyers_UserId", schema: "ordering", table: "Buyers", column: "UserId") .Annotation("SqlServer:Clustered", false); migrationBuilder.AddPrimaryKey( name: "PK_OrderStates", schema: "ordering", table: "OrderStates", column: "Id"); migrationBuilder.AddForeignKey( name: "FK_OrderStates_Orders_OrderId", schema: "ordering", table: "OrderStates", column: "OrderId", principalSchema: "ordering", principalTable: "Orders", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_Requirements_Orders_OrderId", schema: "ordering", table: "Requirements", column: "OrderId", principalSchema: "ordering", principalTable: "Orders", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_OrderStates_Orders_OrderId", schema: "ordering", table: "OrderStates"); migrationBuilder.DropForeignKey( name: "FK_Requirements_Orders_OrderId", schema: "ordering", table: "Requirements"); migrationBuilder.DropPrimaryKey( name: "PK_Requirements", schema: "ordering", table: "Requirements"); migrationBuilder.DropUniqueConstraint( name: "AK_Orders_OrderNumber", schema: "ordering", table: "Orders"); migrationBuilder.DropUniqueConstraint( name: "AK_Buyers_UserId", schema: "ordering", table: "Buyers"); migrationBuilder.DropPrimaryKey( name: "PK_OrderStates", schema: "ordering", table: "OrderStates"); migrationBuilder.DropColumn( name: "Quantity", schema: "ordering", table: "Orders"); migrationBuilder.DropColumn( name: "TotalPrice", schema: "ordering", table: "Orders"); migrationBuilder.RenameTable( name: "Requirements", schema: "ordering", newName: "requirements", newSchema: "ordering"); migrationBuilder.RenameTable( name: "OrderStates", schema: "ordering", newName: "State", newSchema: "ordering"); migrationBuilder.RenameIndex( name: "IX_Requirements_OrderId", schema: "ordering", table: "requirements", newName: "IX_requirements_OrderId"); migrationBuilder.RenameIndex( name: "IX_OrderStates_OrderId", schema: "ordering", table: "State", newName: "IX_State_OrderId"); migrationBuilder.AddColumn<int>( name: "OrderId1", schema: "ordering", table: "Resolutions", type: "int", nullable: true); migrationBuilder.AlterColumn<int>( name: "BuyerId", schema: "ordering", table: "Orders", type: "int", nullable: true, oldClrType: typeof(int), oldType: "int"); migrationBuilder.AlterColumn<string>( name: "UserId", schema: "ordering", table: "Buyers", type: "nvarchar(max)", nullable: false, oldClrType: typeof(string), oldType: "nvarchar(450)"); migrationBuilder.AddPrimaryKey( name: "PK_requirements", schema: "ordering", table: "requirements", column: "Id"); migrationBuilder.AddPrimaryKey( name: "PK_State", schema: "ordering", table: "State", column: "Id"); migrationBuilder.CreateIndex( name: "IX_Resolutions_OrderId1", schema: "ordering", table: "Resolutions", column: "OrderId1"); migrationBuilder.CreateIndex( name: "IX_Orders_OrderNumber", schema: "ordering", table: "Orders", column: "OrderNumber", unique: true); migrationBuilder.AddForeignKey( name: "FK_requirements_Orders_OrderId", schema: "ordering", table: "requirements", column: "OrderId", principalSchema: "ordering", principalTable: "Orders", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_Resolutions_Orders_OrderId1", schema: "ordering", table: "Resolutions", column: "OrderId1", principalSchema: "ordering", principalTable: "Orders", principalColumn: "Id", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey( name: "FK_State_Orders_OrderId", schema: "ordering", table: "State", column: "OrderId", principalSchema: "ordering", principalTable: "Orders", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } } }
33.644737
71
0.481619
[ "MIT" ]
NikolayPIvanov/Hive
src/Ordering/Ordering.Infrastructure/Persistence/Migrations/20210608104322_OrderingQuantity.cs
10,230
C#
using Serenity.ComponentModel; using Serenity.Data; using System; using System.Collections.Generic; namespace Serenity.PropertyGrid { public partial class BasicPropertyProcessor : PropertyProcessor { private void SetEditing(IPropertySource source, PropertyItem item) { var editorTypeAttr = source.GetAttribute<EditorTypeAttribute>(); if (editorTypeAttr == null) { item.EditorType = AutoDetermineEditorType(source.ValueType, source.EnumType, item.EditorParams); } else { item.EditorType = editorTypeAttr.EditorType; editorTypeAttr.SetParams(item.EditorParams); } if (source.EnumType != null) item.EditorParams["enumKey"] = EnumMapper.GetEnumTypeKey(source.EnumType); if (!ReferenceEquals(null, source.BasedOnField)) { if (item.EditorType == "Decimal" && (source.BasedOnField is DoubleField || source.BasedOnField is DecimalField) && source.BasedOnField.Size > 0 && source.BasedOnField.Scale < source.BasedOnField.Size && !item.EditorParams.ContainsKey("minValue") && !item.EditorParams.ContainsKey("maxValue")) { string minVal = new String('0', source.BasedOnField.Size - source.BasedOnField.Scale); if (source.BasedOnField.Scale > 0) minVal += "." + new String('0', source.BasedOnField.Scale); string maxVal = minVal.Replace('0', '9'); item.EditorParams["minValue"] = minVal; item.EditorParams["maxValue"] = maxVal; } else if (source.BasedOnField.Size > 0) { item.EditorParams["maxLength"] = source.BasedOnField.Size; item.MaxLength = source.BasedOnField.Size; } } var maxLengthAttr = source.GetAttribute<MaxLengthAttribute>(); if (maxLengthAttr != null) { item.MaxLength = maxLengthAttr.MaxLength; item.EditorParams["maxLength"] = maxLengthAttr.MaxLength; } foreach (EditorOptionAttribute param in source.GetAttributes<EditorOptionAttribute>()) { var key = param.Key; if (key != null && key.Length >= 1) key = key.Substring(0, 1).ToLowerInvariant() + key.Substring(1); item.EditorParams[key] = param.Value; } } private static string AutoDetermineEditorType(Type valueType, Type enumType, IDictionary<string, object> editorParams) { if (enumType != null) return "Enum"; else if (valueType == typeof(string)) return "String"; else if (valueType == typeof(Int32)) return "Integer"; else if (valueType == typeof(Int16)) { editorParams["maxValue"] = Int16.MaxValue; return "Integer"; } else if (valueType == typeof(DateTime)) return "Date"; else if (valueType == typeof(Boolean)) return "Boolean"; else if (valueType == typeof(Decimal) || valueType == typeof(Double) || valueType == typeof(Single)) return "Decimal"; else return "String"; } } }
40.706522
127
0.515354
[ "MIT" ]
DucThanhNguyen/Serenity
Serenity.Data.Entity/PropertyGrid/BasicPropertyProcessor/BasicPropertyProcessor.Editing.cs
3,747
C#
using SharpDX; using SharpDX.Direct3D; using SharpDX.Direct3D11; using SharpDX.DXGI; //using _sc_core_systems.SC_Graphics.SC_Textures.SC_VR_Touch_Textures; using System.Linq; using System; using Jitter.Collision; using Jitter; using Jitter.Dynamics; using Jitter.DataStructures; using Jitter.Collision.Shapes; using System.Runtime.InteropServices; using _sc_core_systems.SC_Graphics; namespace _sc_core_systems.SC_Graphics { public class SC_modL_rght_elbow_target : ITransform, IComponent { public ITransform transform { get; private set; } IComponent ITransform.Component { get => component; } IComponent component; RigidBody IComponent.rigidbody { get; set; } SoftBody IComponent.softbody { get; set; } public Matrix _POSITION { get; set; } public float RotationY { get; set; } public float RotationX { get; set; } public float RotationZ { get; set; } /*struct Spatial { vec4 pos, rot; }; //rotate */ /*Vector3 qrot(Vector4 q, Vector3 v) { return v + 2.0f * Vector3.Cross(new Vector3(q.X,q.Y,q.Z), Vector3.Cross(new Vector3(q.X, q.Y, q.Z), v) + q.W * v); }*/ /*Vector3 rotate_vertex_position(Vector3 position, Vector3 axis, float angle) { Vector4 q = quat_from_axis_angle(axis, angle); Vector3 v = position.xyz; return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v); }*/ // Properties private SharpDX.Direct3D11.Buffer VertexBuffer { get; set; } private SharpDX.Direct3D11.Buffer IndexBuffer { get; set; } private int VertexCount { get; set; } public int IndexCount { get; set; } private float _touchSize = 1f; //public SharpDX.Vector3 Position { get; set; } public SharpDX.Quaternion Rotation { get; set; } public SharpDX.Vector3 Forward { get; set; } public DVertex[] Vertices { get; set; } /*[StructLayout(LayoutKind.Sequential)] public struct DVertex { public static int AppendAlignedElement = 12; public Vector3 position; public Vector4 color; public Vector3 normal; }*/ [StructLayout(LayoutKind.Sequential)] public struct DVertex { public Vector3 position; public Vector2 texture; public Vector4 color; public Vector3 normal; }; [StructLayout(LayoutKind.Sequential)] public struct DMatrixBuffer { public Matrix world; public Matrix view; public Matrix projection; } [StructLayout(LayoutKind.Sequential)] public struct DInstanceType { public Vector4 position; }; [StructLayout(LayoutKind.Sequential)] public struct DInstanceData { public Vector4 rotation; } [StructLayout(LayoutKind.Sequential)] public struct DInstanceDataMatrixRotter { //public Matrix rotationMatrix; public Vector4 instanceRot0; public Vector4 instanceRot1; public Vector4 instanceRot2; public Vector4 instanceRot3; } public int InstanceCount { get; private set; } public SharpDX.Direct3D11.Buffer InstanceBuffer { get; set; } public SharpDX.Direct3D11.Buffer InstanceRotationBuffer { get; set; } public SharpDX.Direct3D11.Buffer InstanceRotationBufferRIGHT { get; set; } public SharpDX.Direct3D11.Buffer InstanceRotationBufferUP { get; set; } public SharpDX.Direct3D11.Buffer InstanceRotationMatrixBuffer { get; set; } float _tileSize = 0; int _divX; int _divY; float _a; float _r; float _g; float _b; // Variables private int m_TerrainWidth, m_TerrainHeight; public Vector4 _color; //LIGHTS [StructLayout(LayoutKind.Explicit)] public struct DLightBuffer { [FieldOffset(0)] public Vector4 ambientColor; //16 [FieldOffset(16)] public Vector4 diffuseColor; //16 [FieldOffset(32)] public Vector3 lightDirection; //12 [FieldOffset(44)] public float padding0; [FieldOffset(48)] public Vector3 lightPosition; //12 [FieldOffset(60)] public float padding1; } //[FieldOffset(44)] //public Vector3 lightPosition; DLightBuffer[] _DLightBuffer = new DLightBuffer[1]; SC_cube_instances[] _arrayOfInstances;// = new SC_cube_instances[]; public DInstanceType[] instances; public DInstanceData[] instancesData; public DInstanceDataMatrixRotter[] instancesDataRotter; public int _instX; public int _instY; public int _instZ; public Matrix _ORIGINPOSITION { get; set; } public SC_cube_instances _singleObjectOnly;// = new SC_cube_instances(); public SC_sdr_rght_elbow_target _this_object_texture_shader { get; set; } //public Vector3 _y_top_pivot; //public Vector3 _y_bottom_pivot; public float _total_torso_height = -1; public float _total_torso_depth = -1; public float _total_torso_width = -1; //int _isTerrain; // Constructor public SC_modL_rght_elbow_target() { } public bool Initialize(SC_console_directx D3D, int width, int height, float tileSize, int divX, int divY, float _sizeX, float _sizeY, float _sizeZ, Vector4 color, int instX, int instY, int instZ, IntPtr windowsHandle, Matrix matroxer, int isTerrain, float offsetPosX, float offsetPosY, float offsetPosZ, float offsetVertX, float offsetVertY, float offsetVertZ) { _ORIGINPOSITION = matroxer; _POSITION = matroxer; transform = this; component = this; //_isTerrain = isTerrain; this._color = color; this._sizeX = _sizeX; this._sizeY = _sizeY; this._sizeZ = _sizeZ; _tileSize = tileSize; // Manually set the width and height of the terrain. m_TerrainWidth = width; m_TerrainHeight = height; this._divX = divX; this._divY = divY; this._a = color.W; this._r = color.X; this._g = color.Y; this._b = color.Z; this._instX = instX; this._instX = instY; this._instX = instZ; // Initialize the vertex and index buffer that hold the geometry for the terrain. if (!InitializeBuffer(D3D, _sizeX, _sizeY, _sizeZ, tileSize, instX, instY, instZ, windowsHandle, matroxer, isTerrain, offsetPosX, offsetPosY, offsetPosZ, offsetVertX, offsetVertY, offsetVertZ)) return false; return true; } SharpDX.Direct3D11.Buffer ConstantLightBuffer; /*public bool _initTexture(SharpDX.Direct3D11.Device device, IntPtr windowsHandle) { Vector4 ambientColor = new Vector4(0.15f, 0.15f, 0.15f, 1.0f); Vector4 diffuseColour = new Vector4(1, 1, 1, 1); Vector3 lightDirection = new Vector3(1, 0, 0); Vector3 lightPosition = new Vector3(0, 0, 0); _DLightBuffer[0] = new DLightBuffer() { ambientColor = ambientColor, diffuseColor = diffuseColour, lightDirection = lightDirection, padding0 = 0, lightPosition = lightPosition, padding1 = 0 }; _this_object_texture_shader = new SC_sdr_rght_elbow_target(); BufferDescription lightBufferDesc = new BufferDescription() { Usage = ResourceUsage.Dynamic, SizeInBytes = Utilities.SizeOf<DLightBuffer>(), BindFlags = BindFlags.ConstantBuffer, CpuAccessFlags = CpuAccessFlags.Write, OptionFlags = ResourceOptionFlags.None, StructureByteStride = 0 }; ConstantLightBuffer = new SharpDX.Direct3D11.Buffer(device, lightBufferDesc); _this_object_texture_shader.Initialize(device, windowsHandle, ConstantLightBuffer, _DLightBuffer); // Initialize the texture shader object. if (!_this_object_texture_shader.Initialize(device, windowsHandle, ConstantLightBuffer, _DLightBuffer)) { return false; } return true; }*/ /*public bool RenderInstancedObject(DeviceContext deviceContext, int VertexCount, int InstanceCount, Matrix worldMatrix, Matrix viewMatrix, Matrix projectionMatrix, ShaderResourceView texture, Matrix[] worldMatrix_instances, DLightBuffer[] _DLightBuffer_, Vector3 oculusRiftDir) { /*Vector4 ambientColor = new Vector4(0.15f, 0.15f, 0.15f, 1.0f); Vector4 diffuseColour = new Vector4(1, 1, 1, 1); Vector3 lightDirection = new Vector3(1, 0, 0); _DLightBuffer[0] = new DLightBuffer() { ambientColor = ambientColor, diffuseColor = diffuseColour, lightDirection = lightDirection, padding = 0 }; // Render the model using the texture shader. _this_object_texture_shader.Render(deviceContext, VertexCount, InstanceCount, worldMatrix, viewMatrix, projectionMatrix, texture, instances, instancesData, instancesDataRotter, InstanceBuffer, InstanceRotationBuffer, InstanceRotationMatrixBuffer, worldMatrix_instances, _instX, _instY, _instZ, _DLightBuffer_, oculusRiftDir, InstanceRotationBufferRIGHT, InstanceRotationBufferUP); return true; }*/ private float _sizeX = 0; private float _sizeY = 0; private float _sizeZ = 0; public void ShutDown() { // Release the vertex and index buffers. ShutDownBuffers(); } private bool InitializeBuffer(SC_console_directx D3D, float _sizeX, float _sizeY, float _sizeZ, float tileSize, int instX, int instY, int instZ, IntPtr windowsHandle, Matrix matroxer, int isTerrain, float offsetPosX, float offsetPosY, float offsetPosZ, float offsetVertX, float offsetVertY, float offsetVertZ) { try { int sizeWidther = (int)(m_TerrainWidth * 0.5f); int sizeHeighter = (int)(m_TerrainHeight * 0.5f); sizeWidther /= 10; sizeHeighter /= 10; // Set number of vertices in the vertex array. //VertexCount = 8; // Set number of vertices in the index array. //IndexCount = 36; // Create the vertex array and load it with data. var someOffsetPos = new Vector3(offsetPosX, offsetPosY, offsetPosZ); Vertices = new[] { //TOP new DVertex() { position = new Vector3((1*_sizeX) + (offsetVertX * _sizeX), (1*_sizeY) + (offsetVertY * _sizeY), (1*_sizeZ) + (offsetVertZ * _sizeZ)) , normal = new Vector3(0, 1, 1), color = _color, }, new DVertex() { position = new Vector3((1*_sizeX) + (offsetVertX * _sizeX), (1*_sizeY) + (offsetVertY * _sizeY), -(1*_sizeZ) - (offsetVertZ * _sizeZ)) , normal = new Vector3(0, 1, 1), color = _color, }, new DVertex() { position = new Vector3(-(1*_sizeX) - (offsetVertX * _sizeX), (1*_sizeY) + (offsetVertY * _sizeY), -(1*_sizeZ) - (offsetVertZ * _sizeZ)) , normal = new Vector3(0, 1, 1), color = _color, }, new DVertex() { position = new Vector3(-(1*_sizeX) - (offsetVertX * _sizeX), (1*_sizeY) + (offsetVertY * _sizeY), -(1*_sizeZ) - (offsetVertZ * _sizeZ)) , normal = new Vector3(0, 1, 1), color = _color, }, new DVertex() { position = new Vector3(-(1*_sizeX) - (offsetVertX * _sizeX), (1*_sizeY) + (offsetVertY * _sizeY), (1*_sizeZ) + (offsetVertZ * _sizeZ)) , normal = new Vector3(0, 1, 1), color = _color, }, new DVertex() { position = new Vector3((1*_sizeX) + (offsetVertX * _sizeX), (1*_sizeY) + (offsetVertY * _sizeY), (1*_sizeZ) + (offsetVertZ * _sizeZ)), normal = new Vector3(0, 1, 1), color = _color, }, //BOTTOM new DVertex() { position = new Vector3(-(1*_sizeX) - (offsetVertX * _sizeX), -(1*_sizeY) - (offsetVertY * _sizeY), -(1*_sizeZ) - (offsetVertZ * _sizeZ)) , normal = new Vector3(1, 0, 1), color = _color, }, new DVertex() { position = new Vector3((1*_sizeX) + (offsetVertX * _sizeX), -(1*_sizeY) - (offsetVertY * _sizeY), -(1*_sizeZ) - (offsetVertZ * _sizeZ)) , normal = new Vector3(1, 0, 1), color = _color, }, new DVertex() { position = new Vector3((1*_sizeX) + (offsetVertX * _sizeX), -(1*_sizeY) - (offsetVertY * _sizeY), (1*_sizeZ) + (offsetVertZ * _sizeZ)) , normal = new Vector3(1, 0, 1), color = _color, }, new DVertex() { position = new Vector3((1*_sizeX) + (offsetVertX * _sizeX), -(1*_sizeY) - (offsetVertY * _sizeY), (1*_sizeZ) + (offsetVertZ * _sizeZ)) , normal = new Vector3(1, 0, 1), color = _color, }, new DVertex() { position = new Vector3(-(1*_sizeX) - (offsetVertX * _sizeX), -(1*_sizeY) - (offsetVertY * _sizeY), (1*_sizeZ) + (offsetVertZ * _sizeZ)) , normal = new Vector3(1, 0, 1), color = _color, }, new DVertex() { position = new Vector3(-(1*_sizeX) - (offsetVertX * _sizeX), -(1*_sizeY) - (offsetVertY * _sizeY), -(1*_sizeZ) - (offsetVertZ * _sizeZ)) , normal = new Vector3(1, 0, 1), color = _color, }, //FACE NEAR new DVertex() { position = new Vector3((1*_sizeX) + (offsetVertX * _sizeX), (1*_sizeY) + (offsetVertY * _sizeY), -(1*_sizeZ) - (offsetVertZ * _sizeZ)) , normal = new Vector3(1, 0, 0), color = _color, }, new DVertex() { position = new Vector3((1*_sizeX) + (offsetVertX * _sizeX), -(1*_sizeY) - (offsetVertY * _sizeY), -(1*_sizeZ) - (offsetVertZ * _sizeZ)) , normal = new Vector3(1, 0, 0), color = _color, }, new DVertex() { position = new Vector3(-(1*_sizeX) - (offsetVertX * _sizeX), -(1*_sizeY) - (offsetVertY * _sizeY), -(1*_sizeZ) - (offsetVertZ * _sizeZ)) , normal = new Vector3(1, 0, 0), color = _color, }, new DVertex() { position = new Vector3(-(1*_sizeX) - (offsetVertX * _sizeX), (1*_sizeY) + (offsetVertY * _sizeY), -(1*_sizeZ) - (offsetVertZ * _sizeZ)) , normal = new Vector3(1, 0, 0), color = _color, }, new DVertex() { position = new Vector3((1*_sizeX) + (offsetVertX * _sizeX), (1*_sizeY) + (offsetVertY * _sizeY), -(1*_sizeZ) - (offsetVertZ * _sizeZ)) , normal = new Vector3(1, 0, 0), color = _color, }, new DVertex() { position = new Vector3(-(1*_sizeX) - (offsetVertX * _sizeX), -(1*_sizeY) - (offsetVertY * _sizeY), -(1*_sizeZ) - (offsetVertZ * _sizeZ)) , normal = new Vector3(1, 0, 0), color = _color, }, //FACE FAR new DVertex() { position = new Vector3(-(1*_sizeX) - (offsetVertX * _sizeX), -(1*_sizeY) - (offsetVertY * _sizeY), (1*_sizeZ) + (offsetVertZ * _sizeZ)) , normal = new Vector3(0, 1, 0), color = _color, }, new DVertex() { position = new Vector3((1*_sizeX) + (offsetVertX * _sizeX), -(1*_sizeY) - (offsetVertY * _sizeY), (1*_sizeZ) + (offsetVertZ * _sizeZ)) , normal = new Vector3(0, 1, 0), color = _color, }, new DVertex() { position = new Vector3((1*_sizeX) + (offsetVertX * _sizeX), (1*_sizeY) + (offsetVertY * _sizeY), (1*_sizeZ) + (offsetVertZ * _sizeZ)) , normal = new Vector3(0, 1, 0), color = _color, }, new DVertex() { position = new Vector3((1*_sizeX) + (offsetVertX * _sizeX), (1*_sizeY) + (offsetVertY * _sizeY), (1*_sizeZ) + (offsetVertZ * _sizeZ)), normal = new Vector3(0, 1, 0), color = _color, }, new DVertex() { position = new Vector3(-(1*_sizeX) - (offsetVertX * _sizeX), (1*_sizeY) + (offsetVertY * _sizeY), (1*_sizeZ) + (offsetVertZ * _sizeZ)) , normal = new Vector3(0, 1, 0), color = _color, }, new DVertex() { position = new Vector3(-(1*_sizeX) - (offsetVertX * _sizeX), -(1*_sizeY) - (offsetVertY * _sizeY), (1*_sizeZ) + (offsetVertZ * _sizeZ)), normal = new Vector3(0, 1, 0), color = _color, }, //FACE LEFT new DVertex() { position = new Vector3(-(1*_sizeX) - (offsetVertX * _sizeX), (1*_sizeY) + (offsetVertY * _sizeY), (1*_sizeZ) + (offsetVertZ * _sizeZ)), normal = new Vector3(0, 0, 1), color = _color, }, new DVertex() { position = new Vector3(-(1*_sizeX) - (offsetVertX * _sizeX), (1*_sizeY) + (offsetVertY * _sizeY), -(1*_sizeZ) - (offsetVertZ * _sizeZ)) , normal = new Vector3(0, 0, 1), color = _color, }, new DVertex() { position = new Vector3(-(1*_sizeX) - (offsetVertX * _sizeX), -(1*_sizeY) - (offsetVertY * _sizeY), -(1*_sizeZ) - (offsetVertZ * _sizeZ)), normal = new Vector3(0, 0, 1), color = _color, }, new DVertex() { position = new Vector3(-(1*_sizeX) - (offsetVertX * _sizeX), -(1*_sizeY) - (offsetVertY * _sizeY), -(1*_sizeZ) - (offsetVertZ * _sizeZ)) , normal = new Vector3(0, 0, 1), color = _color, }, new DVertex() { position = new Vector3(-(1*_sizeX) - (offsetVertX * _sizeX), -(1*_sizeY) - (offsetVertY * _sizeY), (1*_sizeZ) + (offsetVertZ * _sizeZ)) , normal = new Vector3(0, 0, 1), color = _color, }, new DVertex() { position = new Vector3(-(1*_sizeX) + (offsetVertX * _sizeX), (1*_sizeY) + (offsetVertY * _sizeY), (1*_sizeZ) + (offsetVertZ * _sizeZ)) , normal = new Vector3(0, 0, 1), color = _color, }, //FACE RIGHT new DVertex() { position = new Vector3((1*_sizeX) + (offsetVertX * _sizeX), -(1*_sizeY) - (offsetVertY * _sizeY), -(1*_sizeZ) - (offsetVertZ * _sizeZ)) , normal = new Vector3(1, 1, 0), color = _color, }, new DVertex() { position = new Vector3((1*_sizeX) + (offsetVertX * _sizeX), (1*_sizeY) + (offsetVertY * _sizeY), -(1*_sizeZ) - (offsetVertZ * _sizeZ)) , normal = new Vector3(1, 1, 0), color = _color, }, new DVertex() { position = new Vector3((1*_sizeX) + (offsetVertX * _sizeX), (1*_sizeY) + (offsetVertY * _sizeY), (1*_sizeZ) + (offsetVertZ * _sizeZ)) , normal = new Vector3(1, 1, 0), color = _color, }, new DVertex() { position = new Vector3((1*_sizeX) + (offsetVertX * _sizeX), (1*_sizeY) + (offsetVertY * _sizeY), (1*_sizeZ) + (offsetVertZ * _sizeZ)) , normal = new Vector3(1, 1, 0), color = _color, }, new DVertex() { position = new Vector3((1*_sizeX) + (offsetVertX * _sizeX), -(1*_sizeY) - (offsetVertY * _sizeY), (1*_sizeZ) + (offsetVertZ * _sizeZ)) , normal = new Vector3(1, 1, 0), color = _color, }, new DVertex() { position = new Vector3((1*_sizeX) + (offsetVertX * _sizeX), -(1*_sizeY) - (offsetVertY * _sizeY), -(1*_sizeZ) - (offsetVertZ * _sizeZ)) , normal = new Vector3(1, 1, 0), color = _color, }, }; Vector3[] sorterList = new Vector3[Vertices.Length]; for (int i = 0; i < Vertices.Length; i++) { sorterList[i] = Vertices[i].position; } var lowestX = sorterList.OrderBy(x => x.X).FirstOrDefault(); var highestX = sorterList.OrderBy(x => x.X).Last(); var lowestY = sorterList.OrderBy(y => y.X).FirstOrDefault(); var highestY = sorterList.OrderBy(y => y.X).Last(); var lowestZ = sorterList.OrderBy(z => z.X).FirstOrDefault(); var highestZ = sorterList.OrderBy(z => z.X).Last(); //_total_torso_width = highestX.X - lowestX.X; //_total_torso_height = highestY.Y - lowestY.Y; //_total_torso_depth = highestZ.Z - lowestZ.Z; //_y_top_pivot = highestY; //_y_bottom_pivot = lowestY; _total_torso_width = ((1 * _sizeX) + (offsetVertX * _sizeX) * 2); _total_torso_height = ((1 * _sizeY) + (offsetVertY * _sizeY) * 2); _total_torso_depth = ((1 * _sizeZ) + (offsetVertZ * _sizeZ) * 2); int[] triangles = new int[] { 5,4,3,2,1,0, 11,10,9,8,7,6, 17,16,15,14,13,12, 23,22,21,20,19,18, 29,28,27,26,25,24, 35,34,33,32,31,30, }; int count = 0; IndexCount = triangles.Length; VertexCount = Vertices.Length; instancesDataRotter = new DInstanceDataMatrixRotter[instX * instY * instZ]; instancesData = new DInstanceData[instX * instY * instZ]; instances = new DInstanceType[instX * instY * instZ]; _arrayOfInstances = new SC_cube_instances[instX * instY * instZ]; count = 0; for (int x = 0; x < instX; x++) { for (int y = 0; y < instY; y++) { for (int z = 0; z < instZ; z++) { Vector3 position = new Vector3(x * offsetPosX, y * offsetPosY, z * offsetPosZ); Matrix _tempMatrix = matroxer; position.X += matroxer.M41; position.Y += matroxer.M42; position.Z += matroxer.M43; instances[count] = new DInstanceType() { position = new Vector4(position.X, position.Y, position.Z, 1) }; instancesData[count] = new DInstanceData() { rotation = new Vector4(0, 0, 0, 1) }; _tempMatrix.M41 = position.X; _tempMatrix.M42 = position.Y; _tempMatrix.M43 = position.Z; SC_cube_instances _cube = new SC_cube_instances(); _cube.transform.Component.rigidbody = new RigidBody(new BoxShape(_sizeX * 2, _sizeY * 2, _sizeZ * 2)); _cube.transform.Component.rigidbody.Position = new Jitter.LinearMath.JVector(_tempMatrix.M41, _tempMatrix.M42, _tempMatrix.M43); _cube.transform.Component.rigidbody.Orientation = Conversion.ToJitterMatrix(_tempMatrix); _cube.transform.Component.rigidbody.LinearVelocity = new Jitter.LinearMath.JVector(0, 0, 0); _cube.transform.Component.rigidbody.IsStatic = true; _cube.transform.Component.rigidbody.Tag = SC_console_directx.BodyTag.PlayerTorso; _cube.transform.Component.rigidbody.Material.Restitution = 0.25f; _cube.transform.Component.rigidbody.Material.StaticFriction = 0.45f; //_cube.transform.Component.rigidbody.Material.KineticFriction = 0.45f; _cube.transform.Component.rigidbody.Mass = 100; SC_Console_GRAPHICS.World.AddBody(_cube.transform.Component.rigidbody); //_cube._POSITION = _tempMatrix; _singleObjectOnly = _cube; } } } InstanceCount = instances.Length; // Create the vertex buffer. VertexBuffer = SharpDX.Direct3D11.Buffer.Create(D3D.device, BindFlags.VertexBuffer, Vertices); IndexBuffer = SharpDX.Direct3D11.Buffer.Create(D3D.device, BindFlags.IndexBuffer, triangles); // Create the Instance instead of an Index Buffer. InstanceBuffer = SharpDX.Direct3D11.Buffer.Create(D3D.device, BindFlags.VertexBuffer, instances); InstanceRotationBuffer = SharpDX.Direct3D11.Buffer.Create(D3D.device, BindFlags.VertexBuffer, instancesData); InstanceRotationBufferRIGHT = SharpDX.Direct3D11.Buffer.Create(D3D.device, BindFlags.VertexBuffer, instancesData); InstanceRotationBufferUP = SharpDX.Direct3D11.Buffer.Create(D3D.device, BindFlags.VertexBuffer, instancesData); InstanceRotationMatrixBuffer = SharpDX.Direct3D11.Buffer.Create(D3D.device, BindFlags.VertexBuffer, instancesData); //SC_Console_GRAPHICS.MessageBox((IntPtr)0, InstanceBuffer.Description.Usage + "", "Oculus Error", 0); // Setup the description of the dynamic matrix constant Matrix buffer that is in the vertex shader. BufferDescription matrixBufferDescription = new BufferDescription() { Usage = ResourceUsage.Dynamic, SizeInBytes = Utilities.SizeOf<DInstanceType>() * instances.Length, BindFlags = BindFlags.VertexBuffer, CpuAccessFlags = CpuAccessFlags.Write, OptionFlags = ResourceOptionFlags.None, StructureByteStride = 0 }; // Create the constant buffer pointer so we can access the vertex shader constant buffer from within this class. InstanceBuffer = new SharpDX.Direct3D11.Buffer(D3D.device, matrixBufferDescription); matrixBufferDescription = new BufferDescription() { Usage = ResourceUsage.Dynamic, SizeInBytes = Utilities.SizeOf<DInstanceData>() * instancesData.Length, BindFlags = BindFlags.VertexBuffer, CpuAccessFlags = CpuAccessFlags.Write, OptionFlags = ResourceOptionFlags.None, StructureByteStride = 0 }; // Create the constant buffer pointer so we can access the vertex shader constant buffer from within this class. InstanceRotationBuffer = new SharpDX.Direct3D11.Buffer(D3D.device, matrixBufferDescription); matrixBufferDescription = new BufferDescription() { Usage = ResourceUsage.Dynamic, SizeInBytes = Utilities.SizeOf<DInstanceData>() * instancesData.Length, BindFlags = BindFlags.VertexBuffer, CpuAccessFlags = CpuAccessFlags.Write, OptionFlags = ResourceOptionFlags.None, StructureByteStride = 0 }; // Create the constant buffer pointer so we can access the vertex shader constant buffer from within this class. InstanceRotationBufferRIGHT = new SharpDX.Direct3D11.Buffer(D3D.device, matrixBufferDescription); matrixBufferDescription = new BufferDescription() { Usage = ResourceUsage.Dynamic, SizeInBytes = Utilities.SizeOf<DInstanceData>() * instancesData.Length, BindFlags = BindFlags.VertexBuffer, CpuAccessFlags = CpuAccessFlags.Write, OptionFlags = ResourceOptionFlags.None, StructureByteStride = 0 }; // Create the constant buffer pointer so we can access the vertex shader constant buffer from within this class. InstanceRotationBufferUP = new SharpDX.Direct3D11.Buffer(D3D.device, matrixBufferDescription); //_initTexture(D3D.device, windowsHandle); // Create the vertex buffer. //VertexBuffer = SharpDX.Direct3D11.Buffer.Create(D3D.device, BindFlags.VertexBuffer, Vertices); // Delete arrays now that they are in their respective vertex and index buffers. //Vertices = null; //indices = null; // Set the vertex buffer to active in the input assembler so it can be rendered. //device.ImmediateContext.InputAssembler.SetVertexBuffers(0, new VertexBufferBinding(VertexBuffer, Utilities.SizeOf<SC_Desk_Screen_Shader.DVertex>(), 0)); // Set the index buffer to active in the input assembler so it can be rendered. //device.ImmediateContext.InputAssembler.SetIndexBuffer(IndexBuffer, SharpDX.DXGI.Format.R32_UInt, 0); // Set the type of the primitive that should be rendered from this vertex buffer, in this case triangles. //device.ImmediateContext.InputAssembler.PrimitiveTopology = PrimitiveTopology.TriangleList; return true; } catch { return false; } } private void ShutDownBuffers() { // Release the index buffer. IndexBuffer?.Dispose(); IndexBuffer = null; // Release the vertex buffer. VertexBuffer?.Dispose(); VertexBuffer = null; } public void Render(DeviceContext deviceContext) { // Put the vertex and index buffers on the graphics pipeline to prepare for drawings. RenderBuffers(deviceContext); } private void RenderBuffers(DeviceContext deviceContext) { deviceContext.InputAssembler.SetVertexBuffers(0, new VertexBufferBinding(VertexBuffer, Utilities.SizeOf<DVertex>(), 0)); //, new VertexBufferBinding(InstanceBuffer, Utilities.SizeOf<DInstanceType>(), 0) ////// , new VertexBufferBinding(InstanceBuffer, Utilities.SizeOf<DInstanceType>(), 0), new VertexBufferBinding(InstanceRotationBuffer, Utilities.SizeOf<DInstanceData>(), 0) //deviceContext.InputAssembler.SetVertexBuffers(1, new VertexBufferBinding(InstanceBuffer, Utilities.SizeOf<DInstanceType>(), 0)); deviceContext.InputAssembler.SetVertexBuffers(1, new[] { new VertexBufferBinding(InstanceBuffer, Marshal.SizeOf(typeof(DInstanceType)),0), }); deviceContext.InputAssembler.SetVertexBuffers(2, new[] { new VertexBufferBinding(InstanceRotationBuffer, Marshal.SizeOf(typeof(DInstanceData)),0), }); deviceContext.InputAssembler.SetVertexBuffers(3, new[] { new VertexBufferBinding(InstanceRotationBufferRIGHT, Marshal.SizeOf(typeof(DInstanceData)),0), }); deviceContext.InputAssembler.SetVertexBuffers(4, new[] { new VertexBufferBinding(InstanceRotationBufferUP, Marshal.SizeOf(typeof(DInstanceData)),0), }); /*deviceContext.InputAssembler.SetVertexBuffers(3, new[] { new VertexBufferBinding(InstanceRotationMatrixBuffer, Marshal.SizeOf(typeof(DInstanceDataMatrixRotter)),0), });*/ deviceContext.InputAssembler.SetIndexBuffer(IndexBuffer, SharpDX.DXGI.Format.R32_UInt, 0); deviceContext.InputAssembler.PrimitiveTopology = PrimitiveTopology.TriangleList; // Set the vertex buffer to active in the input assembler so it can be rendered. //deviceContext.InputAssembler.SetVertexBuffers(0, new VertexBufferBinding(VertexBuffer, Utilities.SizeOf<DVertex>(), 0), new VertexBufferBinding(InstanceBuffer, Utilities.SizeOf<DInstanceType>(), 0)); //deviceContext.InputAssembler.SetIndexBuffer(IndexBuffer, SharpDX.DXGI.Format.R32_UInt, 0); // Set the type of the primitive that should be rendered from this vertex buffer, in this case triangles. //deviceContext.InputAssembler.PrimitiveTopology = PrimitiveTopology.TriangleList; } } } /*new DVertex() { position = new Vector3(-1*_sizeX, -1*_sizeY, 1*_sizeZ), color = _color, }, new DVertex() { position = new Vector3(-1*_sizeX, 1*_sizeY, 1*_sizeZ), color = _color, }, new DVertex() { position = new Vector3(1*_sizeX, -1*_sizeY, 1*_sizeZ), color = _color, }, new DVertex() { position = new Vector3(1*_sizeX, 1*_sizeY, 1*_sizeZ), color = _color, }, new DVertex() { position = new Vector3(-1*_sizeX, -1*_sizeY, -1*_sizeZ), color = _color, }, new DVertex() { position = new Vector3(-1*_sizeX, 1*_sizeY, -1*_sizeZ), color = _color, }, new DVertex() { position = new Vector3(1*_sizeX, -1*_sizeY, -1*_sizeZ), color = _color, }, new DVertex() { position = new Vector3(1*_sizeX, 1*_sizeY, -1*_sizeZ), color = _color, },*/
40.800425
392
0.505854
[ "MIT" ]
ninekorn/SCCoreSystems-rerelease
sccsv10/_sc_graphics/_sc_models/human_rig/SC_modL_rght_elbow_target.cs
38,436
C#
namespace Ryujinx.Graphics.Gpu { /// <summary> /// General GPU and graphics configuration. /// </summary> public static class GraphicsConfig { /// <summary> /// Resolution scale. /// </summary> public static float ResScale = 1f; /// <summary> /// Max Anisotropy. Values range from 0 - 16. Set to -1 to let the game decide. /// </summary> public static float MaxAnisotropy = -1; /// <summary> /// Base directory used to write shader code dumps. /// Set to null to disable code dumping. /// </summary> public static string ShadersDumpPath; /// <summary> /// Fast GPU time calculates the internal GPU time ticks as if the GPU was capable of /// processing commands almost instantly, instead of using the host timer. /// This can avoid lower resolution on some games when GPU performance is poor. /// </summary> public static bool FastGpuTime = true; /// <summary> /// Enables or disables fast 2d engine texture copies entirely on CPU when possible. /// Reduces stuttering and # of textures in games that copy textures around for streaming, /// as textures will not need to be created for the copy, and the data does not need to be /// flushed from GPU. /// </summary> public static bool Fast2DCopy = true; /// <summary> /// Enables or disables the Just-in-Time compiler for GPU Macro code. /// </summary> public static bool EnableMacroJit = true; /// <summary> /// Enables or disables high-level emulation of common GPU Macro code. /// </summary> public static bool EnableMacroHLE = true; /// <summary> /// Title id of the current running game. /// Used by the shader cache. /// </summary> public static string TitleId; /// <summary> /// Enables or disables the shader cache. /// </summary> public static bool EnableShaderCache; } }
35.116667
99
0.589938
[ "MIT" ]
CrusadingNinja/Ryujinx
Ryujinx.Graphics.Gpu/GraphicsConfig.cs
2,107
C#
using UnityEngine; public class SpawnCommander : MonoBehaviour { public Unit unitPrefab; public UnitScriptableObject CommanderUnitSO; public SpawnEnemyUnits spawnEnemyUnits; void Start () { Unit newUnit = Instantiate (unitPrefab, this.transform); Destroy (newUnit.GetComponent<Attack> ()); Destroy (newUnit.GetComponent<MoveUnit> ()); Destroy (newUnit.GetComponent<FindTarget> ()); newUnit.gameObject.AddComponent<Commander> (); newUnit.gameObject.GetComponent<Commander> ().SetupWeapon (CommanderUnitSO.startingWeapon); spawnEnemyUnits.commander = newUnit.GetComponent<Commander> (); newUnit.SetupUnitType (CommanderUnitSO); newUnit.UpdateUnitLane (transform, 0); } }
42.333333
99
0.709974
[ "MIT" ]
h-Nystrom/IdleRpg
Assets/Scripts/_IdleRPG/BattleField/SpawnCommander.cs
764
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Biz.Morsink.Identity.Test.WebApplication.Domain { /// <summary> /// This class represents a comment on a blog entry. /// </summary> public class Comment { /// <summary> /// Gets and sets the comment's identity value. /// </summary> public IIdentity<Blog, BlogEntry, Comment> Id { get; set; } /// <summary> /// Get and sets the order number of the comment. /// </summary> public int Order { get; set; } /// <summary> /// Gets and sets the reference to the user making the comment. /// </summary> public IIdentity<User> UserId { get; set; } /// <summary> /// Gets and sets the comment timestamp. /// </summary> public DateTime CommentDate { get; set; } /// <summary> /// Gets and sets the text. /// </summary> public string Text { get; set; } } }
30.628571
72
0.546642
[ "MIT" ]
joost-morsink/Identity
Biz.Morsink.Identity.Test.WebApplication/Domain/Comment.cs
1,074
C#
using UnityEngine; using System.Collections; using System.Collections.Generic; public class DecisionSystem : MonoBehaviour { int Dijkstra = 0, Astar = 1, Bfs = 2, Dfs = 3, Bestfs = 4; float[] ArraySort; int[] indexOfTie; int[] WinCount; int i, j; float temp; int rank = 5, EqualCount = 0, max0, max1, max2, max3, max4; public Dictionary<int, float> TotalTime = new Dictionary<int, float> (); public Dictionary<int, int> TotalTimeRank = new Dictionary<int, int> (); public Dictionary<int, int> TotalNodes = new Dictionary<int, int> (); public Dictionary<int, int> TotalNodesRank = new Dictionary<int, int> (); public Dictionary<int, float> TotalEfficiency = new Dictionary<int, float> (); public Dictionary<int, float> TotalEfficiencyRank = new Dictionary<int, float> (); public Dictionary<int, float> TotalDistance = new Dictionary<int, float> (); public Dictionary<int, float> TotalDistanceRank = new Dictionary<int, float> (); public Dictionary<int, int> TotalNodesExamined = new Dictionary<int, int> (); public Dictionary<int, int> TotalNodesExaminedRank = new Dictionary<int, int> (); public Dictionary<int, int> TotalAlgorithmRank = new Dictionary<int, int> (); public Dictionary<int, int> TotalAlgorithmRankPriority = new Dictionary<int, int> (); void Ranking () { //Total Time for ( i = 0; i < 5; i++ ) { ArraySort[i] = TotalTime[i]; TotalTimeRank[i] = 0; } for ( i = 0; i < 5; i++ ) { for ( j = 0; j < 4; j++ ) { if ( ArraySort[j] > ArraySort[j + 1] ) { temp = ArraySort[j + 1]; ArraySort[j + 1] = ArraySort[j]; ArraySort[j] = temp; } } } rank = 5; for ( i = 0; i < 5; i++ ) { for ( j = 0; j < 5; j++ ) { if ( ArraySort[i] == TotalTime[j] && TotalTimeRank[j] == 0 ) { TotalTimeRank[j] = rank; } else if ( ArraySort[i] == TotalTime[j] && TotalTimeRank[j] != 0 ) { rank++; break; } } rank--; } //End of total time //TotalNodes for ( i = 0; i < 5; i++ ) { ArraySort[i] = TotalNodes[i]; TotalNodesRank[i] = 0; } for ( i = 0; i < 5; i++ ) { for ( j = 0; j < 4; j++ ) { if ( ArraySort[j] > ArraySort[j + 1] ) { temp = ArraySort[j + 1]; ArraySort[j + 1] = ArraySort[j]; ArraySort[j] = temp; } } } rank = 5; for ( i = 0; i < 5; i++ ) { for ( j = 0; j < 5; j++ ) { if ( ArraySort[i] == TotalNodes[j] && TotalNodesRank[j] == 0 ) { TotalNodesRank[j] = rank; } else if ( ArraySort[i] == TotalNodes[j] && TotalNodesRank[j] != 0 ) { rank++; break; } } rank--; } //End of TotalNodes //TotalEfficiency for ( i = 0; i < 5; i++ ) { ArraySort[i] = TotalEfficiency[i]; TotalEfficiencyRank[i] = 0; } for ( i = 0; i < 5; i++ ) { for ( j = 0; j < 4; j++ ) { if ( ArraySort[j] > ArraySort[j + 1] ) { temp = ArraySort[j + 1]; ArraySort[j + 1] = ArraySort[j]; ArraySort[j] = temp; } } } rank = 5; for ( i = 0; i < 5; i++ ) { for ( j = 0; j < 5; j++ ) { if ( ArraySort[i] == TotalEfficiency[j] && TotalEfficiencyRank[j] == 0 ) { TotalEfficiencyRank[j] = rank; } else if ( ArraySort[i] == TotalEfficiency[j] && TotalEfficiencyRank[j] != 0 ) { rank++; break; } } rank--; } //End of TotalEfficiency //Total Distance for ( i = 0; i < 5; i++ ) { ArraySort[i] = TotalTime[i]; TotalDistanceRank[i] = 0; } for ( i = 0; i < 5; i++ ) { for ( j = 0; j < 4; j++ ) { if ( ArraySort[j] > ArraySort[j + 1] ) { temp = ArraySort[j + 1]; ArraySort[j + 1] = ArraySort[j]; ArraySort[j] = temp; } } } rank = 5; for ( i = 0; i < 5; i++ ) { for ( j = 0; j < 5; j++ ) { if ( ArraySort[i] == TotalDistance[j] && TotalDistanceRank[j] == 0 ) { TotalDistanceRank[j] = rank; } else if ( ArraySort[i] == TotalDistance[j] && TotalDistanceRank[j] != 0 ) { rank++; break; } } rank--; } //End of TotalDistance //TotalNodesExamined for ( i = 0; i < 5; i++ ) { ArraySort[i] = TotalTime[i]; TotalNodesExaminedRank[i] = 0; } for ( i = 0; i < 5; i++ ) { for ( j = 0; j < 4; j++ ) { if ( ArraySort[j] > ArraySort[j + 1] ) { temp = ArraySort[j + 1]; ArraySort[j + 1] = ArraySort[j]; ArraySort[j] = temp; } } } rank = 5; for ( i = 0; i < 5; i++ ) { for ( j = 0; j < 5; j++ ) { if ( ArraySort[i] == TotalNodesExamined[j] && TotalNodesExaminedRank[j] == 0 ) { TotalNodesExaminedRank[j] = rank; } else if ( ArraySort[i] == TotalNodesExamined[j] && TotalNodesExaminedRank[j] != 0 ) { rank++; break; } } rank--; } //End of TotalNodesExamined // sum of ranks for ( i = 0; i < 5; i++ ) { TotalAlgorithmRank[i] = TotalTimeRank[i] + TotalNodesRank[i] + (int)(TotalEfficiencyRank[i]) + (int)(TotalDistanceRank[i]) + TotalNodesExaminedRank[i]; } //end of sum //sorting sum for ( i = 0; i < 5; i++ ) { ArraySort[i] = TotalAlgorithmRank[i]; //TotalTimeRank [i] = 0; } for ( i = 0; i < 5; i++ ) { for ( j = 0; j < 4; j++ ) { if ( ArraySort[j] < ArraySort[j + 1] ) { temp = ArraySort[j + 1]; ArraySort[j + 1] = ArraySort[j]; ArraySort[j] = temp; } } } //if two or more same values for ( i = 1; i < 5; i++ ) { if ( ArraySort[0] == ArraySort[i] ) { EqualCount++; } } if ( EqualCount > 0 ) { i = 0; for ( j = 0; j < 5; j++ ) { if ( ArraySort[0] == TotalAlgorithmRank[j] ) { indexOfTie[i] = j; i++; } } max0 = TotalTimeRank[indexOfTie[0]]; max1 = TotalNodesRank[indexOfTie[0]]; max2 = (int)TotalEfficiencyRank[indexOfTie[0]]; max3 = (int)TotalDistanceRank[indexOfTie[0]]; max4 = TotalNodesExaminedRank[indexOfTie[0]]; for ( i = 0; i < EqualCount; i++ ) { if ( max0 < TotalTimeRank[indexOfTie[i]] ) { max0 = TotalTimeRank[indexOfTie[i]]; WinCount[0] = indexOfTie[i]; } if ( max1 < TotalNodesRank[indexOfTie[i]] ) { max1 = TotalNodesRank[indexOfTie[i]]; WinCount[1] = indexOfTie[i]; } if ( max2 < TotalEfficiencyRank[indexOfTie[i]] ) { max2 = (int)TotalEfficiencyRank[indexOfTie[i]]; WinCount[2] = indexOfTie[i]; } if ( max3 < TotalDistanceRank[indexOfTie[i]] ) { max3 = (int)TotalDistanceRank[indexOfTie[i]]; WinCount[3] = indexOfTie[i]; } if ( max4 < TotalNodesExaminedRank[indexOfTie[i]] ) { max4 = TotalNodesExaminedRank[indexOfTie[i]]; WinCount[4] = indexOfTie[i]; } } } else { rank = 5; for ( i = 0; i < 5; i++ ) { for ( j = 0; j < 5; j++ ) { if ( ArraySort[i] == TotalAlgorithmRank[j] && TotalAlgorithmRankPriority[j] == 0 ) { TotalAlgorithmRankPriority[j] = rank; } } rank--; } } // end of sorting sum a } }
25.671698
154
0.545642
[ "MIT" ]
aparant777/Artificial-Intelligence-Modules
Final/Path Optimization april 6 - Copy/Assets/Scripts/DecisionSystem.cs
6,805
C#
using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Threading.Tasks; using GovUk.Education.ExploreEducationStatistics.Admin.Services; using GovUk.Education.ExploreEducationStatistics.Admin.Services.Interfaces; using GovUk.Education.ExploreEducationStatistics.Admin.ViewModels; using GovUk.Education.ExploreEducationStatistics.Common.Model; using GovUk.Education.ExploreEducationStatistics.Common.Services; using GovUk.Education.ExploreEducationStatistics.Common.Tests.Utils; using GovUk.Education.ExploreEducationStatistics.Common.Utils; using GovUk.Education.ExploreEducationStatistics.Content.Model; using GovUk.Education.ExploreEducationStatistics.Content.Model.Database; using GovUk.Education.ExploreEducationStatistics.Data.Model; using GovUk.Education.ExploreEducationStatistics.Data.Model.Database; using GovUk.Education.ExploreEducationStatistics.Data.Model.Services.Interfaces; using Microsoft.EntityFrameworkCore; using Moq; using Xunit; using static GovUk.Education.ExploreEducationStatistics.Admin.Tests.Services.DbUtils; using static GovUk.Education.ExploreEducationStatistics.Admin.Tests.Services.MapperUtils; using static GovUk.Education.ExploreEducationStatistics.Admin.Tests.Services.ValidationTestUtil; using static GovUk.Education.ExploreEducationStatistics.Admin.Validators.ValidationErrorMessages; using IFootnoteService = GovUk.Education.ExploreEducationStatistics.Admin.Services.Interfaces.IFootnoteService; using IReleaseRepository = GovUk.Education.ExploreEducationStatistics.Admin.Services.Interfaces.IReleaseRepository; using Publication = GovUk.Education.ExploreEducationStatistics.Content.Model.Publication; using Release = GovUk.Education.ExploreEducationStatistics.Content.Model.Release; using Unit = GovUk.Education.ExploreEducationStatistics.Common.Model.Unit; namespace GovUk.Education.ExploreEducationStatistics.Admin.Tests.Services { public class ReleaseServiceTests { private readonly Guid _userId = Guid.NewGuid(); [Fact] public async Task CreateReleaseNoTemplate() { var publication = new Publication { Title = "Publication" }; var contextId = Guid.NewGuid().ToString(); await using (var context = InMemoryApplicationDbContext(contextId)) { await context.AddAsync( new ReleaseType { Title = "Ad Hoc", } ); await context.AddAsync(publication); await context.SaveChangesAsync(); } await using (var context = InMemoryApplicationDbContext(contextId)) { var releaseService = BuildReleaseService(context); var result = releaseService.CreateReleaseAsync( new ReleaseCreateViewModel { PublicationId = publication.Id, ReleaseName = "2018", TimePeriodCoverage = TimeIdentifier.AcademicYear, PublishScheduled = "2050-06-30", TypeId = new Guid("02e664f2-a4bc-43ee-8ff0-c87354adae72") } ); var publishScheduled = new DateTime(2050, 6, 30, 0, 0, 0, DateTimeKind.Unspecified); Assert.Equal("Academic Year 2018/19", result.Result.Right.Title); Assert.Null(result.Result.Right.Published); Assert.Equal(publishScheduled, result.Result.Right.PublishScheduled); Assert.False(result.Result.Right.LatestRelease); // Most recent - but not published yet. Assert.Equal(TimeIdentifier.AcademicYear, result.Result.Right.TimePeriodCoverage); } } [Fact] public async Task CreateReleaseWithTemplate() { var dataBlock1 = new DataBlock { Id = Guid.NewGuid(), Name = "Data Block 1", Order = 2, Comments = new List<Comment> { new Comment { Id = Guid.NewGuid(), Content = "Comment 1 Text" }, new Comment { Id = Guid.NewGuid(), Content = "Comment 2 Text" } } }; var dataBlock2 = new DataBlock { Id = Guid.NewGuid(), Name = "Data Block 2" }; var templateReleaseId = new Guid("26f17bad-fc48-4496-9387-d6e5b2cb0e7f"); var contextId = Guid.NewGuid().ToString(); await using (var context = InMemoryApplicationDbContext(contextId)) { await context.AddAsync( new ReleaseType { Id = new Guid("2a0217ca-c514-45da-a8b3-44c68a6737e8"), Title = "Ad Hoc", } ); await context.AddAsync( new Publication { Id = new Guid("403d3c5d-a8cd-4d54-a029-0c74c86c55b2"), Title = "Publication", Releases = new List<Release> { new Release // Template release { Id = templateReleaseId, ReleaseName = "2018", Content = new List<ReleaseContentSection> { new ReleaseContentSection { ReleaseId = Guid.NewGuid(), ContentSection = new ContentSection { Id = Guid.NewGuid(), Caption = "Template caption index 0", Heading = "Template heading index 0", Type = ContentSectionType.Generic, Order = 1, Content = new List<ContentBlock> { new HtmlBlock { Id = Guid.NewGuid(), Body = @"<div></div>", Order = 1, Comments = new List<Comment> { new Comment { Id = Guid.NewGuid(), Content = "Comment 1 Text" }, new Comment { Id = Guid.NewGuid(), Content = "Comment 2 Text" } } }, dataBlock1 } } }, }, Version = 0, PreviousVersionId = templateReleaseId, ContentBlocks = new List<ReleaseContentBlock> { new ReleaseContentBlock { ReleaseId = templateReleaseId, ContentBlock = dataBlock1, ContentBlockId = dataBlock1.Id, }, new ReleaseContentBlock { ReleaseId = templateReleaseId, ContentBlock = dataBlock2, ContentBlockId = dataBlock2.Id, } } } } } ); await context.SaveChangesAsync(); } await using (var context = InMemoryApplicationDbContext(contextId)) { var releaseService = BuildReleaseService(context); var result = releaseService.CreateReleaseAsync( new ReleaseCreateViewModel { PublicationId = new Guid("403d3c5d-a8cd-4d54-a029-0c74c86c55b2"), TemplateReleaseId = templateReleaseId, ReleaseName = "2018", TimePeriodCoverage = TimeIdentifier.AcademicYear, PublishScheduled = "2050-01-01", TypeId = new Guid("2a0217ca-c514-45da-a8b3-44c68a6737e8") } ); // Do an in depth check of the saved release var newRelease = context.Releases .Include(r => r.Content) .ThenInclude(join => join.ContentSection) .ThenInclude(section => section.Content) .Single(r => r.Id == result.Result.Right.Id); var contentSections = newRelease.GenericContent.ToList(); Assert.Single(contentSections); Assert.Equal("Template caption index 0", contentSections[0].Caption); Assert.Equal("Template heading index 0", contentSections[0].Heading); Assert.Single(contentSections); Assert.Equal(1, contentSections[0].Order); // Content should not be copied when create from template Assert.Empty(contentSections[0].Content); Assert.Empty(contentSections[0].Content.AsReadOnly()); Assert.Equal(ContentSectionType.ReleaseSummary, newRelease.SummarySection.Type); Assert.Equal(ContentSectionType.Headlines, newRelease.HeadlinesSection.Type); Assert.Equal(ContentSectionType.KeyStatistics, newRelease.KeyStatisticsSection.Type); Assert.Equal(ContentSectionType.KeyStatisticsSecondary, newRelease.KeyStatisticsSecondarySection.Type); } } [Fact] public async Task LatestReleaseCorrectlyReported() { var publication = new Publication { Id = Guid.NewGuid() }; var notLatestRelease = new Release { Id = new Guid("a941444a-687a-4364-9f7d-d39c35d91b9e"), ReleaseName = "2019", TimePeriodCoverage = TimeIdentifier.December, PublicationId = publication.Id, Published = DateTime.UtcNow, Version = 0, PreviousVersionId = new Guid("a941444a-687a-4364-9f7d-d39c35d91b9e") }; var latestRelease = new Release { Id = new Guid("8909d1b4-78fc-4070-bb3d-90e055f39b39"), ReleaseName = "2020", TimePeriodCoverage = TimeIdentifier.June, PublicationId = publication.Id, Published = DateTime.UtcNow, Version = 0, PreviousVersionId = new Guid("8909d1b4-78fc-4070-bb3d-90e055f39b39") }; var contextId = Guid.NewGuid().ToString(); await using (var context = InMemoryApplicationDbContext(contextId)) { await context.AddAsync(publication); await context.AddRangeAsync( new List<Release> { notLatestRelease, latestRelease } ); await context.SaveChangesAsync(); } // Note that we use different contexts for each method call - this is to avoid misleadingly optimistic // loading of the entity graph as we go. await using (var context = InMemoryApplicationDbContext(contextId)) { var releaseService = BuildReleaseService(context); var notLatest = (await releaseService.GetRelease(notLatestRelease.Id)).Right; Assert.Equal(notLatestRelease.Id, notLatest.Id); Assert.False(notLatest.LatestRelease); } await using (var context = InMemoryApplicationDbContext(contextId)) { var releaseService = BuildReleaseService(context); var latest = (await releaseService.GetRelease(latestRelease.Id)).Right; Assert.Equal(latestRelease.Id, latest.Id); Assert.True(latest.LatestRelease); } } [Fact] public async Task RemoveDataFiles() { var release = new Release { Status = ReleaseStatus.Draft }; var subject = new Subject { Id = Guid.NewGuid(), Name = "Test subject" }; var file = new File { Filename = "data.csv", Type = FileType.Data, SubjectId = subject.Id }; var contentDbContextId = Guid.NewGuid().ToString(); await using (var contentDbContext = InMemoryApplicationDbContext(contentDbContextId)) { await contentDbContext.AddAsync(release); await contentDbContext.AddAsync(file); await contentDbContext.SaveChangesAsync(); } var dataBlockService = new Mock<IDataBlockService>(MockBehavior.Strict); var dataImportService = new Mock<IDataImportService>(MockBehavior.Strict); var subjectService = new Mock<ISubjectService>(MockBehavior.Strict); var releaseDataFileService = new Mock<IReleaseDataFileService>(MockBehavior.Strict); var releaseSubjectService = new Mock<IReleaseSubjectService>(MockBehavior.Strict); dataBlockService.Setup(service => service.GetDeletePlan(release.Id, subject)) .ReturnsAsync(new DeleteDataBlockPlan()); dataBlockService.Setup(service => service.DeleteDataBlocks(It.IsAny<DeleteDataBlockPlan>())) .Returns(Task.CompletedTask); dataImportService.Setup(service => service.GetStatus(file.Id)) .ReturnsAsync(DataImportStatus.COMPLETE); subjectService.Setup(service => service.Get(subject.Id)).ReturnsAsync(subject); releaseDataFileService.Setup(service => service.Delete(release.Id, file.Id, false)) .ReturnsAsync(Unit.Instance); releaseSubjectService.Setup(service => service.SoftDeleteReleaseSubject(release.Id, subject.Id)) .Returns(Task.CompletedTask); await using (var context = InMemoryApplicationDbContext(contentDbContextId)) { var releaseService = BuildReleaseService(context, dataBlockService: dataBlockService.Object, dataImportService: dataImportService.Object, subjectService: subjectService.Object, releaseDataFileService: releaseDataFileService.Object, releaseSubjectService: releaseSubjectService.Object); var result = await releaseService.RemoveDataFiles(release.Id, file.Id); dataBlockService.Verify(mock => mock.GetDeletePlan(release.Id, subject), Times.Once()); dataBlockService.Verify( mock => mock.DeleteDataBlocks(It.IsAny<DeleteDataBlockPlan>()), Times.Once()); releaseDataFileService.Verify(mock => mock.Delete(release.Id, file.Id, false), Times.Once()); dataImportService.Verify( mock => mock.GetStatus(file.Id), Times.Once()); releaseSubjectService.Verify( mock => mock.SoftDeleteReleaseSubject(release.Id, subject.Id), Times.Once()); Assert.True(result.IsRight); } } [Fact] public async Task RemoveDataFiles_FileImporting() { var release = new Release { Status = ReleaseStatus.Draft }; var subject = new Subject { Id = Guid.NewGuid(), Name = "Test subject" }; var file = new File { Filename = "data.csv", Type = FileType.Data, SubjectId = subject.Id }; var contentDbContextId = Guid.NewGuid().ToString(); await using (var contentDbContext = InMemoryApplicationDbContext(contentDbContextId)) { await contentDbContext.AddAsync(release); await contentDbContext.AddAsync(file); await contentDbContext.SaveChangesAsync(); } var dataBlockService = new Mock<IDataBlockService>(MockBehavior.Strict); var dataImportService = new Mock<IDataImportService>(MockBehavior.Strict); var subjectService = new Mock<ISubjectService>(MockBehavior.Strict); var fileStorageService = new Mock<IReleaseFileService>(MockBehavior.Strict); var releaseSubjectService = new Mock<IReleaseSubjectService>(MockBehavior.Strict); dataImportService.Setup(service => service.GetStatus(file.Id)) .ReturnsAsync(DataImportStatus.STAGE_1); subjectService.Setup(service => service.Get(subject.Id)).ReturnsAsync(subject); await using (var context = InMemoryApplicationDbContext(contentDbContextId)) { var releaseService = BuildReleaseService(context, dataBlockService: dataBlockService.Object, dataImportService: dataImportService.Object, subjectService: subjectService.Object, releaseFileService: fileStorageService.Object, releaseSubjectService: releaseSubjectService.Object); var result = await releaseService.RemoveDataFiles(release.Id, file.Id); dataImportService.Verify( mock => mock.GetStatus(file.Id), Times.Once()); Assert.True(result.IsLeft); AssertValidationProblem(result.Left, CannotRemoveDataFilesUntilImportComplete); } } [Fact] public async Task RemoveDataFiles_ReplacementExists() { var release = new Release { Status = ReleaseStatus.Draft }; var subject = new Subject { Id = Guid.NewGuid(), Name = "Test subject", }; var replacementSubject = new Subject { Id = Guid.NewGuid(), Name = "Replacement subject" }; var file = new File { Filename = "data.csv", Type = FileType.Data, SubjectId = subject.Id }; var replacementFile = new File { Filename = "replacement.csv", Type = FileType.Data, SubjectId = replacementSubject.Id, Replacing = file }; file.ReplacedBy = replacementFile; var contentDbContextId = Guid.NewGuid().ToString(); await using (var contentDbContext = InMemoryApplicationDbContext(contentDbContextId)) { await contentDbContext.AddAsync(release); await contentDbContext.AddRangeAsync(file, replacementFile); await contentDbContext.SaveChangesAsync(); } var dataBlockService = new Mock<IDataBlockService>(MockBehavior.Strict); var dataImportService = new Mock<IDataImportService>(MockBehavior.Strict); var subjectService = new Mock<ISubjectService>(MockBehavior.Strict); var releaseDataFileService = new Mock<IReleaseDataFileService>(MockBehavior.Strict); var releaseSubjectService = new Mock<IReleaseSubjectService>(MockBehavior.Strict); dataBlockService.Setup(service => service.GetDeletePlan(release.Id, It.IsIn(subject, replacementSubject))) .ReturnsAsync(new DeleteDataBlockPlan()); dataBlockService.Setup(service => service.DeleteDataBlocks(It.IsAny<DeleteDataBlockPlan>())) .Returns(Task.CompletedTask); dataImportService.Setup(service => service.GetStatus(It.IsIn(file.Id, replacementFile.Id))) .ReturnsAsync(DataImportStatus.COMPLETE); subjectService.Setup(service => service.Get(subject.Id)).ReturnsAsync(subject); subjectService.Setup(service => service.Get(replacementSubject.Id)).ReturnsAsync(replacementSubject); releaseDataFileService .Setup(service => service.Delete(release.Id, It.IsIn(file.Id, replacementFile.Id), false)) .ReturnsAsync(Unit.Instance); releaseSubjectService.Setup(service => service.SoftDeleteReleaseSubject(release.Id, It.IsIn(subject.Id, replacementSubject.Id))) .Returns(Task.CompletedTask); await using (var context = InMemoryApplicationDbContext(contentDbContextId)) { var releaseService = BuildReleaseService(context, dataBlockService: dataBlockService.Object, dataImportService: dataImportService.Object, subjectService: subjectService.Object, releaseDataFileService: releaseDataFileService.Object, releaseSubjectService: releaseSubjectService.Object); var result = await releaseService.RemoveDataFiles(release.Id, file.Id); dataBlockService.Verify( mock => mock.GetDeletePlan(release.Id, It.IsIn(subject, replacementSubject)), Times.Exactly(2)); dataBlockService.Verify( mock => mock.DeleteDataBlocks(It.IsAny<DeleteDataBlockPlan>()), Times.Exactly(2)); releaseDataFileService.Verify( mock => mock.Delete( release.Id, It.IsIn(file.Id, replacementFile.Id), false ), Times.Exactly(2) ); dataImportService.Verify( mock => mock.GetStatus(It.IsIn(file.Id, replacementFile.Id)), Times.Exactly(2)); releaseSubjectService.Verify( mock => mock.SoftDeleteReleaseSubject(release.Id, It.IsIn(subject.Id, replacementSubject.Id)), Times.Exactly(2)); Assert.True(result.IsRight); } } [Fact] public async Task RemoveDataFiles_ReplacementFileImporting() { var release = new Release { Status = ReleaseStatus.Draft }; var subject = new Subject { Id = Guid.NewGuid(), Name = "Test subject", }; var replacementSubject = new Subject { Id = Guid.NewGuid(), Name = "Replacement subject" }; var file = new File { Filename = "data.csv", Type = FileType.Data, SubjectId = subject.Id }; var replacementFile = new File { Filename = "replacement.csv", Type = FileType.Data, SubjectId = replacementSubject.Id, Replacing = file }; file.ReplacedBy = replacementFile; var contentDbContextId = Guid.NewGuid().ToString(); await using (var contentDbContext = InMemoryApplicationDbContext(contentDbContextId)) { await contentDbContext.AddAsync(release); await contentDbContext.AddRangeAsync(file, replacementFile); await contentDbContext.SaveChangesAsync(); } var dataBlockService = new Mock<IDataBlockService>(MockBehavior.Strict); var dataImportService = new Mock<IDataImportService>(MockBehavior.Strict); var subjectService = new Mock<ISubjectService>(MockBehavior.Strict); var fileStorageService = new Mock<IReleaseFileService>(MockBehavior.Strict); var releaseSubjectService = new Mock<IReleaseSubjectService>(MockBehavior.Strict); dataImportService.Setup(service => service.GetStatus(file.Id)) .ReturnsAsync(DataImportStatus.COMPLETE); dataImportService.Setup(service => service.GetStatus(replacementFile.Id)) .ReturnsAsync(DataImportStatus.STAGE_1); await using (var context = InMemoryApplicationDbContext(contentDbContextId)) { var releaseService = BuildReleaseService(context, dataBlockService: dataBlockService.Object, dataImportService: dataImportService.Object, subjectService: subjectService.Object, releaseFileService: fileStorageService.Object, releaseSubjectService: releaseSubjectService.Object); var result = await releaseService.RemoveDataFiles(release.Id, file.Id); dataImportService.Verify( mock => mock.GetStatus(It.IsIn(file.Id, replacementFile.Id)), Times.Exactly(2)); Assert.True(result.IsLeft); AssertValidationProblem(result.Left, CannotRemoveDataFilesUntilImportComplete); } } [Fact] public async Task UpdateRelease() { var releaseId = Guid.NewGuid(); var adHocReleaseType = new ReleaseType { Title = "Ad Hoc" }; var officialStatisticsReleaseType = new ReleaseType { Title = "Official Statistics" }; var release = new Release { Id = releaseId, Type = adHocReleaseType, Publication = new Publication { Title = "Old publication" }, ReleaseName = "2030", PublishScheduled = DateTime.UtcNow, NextReleaseDate = new PartialDate { Day = "15", Month = "6", Year = "2039" }, PreReleaseAccessList = "Old access list", Version = 0, PreviousVersionId = releaseId }; var contextId = Guid.NewGuid().ToString(); await using (var context = InMemoryApplicationDbContext(contextId)) { await context.AddRangeAsync(adHocReleaseType, officialStatisticsReleaseType); await context.AddAsync(release); await context.SaveChangesAsync(); } await using (var context = InMemoryApplicationDbContext(contextId)) { var releaseService = BuildReleaseService(context); var nextReleaseDateEdited = new PartialDate { Day = "1", Month = "1", Year = "2040" }; var result = await releaseService .UpdateRelease( releaseId, new ReleaseUpdateViewModel { PublishScheduled = "2051-06-30", NextReleaseDate = nextReleaseDateEdited, TypeId = officialStatisticsReleaseType.Id, ReleaseName = "2035", TimePeriodCoverage = TimeIdentifier.March, PreReleaseAccessList = "New access list", Status = ReleaseStatus.Draft } ); Assert.True(result.IsRight); Assert.Equal(release.Publication.Id, result.Right.PublicationId); Assert.Equal(new DateTime(2051, 6, 30, 0, 0, 0, DateTimeKind.Unspecified), result.Right.PublishScheduled); Assert.Equal(nextReleaseDateEdited, result.Right.NextReleaseDate); Assert.Equal(officialStatisticsReleaseType, result.Right.Type); Assert.Equal("2035", result.Right.ReleaseName); Assert.Equal(TimeIdentifier.March, result.Right.TimePeriodCoverage); Assert.Equal("New access list", result.Right.PreReleaseAccessList); var saved = await context.Releases.FindAsync(result.Right.Id); Assert.Equal(release.Publication.Id, saved.PublicationId); Assert.Equal(new DateTime(2051, 6, 29, 23, 0, 0, DateTimeKind.Utc), saved.PublishScheduled); Assert.Equal(nextReleaseDateEdited, saved.NextReleaseDate); Assert.Equal(officialStatisticsReleaseType, saved.Type); Assert.Equal("2035-march", saved.Slug); Assert.Equal("2035", saved.ReleaseName); Assert.Equal(TimeIdentifier.March, saved.TimePeriodCoverage); Assert.Equal("New access list", saved.PreReleaseAccessList); } } [Fact] public async Task UpdateRelease_FailsNonUniqueSlug() { var releaseType = new ReleaseType { Title = "Ad Hoc" }; var publication = new Publication { Title = "Old publication" }; var releaseId = Guid.NewGuid(); var release = new Release { Id = releaseId, Type = releaseType, Publication = publication, ReleaseName = "2030", Slug = "2030", PublishScheduled = DateTime.UtcNow, Version = 0, PreviousVersionId = releaseId }; var otherReleaseId = Guid.NewGuid(); var otherRelease = new Release { Id = otherReleaseId, Type = releaseType, Publication = publication, ReleaseName = "2035", Slug = "2035", PublishScheduled = DateTime.UtcNow, Version = 0, PreviousVersionId = otherReleaseId }; var contextId = Guid.NewGuid().ToString(); await using (var context = InMemoryApplicationDbContext(contextId)) { await context.AddAsync(releaseType); await context.AddRangeAsync(release, otherRelease); await context.SaveChangesAsync(); } await using (var context = InMemoryApplicationDbContext(contextId)) { var releaseService = BuildReleaseService(context); var result = await releaseService .UpdateRelease( releaseId, new ReleaseUpdateViewModel { PublishScheduled = "2051-06-30", TypeId = releaseType.Id, ReleaseName = "2035", TimePeriodCoverage = TimeIdentifier.CalendarYear, Status = ReleaseStatus.Draft } ); Assert.True(result.IsLeft); AssertValidationProblem(result.Left, SlugNotUnique); } } [Fact] public async Task UpdateRelease_Amendment_NoUniqueSlugFailure() { var releaseType = new ReleaseType { Title = "Ad Hoc" }; var publication = new Publication { Title = "Old publication" }; var initialReleaseId = Guid.NewGuid(); var initialRelease = new Release { Id = initialReleaseId, Type = releaseType, Publication = publication, ReleaseName = "2035", Slug = "2035", PublishScheduled = DateTime.UtcNow, Version = 0, PreviousVersionId = initialReleaseId }; var amendedRelease = new Release { Type = releaseType, Publication = publication, ReleaseName = "2030", Slug = "2030", PublishScheduled = DateTime.UtcNow, Version = 1, PreviousVersionId = initialRelease.Id }; var contextId = Guid.NewGuid().ToString(); await using (var context = InMemoryApplicationDbContext(contextId)) { await context.AddAsync(releaseType); await context.AddRangeAsync(amendedRelease, initialRelease); await context.SaveChangesAsync(); } await using (var context = InMemoryApplicationDbContext(contextId)) { var releaseService = BuildReleaseService(context); var result = await releaseService .UpdateRelease( amendedRelease.Id, new ReleaseUpdateViewModel { PublishScheduled = "2051-06-30", TypeId = releaseType.Id, ReleaseName = "2035", TimePeriodCoverage = TimeIdentifier.CalendarYear, Status = ReleaseStatus.Draft } ); Assert.True(result.IsRight); Assert.Equal("2035", result.Right.ReleaseName); Assert.Equal(TimeIdentifier.CalendarYear, result.Right.TimePeriodCoverage); } } [Fact] public async Task UpdateRelease_Approved_FailsOnChecklistErrors() { var release = new Release { Type = new ReleaseType { Title = "Ad Hoc" }, Publication = new Publication { Title = "Old publication" }, ReleaseName = "2030", Slug = "2030", PublishScheduled = DateTime.UtcNow, Version = 0, }; var contextId = Guid.NewGuid().ToString(); await using (var context = InMemoryApplicationDbContext(contextId)) { await context.AddAsync(release); await context.SaveChangesAsync(); } await using (var context = InMemoryApplicationDbContext(contextId)) { var releaseChecklistService = new Mock<IReleaseChecklistService>(MockBehavior.Strict); releaseChecklistService .Setup(s => s.GetErrors(It.Is<Release>(r => r.Id == release.Id))) .ReturnsAsync( new List<ReleaseChecklistIssue> { new ReleaseChecklistIssue(DataFileImportsMustBeCompleted), new ReleaseChecklistIssue(DataFileReplacementsMustBeCompleted), } ); var releaseService = BuildReleaseService( context, releaseChecklistService: releaseChecklistService.Object); var result = await releaseService .UpdateRelease( release.Id, new ReleaseUpdateViewModel { PublishScheduled = "2051-06-30", TypeId = release.Type.Id, ReleaseName = "2030", TimePeriodCoverage = TimeIdentifier.CalendarYear, Status = ReleaseStatus.Approved } ); Assert.True(result.IsLeft); AssertValidationProblem(result.Left, DataFileImportsMustBeCompleted); AssertValidationProblem(result.Left, DataFileReplacementsMustBeCompleted); } } [Fact] public async Task UpdateRelease_Approved_FailsChangingToDraft() { var release = new Release { Type = new ReleaseType { Title = "Ad Hoc" }, Publication = new Publication { Title = "Old publication", }, ReleaseName = "2030", Slug = "2030", Published = DateTime.Now, PublishScheduled = DateTime.UtcNow, Version = 0, }; var contextId = Guid.NewGuid().ToString(); await using (var context = InMemoryApplicationDbContext(contextId)) { await context.AddAsync(release); await context.SaveChangesAsync(); } await using (var context = InMemoryApplicationDbContext(contextId)) { var releaseService = BuildReleaseService(context); var result = await releaseService .UpdateRelease( release.Id, new ReleaseUpdateViewModel { PublishScheduled = "2051-06-30", TypeId = release.Type.Id, ReleaseName = "2030", TimePeriodCoverage = TimeIdentifier.CalendarYear, Status = ReleaseStatus.Draft } ); Assert.True(result.IsLeft); AssertValidationProblem(result.Left, PublishedReleaseCannotBeUnapproved); } } [Fact] public async Task UpdateRelease_Approved_FailsNoPublishScheduledDate() { var release = new Release { Type = new ReleaseType { Title = "Ad Hoc" }, Publication = new Publication { Title = "Old publication", }, ReleaseName = "2030", Slug = "2030", Published = DateTime.Now, PublishScheduled = DateTime.UtcNow, Version = 0, }; var contextId = Guid.NewGuid().ToString(); await using (var context = InMemoryApplicationDbContext(contextId)) { await context.AddAsync(release); await context.SaveChangesAsync(); } await using (var context = InMemoryApplicationDbContext(contextId)) { var releaseService = BuildReleaseService(context); var result = await releaseService .UpdateRelease( release.Id, new ReleaseUpdateViewModel { TypeId = release.Type.Id, ReleaseName = "2030", TimePeriodCoverage = TimeIdentifier.CalendarYear, Status = ReleaseStatus.Approved, PublishMethod = PublishMethod.Scheduled } ); Assert.True(result.IsLeft); AssertValidationProblem(result.Left, ApprovedReleaseMustHavePublishScheduledDate); } } [Fact] public async Task GetRelease() { var adHocReleaseType = new ReleaseType { Title = "Ad Hoc" }; var releaseId = Guid.NewGuid(); var nextReleaseDate = new PartialDate {Day = "1", Month = "1", Year = "2040"}; var release = new Release { Id = releaseId, Type = adHocReleaseType, TimePeriodCoverage = TimeIdentifier.January, PublishScheduled = DateTime.Parse("2020-06-29T00:00:00.00Z", styles: DateTimeStyles.AdjustToUniversal), Published = DateTime.Parse("2020-06-29T02:00:00.00Z"), NextReleaseDate = nextReleaseDate, ReleaseName = "2035", Slug = "2035-1", Version = 0, InternalReleaseNote = "Test release note", PreReleaseAccessList = "Test access list", }; var publication = new Publication { Id = new Guid("f7da23e2-304a-4b47-a8f5-dba28a554de9"), Title = "Test publication", Slug = "test-publication", Releases = new List<Release> { release } }; var contextId = Guid.NewGuid().ToString(); await using (var context = InMemoryApplicationDbContext(contextId)) { await context.AddAsync(publication); await context.SaveChangesAsync(); } await using (var context = InMemoryApplicationDbContext(contextId)) { var releaseService = BuildReleaseService(context); var result = await releaseService.GetRelease(releaseId); var viewModel = result.Right; Assert.Equal("2035", viewModel.ReleaseName); Assert.Equal("2035-1", viewModel.Slug); Assert.Equal(publication.Id, viewModel.PublicationId); Assert.Equal("Test publication", viewModel.PublicationTitle); Assert.Equal("test-publication", viewModel.PublicationSlug); Assert.Equal("Test release note", viewModel.InternalReleaseNote); Assert.Equal(DateTime.Parse("2020-06-29T01:00:00.00"), viewModel.PublishScheduled); Assert.Equal(DateTime.Parse("2020-06-29T02:00:00.00Z"), viewModel.Published); Assert.Equal("Test access list", viewModel.PreReleaseAccessList); Assert.Equal(nextReleaseDate, viewModel.NextReleaseDate); Assert.Equal(adHocReleaseType, viewModel.Type); Assert.Equal(TimeIdentifier.January, viewModel.TimePeriodCoverage); Assert.Equal("2035", viewModel.YearTitle); Assert.Null(viewModel.PreviousVersionId); Assert.True(viewModel.LatestRelease); Assert.True(viewModel.Live); Assert.False(viewModel.Amendment); } } [Fact] public async Task GetLatestReleaseAsync() { var publication = new Publication { Id = Guid.NewGuid() }; var notLatestRelease = new Release { Id = new Guid("1cf74d85-2a20-4b2a-a944-6b74f79e56a4"), Published = DateTime.UtcNow, PublicationId = publication.Id, ReleaseName = "2035", TimePeriodCoverage = TimeIdentifier.December, Version = 0, PreviousVersionId = new Guid("1cf74d85-2a20-4b2a-a944-6b74f79e56a4") }; var latestReleaseV0 = new Release { Id = new Guid("7ef22424-a66f-47b9-85b0-50bdf2a622fc"), Published = DateTime.UtcNow, PublicationId = publication.Id, ReleaseName = "2036", TimePeriodCoverage = TimeIdentifier.June, Version = 0, PreviousVersionId = new Guid("7ef22424-a66f-47b9-85b0-50bdf2a622fc") }; var latestReleaseV1 = new Release { Id = new Guid("d301f5b7-a89b-4d7e-b020-53f8631c72b2"), Published = DateTime.UtcNow, PublicationId = publication.Id, ReleaseName = "2036", TimePeriodCoverage = TimeIdentifier.June, Version = 1, PreviousVersionId = new Guid("7ef22424-a66f-47b9-85b0-50bdf2a622fc") }; var latestReleaseV2Deleted = new Release { Id = new Guid("efc6d4bd-9bf4-4179-a1fb-88cdfa2e19f6"), Published = DateTime.UtcNow, PublicationId = publication.Id, ReleaseName = "2036", TimePeriodCoverage = TimeIdentifier.June, Version = 2, PreviousVersionId = new Guid("d301f5b7-a89b-4d7e-b020-53f8631c72b2"), SoftDeleted = true }; var contextId = Guid.NewGuid().ToString(); await using (var context = InMemoryApplicationDbContext(contextId)) { await context.AddAsync( new UserReleaseRole { UserId = _userId, ReleaseId = notLatestRelease.Id } ); await context.AddAsync(publication); await context.AddRangeAsync( new List<Release> { notLatestRelease, latestReleaseV0, latestReleaseV1, latestReleaseV2Deleted } ); await context.SaveChangesAsync(); } await using (var context = InMemoryApplicationDbContext(contextId)) { var releaseService = BuildReleaseService(context); var latest = releaseService.GetLatestReleaseAsync(publication.Id).Result.Right; Assert.NotNull(latest); Assert.Equal(latestReleaseV1.Id, latest.Id); Assert.Equal("June 2036", latest.Title); } } [Fact] public async Task DeleteRelease() { var publication = new Publication(); var release = new Release { Publication = publication, Version = 0, }; var userReleaseRole = new UserReleaseRole { UserId = _userId, Release = release }; var userReleaseInvite = new UserReleaseInvite { Release = release }; var anotherRelease = new Release { Publication = publication, Version = 0 }; var anotherUserReleaseRole = new UserReleaseRole { Id = Guid.NewGuid(), Release = anotherRelease }; var anotherUserReleaseInvite = new UserReleaseInvite { Id = Guid.NewGuid(), Release = anotherRelease }; var contextId = Guid.NewGuid().ToString(); await using (var context = InMemoryApplicationDbContext(contextId)) { await context.AddAsync(publication); await context.AddRangeAsync(release, anotherRelease); await context.AddRangeAsync(userReleaseRole, anotherUserReleaseRole); await context.AddRangeAsync(userReleaseInvite, anotherUserReleaseInvite); await context.SaveChangesAsync(); } var releaseDataFilesService = new Mock<IReleaseDataFileService>(MockBehavior.Strict); var releaseFileService = new Mock<IReleaseFileService>(MockBehavior.Strict); releaseDataFilesService.Setup(mock => mock.DeleteAll(release.Id, false)).ReturnsAsync(Unit.Instance); releaseFileService.Setup(mock => mock.DeleteAll(release.Id, false)).ReturnsAsync(Unit.Instance); await using (var context = InMemoryApplicationDbContext(contextId)) { var releaseService = BuildReleaseService(context, releaseDataFileService: releaseDataFilesService.Object, releaseFileService: releaseFileService.Object); var result = await releaseService.DeleteRelease(release.Id); releaseDataFilesService.Verify(mock => mock.DeleteAll(release.Id, false), Times.Once); releaseFileService.Verify(mock => mock.DeleteAll(release.Id, false), Times.Once); Assert.True(result.IsRight); // assert that soft-deleted entities are no longer discoverable by default var unableToFindDeletedRelease = context .Releases .FirstOrDefault(r => r.Id == release.Id); Assert.Null(unableToFindDeletedRelease); var unableToFindDeletedReleaseRole = context .UserReleaseRoles .FirstOrDefault(r => r.Id == userReleaseRole.Id); Assert.Null(unableToFindDeletedReleaseRole); var unableToFindDeletedReleaseInvite = context .UserReleaseInvites .FirstOrDefault(r => r.Id == userReleaseInvite.Id); Assert.Null(unableToFindDeletedReleaseInvite); // assert that soft-deleted entities do not appear via references from other entities by default var publicationWithoutDeletedRelease = context .Publications .Include(p => p.Releases) .AsNoTracking() .First(p => p.Id == publication.Id); Assert.Single(publicationWithoutDeletedRelease.Releases); Assert.Equal(anotherRelease.Id, publicationWithoutDeletedRelease.Releases[0].Id); // assert that soft-deleted entities have had their soft-deleted flag set to true var updatedRelease = context .Releases .IgnoreQueryFilters() .First(r => r.Id == release.Id); Assert.True(updatedRelease.SoftDeleted); var updatedReleaseRole = context .UserReleaseRoles .IgnoreQueryFilters() .First(r => r.Id == userReleaseRole.Id); Assert.True(updatedReleaseRole.SoftDeleted); var updatedReleaseInvite = context .UserReleaseInvites .IgnoreQueryFilters() .First(r => r.Id == userReleaseInvite.Id); Assert.True(updatedReleaseInvite.SoftDeleted); // assert that soft-deleted entities appear via references from other entities when explicitly searched for var publicationWithDeletedRelease = context .Publications .Include(p => p.Releases) .IgnoreQueryFilters() .AsNoTracking() .First(p => p.Id == publication.Id); Assert.Equal(2, publicationWithDeletedRelease.Releases.Count); Assert.Equal(updatedRelease.Id, publicationWithDeletedRelease.Releases[0].Id); Assert.Equal(anotherRelease.Id, publicationWithDeletedRelease.Releases[1].Id); Assert.True(publicationWithDeletedRelease.Releases[0].SoftDeleted); Assert.False(publicationWithDeletedRelease.Releases[1].SoftDeleted); // assert that other entities were not accidentally soft-deleted var retrievedAnotherReleaseRole = context .UserReleaseRoles .First(r => r.Id == anotherUserReleaseRole.Id); Assert.False(retrievedAnotherReleaseRole.SoftDeleted); var retrievedAnotherReleaseInvite = context .UserReleaseInvites .First(r => r.Id == anotherUserReleaseInvite.Id); Assert.False(retrievedAnotherReleaseInvite.SoftDeleted); } } private ReleaseService BuildReleaseService( ContentDbContext contentDbContext, StatisticsDbContext statisticsDbContext = null, IPublishingService publishingService = null, IReleaseRepository releaseRepository = null, IReleaseFileRepository releaseFileRepository = null, ISubjectService subjectService = null, IReleaseFileService releaseFileService = null, IReleaseDataFileService releaseDataFileService = null, IDataImportService dataImportService = null, IFootnoteService footnoteService = null, IDataBlockService dataBlockService = null, IReleaseChecklistService releaseChecklistService = null, IReleaseSubjectService releaseSubjectService = null) { var userService = MockUtils.AlwaysTrueUserService(); userService .Setup(s => s.GetUserId()) .Returns(_userId); return new ReleaseService( contentDbContext, AdminMapper(), publishingService ?? new Mock<IPublishingService>().Object, new PersistenceHelper<ContentDbContext>(contentDbContext), userService.Object, releaseRepository ?? new Mock<IReleaseRepository>().Object, releaseFileRepository ?? new Mock<IReleaseFileRepository>().Object, subjectService ?? new Mock<ISubjectService>().Object, releaseDataFileService ?? new Mock<IReleaseDataFileService>().Object, releaseFileService ?? new Mock<IReleaseFileService>().Object, dataImportService ?? new Mock<IDataImportService>().Object, footnoteService ?? new Mock<IFootnoteService>().Object, statisticsDbContext ?? new Mock<StatisticsDbContext>().Object, dataBlockService ?? new Mock<IDataBlockService>().Object, releaseChecklistService ?? new Mock<IReleaseChecklistService>().Object, releaseSubjectService ?? new Mock<IReleaseSubjectService>().Object, new SequentialGuidGenerator() ); } } }
40.690151
123
0.520495
[ "MIT" ]
benoutram/explore-education-statistics
src/GovUk.Education.ExploreEducationStatistics.Admin.Tests/Services/ReleaseServiceTests.cs
56,600
C#
using UnityEngine; namespace ScriptableVariablesAndReferences { public class TransformReference : Reference<Transform> { } }
16.333333
58
0.707483
[ "MIT" ]
Maximilian-Winter/CSCS-Unity
Assets/Scripts/ScriptableObjects/ScriptableArchitecture/Runtime/References/TransformReference.cs
149
C#
using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using NSubstitute; using RestEase; using Rsi.DependencyInjection.Testing; using Xunit; namespace Rsi.DependencyInjection.SampleWebApi.Tests { [Collection(nameof(FixtureCollection))] public class SampleControllerTests { private readonly TestHost<TestStartup> _testHost; public SampleControllerTests(TestHost<TestStartup> testHost) { _testHost = testHost; } [Fact] public async Task GetSampleValue_WhenCalledWithoutMocks_ReturnsInitialValue() { var sampleController = RestClient.For<ISampleController>(_testHost.HttpClient); var sampleValue = await sampleController.GetSampleValue(); Assert.Equal("To get this value we had to do some really hard work", sampleValue); } [Fact] public async Task GetSampleValue_WhenCalledWithMock_ReturnsMockValue() { using var mockServiceScope = _testHost.RootScope.CreateScope(mockServices => { var mockSampleService = Substitute.For<ISampleService>(); mockSampleService.GetSampleValue().ReturnsForAnyArgs("Mock value"); mockServices.AddSingleton(_ => mockSampleService); }); var sampleController = RestClient.For<ISampleController>(_testHost.HttpClient); var sampleValue = await sampleController.GetSampleValue(); Assert.Equal("Mock value", sampleValue); } } }
30.75
85
0.777531
[ "MIT" ]
volodin-danila/Rsi.DependencyInjection
tests/Rsi.DependencyInjection.SampleWebApi.Tests/SampleControllerTests.cs
1,355
C#
namespace _8._1._2_objekt { internal class Nastavnik { private string ime = "Antonije Marcus"; private int oib; public string Ime { get => ime; // READ ONLY. } public int Oib { set => oib = value; // WRITE ONLY. } public int PartialOib { get => int.Parse(oib.ToString().Substring(0, 3)); } public static string Opis() { return "Nastavnik je osoba koja predaje u obrazovnim ustanovama"; } /// <summary> /// Ovo dohvaća koeficijent za izračun plaće /// </summary> /// <returns>float</returns> public static float Koeficijent() { return 1.5f; } public override string ToString() { return "Moje ime je " + this.Ime + " a moj oib je: " + this.PartialOib+"*********"; } } }
22.75
77
0.453546
[ "MIT" ]
mmikleusevic/AlgebraCSharp2019-1
ConsoleApp1/8.1.2_objekt/Nastavnik.cs
1,006
C#
/* * convertapi * * Convert API lets you effortlessly convert file formats and types. * * OpenAPI spec version: v1 * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ using NUnit.Framework; using System; using System.Linq; using System.IO; using System.Collections.Generic; using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Api; using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Model; using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Client; using System.Reflection; using Newtonsoft.Json; namespace Cloudmersive.APIClient.NET.DocumentAndDataConvert.Test { /// <summary> /// Class for testing RemoveDocxHeadersAndFootersResponse /// </summary> /// <remarks> /// This file is automatically generated by Swagger Codegen. /// Please update the test case below to test the model. /// </remarks> [TestFixture] public class RemoveDocxHeadersAndFootersResponseTests { // TODO uncomment below to declare an instance variable for RemoveDocxHeadersAndFootersResponse //private RemoveDocxHeadersAndFootersResponse instance; /// <summary> /// Setup before each test /// </summary> [SetUp] public void Init() { // TODO uncomment below to create an instance of RemoveDocxHeadersAndFootersResponse //instance = new RemoveDocxHeadersAndFootersResponse(); } /// <summary> /// Clean up after each test /// </summary> [TearDown] public void Cleanup() { } /// <summary> /// Test an instance of RemoveDocxHeadersAndFootersResponse /// </summary> [Test] public void RemoveDocxHeadersAndFootersResponseInstanceTest() { // TODO uncomment below to test "IsInstanceOfType" RemoveDocxHeadersAndFootersResponse //Assert.IsInstanceOfType<RemoveDocxHeadersAndFootersResponse> (instance, "variable 'instance' is a RemoveDocxHeadersAndFootersResponse"); } /// <summary> /// Test the property 'Successful' /// </summary> [Test] public void SuccessfulTest() { // TODO unit test for the property 'Successful' } /// <summary> /// Test the property 'EditedDocumentURL' /// </summary> [Test] public void EditedDocumentURLTest() { // TODO unit test for the property 'EditedDocumentURL' } } }
28.404494
150
0.644778
[ "Apache-2.0" ]
Cloudmersive/Cloudmersive.APIClient.NET.DocumentAndDataConvert
client/src/Cloudmersive.APIClient.NET.DocumentAndDataConvert.Test/Model/RemoveDocxHeadersAndFootersResponseTests.cs
2,528
C#
// Copyright (c) Alexandre Mutel. All rights reserved. // This file is licensed under the BSD-Clause 2 license. // See the license.txt file in the project root for more information. using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Runtime.CompilerServices; using Markdig.Extensions.Tables; namespace Markdig.Helpers { /// <summary> /// A group of <see cref="StringLine"/>. /// </summary> /// <seealso cref="System.Collections.IEnumerable" /> public struct StringLineGroup : IEnumerable { /// <summary> /// Initializes a new instance of the <see cref="StringLineGroup"/> class. /// </summary> /// <param name="capacity"></param> public StringLineGroup(int capacity) { if (capacity <= 0) throw new ArgumentOutOfRangeException(nameof(capacity)); Lines = new StringLine[capacity]; Count = 0; } /// <summary> /// Initializes a new instance of the <see cref="StringLineGroup"/> class. /// </summary> /// <param name="text">The text.</param> /// <exception cref="System.ArgumentNullException"></exception> public StringLineGroup(string text) { if (text == null) throw new ArgumentNullException(nameof(text)); Lines = new StringLine[1]; Count = 0; Add(new StringSlice(text)); } /// <summary> /// Gets the lines. /// </summary> public StringLine[] Lines { get; private set; } /// <summary> /// Gets the number of lines. /// </summary> public int Count { get; private set; } /// <summary> /// Clears this instance. /// </summary> public void Clear() { Array.Clear(Lines, 0, Lines.Length); Count = 0; } /// <summary> /// Removes the line at the specified index. /// </summary> /// <param name="index">The index.</param> public void RemoveAt(int index) { if (Count - 1 == index) { Count--; } else { Array.Copy(Lines, index + 1, Lines, index, Count - index - 1); Lines[Count - 1] = new StringLine(); Count--; } } /// <summary> /// Adds the specified line to this instance. /// </summary> /// <param name="line">The line.</param> [MethodImpl(MethodImplOptionPortable.AggressiveInlining)] public void Add(ref StringLine line) { if (Count == Lines.Length) IncreaseCapacity(); Lines[Count++] = line; } /// <summary> /// Adds the specified slice to this instance. /// </summary> /// <param name="slice">The slice.</param> [MethodImpl(MethodImplOptionPortable.AggressiveInlining)] public void Add(StringSlice slice) { if (Count == Lines.Length) IncreaseCapacity(); Lines[Count++] = new StringLine(ref slice); } public override string ToString() { return ToSlice().ToString(); } /// <summary> /// Converts the lines to a single <see cref="StringSlice"/> by concatenating the lines. /// </summary> /// <param name="lineOffsets">The position of the `\n` line offsets from the beginning of the returned slice.</param> /// <returns>A single slice concatenating the lines of this instance</returns> public StringSlice ToSlice(List<LineOffset> lineOffsets = null) { // Optimization case when no lines if (Count == 0) { return new StringSlice(string.Empty); } // Optimization case for a single line. if (Count == 1) { if (lineOffsets != null) { lineOffsets.Add(new LineOffset(Lines[0].Position, Lines[0].Column, Lines[0].Slice.Start - Lines[0].Position, Lines[0].Slice.Start, Lines[0].Slice.End + 1)); } return Lines[0]; } // Else use a builder var builder = StringBuilderCache.Local(); int previousStartOfLine = 0; for (int i = 0; i < Count; i++) { if (i > 0) { if (lineOffsets != null) { lineOffsets.Add(new LineOffset(Lines[i - 1].Position, Lines[i - 1].Column, Lines[i - 1].Slice.Start - Lines[i - 1].Position, previousStartOfLine, builder.Length)); } builder.Append('\n'); previousStartOfLine = builder.Length; } if (!Lines[i].Slice.IsEmpty) { builder.Append(Lines[i].Slice.Text, Lines[i].Slice.Start, Lines[i].Slice.Length); } } if (lineOffsets != null) { lineOffsets.Add(new LineOffset(Lines[Count - 1].Position, Lines[Count - 1].Column, Lines[Count - 1].Slice.Start - Lines[Count - 1].Position, previousStartOfLine, builder.Length)); } var str = builder.ToString(); builder.Length = 0; return new StringSlice(str); } /// <summary> /// Converts this instance into a <see cref="ICharIterator"/>. /// </summary> /// <returns></returns> public Iterator ToCharIterator() { return new Iterator(this); } /// <summary> /// Trims each lines of the specified <see cref="StringLineGroup"/>. /// </summary> public void Trim() { for (int i = 0; i < Count; i++) { Lines[i].Slice.Trim(); } } IEnumerator IEnumerable.GetEnumerator() { return Lines.GetEnumerator(); } private void IncreaseCapacity() { var newItems = new StringLine[Lines.Length * 2]; if (Count > 0) { Array.Copy(Lines, 0, newItems, 0, Count); } Lines = newItems; } /// <summary> /// The iterator used to iterate other the lines. /// </summary> /// <seealso cref="ICharIterator" /> public struct Iterator : ICharIterator { private readonly StringLineGroup _lines; private int _offset; public Iterator(StringLineGroup lines) { this._lines = lines; Start = -1; _offset = -1; SliceIndex = 0; CurrentChar = '\0'; End = -2; for (int i = 0; i < lines.Count; i++) { End += lines.Lines[i].Slice.Length + 1; // Add chars } NextChar(); } public int Start { get; private set; } public char CurrentChar { get; private set; } public int End { get; private set; } public bool IsEmpty => Start > End; public int SliceIndex { get; private set; } public char NextChar() { Start++; _offset++; if (Start <= End) { var slice = (StringSlice)_lines.Lines[SliceIndex]; if (_offset < slice.Length) { CurrentChar = slice[slice.Start + _offset]; } else { CurrentChar = '\n'; SliceIndex++; _offset = -1; } } else { CurrentChar = '\0'; Start = End + 1; SliceIndex = _lines.Count; _offset--; } return CurrentChar; } public char PeekChar(int offset = 1) { if (offset < 0) throw new ArgumentOutOfRangeException("Negative offset are not supported for StringLineGroup", nameof(offset)); if (Start + offset > End) { return '\0'; } var slice = (StringSlice)_lines.Lines[SliceIndex]; if (_offset + offset >= slice.Length) { return '\n'; } return slice[slice.Start + _offset + offset]; } public bool TrimStart() { var c = CurrentChar; bool hasSpaces = false; while (c.IsWhitespace()) { hasSpaces = true; c = NextChar(); } return hasSpaces; } } public struct LineOffset { public LineOffset(int linePosition, int column, int offset, int start, int end) { LinePosition = linePosition; Column = column; Offset = offset; Start = start; End = end; } public readonly int LinePosition; public readonly int Column; public readonly int Offset; public readonly int Start; public readonly int End; } } }
31.605178
195
0.470408
[ "BSD-2-Clause" ]
ForNeVeR/markdig
src/Markdig/Helpers/StringLineGroup.cs
9,766
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. #nullable disable using System; namespace Microsoft.AspNetCore.Components { public static partial class BindConverter { public static bool FormatValue(bool value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(System.DateTime value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(System.DateTime value, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(System.DateTimeOffset value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(System.DateTimeOffset value, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(decimal value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(double value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(int value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(long value, System.Globalization.CultureInfo culture = null) { throw null; } public static bool? FormatValue(bool? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(System.DateTimeOffset? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(System.DateTimeOffset? value, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(System.DateTime? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(System.DateTime? value, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(decimal? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(double? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(int? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(long? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(float? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(float value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(string value, System.Globalization.CultureInfo culture = null) { throw null; } public static object FormatValue<T>(T value, System.Globalization.CultureInfo culture = null) { throw null; } public static bool TryConvertToBool(object obj, System.Globalization.CultureInfo culture, out bool value) { throw null; } public static bool TryConvertToDateTime(object obj, System.Globalization.CultureInfo culture, out System.DateTime value) { throw null; } public static bool TryConvertToDateTime(object obj, System.Globalization.CultureInfo culture, string format, out System.DateTime value) { throw null; } public static bool TryConvertToDateTimeOffset(object obj, System.Globalization.CultureInfo culture, out System.DateTimeOffset value) { throw null; } public static bool TryConvertToDateTimeOffset(object obj, System.Globalization.CultureInfo culture, string format, out System.DateTimeOffset value) { throw null; } public static bool TryConvertToDecimal(object obj, System.Globalization.CultureInfo culture, out decimal value) { throw null; } public static bool TryConvertToDouble(object obj, System.Globalization.CultureInfo culture, out double value) { throw null; } public static bool TryConvertToFloat(object obj, System.Globalization.CultureInfo culture, out float value) { throw null; } public static bool TryConvertToInt(object obj, System.Globalization.CultureInfo culture, out int value) { throw null; } public static bool TryConvertToLong(object obj, System.Globalization.CultureInfo culture, out long value) { throw null; } public static bool TryConvertToNullableBool(object obj, System.Globalization.CultureInfo culture, out bool? value) { throw null; } public static bool TryConvertToNullableDateTime(object obj, System.Globalization.CultureInfo culture, out System.DateTime? value) { throw null; } public static bool TryConvertToNullableDateTime(object obj, System.Globalization.CultureInfo culture, string format, out System.DateTime? value) { throw null; } public static bool TryConvertToNullableDateTimeOffset(object obj, System.Globalization.CultureInfo culture, out System.DateTimeOffset? value) { throw null; } public static bool TryConvertToNullableDateTimeOffset(object obj, System.Globalization.CultureInfo culture, string format, out System.DateTimeOffset? value) { throw null; } public static bool TryConvertToNullableDecimal(object obj, System.Globalization.CultureInfo culture, out decimal? value) { throw null; } public static bool TryConvertToNullableDouble(object obj, System.Globalization.CultureInfo culture, out double? value) { throw null; } public static bool TryConvertToNullableFloat(object obj, System.Globalization.CultureInfo culture, out float? value) { throw null; } public static bool TryConvertToNullableInt(object obj, System.Globalization.CultureInfo culture, out int? value) { throw null; } public static bool TryConvertToNullableLong(object obj, System.Globalization.CultureInfo culture, out long? value) { throw null; } public static bool TryConvertToString(object obj, System.Globalization.CultureInfo culture, out string value) { throw null; } public static bool TryConvertTo<T>(object obj, System.Globalization.CultureInfo culture, out T value) { throw null; } } [System.AttributeUsageAttribute(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)] public sealed partial class BindElementAttribute : System.Attribute { public BindElementAttribute(string element, string suffix, string valueAttribute, string changeAttribute) { } public string ChangeAttribute { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public string Element { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public string Suffix { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public string ValueAttribute { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)] public sealed partial class CascadingParameterAttribute : System.Attribute { public CascadingParameterAttribute() { } public string Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } } [System.AttributeUsageAttribute(System.AttributeTargets.Class, AllowMultiple = true, Inherited = false)] public sealed partial class CascadingTypeParameterAttribute : System.Attribute { public CascadingTypeParameterAttribute(string name) { } public string Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } } public partial class CascadingValue<TValue> : Microsoft.AspNetCore.Components.IComponent { public CascadingValue() { } [Microsoft.AspNetCore.Components.ParameterAttribute] public Microsoft.AspNetCore.Components.RenderFragment ChildContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } [Microsoft.AspNetCore.Components.ParameterAttribute] public bool IsFixed { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } [Microsoft.AspNetCore.Components.ParameterAttribute] public string Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } [Microsoft.AspNetCore.Components.ParameterAttribute] public TValue Value { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } public void Attach(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { } public System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView parameters) { throw null; } } public partial class ChangeEventArgs : System.EventArgs { public ChangeEventArgs() { } public object Value { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } } public abstract partial class ComponentBase : Microsoft.AspNetCore.Components.IComponent, Microsoft.AspNetCore.Components.IHandleAfterRender, Microsoft.AspNetCore.Components.IHandleEvent { public ComponentBase() { } protected virtual void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder builder) { } protected System.Threading.Tasks.Task InvokeAsync(System.Action workItem) { throw null; } protected System.Threading.Tasks.Task InvokeAsync(System.Func<System.Threading.Tasks.Task> workItem) { throw null; } void Microsoft.AspNetCore.Components.IComponent.Attach(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { } System.Threading.Tasks.Task Microsoft.AspNetCore.Components.IHandleAfterRender.OnAfterRenderAsync() { throw null; } System.Threading.Tasks.Task Microsoft.AspNetCore.Components.IHandleEvent.HandleEventAsync(Microsoft.AspNetCore.Components.EventCallbackWorkItem callback, object arg) { throw null; } protected virtual void OnAfterRender(bool firstRender) { } protected virtual System.Threading.Tasks.Task OnAfterRenderAsync(bool firstRender) { throw null; } protected virtual void OnInitialized() { } protected virtual System.Threading.Tasks.Task OnInitializedAsync() { throw null; } protected virtual void OnParametersSet() { } protected virtual System.Threading.Tasks.Task OnParametersSetAsync() { throw null; } public virtual System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView parameters) { throw null; } protected virtual bool ShouldRender() { throw null; } protected void StateHasChanged() { } } public abstract partial class Dispatcher { protected Dispatcher() { } public void AssertAccess() { } public abstract bool CheckAccess(); public static Microsoft.AspNetCore.Components.Dispatcher CreateDefault() { throw null; } public abstract System.Threading.Tasks.Task InvokeAsync(System.Action workItem); public abstract System.Threading.Tasks.Task InvokeAsync(System.Func<System.Threading.Tasks.Task> workItem); public abstract System.Threading.Tasks.Task<TResult> InvokeAsync<TResult>(System.Func<System.Threading.Tasks.Task<TResult>> workItem); public abstract System.Threading.Tasks.Task<TResult> InvokeAsync<TResult>(System.Func<TResult> workItem); protected void OnUnhandledException(System.UnhandledExceptionEventArgs e) { } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ElementReference { private readonly object _dummy; public ElementReference(string id) { throw null; } public string Id { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct EventCallback { private readonly object _dummy; public static readonly Microsoft.AspNetCore.Components.EventCallback Empty; public static readonly Microsoft.AspNetCore.Components.EventCallbackFactory Factory; public EventCallback(Microsoft.AspNetCore.Components.IHandleEvent receiver, System.MulticastDelegate @delegate) { throw null; } public bool HasDelegate { get { throw null; } } public System.Threading.Tasks.Task InvokeAsync(object arg) { throw null; } public System.Threading.Tasks.Task InvokeAsync() { throw null; } } public sealed partial class EventCallbackFactory { public EventCallbackFactory() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Microsoft.AspNetCore.Components.EventCallback Create(object receiver, Microsoft.AspNetCore.Components.EventCallback callback) { throw null; } public Microsoft.AspNetCore.Components.EventCallback Create(object receiver, System.Action callback) { throw null; } public Microsoft.AspNetCore.Components.EventCallback Create(object receiver, System.Action<object> callback) { throw null; } public Microsoft.AspNetCore.Components.EventCallback Create(object receiver, System.Func<object, System.Threading.Tasks.Task> callback) { throw null; } public Microsoft.AspNetCore.Components.EventCallback Create(object receiver, System.Func<System.Threading.Tasks.Task> callback) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Microsoft.AspNetCore.Components.EventCallback<TValue> CreateInferred<TValue>(object receiver, System.Action<TValue> callback, TValue value) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Microsoft.AspNetCore.Components.EventCallback<TValue> CreateInferred<TValue>(object receiver, System.Func<TValue, System.Threading.Tasks.Task> callback, TValue value) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Microsoft.AspNetCore.Components.EventCallback<TValue> Create<TValue>(object receiver, Microsoft.AspNetCore.Components.EventCallback callback) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Microsoft.AspNetCore.Components.EventCallback<TValue> Create<TValue>(object receiver, Microsoft.AspNetCore.Components.EventCallback<TValue> callback) { throw null; } public Microsoft.AspNetCore.Components.EventCallback<TValue> Create<TValue>(object receiver, System.Action callback) { throw null; } public Microsoft.AspNetCore.Components.EventCallback<TValue> Create<TValue>(object receiver, System.Action<TValue> callback) { throw null; } public Microsoft.AspNetCore.Components.EventCallback<TValue> Create<TValue>(object receiver, System.Func<System.Threading.Tasks.Task> callback) { throw null; } public Microsoft.AspNetCore.Components.EventCallback<TValue> Create<TValue>(object receiver, System.Func<TValue, System.Threading.Tasks.Task> callback) { throw null; } } public static partial class EventCallbackFactoryBinderExtensions { public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<bool> setter, bool existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<bool> setter, bool existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTimeOffset> setter, System.DateTimeOffset existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<System.DateTimeOffset> setter, System.DateTimeOffset existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTimeOffset> setter, System.DateTimeOffset existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<System.DateTimeOffset> setter, System.DateTimeOffset existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTime> setter, System.DateTime existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<System.DateTime> setter, System.DateTime existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTime> setter, System.DateTime existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<System.DateTime> setter, System.DateTime existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<decimal> setter, decimal existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<decimal> setter, decimal existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<double> setter, double existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<double> setter, double existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<int> setter, int existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<int> setter, int existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<long> setter, long existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<long> setter, long existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<bool?> setter, bool? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<bool?> setter, bool? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTimeOffset?> setter, System.DateTimeOffset? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<System.DateTimeOffset?> setter, System.DateTimeOffset? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTimeOffset?> setter, System.DateTimeOffset? existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<System.DateTimeOffset?> setter, System.DateTimeOffset? existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTime?> setter, System.DateTime? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<System.DateTime?> setter, System.DateTime? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTime?> setter, System.DateTime? existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<System.DateTime?> setter, System.DateTime? existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<decimal?> setter, decimal? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<decimal?> setter, decimal? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<double?> setter, double? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<double?> setter, double? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<int?> setter, int? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<int?> setter, int? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<long?> setter, long? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<long?> setter, long? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<float?> setter, float? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<float?> setter, float? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<float> setter, float existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<float> setter, float existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<string> setter, string existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<string> setter, string existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder<T>(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<T> setter, T existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder<T>(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, Microsoft.AspNetCore.Components.EventCallback<T> setter, T existingValue, System.Globalization.CultureInfo culture = null) { throw null; } } public static partial class EventCallbackFactoryEventArgsExtensions { public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<Microsoft.AspNetCore.Components.ChangeEventArgs> callback) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<System.EventArgs> Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.EventArgs> callback) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Func<Microsoft.AspNetCore.Components.ChangeEventArgs, System.Threading.Tasks.Task> callback) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<System.EventArgs> Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Func<System.EventArgs, System.Threading.Tasks.Task> callback) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct EventCallbackWorkItem { private readonly object _dummy; public static readonly Microsoft.AspNetCore.Components.EventCallbackWorkItem Empty; public EventCallbackWorkItem(System.MulticastDelegate @delegate) { throw null; } public System.Threading.Tasks.Task InvokeAsync(object arg) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct EventCallback<TValue> { private readonly object _dummy; public static readonly Microsoft.AspNetCore.Components.EventCallback<TValue> Empty; public EventCallback(Microsoft.AspNetCore.Components.IHandleEvent receiver, System.MulticastDelegate @delegate) { throw null; } public bool HasDelegate { get { throw null; } } public System.Threading.Tasks.Task InvokeAsync(TValue arg) { throw null; } } [System.AttributeUsageAttribute(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)] public sealed partial class EventHandlerAttribute : System.Attribute { public EventHandlerAttribute(string attributeName, System.Type eventArgsType) { } public EventHandlerAttribute(string attributeName, System.Type eventArgsType, bool enablestopPropagation, bool enablePreventDefault) { } public string AttributeName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public System.Type EventArgsType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public bool EnableStopPropagation { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public bool EnablePreventDefault { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } } public partial interface IComponent { void Attach(Microsoft.AspNetCore.Components.RenderHandle renderHandle); System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView parameters); } public partial interface IHandleAfterRender { System.Threading.Tasks.Task OnAfterRenderAsync(); } public partial interface IHandleEvent { System.Threading.Tasks.Task HandleEventAsync(Microsoft.AspNetCore.Components.EventCallbackWorkItem item, object arg); } [System.AttributeUsageAttribute(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)] public sealed partial class InjectAttribute : System.Attribute { public InjectAttribute() { } } [System.AttributeUsageAttribute(System.AttributeTargets.Class, AllowMultiple=false, Inherited=true)] public sealed partial class LayoutAttribute : System.Attribute { public LayoutAttribute(System.Type layoutType) { } public System.Type LayoutType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } } public abstract partial class LayoutComponentBase : Microsoft.AspNetCore.Components.ComponentBase { protected LayoutComponentBase() { } [Microsoft.AspNetCore.Components.ParameterAttribute] public Microsoft.AspNetCore.Components.RenderFragment Body { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } } public partial class LayoutView : Microsoft.AspNetCore.Components.IComponent { public LayoutView() { } [Microsoft.AspNetCore.Components.ParameterAttribute] public Microsoft.AspNetCore.Components.RenderFragment ChildContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } [Microsoft.AspNetCore.Components.ParameterAttribute] public System.Type Layout { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } public void Attach(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { } public System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView parameters) { throw null; } } public sealed partial class LocationChangeException : System.Exception { public LocationChangeException(string message, System.Exception innerException) { } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MarkupString { private readonly object _dummy; public MarkupString(string value) { throw null; } public string Value { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public static explicit operator Microsoft.AspNetCore.Components.MarkupString (string value) { throw null; } public override string ToString() { throw null; } } public partial class NavigationException : System.Exception { public NavigationException(string uri) { } public string Location { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } } public abstract partial class NavigationManager { protected NavigationManager() { } public string BaseUri { get { throw null; } protected set { } } public string Uri { get { throw null; } protected set { } } public event System.EventHandler<Microsoft.AspNetCore.Components.Routing.LocationChangedEventArgs> LocationChanged { add { } remove { } } protected virtual void EnsureInitialized() { } protected void Initialize(string baseUri, string uri) { } public void NavigateTo(string uri, bool forceLoad = false) { } protected abstract void NavigateToCore(string uri, bool forceLoad); protected void NotifyLocationChanged(bool isInterceptedLink) { } public System.Uri ToAbsoluteUri(string relativeUri) { throw null; } public string ToBaseRelativePath(string uri) { throw null; } } public abstract partial class OwningComponentBase : Microsoft.AspNetCore.Components.ComponentBase, System.IDisposable { protected OwningComponentBase() { } protected bool IsDisposed { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } protected System.IServiceProvider ScopedServices { get { throw null; } } protected virtual void Dispose(bool disposing) { } void System.IDisposable.Dispose() { } } public abstract partial class OwningComponentBase<TService> : Microsoft.AspNetCore.Components.OwningComponentBase, System.IDisposable { protected OwningComponentBase() { } protected TService Service { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)] public sealed partial class ParameterAttribute : System.Attribute { public ParameterAttribute() { } public bool CaptureUnmatchedValues { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ParameterValue { private readonly object _dummy; private readonly int _dummyPrimitive; public bool Cascading { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public string Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public object Value { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ParameterView { private readonly object _dummy; private readonly int _dummyPrimitive; public static Microsoft.AspNetCore.Components.ParameterView Empty { get { throw null; } } public static Microsoft.AspNetCore.Components.ParameterView FromDictionary(System.Collections.Generic.IDictionary<string, object> parameters) { throw null; } public Microsoft.AspNetCore.Components.ParameterView.Enumerator GetEnumerator() { throw null; } public TValue GetValueOrDefault<TValue>(string parameterName) { throw null; } public TValue GetValueOrDefault<TValue>(string parameterName, TValue defaultValue) { throw null; } public void SetParameterProperties(object target) { } public System.Collections.Generic.IReadOnlyDictionary<string, object> ToDictionary() { throw null; } public bool TryGetValue<TValue>(string parameterName, out TValue result) { throw null; } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct Enumerator { private readonly object _dummy; private readonly int _dummyPrimitive; public Microsoft.AspNetCore.Components.ParameterValue Current { get { throw null; } } public bool MoveNext() { throw null; } } } public delegate void RenderFragment(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder builder); public delegate Microsoft.AspNetCore.Components.RenderFragment RenderFragment<TValue>(TValue value); [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct RenderHandle { private readonly object _dummy; private readonly int _dummyPrimitive; public Microsoft.AspNetCore.Components.Dispatcher Dispatcher { get { throw null; } } public bool IsInitialized { get { throw null; } } public void Render(Microsoft.AspNetCore.Components.RenderFragment renderFragment) { } } [System.AttributeUsageAttribute(System.AttributeTargets.Class, AllowMultiple=true, Inherited=false)] public sealed partial class RouteAttribute : System.Attribute { public RouteAttribute(string template) { } public string Template { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } } public sealed partial class RouteData { public RouteData(System.Type pageType, System.Collections.Generic.IReadOnlyDictionary<string, object> routeValues) { } public System.Type PageType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary<string, object> RouteValues { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } } public partial class RouteView : Microsoft.AspNetCore.Components.IComponent { public RouteView() { } [Microsoft.AspNetCore.Components.ParameterAttribute] public System.Type DefaultLayout { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } [Microsoft.AspNetCore.Components.ParameterAttribute] public Microsoft.AspNetCore.Components.RouteData RouteData { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } public void Attach(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { } protected virtual void Render(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder builder) { } public System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView parameters) { throw null; } } [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] public partial class EditorRequiredAttribute : Attribute { public EditorRequiredAttribute() { } } } namespace Microsoft.AspNetCore.Components.CompilerServices { public static partial class RuntimeHelpers { public static void InvokeSynchronousDelegate(System.Action callback) { throw null; } public static System.Threading.Tasks.Task InvokeAsynchronousDelegate(System.Action callback) { throw null; } public static System.Threading.Tasks.Task InvokeAsynchronousDelegate(System.Func<System.Threading.Tasks.Task> callback) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<T> CreateInferredEventCallback<T>(object receiver, System.Action<T> callback, T value) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<T> CreateInferredEventCallback<T>(object receiver, Microsoft.AspNetCore.Components.EventCallback<T> callback, T value) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback<T> CreateInferredEventCallback<T>(object receiver, System.Func<T, System.Threading.Tasks.Task> callback, T value) { throw null; } public static T TypeCheck<T>(T value) { throw null; } } } namespace Microsoft.AspNetCore.Components.Rendering { public sealed partial class RenderTreeBuilder : System.IDisposable { public RenderTreeBuilder() { } public void AddAttribute(int sequence, in Microsoft.AspNetCore.Components.RenderTree.RenderTreeFrame frame) { } public void AddAttribute(int sequence, string name) { } public void AddAttribute(int sequence, string name, Microsoft.AspNetCore.Components.EventCallback value) { } public void AddAttribute(int sequence, string name, bool value) { } public void AddAttribute(int sequence, string name, System.MulticastDelegate value) { } public void AddAttribute(int sequence, string name, object value) { } public void AddAttribute(int sequence, string name, string value) { } public void AddAttribute<TArgument>(int sequence, string name, Microsoft.AspNetCore.Components.EventCallback<TArgument> value) { } public void AddComponentReferenceCapture(int sequence, System.Action<object> componentReferenceCaptureAction) { } public void AddContent(int sequence, Microsoft.AspNetCore.Components.MarkupString markupContent) { } public void AddContent(int sequence, Microsoft.AspNetCore.Components.RenderFragment fragment) { } public void AddContent(int sequence, object textContent) { } public void AddContent(int sequence, string textContent) { } public void AddContent<TValue>(int sequence, Microsoft.AspNetCore.Components.RenderFragment<TValue> fragment, TValue value) { } public void AddElementReferenceCapture(int sequence, System.Action<Microsoft.AspNetCore.Components.ElementReference> elementReferenceCaptureAction) { } public void AddMarkupContent(int sequence, string markupContent) { } public void AddMultipleAttributes(int sequence, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>> attributes) { } public void Clear() { } public void CloseComponent() { } public void CloseElement() { } public void CloseRegion() { } public Microsoft.AspNetCore.Components.RenderTree.ArrayRange<Microsoft.AspNetCore.Components.RenderTree.RenderTreeFrame> GetFrames() { throw null; } public void OpenComponent(int sequence, System.Type componentType) { } public void OpenComponent<TComponent>(int sequence) where TComponent : Microsoft.AspNetCore.Components.IComponent { } public void OpenElement(int sequence, string elementName) { } public void OpenRegion(int sequence) { } public void SetKey(object value) { } public void SetUpdatesAttributeName(string updatesAttributeName) { } void System.IDisposable.Dispose() { } } } namespace Microsoft.AspNetCore.Components.RenderTree { [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ArrayBuilderSegment<T> : System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable { private readonly object _dummy; private readonly int _dummyPrimitive; public T[] Array { get { throw null; } } public int Count { get { throw null; } } public T this[int index] { get { throw null; } } public int Offset { get { throw null; } } System.Collections.Generic.IEnumerator<T> System.Collections.Generic.IEnumerable<T>.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ArrayRange<T> { public readonly T[] Array; public readonly int Count; public ArrayRange(T[] array, int count) { throw null; } public Microsoft.AspNetCore.Components.RenderTree.ArrayRange<T> Clone() { throw null; } } public partial class EventFieldInfo { public EventFieldInfo() { } public int ComponentId { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } public object FieldValue { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct RenderBatch { private readonly object _dummy; public Microsoft.AspNetCore.Components.RenderTree.ArrayRange<int> DisposedComponentIDs { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public Microsoft.AspNetCore.Components.RenderTree.ArrayRange<ulong> DisposedEventHandlerIDs { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public Microsoft.AspNetCore.Components.RenderTree.ArrayRange<Microsoft.AspNetCore.Components.RenderTree.RenderTreeFrame> ReferenceFrames { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public Microsoft.AspNetCore.Components.RenderTree.ArrayRange<Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiff> UpdatedComponents { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct RenderTreeDiff { public readonly int ComponentId; public readonly Microsoft.AspNetCore.Components.RenderTree.ArrayBuilderSegment<Microsoft.AspNetCore.Components.RenderTree.RenderTreeEdit> Edits; } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Explicit)] public readonly partial struct RenderTreeEdit { [System.Runtime.InteropServices.FieldOffsetAttribute(8)] public readonly int MoveToSiblingIndex; [System.Runtime.InteropServices.FieldOffsetAttribute(8)] public readonly int ReferenceFrameIndex; [System.Runtime.InteropServices.FieldOffsetAttribute(16)] public readonly string RemovedAttributeName; [System.Runtime.InteropServices.FieldOffsetAttribute(4)] public readonly int SiblingIndex; [System.Runtime.InteropServices.FieldOffsetAttribute(0)] public readonly Microsoft.AspNetCore.Components.RenderTree.RenderTreeEditType Type; } public enum RenderTreeEditType { PrependFrame = 1, RemoveFrame = 2, SetAttribute = 3, RemoveAttribute = 4, UpdateText = 5, StepIn = 6, StepOut = 7, UpdateMarkup = 8, PermutationListEntry = 9, PermutationListEnd = 10, } public enum RenderTreeFrameType : short { None = (short)0, Element = (short)1, Text = (short)2, Attribute = (short)3, Component = (short)4, Region = (short)5, ElementReferenceCapture = (short)6, ComponentReferenceCapture = (short)7, Markup = (short)8, } } namespace Microsoft.AspNetCore.Components.Routing { public partial interface IHostEnvironmentNavigationManager { void Initialize(string baseUri, string uri); } public partial interface INavigationInterception { System.Threading.Tasks.Task EnableNavigationInterceptionAsync(); } public partial class LocationChangedEventArgs : System.EventArgs { public LocationChangedEventArgs(string location, bool isNavigationIntercepted) { } public bool IsNavigationIntercepted { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public string Location { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } } public partial class Router : Microsoft.AspNetCore.Components.IComponent, Microsoft.AspNetCore.Components.IHandleAfterRender, System.IDisposable { public Router() { } [Microsoft.AspNetCore.Components.ParameterAttribute] public System.Collections.Generic.IEnumerable<System.Reflection.Assembly> AdditionalAssemblies { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } [Microsoft.AspNetCore.Components.ParameterAttribute] public System.Reflection.Assembly AppAssembly { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } [Microsoft.AspNetCore.Components.ParameterAttribute] public Microsoft.AspNetCore.Components.RenderFragment<Microsoft.AspNetCore.Components.RouteData> Found { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } [Microsoft.AspNetCore.Components.ParameterAttribute] public Microsoft.AspNetCore.Components.RenderFragment NotFound { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } public void Attach(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { } public void Dispose() { } System.Threading.Tasks.Task Microsoft.AspNetCore.Components.IHandleAfterRender.OnAfterRenderAsync() { throw null; } public System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView parameters) { throw null; } } }
97.475694
409
0.781178
[ "MIT" ]
dotnet/razor-compiler
src/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components.netstandard2.0.cs
56,146
C#
namespace ZohoBooksExporter; using System; using System.Net.Http; using System.Threading.Tasks; using System.Web; using Newtonsoft.Json.Linq; public class OAuthClient { private readonly string _domain; private readonly string _clientId; private readonly string _clientSecret; public OAuthClient(string domain, string clientId, string clientSecret) { _domain = domain; _clientId = clientId; _clientSecret = clientSecret; } public async Task<string> GetRefreshToken(string code) { Uri uri = new( $"https://{_domain}/oauth/v2/token" + $"?client_id={HttpUtility.UrlEncode(_clientId)}" + $"&client_secret={HttpUtility.UrlEncode(_clientSecret)}" + $"&code={HttpUtility.UrlEncode(code)}" + $"&grant_type=authorization_code" + $"&redirect_uri={HttpUtility.UrlEncode("http://localhost/oauth")}"); using (HttpClient client = new()) { HttpResponseMessage response = await client.PostAsync(uri, new StringContent("")); string sringResult = await response.EnsureSuccessStatusCode().Content.ReadAsStringAsync(); JObject json = JObject.Parse(sringResult); return (string)json["refresh_token"]; } } public async Task<string> GetAccessToken(string refreshToken) { Uri uri = new( $"https://{_domain}/oauth/v2/token" + $"?client_id={HttpUtility.UrlEncode(_clientId)}" + $"&client_secret={HttpUtility.UrlEncode(_clientSecret)}" + $"&refresh_token={HttpUtility.UrlEncode(refreshToken)}" + $"&grant_type=refresh_token" + $"&redirect_uri={HttpUtility.UrlEncode("http://localhost/oauth")}"); using (HttpClient client = new()) { HttpResponseMessage response = await client.PostAsync(uri, new StringContent("")); string sringResult = await response.EnsureSuccessStatusCode().Content.ReadAsStringAsync(); JObject json = JObject.Parse(sringResult); return (string)json["access_token"]; } } }
32.636364
102
0.632776
[ "MIT" ]
Flavien/zoho-books-exporter
ZohoBooksExporter/OAuthClient.cs
2,156
C#
namespace PandaWebApp.Controllers { public class BasePackageViewModel { public string Description { get; set; } public int Id { get; set; } } }
19.222222
47
0.624277
[ "MIT" ]
svetlimladenov/C-Sharp-Web-Development-Basics
Exam/Apps/PandaWebApp/ViewModels/Home/BasePackageViewModel.cs
175
C#
namespace Hjerpbakk.DIPSBot.Model.BikeSharing { public readonly struct BikeSharingStationsInformation { public BikeSharingStationsInformation(string[] response, LabelledBikeSharingStation[] labelledBikeSharingStations) { Response = response; LabelledBikeSharingStations = labelledBikeSharingStations; } public string[] Response { get; } public LabelledBikeSharingStation[] LabelledBikeSharingStations { get; } } }
40
124
0.727083
[ "MIT" ]
Sankra/DIPSbot
src/Hjerpbakk.DIPSBot/Model/BikeSharing/BikeSharingStationsInformation.cs
482
C#
// <auto-generated /> using System; using LibraryWebsite; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace LibraryWebsite.Migrations { [DbContext(typeof(LibraryContext))] [Migration("20200105081306_IdentityServer")] partial class IdentityServer { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "3.1.0") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b => { b.Property<string>("UserCode") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<string>("ClientId") .IsRequired() .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<DateTime>("CreationTime") .HasColumnType("datetime2"); 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>("SubjectId") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.HasKey("UserCode"); b.HasIndex("DeviceCode") .IsUnique(); b.HasIndex("Expiration"); b.ToTable("DeviceCodes"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b => { b.Property<string>("Key") .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property<string>("ClientId") .IsRequired() .HasColumnType("nvarchar(200)") .HasMaxLength(200); 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>("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("PersistedGrants"); }); modelBuilder.Entity("LibraryWebsite.Books.Book", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("Author") .HasColumnType("nvarchar(max)"); b.Property<string>("Description") .HasColumnType("nvarchar(max)"); b.Property<string>("Isbn13") .HasColumnType("nvarchar(max)"); b.Property<string>("Title") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.ToTable("Books"); }); modelBuilder.Entity("LibraryWebsite.Identity.ApplicationUser", b => { b.Property<string>("Id") .HasColumnType("nvarchar(450)"); b.Property<int>("AccessFailedCount") .HasColumnType("int"); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("nvarchar(max)"); b.Property<string>("Email") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<bool>("EmailConfirmed") .HasColumnType("bit"); b.Property<bool>("LockoutEnabled") .HasColumnType("bit"); b.Property<DateTimeOffset?>("LockoutEnd") .HasColumnType("datetimeoffset"); b.Property<string>("NormalizedEmail") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("NormalizedUserName") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("PasswordHash") .HasColumnType("nvarchar(max)"); b.Property<string>("PhoneNumber") .HasColumnType("nvarchar(max)"); b.Property<bool>("PhoneNumberConfirmed") .HasColumnType("bit"); b.Property<string>("SecurityStamp") .HasColumnType("nvarchar(max)"); b.Property<bool>("TwoFactorEnabled") .HasColumnType("bit"); b.Property<string>("UserName") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.HasKey("Id"); b.HasIndex("NormalizedEmail") .HasName("EmailIndex"); b.HasIndex("NormalizedUserName") .IsUnique() .HasName("UserNameIndex") .HasFilter("[NormalizedUserName] IS NOT NULL"); b.ToTable("AspNetUsers"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => { b.Property<string>("Id") .HasColumnType("nvarchar(450)"); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("nvarchar(max)"); b.Property<string>("Name") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property<string>("NormalizedName") .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.HasKey("Id"); b.HasIndex("NormalizedName") .IsUnique() .HasName("RoleNameIndex") .HasFilter("[NormalizedName] IS NOT NULL"); b.ToTable("AspNetRoles"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("ClaimType") .HasColumnType("nvarchar(max)"); b.Property<string>("ClaimValue") .HasColumnType("nvarchar(max)"); b.Property<string>("RoleId") .IsRequired() .HasColumnType("nvarchar(450)"); b.HasKey("Id"); b.HasIndex("RoleId"); b.ToTable("AspNetRoleClaims"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("ClaimType") .HasColumnType("nvarchar(max)"); b.Property<string>("ClaimValue") .HasColumnType("nvarchar(max)"); b.Property<string>("UserId") .IsRequired() .HasColumnType("nvarchar(450)"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("AspNetUserClaims"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => { b.Property<string>("LoginProvider") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("ProviderKey") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("ProviderDisplayName") .HasColumnType("nvarchar(max)"); b.Property<string>("UserId") .IsRequired() .HasColumnType("nvarchar(450)"); b.HasKey("LoginProvider", "ProviderKey"); b.HasIndex("UserId"); b.ToTable("AspNetUserLogins"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => { b.Property<string>("UserId") .HasColumnType("nvarchar(450)"); b.Property<string>("RoleId") .HasColumnType("nvarchar(450)"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId"); b.ToTable("AspNetUserRoles"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => { b.Property<string>("UserId") .HasColumnType("nvarchar(450)"); b.Property<string>("LoginProvider") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("Name") .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property<string>("Value") .HasColumnType("nvarchar(max)"); b.HasKey("UserId", "LoginProvider", "Name"); b.ToTable("AspNetUserTokens"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => { b.HasOne("LibraryWebsite.Identity.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => { b.HasOne("LibraryWebsite.Identity.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("LibraryWebsite.Identity.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => { b.HasOne("LibraryWebsite.Identity.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); #pragma warning restore 612, 618 } } }
36.843342
125
0.453476
[ "MIT" ]
Euphoric/LibraryWebsite
LibraryWebsite/Migrations/20200105081306_IdentityServer.Designer.cs
14,113
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace FrameworksViewerApp.Models { public class STIGRuleFix { public int id { get; set; } public string uifixtext { get; set; } public string clifixtext { get; set; } public string descr { get; set; } public string fixidno { get; set; } } }
23.294118
46
0.646465
[ "MIT" ]
seccodingguy/securityframeworkmapper
Models/STIGRuleFix.cs
398
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; using HTC.UnityPlugin.Vive; using UnityEngine.SceneManagement; // Script written by Kyle Mas on Nov 12, 2019. // Deals with all the button functionalities like play, pause, back, reset. public class buttonScript : MonoBehaviour { // Resets the scene and wave properties public void ResetScene(){ SceneManager.LoadScene(SceneManager.GetActiveScene().name); //this resets the variables back to the original numbers which are 1 ProceduralGrid2.amplitude = 1; ProceduralGrid2.wavelength = 1; } // Changes the play (boolean) variable of the ProceduralGrid to false // which pauses loading the scene. public void pauseScene(){ ProceduralGrid2.play = false; } // Changes the play (boolean) variable of the ProceduralGrid to true // which continues loading the scene. public void playScene(){ ProceduralGrid2.play = true; } // When called, loads the scene called "welcomeScene", which contains // the project's new welcome scene with instructions/tutorials. public void switchToWelcomeScene(){ SceneManager.LoadScene("welcomeScene"); } // When called, loads the scene called "gridDemo2", which contains // the project's main scene. public void switchToGridDemo() { SceneManager.LoadScene("gridDemo2"); } }
26.92
75
0.743685
[ "MIT" ]
ubcemergingmedialab/Jupyter3D-Unity
Assets/Scripts/gridDemo2/buttonScript.cs
1,346
C#
using Sandbox.Game.EntityComponents; using Sandbox.ModAPI.Ingame; using Sandbox.ModAPI.Interfaces; using SpaceEngineers.Game.ModAPI.Ingame; using System.Collections.Generic; using System.Collections; using System.Linq; using System.Text; using System; using VRage.Collections; using VRage.Game.Components; using VRage.Game.GUI.TextPanel; using VRage.Game.ModAPI.Ingame.Utilities; using VRage.Game.ModAPI.Ingame; using VRage.Game.ObjectBuilders.Definitions; using VRage.Game; using VRage; using VRageMath; namespace IngameScript { partial class Program { public class TextSurfaceHandler : MultiInstanceBlockHandler<IMyTextSurface> { public TextSurfaceHandler() { var fontSizeHandler = NumericHandler(b => b.FontSize, (b, v) => b.FontSize = v, 0.5f); var fontColorHandler = ColorHandler(b => b.ContentType == ContentType.SCRIPT ? b.ScriptForegroundColor : b.FontColor, (b, v) => { if (b.ContentType == ContentType.SCRIPT) b.ScriptForegroundColor = v; else b.FontColor = v; }); AddStringHandler(Property.NAME, b => Name(b)); AddBooleanHandler(Property.ENABLE, b => b.ContentType != ContentType.NONE, (b, v) => b.ContentType = v ? ContentType.TEXT_AND_IMAGE : ContentType.NONE); AddStringHandler(Property.TEXT, b => { var builder = new StringBuilder(); b.ReadText(builder); return builder.ToString(); }, (b, v) => { b.ContentType = ContentType.TEXT_AND_IMAGE; b.WriteText(v); }); AddStringHandler(Property.MEDIA, b => b.CurrentlyShownImage ?? "", (b,v) => SetImages(b,CastList(ResolvePrimitive(v)))); AddStringHandler(Property.RUN, b => b.Script ?? "", (b, v) => { b.ContentType = ContentType.SCRIPT; b.Script = v; }); AddNumericHandler(Property.OFFSET, b => b.TextPadding, (b, v) => b.TextPadding = v, 1); AddBooleanHandler(Property.RATIO, b => b.PreserveAspectRatio, (b, v) => b.PreserveAspectRatio = v); AddListHandler(Property.MEDIA_LIST, b => { var images = NewList<string>(); b.GetSelectedImages(images); return NewKeyedList(images.Select(i => GetStaticVariable(i))); }, SetImages); AddStringHandler(Property.POSITION, b => (b.Alignment + "").ToLower(), (b, v) => b.Alignment = v == "center" ? TextAlignment.CENTER : v == "right" ? TextAlignment.RIGHT : TextAlignment.LEFT); AddNumericHandler(Property.INTERVAL, b => b.ChangeInterval, (b, v) => b.ChangeInterval = v, 1); AddPropertyHandler(Property.LEVEL, fontSizeHandler); AddPropertyHandler(Property.COLOR, fontColorHandler); AddColorHandler(Property.BACKGROUND, b => b.ContentType == ContentType.SCRIPT ? b.ScriptBackgroundColor : b.BackgroundColor, (b, v) => { if (b.ContentType == ContentType.SCRIPT) b.ScriptBackgroundColor = v; else b.BackgroundColor = v; }); AddReturnHandlers(Property.FONT, Return.STRING, TypeHandler(StringHandler(b => b.Font, (b,v) => b.Font = v), Return.STRING), TypeHandler(fontSizeHandler, Return.NUMERIC), TypeHandler(fontColorHandler, Return.COLOR)); defaultPropertiesByPrimitive[Return.STRING] = Property.TEXT; defaultPropertiesByPrimitive[Return.COLOR] = Property.COLOR; defaultPropertiesByPrimitive[Return.NUMERIC] = Property.LEVEL; defaultPropertiesByPrimitive[Return.LIST] = Property.MEDIA_LIST; defaultPropertiesByDirection[Direction.UP] = Property.TEXT; } void SetImages(IMyTextSurface block, KeyedList images) { block.ContentType = ContentType.TEXT_AND_IMAGE; block.ClearImagesFromSelection(); block.AddImagesToSelection(images.keyedValues.Select(i => CastString(i.GetValue())).ToList()); } public override string Name(IMyTextSurface block) => block.DisplayName; public override void GetInstances(IMyTerminalBlock b, List<IMyTextSurface> surfaces) { if (b is IMyTextSurface) surfaces.Add((IMyTextSurface)b); else if (b is IMyTextSurfaceProvider) Add((IMyTextSurfaceProvider)b, surfaces); } void Add(IMyTextSurfaceProvider p, List<IMyTextSurface> surfaces) { for (int i = 0; i < p.SurfaceCount; i++) surfaces.Add(p.GetSurface(i)); } } } }
60.52
254
0.645737
[ "MIT" ]
MerlinofMines/EasyCommands
EasyCommands/BlockHandlers/TextSurfaceHandlers.cs
4,541
C#
using System; namespace ENode.Domain.Impl { public class SnapshotOnlyAggregateStorage : IAggregateStorage { private readonly IAggregateSnapshotter _aggregateSnapshotter; public SnapshotOnlyAggregateStorage(IAggregateSnapshotter aggregateSnapshotter) { _aggregateSnapshotter = aggregateSnapshotter; } public IAggregateRoot Get(Type aggregateRootType, string aggregateRootId) { if (aggregateRootType == null) throw new ArgumentNullException("aggregateRootType"); if (aggregateRootId == null) throw new ArgumentNullException("aggregateRootId"); var aggregateRoot = _aggregateSnapshotter.RestoreFromSnapshot(aggregateRootType, aggregateRootId); if (aggregateRoot != null && (aggregateRoot.GetType() != aggregateRootType || aggregateRoot.UniqueId != aggregateRootId)) { throw new Exception(string.Format("AggregateRoot recovery from snapshot is invalid as the aggregateRootType or aggregateRootId is not matched. Snapshot: [aggregateRootType:{0},aggregateRootId:{1}], expected: [aggregateRootType:{2},aggregateRootId:{3}]", aggregateRoot.GetType(), aggregateRoot.UniqueId, aggregateRootType, aggregateRootId)); } return aggregateRoot; } } }
41.264706
269
0.670706
[ "MIT" ]
ChenQianPing/enode-master
src/ENode/Domain/Impl/SnapshotOnlyAggregateStorage.cs
1,405
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; namespace Project2_Cooperation.Models.ManageViewModels { public class SetPasswordViewModel { [Required] [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] [DataType(DataType.Password)] [Display(Name = "New password")] public string NewPassword { get; set; } [DataType(DataType.Password)] [Display(Name = "Confirm new password")] [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] public string ConfirmPassword { get; set; } public string StatusMessage { get; set; } } }
32.96
125
0.680825
[ "MIT" ]
michailvarouchas/project2-razors-coop
Project2-Cooperation/Models/ManageViewModels/SetPasswordViewModel.cs
826
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using Xunit; namespace System.Collections.Tests { public class HashtableBasicTests : HashtableIDictionaryTestBase { protected override IDictionary NonGenericIDictionaryFactory() => new Hashtable(); } public class HashtableSynchronizedTests : HashtableIDictionaryTestBase { protected override bool ExpectedIsSynchronized => true; protected override bool SupportsSerialization => false; protected override IDictionary NonGenericIDictionaryFactory() => Hashtable.Synchronized(new Hashtable()); } public abstract class HashtableIDictionaryTestBase : IDictionary_NonGeneric_Tests { protected override Type ICollection_NonGeneric_CopyTo_ArrayOfEnumType_ThrowType => typeof(InvalidCastException); protected override Type ICollection_NonGeneric_CopyTo_ArrayOfIncorrectReferenceType_ThrowType => typeof(InvalidCastException); protected override Type ICollection_NonGeneric_CopyTo_ArrayOfIncorrectValueType_ThrowType => typeof(InvalidCastException); protected override Type ICollection_NonGeneric_CopyTo_NonZeroLowerBound_ThrowType => typeof(IndexOutOfRangeException); protected override object CreateTKey(int seed) { int stringLength = seed % 10 + 5; Random rand = new Random(seed); byte[] bytes = new byte[stringLength]; rand.NextBytes(bytes); return Convert.ToBase64String(bytes); } protected override object CreateTValue(int seed) => CreateTKey(seed); [Theory] [MemberData(nameof(ValidCollectionSizes))] public override void ICollection_NonGeneric_CopyTo_NonZeroLowerBound(int count) { if (!PlatformDetection.IsNonZeroLowerBoundArraySupported) return; ICollection collection = NonGenericICollectionFactory(count); Array arr = Array.CreateInstance(typeof(object), new int[] { count }, new int[] { 2 }); Assert.Equal(1, arr.Rank); Assert.Equal(2, arr.GetLowerBound(0)); // A bug in Hashtable.CopyTo means we don't check the lower bounds of the destination array if (count == 0) { collection.CopyTo(arr, 0); } else { Assert.Throws<IndexOutOfRangeException>(() => collection.CopyTo(arr, 0)); } } } }
41.171875
134
0.681214
[ "MIT" ]
2E0PGS/corefx
src/System.Collections.NonGeneric/tests/Hashtable/Hashtable.IDictionary.Tests.cs
2,635
C#
using System; using System.ComponentModel; using System.Runtime.CompilerServices; using AndroidLogViewer.Models; using AndroidLogViewer.Properties; namespace AndroidLogViewer { public class LogEntry : INotifyPropertyChanged { public string Time { get; set; } = string.Empty; public int Process { get; set; } public int Thread { get; set; } public string Level { get; set; } = string.Empty; public string Message { get; set; } = string.Empty; public string Tag { get; set; } = string.Empty; public event PropertyChangedEventHandler PropertyChanged; [NotifyPropertyChangedInvocator] protected void OnPropertyChanged([CallerMemberName] string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } public virtual void Accept(ILogEntryVisitor visitor) { visitor.Visit(this); } } }
28.909091
87
0.680294
[ "MIT" ]
MarkusPalcer/AndroidLogViewer
AndroidLogViewer/Models/LogEntry.cs
956
C#
using System.Drawing; namespace AltoControls { public static class ExtensionMethods { public static Color FromHex(this string hex) { return ColorTranslator.FromHtml(hex); } } }
17.461538
52
0.621145
[ "MIT" ]
LambertOVO/AltoControls-For.NetWinForm
AltoControls/Helpers/ExtensionMethods.cs
229
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Text; using Silk.NET.Core; using Silk.NET.Core.Native; using Silk.NET.Core.Attributes; using Silk.NET.Core.Contexts; using Silk.NET.Core.Loader; #pragma warning disable 1591 namespace Silk.NET.Vulkan { [NativeName("Name", "VkWriteDescriptorSetInlineUniformBlockEXT")] public unsafe partial struct WriteDescriptorSetInlineUniformBlockEXT { public WriteDescriptorSetInlineUniformBlockEXT ( StructureType? sType = StructureType.WriteDescriptorSetInlineUniformBlockExt, void* pNext = null, uint? dataSize = null, void* pData = null ) : this() { if (sType is not null) { SType = sType.Value; } if (pNext is not null) { PNext = pNext; } if (dataSize is not null) { DataSize = dataSize.Value; } if (pData is not null) { PData = pData; } } /// <summary></summary> [NativeName("Type", "VkStructureType")] [NativeName("Type.Name", "VkStructureType")] [NativeName("Name", "sType")] public StructureType SType; /// <summary></summary> [NativeName("Type", "void*")] [NativeName("Type.Name", "void")] [NativeName("Name", "pNext")] public void* PNext; /// <summary></summary> [NativeName("Type", "uint32_t")] [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "dataSize")] public uint DataSize; /// <summary></summary> [NativeName("Type", "void*")] [NativeName("Type.Name", "void")] [NativeName("Name", "pData")] public void* PData; } }
27.643836
89
0.571853
[ "MIT" ]
DmitryGolubenkov/Silk.NET
src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetInlineUniformBlockEXT.gen.cs
2,018
C#
using System; using System.Collections.Generic; using System.IO; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualBasic.FileIO; using CarsonDB; namespace CarsonDBTest { [TestClass] public class TreatmentUnitTest { private string _legacySourcePath = Path.Combine(Directory.GetCurrentDirectory(), "LEGACY"); private string _modernSourcePath = Path.Combine(Directory.GetCurrentDirectory(), "MODERN"); [TestInitialize] public void TreatmentTestInit() { Shared.BuildTreatmentRecords(); } [TestCleanup] public void TreatmentTestCleanup() { Shared.UnloadDll(); } [TestMethod] public void TreatmentTest1() { for (int x = 0; x < 2; x++) { int lineNumber = 0; using (Treatment treatment = new Treatment(x == 0 ? _legacySourcePath : _modernSourcePath)) { var treatmentList = treatment.TreatmentList(); var lines = File.ReadLines(Path.Combine(Directory.GetCurrentDirectory(), "treat.csv")); foreach (var line in lines) { TextFieldParser parser = new TextFieldParser(new StringReader(line)); parser.HasFieldsEnclosedInQuotes = true; parser.SetDelimiters(","); string[] fields = parser.ReadFields(); if (!TreatmentRecordCompare(treatmentList, fields, lineNumber)) { Assert.Fail("Match failed on line: " + (lineNumber + 1).ToString()); } lineNumber++; } } } Assert.IsFalse(false, "TreatmentTest1 Passed!!"); } [TestMethod] public void TreatmentTest2() { for (int x = 0; x < 2; x++) { for (int y = 0; y < 1000; y++) { string[] fields = null; var lines = File.ReadLines(Path.Combine(Directory.GetCurrentDirectory(), "treat.csv")); int lineCount = File.ReadAllLines(Path.Combine(Directory.GetCurrentDirectory(), "treat.csv")).Length; if (y > lineCount - 1) break; var line = new List<string>(lines)[y]; TextFieldParser parser = new TextFieldParser(new StringReader(line)); parser.HasFieldsEnclosedInQuotes = true; parser.SetDelimiters(","); fields = parser.ReadFields(); using (Treatment treatment = new Treatment(x == 0 ? _legacySourcePath : _modernSourcePath)) { if (fields[0].Length > 0) treatment.AddFilterCriteria(Treatment.TreatmentFields.TreatmentCode, ComparisonType.EqualTo, fields[0]); if (fields[1].Length > 0) treatment.AddFilterCriteria(Treatment.TreatmentFields.TreatmentRecd, ComparisonType.EqualTo, fields[1]); if (fields[2].Length > 0) treatment.AddFilterCriteria(Treatment.TreatmentFields.TreatmentClass, ComparisonType.EqualTo, Convert.ToInt32(fields[2])); if (fields[3].Length > 0) treatment.AddFilterCriteria(Treatment.TreatmentFields.TreatmentCodes, ComparisonType.EqualTo, fields[3]); if (fields[4].Length > 0) treatment.AddFilterCriteria(Treatment.TreatmentFields.TreatmentDescription, ComparisonType.EqualTo, fields[4]); if (!fields[5].Contains("1900")) treatment.AddFilterCriteria(Treatment.TreatmentFields.TreatmentChanged, ComparisonType.EqualTo, DateTime.Parse(fields[5])); if (fields[6].Length > 0) treatment.AddFilterCriteria(Treatment.TreatmentFields.TreatmentPrice, ComparisonType.EqualTo, Convert.ToDecimal(fields[6])); var treatmentList = treatment.TreatmentList(); if (treatmentList.Count == 0) { Assert.Fail("Match failed on line: " + (y + 1).ToString()); } } } } Assert.IsTrue(true, "TreatmentTest2 Passed!!"); } private bool TreatmentRecordCompare(List<Treatment.TreatmentData> treatmentList, string[] fields, int lineNumber) { if (treatmentList[lineNumber].TreatmentCode == fields[0] && treatmentList[lineNumber].TreatmentRecd == fields[1] && Shared.CompareAmount(treatmentList[lineNumber].TreatmentClass, fields[2]) && treatmentList[lineNumber].TreatmentCodes == fields[3] && treatmentList[lineNumber].TreatmentDescription == fields[4] && (treatmentList[lineNumber].TreatmentChanged - DateTime.Parse(fields[5])).TotalDays == 0 && Shared.CompareAmount(treatmentList[lineNumber].TreatmentPrice, fields[6]) ) { return true; } else { return false; } } } }
31.597015
252
0.692726
[ "MIT" ]
ksanchezm/CarsonDB_demo
CarsonDBTest/TreatmentUnitTest.cs
4,236
C#
/** * Copyright (c) 2001-2019 Mathew A. Nelson and Robocode contributors * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * https://robocode.sourceforge.io/license/epl-v10.html */ using System; using System.Runtime.Serialization; namespace Robocode.Exception { /// <summary> /// Throw this exception to stop robot /// </summary> /// <exclude/> [Serializable] public class RobotException : System.Exception { /// <summary> /// Default constructor /// </summary> public RobotException() { } /// <summary> /// Constructor with message /// </summary> public RobotException(string s) : base(s) { } /// <summary> /// Deserialization constructor /// </summary> protected RobotException(SerializationInfo info, StreamingContext context) : base(info, context) { } } } //doc
25.933333
85
0.575835
[ "Apache-2.0" ]
Delawen/robocode
plugins/dotnet/robocode.dotnet.api/src/robocode/exception/RobotException.cs
1,167
C#
namespace ParentLoadRO.Business.ERLevel { public partial class A07_Country_Child { #region OnDeserialized actions /*/// <summary> /// This method is called on a newly deserialized object /// after deserialization is complete. /// </summary> /// <param name="context">Serialization context object.</param> protected override void OnDeserialized(System.Runtime.Serialization.StreamingContext context) { base.OnDeserialized(context); // add your custom OnDeserialized actions here. }*/ #endregion #region Implementation of DataPortal Hooks //partial void OnFetchRead(DataPortalHookArgs args) //{ // throw new NotImplementedException(); //} #endregion } }
26.030303
102
0.593714
[ "MIT" ]
CslaGenFork/CslaGenFork
trunk/Samples/DeepLoad/DAL-DR/ParentLoadRO.Business/ERLevel/A07_Country_Child.cs
859
C#
using System; namespace Print_Part_Of_ASCII_Table { class Program { static void Main(string[] args) { int startAsci = int.Parse(Console.ReadLine()); int SecondAsci =int.Parse(Console.ReadLine()); for (int i = startAsci; i <= SecondAsci; i++) { Console.Write((char)i + " "); } } } }
19.9
58
0.494975
[ "MIT" ]
VladimirDikovski/C-Fundamentals-May-2019
Data Types and Variables Exercise/Print Part Of ASCII Table/Print Part Of ASCII Table/Program.cs
400
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TradeAndTravel { public class Merchant : Shopkeeper, IShopkeeper, ITraveller { public Merchant(string name, Location location) : base(name, location) { } public void TravelTo(Location location) { this.Location = location; } } }
20.952381
63
0.631818
[ "MIT" ]
ykomitov/Homeworks-TA
03.OOP/89.OOP_Exam_Preparation/2. Trade and Travel/TradeAndTravel/Person/Merchant.cs
442
C#
namespace WinFormsTestApp { partial class Form1 { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("Grand Child"); System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("Child", new System.Windows.Forms.TreeNode[] { treeNode1}); System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("Root", new System.Windows.Forms.TreeNode[] { treeNode2}); System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("Main"); System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("Child"); System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("Root", new System.Windows.Forms.TreeNode[] { treeNode5}); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); this.buton = new System.Windows.Forms.Button(); this.result = new System.Windows.Forms.Label(); this.chequeBox = new System.Windows.Forms.CheckBox(); this.komboBox = new System.Windows.Forms.ComboBox(); this.dateTimePicker = new System.Windows.Forms.DateTimePicker(); this.linkLabel = new System.Windows.Forms.LinkLabel(); this.listBox = new System.Windows.Forms.ListBox(); this.listBoxPopupMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.showFilmsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ped = new System.Windows.Forms.TreeView(); this.radioButton1 = new System.Windows.Forms.RadioButton(); this.radioButton2 = new System.Windows.Forms.RadioButton(); this.people = new System.Windows.Forms.DataGridView(); this.name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.country = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.alive = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.display = new System.Windows.Forms.DataGridViewButtonColumn(); this.details = new System.Windows.Forms.DataGridViewLinkColumn(); this.textBox = new System.Windows.Forms.TextBox(); this.listBoxWithVScrollBar = new System.Windows.Forms.ListBox(); this.menuStripContainingMultilevelSubMenus = new System.Windows.Forms.ContextMenuStrip(this.components); this.rootToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.level1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.level2ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mainToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.launchModal = new System.Windows.Forms.Button(); this.textBox1 = new System.Windows.Forms.TextBox(); this.seasons = new System.Windows.Forms.TabControl(); this.spring = new System.Windows.Forms.TabPage(); this.springyButton = new System.Windows.Forms.Button(); this.springyTextBox = new System.Windows.Forms.TextBox(); this.Autumn = new System.Windows.Forms.TabPage(); this.autumnListBox = new System.Windows.Forms.ListBox(); this.winter = new System.Windows.Forms.TabPage(); this.iAmDuplicateBox = new System.Windows.Forms.TextBox(); this.myNameIsDuplicateBox = new System.Windows.Forms.TextBox(); this.addNode = new System.Windows.Forms.Button(); this.showError = new System.Windows.Forms.Button(); this.invisibleControlShower = new System.Windows.Forms.Button(); this.dynamicControl = new System.Windows.Forms.Label(); this.checkBoxLaunchedModalWindow = new System.Windows.Forms.CheckBox(); this.linkLaunchesModalWindow = new System.Windows.Forms.LinkLabel(); this.treeViewLaunchesModal = new System.Windows.Forms.TreeView(); this.comboBoxLaunchingModalWindow = new System.Windows.Forms.ComboBox(); this.addDynamicControl = new System.Windows.Forms.Button(); this.hasDynamicControl = new System.Windows.Forms.Panel(); this.statusStrip = new System.Windows.Forms.StatusStrip(); this.statusStripLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripProgressBar = new System.Windows.Forms.ToolStripProgressBar(); this.toolStripDropDownButton = new System.Windows.Forms.ToolStripDropDownButton(); this.twoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.oneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSplitButton = new System.Windows.Forms.ToolStripSplitButton(); this.splitButtonToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripProgressBar2 = new System.Windows.Forms.ToolStripProgressBar(); this.progressBar = new System.Windows.Forms.ProgressBar(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.launchModalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.clickMeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.selectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.lineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel(); this.toolStripSplitButton1 = new System.Windows.Forms.ToolStripSplitButton(); this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); this.toolStripComboBox1 = new System.Windows.Forms.ToolStripComboBox(); this.toolStripTextBox1 = new System.Windows.Forms.ToolStripTextBox(); this.toolStripProgressBar1 = new System.Windows.Forms.ToolStripProgressBar(); this.toolStrip2 = new System.Windows.Forms.ToolStrip(); this.listView = new System.Windows.Forms.ListView(); this.multilineTextBox = new System.Windows.Forms.TextBox(); this.richTextBox1 = new System.Windows.Forms.RichTextBox(); this.image = new System.Windows.Forms.PictureBox(); this.disableControls = new System.Windows.Forms.Button(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.buttonInGroupBox = new System.Windows.Forms.Button(); this.panel1 = new System.Windows.Forms.Panel(); this.textBoxInsidePanel = new System.Windows.Forms.TextBox(); this.listViewForScenarioTest = new System.Windows.Forms.ListView(); this.invisible = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.buttonLaunchesMessageBox = new System.Windows.Forms.Button(); this.panelWithText = new System.Windows.Forms.Panel(); this.hiddenButton = new System.Windows.Forms.Button(); this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); this.slider1 = new System.Windows.Forms.TrackBar(); this.listBoxPopupMenu.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.people)).BeginInit(); this.menuStripContainingMultilevelSubMenus.SuspendLayout(); this.seasons.SuspendLayout(); this.spring.SuspendLayout(); this.Autumn.SuspendLayout(); this.winter.SuspendLayout(); this.statusStrip.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.toolStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.image)).BeginInit(); this.groupBox1.SuspendLayout(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.slider1)).BeginInit(); this.SuspendLayout(); // // buton // this.buton.Location = new System.Drawing.Point(13, 81); this.buton.Name = "buton"; this.buton.Size = new System.Drawing.Size(75, 23); this.buton.TabIndex = 0; this.buton.Text = "&Buton"; this.buton.UseVisualStyleBackColor = true; // // result // this.result.AutoSize = true; this.result.Location = new System.Drawing.Point(13, 447); this.result.Name = "result"; this.result.Size = new System.Drawing.Size(37, 13); this.result.TabIndex = 1; this.result.Text = "Result"; // // chequeBox // this.chequeBox.AutoSize = true; this.chequeBox.Location = new System.Drawing.Point(114, 85); this.chequeBox.Name = "chequeBox"; this.chequeBox.Size = new System.Drawing.Size(84, 17); this.chequeBox.TabIndex = 2; this.chequeBox.Text = "Cheque Box"; this.chequeBox.UseVisualStyleBackColor = true; // // komboBox // this.komboBox.DropDownWidth = 100; this.komboBox.FormattingEnabled = true; this.komboBox.Items.AddRange(new object[] { "Arundhati Roy", "Noam Chomsky", "1", "2", "3", "4", "5", "6", "7", "ReallyReallyLongTextHere"}); this.komboBox.Location = new System.Drawing.Point(367, 80); this.komboBox.Name = "komboBox"; this.komboBox.Size = new System.Drawing.Size(121, 21); this.komboBox.TabIndex = 4; // // dateTimePicker // this.dateTimePicker.CustomFormat = "ddmmyyyyhhmm"; this.dateTimePicker.Location = new System.Drawing.Point(639, 81); this.dateTimePicker.Name = "dateTimePicker"; this.dateTimePicker.Size = new System.Drawing.Size(200, 20); this.dateTimePicker.TabIndex = 5; // // linkLabel // this.linkLabel.Location = new System.Drawing.Point(875, 83); this.linkLabel.Name = "linkLabel"; this.linkLabel.Size = new System.Drawing.Size(48, 18); this.linkLabel.TabIndex = 6; this.linkLabel.TabStop = true; this.linkLabel.Text = "Linque"; // // listBox // this.listBox.ContextMenuStrip = this.listBoxPopupMenu; this.listBox.FormattingEnabled = true; this.listBox.Items.AddRange(new object[] { "Speilberg", "Nagesh"}); this.listBox.Location = new System.Drawing.Point(957, 80); this.listBox.Name = "listBox"; this.listBox.Size = new System.Drawing.Size(120, 95); this.listBox.TabIndex = 7; // // listBoxPopupMenu // this.listBoxPopupMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.showFilmsToolStripMenuItem}); this.listBoxPopupMenu.Name = "listBoxPopupMenu"; this.listBoxPopupMenu.Size = new System.Drawing.Size(135, 26); // // showFilmsToolStripMenuItem // this.showFilmsToolStripMenuItem.Name = "showFilmsToolStripMenuItem"; this.showFilmsToolStripMenuItem.Size = new System.Drawing.Size(134, 22); this.showFilmsToolStripMenuItem.Text = "Show Films"; // // ped // this.ped.Location = new System.Drawing.Point(16, 224); this.ped.Name = "ped"; treeNode1.Name = "grandChild"; treeNode1.Text = "Grand Child"; treeNode2.Name = "childNode"; treeNode2.Text = "Child"; treeNode3.Name = "rootNode"; treeNode3.Text = "Root"; treeNode4.Name = "main"; treeNode4.Text = "Main"; this.ped.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { treeNode3, treeNode4}); this.ped.Size = new System.Drawing.Size(199, 96); this.ped.TabIndex = 8; // // radioButton1 // this.radioButton1.AutoSize = true; this.radioButton1.Location = new System.Drawing.Point(367, 132); this.radioButton1.Name = "radioButton1"; this.radioButton1.Size = new System.Drawing.Size(40, 17); this.radioButton1.TabIndex = 9; this.radioButton1.TabStop = true; this.radioButton1.Text = "foo"; this.radioButton1.UseVisualStyleBackColor = true; // // radioButton2 // this.radioButton2.AutoSize = true; this.radioButton2.Location = new System.Drawing.Point(448, 132); this.radioButton2.Name = "radioButton2"; this.radioButton2.Size = new System.Drawing.Size(40, 17); this.radioButton2.TabIndex = 10; this.radioButton2.TabStop = true; this.radioButton2.Text = "bar"; this.radioButton2.UseVisualStyleBackColor = true; // // people // this.people.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.people.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.name, this.country, this.alive, this.display, this.details}); this.people.Location = new System.Drawing.Point(225, 224); this.people.Name = "people"; this.people.Size = new System.Drawing.Size(599, 150); this.people.TabIndex = 9; // // name // this.name.HeaderText = "Name"; this.name.Name = "name"; // // country // this.country.HeaderText = "Country"; this.country.Items.AddRange(new object[] { "India", "Sri Lanka", "Pakistan"}); this.country.Name = "country"; // // alive // this.alive.HeaderText = "Alive"; this.alive.Name = "alive"; // // display // this.display.HeaderText = "Display"; this.display.Name = "display"; this.display.Text = "Show"; // // details // this.details.HeaderText = "Details"; this.details.Name = "details"; this.details.Text = "More.."; // // textBox // this.textBox.AutoCompleteCustomSource.AddRange(new string[] { "hi", "hello"}); this.textBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; this.textBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource; this.textBox.Location = new System.Drawing.Point(244, 196); this.textBox.Name = "textBox"; this.textBox.Size = new System.Drawing.Size(100, 20); this.textBox.TabIndex = 9; this.textBox.Text = "userText"; // // listBoxWithVScrollBar // this.listBoxWithVScrollBar.ContextMenuStrip = this.menuStripContainingMultilevelSubMenus; this.listBoxWithVScrollBar.FormattingEnabled = true; this.listBoxWithVScrollBar.Items.AddRange(new object[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"}); this.listBoxWithVScrollBar.Location = new System.Drawing.Point(244, 413); this.listBoxWithVScrollBar.Name = "listBoxWithVScrollBar"; this.listBoxWithVScrollBar.Size = new System.Drawing.Size(120, 108); this.listBoxWithVScrollBar.TabIndex = 11; // // menuStripContainingMultilevelSubMenus // this.menuStripContainingMultilevelSubMenus.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.rootToolStripMenuItem, this.mainToolStripMenuItem}); this.menuStripContainingMultilevelSubMenus.Name = "menuStripContainingMultilevelSubMenus"; this.menuStripContainingMultilevelSubMenus.Size = new System.Drawing.Size(102, 48); // // rootToolStripMenuItem // this.rootToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.level1ToolStripMenuItem}); this.rootToolStripMenuItem.Name = "rootToolStripMenuItem"; this.rootToolStripMenuItem.Size = new System.Drawing.Size(101, 22); this.rootToolStripMenuItem.Text = "Root"; // // level1ToolStripMenuItem // this.level1ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.level2ToolStripMenuItem}); this.level1ToolStripMenuItem.Name = "level1ToolStripMenuItem"; this.level1ToolStripMenuItem.Size = new System.Drawing.Size(107, 22); this.level1ToolStripMenuItem.Text = "Level1"; // // level2ToolStripMenuItem // this.level2ToolStripMenuItem.Name = "level2ToolStripMenuItem"; this.level2ToolStripMenuItem.Size = new System.Drawing.Size(107, 22); this.level2ToolStripMenuItem.Text = "Level2"; // // mainToolStripMenuItem // this.mainToolStripMenuItem.Name = "mainToolStripMenuItem"; this.mainToolStripMenuItem.Size = new System.Drawing.Size(101, 22); this.mainToolStripMenuItem.Text = "Main"; // // launchModal // this.launchModal.Location = new System.Drawing.Point(599, 392); this.launchModal.Name = "launchModal"; this.launchModal.Size = new System.Drawing.Size(84, 23); this.launchModal.TabIndex = 12; this.launchModal.Text = "Launch Modal"; this.launchModal.UseVisualStyleBackColor = true; // // textBox1 // this.textBox1.Location = new System.Drawing.Point(412, 392); this.textBox1.Multiline = true; this.textBox1.Name = "textBox1"; this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Horizontal; this.textBox1.Size = new System.Drawing.Size(180, 40); this.textBox1.TabIndex = 12; this.textBox1.Text = "This control is used to test HScrollBar. It will display text long enought to dis" + "play HScrollBar"; this.textBox1.WordWrap = false; // // seasons // this.seasons.Controls.Add(this.spring); this.seasons.Controls.Add(this.Autumn); this.seasons.Controls.Add(this.winter); this.seasons.Location = new System.Drawing.Point(412, 507); this.seasons.Name = "seasons"; this.seasons.SelectedIndex = 0; this.seasons.Size = new System.Drawing.Size(448, 133); this.seasons.TabIndex = 12; // // spring // this.spring.Controls.Add(this.springyButton); this.spring.Controls.Add(this.springyTextBox); this.spring.Location = new System.Drawing.Point(4, 22); this.spring.Name = "spring"; this.spring.Padding = new System.Windows.Forms.Padding(3); this.spring.Size = new System.Drawing.Size(440, 107); this.spring.TabIndex = 0; this.spring.Text = "Spring"; this.spring.UseVisualStyleBackColor = true; // // springyButton // this.springyButton.Location = new System.Drawing.Point(132, 74); this.springyButton.Name = "springyButton"; this.springyButton.Size = new System.Drawing.Size(75, 23); this.springyButton.TabIndex = 14; this.springyButton.Text = "Add Node"; this.springyButton.UseVisualStyleBackColor = true; // // springyTextBox // this.springyTextBox.Location = new System.Drawing.Point(6, 74); this.springyTextBox.Name = "springyTextBox"; this.springyTextBox.Size = new System.Drawing.Size(100, 20); this.springyTextBox.TabIndex = 10; this.springyTextBox.Text = "userText"; // // Autumn // this.Autumn.Controls.Add(this.autumnListBox); this.Autumn.Location = new System.Drawing.Point(4, 22); this.Autumn.Name = "Autumn"; this.Autumn.Padding = new System.Windows.Forms.Padding(3); this.Autumn.Size = new System.Drawing.Size(440, 107); this.Autumn.TabIndex = 1; this.Autumn.Text = "Autumn"; this.Autumn.UseVisualStyleBackColor = true; // // autumnListBox // this.autumnListBox.ContextMenuStrip = this.listBoxPopupMenu; this.autumnListBox.FormattingEnabled = true; this.autumnListBox.Items.AddRange(new object[] { "Speilberg", "Nagesh"}); this.autumnListBox.Location = new System.Drawing.Point(6, 71); this.autumnListBox.Name = "autumnListBox"; this.autumnListBox.Size = new System.Drawing.Size(120, 95); this.autumnListBox.TabIndex = 8; // // winter // this.winter.Controls.Add(this.iAmDuplicateBox); this.winter.Controls.Add(this.myNameIsDuplicateBox); this.winter.Location = new System.Drawing.Point(4, 22); this.winter.Name = "winter"; this.winter.Size = new System.Drawing.Size(440, 107); this.winter.TabIndex = 2; this.winter.Text = "Winter"; this.winter.UseVisualStyleBackColor = true; // // iAmDuplicateBox // this.iAmDuplicateBox.Location = new System.Drawing.Point(164, 87); this.iAmDuplicateBox.Name = "iAmDuplicateBox"; this.iAmDuplicateBox.Size = new System.Drawing.Size(100, 20); this.iAmDuplicateBox.TabIndex = 1; // // myNameIsDuplicateBox // this.myNameIsDuplicateBox.Location = new System.Drawing.Point(17, 87); this.myNameIsDuplicateBox.Name = "myNameIsDuplicateBox"; this.myNameIsDuplicateBox.Size = new System.Drawing.Size(100, 20); this.myNameIsDuplicateBox.TabIndex = 0; // // addNode // this.addNode.Location = new System.Drawing.Point(140, 411); this.addNode.Name = "addNode"; this.addNode.Size = new System.Drawing.Size(75, 23); this.addNode.TabIndex = 13; this.addNode.Text = "Add Node"; this.addNode.UseVisualStyleBackColor = true; // // showError // this.showError.Location = new System.Drawing.Point(545, 80); this.showError.Name = "showError"; this.showError.Size = new System.Drawing.Size(75, 23); this.showError.TabIndex = 14; this.showError.Text = "Show Error"; this.showError.UseVisualStyleBackColor = true; // // invisibleControlShower // this.invisibleControlShower.Location = new System.Drawing.Point(848, 268); this.invisibleControlShower.Name = "invisibleControlShower"; this.invisibleControlShower.Size = new System.Drawing.Size(75, 23); this.invisibleControlShower.TabIndex = 14; this.invisibleControlShower.Text = "Invisible Control Shower"; this.invisibleControlShower.UseVisualStyleBackColor = true; // // dynamicControl // this.dynamicControl.AutoSize = true; this.dynamicControl.Location = new System.Drawing.Point(830, 312); this.dynamicControl.Name = "dynamicControl"; this.dynamicControl.Size = new System.Drawing.Size(93, 13); this.dynamicControl.TabIndex = 15; this.dynamicControl.Text = "dynamically visible"; this.dynamicControl.Visible = false; // // checkBoxLaunchedModalWindow // this.checkBoxLaunchedModalWindow.AutoSize = true; this.checkBoxLaunchedModalWindow.Location = new System.Drawing.Point(16, 486); this.checkBoxLaunchedModalWindow.Name = "checkBoxLaunchedModalWindow"; this.checkBoxLaunchedModalWindow.Size = new System.Drawing.Size(84, 17); this.checkBoxLaunchedModalWindow.TabIndex = 16; this.checkBoxLaunchedModalWindow.Text = "Cheque Box"; this.checkBoxLaunchedModalWindow.UseVisualStyleBackColor = true; // // linkLaunchesModalWindow // this.linkLaunchesModalWindow.AutoSize = true; this.linkLaunchesModalWindow.Location = new System.Drawing.Point(111, 490); this.linkLaunchesModalWindow.Name = "linkLaunchesModalWindow"; this.linkLaunchesModalWindow.Size = new System.Drawing.Size(39, 13); this.linkLaunchesModalWindow.TabIndex = 17; this.linkLaunchesModalWindow.TabStop = true; this.linkLaunchesModalWindow.Text = "Linque"; // // treeViewLaunchesModal // this.treeViewLaunchesModal.Location = new System.Drawing.Point(184, 565); this.treeViewLaunchesModal.Name = "treeViewLaunchesModal"; treeNode5.Name = "childNode"; treeNode5.Text = "Child"; treeNode6.Name = "rootNode"; treeNode6.Text = "Root"; this.treeViewLaunchesModal.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { treeNode6}); this.treeViewLaunchesModal.Size = new System.Drawing.Size(199, 86); this.treeViewLaunchesModal.TabIndex = 18; // // comboBoxLaunchingModalWindow // this.comboBoxLaunchingModalWindow.FormattingEnabled = true; this.comboBoxLaunchingModalWindow.Items.AddRange(new object[] { "Arundhati Roy", "Noam Chomsky"}); this.comboBoxLaunchingModalWindow.Location = new System.Drawing.Point(16, 520); this.comboBoxLaunchingModalWindow.Name = "comboBoxLaunchingModalWindow"; this.comboBoxLaunchingModalWindow.Size = new System.Drawing.Size(121, 21); this.comboBoxLaunchingModalWindow.TabIndex = 19; // // // addDynamicControl // this.addDynamicControl.Location = new System.Drawing.Point(945, 268); this.addDynamicControl.Name = "addDynamicControl"; this.addDynamicControl.Size = new System.Drawing.Size(122, 23); this.addDynamicControl.TabIndex = 21; this.addDynamicControl.Text = "Add Dynamic Control"; this.addDynamicControl.UseVisualStyleBackColor = true; // // hasDynamicControl // this.hasDynamicControl.Location = new System.Drawing.Point(945, 312); this.hasDynamicControl.Name = "hasDynamicControl"; this.hasDynamicControl.Size = new System.Drawing.Size(141, 57); this.hasDynamicControl.TabIndex = 22; // // statusStrip // this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.statusStripLabel, this.toolStripProgressBar, this.toolStripDropDownButton, this.toolStripSplitButton, this.toolStripProgressBar2}); this.statusStrip.Location = new System.Drawing.Point(0, 690); this.statusStrip.Name = "statusStrip"; this.statusStrip.Size = new System.Drawing.Size(1086, 22); this.statusStrip.TabIndex = 23; this.statusStrip.Text = "statusStrip1"; // // statusStripLabel // this.statusStripLabel.Name = "statusStripLabel"; this.statusStripLabel.Size = new System.Drawing.Size(97, 17); this.statusStripLabel.Text = "Status Strip Label"; // // toolStripProgressBar // this.toolStripProgressBar.Name = "toolStripProgressBar"; this.toolStripProgressBar.Size = new System.Drawing.Size(100, 16); // // toolStripDropDownButton // this.toolStripDropDownButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripDropDownButton.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.twoToolStripMenuItem, this.oneToolStripMenuItem}); this.toolStripDropDownButton.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton.Image"))); this.toolStripDropDownButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripDropDownButton.Name = "toolStripDropDownButton"; this.toolStripDropDownButton.Size = new System.Drawing.Size(29, 20); this.toolStripDropDownButton.Text = "toolStripDropDownButton"; // // twoToolStripMenuItem // this.twoToolStripMenuItem.Name = "twoToolStripMenuItem"; this.twoToolStripMenuItem.Size = new System.Drawing.Size(97, 22); this.twoToolStripMenuItem.Text = "Two"; // // oneToolStripMenuItem // this.oneToolStripMenuItem.Name = "oneToolStripMenuItem"; this.oneToolStripMenuItem.Size = new System.Drawing.Size(97, 22); this.oneToolStripMenuItem.Text = "One"; // // toolStripSplitButton // this.toolStripSplitButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripSplitButton.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.splitButtonToolStripMenuItem}); this.toolStripSplitButton.Image = ((System.Drawing.Image)(resources.GetObject("toolStripSplitButton.Image"))); this.toolStripSplitButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripSplitButton.Name = "toolStripSplitButton"; this.toolStripSplitButton.Size = new System.Drawing.Size(32, 20); this.toolStripSplitButton.Text = "toolStripSplitButtonText"; // // splitButtonToolStripMenuItem // this.splitButtonToolStripMenuItem.Name = "splitButtonToolStripMenuItem"; this.splitButtonToolStripMenuItem.Size = new System.Drawing.Size(136, 22); this.splitButtonToolStripMenuItem.Text = "Split Button"; // // toolStripProgressBar2 // this.toolStripProgressBar2.Name = "toolStripProgressBar2"; this.toolStripProgressBar2.Size = new System.Drawing.Size(100, 16); // // progressBar // this.progressBar.Location = new System.Drawing.Point(16, 152); this.progressBar.Name = "progressBar"; this.progressBar.Size = new System.Drawing.Size(100, 23); this.progressBar.TabIndex = 24; // // menuStrip1 // this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem, this.editToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Size = new System.Drawing.Size(1086, 24); this.menuStrip1.TabIndex = 25; this.menuStrip1.Text = "menuStrip1"; // // fileToolStripMenuItem // this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.launchModalToolStripMenuItem, this.clickMeToolStripMenuItem}); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Text = "File"; // // launchModalToolStripMenuItem // this.launchModalToolStripMenuItem.Name = "launchModalToolStripMenuItem"; this.launchModalToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.L))); this.launchModalToolStripMenuItem.Size = new System.Drawing.Size(187, 22); this.launchModalToolStripMenuItem.Text = "LaunchModal"; // // clickMeToolStripMenuItem // this.clickMeToolStripMenuItem.Name = "clickMeToolStripMenuItem"; this.clickMeToolStripMenuItem.Size = new System.Drawing.Size(187, 22); this.clickMeToolStripMenuItem.Text = "Click Me"; // // editToolStripMenuItem // this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.selectToolStripMenuItem}); this.editToolStripMenuItem.Name = "editToolStripMenuItem"; this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20); this.editToolStripMenuItem.Text = "Edit"; // // selectToolStripMenuItem // this.selectToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.lineToolStripMenuItem}); this.selectToolStripMenuItem.Name = "selectToolStripMenuItem"; this.selectToolStripMenuItem.Size = new System.Drawing.Size(105, 22); this.selectToolStripMenuItem.Text = "Select"; // // lineToolStripMenuItem // this.lineToolStripMenuItem.Name = "lineToolStripMenuItem"; this.lineToolStripMenuItem.Size = new System.Drawing.Size(96, 22); this.lineToolStripMenuItem.Text = "Line"; // // toolStrip1 // this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripButton1, this.toolStripLabel1, this.toolStripSplitButton1, this.toolStripDropDownButton1, this.toolStripComboBox1, this.toolStripTextBox1, this.toolStripProgressBar1}); this.toolStrip1.Location = new System.Drawing.Point(0, 24); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new System.Drawing.Size(1086, 25); this.toolStrip1.TabIndex = 26; this.toolStrip1.Text = "toolStrip1"; // // toolStripButton1 // this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image"))); this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButton1.Name = "toolStripButton1"; this.toolStripButton1.Size = new System.Drawing.Size(23, 22); this.toolStripButton1.Text = "toolStripButton1"; // // toolStripLabel1 // this.toolStripLabel1.Name = "toolStripLabel1"; this.toolStripLabel1.Size = new System.Drawing.Size(86, 22); this.toolStripLabel1.Text = "toolStripLabel1"; // // toolStripSplitButton1 // this.toolStripSplitButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripSplitButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripSplitButton1.Image"))); this.toolStripSplitButton1.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripSplitButton1.Name = "toolStripSplitButton1"; this.toolStripSplitButton1.Size = new System.Drawing.Size(32, 22); this.toolStripSplitButton1.Text = "toolStripSplitButton1"; // // toolStripDropDownButton1 // this.toolStripDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripDropDownButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton1.Image"))); this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripDropDownButton1.Name = "toolStripDropDownButton1"; this.toolStripDropDownButton1.Size = new System.Drawing.Size(29, 22); this.toolStripDropDownButton1.Text = "toolStripDropDownButton1"; // // toolStripComboBox1 // this.toolStripComboBox1.Name = "toolStripComboBox1"; this.toolStripComboBox1.Size = new System.Drawing.Size(121, 25); // // toolStripTextBox1 // this.toolStripTextBox1.Name = "toolStripTextBox1"; this.toolStripTextBox1.Size = new System.Drawing.Size(100, 25); // // toolStripProgressBar1 // this.toolStripProgressBar1.Name = "toolStripProgressBar1"; this.toolStripProgressBar1.Size = new System.Drawing.Size(100, 22); // // toolStrip2 // this.toolStrip2.Location = new System.Drawing.Point(0, 49); this.toolStrip2.Name = "toolStrip2"; this.toolStrip2.Size = new System.Drawing.Size(1086, 25); this.toolStrip2.TabIndex = 27; this.toolStrip2.Text = "toolStrip2"; // // listView // this.listView.Location = new System.Drawing.Point(562, 119); this.listView.Name = "listView"; this.listView.Size = new System.Drawing.Size(121, 97); this.listView.TabIndex = 28; this.listView.UseCompatibleStateImageBehavior = false; // // multilineTextBox // this.multilineTextBox.Location = new System.Drawing.Point(712, 392); this.multilineTextBox.Multiline = true; this.multilineTextBox.Name = "multilineTextBox"; this.multilineTextBox.Size = new System.Drawing.Size(100, 47); this.multilineTextBox.TabIndex = 29; // // richTextBox1 // this.richTextBox1.Location = new System.Drawing.Point(734, 119); this.richTextBox1.Name = "richTextBox1"; this.richTextBox1.Size = new System.Drawing.Size(135, 96); this.richTextBox1.TabIndex = 30; this.richTextBox1.Text = ""; // // image // this.image.Image = ((System.Drawing.Image)(resources.GetObject("image.Image"))); this.image.Location = new System.Drawing.Point(839, 413); this.image.Name = "image"; this.image.Size = new System.Drawing.Size(47, 40); this.image.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.image.TabIndex = 31; this.image.TabStop = false; // // disableControls // this.disableControls.Location = new System.Drawing.Point(908, 411); this.disableControls.Name = "disableControls"; this.disableControls.Size = new System.Drawing.Size(106, 23); this.disableControls.TabIndex = 32; this.disableControls.Text = "Disable Controls"; this.disableControls.UseVisualStyleBackColor = true; // // groupBox1 // this.groupBox1.Controls.Add(this.buttonInGroupBox); this.groupBox1.Location = new System.Drawing.Point(878, 486); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(200, 100); this.groupBox1.TabIndex = 33; this.groupBox1.TabStop = false; this.groupBox1.Text = "groupBox1"; // // buttonInGroupBox // this.buttonInGroupBox.Location = new System.Drawing.Point(30, 43); this.buttonInGroupBox.Name = "buttonInGroupBox"; this.buttonInGroupBox.Size = new System.Drawing.Size(142, 23); this.buttonInGroupBox.TabIndex = 1; this.buttonInGroupBox.Text = "Button In GroupBox"; this.buttonInGroupBox.UseVisualStyleBackColor = true; // // panel1 // this.panel1.Controls.Add(this.textBoxInsidePanel); this.panel1.Location = new System.Drawing.Point(878, 181); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(199, 69); this.panel1.TabIndex = 34; // // textBoxInsidePanel // this.textBoxInsidePanel.Location = new System.Drawing.Point(19, 15); this.textBoxInsidePanel.Name = "textBoxInsidePanel"; this.textBoxInsidePanel.Size = new System.Drawing.Size(100, 20); this.textBoxInsidePanel.TabIndex = 0; // // listViewForScenarioTest // this.listViewForScenarioTest.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.invisible}); this.listViewForScenarioTest.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; this.listViewForScenarioTest.Location = new System.Drawing.Point(585, 438); this.listViewForScenarioTest.Name = "listViewForScenarioTest"; this.listViewForScenarioTest.Size = new System.Drawing.Size(121, 63); this.listViewForScenarioTest.TabIndex = 35; this.listViewForScenarioTest.UseCompatibleStateImageBehavior = false; this.listViewForScenarioTest.View = System.Windows.Forms.View.Details; // // buttonLaunchesMessageBox // this.buttonLaunchesMessageBox.Location = new System.Drawing.Point(16, 181); this.buttonLaunchesMessageBox.Name = "buttonLaunchesMessageBox"; this.buttonLaunchesMessageBox.Size = new System.Drawing.Size(134, 23); this.buttonLaunchesMessageBox.TabIndex = 36; this.buttonLaunchesMessageBox.Text = "Launch Message Box"; this.buttonLaunchesMessageBox.UseVisualStyleBackColor = true; // // panelWithText // this.panelWithText.Location = new System.Drawing.Point(878, 603); this.panelWithText.Name = "panelWithText"; this.panelWithText.Size = new System.Drawing.Size(106, 33); this.panelWithText.TabIndex = 37; // // hiddenButton // this.hiddenButton.Location = new System.Drawing.Point(412, 667); this.hiddenButton.Name = "hiddenButton"; this.hiddenButton.Size = new System.Drawing.Size(110, 23); this.hiddenButton.TabIndex = 38; this.hiddenButton.Text = "Scroll To See Me"; this.hiddenButton.UseVisualStyleBackColor = true; // // numericUpDown1 // this.numericUpDown1.DecimalPlaces = 1; this.numericUpDown1.Increment = new decimal(new int[] { 2, 0, 0, 65536}); this.numericUpDown1.Location = new System.Drawing.Point(31, 326); this.numericUpDown1.Name = "numericUpDown1"; this.numericUpDown1.Size = new System.Drawing.Size(120, 20); this.numericUpDown1.TabIndex = 39; this.numericUpDown1.ThousandsSeparator = true; this.numericUpDown1.Value = new decimal(new int[] { 4, 0, 0, 0}); // // slider1 // this.slider1.LargeChange = 4; this.slider1.Location = new System.Drawing.Point(31, 373); this.slider1.Name = "slider1"; this.slider1.Size = new System.Drawing.Size(104, 45); this.slider1.TabIndex = 40; this.slider1.Value = 4; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScroll = true; this.ClientSize = new System.Drawing.Size(1089, 650); this.Controls.Add(this.slider1); this.Controls.Add(this.numericUpDown1); this.Controls.Add(this.hiddenButton); this.Controls.Add(this.panelWithText); this.Controls.Add(this.buttonLaunchesMessageBox); this.Controls.Add(this.listViewForScenarioTest); this.Controls.Add(this.panel1); this.Controls.Add(this.groupBox1); this.Controls.Add(this.disableControls); this.Controls.Add(this.image); this.Controls.Add(this.richTextBox1); this.Controls.Add(this.multilineTextBox); this.Controls.Add(this.listView); this.Controls.Add(this.toolStrip2); this.Controls.Add(this.toolStrip1); this.Controls.Add(this.progressBar); this.Controls.Add(this.statusStrip); this.Controls.Add(this.menuStrip1); this.Controls.Add(this.hasDynamicControl); this.Controls.Add(this.addDynamicControl); this.Controls.Add(this.comboBoxLaunchingModalWindow); this.Controls.Add(this.treeViewLaunchesModal); this.Controls.Add(this.linkLaunchesModalWindow); this.Controls.Add(this.checkBoxLaunchedModalWindow); this.Controls.Add(this.showError); this.Controls.Add(this.dynamicControl); this.Controls.Add(this.invisibleControlShower); this.Controls.Add(this.addNode); this.Controls.Add(this.launchModal); this.Controls.Add(this.textBox1); this.Controls.Add(this.radioButton2); this.Controls.Add(this.radioButton1); this.Controls.Add(this.listBoxWithVScrollBar); this.Controls.Add(this.people); this.Controls.Add(this.textBox); this.Controls.Add(this.ped); this.Controls.Add(this.seasons); this.Controls.Add(this.listBox); this.Controls.Add(this.komboBox); this.Controls.Add(this.linkLabel); this.Controls.Add(this.dateTimePicker); this.Controls.Add(this.chequeBox); this.Controls.Add(this.result); this.Controls.Add(this.buton); this.MainMenuStrip = this.menuStrip1; this.Name = "Form1"; this.Text = "Form1"; this.listBoxPopupMenu.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.people)).EndInit(); this.menuStripContainingMultilevelSubMenus.ResumeLayout(false); this.seasons.ResumeLayout(false); this.spring.ResumeLayout(false); this.spring.PerformLayout(); this.Autumn.ResumeLayout(false); this.winter.ResumeLayout(false); this.winter.PerformLayout(); this.statusStrip.ResumeLayout(false); this.statusStrip.PerformLayout(); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.image)).EndInit(); this.groupBox1.ResumeLayout(false); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.slider1)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Button buton; private System.Windows.Forms.Label result; private System.Windows.Forms.CheckBox chequeBox; private System.Windows.Forms.ComboBox komboBox; private System.Windows.Forms.DateTimePicker dateTimePicker; private System.Windows.Forms.LinkLabel linkLabel; private System.Windows.Forms.ListBox listBox; private System.Windows.Forms.TreeView ped; private System.Windows.Forms.RadioButton radioButton1; private System.Windows.Forms.RadioButton radioButton2; private System.Windows.Forms.DataGridView people; private System.Windows.Forms.TextBox textBox; private System.Windows.Forms.DataGridViewTextBoxColumn name; private System.Windows.Forms.DataGridViewComboBoxColumn country; private System.Windows.Forms.DataGridViewCheckBoxColumn alive; private System.Windows.Forms.DataGridViewButtonColumn display; private System.Windows.Forms.DataGridViewLinkColumn details; private System.Windows.Forms.ListBox listBoxWithVScrollBar; private System.Windows.Forms.Button launchModal; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.TabControl seasons; private System.Windows.Forms.TabPage spring; private System.Windows.Forms.TabPage Autumn; private System.Windows.Forms.ContextMenuStrip listBoxPopupMenu; private System.Windows.Forms.ToolStripMenuItem showFilmsToolStripMenuItem; private System.Windows.Forms.ContextMenuStrip menuStripContainingMultilevelSubMenus; private System.Windows.Forms.ToolStripMenuItem rootToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem level1ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem level2ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem mainToolStripMenuItem; private System.Windows.Forms.Button addNode; private System.Windows.Forms.Button springyButton; private System.Windows.Forms.TextBox springyTextBox; private System.Windows.Forms.ListBox autumnListBox; private System.Windows.Forms.Button showError; private System.Windows.Forms.Button invisibleControlShower; private System.Windows.Forms.Label dynamicControl; private System.Windows.Forms.TabPage winter; private System.Windows.Forms.TextBox iAmDuplicateBox; private System.Windows.Forms.TextBox myNameIsDuplicateBox; private System.Windows.Forms.CheckBox checkBoxLaunchedModalWindow; private System.Windows.Forms.LinkLabel linkLaunchesModalWindow; private System.Windows.Forms.TreeView treeViewLaunchesModal; private System.Windows.Forms.ComboBox comboBoxLaunchingModalWindow; private System.Windows.Forms.Button addDynamicControl; private System.Windows.Forms.Panel hasDynamicControl; private System.Windows.Forms.StatusStrip statusStrip; private System.Windows.Forms.ToolStripStatusLabel statusStripLabel; private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar; private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton; private System.Windows.Forms.ToolStripMenuItem twoToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem oneToolStripMenuItem; private System.Windows.Forms.ToolStripSplitButton toolStripSplitButton; private System.Windows.Forms.ToolStripMenuItem splitButtonToolStripMenuItem; private System.Windows.Forms.ProgressBar progressBar; private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar2; private System.Windows.Forms.MenuStrip menuStrip1; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem launchModalToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem clickMeToolStripMenuItem; private System.Windows.Forms.ToolStrip toolStrip1; private System.Windows.Forms.ToolStripButton toolStripButton1; private System.Windows.Forms.ToolStripLabel toolStripLabel1; private System.Windows.Forms.ToolStripSplitButton toolStripSplitButton1; private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton1; private System.Windows.Forms.ToolStripComboBox toolStripComboBox1; private System.Windows.Forms.ToolStripTextBox toolStripTextBox1; private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar1; private System.Windows.Forms.ToolStrip toolStrip2; private System.Windows.Forms.ListView listView; private System.Windows.Forms.TextBox multilineTextBox; private System.Windows.Forms.RichTextBox richTextBox1; private System.Windows.Forms.PictureBox image; private System.Windows.Forms.Button disableControls; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.Button buttonInGroupBox; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.TextBox textBoxInsidePanel; private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem selectToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem lineToolStripMenuItem; private System.Windows.Forms.ListView listViewForScenarioTest; private System.Windows.Forms.ColumnHeader invisible; private System.Windows.Forms.Button buttonLaunchesMessageBox; private System.Windows.Forms.Panel panelWithText; private System.Windows.Forms.Button hiddenButton; private System.Windows.Forms.NumericUpDown numericUpDown1; private System.Windows.Forms.TrackBar slider1; } }
50.262128
159
0.595703
[ "Apache-2.0" ]
cuongnq/White
src/TestApplications/WinFormsTestApp/Form1.Designer.cs
57,884
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace ConferenceDTO { public class Speaker { public int Id { get; set; } [Required] [StringLength(200)] public string Name { get; set; } [StringLength(4000)] public string Bio { get; set; } [StringLength(1000)] public virtual string WebSite { get; set; } } }
19.863636
51
0.610984
[ "MIT" ]
AnzhelikaKravchuk/aspnetcore-app-workshop
src/ConferenceDTO/Speaker.cs
439
C#
using System; using System.Numerics; using Lykke.AzureStorage.Tables.Entity.Serializers; namespace Lykke.Service.EthereumClassicApi.Repositories.Serializers { public class BigIntegerSerializer : IStorageValueSerializer { public string Serialize(object value) { return value.ToString(); } public object Deserialize(string serialized) { return BigInteger.Parse(serialized); } public string Serialize(object value, Type type) { return Serialize(value); } public object Deserialize(string serialized, Type type) { return Deserialize(serialized); } } }
23.633333
67
0.629055
[ "MIT" ]
LykkeCity/Lykke.Service.EthereumClassic.Api
src/Lykke.Service.EthereumClassicApi.Repositories/Serializers/BigIntegerSerializer.cs
711
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. namespace NuGetConsole { internal interface IHostInitializer { void Start(); void SetDefaultRunspace(); } }
23.538462
111
0.696078
[ "Apache-2.0" ]
BdDsl/NuGet.Client
src/NuGet.Clients/NuGet.Console/IHostInitializer.cs
308
C#
using System; using System.Collections.Generic; using UnityEditor; using UnityLocalize.DataStorage; namespace UnityLocalize.Editor { internal abstract class LocalizationProviderBase { public List<Type> TypesToLocalization { get; set; } public LocalizationProviderCache LocalizationProviderCache { get; set; } public abstract List<StoredString> GetLocalization(); protected void GetLocalizationInternal(IEnumerable<UnityEngine.Object> localizables, ref List<StoredString> strings) { foreach (UnityEngine.Object localizable in localizables) { foreach (var get in this.LocalizationProviderCache.GetCachedMethods(localizable.GetType())) { LocalizableString ls = (LocalizableString)get.Method.Invoke(localizable, null); strings.Add(ls); } EditorUtility.SetDirty(localizable); } } } }
31.774194
124
0.652792
[ "MIT" ]
anvoro/ULocalize
Assets/Plugins/UnityLocalize/Editor/EditorCore/LocalizationExport/LocalizationProviderBase.cs
987
C#
using System; using System.CodeDom.Compiler; using System.ComponentModel; using System.Diagnostics; using System.Runtime.CompilerServices; using System.Xml.Serialization; namespace Workday.Integrations { [GeneratedCode("System.Xml", "4.6.1590.0"), DesignerCategory("code"), DebuggerStepThrough, XmlType(Namespace = "urn:com.workday/bsvc")] [Serializable] public class Integration_Message_DataType : INotifyPropertyChanged { private object itemField; private string message_SummaryField; private string message_DetailField; private Background_Process_Message_Severity_LevelObjectType severity_Level_ReferenceField; private InstanceObjectType[] message_Target_ReferenceField; private Integration_Attachment_DataType[] integration_Attachment_DataField; private Integration_Repository_Document_DataType[] repository_Document_DataField; private bool enqueue_Notification_MessageField; private bool enqueue_Notification_MessageFieldSpecified; [method: CompilerGenerated] [CompilerGenerated] public event PropertyChangedEventHandler PropertyChanged; [XmlElement("Integration_Event_Reference", typeof(Integration_ESB_Invocation__Abstract_ObjectType), Order = 0), XmlElement("Integration_System_Reference", typeof(Integration_System__Audited_ObjectType), Order = 0)] public object Item { get { return this.itemField; } set { this.itemField = value; this.RaisePropertyChanged("Item"); } } [XmlElement(Order = 1)] public string Message_Summary { get { return this.message_SummaryField; } set { this.message_SummaryField = value; this.RaisePropertyChanged("Message_Summary"); } } [XmlElement(Order = 2)] public string Message_Detail { get { return this.message_DetailField; } set { this.message_DetailField = value; this.RaisePropertyChanged("Message_Detail"); } } [XmlElement(Order = 3)] public Background_Process_Message_Severity_LevelObjectType Severity_Level_Reference { get { return this.severity_Level_ReferenceField; } set { this.severity_Level_ReferenceField = value; this.RaisePropertyChanged("Severity_Level_Reference"); } } [XmlElement("Message_Target_Reference", Order = 4)] public InstanceObjectType[] Message_Target_Reference { get { return this.message_Target_ReferenceField; } set { this.message_Target_ReferenceField = value; this.RaisePropertyChanged("Message_Target_Reference"); } } [XmlElement("Integration_Attachment_Data", Order = 5)] public Integration_Attachment_DataType[] Integration_Attachment_Data { get { return this.integration_Attachment_DataField; } set { this.integration_Attachment_DataField = value; this.RaisePropertyChanged("Integration_Attachment_Data"); } } [XmlElement("Repository_Document_Data", Order = 6)] public Integration_Repository_Document_DataType[] Repository_Document_Data { get { return this.repository_Document_DataField; } set { this.repository_Document_DataField = value; this.RaisePropertyChanged("Repository_Document_Data"); } } [XmlElement(Order = 7)] public bool Enqueue_Notification_Message { get { return this.enqueue_Notification_MessageField; } set { this.enqueue_Notification_MessageField = value; this.RaisePropertyChanged("Enqueue_Notification_Message"); } } [XmlIgnore] public bool Enqueue_Notification_MessageSpecified { get { return this.enqueue_Notification_MessageFieldSpecified; } set { this.enqueue_Notification_MessageFieldSpecified = value; this.RaisePropertyChanged("Enqueue_Notification_MessageSpecified"); } } protected void RaisePropertyChanged(string propertyName) { PropertyChangedEventHandler propertyChanged = this.PropertyChanged; if (propertyChanged != null) { propertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } } }
23.383721
216
0.751119
[ "MIT" ]
matteofabbri/Workday.WebServices
Workday.Integrations/Integration_Message_DataType.cs
4,022
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace SparkServer.Application.Enum { /// <summary> /// Identifies various site sections. /// </summary> public enum MainMenu { Home = 0, Article = 1, Category = 2, Resources = 3, About = 4, Blog = 5 } }
18.25
41
0.569863
[ "MIT" ]
bmbruno/SparkServer
Application/SparkServer/Application/Enum/MainMenu.cs
367
C#
using AutoMapper; using CommandModels.Data; using CommandModels.Dtos; using CommandModels.Models; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; namespace CommandService.Controllers; [Route("api/c/platforms/{platformId}/[controller]")] [ApiController] public class CommandsController : ControllerBase { private readonly ICommandRepo _repo; private IMapper _mapper; public CommandsController(ICommandRepo repository, IMapper mapper) { _repo = repository; _mapper = mapper; } [HttpGet] public ActionResult<IEnumerable<CommandReadDto>> GetCommandsFroPlatform(int platformId) { Console.WriteLine("--> Getting Commands for Platform service"); if (!_repo.PlatformExists(platformId)) { return NotFound(); } var list = _repo.GetCommandsForPlatform(platformId); return Ok(_mapper.Map<IEnumerable<CommandReadDto>>(list)); } [HttpGet("{commandId}", Name = "GetCommandForPlatform")] public ActionResult<CommandReadDto> GetCommandForPlatform(int platformId, int commandId) { Console.WriteLine($"--> Getting CommandForPlatform {platformId}/{commandId}"); if (!_repo.PlatformExists(platformId)) { return NotFound(); } var command = _repo.GetCommand(platformId, commandId); if(command == null) return NotFound(); return Ok(_mapper.Map<CommandReadDto>(command)); } [HttpPost] public ActionResult<CommandReadDto> CreateCommandForPlatform(int platformId, CommandCreateDto commandDto) { Console.WriteLine("--> Creating Command from Platform service"); if (!_repo.PlatformExists(platformId)) { return NotFound(); } var cmd = _mapper.Map<Command>(commandDto); _repo.CreateCommand(platformId, cmd); _repo.SaveChanges(); var readDto = _mapper.Map<CommandReadDto>(cmd); return CreatedAtAction(nameof(GetCommandForPlatform), new { platformId = platformId, commandId = readDto.Id }, readDto ); } }
25.566265
111
0.669651
[ "MIT" ]
Altairseven/NetMicroservices
Command/CommandService/Controllers/CommandsController.cs
2,124
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("AlertToCareApi")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] [assembly: System.Reflection.AssemblyProductAttribute("AlertToCareApi")] [assembly: System.Reflection.AssemblyTitleAttribute("AlertToCareApi")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] // Generated by the MSBuild WriteCodeFragment class.
41.416667
80
0.651911
[ "MIT" ]
aruna09/alert-to-care-s21b9
AlertToCareApi/obj/Release/netcoreapp3.1/AlertToCareApi.AssemblyInfo.cs
994
C#
using Assets.Scripts.CooldownButtonTest; using Assets.Scripts.Serialization; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using UnityEngine; using Object = UnityEngine.Object; namespace Assets.Scripts.Binding { public abstract class ResourceManagerBase : MonoBehaviour, ISerializationCallbackReceiver { private readonly IFormatter _formatter = new Formatter(); [SerializeField] private CategoryFoldout[] _serializedCategoryFoldouts; [SerializeField] private SerializedMember[] _serializedValues; private List<CategoryProperties> _categoryProperties; private Dictionary<string, bool> _categoryFoldouts; protected ResourceManagerBase() { InitializeEditorData(); } public IEnumerable<CategoryProperties> CategoryProperties { get { return _categoryProperties; } } public IDictionary<string, bool> CategoryFoldouts { get { return _categoryFoldouts; } } public virtual void OnBeforeSerialize() { _serializedCategoryFoldouts = _categoryFoldouts.Select( categoryFoldout => new CategoryFoldout(categoryFoldout.Key, categoryFoldout.Value)) .ToArray(); _serializedValues = GetNotifyingObjectProperties() .Where(property => property.Type.AssemblyQualifiedName != null) .Select(property => new SerializedMember( property.PropertyName, MemberType.Property, _formatter.Serialize(property.Type, property.GetValue<object>()))) .ToArray(); } public virtual void OnAfterDeserialize() { if (_serializedCategoryFoldouts != null) { foreach (var categoryFoldout in _serializedCategoryFoldouts) { if (_categoryFoldouts.ContainsKey(categoryFoldout.Name)) { _categoryFoldouts[categoryFoldout.Name] = categoryFoldout.Foldout; } } } if (_serializedValues != null) { var properties = GetNotifyingObjectProperties().ToList(); foreach (var serializedMember in _serializedValues.Where(member => member.MemberType == MemberType.Property)) { var property = properties.FirstOrDefault( propertyInfo => propertyInfo.PropertyName == serializedMember.Name); if (property != null) { var type = Type.GetType(serializedMember.SerializedValue.AssemblyQualifiedName, false); if (type == property.Type) { var value = _formatter.Deserialize(serializedMember.SerializedValue); property.SetValue(value); } } } } } private IEnumerable<NotifyingObjectProperty> GetNotifyingObjectProperties() { return GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance) .Where(IsNotifyingObject) .Select(property => new NotifyingObjectProperty(property, this)) .Where(IsSupported); } private void InitializeEditorData() { _categoryProperties = GetNotifyingObjectProperties() .OrderBy(property => property.DisplayName) .GroupBy(property => property.Category) .Select(group => new CategoryProperties(group.Key, group.ToArray())) .OrderBy(group => group.Category) .ToList(); _categoryFoldouts = _categoryProperties.ToDictionary(group => group.Category, category => true); } private static bool IsNotifyingObject(PropertyInfo property) { var getter = property.GetGetMethod(); if (getter == null || !getter.IsPublic) { return false; } var type = property.PropertyType; if (!type.IsGenericType) { return false; } var genericTypeDefinition = type.GetGenericTypeDefinition(); return genericTypeDefinition == typeof(NotifyingObject<>); } private static bool IsSupported(NotifyingObjectProperty property) { var propertyType = property.Type; switch (property.PropertyKind) { case PropertyKind.Undefined: return propertyType == typeof(Color) || propertyType == typeof(float) || propertyType == typeof(string) || propertyType == typeof(int) || propertyType == typeof(long) || propertyType == typeof(double) || propertyType == typeof(bool) || propertyType == typeof(Vector2) || propertyType == typeof(Vector3) || propertyType == typeof(Bounds) || propertyType == typeof(Rect) || propertyType.IsEnum || typeof(Object).IsAssignableFrom(propertyType); case PropertyKind.Tag: return propertyType == typeof(string); case PropertyKind.Layer: return propertyType == typeof(int); case PropertyKind.Passwort: return propertyType == typeof(string); default: return false; } } } }
38.270968
125
0.545516
[ "MIT" ]
JackTheRipper42/Binding
Assets/Scripts/Binding/ResourceManagerBase.cs
5,934
C#
using Newtonsoft.Json; namespace Canvas.v1.Models.Analytics { public class TardinessBreakdown { [JsonProperty("total")] public int Total { get; set; } [JsonProperty("on_time")] public int OnTime { get; set; } [JsonProperty("late")] public int Late { get; set; } [JsonProperty("missing")] public int Missing { get; set; } [JsonProperty("floating")] public int Floating { get; set; } } }
26.555556
41
0.577406
[ "Apache-2.0" ]
thatsnotmylane/canvas-windows-sdk-v1
Canvas.v1/Models/Analytics/TardinessBreakdown.cs
478
C#
using System.Diagnostics; using FubuMVC.Core.Registration; using FubuMVC.Core.UI.Navigation; using NUnit.Framework; using System.Linq; using FubuTestingSupport; using System.Collections.Generic; namespace FubuMVC.Tests.UI.Navigation { [TestFixture] public class MenuItemAttributes_integrated_Tester { private BehaviorGraph graph; [SetUp] public void SetUp() { graph = BehaviorGraph.BuildFrom(x => x.Actions.IncludeType<Controller1>()); } [Test] public void puts_the_navigation_graph_in_the_right_order() { var navigationGraph = graph.Navigation; navigationGraph.FindNode(new NavigationKey("Two")).ShouldBeOfType<MenuNode>().Previous.Key.Key.ShouldEqual("Three"); navigationGraph.MenuFor("Root").AllNodes().Select(x => x.Key.Key) .ShouldHaveTheSameElementsAs("Three", "Two", "One","Four"); } public class Controller1 { [MenuItem("One", AddChildTo = "Two")] public void One(Input1 input){} [MenuItem("Two", AddChildTo = "Root")] public void Two(Input1 input){} [MenuItem("Three", AddBefore = "Two")] public void Three(Input1 input){} [MenuItem("Four", AddChildTo = "Root")] public void Four(Input1 input) { } public class Input1 { } } } }
28.09434
129
0.584956
[ "Apache-2.0" ]
ketiko/fubumvc
src/FubuMVC.Tests/UI/Navigation/MenuItemAttributes_integrated_Tester.cs
1,489
C#
using FFXIVRelicTracker.Models.Helpers; using System; using System.Collections.Generic; using System.Text; namespace FFXIVRelicTracker._04_SB.Main { public class SBModel : ObservableObject { #region Fields #endregion #region Constructor public SBModel() { } #endregion #region Properties #endregion #region Methods #endregion #region Commands #endregion } }
14.264706
43
0.597938
[ "Apache-2.0" ]
Hezkezl/FFXIVRelicTracker
04-SB/Main/SBModel.cs
487
C#
using System.ComponentModel; using System.Windows.Forms; namespace interactive_audio { public class ImageForm : Form { /// <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 && (this.components != null)) { this.components.Dispose(); } base.Dispose(disposing); } /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { ComponentResourceManager resources = new ComponentResourceManager(typeof(ImageForm)); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.MaximizeBox = false; this.Name = "AudioDisplay"; this.Text = "AudioDisplay"; this.ResumeLayout(false); this.PerformLayout(); } public ImageForm() { this.InitializeComponent(); } } }
32.020408
107
0.579987
[ "MIT" ]
James-Frowen/led-strip-gui
interactive-audio/ImageForm.cs
1,571
C#
using System.Collections; using System.Collections.Generic; using System; using UnityEngine; using HuaweiMobileServices.Ads; #if HMS_BUILD namespace HmsPlugin { public class RewardAdManager : MonoBehaviour { private class RewardAdListener : IRewardAdStatusListener { private readonly RewardAdManager mAdsManager; public RewardAdListener(RewardAdManager adsManager) { mAdsManager = adsManager; } public void OnRewardAdClosed() { Debug.Log("[HMS] AdsManager OnRewardAdClosed"); mAdsManager.OnRewardAdClosed?.Invoke(); mAdsManager.LoadNextRewardedAd(); } public void OnRewardAdFailedToShow(int errorCode) { Debug.Log("[HMS] AdsManager OnRewardAdFailedToShow " + errorCode); mAdsManager.OnRewardAdFailedToShow?.Invoke(errorCode); } public void OnRewardAdOpened() { Debug.Log("[HMS] AdsManager OnRewardAdOpened"); mAdsManager.OnRewardAdOpened?.Invoke(); } public void OnRewarded(Reward reward) { Debug.Log("[HMS] AdsManager OnRewarded " + reward); mAdsManager.OnRewarded?.Invoke(reward); } } public static RewardAdManager GetInstance(string name = "AdsManager") => GameObject.Find(name).GetComponent<RewardAdManager>(); private RewardAd rewardAd = null; private string mAdId; public string AdId { get => mAdId; set { Debug.Log($"[HMS] RewardAdManager: Set reward ad ID: {value}"); mAdId = value; LoadNextRewardedAd(); } } public Action OnRewardAdClosed { get; set; } public Action<int> OnRewardAdFailedToShow { get; set; } public Action OnRewardAdOpened { get; set; } public Action<Reward> OnRewarded { get; set; } // Start is called before the first frame update void Start() { Debug.Log("[HMS] RewardAdManager Start"); HwAds.Init(); AdId = "testx9dtjwj8hp"; } private void LoadNextRewardedAd() { Debug.Log("[HMS] AdsManager LoadNextRewardedAd"); rewardAd = new RewardAd(AdId); rewardAd.LoadAd( new AdParam.Builder().Build(), () => Debug.Log("[HMS] Rewarded ad loaded!"), (errorCode) => Debug.Log($"[HMS] Rewarded ad loading failed with error ${errorCode}") ); } public void ShowRewardedAd() { Debug.Log("[HMS] AdsManager ShowRewardedAd"); if (rewardAd?.Loaded == true) { Debug.Log("[HMS] AdsManager rewardAd.Show"); rewardAd.Show(new RewardAdListener(this)); } else { Debug.Log("[HMS] Reward ad clicked but still not loaded"); } } } } #endif
30.326923
131
0.542803
[ "MIT" ]
EvilMindDevs/hms-reference-game
RefGame/Assets/Huawei/Scripts/Ads/RewardAdManager.cs
3,156
C#
namespace Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801 { using Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.PowerShell; /// <summary>String dictionary resource.</summary> [System.ComponentModel.TypeConverter(typeof(ConnectionStringDictionaryTypeConverter))] public partial class ConnectionStringDictionary { /// <summary> /// <c>AfterDeserializeDictionary</c> will be called after the deserialization has finished, allowing customization of the /// object before it is returned. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); /// <summary> /// <c>AfterDeserializePSObject</c> will be called after the deserialization has finished, allowing customization of the object /// before it is returned. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); /// <summary> /// <c>BeforeDeserializeDictionary</c> will be called before the deserialization has commenced, allowing complete customization /// of the object before it is deserialized. /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter. /// Implement this method in a partial class to enable this behavior. /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return /// instantly.</param> partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); /// <summary> /// <c>BeforeDeserializePSObject</c> will be called before the deserialization has commenced, allowing complete customization /// of the object before it is deserialized. /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter. /// Implement this method in a partial class to enable this behavior. /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return /// instantly.</param> partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// <summary> /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ConnectionStringDictionary" /// />. /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> internal ConnectionStringDictionary(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; } // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IConnectionStringDictionaryInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IConnectionStringDictionaryProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IConnectionStringDictionaryInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ConnectionStringDictionaryPropertiesTypeConverter.ConvertFrom); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IProxyOnlyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IProxyOnlyResourceInternal)this).Name, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IProxyOnlyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IProxyOnlyResourceInternal)this).Type, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IProxyOnlyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IProxyOnlyResourceInternal)this).Id, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IProxyOnlyResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IProxyOnlyResourceInternal)this).Kind, global::System.Convert.ToString); AfterDeserializeDictionary(content); } /// <summary> /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ConnectionStringDictionary" /// />. /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> internal ConnectionStringDictionary(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; } // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IConnectionStringDictionaryInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IConnectionStringDictionaryProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IConnectionStringDictionaryInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ConnectionStringDictionaryPropertiesTypeConverter.ConvertFrom); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IProxyOnlyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IProxyOnlyResourceInternal)this).Name, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IProxyOnlyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IProxyOnlyResourceInternal)this).Type, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IProxyOnlyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IProxyOnlyResourceInternal)this).Id, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IProxyOnlyResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IProxyOnlyResourceInternal)this).Kind, global::System.Convert.ToString); AfterDeserializePSObject(content); } /// <summary> /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ConnectionStringDictionary" /// />. /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> /// <returns> /// an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IConnectionStringDictionary" /// />. /// </returns> public static Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IConnectionStringDictionary DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConnectionStringDictionary(content); } /// <summary> /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ConnectionStringDictionary" /// />. /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> /// <returns> /// an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IConnectionStringDictionary" /// />. /// </returns> public static Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IConnectionStringDictionary DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConnectionStringDictionary(content); } /// <summary> /// Creates a new instance of <see cref="ConnectionStringDictionary" />, deserializing the content from a json string. /// </summary> /// <param name="jsonText">a string containing a JSON serialized instance of this model.</param> /// <returns>an instance of the <see cref="className" /> model class.</returns> public static Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IConnectionStringDictionary FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonNode.Parse(jsonText)); /// <summary>Serializes this instance to a json string.</summary> /// <returns>a <see cref="System.String" /> containing this model serialized to JSON text.</returns> public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.SerializationMode.IncludeAll)?.ToString(); } /// String dictionary resource. [System.ComponentModel.TypeConverter(typeof(ConnectionStringDictionaryTypeConverter))] public partial interface IConnectionStringDictionary { } }
78.156028
520
0.723866
[ "MIT" ]
Arsasana/azure-powershell
src/Functions/generated/api/Models/Api20190801/ConnectionStringDictionary.PowerShell.cs
10,880
C#
using java.lang; using stab.query; using stab.tree; public class ExpressionTreeReturn { public static int test() { ExpressionTree<FunctionIntInt> expr = p => { return 1; }; return (int)((ValueExpression)((ReturnStatement)((BlockStatement)expr.Body).Statements.first()).Value).Value; } }
28.363636
117
0.692308
[ "Apache-2.0" ]
monoman/cnatural-language
tests/resources/LibraryTest/sources/ExpressionTreeReturn.stab.cs
312
C#
using System; using System.Collections.Generic; using System.Text; namespace ESFA.DC.ILR.ReportService.Model.ReportModels { public sealed class FundingClaim1619HeaderModel { public string ProviderName { get; set; } public int Ukprn { get; set; } public string IlrFile { get; set; } public string Year { get; set; } } }
20.444444
54
0.663043
[ "MIT" ]
SkillsFundingAgency/DC-ILR-1819-ReportService
src/ESFA.DC.ILR.ReportService.Model/ReportModels/FundingClaim1619HeaderModel.cs
370
C#
using System.Collections.Generic; public class SettlementSection { public List<Lot> Lots; public SettlementSection() { } public SettlementSection(SettlementSectionSdo sdo) { if (sdo == null) { return; } Lots = LotSdo.ConvertToLots(sdo.LotSdos); } }
15.571429
54
0.584098
[ "Apache-2.0" ]
SchwiftyPython/PizzalikeRL
Assets/Resources/Scripts/World/Settlements/SettlementSection.cs
329
C#
using DCL.Configuration; using System; using DCL; using DCL.Helpers; using UnityEngine; public class DCLCharacterPosition { private Vector3 worldPositionValue; private Vector3 unityPositionValue; private Vector3 offset; private int lastRepositionFrame = 0; public Vector3 worldPosition { get { return worldPositionValue; } set { worldPositionValue = value; unityPositionValue = PositionUtils.WorldToUnityPosition(worldPositionValue); CheckAndRepositionWorld(); } } public Vector3 unityPosition { get { return unityPositionValue; } set { unityPositionValue = value; worldPositionValue = PositionUtils.UnityToWorldPosition(unityPositionValue); CheckAndRepositionWorld(); } } public DCLCharacterPosition() { CommonScriptableObjects.worldOffset.Set(Vector3.zero); CommonScriptableObjects.playerWorldPosition.Set(Vector3.zero); } private void CheckAndRepositionWorld() { bool dirty = false; float minDistanceForReposition = PlayerSettings.WORLD_REPOSITION_MINIMUM_DISTANCE; if (Mathf.Abs(unityPositionValue.x) > minDistanceForReposition) { float dist = (int) (unityPositionValue.x / minDistanceForReposition) * minDistanceForReposition; unityPositionValue.x -= dist; offset.x += dist; dirty = true; } if (Mathf.Abs(unityPositionValue.z) > minDistanceForReposition) { float dist = (int) (unityPositionValue.z / minDistanceForReposition) * minDistanceForReposition; unityPositionValue.z -= dist; offset.z += dist; dirty = true; } if (dirty) { worldPositionValue = unityPositionValue + offset; lastRepositionFrame = Time.frameCount; CommonScriptableObjects.playerWorldPosition.Set(worldPositionValue); CommonScriptableObjects.worldOffset.Set(offset); DCL.Environment.i.platform.physicsSyncController.MarkDirty(); } } public bool RepositionedWorldLastFrame() { return lastRepositionFrame == Time.frameCount - 1; } public override string ToString() { return $"worldPos: {worldPositionValue} - unityPos: {unityPositionValue} - offset: {offset}"; } }
30.620253
135
0.651922
[ "Apache-2.0" ]
0xBlockchainx0/unity-renderer
unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/CharacterController/DCLCharacterPosition.cs
2,419
C#
using System; using System.Reflection; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; // 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("AWSSDK.EBS")] #if BCL35 [assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - Amazon Elastic Block Store. This release introduces the EBS direct APIs for Snapshots: 1. ListSnapshotBlocks, which lists the block indexes and block tokens for blocks in an Amazon EBS snapshot. 2. ListChangedBlocks, which lists the block indexes and block tokens for blocks that are different between two snapshots of the same volume/snapshot lineage. 3. GetSnapshotBlock, which returns the data in a block of an Amazon EBS snapshot.")] #elif BCL45 [assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (4.5) - Amazon Elastic Block Store. This release introduces the EBS direct APIs for Snapshots: 1. ListSnapshotBlocks, which lists the block indexes and block tokens for blocks in an Amazon EBS snapshot. 2. ListChangedBlocks, which lists the block indexes and block tokens for blocks that are different between two snapshots of the same volume/snapshot lineage. 3. GetSnapshotBlock, which returns the data in a block of an Amazon EBS snapshot.")] #elif PCL [assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (PCL) - Amazon Elastic Block Store. This release introduces the EBS direct APIs for Snapshots: 1. ListSnapshotBlocks, which lists the block indexes and block tokens for blocks in an Amazon EBS snapshot. 2. ListChangedBlocks, which lists the block indexes and block tokens for blocks that are different between two snapshots of the same volume/snapshot lineage. 3. GetSnapshotBlock, which returns the data in a block of an Amazon EBS snapshot.")] #elif UNITY [assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (Unity) - Amazon Elastic Block Store. This release introduces the EBS direct APIs for Snapshots: 1. ListSnapshotBlocks, which lists the block indexes and block tokens for blocks in an Amazon EBS snapshot. 2. ListChangedBlocks, which lists the block indexes and block tokens for blocks that are different between two snapshots of the same volume/snapshot lineage. 3. GetSnapshotBlock, which returns the data in a block of an Amazon EBS snapshot.")] #elif NETSTANDARD13 [assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (NetStandard 1.3)- Amazon Elastic Block Store. This release introduces the EBS direct APIs for Snapshots: 1. ListSnapshotBlocks, which lists the block indexes and block tokens for blocks in an Amazon EBS snapshot. 2. ListChangedBlocks, which lists the block indexes and block tokens for blocks that are different between two snapshots of the same volume/snapshot lineage. 3. GetSnapshotBlock, which returns the data in a block of an Amazon EBS snapshot.")] #elif NETSTANDARD20 [assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (NetStandard 2.0)- Amazon Elastic Block Store. This release introduces the EBS direct APIs for Snapshots: 1. ListSnapshotBlocks, which lists the block indexes and block tokens for blocks in an Amazon EBS snapshot. 2. ListChangedBlocks, which lists the block indexes and block tokens for blocks that are different between two snapshots of the same volume/snapshot lineage. 3. GetSnapshotBlock, which returns the data in a block of an Amazon EBS snapshot.")] #else #error Unknown platform constant - unable to set correct AssemblyDescription #endif [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("Amazon Web Services SDK for .NET")] [assembly: AssemblyCompany("Amazon.com, Inc")] [assembly: AssemblyCopyright("Copyright 2009-2020 Amazon.com, Inc. or its affiliates. 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)] // 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("3.3")] [assembly: AssemblyFileVersion("3.3.101.1")] #if WINDOWS_PHONE || UNITY [assembly: System.CLSCompliant(false)] # else [assembly: System.CLSCompliant(true)] #endif #if BCL [assembly: System.Security.AllowPartiallyTrustedCallers] #endif
81.389831
525
0.78863
[ "Apache-2.0" ]
JeffAshton/aws-sdk-net
sdk/src/Services/EBS/Properties/AssemblyInfo.cs
4,802
C#
using System; namespace NextGenSoftware.OASIS.API.Providers.IPFSOASIS { public class HolonResume { public Guid Id { get; set; } public string login { get; set; } public string password { get; set; } } }
20.083333
55
0.622407
[ "CC0-1.0" ]
neurip/Our-World-OASIS-API-HoloNET-HoloUnity-And-.NET-HDK
NextGenSoftware.OASIS.API.Providers.IPFSOASIS/HolonResume.cs
243
C#
// This file is part of YamlDotNet - A .NET library for YAML. // Copyright (c) Antoine Aubry and contributors // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. using System; using YamlDotNet.Core; namespace YamlDotNet.Serialization { /// <summary> /// Allows an object to customize how it is serialized and deserialized. /// </summary> public interface IYamlConvertible { /// <summary> /// Reads this object's state from a YAML parser. /// </summary> /// <param name="parser">The parser where the object's state should be read from.</param> /// <param name="expectedType">The type that the deserializer is expecting.</param> /// <param name="nestedObjectDeserializer"> /// A function that will use the current deserializer /// to read an object of the given type from the parser. /// </param> void Read(IParser parser, Type expectedType, ObjectDeserializer nestedObjectDeserializer); /// <summary> /// Writes this object's state to a YAML emitter. /// </summary> /// <param name="emitter">The emitter where the object's state should be written to.</param> /// <param name="nestedObjectSerializer">A function that will use the current serializer to write an object to the emitter.</param> void Write(IEmitter emitter, ObjectSerializer nestedObjectSerializer); } /// <summary> /// Represents a function that is used to deserialize an object of the given type. /// </summary> /// <param name="type">The type that the deserializer should read.</param> /// <returns>Returns the object that was deserialized.</returns> public delegate object ObjectDeserializer(Type type); /// <summary> /// Represents a function that is used to serialize an object of the given type. /// </summary> /// <param name="value">The object to be serialized.</param> /// <param name="type"> /// The type that should be considered when emitting the object. /// If null, the actual type of the <paramref name="value" /> is used. /// </param> public delegate void ObjectSerializer(object value, Type type = null); }
48.298507
139
0.694994
[ "BSD-2-Clause" ]
4Rtrtr/Unity3DTemplateProject
{{cookiecutter.project_name}}/src/{{cookiecutter.project_name}}/Assets/Editor/Plugins/YamlDotNet/Serialization/IYamlConvertible.cs
3,236
C#
namespace AnnoSavegameViewer.Structures.Savegame.Generated { using AnnoSavegameViewer.Serialization.Core; public class InfectionChanceTrackerListList { #region Public Properties [BinaryContent(Name = "Counter", NodeType = BinaryContentTypes.Attribute)] public object Counter { get; set; } [BinaryContent(Name = "AccumulatedInfectionChance", NodeType = BinaryContentTypes.Attribute)] public object AccumulatedInfectionChance { get; set; } #endregion Public Properties } }
31.5625
97
0.768317
[ "MIT" ]
Veraatversus/AnnoSavegameViewer
src/AnnoSavegameViewer/GeneratedA7s/Structures/Savegame2/Generated/Content/InfectionChanceTrackerListList.cs
505
C#
// Copyright (c) Xenko contributors (https://xenko.com) and Silicon Studio Corp. (https://www.siliconstudio.co.jp) // Distributed under the MIT license. See the LICENSE.md file in the project root for more information. using System; using System.Runtime.InteropServices; namespace Xenko.Video { /// <summary> /// Represents an image extracted from a video. /// </summary> public sealed class VideoImage : IDisposable { /// <summary> /// Initializes a new instance of the <see cref="VideoImage"/> class. /// </summary> public VideoImage(int width, int height, int bufferSize) { Buffer = Marshal.AllocHGlobal(bufferSize); BufferSize = bufferSize; Height = height; Width = width; } /// <summary> /// Buffer to the image data. /// </summary> public IntPtr Buffer { get; } /// <summary> /// Size of the buffer in bytes. /// </summary> public int BufferSize { get; } /// <summary> /// Image height. /// </summary> public int Height { get; } public int Linesize { get; set; } public long Timestamp { get; set; } /// <summary> /// Image width. /// </summary> public int Width { get; } public void Dispose() { Marshal.FreeHGlobal(Buffer); } } }
26.272727
114
0.547405
[ "MIT" ]
Aminator/xenko
sources/engine/Xenko.Video/VideoImage.cs
1,445
C#
using Engine; using Engine.ECS; using Engine.Input; using PovertySTG.ECS.Components; using Microsoft.Xna.Framework; using System; using System.Collections.Generic; using System.Text; using Engine.Resource; using PovertySTG.Factories; namespace PovertySTG.ECS.Systems { public class LevelScriptSystem : CSystem { SystemReferences sys; public LevelScriptSystem(SystemReferences sys) { this.sys = sys; } public override void Update(GameTime gameTime) { sys.LevelScriptComponents.TryGetFirstEnabled(out LevelScriptComponent level); float seconds = (float)gameTime.ElapsedGameTime.TotalSeconds; LevelScript levelScript = level.Level; if (levelScript == null) return; switch (level.WaitMode) { case LevelWaitMode.Start: ProgressLevel(level, levelScript); break; case LevelWaitMode.Timer: if (level.WaitTimer > 0) level.WaitTimer -= seconds; if (level.WaitTimer <= 0) { ProgressLevel(level, levelScript); } break; case LevelWaitMode.Leave: if (CheckLeave()) ProgressLevel(level, levelScript); break; case LevelWaitMode.Clear: if (CheckClear()) ProgressLevel(level, levelScript); break; } } bool CheckClear() { foreach (EnemyComponent enemy in sys.EnemyComponents.EnabledList) { if (enemy.Type != EnemyType.MoneyBag) return false; } return true; } bool CheckLeave() { foreach (EnemyComponent enemy in sys.EnemyComponents.EnabledList) { if (enemy.Type != EnemyType.MoneyBag && enemy.Phase >= 0) return false; } return true; } void ProgressLevel(LevelScriptComponent level, LevelScript levelScript) { List<string> lines = levelScript.Lines; while (level.Progress < lines.Count) { //level.Owner.Scene.GS.Error.DebugPrint(lines[level.Progress]); string[] line = lines[level.Progress].Split(' '); if (line.Length < 1) { level.Progress++; continue; } switch (line[0]) { case "loop": level.LoopPoint = level.Progress + 1; break; case "repeat": level.Progress = level.LoopPoint; // TODO: This can cause an infinite loop. level.Progress++; continue; case "leave": foreach (EnemyComponent enemy in sys.EnemyComponents.EnabledList) { enemy.Phase = -1; } break; case "clear": foreach (BulletComponent bullet in sys.BulletComponents.EnabledList) { if (bullet.Type > BulletType.Items) bullet.Owner.Delete(); } foreach (EnemyComponent enemy in sys.EnemyComponents.EnabledList) { enemy.Owner.Delete(); } break; } if (line.Length < 2) { level.Progress++; continue; } switch (line[0]) { case "summon": Random r = new Random(); float x = (float)r.NextDouble() * Config.LevelWidth; float y = (float)r.NextDouble() * Config.LevelHeight / 2 + 20; float x2 = Config.LevelWidth / 2; float y2 = Config.LevelHeight * 1 / 4; if (line[1] == "fairy") DanmakuFactory.MakeEnemy(scene, EnemyType.Fairy, x, 0, x, y); else if (line[1] == "brave_fairy") DanmakuFactory.MakeEnemy(scene, EnemyType.BraveFairy, x, 0, x, y); else if (line[1] == "moneybag") { float x3; if (x > Config.LevelWidth / 2) x3 = 0 - 50; else x3 = Config.LevelWidth + 50; DanmakuFactory.MakeEnemy(scene, EnemyType.MoneyBag, x3, y, x, y); } else if (line[1] == "yoshika") DanmakuFactory.MakeEnemy(scene, EnemyType.Yoshika, x2, -75, x2, y2); else if (line[1] == "fuyu") DanmakuFactory.MakeEnemy(scene, EnemyType.Fuyu, x2, -75, x2, y2); else if (line[1] == "joon") DanmakuFactory.MakeEnemy(scene, EnemyType.Joon, x2, -75, x2, y2); else if (line[1] == "shion") DanmakuFactory.MakeEnemy(scene, EnemyType.Shion, x2, -75, x2, y2); break; case "wait": if (line[1] == "clear") { level.WaitMode = LevelWaitMode.Clear; level.Progress++; return; } else if (line[1] == "leave") { level.WaitMode = LevelWaitMode.Leave; level.Progress++; return; } else if (float.TryParse(line[1], out float time)) { level.WaitMode = LevelWaitMode.Timer; level.WaitTimer = time; level.Progress++; return; } break; case "talk": //sys.GetGameState().Request(lines[level.Progress]); //scene.AddScene(SceneFactory.NewTalkScene(gs, "talk", line[1])).Enable(); level.Story = gs.ResourceManager.Stories.Get(line[1]); level.StoryProgress = -1; level.WaitMode = LevelWaitMode.Forever; level.Progress++; return; case "level": level.Level = gs.ResourceManager.LevelScripts.Get(line[1]); level.Progress = 0; level.LoopPoint = 0; level.WaitMode = LevelWaitMode.Start; return; case "music": if (line[1] == "stop") { SoundManager.StopMusic(); break; } SoundManager.PlayMusic(line[1]); break; case "sound": if (line.Length == 3 && line[2] == "stop") SoundManager.StopSound(line[1]); else SoundManager.PlaySound(line[1]); break; } level.Progress++; } // Reached end of script with no remaining action. Go dormant. level.Level = null; level.Progress = 0; level.WaitMode = LevelWaitMode.Start; level.LoopPoint = 0; return; } } }
41.132653
99
0.420367
[ "MIT" ]
Karob2/PovertySTG
Source/ECS/Systems/LevelScriptSystem.cs
8,064
C#
namespace RedSpark.Thot.Api.Domain.Entities.Example { public class Product { public int Id { get; set; } public string Name { get; set; } public override bool Equals(object obj) { if (obj is null) return false; var compareTo = obj is Product ? (Product)obj : default; if (ReferenceEquals(this, compareTo)) return true; return Id.Equals(compareTo.Id); } public override int GetHashCode() { return Id.GetHashCode() + Name.GetHashCode() + 3573; } } }
23.6
68
0.557627
[ "MIT" ]
rmstreet/RedSpark.Thot
src/RedSpark.Thot.Api/Domain/Entities/Example/Product.cs
592
C#
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Microsoft.Practices.DataPipeline.ColdStorage.BlobWriter.Tests { using System; using System.Configuration; using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.Practices.DataPipeline.ColdStorage.Instrumentation; using Microsoft.WindowsAzure.Storage; using Microsoft.WindowsAzure.Storage.Blob; using Moq; using Xunit; public class GivenARollingBlobWriterOnExistingBlobs : IDisposable { private const string Prefix = "prefix/"; private const int BlocksAllowed = 6; private const int BlockSize = 1024 * 1024; private CloudStorageAccount _storageAccount; private string _containerName; private string _existingBlobContents; private RollingBlobWriter _sut; public GivenARollingBlobWriterOnExistingBlobs() { _storageAccount = TestUtilities.GetStorageAccount(); _containerName = "testesistingblobs" + Guid.NewGuid().ToString("N").ToLowerInvariant(); GetContainer().Create(); var existingBlobWriter = new RollingBlobWriter( Mock.Of<IBlobNamingStrategy>(ns => ns.GetNamePrefix() == Prefix), Mock.Of<IColdStorageInstrumentationPublisher>(), _storageAccount, _containerName, rollSizeMb: 1, blocksAllowed: BlocksAllowed, blockSize: BlockSize); // setup first blob existingBlobWriter.WriteAsync( new[] { TestUtilities.CreateBlockData(new string('z', 1024*1024), BlockSize), }, CancellationToken.None).Wait(); // setup a payload of 1023KB for second blob _existingBlobContents = new string('z', 1024 * 1024 - 1024); // setup second blob existingBlobWriter.WriteAsync( new[] { TestUtilities.CreateBlockData(_existingBlobContents, BlockSize), }, CancellationToken.None).Wait(); _sut = new RollingBlobWriter( Mock.Of<IBlobNamingStrategy>(ns => ns.GetNamePrefix() == Prefix), Mock.Of<IColdStorageInstrumentationPublisher>(), _storageAccount, _containerName, rollSizeMb: 1, blocksAllowed: BlocksAllowed, blockSize: BlockSize); } [Fact] [Trait("Running time", "Long")] [Trait("Category", "Integration")] public async Task WhenWritingSingleBlock_ThenBlockIsAppendedToLastBlob() { var payloadString = new string('a', 50); await _sut.WriteAsync( new[] { TestUtilities.CreateBlockData(payloadString, BlockSize) }, CancellationToken.None); Assert.Equal( _existingBlobContents + payloadString, await GetContainer() .GetBlockBlobReference(Prefix + "1") .DownloadTextAsync(Encoding.UTF8, AccessCondition.GenerateEmptyCondition(), null, null)); } [Fact] [Trait("Running time", "Long")] [Trait("Category", "Integration")] public async Task WhenWritingMultipleBlocksAndBlobIsMaxedOut_ThenRollBlocksToNewBlob() { // existing blob 0 size: 1MB // existing blob 1 size: 1023KB var payloadBlock1 = new string('r', 1024); var payloadBlock2 = new string('t', 1024); await _sut.WriteAsync( new[] { TestUtilities.CreateBlockData(payloadBlock1, BlockSize), TestUtilities.CreateBlockData(payloadBlock2, BlockSize) }, CancellationToken.None); Assert.Equal( payloadBlock1 + payloadBlock2, await GetContainer() .GetBlockBlobReference(Prefix + "2") .DownloadTextAsync(Encoding.UTF8, AccessCondition.GenerateEmptyCondition(), null, null)); } [Fact] [Trait("Running time", "Long")] [Trait("Category", "Integration")] public async Task WhenWritingSingleMaxedOutBlock_ThenRollsToANewBlob() { // existing blob 0 size: 1MB // existing blob 1 size: 1023KB // 1MB payload block var payloadString = new string('a', 1024 * 1024); await _sut.WriteAsync( new[] { TestUtilities.CreateBlockData(payloadString, BlockSize) }, CancellationToken.None); Assert.Equal( payloadString, await GetContainer() .GetBlockBlobReference(Prefix + "2") .DownloadTextAsync(Encoding.UTF8, AccessCondition.GenerateEmptyCondition(), null, null)); } public void Dispose() { this.GetContainer().DeleteIfExists(); } private CloudBlobContainer GetContainer() { var client = _storageAccount.CreateCloudBlobClient(); return client.GetContainerReference(_containerName); } } }
35.93038
113
0.558922
[ "MIT" ]
averyspa/data-pipeline
src/Implementation/ColdStorage/ColdStorage.BlobWriter.Tests/GivenARollingBlobWriterOnExistingBlobs.cs
5,679
C#
namespace HtmlGenerator { public class HtmlProgressElement : HtmlElement { public HtmlProgressElement() : base("progress") { } public HtmlProgressElement WithMax(string value) => this.WithAttribute(Attribute.Max(value)); public HtmlProgressElement WithValue(string value) => this.WithAttribute(Attribute.Value(value)); } }
30.083333
105
0.714681
[ "MIT" ]
hughbe/HtmlGenerator
src/Elements/HtmlProgressElement.cs
361
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 WindowCapture.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("WindowCapture.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.652778
179
0.603665
[ "Apache-2.0" ]
shipinm1/MwCapture
WindowCapture/WindowCapture/Properties/Resources.Designer.cs
2,785
C#
using ShellLink.DataObjects; using ShellLink.DataObjects.ExtraData; using ShellLink.Internals; using System; using System.Collections.Generic; using System.IO; using System.Text; namespace ShellLink.Actuators.ExtraData { public sealed class EnvironmentVariableDataBlockActuator : ExtraDataBlockActuator<EnvironmentVariableDataBlock> { public override int MinBlockSize { get; } = 0x00000314; public override int MaxBlockSize { get; } = 0x00000314; public override int StandardBlockSignature { get; } = unchecked((int)0xA0000001); protected override void WriteDataTo(EnvironmentVariableDataBlock edb, BinaryWriter writer, IOptions options) { writer.WriteFixedSizeString(edb.TargetAnsi, 260, Encoding.Default); writer.WriteFixedSizeString(edb.TargetUnicode, 520, Encoding.Unicode); } protected override bool LoadData(EnvironmentVariableDataBlock edb, BinaryReader reader, IOptions options) { edb.TargetAnsi = reader.ReadFixedSizeString(260, Encoding.Default, ZeroCharBehavior.RemoveTrailing); edb.TargetUnicode = reader.ReadFixedSizeString(520, Encoding.Unicode, ZeroCharBehavior.RemoveTrailing); return true; } protected override void CheckData(EnvironmentVariableDataBlock edb, List<Exception> errors, ShellLinkObject shellLinkObject) { CheckString(errors, edb.TargetAnsi, 260, nameof(edb.TargetAnsi)); CheckString(errors, edb.TargetUnicode, 260, nameof(edb.TargetUnicode)); } protected override void RepairData(EnvironmentVariableDataBlock edb) { // TODO: this should be the same for: // - DarwinDataBlock // - EnvironmentVariableDataBlock // - IconEnvironmentDataBlock } } }
41.931818
132
0.706233
[ "MIT" ]
masbicudo/MS-SHLLINK.Net
ShellLink/Actuators.ExtraData/EnvironmentVariableDataBlockActuator.cs
1,847
C#
using System; using System.Collections.Generic; using System.Linq; using Newtonsoft.Json.Linq; using System.Runtime.Serialization; namespace XBMCRPC.Settings { }
18
35
0.820988
[ "MIT" ]
RyanMelenaNoesis/ElveKodiDriver
src/NoesisLabs.Elve.Kodi/XBMCRPC/XBMCRPC/Settings/GetCategoriesResponse_categories.cs
162
C#
#pragma warning disable 108 // new keyword hiding #pragma warning disable 114 // new keyword hiding namespace Windows.Security.DataProtection { #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__ #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__ [global::Uno.NotImplemented] #endif public enum UserDataAvailability { #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__ Always, #endif #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__ AfterFirstUnlock, #endif #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__ WhileUnlocked, #endif } #endif }
27.26087
63
0.708134
[ "Apache-2.0" ]
JTOne123/uno
src/Uno.UWP/Generated/3.0.0.0/Windows.Security.DataProtection/UserDataAvailability.cs
627
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using Microsoft.Data.DataView; using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.EntryPoints; [assembly: LoadableClass(typeof(void), typeof(DataViewReference), null, typeof(SignatureEntryPointModule), "DataViewReference")] namespace Microsoft.ML.EntryPoints { internal static class DataViewReference { public sealed class Input { [Argument(ArgumentType.Required, HelpText = "Pointer to IDataView in memory", SortOrder = 1)] public IDataView Data; } public sealed class Output { [TlcModule.Output(Desc = "The resulting data view", SortOrder = 1)] public IDataView Data; } [TlcModule.EntryPoint(Name = "Data.DataViewReference", Desc = "Pass dataview from memory to experiment")] public static Output ImportData(IHostEnvironment env, Input input) { Contracts.CheckValue(env, nameof(env)); var host = env.Register("DataViewReference"); env.CheckValue(input, nameof(input)); EntryPointUtils.CheckInputArgs(host, input); return new Output { Data = input.Data }; } } }
35.692308
128
0.667385
[ "MIT" ]
IndigoShock/machinelearning
src/Microsoft.ML.EntryPoints/DataViewReference.cs
1,394
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Runtime.InteropServices; internal static partial class Interop { internal static partial class Crypt32 { [StructLayout(LayoutKind.Sequential)] internal struct CRYPT_RC2_CBC_PARAMETERS { internal CryptRc2Version dwVersion; internal int fIV; internal byte rgbIV0; internal byte rgbIV1; internal byte rgbIV2; internal byte rgbIV3; internal byte rgbIV4; internal byte rgbIV5; internal byte rgbIV6; internal byte rgbIV7; } } }
29.777778
71
0.640547
[ "MIT" ]
06needhamt/runtime
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CRYPT_RC2_CBC_PARAMETERS.cs
804
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BGFolklore.Data.Models.Calendar { public class Town { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; } [Required] [MaxLength(60)] public string Name { get; set; } [Required] public int AreaId { get; set; } public ICollection<PublicEvent> PublicEvents { get; set; } } }
22.962963
66
0.672581
[ "MIT" ]
Margi13/BGFolklore
BGFolklore.Data/BGFolklore.Models/Calendar/Town.cs
622
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using YourPlace.Web.Models.StoreService; namespace YourPlace.Web.Services.StoreService { public interface IStoreServiceService { bool Create(string name, string description, decimal price, string storeId, string userId); DetailsStoreServiceViewModel ServiceById(string id); bool Edit(string name, string description, decimal price, string id, string userId); bool Delete(string id, string userId); DateTime ParseDate(string date); BookAnHourViewModel FreeHours(string storeServiceId, DateTime currDate); string BookHour(int hour, string storeName, string storeServiceName, string storeServiceId, string storeId, DateTime currDate, YourPlace.Models.Models.User user); } }
32.461538
170
0.753555
[ "MIT" ]
RadoslavDimitrov/YourPlace
YourPlace.Web/YourPlace.Web/Services/StoreService/IStoreServiceService.cs
846
C#
using DeveImageOptimizer.FileProcessing; using DeveImageOptimizer.Helpers; using DeveImageOptimizer.State; using DeveImageOptimizer.State.StoringProcessedDirectories; using DeveImageOptimizer.Tests.ExternalTools; using DeveImageOptimizer.Tests.TestHelpers; using System.IO; using System.Linq; using System.Threading.Tasks; using Xunit; namespace DeveImageOptimizer.Tests.FileProcessing { public class FileProcessorDirTests { [SkippableFact] public async Task CorrectlyOptimizesCompleteDirectoryAndDoesntOptimizeSecondTime() { var config = ConfigCreator.CreateTestConfig(false); var testName = $"{nameof(FileProcessorDirTests)}_{nameof(CorrectlyOptimizesCompleteDirectoryAndDoesntOptimizeSecondTime)}"; var fileNameFileProcessedStateRememberer = Path.Combine(FolderHelperMethods.Internal_AssemblyDirectory.Value, $"{testName}.txt"); var fileNameDirProcessedStateRememberer = Path.Combine(FolderHelperMethods.Internal_AssemblyDirectory.Value, $"{testName}-dir.txt"); string sampleDirToOptimize = FileProcessingTestsHelpers.PrepareTestOptimizeDir("SampleDirToOptimize", fileNameFileProcessedStateRememberer, fileNameDirProcessedStateRememberer, testName); //Optimize first time { var rememberer = new FileProcessedStateRememberer(true, fileNameFileProcessedStateRememberer); var dirRememberer = new DirProcessedStateRememberer(false, fileNameDirProcessedStateRememberer); var fp = new DeveImageOptimizerProcessor(config, null, rememberer, dirRememberer); var results = (await fp.ProcessDirectory(sampleDirToOptimize)).ToList(); Assert.Equal(4, results.Count); foreach (var result in results) { Assert.Equal(OptimizationResult.Success, result.OptimizationResult); Assert.True(result.OriginalSize > result.OptimizedSize); } } //Optimize second time { var rememberer = new FileProcessedStateRememberer(true, fileNameFileProcessedStateRememberer); var dirRememberer = new DirProcessedStateRememberer(false, fileNameDirProcessedStateRememberer); var fp = new DeveImageOptimizerProcessor(config, null, rememberer, dirRememberer); var results = (await fp.ProcessDirectory(sampleDirToOptimize)).ToList(); Assert.Equal(4, results.Count); foreach (var result in results) { Assert.Equal(OptimizationResult.Skipped, result.OptimizationResult); Assert.True(result.OriginalSize == result.OptimizedSize); } } } [SkippableFact] public async Task CorrectlyOptimizesCompleteDirectoryAndDoesntSkipFailedFiles() { var config = ConfigCreator.CreateTestConfig(false); var testName = $"{nameof(FileProcessorDirTests)}_{nameof(CorrectlyOptimizesCompleteDirectoryAndDoesntSkipFailedFiles)}"; var fileNameFileProcessedStateRememberer = Path.Combine(FolderHelperMethods.Internal_AssemblyDirectory.Value, $"{testName}.txt"); var fileNameDirProcessedStateRememberer = Path.Combine(FolderHelperMethods.Internal_AssemblyDirectory.Value, $"{testName}-dir.txt"); string sampleDirToOptimize = FileProcessingTestsHelpers.PrepareTestOptimizeDir("SampleDirToOptimizeBrokenJpg", fileNameFileProcessedStateRememberer, fileNameDirProcessedStateRememberer, testName); //Optimize first time { var rememberer = new FileProcessedStateRememberer(true, fileNameFileProcessedStateRememberer); var dirRememberer = new DirProcessedStateRememberer(false, fileNameDirProcessedStateRememberer); var fp = new DeveImageOptimizerProcessor(config, null, rememberer, dirRememberer); var results = (await fp.ProcessDirectory(sampleDirToOptimize)).ToList(); Assert.Equal(2, results.Count); Assert.Equal(1, results.Count(t => t.OptimizationResult == OptimizationResult.Success)); Assert.Equal(1, results.Count(t => t.OptimizationResult == OptimizationResult.Failed)); } //Optimize second time { var rememberer = new FileProcessedStateRememberer(true, fileNameFileProcessedStateRememberer); var dirRememberer = new DirProcessedStateRememberer(false, fileNameDirProcessedStateRememberer); var fp = new DeveImageOptimizerProcessor(config, null, rememberer, dirRememberer); var results = (await fp.ProcessDirectory(sampleDirToOptimize)).ToList(); Assert.Equal(2, results.Count); Assert.Equal(1, results.Count(t => t.OptimizationResult == OptimizationResult.Success)); Assert.Equal(1, results.Count(t => t.OptimizationResult == OptimizationResult.Failed)); } } [SkippableFact] public async Task ProcessSampleDirInParallel() { var config = ConfigCreator.CreateTestConfig(true); var testName = $"{nameof(FileProcessorDirTests)}_{nameof(ProcessSampleDirInParallel)}"; var fileNameFileProcessedStateRememberer = Path.Combine(FolderHelperMethods.Internal_AssemblyDirectory.Value, $"{testName}.txt"); var fileNameDirProcessedStateRememberer = Path.Combine(FolderHelperMethods.Internal_AssemblyDirectory.Value, $"{testName}-dir.txt"); string sampleDirToOptimize = FileProcessingTestsHelpers.PrepareTestOptimizeDir("SampleDirToOptimize", fileNameFileProcessedStateRememberer, fileNameDirProcessedStateRememberer, testName); //Optimize first time { var rememberer = new FileProcessedStateRememberer(true, fileNameFileProcessedStateRememberer); var dirRememberer = new DirProcessedStateRememberer(false, fileNameDirProcessedStateRememberer); var fp = new DeveImageOptimizerProcessor(config, null, rememberer, dirRememberer); var results = (await fp.ProcessDirectory(sampleDirToOptimize)).ToList(); Assert.Equal(4, results.Count); foreach (var result in results) { Assert.Equal(OptimizationResult.Success, result.OptimizationResult); Assert.True(result.OriginalSize > result.OptimizedSize); } } } [SkippableFact] public async Task CorrectlyOptimizesCompleteDirectoryAndDoesntOptimizeSecondTimeInParallel() { var config = ConfigCreator.CreateTestConfig(true); var testName = $"{nameof(FileProcessorDirTests)}_{nameof(CorrectlyOptimizesCompleteDirectoryAndDoesntOptimizeSecondTimeInParallel)}"; var fileNameFileProcessedStateRememberer = Path.Combine(FolderHelperMethods.Internal_AssemblyDirectory.Value, $"{testName}.txt"); var fileNameDirProcessedStateRememberer = Path.Combine(FolderHelperMethods.Internal_AssemblyDirectory.Value, $"{testName}-dir.txt"); string sampleDirToOptimize = FileProcessingTestsHelpers.PrepareTestOptimizeDir("SampleDirToOptimize", fileNameFileProcessedStateRememberer, fileNameDirProcessedStateRememberer, testName); //Optimize first time { var rememberer = new FileProcessedStateRememberer(true, fileNameFileProcessedStateRememberer); var dirRememberer = new DirProcessedStateRememberer(false, fileNameDirProcessedStateRememberer); var fp = new DeveImageOptimizerProcessor(config, null, rememberer, dirRememberer); var results = (await fp.ProcessDirectory(sampleDirToOptimize)).ToList(); Assert.Equal(4, results.Count); foreach (var result in results) { Assert.Equal(OptimizationResult.Success, result.OptimizationResult); Assert.True(result.OriginalSize > result.OptimizedSize); } } //Optimize second time { var rememberer = new FileProcessedStateRememberer(true, fileNameFileProcessedStateRememberer); var dirRememberer = new DirProcessedStateRememberer(false, fileNameDirProcessedStateRememberer); var fp = new DeveImageOptimizerProcessor(config, null, rememberer, dirRememberer); var results = (await fp.ProcessDirectory(sampleDirToOptimize)).ToList(); Assert.Equal(4, results.Count); foreach (var result in results) { Assert.Equal(OptimizationResult.Skipped, result.OptimizationResult); Assert.True(result.OriginalSize == result.OptimizedSize); } } } [SkippableFact] public async Task CorrectlyOptimizesCompleteDirectoryAndDoesntSkipFailedFilesInParallel() { var config = ConfigCreator.CreateTestConfig(true); var testName = $"{nameof(FileProcessorDirTests)}_{nameof(CorrectlyOptimizesCompleteDirectoryAndDoesntSkipFailedFilesInParallel)}"; var fileNameFileProcessedStateRememberer = Path.Combine(FolderHelperMethods.Internal_AssemblyDirectory.Value, $"{testName}.txt"); var fileNameDirProcessedStateRememberer = Path.Combine(FolderHelperMethods.Internal_AssemblyDirectory.Value, $"{testName}-dir.txt"); string sampleDirToOptimize = FileProcessingTestsHelpers.PrepareTestOptimizeDir("SampleDirToOptimizeBrokenJpg", fileNameFileProcessedStateRememberer, fileNameDirProcessedStateRememberer, testName); //Optimize first time { var rememberer = new FileProcessedStateRememberer(true, fileNameFileProcessedStateRememberer); var dirRememberer = new DirProcessedStateRememberer(false, fileNameDirProcessedStateRememberer); var fp = new DeveImageOptimizerProcessor(config, null, rememberer, dirRememberer); var results = (await fp.ProcessDirectory(sampleDirToOptimize)).ToList(); Assert.Equal(2, results.Count); Assert.Equal(1, results.Count(t => t.OptimizationResult == OptimizationResult.Success)); Assert.Equal(1, results.Count(t => t.OptimizationResult == OptimizationResult.Failed)); } //Optimize second time { var rememberer = new FileProcessedStateRememberer(true, fileNameFileProcessedStateRememberer); var dirRememberer = new DirProcessedStateRememberer(false, fileNameDirProcessedStateRememberer); var fp = new DeveImageOptimizerProcessor(config, null, rememberer, dirRememberer); var results = (await fp.ProcessDirectory(sampleDirToOptimize)).ToList(); Assert.Equal(2, results.Count); Assert.Equal(1, results.Count(t => t.OptimizationResult == OptimizationResult.Success)); Assert.Equal(1, results.Count(t => t.OptimizationResult == OptimizationResult.Failed)); } } [SkippableFact] public async Task CorrectlyOptimizesReadonlyAndBlockedFilesInDirectory() { var config = ConfigCreator.CreateTestConfig(true); var testName = $"{nameof(FileProcessorDirTests)}_{nameof(CorrectlyOptimizesReadonlyAndBlockedFilesInDirectory)}"; var fileNameFileProcessedStateRememberer = Path.Combine(FolderHelperMethods.Internal_AssemblyDirectory.Value, $"{testName}.txt"); var fileNameDirProcessedStateRememberer = Path.Combine(FolderHelperMethods.Internal_AssemblyDirectory.Value, $"{testName}-dir.txt"); string sampleDirToOptimize = FileProcessingTestsHelpers.PrepareTestOptimizeDir("DirWithReadonlyFile", fileNameFileProcessedStateRememberer, fileNameDirProcessedStateRememberer, testName); var blockedJpg = Path.Combine(sampleDirToOptimize, "BlockedJpg.jpg"); var readonlyJpg = Path.Combine(sampleDirToOptimize, "ReadOnlyJpg.jpg"); //Prepare files using (var zoneIdentifier = new ZoneIdentifier(blockedJpg)) { zoneIdentifier.Zone = UrlZone.Internet; } new FileInfo(readonlyJpg).IsReadOnly = true; //Optimize first time { var rememberer = new FileProcessedStateRememberer(true, fileNameFileProcessedStateRememberer); var dirRememberer = new DirProcessedStateRememberer(false, fileNameDirProcessedStateRememberer); var fp = new DeveImageOptimizerProcessor(config, null, rememberer, dirRememberer); var results = (await fp.ProcessDirectory(sampleDirToOptimize)).ToList(); Assert.Equal(2, results.Count); foreach (var result in results) { Assert.Equal(OptimizationResult.Success, result.OptimizationResult); Assert.True(result.OriginalSize > result.OptimizedSize); } } } } }
54.408907
208
0.676315
[ "MIT" ]
devedse/DeveImageOptimizer
DeveImageOptimizer.Tests/FileProcessing/FileProcessorDirTests.cs
13,441
C#
using System.Collections.Generic; using ProjectZero.Library.Interfaces; using ProjectZero.DataAccess.Model; using System; using Microsoft.EntityFrameworkCore; using System.Threading.Tasks; namespace ProjectZero { internal class ProZeroRepo : IProZeroRepo { private static readonly List<IDisposable> _disposables = new List<IDisposable>(); private static ProZeroContext _dbContext; public static ProZeroContext DbContext { get { // If there is no context throw this exception. return _dbContext ?? throw new Exception("Connection Lost. Restart program."); // } set { _dbContext = value ?? throw new Exception("Failed to connect to database."); } } private async Task CreateProZeroDbContextAsync() { var optionsBuilder = new DbContextOptionsBuilder<ProZeroContext>() .UseSqlServer(SecretConfiguration.ConnectionString) .optionsBuilder; var dbContext = new ProZeroContext(optionsBuilder.Options ?? throw new Exception("Failed to create DbContext...")); _disposables.Add(dbContext); DbContext = dbContext; } public void AddObject(object obj) { throw new System.NotImplementedException(); } public void DisplayObjectDetails(object obj) { throw new System.NotImplementedException(); } public object GetObjectById(int id, int? id2) { throw new System.NotImplementedException(); } public IEnumerable<object> GetOrders(object searchBy) { throw new System.NotImplementedException(); } public void Save() { throw new System.NotImplementedException(); } } }
29.646154
127
0.600415
[ "MIT" ]
2006-jun15-net/william-project0
ProjectZero/ProjectZero/ProZeroRepo.cs
1,927
C#
using Microsoft.Xna.Framework; using Zeds.Engine; namespace Zeds.Graphics.Background { static class RenderBackground { public static void DrawBackground() { var backgroundRec = new Rectangle(0, 0, Engine.Engine.MapSizeX, Engine.Engine.MapSizeY); Engine.Engine.SpriteBatch.Draw(Textures.BackgroundTexture, backgroundRec, Color.White); } } }
26.8
100
0.681592
[ "MIT" ]
Ratstool/Zeds
Graphics/Background/RenderBackground.cs
404
C#
using UnityEngine; using System.Collections; public class PlayerDirectionController : MonoBehaviour { private Camera gameCamera; /// <summary> /// MONOBEHAVIOUR Start /// </summary> void Start() { gameCamera = GameObject.Find("Main Camera").GetComponent<Camera>(); } /// <summary> /// MONOBEHAVIOUR Update /// </summary> void Update () { LookAtMousePoint(); } /// <summary> /// Rotates the transform according to the direction the mouse pointer is in. /// </summary> private void LookAtMousePoint() { Vector3 mousePositionOnScreen = Input.mousePosition; Vector3 mousePositionInWorld = gameCamera.ScreenToWorldPoint(mousePositionOnScreen); Vector3 direction = mousePositionInWorld - transform.position; transform.rotation = Quaternion.LookRotation(Vector3.forward, direction); } }
28.741935
92
0.674523
[ "MIT" ]
Zanice/2D-Game-Framework
project/Scripts/Player/PlayerDirectionController.cs
893
C#
using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using MusicStore.Models; namespace MusicStore.Controllers { [Authorize] public class ManageController : Controller { public ManageController( UserManager<ApplicationUser> userManager, SignInManager<ApplicationUser> signInManager, IAuthenticationSchemeProvider schemes) { UserManager = userManager; SignInManager = signInManager; SchemeProvider = schemes; } public UserManager<ApplicationUser> UserManager { get; } public SignInManager<ApplicationUser> SignInManager { get; } public IAuthenticationSchemeProvider SchemeProvider { get; } // // GET: /Manage/Index public async Task<ActionResult> Index(ManageMessageId? message = null) { ViewBag.StatusMessage = message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." : message == ManageMessageId.SetPasswordSuccess ? "Your password has been set." : message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set." : message == ManageMessageId.Error ? "An error has occurred." : message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added." : message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed." : ""; var user = await GetCurrentUserAsync(); var model = new IndexViewModel { HasPassword = await UserManager.HasPasswordAsync(user), PhoneNumber = await UserManager.GetPhoneNumberAsync(user), TwoFactor = await UserManager.GetTwoFactorEnabledAsync(user), Logins = await UserManager.GetLoginsAsync(user), BrowserRemembered = await SignInManager.IsTwoFactorClientRememberedAsync(user) }; return View(model); } // // POST: /Manage/RemoveLogin [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> RemoveLogin(string loginProvider, string providerKey) { ManageMessageId? message = ManageMessageId.Error; var user = await GetCurrentUserAsync(); if (user != null) { var result = await UserManager.RemoveLoginAsync(user, loginProvider, providerKey); if (result.Succeeded) { await SignInManager.SignInAsync(user, isPersistent: false); message = ManageMessageId.RemoveLoginSuccess; } } return RedirectToAction("ManageLogins", new { Message = message }); } // // GET: /Account/AddPhoneNumber public IActionResult AddPhoneNumber() { return View(); } // // POST: /Account/AddPhoneNumber [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> AddPhoneNumber(AddPhoneNumberViewModel model) { if (!ModelState.IsValid) { return View(model); } var user = await GetCurrentUserAsync(); // Generate the token and send it var code = await UserManager.GenerateChangePhoneNumberTokenAsync(user, model.Number); await MessageServices.SendSmsAsync(model.Number, "Your security code is: " + code); return RedirectToAction("VerifyPhoneNumber", new { PhoneNumber = model.Number }); } // // POST: /Manage/EnableTwoFactorAuthentication [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> EnableTwoFactorAuthentication() { var user = await GetCurrentUserAsync(); if (user != null) { await UserManager.SetTwoFactorEnabledAsync(user, true); // TODO: flow remember me somehow? await SignInManager.SignInAsync(user, isPersistent: false); } return RedirectToAction("Index", "Manage"); } // // POST: /Manage/DisableTwoFactorAuthentication [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> DisableTwoFactorAuthentication() { var user = await GetCurrentUserAsync(); if (user != null) { await UserManager.SetTwoFactorEnabledAsync(user, false); await SignInManager.SignInAsync(user, isPersistent: false); } return RedirectToAction("Index", "Manage"); } // // GET: /Account/VerifyPhoneNumber public async Task<IActionResult> VerifyPhoneNumber(string phoneNumber) { // This code allows you exercise the flow without actually sending codes // For production use please register a SMS provider in IdentityConfig and generate a code here. ViewBag.Code = await UserManager.GenerateChangePhoneNumberTokenAsync(await GetCurrentUserAsync(), phoneNumber); return phoneNumber == null ? View("Error") : View(new VerifyPhoneNumberViewModel { PhoneNumber = phoneNumber }); } // // POST: /Account/VerifyPhoneNumber [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> VerifyPhoneNumber(VerifyPhoneNumberViewModel model) { if (!ModelState.IsValid) { return View(model); } var user = await GetCurrentUserAsync(); if (user != null) { var result = await UserManager.ChangePhoneNumberAsync(user, model.PhoneNumber, model.Code); if (result.Succeeded) { await SignInManager.SignInAsync(user, isPersistent: false); return RedirectToAction("Index", new { Message = ManageMessageId.AddPhoneSuccess }); } } // If we got this far, something failed, redisplay form ModelState.AddModelError("", "Failed to verify phone"); return View(model); } // // GET: /Account/RemovePhoneNumber [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> RemovePhoneNumber() { var user = await GetCurrentUserAsync(); if (user != null) { var result = await UserManager.SetPhoneNumberAsync(user, null); if (result.Succeeded) { await SignInManager.SignInAsync(user, isPersistent: false); return RedirectToAction(nameof(Index), new { Message = ManageMessageId.RemovePhoneSuccess }); } } return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); } // // GET: /Manage/ChangePassword public IActionResult ChangePassword() { return View(); } // // POST: /Account/Manage [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> ChangePassword(ChangePasswordViewModel model) { if (!ModelState.IsValid) { return View(model); } var user = await GetCurrentUserAsync(); if (user != null) { var result = await UserManager.ChangePasswordAsync(user, model.OldPassword, model.NewPassword); if (result.Succeeded) { await SignInManager.SignInAsync(user, isPersistent: false); return RedirectToAction("Index", new { Message = ManageMessageId.ChangePasswordSuccess }); } AddErrors(result); return View(model); } return RedirectToAction("Index", new { Message = ManageMessageId.Error }); } // // GET: /Manage/SetPassword public IActionResult SetPassword() { return View(); } // // POST: /Manage/SetPassword [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> SetPassword(SetPasswordViewModel model) { if (!ModelState.IsValid) { return View(model); } var user = await GetCurrentUserAsync(); if (user != null) { var result = await UserManager.AddPasswordAsync(user, model.NewPassword); if (result.Succeeded) { await SignInManager.SignInAsync(user, isPersistent: false); return RedirectToAction("Index", new { Message = ManageMessageId.SetPasswordSuccess }); } AddErrors(result); return View(model); } return RedirectToAction("Index", new { Message = ManageMessageId.Error }); } // // POST: /Manage/RememberBrowser [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> RememberBrowser() { var user = await GetCurrentUserAsync(); if (user != null) { await SignInManager.RememberTwoFactorClientAsync(user); await SignInManager.SignInAsync(user, isPersistent: false); } return RedirectToAction("Index", "Manage"); } // // POST: /Manage/ForgetBrowser [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> ForgetBrowser() { await SignInManager.ForgetTwoFactorClientAsync(); return RedirectToAction("Index", "Manage"); } // // GET: /Account/Manage public async Task<IActionResult> ManageLogins(ManageMessageId? message = null) { ViewBag.StatusMessage = message == ManageMessageId.RemoveLoginSuccess ? "The external login was removed." : message == ManageMessageId.AddLoginSuccess ? "The external login was added." : message == ManageMessageId.Error ? "An error has occurred." : ""; var user = await GetCurrentUserAsync(); if (user == null) { return View("Error"); } var userLogins = await UserManager.GetLoginsAsync(user); var schemes = await SchemeProvider.GetAllSchemesAsync(); var otherLogins = schemes.Where(auth => userLogins.All(ul => auth.Name != ul.LoginProvider)).ToList(); ViewBag.ShowRemoveButton = user.PasswordHash != null || userLogins.Count > 1; return View(new ManageLoginsViewModel { CurrentLogins = userLogins, OtherLogins = otherLogins }); } // // POST: /Manage/LinkLogin [HttpPost] [ValidateAntiForgeryToken] public ActionResult LinkLogin(string provider) { // Request a redirect to the external login provider to link a login for the current user var redirectUrl = Url.Action("LinkLoginCallback", "Manage"); var properties = SignInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl, UserManager.GetUserId(User)); return new ChallengeResult(provider, properties); } // // GET: /Manage/LinkLoginCallback public async Task<ActionResult> LinkLoginCallback() { var user = await GetCurrentUserAsync(); if (user == null) { return View("Error"); } var loginInfo = await SignInManager.GetExternalLoginInfoAsync(await UserManager.GetUserIdAsync(user)); if (loginInfo == null) { return RedirectToAction("ManageLogins", new { Message = ManageMessageId.Error }); } var result = await UserManager.AddLoginAsync(user, loginInfo); var message = result.Succeeded ? ManageMessageId.AddLoginSuccess : ManageMessageId.Error; return RedirectToAction("ManageLogins", new { Message = message }); } #region Helpers private void AddErrors(IdentityResult result) { foreach (var error in result.Errors) { ModelState.AddModelError("", error.Description); } } public enum ManageMessageId { AddPhoneSuccess, AddLoginSuccess, ChangePasswordSuccess, SetTwoFactorSuccess, SetPasswordSuccess, RemoveLoginSuccess, RemovePhoneSuccess, Error } private Task<ApplicationUser> GetCurrentUserAsync() { return UserManager.GetUserAsync(HttpContext.User); } #endregion } }
37.179558
137
0.572851
[ "MIT" ]
Digid-GMAO/MyTested.AspNet.TV
src/Clean Code Best Practices/Code/Before/MusicStore.Web/Controllers/ManageController.cs
13,459
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Version 4.5.0.0 www.ComponentFactory.com // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace ComponentFactory.Krypton.Design.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", "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 (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ComponentFactory.Krypton.Design.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; } } internal static System.Drawing.Bitmap add { get { object obj = ResourceManager.GetObject("add", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap arrow_down_blue { get { object obj = ResourceManager.GetObject("arrow_down_blue", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap arrow_up_blue { get { object obj = ResourceManager.GetObject("arrow_up_blue", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap delete2 { get { object obj = ResourceManager.GetObject("delete2", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap Empty16x16 { get { object obj = ResourceManager.GetObject("Empty16x16", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonBorderEdge { get { object obj = ResourceManager.GetObject("KryptonBorderEdge", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonBreadCrumb { get { object obj = ResourceManager.GetObject("KryptonBreadCrumb", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonBreadCrumbItem { get { object obj = ResourceManager.GetObject("KryptonBreadCrumbItem", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonButton { get { object obj = ResourceManager.GetObject("KryptonButton", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonButtonSpec { get { object obj = ResourceManager.GetObject("KryptonButtonSpec", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonCheckBox { get { object obj = ResourceManager.GetObject("KryptonCheckBox", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonCheckButton { get { object obj = ResourceManager.GetObject("KryptonCheckButton", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonCheckedListBox { get { object obj = ResourceManager.GetObject("KryptonCheckedListBox", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonCheckSet { get { object obj = ResourceManager.GetObject("KryptonCheckSet", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonColorButton { get { object obj = ResourceManager.GetObject("KryptonColorButton", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonComboBox { get { object obj = ResourceManager.GetObject("KryptonComboBox", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonCommand { get { object obj = ResourceManager.GetObject("KryptonCommand", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonContextMenu { get { object obj = ResourceManager.GetObject("KryptonContextMenu", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonContextMenuColorColumns { get { object obj = ResourceManager.GetObject("KryptonContextMenuColorColumns", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonContextMenuHeading { get { object obj = ResourceManager.GetObject("KryptonContextMenuHeading", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonContextMenuImageSelect { get { object obj = ResourceManager.GetObject("KryptonContextMenuImageSelect", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonContextMenuItem { get { object obj = ResourceManager.GetObject("KryptonContextMenuItem", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonContextMenuItems { get { object obj = ResourceManager.GetObject("KryptonContextMenuItems", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonContextMenuSeparator { get { object obj = ResourceManager.GetObject("KryptonContextMenuSeparator", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonDataGridView { get { object obj = ResourceManager.GetObject("KryptonDataGridView", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonDateTimePicker { get { object obj = ResourceManager.GetObject("KryptonDateTimePicker", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonDomainUpDown { get { object obj = ResourceManager.GetObject("KryptonDomainUpDown", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonDropButton { get { object obj = ResourceManager.GetObject("KryptonDropButton", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonForm { get { object obj = ResourceManager.GetObject("KryptonForm", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonGallery { get { object obj = ResourceManager.GetObject("KryptonGallery", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonGroup { get { object obj = ResourceManager.GetObject("KryptonGroup", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonGroupBox { get { object obj = ResourceManager.GetObject("KryptonGroupBox", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonGroupPanel { get { object obj = ResourceManager.GetObject("KryptonGroupPanel", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonHeader { get { object obj = ResourceManager.GetObject("KryptonHeader", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonHeaderGroup { get { object obj = ResourceManager.GetObject("KryptonHeaderGroup", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonLabel { get { object obj = ResourceManager.GetObject("KryptonLabel", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonLinkLabel { get { object obj = ResourceManager.GetObject("KryptonLinkLabel", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonListBox { get { object obj = ResourceManager.GetObject("KryptonListBox", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonManager { get { object obj = ResourceManager.GetObject("KryptonManager", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonMaskedTextBox { get { object obj = ResourceManager.GetObject("KryptonMaskedTextBox", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonMonthCalendar { get { object obj = ResourceManager.GetObject("KryptonMonthCalendar", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonNumericUpDown { get { object obj = ResourceManager.GetObject("KryptonNumericUpDown", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonPalette { get { object obj = ResourceManager.GetObject("KryptonPalette", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonPanel { get { object obj = ResourceManager.GetObject("KryptonPanel", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRadioButton { get { object obj = ResourceManager.GetObject("KryptonRadioButton", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonContext { get { object obj = ResourceManager.GetObject("KryptonRibbonContext", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroup { get { object obj = ResourceManager.GetObject("KryptonRibbonGroup", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupButton { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupButton", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupCheckBox { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupCheckBox", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupCluster { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupCluster", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupClusterButton { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupClusterButton", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupClusterColorButton { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupClusterColorButton", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupColorButton { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupColorButton", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupComboBox { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupComboBox", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupCustomControl { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupCustomControl", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupDateTimePicker { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupDateTimePicker", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupDomainUpDown { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupDomainUpDown", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupLabel { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupLabel", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupLines { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupLines", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupMaskedTextBox { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupMaskedTextBox", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupNumericUpDown { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupNumericUpDown", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupRadioButton { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupRadioButton", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupRichTextBox { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupRichTextBox", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupSeparator { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupSeparator", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupTextBox { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupTextBox", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupTrackBar { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupTrackBar", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonGroupTriple { get { object obj = ResourceManager.GetObject("KryptonRibbonGroupTriple", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonQATButton { get { object obj = ResourceManager.GetObject("KryptonRibbonQATButton", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonRecentDoc { get { object obj = ResourceManager.GetObject("KryptonRibbonRecentDoc", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRibbonTab { get { object obj = ResourceManager.GetObject("KryptonRibbonTab", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonRichTextBox { get { object obj = ResourceManager.GetObject("KryptonRichTextBox", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonSeparator { get { object obj = ResourceManager.GetObject("KryptonSeparator", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonSplitContainer { get { object obj = ResourceManager.GetObject("KryptonSplitContainer", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonTextBox { get { object obj = ResourceManager.GetObject("KryptonTextBox", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap KryptonWrapLabel { get { object obj = ResourceManager.GetObject("KryptonWrapLabel", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap MoveFirst { get { object obj = ResourceManager.GetObject("MoveFirst", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap MoveLast { get { object obj = ResourceManager.GetObject("MoveLast", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap MoveNext { get { object obj = ResourceManager.GetObject("MoveNext", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap MovePrevious { get { object obj = ResourceManager.GetObject("MovePrevious", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } } }
39.277147
197
0.564207
[ "BSD-3-Clause" ]
ALMMa/Krypton
Source/Krypton Components/ComponentFactory.Krypton.Design/Properties/Resources.Designer.cs
24,236
C#
using ServiceWerXBusiness; using System.Threading.Tasks; using System.Security.Claims; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Cors; namespace ServiceWerXAspNetCore { [ServiceFilter(typeof(ApiExceptionFilter))] [EnableCors("CorsPolicy")] public class AccountController : Controller { private AccountRepository accountRepo; public AccountController(AccountRepository actRepo) { accountRepo = actRepo; } [AllowAnonymous] [HttpPost] [Route("api/login")] public async Task<bool> Login([FromBody] User loginUser) { var user = await accountRepo.AuthenticateAndLoadUser(loginUser.Username, loginUser.Password); if (user == null) throw new ApiException("Invalid Login Credentials", 401); var identity = new ClaimsIdentity(CookieAuthenticationDefaults.AuthenticationScheme); identity.AddClaim(new Claim(ClaimTypes.Name, user.Username)) ; if (user.Fullname == null) user.Fullname = string.Empty; identity.AddClaim(new Claim("FullName", user.Fullname)); await HttpContext.Authentication.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(identity)); return true; } [AllowAnonymous] [HttpGet] [Route("api/logout")] public async Task<bool> Logout() { await HttpContext.Authentication.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); return true; } [HttpGet] [Route("api/isAuthenticated")] public bool IsAuthenthenticated() { return User.Identity.IsAuthenticated; } } }
31.421875
121
0.616609
[ "MIT" ]
jbryanmiller/ServiceWerX
src/ServiceWerXASPNetCore/Controllers/AccountController.cs
2,013
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable enable using System.Collections.Concurrent; using System.Collections.Immutable; using System.Composition; using System.Threading; using Microsoft.CodeAnalysis.CaseCorrection; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Text; namespace Microsoft.CodeAnalysis.CSharp.CaseCorrection { [ExportLanguageService(typeof(ICaseCorrectionService), LanguageNames.CSharp), Shared] internal class CSharpCaseCorrectionService : AbstractCaseCorrectionService { [ImportingConstructor] public CSharpCaseCorrectionService() { } protected override void AddReplacements( SemanticModel? semanticModel, SyntaxNode root, ImmutableArray<TextSpan> spans, Workspace workspace, ConcurrentDictionary<SyntaxToken, SyntaxToken> replacements, CancellationToken cancellationToken) { // C# doesn't support case correction since we are a case sensitive language. return; } } }
32.947368
89
0.718051
[ "Apache-2.0" ]
HenrikWM/roslyn
src/Workspaces/CSharp/Portable/CaseCorrection/CSharpCaseCorrectionService.cs
1,254
C#
using DotNetBay.Core.Execution; using DotNetBay.Data.Provider.FileStorage; using DotNetBay.Interfaces; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Configuration; using System.Data; using System.Linq; using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; using System.Windows; using System.Windows.Navigation; using DotNetBay.Core; using DotNetBay.Data.Entity; namespace DotNetBay.WPF { /// <summary> /// Interaction logic for App.xaml /// </summary> public partial class App : Application { public IMainRepository MainRepository { get; private set; } public IAuctionRunner AuctionRunner { get; private set; } public App() { this.MainRepository = new FileSystemMainRepository("appdata.json"); this.MainRepository.SaveChanges(); this.FillSampleData(); this.AuctionRunner = new AuctionRunner(this.MainRepository); this.AuctionRunner.Start(); } private void FillSampleData() { var memberService = new SimpleMemberService(this.MainRepository); var service = new AuctionService(this.MainRepository, memberService); if (!service.GetAll().Any()) { var me = memberService.GetCurrentMember(); service.Save(new Auction { Title = "My First Auction", StartDateTimeUtc = DateTime.UtcNow.AddSeconds(10), EndDateTimeUtc = DateTime.UtcNow.AddDays(14), StartPrice = 72, Seller = me }); } } } }
28.540984
81
0.61861
[ "MIT" ]
NevacFHNW/dotnetbay-hs18
source/DotNetBay.WPF/App.xaml.cs
1,741
C#
using System; using NUnit.Framework; using dexter_vs.Defects; using dexter_vs.Config; namespace dexter_vs.Analysis { [TestFixture] public class DexterTest { private Dexter dexter; [SetUp] public void Init() { var config = new Configuration() { dexterHome = "D:/Applications/dexter/0.9.2/dexter-cli_0.9.2_32/", projectName = "TestData", type = "PROJECT", sourceDir = { AppDomain.CurrentDomain.BaseDirectory + "../../TestData/SampleCppProject/" }, headerDir = { AppDomain.CurrentDomain.BaseDirectory + "../../TestData/SampleCppProject/" }, projectFullPath = AppDomain.CurrentDomain.BaseDirectory + "../../TestData/SampleCppProject/", dexterServerPort = "0", dexterServerIp = "dexter-server" }; dexter = new Dexter(config); } /// <summary> /// Analysis should gather list of defects /// </summary> [Test] public void TestAnalysis() { Result result = dexter.Analyse(); Assert.IsNotNull(result); Assert.IsNotNull(result.FileDefects); Assert.IsNotEmpty(result.FileDefects); } /// <summary> /// Dexter should inform about produced output /// </summary> [Test] public void TestStandardOuputput() { var dataReceived = false; dexter.OutputDataReceived += (s, e) => { Console.WriteLine(e.Data); dataReceived = true; }; dexter.Analyse(); Assert.IsTrue(dataReceived); } /// <summary> /// Dexter should inform about produced errors /// </summary> [Test] public void TestErrorOuputput() { var dataReceived = false; dexter.ErrorDataReceived += (s, e) => { Console.WriteLine(e.Data); dataReceived = true; }; dexter.Analyse(); Assert.IsTrue(dataReceived); } } }
29.985714
109
0.540257
[ "BSD-2-Clause" ]
marchpig/Dexter
project/dexter-vs/dexter-vs-tests/Analysis/DexterTest.cs
2,101
C#
/* * Copyright (c) Contributors, http://whitecore-sim.org/, http://aurora-sim.org, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the WhiteCore-Sim Project nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ using System.Collections.Generic; using OpenMetaverse; using WhiteCore.Framework.ClientInterfaces; using WhiteCore.Framework.DatabaseInterfaces; using WhiteCore.Framework.PresenceInfo; namespace WhiteCore.Framework.Modules { public delegate void NewGroupNotice(UUID groupID, UUID noticeID); public interface IGroupsModule { event NewGroupNotice OnNewGroupNotice; /// <summary> /// Sends a new notice out to all users in the sim /// </summary> /// <param name="remoteClient"></param> /// <param name="notice"></param> /// <param name="localOnly"></param> void SendGroupNoticeToUsers(IClientAPI remoteClient, GroupNoticeInfo notice, bool localOnly); /// <summary> /// Create a group /// </summary> /// <param name="remoteClient"></param> /// <param name="name"></param> /// <param name="charter"></param> /// <param name="showInList"></param> /// <param name="insigniaID"></param> /// <param name="membershipFee"></param> /// <param name="openEnrollment"></param> /// <param name="allowPublish"></param> /// <param name="maturePublish"></param> /// <returns>The UUID of the created group</returns> UUID CreateGroup( IClientAPI remoteClient, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish); /// <summary> /// Determines whether the specified groupID is actually a group. /// </summary> /// <returns><c>true</c> if the specified groupID is a group ; otherwise, <c>false</c>.</returns> /// <param name="groupID">Group UUID.</param> bool IsGroup (UUID groupID); /// <summary> /// Get a group /// </summary> /// <param name="name">Name of the group</param> /// <returns>The group's data. Null if there is no such group.</returns> GroupRecord GetGroupRecord(string name); /// <summary> /// Get a group /// </summary> /// <param name="GroupID">ID of the group</param> /// <returns>The group's data. Null if there is no such group.</returns> GroupRecord GetGroupRecord(UUID GroupID); /// <summary> /// Gets a list of all groups. /// </summary> /// <returns>A list of group UUIDs</returns> List <UUID> GetAllGroups ( UUID RequestingAgentID); List<GroupMembersData> GetGroupMembers (UUID requestingAgentID, UUID GroupID); void ActivateGroup(IClientAPI remoteClient, UUID groupID); List<GroupTitlesData> GroupTitlesRequest(IClientAPI remoteClient, UUID groupID); List<GroupMembersData> GroupMembersRequest(IClientAPI remoteClient, UUID groupID); List<GroupRolesData> GroupRoleDataRequest(IClientAPI remoteClient, UUID groupID); List<GroupRoleMembersData> GroupRoleMembersRequest(IClientAPI remoteClient, UUID groupID); GroupProfileData GroupProfileRequest(IClientAPI remoteClient, UUID groupID); GroupMembershipData[] GetMembershipData(UUID UserID); GroupMembershipData GetMembershipData(UUID GroupID, UUID UserID); void UpdateGroupInfo(IClientAPI remoteClient, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish); void SetGroupAcceptNotices(IClientAPI remoteClient, UUID groupID, bool acceptNotices, bool listInProfile); void GroupTitleUpdate(IClientAPI remoteClient, UUID GroupID, UUID TitleRoleID); GroupNoticeData[] GroupNoticesListRequest(IClientAPI remoteClient, UUID GroupID); string GetGroupTitle(UUID avatarID); void GroupRoleUpdate(IClientAPI remoteClient, UUID GroupID, UUID RoleID, string name, string description, string title, ulong powers, byte updateType); void GroupRoleChanges(IClientAPI remoteClient, UUID GroupID, UUID RoleID, UUID MemberID, uint changes); void GroupNoticeRequest(IClientAPI remoteClient, UUID groupNoticeID); GridInstantMessage CreateGroupNoticeIM(UUID agentID, GroupNoticeInfo info, byte dialog); void SendAgentGroupDataUpdate(IClientAPI remoteClient); void JoinGroupRequest(IClientAPI remoteClient, UUID GroupID); void LeaveGroupRequest(IClientAPI remoteClient, UUID GroupID); void EjectGroupMemberRequest(IClientAPI remoteClient, UUID GroupID, UUID EjecteeID); void EjectGroupMember(IClientAPI remoteClient, UUID agentID, UUID GroupID, UUID EjecteeID); void InviteGroup(IClientAPI remoteClient, UUID agentID, UUID GroupID, UUID InviteeID, UUID RoleID); void InviteGroupRequest(IClientAPI remoteClient, UUID GroupID, UUID InviteeID, UUID RoleID); void NotifyChange(UUID GroupID); bool GroupPermissionCheck(UUID AgentID, UUID GroupID, GroupPowers permissions); GridInstantMessage BuildOfflineGroupNotice(GridInstantMessage msg); void UpdateUsersForExternalRoleUpdate(UUID groupID, UUID roleID, UUID regionID); } }
53.075188
119
0.684375
[ "BSD-3-Clause" ]
WhiteCoreSim/WhiteCore-Dev
WhiteCore/Framework/Modules/IGroupsModule.cs
7,059
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("MVVMModalDialogDemo")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("MVVMModalDialogDemo")] [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.607143
98
0.711232
[ "MIT" ]
mwhite102/MVVMModalDialogDemo
MVVMModalDialogDemo/Properties/AssemblyInfo.cs
2,389
C#
#if UNITY_EDITOR || UNITY_EDITOR_BETA using System.Collections.Generic; using System.IO; using migrationtool.controllers; using migrationtool.models; using migrationtool.utility; using migrationtool.windows; using Newtonsoft.Json; using UnityEditor; using UnityEngine; namespace migrationtool.views { public class MappingView { private readonly Constants constants = Constants.Instance; private readonly MappingController mappingController = new MappingController(); public void MapAllClasses() { string oldIDs = EditorUtility.OpenFilePanel("Old IDs", constants.RootDirectory, "json"); if (string.IsNullOrEmpty(oldIDs)) { Debug.Log("No old ID path selected. Aborting the mapping."); return; } string newIDs = EditorUtility.OpenFilePanel("New IDs", constants.RootDirectory, "json"); if (string.IsNullOrEmpty(newIDs)) { Debug.Log("No new ID path selected. Aborting the mapping."); return; } MapAllClasses(oldIDs, newIDs); } /// <summary> /// Generate a mapping of all scriptMappings in a project. /// Which means it creates a mapping between versions. /// </summary> /// <param name="oldIDsPath"></param> /// <param name="newIDsPath"></param> /// <returns></returns> public void MapAllClasses(string oldIDsPath, string newIDsPath) { List<ClassModel> oldIDs = IDController.DeserializeIDs(oldIDsPath); List<ClassModel> newIDs = IDController.DeserializeIDs(newIDsPath); MapAllClasses(oldIDs, newIDs); } /// <summary> /// Generate a mapping of all scriptMappings in a project. /// Which means it creates a mapping between versions. /// </summary> /// <param name="oldIDs"></param> /// <param name="newIDs"></param> /// <returns></returns> public void MapAllClasses(List<ClassModel> oldIDs, List<ClassModel> newIDs) { ThreadUtility.RunTask(() => { MigrationWindow.DisplayProgressBar("starting migration export", "Mapping classes", 0.4f); mappingController.MapAllClasses(oldIDs, newIDs, mergedScriptMapping => { SaveScriptMappings(constants.RootDirectory, mergedScriptMapping); MigrationWindow.ClearProgressBar(); ThreadUtility.RunMainTask(() => { EditorUtility.DisplayDialog("Completed mapping", "Completed the mapping. Saved the mapping to: " + constants.RelativeScriptMappingPath, "Ok"); }); }); }); } public List<ScriptMapping> CombineMappings(string oldVersion, string newVersion, Dictionary<string, List<ScriptMapping>> allVersions) { List<ScriptMapping> newMapping = mappingController.CombineMappings(allVersions, oldVersion, newVersion); Debug.Log("Combined mappings of version " + oldVersion + " to " + newVersion); return newMapping; } /// <summary> /// Write scriptMappings to a file /// </summary> /// <param name="rootPath"></param> /// <param name="scriptMappings"></param> public void SaveScriptMappings(string rootPath, List<ScriptMapping> scriptMappings) { string scriptMappingsPath = rootPath + constants.RelativeScriptMappingPath; File.WriteAllText(scriptMappingsPath, JsonConvert.SerializeObject(scriptMappings, constants.IndentJson)); } public bool IsOldVersionHigher(string oldVersion, string newVersion) { return mappingController.IsOldVersionHigher(oldVersion, newVersion); } } } #endif
38.046729
118
0.593712
[ "MIT" ]
WouterVanmulken/Unity-Migration-Tool
Assets/MigrationTool/MigrationTool/MigrationTool/Views/MappingView.cs
4,073
C#
using NHSD.BuyingCatalogue.Solutions.Contracts; namespace NHSD.BuyingCatalogue.Solutions.API.ViewModels.Solution.Hosting { public sealed class OnPremiseSection { internal OnPremiseSection(IHosting hosting) => Answers = new OnPremiseSectionAnswers(hosting?.OnPremise); public OnPremiseSectionAnswers Answers { get; } public OnPremiseSection IfPopulated() => Answers.HasData ? this : null; } }
30.857143
113
0.74537
[ "MIT" ]
nhs-digital-gp-it-futures/BuyingCatalogueService
src/NHSD.BuyingCatalogue.Solutions.API/ViewModels/Solution/Hosting/OnPremiseSection.cs
434
C#
using Acme.BookStore.BackgroundJobs; using Acme.BookStore.EntityFrameworkCore; //using MahApps.Metro.Controls.Dialogs; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Auditing; using Volo.Abp.Autofac; using Volo.Abp.BackgroundJobs; using Volo.Abp.BackgroundWorkers; using Volo.Abp.Modularity; namespace Acme.BookStore.Wpf; [DependsOn(typeof(AbpAutofacModule), typeof(BookStoreApplicationModule), typeof(BookStoreEntityFrameworkCoreModule))] public class BookStoreWpfModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { Configure<AbpAuditingOptions>(options => options.IsEnabled = false); Configure<AbpBackgroundJobOptions>(options => options.IsJobExecutionEnabled = BackgroundJobConsts.IsEnabled); Configure<AbpBackgroundWorkerOptions>(options => options.IsEnabled = BackgroundJobConsts.IsEnabled); } }
36.4
117
0.803297
[ "MIT" ]
kfrancis/abp-wpf
src/Acme.BookStore.Wpf/BookStoreWpfModule.cs
910
C#
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; namespace JN.Services.CustomException { public class CustomException : ApplicationException { //记录异常的类型 private CustomExceptionType exceptionType; public CustomException(CustomExceptionType type) : base() { this.exceptionType = type; } public CustomException(CustomExceptionType type, string message) : base(message) { this.exceptionType = type; } public CustomException(string message) : base(message) { this.exceptionType = CustomExceptionType.InputValidation; } //序列化 public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); } //重写message方法,以让它显示相应异常提示信息 public override string Message { get { //根据异常类型从message.xml中读取相应异常提示信息 return Resource.ResourceProvider.R(base.Message); //return string.Format(XmlMessageManager.GetXmlMessage((int)exceptionType), base.Message); } } } public enum CustomExceptionType { InputValidation = 1, hint = 2, Warning = 3, Unknown = 8 } }
25.625
106
0.61115
[ "MIT" ]
fisherLB/NX1222
www/JN.Services/CustomException/CustomException.cs
1,527
C#
using System; using System.Linq; using System.Collections.Generic; namespace QuickSort { public class Quick { static void Main() { //* //Implementation Quick Sort algorithm numbers in Array!!! //* int[] arr = Console.ReadLine().Split().Select(int.Parse).ToArray(); QuickSort(arr, 0, arr.Length - 1); Console.WriteLine(String.Join(" ", arr)); } private static void QuickSort(int[] arr, int start, int end) { if (start >= end) return; if (isSorted(arr)) return; int i = Partition(arr, start, end); QuickSort(arr, start, i - 1); QuickSort(arr, i + 1, end); } private static bool isSorted(int[] arr) { bool isSort = true; for (int i = 0; i < arr.Length - 1; i++) { int el = arr[i]; if (el > arr[i + 1]) { isSort = false; break; } } return isSort; } private static int Partition(int[] arr, int start, int end) { if (start >= end) return start; int index = start - 1; int lastNumber = arr[end]; for (int g = start; g <= end - 1; g++) { int currElement = arr[g]; if (currElement <= lastNumber) { index++; arr[g] = arr[index]; arr[index] = currElement; } } //Swap first element with last! arr = Swap(arr, index + 1, end); return index + 1; } private static int[] Swap(int[] arr, int start, int end) { int temp = arr[start]; arr[start] = arr[end]; arr[end] = temp; return arr; } } }
24.345238
79
0.409291
[ "MIT" ]
PavelRunchev/Dot.Net-Advanced
C# Advanced/15. Basic Algorithms/6. Quick Sort/Quick.cs
2,047
C#