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 Timetabling.Internal.Specialized; namespace Timetabling.Internal.Constraints { public class DifferentRoom : RoomConstraint { public DifferentRoom(int id, bool required, int penalty, int[] classes) : base(id, required, penalty, classes) { } protected override (int hardPenalty, int softPenalty) Evaluate(Problem problem, Room[] configuration) { var penalty = 0; for (var i = 0; i < Classes.Length - 1; i++) { var ci = configuration[i]; for (var j = i + 1; j < Classes.Length; j++) { var cj = configuration[j]; if (ci != cj) { continue; } penalty++; } } return Required ? (penalty, 0) : (0, Penalty * penalty); } } }
28.794118
110
0.444331
[ "MIT" ]
adrianymeri/itc-2019
src/Timetabling.Internal/Constraints/DifferentRoom.cs
981
C#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Screens; using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API; using osu.Game.Scoring; using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Play; using osu.Game.Screens.Ranking.Statistics; using osuTK; namespace osu.Game.Screens.Ranking { public abstract class ResultsScreen : OsuScreen { protected const float BACKGROUND_BLUR = 20; private static readonly float screen_height = 768 - TwoLayerButton.SIZE_EXTENDED.Y; public override bool DisallowExternalBeatmapRulesetChanges => true; // Temporary for now to stop dual transitions. Should respect the current toolbar mode, but there's no way to do so currently. public override bool HideOverlaysOnEnter => true; protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap.Value); public readonly Bindable<ScoreInfo> SelectedScore = new Bindable<ScoreInfo>(); public readonly ScoreInfo Score; private readonly bool allowRetry; [Resolved(CanBeNull = true)] private Player player { get; set; } [Resolved] private IAPIProvider api { get; set; } private StatisticsPanel statisticsPanel; private Drawable bottomPanel; private ScorePanelList scorePanelList; private Container<ScorePanel> detachedPanelContainer; protected ResultsScreen(ScoreInfo score, bool allowRetry = true) { Score = score; this.allowRetry = allowRetry; SelectedScore.Value = score; } [BackgroundDependencyLoader] private void load() { FillFlowContainer buttons; InternalChild = new GridContainer { RelativeSizeAxes = Axes.Both, Content = new[] { new Drawable[] { new VerticalScrollContainer { RelativeSizeAxes = Axes.Both, ScrollbarVisible = false, Child = new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { statisticsPanel = new StatisticsPanel { RelativeSizeAxes = Axes.Both, Score = { BindTarget = SelectedScore } }, scorePanelList = new ScorePanelList { RelativeSizeAxes = Axes.Both, SelectedScore = { BindTarget = SelectedScore }, PostExpandAction = () => statisticsPanel.ToggleVisibility() }, detachedPanelContainer = new Container<ScorePanel> { RelativeSizeAxes = Axes.Both }, } } }, }, new[] { bottomPanel = new Container { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, RelativeSizeAxes = Axes.X, Height = TwoLayerButton.SIZE_EXTENDED.Y, Alpha = 0, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4Extensions.FromHex("#333") }, buttons = new FillFlowContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, AutoSizeAxes = Axes.Both, Spacing = new Vector2(5), Direction = FillDirection.Horizontal, Children = new Drawable[] { new ReplayDownloadButton(null) { Score = { BindTarget = SelectedScore }, Width = 300 }, } } } } } }, RowDimensions = new[] { new Dimension(), new Dimension(GridSizeMode.AutoSize) } }; if (Score != null) scorePanelList.AddScore(Score); if (player != null && allowRetry) { buttons.Add(new RetryButton { Width = 300 }); AddInternal(new HotkeyRetryOverlay { Action = () => { if (!this.IsCurrentScreen()) return; player?.Restart(); }, }); } } protected override void LoadComplete() { base.LoadComplete(); var req = FetchScores(scores => Schedule(() => { foreach (var s in scores) addScore(s); })); if (req != null) api.Queue(req); statisticsPanel.State.BindValueChanged(onStatisticsStateChanged, true); } /// <summary> /// Performs a fetch/refresh of scores to be displayed. /// </summary> /// <param name="scoresCallback">A callback which should be called when fetching is completed. Scheduling is not required.</param> /// <returns>An <see cref="APIRequest"/> responsible for the fetch operation. This will be queued and performed automatically.</returns> protected virtual APIRequest FetchScores(Action<IEnumerable<ScoreInfo>> scoresCallback) => null; public override void OnEntering(IScreen last) { base.OnEntering(last); ((BackgroundScreenBeatmap)Background).BlurAmount.Value = BACKGROUND_BLUR; Background.FadeTo(0.5f, 250); bottomPanel.FadeTo(1, 250); } public override bool OnExiting(IScreen next) { if (statisticsPanel.State.Value == Visibility.Visible) { statisticsPanel.Hide(); return true; } Background.FadeTo(1, 250); return base.OnExiting(next); } private void addScore(ScoreInfo score) { var panel = scorePanelList.AddScore(score); if (detachedPanel != null) panel.Alpha = 0; } private ScorePanel detachedPanel; private void onStatisticsStateChanged(ValueChangedEvent<Visibility> state) { if (state.NewValue == Visibility.Visible) { // Detach the panel in its original location, and move into the desired location in the local container. var expandedPanel = scorePanelList.GetPanelForScore(SelectedScore.Value); var screenSpacePos = expandedPanel.ScreenSpaceDrawQuad.TopLeft; // Detach and move into the local container. scorePanelList.Detach(expandedPanel); detachedPanelContainer.Add(expandedPanel); // Move into its original location in the local container first, then to the final location. var origLocation = detachedPanelContainer.ToLocalSpace(screenSpacePos); expandedPanel.MoveTo(origLocation) .Then() .MoveTo(new Vector2(StatisticsPanel.SIDE_PADDING, origLocation.Y), 150, Easing.OutQuint); // Hide contracted panels. foreach (var contracted in scorePanelList.GetScorePanels().Where(p => p.State == PanelState.Contracted)) contracted.FadeOut(150, Easing.OutQuint); scorePanelList.HandleInput = false; // Dim background. Background.FadeTo(0.1f, 150); detachedPanel = expandedPanel; } else if (detachedPanel != null) { var screenSpacePos = detachedPanel.ScreenSpaceDrawQuad.TopLeft; // Remove from the local container and re-attach. detachedPanelContainer.Remove(detachedPanel); scorePanelList.Attach(detachedPanel); // Move into its original location in the attached container first, then to the final location. var origLocation = detachedPanel.Parent.ToLocalSpace(screenSpacePos); detachedPanel.MoveTo(origLocation) .Then() .MoveTo(new Vector2(0, origLocation.Y), 150, Easing.OutQuint); // Show contracted panels. foreach (var contracted in scorePanelList.GetScorePanels().Where(p => p.State == PanelState.Contracted)) contracted.FadeIn(150, Easing.OutQuint); scorePanelList.HandleInput = true; // Un-dim background. Background.FadeTo(0.5f, 150); detachedPanel = null; } } private class VerticalScrollContainer : OsuScrollContainer { protected override Container<Drawable> Content => content; private readonly Container content; public VerticalScrollContainer() { base.Content.Add(content = new Container { RelativeSizeAxes = Axes.X }); } protected override void Update() { base.Update(); content.Height = Math.Max(screen_height, DrawHeight); } } } }
39.205479
145
0.480521
[ "MIT" ]
LastExceed/osu
osu.Game/Screens/Ranking/ResultsScreen.cs
11,157
C#
using System.Collections.Generic; using Essensoft.Paylink.Alipay.Response; namespace Essensoft.Paylink.Alipay.Request { /// <summary> /// alipay.social.forest.tree.query /// </summary> public class AlipaySocialForestTreeQueryRequest : IAlipayRequest<AlipaySocialForestTreeQueryResponse> { /// <summary> /// 用户种植树统计信息查询 /// </summary> public string BizContent { get; set; } #region IAlipayRequest Members private bool needEncrypt = false; private string apiVersion = "1.0"; private string terminalType; private string terminalInfo; private string prodCode; private string notifyUrl; private string returnUrl; private AlipayObject bizModel; private Dictionary<string, string> udfParams; //add user-defined text parameters public void SetNeedEncrypt(bool needEncrypt) { this.needEncrypt = needEncrypt; } public bool GetNeedEncrypt() { return needEncrypt; } public void SetNotifyUrl(string notifyUrl) { this.notifyUrl = notifyUrl; } public string GetNotifyUrl() { return notifyUrl; } public void SetReturnUrl(string returnUrl) { this.returnUrl = returnUrl; } public string GetReturnUrl() { return returnUrl; } public void SetTerminalType(string terminalType) { this.terminalType = terminalType; } public string GetTerminalType() { return terminalType; } public void SetTerminalInfo(string terminalInfo) { this.terminalInfo = terminalInfo; } public string GetTerminalInfo() { return terminalInfo; } public void SetProdCode(string prodCode) { this.prodCode = prodCode; } public string GetProdCode() { return prodCode; } public string GetApiName() { return "alipay.social.forest.tree.query"; } public void SetApiVersion(string apiVersion) { this.apiVersion = apiVersion; } public string GetApiVersion() { return apiVersion; } public void PutOtherTextParam(string key, string value) { if (udfParams == null) { udfParams = new Dictionary<string, string>(); } udfParams.Add(key, value); } public IDictionary<string, string> GetParameters() { var parameters = new AlipayDictionary { { "biz_content", BizContent } }; if (udfParams != null) { parameters.AddAll(udfParams); } return parameters; } public AlipayObject GetBizModel() { return bizModel; } public void SetBizModel(AlipayObject bizModel) { this.bizModel = bizModel; } #endregion } }
23.463768
105
0.537986
[ "MIT" ]
Frunck8206/payment
src/Essensoft.Paylink.Alipay/Request/AlipaySocialForestTreeQueryRequest.cs
3,262
C#
// ReSharper disable once CheckNamespace namespace NClient.Annotations { public class PartialUpdateOperationAttribute : OperationAttribute, IPartialUpdateOperationAttribute { public PartialUpdateOperationAttribute(string? path = null) : base(path) { } } }
24.5
103
0.721088
[ "Apache-2.0" ]
nclient/NClient
src/NClient/NClient.Annotations/Operations/PartialUpdateOperationAttribute.cs
296
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("SquirrelNet31")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SquirrelNet31")] [assembly: AssemblyCopyright("Copyright © 2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("a407b604-a24c-4113-9cac-f16538126b7f")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
37.675676
84
0.748207
[ "Unlicense" ]
cartman300/Squirrel.NET
SquirrelNet31/Properties/AssemblyInfo.cs
1,397
C#
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("07. Rabbit Hole")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("07. Rabbit Hole")] [assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("df8e855e-7ad8-481c-9521-a22ab4a2a594")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
37.75
84
0.740986
[ "MIT" ]
pirocorp/CSharp-Fundamentals
08. Array and List Algorithms - Exercises/07. Rabbit Hole/Properties/AssemblyInfo.cs
1,362
C#
using System; using System.IO; using GameEngine.Data.Entities.Core; using GameEngine.Data.Tiles; using General.Common; using General.Encoding; namespace MapEditor.Data { public class GameBuilder { public static GameBuilder Instance { get { return Static<GameBuilder>.Value; } } public void BuildGame(Project project, string loc) { FileStream stream = File.OpenWrite(loc); BinaryOutput output = new BinaryOutput(stream); output.Write(project.World.TilesetContainer.Count); foreach (Tileset t in project.World.TilesetContainer) { output.Write(t); } output.Write(project.World.EntityContainer.All().Count); foreach (EntityTemplate e in project.World.EntityContainer.All()) { output.Write(e); } } } }
23.40625
70
0.732977
[ "MIT" ]
oxysoft/PokeSharp
src/MapEditor.Data/GameBuilder.cs
751
C#
using System.Threading.Tasks; namespace SmartProfil.Services.Interfaces { public interface IFeedbacksService { Task SetRatingAsync(int productId, string userId, int rating); double GetAverageRating(int productId); } }
22.545455
70
0.725806
[ "MIT" ]
dimitarkolev00/SmartProfil
SmartProfil/Services/Interfaces/IFeedbacksService.cs
250
C#
// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Generated code. DO NOT EDIT! namespace Google.Cloud.PubSub.V1.Snippets { using Google.Cloud.PubSub.V1; using System.Threading.Tasks; public sealed partial class GeneratedSchemaServiceClientStandaloneSnippets { /// <summary>Snippet for GetSchemaAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task GetSchemaResourceNamesAsync() { // Create client SchemaServiceClient schemaServiceClient = await SchemaServiceClient.CreateAsync(); // Initialize request argument(s) SchemaName name = SchemaName.FromProjectSchema("[PROJECT]", "[SCHEMA]"); // Make the request Schema response = await schemaServiceClient.GetSchemaAsync(name); } } }
38.3
94
0.691906
[ "Apache-2.0" ]
googleapis/googleapis-gen
google/pubsub/v1/google-cloud-pubsub-v1-csharp/Google.Cloud.PubSub.V1.StandaloneSnippets/SchemaServiceClient.GetSchemaResourceNamesAsyncSnippet.g.cs
1,532
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using Xunit; namespace Microsoft.AspNetCore.Razor.Language.CodeGeneration { public class CSharpCodeWriterTest { // The length of the newline string written by writer.WriteLine. private static readonly int WriterNewLineLength = Environment.NewLine.Length; public static IEnumerable<object[]> NewLines { get { return new object[][] { new object[] { "\r" }, new object[] { "\n" }, new object[] { "\r\n" }, }; } } [Fact] public void CSharpCodeWriter_TracksPosition_WithWrite() { // Arrange var writer = new CodeWriter(); // Act writer.Write("1234"); // Assert var location = writer.Location; var expected = new SourceLocation(absoluteIndex: 4, lineIndex: 0, characterIndex: 4); Assert.Equal(expected, location); } [Fact] public void CSharpCodeWriter_TracksPosition_WithIndent() { // Arrange var writer = new CodeWriter(); // Act writer.WriteLine(); writer.Indent(size: 3); // Assert var location = writer.Location; var expected = new SourceLocation( absoluteIndex: 3 + WriterNewLineLength, lineIndex: 1, characterIndex: 3 ); Assert.Equal(expected, location); } [Fact] public void CSharpCodeWriter_TracksPosition_WithWriteLine() { // Arrange var writer = new CodeWriter(); // Act writer.WriteLine("1234"); // Assert var location = writer.Location; var expected = new SourceLocation( absoluteIndex: 4 + WriterNewLineLength, lineIndex: 1, characterIndex: 0 ); Assert.Equal(expected, location); } [Theory] [MemberData(nameof(NewLines))] public void CSharpCodeWriter_TracksPosition_WithWriteLine_WithNewLineInContent( string newLine ) { // Arrange var writer = new CodeWriter(); // Act writer.WriteLine("1234" + newLine + "12"); // Assert var location = writer.Location; var expected = new SourceLocation( absoluteIndex: 6 + newLine.Length + WriterNewLineLength, lineIndex: 2, characterIndex: 0 ); Assert.Equal(expected, location); } [Theory] [MemberData(nameof(NewLines))] public void CSharpCodeWriter_TracksPosition_WithWrite_WithNewlineInContent(string newLine) { // Arrange var writer = new CodeWriter(); // Act writer.Write("1234" + newLine + "123" + newLine + "12"); // Assert var location = writer.Location; var expected = new SourceLocation( absoluteIndex: 9 + newLine.Length + newLine.Length, lineIndex: 2, characterIndex: 2 ); Assert.Equal(expected, location); } [Fact] public void CSharpCodeWriter_TracksPosition_WithWrite_WithNewlineInContent_RepeatedN() { // Arrange var writer = new CodeWriter(); // Act writer.Write("1234\n\n123"); // Assert var location = writer.Location; var expected = new SourceLocation(absoluteIndex: 9, lineIndex: 2, characterIndex: 3); Assert.Equal(expected, location); } [Fact] public void CSharpCodeWriter_TracksPosition_WithWrite_WithMixedNewlineInContent() { // Arrange var writer = new CodeWriter(); // Act writer.Write("1234\r123\r\n12\n1"); // Assert var location = writer.Location; var expected = new SourceLocation(absoluteIndex: 14, lineIndex: 3, characterIndex: 1); Assert.Equal(expected, location); } [Fact] public void CSharpCodeWriter_TracksPosition_WithNewline_SplitAcrossWrites() { // Arrange var writer = new CodeWriter(); // Act writer.Write("1234\r"); var location1 = writer.Location; writer.Write("\n"); var location2 = writer.Location; // Assert var expected1 = new SourceLocation(absoluteIndex: 5, lineIndex: 1, characterIndex: 0); Assert.Equal(expected1, location1); var expected2 = new SourceLocation(absoluteIndex: 6, lineIndex: 1, characterIndex: 0); Assert.Equal(expected2, location2); } [Fact] public void CSharpCodeWriter_TracksPosition_WithTwoNewline_SplitAcrossWrites_R() { // Arrange var writer = new CodeWriter(); // Act writer.Write("1234\r"); var location1 = writer.Location; writer.Write("\r"); var location2 = writer.Location; // Assert var expected1 = new SourceLocation(absoluteIndex: 5, lineIndex: 1, characterIndex: 0); Assert.Equal(expected1, location1); var expected2 = new SourceLocation(absoluteIndex: 6, lineIndex: 2, characterIndex: 0); Assert.Equal(expected2, location2); } [Fact] public void CSharpCodeWriter_TracksPosition_WithTwoNewline_SplitAcrossWrites_N() { // Arrange var writer = new CodeWriter(); // Act writer.Write("1234\n"); var location1 = writer.Location; writer.Write("\n"); var location2 = writer.Location; // Assert var expected1 = new SourceLocation(absoluteIndex: 5, lineIndex: 1, characterIndex: 0); Assert.Equal(expected1, location1); var expected2 = new SourceLocation(absoluteIndex: 6, lineIndex: 2, characterIndex: 0); Assert.Equal(expected2, location2); } [Fact] public void CSharpCodeWriter_TracksPosition_WithTwoNewline_SplitAcrossWrites_Reversed() { // Arrange var writer = new CodeWriter(); // Act writer.Write("1234\n"); var location1 = writer.Location; writer.Write("\r"); var location2 = writer.Location; // Assert var expected1 = new SourceLocation(absoluteIndex: 5, lineIndex: 1, characterIndex: 0); Assert.Equal(expected1, location1); var expected2 = new SourceLocation(absoluteIndex: 6, lineIndex: 2, characterIndex: 0); Assert.Equal(expected2, location2); } [Fact] public void CSharpCodeWriter_TracksPosition_WithNewline_SplitAcrossWrites_AtBeginning() { // Arrange var writer = new CodeWriter(); // Act writer.Write("\r"); var location1 = writer.Location; writer.Write("\n"); var location2 = writer.Location; // Assert var expected1 = new SourceLocation(absoluteIndex: 1, lineIndex: 1, characterIndex: 0); Assert.Equal(expected1, location1); var expected2 = new SourceLocation(absoluteIndex: 2, lineIndex: 1, characterIndex: 0); Assert.Equal(expected2, location2); } [Fact] public void WriteLineNumberDirective_UsesFilePath_FromSourceLocation() { // Arrange var filePath = "some-path"; var mappingLocation = new SourceSpan(filePath, 10, 4, 3, 9); var writer = new CodeWriter(); var expected = $"#line 5 \"{filePath}\"" + writer.NewLine; // Act writer.WriteLineNumberDirective(mappingLocation); var code = writer.GenerateCode(); // Assert Assert.Equal(expected, code); } [Fact] public void WriteField_WritesFieldDeclaration() { // Arrange var writer = new CodeWriter(); // Act writer.WriteField( Array.Empty<string>(), new[] { "private" }, "global::System.String", "_myString" ); // Assert var output = writer.GenerateCode(); Assert.Equal("private global::System.String _myString;" + Environment.NewLine, output); } [Fact] public void WriteField_WithModifiers_WritesFieldDeclaration() { // Arrange var writer = new CodeWriter(); // Act writer.WriteField( Array.Empty<string>(), new[] { "private", "readonly", "static" }, "global::System.String", "_myString" ); // Assert var output = writer.GenerateCode(); Assert.Equal( "private readonly static global::System.String _myString;" + Environment.NewLine, output ); } [Fact] public void WriteField_WithModifiersAndSupressions_WritesFieldDeclaration() { // Arrange var writer = new CodeWriter(); // Act writer.WriteField( new[] { "0001", "0002", }, new[] { "private", "readonly", "static" }, "global::System.String", "_myString" ); // Assert var output = writer.GenerateCode(); Assert.Equal( "#pragma warning disable 0001" + Environment.NewLine + "#pragma warning disable 0002" + Environment.NewLine + "private readonly static global::System.String _myString;" + Environment.NewLine + "#pragma warning restore 0002" + Environment.NewLine + "#pragma warning restore 0001" + Environment.NewLine, output ); } [Fact] public void WriteAutoPropertyDeclaration_WritesPropertyDeclaration() { // Arrange var writer = new CodeWriter(); // Act writer.WriteAutoPropertyDeclaration( new[] { "public" }, "global::System.String", "MyString" ); // Assert var output = writer.GenerateCode(); Assert.Equal( "public global::System.String MyString { get; set; }" + Environment.NewLine, output ); } [Fact] public void WriteAutoPropertyDeclaration_WithModifiers_WritesPropertyDeclaration() { // Arrange var writer = new CodeWriter(); // Act writer.WriteAutoPropertyDeclaration( new[] { "public", "static" }, "global::System.String", "MyString" ); // Assert var output = writer.GenerateCode(); Assert.Equal( "public static global::System.String MyString { get; set; }" + Environment.NewLine, output ); } [Fact] public void CSharpCodeWriter_RespectTabSetting() { // Arrange var options = RazorCodeGenerationOptions.Create( o => { o.IndentWithTabs = true; o.IndentSize = 4; } ); var writer = new CodeWriter(Environment.NewLine, options); // Act writer.BuildClassDeclaration( Array.Empty<string>(), "C", "", Array.Empty<string>(), Array.Empty<string>() ); writer.WriteField(Array.Empty<string>(), Array.Empty<string>(), "int", "f"); // Assert var output = writer.GenerateCode(); Assert.Equal( "class C" + Environment.NewLine + "{" + Environment.NewLine + "\tint f;" + Environment.NewLine, output ); } [Fact] public void CSharpCodeWriter_RespectSpaceSetting() { // Arrange var options = RazorCodeGenerationOptions.Create( o => { o.IndentWithTabs = false; o.IndentSize = 4; } ); var writer = new CodeWriter(Environment.NewLine, options); // Act writer.BuildClassDeclaration( Array.Empty<string>(), "C", "", Array.Empty<string>(), Array.Empty<string>() ); writer.WriteField(Array.Empty<string>(), Array.Empty<string>(), "int", "f"); // Assert var output = writer.GenerateCode(); Assert.Equal( "class C" + Environment.NewLine + "{" + Environment.NewLine + " int f;" + Environment.NewLine, output ); } } }
29.686192
111
0.500846
[ "Apache-2.0" ]
belav/aspnetcore
src/Razor/Microsoft.AspNetCore.Razor.Language/test/CodeGeneration/CSharpCodeWriterTest.cs
14,190
C#
namespace FantasyCritic.MySQL.Entities; internal class MasterGameYearEntity { public MasterGameYearEntity() { } public MasterGameYearEntity(MasterGameCalculatedStats masterGameStats) { MasterGameID = masterGameStats.MasterGame.MasterGameID; Year = masterGameStats.Year; GameName = masterGameStats.MasterGame.GameName; EstimatedReleaseDate = masterGameStats.MasterGame.EstimatedReleaseDate; MinimumReleaseDate = masterGameStats.MasterGame.MinimumReleaseDate.ToDateTimeUnspecified(); MaximumReleaseDate = masterGameStats.MasterGame.MaximumReleaseDate?.ToDateTimeUnspecified(); EarlyAccessReleaseDate = masterGameStats.MasterGame.EarlyAccessReleaseDate?.ToDateTimeUnspecified(); InternationalReleaseDate = masterGameStats.MasterGame.InternationalReleaseDate?.ToDateTimeUnspecified(); AnnouncementDate = masterGameStats.MasterGame.AnnouncementDate?.ToDateTimeUnspecified(); ReleaseDate = masterGameStats.MasterGame.ReleaseDate?.ToDateTimeUnspecified(); OpenCriticID = masterGameStats.MasterGame.OpenCriticID; GGToken = masterGameStats.MasterGame.GGToken; CriticScore = masterGameStats.MasterGame.CriticScore; Notes = masterGameStats.MasterGame.Notes; BoxartFileName = masterGameStats.MasterGame.BoxartFileName; GGCoverArtFileName = masterGameStats.MasterGame.GGCoverArtFileName; EligibilityChanged = masterGameStats.MasterGame.EligibilityChanged; DelayContention = masterGameStats.MasterGame.DelayContention; FirstCriticScoreTimestamp = masterGameStats.MasterGame.FirstCriticScoreTimestamp?.ToDateTimeUtc(); PercentStandardGame = masterGameStats.PercentStandardGame; PercentCounterPick = masterGameStats.PercentCounterPick; EligiblePercentStandardGame = masterGameStats.EligiblePercentStandardGame; AdjustedPercentCounterPick = masterGameStats.AdjustedPercentCounterPick; NumberOfBids = masterGameStats.NumberOfBids; TotalBidAmount = masterGameStats.TotalBidAmount; BidPercentile = masterGameStats.BidPercentile; AverageDraftPosition = masterGameStats.AverageDraftPosition; AverageWinningBid = masterGameStats.AverageWinningBid; HypeFactor = masterGameStats.HypeFactor; DateAdjustedHypeFactor = masterGameStats.DateAdjustedHypeFactor; PeakHypeFactor = masterGameStats.PeakHypeFactor; LinearRegressionHypeFactor = masterGameStats.LinearRegressionHypeFactor; AddedTimestamp = masterGameStats.MasterGame.AddedTimestamp.ToDateTimeUtc(); } public Guid MasterGameID { get; set; } public int Year { get; set; } public string GameName { get; set; } = null!; public string EstimatedReleaseDate { get; set; } = null!; public DateTime MinimumReleaseDate { get; set; } public DateTime? MaximumReleaseDate { get; set; } public DateTime? EarlyAccessReleaseDate { get; set; } public DateTime? InternationalReleaseDate { get; set; } public DateTime? AnnouncementDate { get; set; } public DateTime? ReleaseDate { get; set; } public int? OpenCriticID { get; set; } public string? GGToken { get; set; } public decimal? CriticScore { get; set; } public string? Notes { get; set; } public string? BoxartFileName { get; set; } public string? GGCoverArtFileName { get; set; } public bool EligibilityChanged { get; set; } public bool DelayContention { get; set; } public DateTimeOffset? FirstCriticScoreTimestamp { get; set; } public double PercentStandardGame { get; set; } public double PercentCounterPick { get; set; } public double EligiblePercentStandardGame { get; set; } public double? AdjustedPercentCounterPick { get; set; } public int NumberOfBids { get; set; } public int TotalBidAmount { get; set; } public double BidPercentile { get; set; } public double? AverageDraftPosition { get; set; } public double? AverageWinningBid { get; set; } public double HypeFactor { get; set; } public double DateAdjustedHypeFactor { get; set; } public double PeakHypeFactor { get; set; } public double LinearRegressionHypeFactor { get; set; } public DateTime AddedTimestamp { get; set; } public MasterGameYear ToDomain(IEnumerable<MasterSubGame> subGames, int year, IEnumerable<MasterGameTag> tags) { LocalDate? releaseDate = null; if (ReleaseDate.HasValue) { releaseDate = LocalDate.FromDateTime(ReleaseDate.Value); } LocalDate? maximumReleaseDate = null; if (MaximumReleaseDate.HasValue) { maximumReleaseDate = LocalDate.FromDateTime(MaximumReleaseDate.Value); } LocalDate? earlyAccessReleaseDate = null; if (EarlyAccessReleaseDate.HasValue) { earlyAccessReleaseDate = LocalDate.FromDateTime(EarlyAccessReleaseDate.Value); } LocalDate? internationalReleaseDate = null; if (InternationalReleaseDate.HasValue) { internationalReleaseDate = LocalDate.FromDateTime(InternationalReleaseDate.Value); } LocalDate? announcementDate = null; if (AnnouncementDate.HasValue) { announcementDate = LocalDate.FromDateTime(AnnouncementDate.Value); } Instant? firstCriticScoreTimestamp = null; if (FirstCriticScoreTimestamp.HasValue) { firstCriticScoreTimestamp = Instant.FromDateTimeOffset(FirstCriticScoreTimestamp.Value); } var addedTimestamp = LocalDateTime.FromDateTime(AddedTimestamp).InZoneStrictly(DateTimeZone.Utc).ToInstant(); var masterGame = new MasterGame(MasterGameID, GameName, EstimatedReleaseDate, LocalDate.FromDateTime(MinimumReleaseDate), maximumReleaseDate, earlyAccessReleaseDate, internationalReleaseDate, announcementDate, releaseDate, OpenCriticID, GGToken, CriticScore, Notes, BoxartFileName, GGCoverArtFileName, firstCriticScoreTimestamp, false, false, EligibilityChanged, DelayContention, addedTimestamp, subGames, tags); return new MasterGameYear(masterGame, year, PercentStandardGame, PercentCounterPick, EligiblePercentStandardGame, AdjustedPercentCounterPick, NumberOfBids, TotalBidAmount, BidPercentile, AverageDraftPosition, AverageWinningBid, HypeFactor, DateAdjustedHypeFactor, PeakHypeFactor, LinearRegressionHypeFactor); } }
50.178295
217
0.73768
[ "MIT" ]
shawnwildermuth/FantasyCritic
src/FantasyCritic.MySQL/Entities/MasterGameYearEntity.cs
6,473
C#
/////////////////////////////////////////////////////////////////////////////////////////////// // // This File is Part of the CallButler Open Source PBX (http://www.codeplex.com/callbutler // // Copyright (c) 2005-2008, Jim Heising // All rights reserved. // // 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 Jim Heising 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR 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; using System.Collections.Generic; using System.Text; using System.IO; using System.Reflection; namespace Utilities.PluginManagement { public class PluginEventArgs : EventArgs { public object Plugin; public bool Cancel = false; public PluginEventArgs(object plugin) { this.Plugin = plugin; } } public class PluginManager { public event EventHandler<PluginEventArgs> PluginLoaded; private List<Type> pluginTypes; private List<object> plugins; public PluginManager() { pluginTypes = new List<Type>(); plugins = new List<object>(); } public void LoadPlugins(string pluginDirectory, string filter, bool useSubDirectories, params Type[] pluginTypes) { UnloadPlugins(); // Load all of the plugins in our plugin directory if (Directory.Exists(pluginDirectory)) { SearchOption so = SearchOption.TopDirectoryOnly; if(useSubDirectories) so = SearchOption.AllDirectories; string[] pluginFiles = Directory.GetFiles(pluginDirectory, filter, so); foreach (string pluginFile in pluginFiles) { try { Assembly asm = Assembly.LoadFile(pluginFile); // Loop though all the types in this assembly and get any CallButlerServicePlugin types Type[] loadedTypes = asm.GetTypes(); foreach (Type pluginType in loadedTypes) { if(IsPluginOfType(pluginType, pluginTypes)) { // Create our plugin object object plugin = Activator.CreateInstance(pluginType); PluginEventArgs pluginEventArgs = new PluginEventArgs(plugin); if (PluginLoaded != null) { PluginLoaded(this, pluginEventArgs); } if (!pluginEventArgs.Cancel) plugins.Add(plugin); else plugin = null; } } } catch (Exception e) { } } } } public IList<object> Plugins { get { return plugins.AsReadOnly(); } } public T GetFirstPluginOfType<T>() { foreach (object plugin in plugins) { if (IsPluginOfType(plugin.GetType(), typeof(T))) return (T)plugin; } return default(T); } public T[] GetAllPluginsOfType<T>() { List<T> tmp = new List<T>(); foreach (object plugin in plugins) { if (IsPluginOfType(plugin.GetType(), typeof(T))) tmp.Add((T)plugin); } return tmp.ToArray(); } private bool IsPluginOfType(Type pluginType, Type[] types) { foreach (Type type in types) { if (IsPluginOfType(pluginType, type)) return true; } return false; } private bool IsPluginOfType(Type pluginType, Type type) { Type currentType = pluginType; do { if (currentType == type) { return true; } currentType = currentType.BaseType; } while (currentType != null); return false; } public void UnloadPlugins() { if (plugins != null) { plugins.Clear(); } } } }
33.675532
122
0.497236
[ "BSD-3-Clause" ]
cetin01/callbutler-in-vs2008
Common/Utilities.PluginManagement/PluginManager.cs
6,331
C#
using System; using System.Collections.Generic; namespace PizzaWebApp.Models { public class Customer { public int Userid { get; set; } public string Username { get; set; } public int Deflocationid { get; set; } public bool Haveorder { get; set; } public DateTime? Dateplaced { get; set; } public string Firstname { get; set; } public string Latname { get; set; } public Location Deflocation { get; set; } public List<History> History { get; set; } = new List<History>(); public List<Orderdetails> Orderdetails { get; set; } = new List<Orderdetails>(); } }
32.8
88
0.61128
[ "MIT" ]
1811-nov27-net/Ivan_Alvarez_Project_1
PizzaWebApp/WebApplication1/Models/Customer.cs
658
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("NHib.Factory")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("NHib.Factory")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("31ac7e52-f95f-4acf-abad-d8c1542d38a0")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
37.756757
84
0.743737
[ "Apache-2.0" ]
mustafasacli/NHibSample
NHib/NHib.Factory/Properties/AssemblyInfo.cs
1,400
C#
using Amazon.JSII.Runtime.Deputy; [assembly: JsiiAssembly("@scope/jsii-calc-base", "0.21.1", "scope-jsii-calc-base-0.21.1.tgz")]
32.5
94
0.715385
[ "Apache-2.0" ]
tobli/jsii
packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/AssemblyInfo.cs
130
C#
/* * Ed-Fi Operational Data Store API * * The Ed-Fi ODS / API enables applications to read and write education data stored in an Ed-Fi ODS through a secure REST interface. *** > *Note: Consumers of ODS / API information should sanitize all data for display and storage. The ODS / API provides reasonable safeguards against cross-site scripting attacks and other malicious content, but the platform does not and cannot guarantee that the data it contains is free of all potentially harmful content.* *** * * The version of the OpenAPI document: 3 * Generated by: https://github.com/openapitools/openapi-generator.git */ using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.IO; using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = EdFi.Roster.Sdk.Client.OpenAPIDateConverter; namespace EdFi.Roster.Sdk.Models.Resources { /// <summary> /// EdFiInterventionPrescriptionLearningResourceMetadataURI /// </summary> [DataContract(Name = "edFi_interventionPrescriptionLearningResourceMetadataURI")] public partial class EdFiInterventionPrescriptionLearningResourceMetadataURI : IEquatable<EdFiInterventionPrescriptionLearningResourceMetadataURI>, IValidatableObject { /// <summary> /// Initializes a new instance of the <see cref="EdFiInterventionPrescriptionLearningResourceMetadataURI" /> class. /// </summary> [JsonConstructorAttribute] protected EdFiInterventionPrescriptionLearningResourceMetadataURI() { } /// <summary> /// Initializes a new instance of the <see cref="EdFiInterventionPrescriptionLearningResourceMetadataURI" /> class. /// </summary> /// <param name="learningResourceMetadataURI">The URI (typical a URL) pointing to the metadata entry in a LRMI metadata repository, which describes this content item. (required).</param> public EdFiInterventionPrescriptionLearningResourceMetadataURI(string learningResourceMetadataURI = default(string)) { // to ensure "learningResourceMetadataURI" is required (not null) this.LearningResourceMetadataURI = learningResourceMetadataURI ?? throw new ArgumentNullException("learningResourceMetadataURI is a required property for EdFiInterventionPrescriptionLearningResourceMetadataURI and cannot be null"); } /// <summary> /// The URI (typical a URL) pointing to the metadata entry in a LRMI metadata repository, which describes this content item. /// </summary> /// <value>The URI (typical a URL) pointing to the metadata entry in a LRMI metadata repository, which describes this content item.</value> [DataMember(Name = "learningResourceMetadataURI", IsRequired = true, EmitDefaultValue = false)] public string LearningResourceMetadataURI { get; set; } /// <summary> /// Returns the string presentation of the object /// </summary> /// <returns>String presentation of the object</returns> public override string ToString() { var sb = new StringBuilder(); sb.Append("class EdFiInterventionPrescriptionLearningResourceMetadataURI {\n"); sb.Append(" LearningResourceMetadataURI: ").Append(LearningResourceMetadataURI).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// <summary> /// Returns the JSON string presentation of the object /// </summary> /// <returns>JSON string presentation of the object</returns> public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// <summary> /// Returns true if objects are equal /// </summary> /// <param name="input">Object to be compared</param> /// <returns>Boolean</returns> public override bool Equals(object input) { return this.Equals(input as EdFiInterventionPrescriptionLearningResourceMetadataURI); } /// <summary> /// Returns true if EdFiInterventionPrescriptionLearningResourceMetadataURI instances are equal /// </summary> /// <param name="input">Instance of EdFiInterventionPrescriptionLearningResourceMetadataURI to be compared</param> /// <returns>Boolean</returns> public bool Equals(EdFiInterventionPrescriptionLearningResourceMetadataURI input) { if (input == null) return false; return ( this.LearningResourceMetadataURI == input.LearningResourceMetadataURI || (this.LearningResourceMetadataURI != null && this.LearningResourceMetadataURI.Equals(input.LearningResourceMetadataURI)) ); } /// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; if (this.LearningResourceMetadataURI != null) hashCode = hashCode * 59 + this.LearningResourceMetadataURI.GetHashCode(); return hashCode; } } /// <summary> /// To validate all properties of the instance /// </summary> /// <param name="validationContext">Validation context</param> /// <returns>Validation Result</returns> IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) { // LearningResourceMetadataURI (string) maxLength if(this.LearningResourceMetadataURI != null && this.LearningResourceMetadataURI.Length > 255) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for LearningResourceMetadataURI, length must be less than 255.", new [] { "LearningResourceMetadataURI" }); } yield break; } } }
46.359712
467
0.674115
[ "Apache-2.0" ]
Ed-Fi-Alliance-OSS/Roster-Starter-Kit-for-Vendors
src/EdFi.Roster.Sdk/Models.Resources/EdFiInterventionPrescriptionLearningResourceMetadataURI.cs
6,444
C#
using System.Reflection; namespace SwissILKnife { public static class ParamHelper { public static bool IsByRef(this ParameterInfo parameterInfo) => parameterInfo.ParameterType.IsByRef && !parameterInfo.IsOut; public static bool IsOutOrRef(this ParameterInfo parameterInfo) => parameterInfo.ParameterType.IsByRef; public static bool IsOut(this ParameterInfo parameterInfo) => parameterInfo.IsOut; public static bool IsValueType(this ParameterInfo parameterInfo) => parameterInfo.ParameterType.IsValueType; } }
28.210526
66
0.794776
[ "MIT" ]
SirJosh3917/SwissILKnife
src/SwissILKnife/ParamHelper.cs
538
C#
using System.Collections.Generic; namespace WomPlatform.Web.Api.OutputModels { public record SourceOutput { public string Id { get; init; } public string Name { get; init; } public string Url { get; init; } } public record SourceLoginOutput : SourceOutput { public string PrivateKey { get; init; } public string PublicKey { get; init; } } public record SourceLoginV2Output : SourceLoginOutput { public List<string> EnabledAims { get; init; } public Dictionary<string, int> PerAimBudget { get; init; } public Location DefaultLocation { get; init; } public bool LocationIsFixed { get; init; } } public record SourceBudgetOutput { public List<string> EnabledAims { get; init; } public Dictionary<string, int> PerAimBudget { get; init; } } public static class SourceOutputHelpers { public static SourceOutput ToOutput(this DatabaseDocumentModels.Source source) { return new SourceOutput { Id = source.Id.ToString(), Name = source.Name, Url = source.Url }; } } }
21.410714
88
0.607173
[ "MIT" ]
WOM-Platform/Registry
src/ApiServer/ApiServer/OutputModels/Source.cs
1,201
C#
namespace Pidgin { /// <summary> /// Constructor functions, extension methods and utilities for <see cref="Parser{TToken, T}"/>. /// This class is intended to be imported statically ("using static Pidgin.Parser"). /// </summary> public static partial class Parser { } /// <summary> /// Constructor functions, extension methods and utilities for <see cref="Parser{TToken, T}"/> /// This class is intended to be imported statically, with the type parameter set to the type of tokens in your input stream ("using static Pidgin.Parser&lt;char&gt;"). /// </summary> /// <typeparam name="TToken">The type of the tokens in the input stream for parsers created by methods in this class</typeparam> public static partial class Parser<TToken> { } /// <summary> /// Represents a parser which consumes a stream of values of type <typeparamref name="TToken"/> and returns a value of type <typeparamref name="T"/>. /// A parser can either succeed, and return a value of type <typeparamref name="T"/>, or fail and return a <see cref="ParseError{TToken}"/>. /// </summary> /// <typeparam name="TToken">The type of the tokens in the parser's input stream</typeparam> /// <typeparam name="T">The type of the value returned by the parser</typeparam> /// <remarks>This type is not intended to be subclassed by users of the library</remarks> public abstract partial class Parser<TToken, T> { // invariant: state.Error is populated with the error that caused the failure // if the result was not successful // Why pass the error by reference? // I previously passed Result around directly, which has an Error property, // but copying it around turned out to be too expensive because ParseError is a large struct public abstract InternalResult<T> Parse(ref ParseState<TToken> state); } }
53.194444
172
0.684595
[ "MIT" ]
koliyo/Pidgin
Pidgin/Parser.cs
1,917
C#
using System; using System.Collections.Generic; using System.Text; namespace LinFu.DynamicProxy { public interface IWithTarget { object Target { get; set; } } }
15.166667
35
0.686813
[ "MIT" ]
acken/AutoTest.Net
src/AutoTest.TestRunner/Plugins/AutoTest.TestRunners.MSpec/Interfaces/IWithTarget.cs
182
C#
using Content.Shared.ActionBlocker; using Content.Shared.Hands.Components; using Content.Shared.Hands.EntitySystems; using Content.Shared.Interaction; using Content.Shared.Interaction.Events; using Content.Shared.Popups; using Content.Shared.Sound; using Content.Shared.Verbs; using Robust.Shared.Audio; using Robust.Shared.Containers; using Robust.Shared.GameStates; using Robust.Shared.Player; using Robust.Shared.Timing; using System.Diagnostics.CodeAnalysis; using Content.Shared.Destructible; namespace Content.Shared.Containers.ItemSlots { /// <summary> /// A class that handles interactions related to inserting/ejecting items into/from an item slot. /// </summary> public sealed class ItemSlotsSystem : EntitySystem { [Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!; [Dependency] private readonly SharedContainerSystem _containers = default!; [Dependency] private readonly SharedPopupSystem _popupSystem = default!; [Dependency] private readonly SharedHandsSystem _handsSystem = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; public override void Initialize() { base.Initialize(); SubscribeLocalEvent<ItemSlotsComponent, MapInitEvent>(OnMapInit); SubscribeLocalEvent<ItemSlotsComponent, ComponentInit>(Oninitialize); SubscribeLocalEvent<ItemSlotsComponent, InteractUsingEvent>(OnInteractUsing); SubscribeLocalEvent<ItemSlotsComponent, InteractHandEvent>(OnInteractHand); SubscribeLocalEvent<ItemSlotsComponent, UseInHandEvent>(OnUseInHand); SubscribeLocalEvent<ItemSlotsComponent, GetVerbsEvent<AlternativeVerb>>(AddEjectVerbs); SubscribeLocalEvent<ItemSlotsComponent, GetVerbsEvent<InteractionVerb>>(AddInteractionVerbsVerbs); SubscribeLocalEvent<ItemSlotsComponent, BreakageEventArgs>(OnBreak); SubscribeLocalEvent<ItemSlotsComponent, DestructionEventArgs>(OnBreak); SubscribeLocalEvent<ItemSlotsComponent, ComponentGetState>(GetItemSlotsState); SubscribeLocalEvent<ItemSlotsComponent, ComponentHandleState>(HandleItemSlotsState); SubscribeLocalEvent<ItemSlotsComponent, ItemSlotButtonPressedEvent>(HandleButtonPressed); } #region ComponentManagement /// <summary> /// Spawn in starting items for any item slots that should have one. /// </summary> private void OnMapInit(EntityUid uid, ItemSlotsComponent itemSlots, MapInitEvent args) { foreach (var slot in itemSlots.Slots.Values) { if (slot.HasItem || string.IsNullOrEmpty(slot.StartingItem)) continue; var item = EntityManager.SpawnEntity(slot.StartingItem, EntityManager.GetComponent<TransformComponent>(itemSlots.Owner).Coordinates); slot.ContainerSlot?.Insert(item); } } /// <summary> /// Ensure item slots have containers. /// </summary> private void Oninitialize(EntityUid uid, ItemSlotsComponent itemSlots, ComponentInit args) { foreach (var (id, slot) in itemSlots.Slots) { slot.ContainerSlot = _containers.EnsureContainer<ContainerSlot>(itemSlots.Owner, id); } } /// <summary> /// Given a new item slot, store it in the <see cref="ItemSlotsComponent"/> and ensure the slot has an item /// container. /// </summary> public void AddItemSlot(EntityUid uid, string id, ItemSlot slot) { var itemSlots = EntityManager.EnsureComponent<ItemSlotsComponent>(uid); slot.ContainerSlot = _containers.EnsureContainer<ContainerSlot>(itemSlots.Owner, id); if (itemSlots.Slots.ContainsKey(id)) Logger.Error($"Duplicate item slot key. Entity: {EntityManager.GetComponent<MetaDataComponent>(itemSlots.Owner).EntityName} ({uid}), key: {id}"); itemSlots.Slots[id] = slot; } /// <summary> /// Remove an item slot. This should generally be called whenever a component that added a slot is being /// removed. /// </summary> public void RemoveItemSlot(EntityUid uid, ItemSlot slot, ItemSlotsComponent? itemSlots = null) { if (slot.ContainerSlot == null) return; slot.ContainerSlot.Shutdown(); // Don't log missing resolves. when an entity has all of its components removed, the ItemSlotsComponent may // have been removed before some other component that added an item slot (and is now trying to remove it). if (!Resolve(uid, ref itemSlots, logMissing: false)) return; itemSlots.Slots.Remove(slot.ContainerSlot.ID); if (itemSlots.Slots.Count == 0) EntityManager.RemoveComponent(uid, itemSlots); } #endregion #region Interactions /// <summary> /// Attempt to take an item from a slot, if any are set to EjectOnInteract. /// </summary> private void OnInteractHand(EntityUid uid, ItemSlotsComponent itemSlots, InteractHandEvent args) { if (args.Handled) return; foreach (var slot in itemSlots.Slots.Values) { if (slot.Locked || !slot.EjectOnInteract || slot.Item == null) continue; args.Handled = true; TryEjectToHands(uid, slot, args.User); break; } } /// <summary> /// Attempt to eject an item from the first valid item slot. /// </summary> private void OnUseInHand(EntityUid uid, ItemSlotsComponent itemSlots, UseInHandEvent args) { if (args.Handled) return; foreach (var slot in itemSlots.Slots.Values) { if (slot.Locked || !slot.EjectOnUse || slot.Item == null) continue; args.Handled = true; TryEjectToHands(uid, slot, args.User); break; } } /// <summary> /// Tries to insert a held item in any fitting item slot. If a valid slot already contains an item, it will /// swap it out and place the old one in the user's hand. /// </summary> /// <remarks> /// This only handles the event if the user has an applicable entity that can be inserted. This allows for /// other interactions to still happen (e.g., open UI, or toggle-open), despite the user holding an item. /// Maybe this is undesirable. /// </remarks> private void OnInteractUsing(EntityUid uid, ItemSlotsComponent itemSlots, InteractUsingEvent args) { if (args.Handled) return; if (!EntityManager.TryGetComponent(args.User, out SharedHandsComponent? hands)) return; foreach (var slot in itemSlots.Slots.Values) { if (!slot.InsertOnInteract) continue; if (!CanInsert(uid, args.Used, slot, swap: slot.Swap, popup: args.User)) continue; // Drop the held item onto the floor. Return if the user cannot drop. if (!_handsSystem.TryDrop(args.User, args.Used, handsComp: hands)) return; if (slot.Item != null) _handsSystem.TryPickupAnyHand(args.User, slot.Item.Value, handsComp: hands); Insert(uid, slot, args.Used, args.User, excludeUserAudio: true); args.Handled = true; return; } } #endregion #region Insert /// <summary> /// Insert an item into a slot. This does not perform checks, so make sure to also use <see /// cref="CanInsert"/> or just use <see cref="TryInsert"/> instead. /// </summary> /// <param name="excludeUserAudio">If true, will exclude the user when playing sound. Does nothing client-side. /// Useful for predicted interactions</param> private void Insert(EntityUid uid, ItemSlot slot, EntityUid item, EntityUid? user, bool excludeUserAudio = false) { slot.ContainerSlot?.Insert(item); // ContainerSlot automatically raises a directed EntInsertedIntoContainerMessage PlaySound(uid, slot.InsertSound, slot.SoundOptions, excludeUserAudio ? user : null); var ev = new ItemSlotChangedEvent(); RaiseLocalEvent(uid, ref ev, true); } /// <summary> /// Plays a sound /// </summary> /// <param name="uid">Source of the sound</param> /// <param name="sound">The sound</param> /// <param name="excluded">Optional (server-side) argument used to prevent sending the audio to a specific /// user. When run client-side, exclusion does nothing.</param> private void PlaySound(EntityUid uid, SoundSpecifier? sound, AudioParams audioParams, EntityUid? excluded) { if (sound == null || !_gameTiming.IsFirstTimePredicted) return; var filter = Filter.Pvs(uid); if (excluded != null) filter = filter.RemoveWhereAttachedEntity(entity => entity == excluded.Value); SoundSystem.Play(sound.GetSound(), filter, uid, audioParams); } /// <summary> /// Check whether a given item can be inserted into a slot. Unless otherwise specified, this will return /// false if the slot is already filled. /// </summary> /// <remarks> /// If a popup entity is given, and if the item slot is set to generate a popup message when it fails to /// pass the whitelist, then this will generate a popup. /// </remarks> public bool CanInsert(EntityUid uid, EntityUid usedUid, ItemSlot slot, bool swap = false, EntityUid? popup = null) { if (slot.Locked) return false; if (!swap && slot.HasItem) return false; if (slot.Whitelist != null && !slot.Whitelist.IsValid(usedUid)) { if (popup.HasValue && !string.IsNullOrWhiteSpace(slot.WhitelistFailPopup)) _popupSystem.PopupEntity(Loc.GetString(slot.WhitelistFailPopup), uid, Filter.Entities(popup.Value)); return false; } return slot.ContainerSlot?.CanInsertIfEmpty(usedUid, EntityManager) ?? false; } /// <summary> /// Tries to insert item into a specific slot. /// </summary> /// <returns>False if failed to insert item</returns> public bool TryInsert(EntityUid uid, string id, EntityUid item, EntityUid? user, ItemSlotsComponent? itemSlots = null) { if (!Resolve(uid, ref itemSlots)) return false; if (!itemSlots.Slots.TryGetValue(id, out var slot)) return false; return TryInsert(uid, slot, item, user); } /// <summary> /// Tries to insert item into a specific slot. /// </summary> /// <returns>False if failed to insert item</returns> public bool TryInsert(EntityUid uid, ItemSlot slot, EntityUid item, EntityUid? user) { if (!CanInsert(uid, item, slot)) return false; Insert(uid, slot, item, user); return true; } /// <summary> /// Tries to insert item into a specific slot from an entity's hand. /// Does not check action blockers. /// </summary> /// <returns>False if failed to insert item</returns> public bool TryInsertFromHand(EntityUid uid, ItemSlot slot, EntityUid user, SharedHandsComponent? hands = null) { if (!Resolve(user, ref hands, false)) return false; if (hands.ActiveHand?.HeldEntity is not EntityUid held) return false; if (!CanInsert(uid, held, slot)) return false; // hands.Drop(item) checks CanDrop action blocker if (!_handsSystem.TryDrop(user, hands.ActiveHand)) return false; Insert(uid, slot, held, user); return true; } #endregion #region Eject public bool CanEject(ItemSlot slot) { if (slot.Locked || slot.Item == null) return false; return slot.ContainerSlot?.CanRemove(slot.Item.Value, EntityManager) ?? false; } /// <summary> /// Eject an item into a slot. This does not perform checks (e.g., is the slot locked?), so you should /// probably just use <see cref="TryEject"/> instead. /// </summary> /// <param name="excludeUserAudio">If true, will exclude the user when playing sound. Does nothing client-side. /// Useful for predicted interactions</param> private void Eject(EntityUid uid, ItemSlot slot, EntityUid item, EntityUid? user, bool excludeUserAudio = false) { slot.ContainerSlot?.Remove(item); // ContainerSlot automatically raises a directed EntRemovedFromContainerMessage PlaySound(uid, slot.EjectSound, slot.SoundOptions, excludeUserAudio ? user : null); var ev = new ItemSlotChangedEvent(); RaiseLocalEvent(uid, ref ev, true); } /// <summary> /// Try to eject an item from a slot. /// </summary> /// <returns>False if item slot is locked or has no item inserted</returns> public bool TryEject(EntityUid uid, ItemSlot slot, EntityUid? user, [NotNullWhen(true)] out EntityUid? item, bool excludeUserAudio = false) { item = null; // This handles logic with the slot itself if (!CanEject(slot)) return false; item = slot.Item; // This handles user logic if (user != null && item != null && !_actionBlockerSystem.CanPickup(user.Value, item.Value)) return false; Eject(uid, slot, item!.Value, user, excludeUserAudio); return true; } /// <summary> /// Try to eject item from a slot. /// </summary> /// <returns>False if the id is not valid, the item slot is locked, or it has no item inserted</returns> public bool TryEject(EntityUid uid, string id, EntityUid? user, [NotNullWhen(true)] out EntityUid? item, ItemSlotsComponent? itemSlots = null, bool excludeUserAudio = false) { item = null; if (!Resolve(uid, ref itemSlots)) return false; if (!itemSlots.Slots.TryGetValue(id, out var slot)) return false; return TryEject(uid, slot, user, out item, excludeUserAudio); } /// <summary> /// Try to eject item from a slot directly into a user's hands. If they have no hands, the item will still /// be ejected onto the floor. /// </summary> /// <returns> /// False if the id is not valid, the item slot is locked, or it has no item inserted. True otherwise, even /// if the user has no hands. /// </returns> public bool TryEjectToHands(EntityUid uid, ItemSlot slot, EntityUid? user, bool excludeUserAudio = false) { if (!TryEject(uid, slot, user, out var item, excludeUserAudio)) return false; if (user != null) _handsSystem.PickupOrDrop(user.Value, item.Value); return true; } #endregion #region Verbs private void AddEjectVerbs(EntityUid uid, ItemSlotsComponent itemSlots, GetVerbsEvent<AlternativeVerb> args) { if (args.Hands == null || !args.CanAccess ||!args.CanInteract) { return; } foreach (var slot in itemSlots.Slots.Values) { if (slot.EjectOnInteract) // For this item slot, ejecting/inserting is a primary interaction. Instead of an eject category // alt-click verb, there will be a "Take item" primary interaction verb. continue; if (!CanEject(slot)) continue; if (!_actionBlockerSystem.CanPickup(args.User, slot.Item!.Value)) continue; var verbSubject = slot.Name != string.Empty ? Loc.GetString(slot.Name) : EntityManager.GetComponent<MetaDataComponent>(slot.Item.Value).EntityName ?? string.Empty; AlternativeVerb verb = new(); verb.IconEntity = slot.Item; verb.Act = () => TryEjectToHands(uid, slot, args.User, excludeUserAudio: true); if (slot.EjectVerbText == null) { verb.Text = verbSubject; verb.Category = VerbCategory.Eject; } else { verb.Text = Loc.GetString(slot.EjectVerbText); } verb.Priority = slot.Priority; args.Verbs.Add(verb); } } private void AddInteractionVerbsVerbs(EntityUid uid, ItemSlotsComponent itemSlots, GetVerbsEvent<InteractionVerb> args) { if (args.Hands == null || !args.CanAccess || !args.CanInteract) return; // If there are any slots that eject on left-click, add a "Take <item>" verb. foreach (var slot in itemSlots.Slots.Values) { if (!slot.EjectOnInteract || !CanEject(slot)) continue; if (!_actionBlockerSystem.CanPickup(args.User, slot.Item!.Value)) continue; var verbSubject = slot.Name != string.Empty ? Loc.GetString(slot.Name) : EntityManager.GetComponent<MetaDataComponent>(slot.Item!.Value).EntityName ?? string.Empty; InteractionVerb takeVerb = new(); takeVerb.IconEntity = slot.Item; takeVerb.Act = () => TryEjectToHands(uid, slot, args.User, excludeUserAudio: true); if (slot.EjectVerbText == null) takeVerb.Text = Loc.GetString("take-item-verb-text", ("subject", verbSubject)); else takeVerb.Text = Loc.GetString(slot.EjectVerbText); takeVerb.Priority = slot.Priority; args.Verbs.Add(takeVerb); } // Next, add the insert-item verbs if (args.Using == null || !_actionBlockerSystem.CanDrop(args.User)) return; foreach (var slot in itemSlots.Slots.Values) { if (!CanInsert(uid, args.Using.Value, slot)) continue; var verbSubject = slot.Name != string.Empty ? Loc.GetString(slot.Name) : Name(args.Using.Value) ?? string.Empty; InteractionVerb insertVerb = new(); insertVerb.IconEntity = args.Using; insertVerb.Act = () => Insert(uid, slot, args.Using.Value, args.User, excludeUserAudio: true); if (slot.InsertVerbText != null) { insertVerb.Text = Loc.GetString(slot.InsertVerbText); insertVerb.IconTexture = "/Textures/Interface/VerbIcons/insert.svg.192dpi.png"; } else if(slot.EjectOnInteract) { // Inserting/ejecting is a primary interaction for this entity. Instead of using the insert // category, we will use a single "Place <item>" verb. insertVerb.Text = Loc.GetString("place-item-verb-text", ("subject", verbSubject)); insertVerb.IconTexture = "/Textures/Interface/VerbIcons/drop.svg.192dpi.png"; } else { insertVerb.Category = VerbCategory.Insert; insertVerb.Text = verbSubject; } insertVerb.Priority = slot.Priority; args.Verbs.Add(insertVerb); } } #endregion #region BUIs private void HandleButtonPressed(EntityUid uid, ItemSlotsComponent component, ItemSlotButtonPressedEvent args) { if (!component.Slots.TryGetValue(args.SlotId, out var slot)) return; if (args.TryEject && slot.HasItem) TryEjectToHands(uid, slot, args.Session.AttachedEntity); else if (args.TryInsert && !slot.HasItem && args.Session.AttachedEntity is EntityUid user) TryInsertFromHand(uid, slot, user); } #endregion /// <summary> /// Eject items from (some) slots when the entity is destroyed. /// </summary> private void OnBreak(EntityUid uid, ItemSlotsComponent component, EntityEventArgs args) { foreach (var slot in component.Slots.Values) { if (slot.EjectOnBreak && slot.HasItem) TryEject(uid, slot, null, out var _); } } /// <summary> /// Get the contents of some item slot. /// </summary> public EntityUid? GetItem(EntityUid uid, string id, ItemSlotsComponent? itemSlots = null) { if (!Resolve(uid, ref itemSlots)) return null; return itemSlots.Slots.GetValueOrDefault(id)?.Item; } /// <summary> /// Lock an item slot. This stops items from being inserted into or ejected from this slot. /// </summary> public void SetLock(EntityUid uid, string id, bool locked, ItemSlotsComponent? itemSlots = null) { if (!Resolve(uid, ref itemSlots)) return; if (!itemSlots.Slots.TryGetValue(id, out var slot)) return; SetLock(uid, slot, locked, itemSlots); } /// <summary> /// Lock an item slot. This stops items from being inserted into or ejected from this slot. /// </summary> public void SetLock(EntityUid uid, ItemSlot slot, bool locked, ItemSlotsComponent? itemSlots = null) { if (!Resolve(uid, ref itemSlots)) return; slot.Locked = locked; itemSlots.Dirty(); } /// <summary> /// Update the locked state of the managed item slots. /// </summary> /// <remarks> /// Note that the slot's ContainerSlot performs its own networking, so we don't need to send information /// about the contained entity. /// </remarks> private void HandleItemSlotsState(EntityUid uid, ItemSlotsComponent component, ref ComponentHandleState args) { if (args.Current is not ItemSlotsComponentState state) return; foreach (var (id, locked) in state.SlotLocked) { component.Slots[id].Locked = locked; } } private void GetItemSlotsState(EntityUid uid, ItemSlotsComponent component, ref ComponentGetState args) { args.State = new ItemSlotsComponentState(component.Slots); } } /// <summary> /// Raised directed on an entity when one of its item slots changes. /// </summary> [ByRefEvent] public readonly struct ItemSlotChangedEvent {} }
40.087748
161
0.577624
[ "MIT" ]
EmoGarbage404/space-station-14
Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs
24,213
C#
using System; using System.IO; using System.Runtime.CompilerServices; using System.Runtime.Versioning; namespace Microsoft.Dnx.Runtime { internal static class FrameworkDefinitions { private const string NetFrameworkIdentifier = ".NETFramework"; public static bool TryPopulateFrameworkFastPath(FrameworkName framework, string referenceAssembliesPath, out FrameworkInformation frameworkInfo) { if(!string.IsNullOrEmpty(framework.Profile)) { // We don't have embedded framework info for Client Profile frameworkInfo = null; return false; } // 4.6 if (framework.Identifier == NetFrameworkIdentifier && framework.Version.Major == 4 && framework.Version.Minor == 6) { frameworkInfo = PopulateNet46(referenceAssembliesPath); return true; } // 4.5.2 if (framework.Identifier == NetFrameworkIdentifier && framework.Version.Major == 4 && framework.Version.Minor == 5 && framework.Version.Build == 2) { frameworkInfo = PopulateNet452(referenceAssembliesPath); return true; } // 4.5.1 if (framework.Identifier == NetFrameworkIdentifier && framework.Version.Major == 4 && framework.Version.Minor == 5 && framework.Version.Build == 1) { frameworkInfo = PopulateNet451(referenceAssembliesPath); return true; } // 4.5 if (framework.Identifier == NetFrameworkIdentifier && framework.Version.Major == 4 && framework.Version.Minor == 5) { frameworkInfo = PopulateNet45(referenceAssembliesPath); return true; } // 4.0 if (framework.Identifier == NetFrameworkIdentifier && framework.Version.Major == 4 && framework.Version.Minor == 0) { frameworkInfo = PopulateNet40(referenceAssembliesPath); return true; } frameworkInfo = null; return false; } [MethodImpl(MethodImplOptions.NoInlining)] private static FrameworkInformation PopulateNet46(string referenceAssembliesPath) { // Generated framework information for .NETFramework,Version=v4.6 var frameworkInfo = new FrameworkInformation(); frameworkInfo.Path = Path.Combine(referenceAssembliesPath, ".NETFramework", "v4.6"); frameworkInfo.RedistListPath = Path.Combine(referenceAssembliesPath, ".NETFramework", "v4.6", "RedistList", "FrameworkList.xml"); frameworkInfo.Name = ".NET Framework 4.6"; frameworkInfo.SearchPaths = new[] { frameworkInfo.Path, Path.Combine(frameworkInfo.Path, "Facades") }; frameworkInfo.Assemblies["Accessibility"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Accessibility.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["CustomMarshalers"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "CustomMarshalers.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["ISymWrapper"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "ISymWrapper.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Activities.Build"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Activities.Build.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Conversion.v4.0"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Conversion.v4.0.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Engine"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Engine.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Framework"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Framework.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Tasks.v4.0"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Tasks.v4.0.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Utilities.v4.0"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Utilities.v4.0.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.CSharp"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.CSharp.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.JScript"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.JScript.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualBasic"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualBasic.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualBasic.Compatibility"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualBasic.Compatibility.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualBasic.Compatibility.Data"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualBasic.Compatibility.Data.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualC"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualC.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualC.STLCLR"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualC.STLCLR.dll"), Version = new Version(2, 0, 0, 0) }; frameworkInfo.Assemblies["mscorlib"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "mscorlib.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationBuildTasks"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationBuildTasks.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationCore"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationCore.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Aero"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Aero.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Aero2"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Aero2.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.AeroLite"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.AeroLite.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Classic"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Classic.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Luna"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Luna.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Royale"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Royale.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["ReachFramework"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "ReachFramework.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["sysglobl"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "sysglobl.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.Core.Presentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.Core.Presentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.DurableInstancing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.DurableInstancing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.Presentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.Presentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.Statements"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.Statements.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.AddIn.Contract"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.AddIn.Contract.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.AddIn"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.AddIn.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.Composition"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ComponentModel.Composition.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.Composition.Registration"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ComponentModel.Composition.Registration.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.DataAnnotations"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ComponentModel.DataAnnotations.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Configuration"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Configuration.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Configuration.Install"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Configuration.Install.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Core"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Core.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.DataSetExtensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.DataSetExtensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Entity.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Entity.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Entity"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Entity.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Linq"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Linq.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.OracleClient"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.OracleClient.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Services.Client"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Services.Client.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Services.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Services.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Services"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Services.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.SqlXml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.SqlXml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Deployment"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Deployment.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Device"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Device.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.DirectoryServices.AccountManagement"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.DirectoryServices.AccountManagement.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.DirectoryServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.DirectoryServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.DirectoryServices.Protocols"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.DirectoryServices.Protocols.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Drawing.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Drawing.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Drawing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Drawing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Dynamic"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Dynamic.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.EnterpriseServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.EnterpriseServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IdentityModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IdentityModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IdentityModel.Selectors"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IdentityModel.Selectors.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IdentityModel.Services"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IdentityModel.Services.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IO.Log"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IO.Log.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IO.Compression"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IO.Compression.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IO.Compression.FileSystem"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IO.Compression.FileSystem.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Management"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Management.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Management.Instrumentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Management.Instrumentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Messaging"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Messaging.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Net.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net.Http"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Net.Http.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net.Http.WebRequest"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Net.Http.WebRequest.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Numerics"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Numerics.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Numerics.Vectors"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Numerics.Vectors.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Printing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Printing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Context"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Reflection.Context.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.DurableInstancing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.DurableInstancing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Caching"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Caching.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Remoting"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Remoting.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Serialization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization.Formatters.Soap"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Serialization.Formatters.Soap.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Security"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Security.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Activation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Activation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Activities"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Activities.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Channels"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Channels.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Discovery"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Discovery.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Routing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Routing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Web"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Web.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceProcess"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceProcess.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Speech"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Speech.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Transactions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Transactions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Abstractions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Abstractions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.ApplicationServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.ApplicationServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DataVisualization.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DataVisualization.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DataVisualization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DataVisualization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DynamicData.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DynamicData.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DynamicData"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DynamicData.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Entity.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Entity.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Entity"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Entity.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Extensions.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Extensions.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Extensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Extensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Mobile"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Mobile.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.RegularExpressions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.RegularExpressions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Routing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Routing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Services"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Services.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Controls.Ribbon"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Controls.Ribbon.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Forms.DataVisualization.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Forms.DataVisualization.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Forms.DataVisualization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Forms.DataVisualization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Forms"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Forms.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Input.Manipulations"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Input.Manipulations.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Presentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Presentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Workflow.Activities"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Workflow.Activities.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Workflow.ComponentModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Workflow.ComponentModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Workflow.Runtime"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Workflow.Runtime.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.WorkflowServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.WorkflowServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xaml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xaml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.Linq"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xml.Linq.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.Serialization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xml.Serialization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationClient"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationClient.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationClientsideProviders"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationClientsideProviders.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationProvider"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationProvider.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationTypes"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationTypes.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["WindowsBase"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "WindowsBase.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["WindowsFormsIntegration"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "WindowsFormsIntegration.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["XamlBuildTask"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "XamlBuildTask.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Collections"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Collections.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.Collections.Concurrent"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Collections.Concurrent.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ComponentModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.Annotations"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ComponentModel.Annotations.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.ComponentModel.EventBasedAsync"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ComponentModel.EventBasedAsync.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Diagnostics.Contracts"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Diagnostics.Contracts.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Diagnostics.Debug"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Diagnostics.Debug.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.Diagnostics.Tools"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Diagnostics.Tools.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Diagnostics.Tracing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Diagnostics.Tracing.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.Dynamic.Runtime"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Dynamic.Runtime.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Globalization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Globalization.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.IO"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.IO.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Linq"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Linq.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Linq.Expressions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Linq.Expressions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Linq.Parallel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Linq.Parallel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Linq.Queryable"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Linq.Queryable.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net.NetworkInformation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Net.NetworkInformation.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.Net.Primitives"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Net.Primitives.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.Net.Requests"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Net.Requests.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ObjectModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ObjectModel.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.Reflection"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.Reflection.Emit"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Emit.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Emit.ILGeneration"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Emit.ILGeneration.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Emit.Lightweight"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Emit.Lightweight.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Extensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Extensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Primitives"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Primitives.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Resources.ResourceManager"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Resources.ResourceManager.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.dll"), Version = new Version(4, 0, 20, 0) }; frameworkInfo.Assemblies["System.Runtime.Extensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Extensions.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.Runtime.Handles"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Handles.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.InteropServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.InteropServices.dll"), Version = new Version(4, 0, 20, 0) }; frameworkInfo.Assemblies["System.Runtime.InteropServices.WindowsRuntime"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.InteropServices.WindowsRuntime.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Numerics"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Numerics.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization.Json"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Serialization.Json.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization.Primitives"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Serialization.Primitives.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization.Xml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Serialization.Xml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Security.Principal"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Security.Principal.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Duplex"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.Duplex.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Http"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.Http.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.NetTcp"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.NetTcp.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Primitives"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.Primitives.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Security"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.Security.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Text.Encoding"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Text.Encoding.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Text.Encoding.Extensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Text.Encoding.Extensions.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.Text.RegularExpressions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Text.RegularExpressions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Threading"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Threading.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.Threading.Tasks"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Threading.Tasks.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.Threading.Tasks.Parallel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Threading.Tasks.Parallel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Threading.Timer"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Threading.Timer.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.ReaderWriter"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Xml.ReaderWriter.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.Xml.XDocument"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Xml.XDocument.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.XmlSerializer"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Xml.XmlSerializer.dll"), Version = new Version(4, 0, 0, 0) }; return frameworkInfo; } [MethodImpl(MethodImplOptions.NoInlining)] private static FrameworkInformation PopulateNet452(string referenceAssembliesPath) { // Generated framework information for .NETFramework,Version=v4.5.2 var frameworkInfo = new FrameworkInformation(); frameworkInfo.Path = Path.Combine(referenceAssembliesPath, ".NETFramework", "v4.5.2"); frameworkInfo.RedistListPath = Path.Combine(referenceAssembliesPath, ".NETFramework", "v4.5.2", "RedistList", "FrameworkList.xml"); frameworkInfo.Name = ".NET Framework 4.5.2"; frameworkInfo.SearchPaths = new[] { frameworkInfo.Path, Path.Combine(frameworkInfo.Path, "Facades") }; frameworkInfo.Assemblies["Accessibility"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Accessibility.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["CustomMarshalers"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "CustomMarshalers.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["ISymWrapper"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "ISymWrapper.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Activities.Build"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Activities.Build.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Conversion.v4.0"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Conversion.v4.0.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Engine"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Engine.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Framework"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Framework.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Tasks.v4.0"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Tasks.v4.0.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Utilities.v4.0"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Utilities.v4.0.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.CSharp"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.CSharp.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.JScript"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.JScript.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualBasic"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualBasic.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualBasic.Compatibility"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualBasic.Compatibility.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualBasic.Compatibility.Data"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualBasic.Compatibility.Data.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualC"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualC.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualC.STLCLR"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualC.STLCLR.dll"), Version = new Version(2, 0, 0, 0) }; frameworkInfo.Assemblies["mscorlib"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "mscorlib.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationBuildTasks"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationBuildTasks.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationCore"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationCore.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Aero"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Aero.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Aero2"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Aero2.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.AeroLite"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.AeroLite.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Classic"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Classic.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Luna"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Luna.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Royale"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Royale.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["ReachFramework"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "ReachFramework.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["sysglobl"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "sysglobl.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.Core.Presentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.Core.Presentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.DurableInstancing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.DurableInstancing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.Presentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.Presentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.Statements"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.Statements.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.AddIn.Contract"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.AddIn.Contract.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.AddIn"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.AddIn.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.Composition"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ComponentModel.Composition.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.Composition.Registration"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ComponentModel.Composition.Registration.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.DataAnnotations"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ComponentModel.DataAnnotations.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Configuration"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Configuration.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Configuration.Install"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Configuration.Install.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Core"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Core.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.DataSetExtensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.DataSetExtensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Entity.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Entity.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Entity"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Entity.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Linq"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Linq.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.OracleClient"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.OracleClient.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Services.Client"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Services.Client.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Services.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Services.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Services"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Services.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.SqlXml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.SqlXml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Deployment"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Deployment.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Device"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Device.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.DirectoryServices.AccountManagement"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.DirectoryServices.AccountManagement.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.DirectoryServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.DirectoryServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.DirectoryServices.Protocols"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.DirectoryServices.Protocols.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Drawing.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Drawing.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Drawing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Drawing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Dynamic"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Dynamic.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.EnterpriseServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.EnterpriseServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IdentityModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IdentityModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IdentityModel.Selectors"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IdentityModel.Selectors.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IdentityModel.Services"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IdentityModel.Services.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IO.Log"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IO.Log.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IO.Compression"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IO.Compression.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IO.Compression.FileSystem"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IO.Compression.FileSystem.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Management"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Management.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Management.Instrumentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Management.Instrumentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Messaging"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Messaging.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Net.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net.Http"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Net.Http.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net.Http.WebRequest"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Net.Http.WebRequest.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Numerics"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Numerics.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Printing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Printing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Context"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Reflection.Context.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.DurableInstancing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.DurableInstancing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Caching"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Caching.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Remoting"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Remoting.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Serialization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization.Formatters.Soap"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Serialization.Formatters.Soap.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Security"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Security.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Activation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Activation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Activities"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Activities.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Channels"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Channels.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Discovery"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Discovery.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Routing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Routing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Web"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Web.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceProcess"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceProcess.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Speech"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Speech.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Transactions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Transactions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Abstractions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Abstractions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.ApplicationServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.ApplicationServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DataVisualization.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DataVisualization.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DataVisualization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DataVisualization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DynamicData.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DynamicData.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DynamicData"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DynamicData.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Entity.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Entity.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Entity"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Entity.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Extensions.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Extensions.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Extensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Extensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Mobile"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Mobile.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.RegularExpressions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.RegularExpressions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Routing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Routing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Services"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Services.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Controls.Ribbon"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Controls.Ribbon.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Forms.DataVisualization.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Forms.DataVisualization.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Forms.DataVisualization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Forms.DataVisualization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Forms"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Forms.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Input.Manipulations"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Input.Manipulations.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Presentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Presentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Workflow.Activities"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Workflow.Activities.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Workflow.ComponentModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Workflow.ComponentModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Workflow.Runtime"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Workflow.Runtime.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.WorkflowServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.WorkflowServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xaml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xaml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.Linq"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xml.Linq.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.Serialization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xml.Serialization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationClient"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationClient.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationClientsideProviders"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationClientsideProviders.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationProvider"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationProvider.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationTypes"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationTypes.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["WindowsBase"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "WindowsBase.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["WindowsFormsIntegration"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "WindowsFormsIntegration.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["XamlBuildTask"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "XamlBuildTask.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Collections"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Collections.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Collections.Concurrent"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Collections.Concurrent.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ComponentModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.Annotations"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ComponentModel.Annotations.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.EventBasedAsync"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ComponentModel.EventBasedAsync.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Diagnostics.Contracts"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Diagnostics.Contracts.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Diagnostics.Debug"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Diagnostics.Debug.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Diagnostics.Tools"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Diagnostics.Tools.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Diagnostics.Tracing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Diagnostics.Tracing.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.Dynamic.Runtime"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Dynamic.Runtime.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Globalization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Globalization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IO"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.IO.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Linq"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Linq.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Linq.Expressions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Linq.Expressions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Linq.Parallel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Linq.Parallel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Linq.Queryable"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Linq.Queryable.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net.NetworkInformation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Net.NetworkInformation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net.Primitives"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Net.Primitives.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net.Requests"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Net.Requests.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ObjectModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ObjectModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Emit"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Emit.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Emit.ILGeneration"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Emit.ILGeneration.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Emit.Lightweight"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Emit.Lightweight.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Extensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Extensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Primitives"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Primitives.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Resources.ResourceManager"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Resources.ResourceManager.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.Runtime.Extensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Extensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.InteropServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.InteropServices.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.Runtime.InteropServices.WindowsRuntime"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.InteropServices.WindowsRuntime.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Numerics"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Numerics.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization.Json"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Serialization.Json.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization.Primitives"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Serialization.Primitives.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization.Xml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Serialization.Xml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Security.Principal"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Security.Principal.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Duplex"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.Duplex.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Http"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.Http.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.NetTcp"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.NetTcp.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Primitives"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.Primitives.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Security"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.Security.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Text.Encoding"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Text.Encoding.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Text.Encoding.Extensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Text.Encoding.Extensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Text.RegularExpressions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Text.RegularExpressions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Threading"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Threading.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Threading.Tasks"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Threading.Tasks.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Threading.Tasks.Parallel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Threading.Tasks.Parallel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Threading.Timer"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Threading.Timer.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.ReaderWriter"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Xml.ReaderWriter.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.XDocument"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Xml.XDocument.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.XmlSerializer"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Xml.XmlSerializer.dll"), Version = new Version(4, 0, 0, 0) }; return frameworkInfo; } [MethodImpl(MethodImplOptions.NoInlining)] private static FrameworkInformation PopulateNet451(string referenceAssembliesPath) { // Generated framework information for .NETFramework,Version=v4.5.1 var frameworkInfo = new FrameworkInformation(); frameworkInfo.Path = Path.Combine(referenceAssembliesPath, ".NETFramework", "v4.5.1"); frameworkInfo.RedistListPath = Path.Combine(referenceAssembliesPath, ".NETFramework", "v4.5.1", "RedistList", "FrameworkList.xml"); frameworkInfo.Name = ".NET Framework 4.5.1"; frameworkInfo.SearchPaths = new[] { frameworkInfo.Path, Path.Combine(frameworkInfo.Path, "Facades") }; frameworkInfo.Assemblies["Accessibility"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Accessibility.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["CustomMarshalers"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "CustomMarshalers.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["ISymWrapper"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "ISymWrapper.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Activities.Build"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Activities.Build.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Conversion.v4.0"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Conversion.v4.0.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Engine"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Engine.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Framework"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Framework.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Tasks.v4.0"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Tasks.v4.0.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Utilities.v4.0"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Utilities.v4.0.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.CSharp"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.CSharp.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.JScript"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.JScript.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualBasic"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualBasic.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualBasic.Compatibility"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualBasic.Compatibility.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualBasic.Compatibility.Data"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualBasic.Compatibility.Data.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualC"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualC.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualC.STLCLR"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualC.STLCLR.dll"), Version = new Version(2, 0, 0, 0) }; frameworkInfo.Assemblies["mscorlib"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "mscorlib.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationBuildTasks"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationBuildTasks.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationCore"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationCore.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Aero"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Aero.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Aero2"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Aero2.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.AeroLite"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.AeroLite.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Classic"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Classic.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Luna"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Luna.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Royale"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Royale.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["ReachFramework"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "ReachFramework.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["sysglobl"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "sysglobl.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.Core.Presentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.Core.Presentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.DurableInstancing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.DurableInstancing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.Presentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.Presentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.Statements"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.Statements.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.AddIn.Contract"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.AddIn.Contract.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.AddIn"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.AddIn.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.Composition"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ComponentModel.Composition.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.Composition.Registration"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ComponentModel.Composition.Registration.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.DataAnnotations"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ComponentModel.DataAnnotations.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Configuration"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Configuration.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Configuration.Install"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Configuration.Install.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Core"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Core.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.DataSetExtensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.DataSetExtensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Entity.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Entity.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Entity"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Entity.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Linq"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Linq.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.OracleClient"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.OracleClient.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Services.Client"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Services.Client.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Services.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Services.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Services"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Services.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.SqlXml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.SqlXml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Deployment"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Deployment.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Device"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Device.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.DirectoryServices.AccountManagement"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.DirectoryServices.AccountManagement.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.DirectoryServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.DirectoryServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.DirectoryServices.Protocols"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.DirectoryServices.Protocols.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Drawing.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Drawing.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Drawing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Drawing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Dynamic"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Dynamic.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.EnterpriseServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.EnterpriseServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IdentityModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IdentityModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IdentityModel.Selectors"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IdentityModel.Selectors.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IdentityModel.Services"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IdentityModel.Services.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IO.Log"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IO.Log.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IO.Compression"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IO.Compression.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IO.Compression.FileSystem"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IO.Compression.FileSystem.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Management"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Management.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Management.Instrumentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Management.Instrumentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Messaging"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Messaging.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Net.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net.Http"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Net.Http.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net.Http.WebRequest"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Net.Http.WebRequest.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Numerics"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Numerics.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Printing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Printing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Context"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Reflection.Context.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.DurableInstancing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.DurableInstancing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Caching"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Caching.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Remoting"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Remoting.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Serialization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization.Formatters.Soap"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Serialization.Formatters.Soap.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Security"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Security.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Activation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Activation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Activities"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Activities.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Channels"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Channels.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Discovery"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Discovery.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Routing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Routing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Web"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Web.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceProcess"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceProcess.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Speech"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Speech.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Transactions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Transactions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Abstractions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Abstractions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.ApplicationServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.ApplicationServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DataVisualization.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DataVisualization.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DataVisualization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DataVisualization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DynamicData.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DynamicData.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DynamicData"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DynamicData.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Entity.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Entity.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Entity"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Entity.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Extensions.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Extensions.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Extensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Extensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Mobile"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Mobile.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.RegularExpressions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.RegularExpressions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Routing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Routing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Services"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Services.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Controls.Ribbon"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Controls.Ribbon.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Forms.DataVisualization.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Forms.DataVisualization.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Forms.DataVisualization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Forms.DataVisualization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Forms"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Forms.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Input.Manipulations"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Input.Manipulations.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Presentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Presentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Workflow.Activities"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Workflow.Activities.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Workflow.ComponentModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Workflow.ComponentModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Workflow.Runtime"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Workflow.Runtime.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.WorkflowServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.WorkflowServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xaml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xaml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.Linq"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xml.Linq.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.Serialization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xml.Serialization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationClient"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationClient.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationClientsideProviders"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationClientsideProviders.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationProvider"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationProvider.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationTypes"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationTypes.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["WindowsBase"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "WindowsBase.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["WindowsFormsIntegration"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "WindowsFormsIntegration.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["XamlBuildTask"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "XamlBuildTask.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Collections"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Collections.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Collections.Concurrent"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Collections.Concurrent.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ComponentModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.Annotations"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ComponentModel.Annotations.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.EventBasedAsync"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ComponentModel.EventBasedAsync.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Diagnostics.Contracts"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Diagnostics.Contracts.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Diagnostics.Debug"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Diagnostics.Debug.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Diagnostics.Tools"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Diagnostics.Tools.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Diagnostics.Tracing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Diagnostics.Tracing.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.Dynamic.Runtime"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Dynamic.Runtime.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Globalization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Globalization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IO"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.IO.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Linq"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Linq.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Linq.Expressions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Linq.Expressions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Linq.Parallel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Linq.Parallel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Linq.Queryable"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Linq.Queryable.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net.NetworkInformation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Net.NetworkInformation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net.Primitives"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Net.Primitives.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net.Requests"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Net.Requests.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ObjectModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ObjectModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Emit"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Emit.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Emit.ILGeneration"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Emit.ILGeneration.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Emit.Lightweight"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Emit.Lightweight.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Extensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Extensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Primitives"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Primitives.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Resources.ResourceManager"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Resources.ResourceManager.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.Runtime.Extensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Extensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.InteropServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.InteropServices.dll"), Version = new Version(4, 0, 10, 0) }; frameworkInfo.Assemblies["System.Runtime.InteropServices.WindowsRuntime"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.InteropServices.WindowsRuntime.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Numerics"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Numerics.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization.Json"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Serialization.Json.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization.Primitives"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Serialization.Primitives.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization.Xml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Serialization.Xml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Security.Principal"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Security.Principal.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Duplex"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.Duplex.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Http"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.Http.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.NetTcp"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.NetTcp.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Primitives"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.Primitives.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Security"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.Security.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Text.Encoding"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Text.Encoding.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Text.Encoding.Extensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Text.Encoding.Extensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Text.RegularExpressions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Text.RegularExpressions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Threading"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Threading.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Threading.Tasks"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Threading.Tasks.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Threading.Tasks.Parallel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Threading.Tasks.Parallel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Threading.Timer"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Threading.Timer.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.ReaderWriter"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Xml.ReaderWriter.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.XDocument"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Xml.XDocument.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.XmlSerializer"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Xml.XmlSerializer.dll"), Version = new Version(4, 0, 0, 0) }; return frameworkInfo; } [MethodImpl(MethodImplOptions.NoInlining)] private static FrameworkInformation PopulateNet45(string referenceAssembliesPath) { var frameworkInfo = new FrameworkInformation(); // Generated framework information for .NETFramework,Version=v4.5 frameworkInfo.Path = Path.Combine(referenceAssembliesPath, ".NETFramework", "v4.5"); frameworkInfo.RedistListPath = Path.Combine(referenceAssembliesPath, ".NETFramework", "v4.5", "RedistList", "FrameworkList.xml"); frameworkInfo.Name = ".NET Framework 4.5"; frameworkInfo.SearchPaths = new[] { frameworkInfo.Path, Path.Combine(frameworkInfo.Path, "Facades") }; frameworkInfo.Assemblies["Accessibility"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Accessibility.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["CustomMarshalers"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "CustomMarshalers.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["ISymWrapper"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "ISymWrapper.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Activities.Build"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Activities.Build.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Conversion.v4.0"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Conversion.v4.0.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Engine"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Engine.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Framework"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Framework.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Tasks.v4.0"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Tasks.v4.0.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Utilities.v4.0"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Utilities.v4.0.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.CSharp"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.CSharp.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.JScript"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.JScript.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualBasic"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualBasic.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualBasic.Compatibility"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualBasic.Compatibility.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualBasic.Compatibility.Data"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualBasic.Compatibility.Data.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualC"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualC.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualC.STLCLR"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualC.STLCLR.dll"), Version = new Version(2, 0, 0, 0) }; frameworkInfo.Assemblies["mscorlib"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "mscorlib.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationBuildTasks"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationBuildTasks.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationCore"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationCore.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Aero"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Aero.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Aero2"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Aero2.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.AeroLite"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.AeroLite.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Classic"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Classic.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Luna"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Luna.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Royale"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Royale.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["ReachFramework"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "ReachFramework.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["sysglobl"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "sysglobl.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.Core.Presentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.Core.Presentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.DurableInstancing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.DurableInstancing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.Presentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.Presentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.Statements"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.Statements.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.AddIn.Contract"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.AddIn.Contract.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.AddIn"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.AddIn.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.Composition"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ComponentModel.Composition.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.Composition.Registration"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ComponentModel.Composition.Registration.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.DataAnnotations"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ComponentModel.DataAnnotations.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Configuration"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Configuration.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Configuration.Install"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Configuration.Install.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Core"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Core.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.DataSetExtensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.DataSetExtensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Entity.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Entity.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Entity"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Entity.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Linq"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Linq.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.OracleClient"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.OracleClient.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Services.Client"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Services.Client.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Services.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Services.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Services"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Services.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.SqlXml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.SqlXml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Deployment"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Deployment.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Device"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Device.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.DirectoryServices.AccountManagement"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.DirectoryServices.AccountManagement.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.DirectoryServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.DirectoryServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.DirectoryServices.Protocols"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.DirectoryServices.Protocols.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Drawing.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Drawing.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Drawing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Drawing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Dynamic"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Dynamic.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.EnterpriseServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.EnterpriseServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IdentityModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IdentityModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IdentityModel.Selectors"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IdentityModel.Selectors.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IdentityModel.Services"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IdentityModel.Services.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IO.Log"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IO.Log.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IO.Compression"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IO.Compression.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IO.Compression.FileSystem"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IO.Compression.FileSystem.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Management"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Management.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Management.Instrumentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Management.Instrumentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Messaging"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Messaging.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Net.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net.Http"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Net.Http.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net.Http.WebRequest"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Net.Http.WebRequest.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Numerics"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Numerics.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Printing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Printing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Context"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Reflection.Context.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.DurableInstancing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.DurableInstancing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Caching"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Caching.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Remoting"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Remoting.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Serialization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization.Formatters.Soap"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Serialization.Formatters.Soap.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Security"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Security.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Activation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Activation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Activities"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Activities.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Channels"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Channels.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Discovery"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Discovery.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Routing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Routing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Web"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Web.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceProcess"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceProcess.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Speech"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Speech.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Transactions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Transactions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Abstractions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Abstractions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.ApplicationServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.ApplicationServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DataVisualization.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DataVisualization.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DataVisualization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DataVisualization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DynamicData.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DynamicData.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DynamicData"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DynamicData.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Entity.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Entity.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Entity"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Entity.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Extensions.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Extensions.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Extensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Extensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Mobile"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Mobile.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.RegularExpressions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.RegularExpressions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Routing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Routing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Services"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Services.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Controls.Ribbon"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Controls.Ribbon.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Forms.DataVisualization.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Forms.DataVisualization.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Forms.DataVisualization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Forms.DataVisualization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Forms"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Forms.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Input.Manipulations"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Input.Manipulations.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Presentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Presentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Workflow.Activities"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Workflow.Activities.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Workflow.ComponentModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Workflow.ComponentModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Workflow.Runtime"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Workflow.Runtime.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.WorkflowServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.WorkflowServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xaml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xaml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.Linq"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xml.Linq.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.Serialization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xml.Serialization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationClient"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationClient.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationClientsideProviders"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationClientsideProviders.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationProvider"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationProvider.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationTypes"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationTypes.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["WindowsBase"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "WindowsBase.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["WindowsFormsIntegration"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "WindowsFormsIntegration.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["XamlBuildTask"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "XamlBuildTask.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Collections"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Collections.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Collections.Concurrent"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Collections.Concurrent.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ComponentModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.Annotations"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ComponentModel.Annotations.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.EventBasedAsync"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ComponentModel.EventBasedAsync.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Diagnostics.Contracts"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Diagnostics.Contracts.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Diagnostics.Debug"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Diagnostics.Debug.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Diagnostics.Tools"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Diagnostics.Tools.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Diagnostics.Tracing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Diagnostics.Tracing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Dynamic.Runtime"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Dynamic.Runtime.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Globalization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Globalization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IO"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.IO.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Linq"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Linq.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Linq.Expressions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Linq.Expressions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Linq.Parallel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Linq.Parallel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Linq.Queryable"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Linq.Queryable.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net.NetworkInformation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Net.NetworkInformation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net.Primitives"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Net.Primitives.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net.Requests"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Net.Requests.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ObjectModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ObjectModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Emit"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Emit.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Emit.ILGeneration"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Emit.ILGeneration.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Emit.Lightweight"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Emit.Lightweight.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Extensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Extensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Reflection.Primitives"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Reflection.Primitives.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Resources.ResourceManager"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Resources.ResourceManager.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Extensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Extensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.InteropServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.InteropServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.InteropServices.WindowsRuntime"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.InteropServices.WindowsRuntime.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Numerics"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Numerics.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization.Json"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Serialization.Json.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization.Primitives"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Serialization.Primitives.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization.Xml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Runtime.Serialization.Xml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Security.Principal"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Security.Principal.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Duplex"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.Duplex.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Http"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.Http.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.NetTcp"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.NetTcp.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Primitives"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.Primitives.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Security"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.ServiceModel.Security.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Text.Encoding"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Text.Encoding.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Text.Encoding.Extensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Text.Encoding.Extensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Text.RegularExpressions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Text.RegularExpressions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Threading"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Threading.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Threading.Tasks"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Threading.Tasks.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Threading.Tasks.Parallel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Threading.Tasks.Parallel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.ReaderWriter"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Xml.ReaderWriter.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.XDocument"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Xml.XDocument.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.XmlSerializer"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Facades", "System.Xml.XmlSerializer.dll"), Version = new Version(4, 0, 0, 0) }; return frameworkInfo; } [MethodImpl(MethodImplOptions.NoInlining)] private static FrameworkInformation PopulateNet40(string referenceAssembliesPath) { // Generated framework information for .NETFramework,Version=v4.0 var frameworkInfo = new FrameworkInformation(); frameworkInfo.Path = Path.Combine(referenceAssembliesPath, ".NETFramework", "v4.0"); frameworkInfo.RedistListPath = Path.Combine(referenceAssembliesPath, ".NETFramework", "v4.0", "RedistList", "FrameworkList.xml"); frameworkInfo.Name = ".NET Framework 4"; frameworkInfo.SearchPaths = new[] { frameworkInfo.Path, Path.Combine(frameworkInfo.Path, "Facades") }; frameworkInfo.Assemblies["Accessibility"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Accessibility.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["CustomMarshalers"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "CustomMarshalers.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["ISymWrapper"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "ISymWrapper.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Conversion.v4.0"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Conversion.v4.0.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Engine"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Engine.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Framework"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Framework.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Tasks.v4.0"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Tasks.v4.0.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.Build.Utilities.v4.0"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.Build.Utilities.v4.0.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.CSharp"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.CSharp.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.JScript"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.JScript.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualBasic"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualBasic.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualBasic.Compatibility"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualBasic.Compatibility.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualBasic.Compatibility.Data"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualBasic.Compatibility.Data.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualC"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualC.dll"), Version = new Version(10, 0, 0, 0) }; frameworkInfo.Assemblies["Microsoft.VisualC.STLCLR"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "Microsoft.VisualC.STLCLR.dll"), Version = new Version(2, 0, 0, 0) }; frameworkInfo.Assemblies["mscorlib"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "mscorlib.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationBuildTasks"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationBuildTasks.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationCore"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationCore.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Aero"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Aero.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Classic"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Classic.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Luna"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Luna.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["PresentationFramework.Royale"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "PresentationFramework.Royale.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["ReachFramework"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "ReachFramework.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["sysglobl"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "sysglobl.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.Core.Presentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.Core.Presentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.DurableInstancing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.DurableInstancing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Activities.Presentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Activities.Presentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.AddIn.Contract"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.AddIn.Contract.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.AddIn"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.AddIn.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.Composition"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ComponentModel.Composition.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ComponentModel.DataAnnotations"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ComponentModel.DataAnnotations.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Configuration"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Configuration.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Configuration.Install"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Configuration.Install.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Core"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Core.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.DataSetExtensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.DataSetExtensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Entity.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Entity.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Entity"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Entity.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Linq"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Linq.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.OracleClient"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.OracleClient.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Services.Client"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Services.Client.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Services.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Services.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.Services"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.Services.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Data.SqlXml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Data.SqlXml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Deployment"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Deployment.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Device"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Device.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.DirectoryServices.AccountManagement"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.DirectoryServices.AccountManagement.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.DirectoryServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.DirectoryServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.DirectoryServices.Protocols"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.DirectoryServices.Protocols.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Drawing.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Drawing.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Drawing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Drawing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Dynamic"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Dynamic.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.EnterpriseServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.EnterpriseServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IdentityModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IdentityModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IdentityModel.Selectors"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IdentityModel.Selectors.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.IO.Log"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.IO.Log.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Management"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Management.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Management.Instrumentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Management.Instrumentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Messaging"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Messaging.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Net"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Net.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Numerics"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Numerics.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Printing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Printing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.DurableInstancing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.DurableInstancing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Caching"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Caching.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Remoting"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Remoting.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Serialization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Runtime.Serialization.Formatters.Soap"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Runtime.Serialization.Formatters.Soap.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Security"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Security.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Activation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Activation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Activities"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Activities.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Channels"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Channels.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Discovery"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Discovery.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Routing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Routing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceModel.Web"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceModel.Web.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.ServiceProcess"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.ServiceProcess.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Speech"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Speech.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Transactions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Transactions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Abstractions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Abstractions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.ApplicationServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.ApplicationServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DataVisualization.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DataVisualization.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DataVisualization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DataVisualization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DynamicData.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DynamicData.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.DynamicData"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.DynamicData.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Entity.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Entity.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Entity"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Entity.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Extensions.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Extensions.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Extensions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Extensions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Mobile"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Mobile.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.RegularExpressions"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.RegularExpressions.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Routing"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Routing.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Web.Services"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Web.Services.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Forms.DataVisualization.Design"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Forms.DataVisualization.Design.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Forms.DataVisualization"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Forms.DataVisualization.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Forms"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Forms.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Input.Manipulations"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Input.Manipulations.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Windows.Presentation"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Windows.Presentation.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Workflow.Activities"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Workflow.Activities.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Workflow.ComponentModel"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Workflow.ComponentModel.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Workflow.Runtime"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Workflow.Runtime.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.WorkflowServices"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.WorkflowServices.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xaml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xaml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xml.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["System.Xml.Linq"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "System.Xml.Linq.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationClient"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationClient.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationClientsideProviders"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationClientsideProviders.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationProvider"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationProvider.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["UIAutomationTypes"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "UIAutomationTypes.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["WindowsBase"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "WindowsBase.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["WindowsFormsIntegration"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "WindowsFormsIntegration.dll"), Version = new Version(4, 0, 0, 0) }; frameworkInfo.Assemblies["XamlBuildTask"] = new AssemblyEntry { Path = Path.Combine(frameworkInfo.Path, "XamlBuildTask.dll"), Version = new Version(4, 0, 0, 0) }; return frameworkInfo; } } }
173.692231
249
0.701761
[ "Apache-2.0" ]
aspnet/DNX
src/Microsoft.Dnx.Runtime/FrameworkDefinitions.cs
174,389
C#
using Newtonsoft.Json; using System.ComponentModel.DataAnnotations; namespace WePay.KnowYourCustomer.Structure { /// <summary> /// Contains the user’s address information, including region and postcode. /// </summary> public class KycAddress { [JsonIgnore] private const string Identifier = "WePay.KnowYourCustomer.Structure.KycAddress"; /// <summary> /// The street address where the user resides. /// In the US, this parameter must begin with a digit and not contain PO. /// </summary> [Required(AllowEmptyStrings = false, ErrorMessage = Identifier + " - Requires Address1"), StringLength(60, ErrorMessage = Identifier + " - Address1 cannot exceed 60 characters")] public string Address1 { get; set; } /// <summary> /// A continuation of the users address. /// </summary> [StringLength(60, ErrorMessage = Identifier + " - Address2 cannot exceed 60 characters")] public string Address2 { get; set; } /// <summary> /// The city where the user resides. /// </summary> [Required(AllowEmptyStrings = false, ErrorMessage = Identifier + " - Requires City"), StringLength(30, ErrorMessage = Identifier + " - City cannot exceed 30 characters")] public string City { get; set; } /// <summary> /// The region where the user resides. /// </summary> [Required(AllowEmptyStrings = false, ErrorMessage = Identifier + " - Requires Region"), StringLength(30, ErrorMessage = Identifier + " - Region cannot exceed 30 characters")] public string Region { get; set; } /// <summary> /// The postcode where the user resides. /// </summary> [Required(AllowEmptyStrings = false, ErrorMessage = Identifier + " - Requires PostalCode"), StringLength(14, ErrorMessage = Identifier + " - PostalCode cannot exceed 14 characters")] public string PostalCode { get; set; } /// <summary> /// The country where the user resides. /// </summary> [Required(AllowEmptyStrings = false, ErrorMessage = Identifier + " - Requires Country"), StringLength(2, ErrorMessage = Identifier + " - Country cannot exceed 2 characters")] public string Country { get; set; } } }
42.232143
99
0.623256
[ "MIT" ]
PointmanDev/WePay.NET
WePay.NET/KnowYourCustomer/Structure/KycAddress.cs
2,369
C#
/* * Ory APIs * * Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. * * The version of the OpenAPI document: v0.0.1-alpha.42 * Contact: support@ory.sh * Generated by: https://github.com/openapitools/openapi-generator.git */ using Xunit; using System; using System.Linq; using System.IO; using System.Collections.Generic; using Ory.Client.Api; using Ory.Client.Model; using Ory.Client.Client; using System.Reflection; using Newtonsoft.Json; namespace Ory.Client.Test.Model { /// <summary> /// Class for testing ClientSelfServiceRecoveryLink /// </summary> /// <remarks> /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). /// Please update the test case below to test the model. /// </remarks> public class ClientSelfServiceRecoveryLinkTests : IDisposable { // TODO uncomment below to declare an instance variable for ClientSelfServiceRecoveryLink //private ClientSelfServiceRecoveryLink instance; public ClientSelfServiceRecoveryLinkTests() { // TODO uncomment below to create an instance of ClientSelfServiceRecoveryLink //instance = new ClientSelfServiceRecoveryLink(); } public void Dispose() { // Cleanup when everything is done. } /// <summary> /// Test an instance of ClientSelfServiceRecoveryLink /// </summary> [Fact] public void ClientSelfServiceRecoveryLinkInstanceTest() { // TODO uncomment below to test "IsType" ClientSelfServiceRecoveryLink //Assert.IsType<ClientSelfServiceRecoveryLink>(instance); } /// <summary> /// Test the property 'ExpiresAt' /// </summary> [Fact] public void ExpiresAtTest() { // TODO unit test for the property 'ExpiresAt' } /// <summary> /// Test the property 'RecoveryLink' /// </summary> [Fact] public void RecoveryLinkTest() { // TODO unit test for the property 'RecoveryLink' } } }
28.4125
179
0.641443
[ "Apache-2.0" ]
russelg/sdk
clients/client/dotnet/src/Ory.Client.Test/Model/ClientSelfServiceRecoveryLinkTests.cs
2,273
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ComponentModel; namespace downloader { public static class ExtensionMethod { public static TResult SafeInvoke<T, TResult>(this T isi, Func<T, TResult> call) where T : ISynchronizeInvoke { if (isi.InvokeRequired) { IAsyncResult result = isi.BeginInvoke(call, new object[] { isi }); object endResult = isi.EndInvoke(result); return (TResult)endResult; } else return call(isi); } public static void SafeInvoke<T>(this T isi, Action<T> call) where T : ISynchronizeInvoke { if (isi.InvokeRequired) isi.BeginInvoke(call, new object[] { isi }); else call(isi); } } }
28.645161
116
0.591216
[ "MIT" ]
aliostad/deep-learning-lang-detection
data/train/csharp/49ce1a02c4cc7f66bd6093921af2995ad36b735aExtensionMethod.cs
890
C#
// Copyright (c) Samuel Cragg. // // Licensed under the MIT license. See LICENSE file in the project root for // full license information. namespace SharpKml.Dom { using System; using SharpKml.Base; /// <summary> /// Defines a key/value pair that maps a mode /// (<see cref="Dom.StyleState"/>) to the predefined /// <see cref="StyleUrl"/> and/or a <see cref="StyleSelector"/>. /// </summary> /// <remarks> /// <para>OGC KML 2.2 Section 12.4.</para> /// <para>If both <c>StyleUrl</c> and <see cref="Selector"/> exist then /// their styles shall be merged.</para> /// </remarks> [KmlElement("Pair")] public class Pair : KmlObject { private StyleSelector selector; /// <summary> /// Gets or sets the associated <see cref="StyleSelector"/> of this instance. /// </summary> [KmlElement(null, 3)] public StyleSelector Selector { get => this.selector; set => this.UpdatePropertyChild(value, ref this.selector); } /// <summary> /// Gets or sets the <see cref="Dom.StyleState"/> for the key. /// </summary> [KmlElement("key", 1)] public StyleState? State { get; set; } /// <summary> /// Gets or sets a reference to a <see cref="Style"/> or /// <see cref="StyleMapCollection"/>. /// </summary> /// <remarks> /// The value of the fragment shall be the id of a <c>Style</c> or /// <c>StyleMap</c> defined in a <see cref="Document"/>. /// </remarks> [KmlElement("styleUrl", 2)] public Uri StyleUrl { get; set; } } }
32.111111
86
0.540369
[ "MIT" ]
D-Bullock/sharpkml
SharpKml/Dom/Styles/Pair.cs
1,736
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.Windows.Media.Animation; using Microsoft.Test.Stability.Core; namespace Microsoft.Test.Stability.Extensions.Factories { internal class SplineDecimalKeyFrameFactory : DecimalKeyFrameFactory<SplineDecimalKeyFrame> { #region Public Members public KeySpline KeySpline { get; set; } #endregion #region Override Members public override SplineDecimalKeyFrame Create(DeterministicRandom random) { SplineDecimalKeyFrame splineDecimalKeyFrame = new SplineDecimalKeyFrame(); splineDecimalKeyFrame.KeySpline = KeySpline; ApplyDecimalKeyFrameProperties(splineDecimalKeyFrame, random); return splineDecimalKeyFrame; } #endregion } }
30.25
95
0.719008
[ "MIT" ]
batzen/wpf-test
src/Test/Common/Code/Microsoft/Test/Stability/Extensions/Factories/System.Windows.Media.Animation/SplineDecimalKeyFrameFactory.cs
970
C#
namespace FrameworkTest.TestService { public class ReturnModel { public int code { get; set; } public object content { get; set; } } }
19.111111
44
0.575581
[ "MIT" ]
rentianhua/surfboard
UnitTest/FrameworkTest/TestService/Models.cs
174
C#
// *********************************************************************** // Assembly : Cql.Core.Common // Author : jeremy.bell // Created : 09-14-2017 // // Last Modified By : jeremy.bell // Last Modified On : 09-14-2017 // *********************************************************************** // <copyright file="AutocompleteItem.cs" company="CQL;Jeremy Bell"> // 2017 Cql Incorporated // </copyright> // <summary></summary> // *********************************************************************** namespace Cql.Core.Common.Types { using System; /// <summary> /// Class AutocompleteItem. /// </summary> public class AutocompleteItem { /// <summary> /// Initializes a new instance of the <see cref="AutocompleteItem"/> class. /// </summary> public AutocompleteItem() : this(string.Empty) { } /// <summary> /// Initializes a new instance of the <see cref="AutocompleteItem"/> class. /// </summary> /// <param name="id">The identifier.</param> /// <param name="text">The text.</param> public AutocompleteItem(object id, object text) : this(Convert.ToString(id), Convert.ToString(text)) { } /// <summary> /// Initializes a new instance of the <see cref="AutocompleteItem"/> class. /// </summary> /// <param name="text">The text.</param> public AutocompleteItem(string text) : this(text, text) { } /// <summary> /// Initializes a new instance of the <see cref="AutocompleteItem"/> class. /// </summary> /// <param name="id">The identifier.</param> /// <param name="text">The text.</param> public AutocompleteItem(string id, string text) { this.Id = id; this.Text = text; } /// <summary> /// Gets or sets the identifier. /// </summary> /// <value>The identifier.</value> public string Id { get; set; } /// <summary> /// Gets or sets the text. /// </summary> /// <value>The text.</value> public string Text { get; set; } } }
30.567568
83
0.475243
[ "MIT" ]
cqlcorp/cql.core
Cql.Core.Common/Types/AutocompleteItem.cs
2,262
C#
namespace DreamAITek.T001.Adapter { public class A026Adapter : A000Adapter { } }
14.285714
43
0.63
[ "MIT" ]
twoutlook/BlazorServerDbContextExample
BlazorServerEFCoreSample/Inventory/A000/Adapters/auto/A026Adapter.cs
102
C#
using NHapi.Base.Parser; using NHapi.Base; using NHapi.Base.Log; using System; using System.Collections.Generic; using NHapi.Model.V281.Segment; using NHapi.Model.V281.Datatype; using NHapi.Base.Model; namespace NHapi.Model.V281.Group { ///<summary> ///Represents the ORL_O34_SPECIMEN_OBSERVATION 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: OBX (Observation/Result) </li> ///<li>1: PRT (Participation Information) optional repeating</li> ///</ol> ///</summary> [Serializable] public class ORL_O34_SPECIMEN_OBSERVATION : AbstractGroup { ///<summary> /// Creates a new ORL_O34_SPECIMEN_OBSERVATION Group. ///</summary> public ORL_O34_SPECIMEN_OBSERVATION(IGroup parent, IModelClassFactory factory) : base(parent, factory){ try { this.add(typeof(OBX), true, false); this.add(typeof(PRT), false, true); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error creating ORL_O34_SPECIMEN_OBSERVATION - this is probably a bug in the source code generator.", e); } } ///<summary> /// Returns OBX (Observation/Result) - creates it if necessary ///</summary> public OBX OBX { get{ OBX ret = null; try { ret = (OBX)this.GetStructure("OBX"); } 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 PRT (Participation Information) - creates it if necessary ///</summary> public PRT GetPRT() { PRT ret = null; try { ret = (PRT)this.GetStructure("PRT"); } 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 PRT /// * (Participation Information) - creates it if necessary /// throws HL7Exception if the repetition requested is more than one /// greater than the number of existing repetitions. ///</summary> public PRT GetPRT(int rep) { return (PRT)this.GetStructure("PRT", rep); } /** * Returns the number of existing repetitions of PRT */ public int PRTRepetitionsUsed { get{ int reps = -1; try { reps = this.GetAll("PRT").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 PRT results */ public IEnumerable<PRT> PRTs { get { for (int rep = 0; rep < PRTRepetitionsUsed; rep++) { yield return (PRT)this.GetStructure("PRT", rep); } } } ///<summary> ///Adds a new PRT ///</summary> public PRT AddPRT() { return this.AddStructure("PRT") as PRT; } ///<summary> ///Removes the given PRT ///</summary> public void RemovePRT(PRT toRemove) { this.RemoveStructure("PRT", toRemove); } ///<summary> ///Removes the PRT at the given index ///</summary> public void RemovePRTAt(int index) { this.RemoveRepetition("PRT", index); } } }
26.947368
166
0.670201
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
AMCN41R/nHapi
src/NHapi.Model.V281/Group/ORL_O34_SPECIMEN_OBSERVATION.cs
3,584
C#
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("AWSSDK.Outposts")] [assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - AWS Outposts. This is the initial release for AWS Outposts, a fully managed service that extends AWS infrastructure, services, APIs, and tools to customer sites. AWS Outposts enables you to launch and run EC2 instances and EBS volumes locally at your on-premises location. This release introduces new APIs for creating and viewing Outposts. ")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("Amazon Web Services SDK for .NET")] [assembly: AssemblyCompany("Amazon.com, Inc")] [assembly: AssemblyCopyright("Copyright 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.5.0.8")]
52.5625
421
0.757432
[ "Apache-2.0" ]
orinem/aws-sdk-net
sdk/code-analysis/ServiceAnalysis/Outposts/Properties/AssemblyInfo.cs
1,682
C#
// <copyright file="AssemblyInfo.cs" company="Washington University in St. Louis"> // Copyright (c) 2021 Washington University in St. Louis. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // </copyright> using System; using System.Reflection; using System.Resources; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("WUSTL.EMed.EntityFramework.SqlServer.Temporal")] [assembly: AssemblyDescription("Adds a set of SQL Server temporal (system versioned) table Entity Framework migration operations.")] [assembly: AssemblyCompany("Emergency Medicine Information Technology Services, Department of Emergency Medicine, Washington University School of Medicine in St. Louis")] [assembly: AssemblyProduct("WUSTL.EMed.EntityFramework.SqlServer.Temporal")] [assembly: AssemblyCopyright("Copyright © 2021 Washington University in St. Louis")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Set assembly configuration based on DEBUG constant. #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif // 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)] [assembly: CLSCompliant(false)] [assembly: NeutralResourcesLanguage("en-US")] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("769379a5-a915-4430-8ee5-50c84ec9ef6e")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.1.0.0")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion(ThisAssembly.Git.Sha)]
43.692308
170
0.770246
[ "MIT" ]
WUSTL-EMED/WUSTL.EMed.EntityFramework.SqlServer.Temporal
WUSTL.EMed.EntityFramework.SqlServer.Temporal/Properties/AssemblyInfo.cs
2,275
C#
// UniqueConstraintTest.cs - NUnit Test Cases for testing the class System.Data.UniqueConstraint // // Authors: // Franklin Wise <gracenote@earthlink.net> // Martin Willemoes Hansen <mwh@sysrq.dk> // // (C) 2002 Franklin Wise // (C) 2003 Martin Willemoes Hansen // // // Copyright (C) 2004 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using NUnit.Framework; using System; using System.Data; namespace MonoTests.System.Data { [TestFixture] public class UniqueConstraintTest : Assertion { private DataTable _table; [SetUp] public void GetReady() { //Setup DataTable _table = new DataTable("TestTable"); _table.Columns.Add("Col1",typeof(int)); _table.Columns.Add("Col2",typeof(int)); _table.Columns.Add("Col3",typeof(int)); } [Test] public void CtorExceptions() { //UniqueConstraint(string name, DataColumn column, bool isPrimaryKey) UniqueConstraint cst; //must have DataTable exception try{ //Should throw an ArgumentException //Can only add DataColumns that are attached //to a DataTable cst = new UniqueConstraint(new DataColumn("")); Fail("Failed to throw ArgumentException."); } catch (Exception e) { AssertEquals ("test#02", typeof (ArgumentException), e.GetType ()); // Never premise English. // AssertEquals ("test#03", "Column must belong to a table.", e.Message); } //Null exception try { //Should throw argument null exception cst = new UniqueConstraint((DataColumn)null); } catch (Exception e) { AssertEquals ("test#05", typeof (NullReferenceException), e.GetType ()); // Never premise English. //AssertEquals ("test#06", "Object reference not set to an instance of an object.", e.Message); } try { //Should throw exception //must have at least one valid column //InvalidConstraintException is thrown by msft ver cst = new UniqueConstraint(new DataColumn [] {}); Fail("B1: Failed to throw InvalidConstraintException."); } catch (InvalidConstraintException) {} catch (AssertionException exc) {throw exc;} catch { Fail("A3: Wrong Exception type."); } DataTable dt = new DataTable("Table1"); dt.Columns.Add("Col1",typeof(int)); DataTable dt2 = new DataTable("Table2"); dt2.Columns.Add("Col1",typeof(int)); DataSet ds = new DataSet(); ds.Tables.Add(dt); ds.Tables.Add(dt2); //columns from two different tables. try { //next line should throw //can't have columns from two different tables cst = new UniqueConstraint(new DataColumn [] { dt.Columns[0], dt2.Columns[0]}); Fail("B2: Failed to throw InvalidConstraintException"); } catch (InvalidConstraintException) {} catch (AssertionException exc) {throw exc;} catch { Fail("A4: Wrong Exception type."); } } [Test] public void Ctor() { UniqueConstraint cst; //Success case try { cst = new UniqueConstraint(_table.Columns[0]); } catch (Exception exc) { Fail("A1: Failed to ctor. " + exc.ToString()); } try { cst = new UniqueConstraint( new DataColumn [] { _table.Columns[0], _table.Columns[1]}); } catch (Exception exc) { Fail("A2: Failed to ctor. " + exc.ToString()); } //table is set on ctor cst = new UniqueConstraint(_table.Columns[0]); AssertSame("B1", cst.Table, _table); //table is set on ctor cst = new UniqueConstraint( new DataColumn [] { _table.Columns[0], _table.Columns[1]}); AssertSame ("B2", cst.Table, _table); cst = new UniqueConstraint("MyName",_table.Columns[0],true); //Test ctor parm set for ConstraintName & IsPrimaryKey AssertEquals("ConstraintName not set in ctor.", "MyName", cst.ConstraintName); AssertEquals("IsPrimaryKey already set.", false, cst.IsPrimaryKey); _table.Constraints.Add (cst); AssertEquals("IsPrimaryKey not set set.", true, cst.IsPrimaryKey); AssertEquals("PrimaryKey not set.", 1, _table.PrimaryKey.Length); AssertEquals("Not unigue.", true, _table.PrimaryKey [0].Unique); } [Test] public void Unique () { UniqueConstraint U = new UniqueConstraint (_table.Columns [0]); AssertEquals ("test#01", false, _table.Columns [0].Unique); U = new UniqueConstraint (new DataColumn [] {_table.Columns [0],_table.Columns [1]}); AssertEquals ("test#02", false, _table.Columns [0].Unique); AssertEquals ("test#03", false, _table.Columns [1].Unique); AssertEquals ("test#04", false, _table.Columns [2].Unique); _table.Constraints.Add (U); AssertEquals ("test#05", false, _table.Columns [0].Unique); AssertEquals ("test#06", false, _table.Columns [1].Unique); AssertEquals ("test#07", false, _table.Columns [2].Unique); } [Test] public void EqualsAndHashCode() { UniqueConstraint cst = new UniqueConstraint( new DataColumn [] { _table.Columns[0], _table.Columns[1]}); UniqueConstraint cst2 = new UniqueConstraint( new DataColumn [] { _table.Columns[1], _table.Columns[0]}); UniqueConstraint cst3 = new UniqueConstraint(_table.Columns[0]); UniqueConstraint cst4 = new UniqueConstraint(_table.Columns[2]); //true Assert(cst.Equals(cst2) == true); //false Assert("A1", cst.Equals(23) == false); Assert("A2", cst.Equals(cst3) == false); Assert("A3", cst3.Equals(cst) == false); Assert("A4", cst.Equals(cst4) == false); //true Assert("HashEquals", cst.GetHashCode() == cst2.GetHashCode()); //false Assert("Hash Not Equals", (cst.GetHashCode() == cst3.GetHashCode()) == false); } [Test] public void DBNullAllowed () { DataTable dt = new DataTable ("table"); dt.Columns.Add ("col1"); dt.Columns.Add ("col2"); dt.Constraints.Add (new UniqueConstraint (dt.Columns [0])); dt.Rows.Add (new object [] {1, 3}); dt.Rows.Add (new object [] {DBNull.Value, 3}); } } }
32.105485
127
0.617427
[ "Apache-2.0" ]
Sectoid/debian-mono
mcs/class/System.Data/Test/System.Data/UniqueConstraintTest.cs
7,609
C#
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Microsoft.VisualStudio.Services.Agent.Util; using System; using System.Collections.Generic; using Microsoft.TeamFoundation.DistributedTask.Logging; // // Pattern: // cmd1 cmd2 --arg1 arg1val --aflag --arg2 arg2val // namespace Microsoft.VisualStudio.Services.Agent { public sealed class CommandLineParser { private ISecretMasker _secretMasker; private Tracing _trace; public List<string> Commands { get; } public HashSet<string> Flags { get; } public Dictionary<string, string> Args { get; } public HashSet<string> SecretArgNames { get; } private bool HasArgs { get; set; } public CommandLineParser(IHostContext hostContext, string[] secretArgNames) { _secretMasker = hostContext.SecretMasker; _trace = hostContext.GetTrace(nameof(CommandLineParser)); Commands = new List<string>(); Flags = new HashSet<string>(StringComparer.OrdinalIgnoreCase); Args = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); SecretArgNames = new HashSet<string>(secretArgNames ?? new string[0], StringComparer.OrdinalIgnoreCase); } public bool IsCommand(string name) { bool result = false; if (Commands.Count > 0) { result = String.Equals(name, Commands[0], StringComparison.CurrentCultureIgnoreCase); } return result; } public void Parse(string[] args) { _trace.Info(nameof(Parse)); ArgUtil.NotNull(args, nameof(args)); _trace.Info("Parsing {0} args", args.Length); string argScope = null; foreach (string arg in args) { _trace.Info("parsing argument"); HasArgs = HasArgs || arg.StartsWith("--"); _trace.Info("HasArgs: {0}", HasArgs); if (string.Equals(arg, "/?", StringComparison.Ordinal)) { Flags.Add("help"); } else if (!HasArgs) { _trace.Info("Adding Command: {0}", arg); Commands.Add(arg.Trim()); } else { // it's either an arg, an arg value or a flag if (arg.StartsWith("--") && arg.Length > 2) { string argVal = arg.Substring(2); _trace.Info("arg: {0}", argVal); // this means two --args in a row which means previous was a flag if (argScope != null) { _trace.Info("Adding flag: {0}", argScope); Flags.Add(argScope.Trim()); } argScope = argVal; } else if (!arg.StartsWith("-")) { // we found a value - check if we're in scope of an arg if (argScope != null && !Args.ContainsKey(argScope = argScope.Trim())) { if (SecretArgNames.Contains(argScope)) { _secretMasker.AddValue(arg); } _trace.Info("Adding option '{0}': '{1}'", argScope, arg); // ignore duplicates - first wins - below will be val1 // --arg1 val1 --arg1 val1 Args.Add(argScope, arg); argScope = null; } } else { // // ignoring the second value for an arg (val2 below) // --arg val1 val2 // ignoring invalid things like empty - and -- // --arg val1 -- --flag _trace.Info("Ignoring arg"); } } } _trace.Verbose("done parsing arguments"); // handle last arg being a flag if (argScope != null) { Flags.Add(argScope); } _trace.Verbose("Exiting parse"); } } }
34.732824
116
0.460879
[ "MIT" ]
BobSilent/azure-pipelines-agent
src/Microsoft.VisualStudio.Services.Agent/CommandLineParser.cs
4,550
C#
namespace BolRetailerApi.Models.Response.Orders { public class ShipmentDetails { public string PickupPointName { get; set; } public string Salutation { get; set; } public string FirstName { get; set; } public string SurName { get; set; } public string StreetName { get; set; } public string HouseNumber { get; set; } public string HouseNumberExtension { get; set; } public string ExtraAddressInformation { get; set; } public string ZipCode { get; set; } public string City { get; set; } public string CountryCode { get; set; } public string Email { get; set; } public string Company { get; set; } public string DeliveryPhoneNumber { get; set; } public string Language { get; set; } } }
38.952381
59
0.617359
[ "MIT" ]
Soneritics/BolRetailerAPI
BolRetailerAPI/Models/Response/Orders/ShipmentDetails.cs
820
C#
using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using AutoMapper; using CarDealer.DTO; using CarDealer.Models; namespace CarDealer { public class CarDealerProfile : Profile { public CarDealerProfile() { this.CreateMap<Car, CarsDTO>(); this.CreateMap<Supplier, SuppliersDTO>() .ForMember(x => x.PartsCount, y => y.MapFrom(s => s.Parts.Count)); this.CreateMap<Customer, CustomerTotalSalesDTO>() .ForMember(x => x.FullName, y => y.MapFrom(s => s.Name)) .ForMember(x => x.BoughtCars, y => y.MapFrom(s => s.Sales.Count)) .ForMember(x => x.SpentMoney, y => y.MapFrom(s => s.Sales .Select(s => s.Car .PartCars .Select(pc => pc.Part) .Sum(pc => pc.Price)) .Sum())); } } }
37.787879
103
0.417803
[ "MIT" ]
georgidelchev/CSharp-Databases
02 - [Entity Framework Core]/16 - [JSON Processing - Exercise]/CarDealer/CarDealerProfile.cs
1,249
C#
using System; using System.Collections; using System.Linq; using SkbKontur.DbViewer.Configuration; namespace SkbKontur.DbViewer.Helpers { public static class ObjectPropertyEditor { public static object SetValue(object obj, string[] path, string? value, ICustomPropertyConfigurationProvider propertyConfigurator) { var objectType = obj.GetType(); if (obj is IList list) { var type = objectType.HasElementType ? objectType.GetElementType() : objectType.GetGenericArguments()[0]; var index = int.Parse(path[0]); var newValue = path.Length == 1 ? ParseInternal(type, value, propertyConfigurator) : SetValue(list[index], path.Skip(1).ToArray(), value, propertyConfigurator); list[index] = newValue; return obj; } if (obj is IDictionary dictionary) { var args = objectType.GetGenericArguments(); var key = ParseInternal(args[0], path[0], propertyConfigurator); var newValue = path.Length == 1 ? ParseInternal(args[1], value, propertyConfigurator) : SetValue(dictionary[key], path.Skip(1).ToArray(), value, propertyConfigurator); dictionary[key] = newValue; return obj; } var property = objectType.GetProperty(path[0]); if (property == null) throw new InvalidOperationException($"Expected type {objectType} to have property {path[0]}"); var propertyConfiguration = propertyConfigurator.TryGetConfiguration(obj, property); if (propertyConfiguration != null) { if (path.Length == 1) { property.SetValue(obj, propertyConfiguration.ApiToStored(ObjectParser.Parse(propertyConfiguration.ResolvedType, value))); return obj; } var oldValue = propertyConfiguration.StoredToApi(property.GetValue(obj)); if (oldValue == null) throw new InvalidOperationException($"Unable to set inner value for property {property.Name} of type {propertyConfiguration.ResolvedType}"); var intermediateValue = SetValue(oldValue, path.Skip(1).ToArray(), value, propertyConfigurator); var newValue = propertyConfiguration.ApiToStored(intermediateValue); property.SetValue(obj, newValue); return obj; } var newPropertyValue = path.Length == 1 ? ObjectParser.Parse(property.PropertyType, value) : SetValue(property.GetValue(obj), path.Skip(1).ToArray(), value, propertyConfigurator); property.SetValue(obj, newPropertyValue); return obj; } private static object? ParseInternal(Type type, string? value, ICustomPropertyConfigurationProvider propertyConfigurator) { var configuration = propertyConfigurator.TryGetConfiguration(type); var parsedObject = ObjectParser.Parse(configuration?.ResolvedType ?? type, value); return configuration == null ? parsedObject : configuration.ApiToStored(parsedObject); } } }
47.410959
160
0.587691
[ "MIT" ]
RomanKhasanov/db-viewer
DbViewer/Helpers/ObjectPropertyEditor.cs
3,461
C#
#region License //MIT License // //Copyright (c) 2017 Dave Glick // //Permission is hereby granted, free of charge, to any person obtaining a copy //of this software and associated documentation files (the "Software"), to deal //in the Software without restriction, including without limitation the rights //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell //copies of the Software, and to permit persons to whom the Software is //furnished to do so, subject to the following conditions: // //The above copyright notice and this permission notice shall be included in all //copies or substantial portions of the Software. // //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE //SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; namespace DocGenerator.Buildalyzer.Environment { internal static class DotnetPathResolver { private const string DotnetCliUiLanguage = nameof(DotnetCliUiLanguage); private static string _basePath; private static readonly object BasePathLock = new object(); public static string ResolvePath(string projectPath) { lock (BasePathLock) { if (_basePath != null) return _basePath; // Need to rety calling "dotnet --info" and do a hacky timeout for the process otherwise it occasionally locks up during testing (and possibly in the field) List<string> lines; var retry = 0; do { lines = GetInfo(projectPath); retry++; } while ((lines == null || lines.Count == 0) && retry < 5); _basePath = ParseBasePath(lines); return _basePath; } } private static List<string> GetInfo(string projectPath) { // Ensure that we set the DOTNET_CLI_UI_LANGUAGE environment variable to "en-US" before // running 'dotnet --info'. Otherwise, we may get localized results. var originalCliLanguage = System.Environment.GetEnvironmentVariable(DotnetCliUiLanguage); System.Environment.SetEnvironmentVariable(DotnetCliUiLanguage, "en-US"); try { // Create the process info var process = new Process(); process.StartInfo.FileName = "dotnet"; process.StartInfo.Arguments = "--info"; process.StartInfo.WorkingDirectory = Path.GetDirectoryName(projectPath); // global.json may change the version, so need to set working directory process.StartInfo.CreateNoWindow = true; process.StartInfo.UseShellExecute = false; // Capture output var lines = new List<string>(); process.StartInfo.RedirectStandardOutput = true; process.OutputDataReceived += (s, e) => lines.Add(e.Data); // Execute the process process.Start(); process.BeginOutputReadLine(); var sw = new Stopwatch(); sw.Start(); while (!process.HasExited) { if (sw.ElapsedMilliseconds > 4000) break; } sw.Stop(); process.Close(); return lines; } finally { System.Environment.SetEnvironmentVariable(DotnetCliUiLanguage, originalCliLanguage); } } private static string ParseBasePath(List<string> lines) { if (lines == null || lines.Count == 0) throw new InvalidOperationException("Could not get results from `dotnet --info` call"); foreach (var line in lines) { var colonIndex = line.IndexOf(':'); if (colonIndex >= 0 && line.Substring(0, colonIndex).Trim().Equals("Base Path", StringComparison.OrdinalIgnoreCase)) { var basePath = line.Substring(colonIndex + 1).Trim(); // Make sure the base path matches the runtime architecture if on Windows // Note that this only works for the default installation locations under "Program Files" if (basePath.Contains(@"\Program Files\") && !System.Environment.Is64BitProcess) { var newBasePath = basePath.Replace(@"\Program Files\", @"\Program Files (x86)\"); if (Directory.Exists(newBasePath)) basePath = newBasePath; } else if (basePath.Contains(@"\Program Files (x86)\") && System.Environment.Is64BitProcess) { var newBasePath = basePath.Replace(@"\Program Files (x86)\", @"\Program Files\"); if (Directory.Exists(newBasePath)) basePath = newBasePath; } return basePath; } } throw new InvalidOperationException("Could not locate base path in `dotnet --info` results"); } } }
34.544118
160
0.711154
[ "Apache-2.0" ]
EamonHetherton/elasticsearch-net
src/CodeGeneration/DocGenerator/Buildalyzer/Environment/DotnetPathResolver.cs
4,700
C#
namespace file_convert { partial class MainForm { /// <summary> /// 必需的设计器变量。 /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// 清理所有正在使用的资源。 /// </summary> /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows 窗体设计器生成的代码 /// <summary> /// 设计器支持所需的方法 - 不要修改 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { this.logBox = new System.Windows.Forms.RichTextBox(); this.SuspendLayout(); // // logBox // this.logBox.Dock = System.Windows.Forms.DockStyle.Fill; this.logBox.Location = new System.Drawing.Point(0, 0); this.logBox.Name = "logBox"; this.logBox.ReadOnly = true; this.logBox.Size = new System.Drawing.Size(1245, 708); this.logBox.TabIndex = 0; this.logBox.Text = ""; // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ButtonFace; this.ClientSize = new System.Drawing.Size(1245, 708); this.Controls.Add(this.logBox); this.MaximizeBox = false; this.Name = "MainForm"; this.ShowIcon = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "文件转换服务"; this.Shown += new System.EventHandler(this.MainForm_Shown); this.ResumeLayout(false); } #endregion private System.Windows.Forms.RichTextBox logBox; } }
31.238806
85
0.537506
[ "MIT" ]
void-soul/file-convert
file-convert/MainForm.Designer.cs
2,261
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Xna.Framework; using WzComparerR2.Rendering; namespace WzComparerR2.MapRender { public interface IWcR2Font { float Size { get; } float LineHeight { get; set; } object BaseFont { get; } Vector2 MeasureString(string text); Vector2 MeasureString(StringBuilder text); } public class D2DFontAdapter : IWcR2Font { public D2DFontAdapter(D2DFont baseFont) { if (baseFont == null) { throw new ArgumentNullException("baseFont"); } this._baseFont = baseFont; } public float Size { get { return this._baseFont.Size; } } public float LineHeight { get { return this._baseFont.Height; } set { this._baseFont.Height = value; } } public object BaseFont { get { return this._baseFont; } } private readonly D2DFont _baseFont; public Vector2 MeasureString(string text) { return this._baseFont.MeasureString(text); } public Vector2 MeasureString(StringBuilder text) { return this._baseFont.MeasureString(text.ToString()); } } public class XnaFontAdapter : IWcR2Font, IDisposable { public XnaFontAdapter(XnaFont baseFont) { if (baseFont == null) { throw new ArgumentNullException("baseFont"); } this._baseFont = baseFont; } public float Size { get { return this._baseFont.Height; } } public float LineHeight { get { return this._baseFont.Height; } set { this._baseFont.Height = (int)value; } } public object BaseFont { get { return this._baseFont; } } private readonly XnaFont _baseFont; public Vector2 MeasureString(string text) { return this._baseFont.MeasureString(text); } public Vector2 MeasureString(StringBuilder text) { return this._baseFont.MeasureString(text); } protected virtual void Dispose(bool disposing) { if (disposing) { this._baseFont.Dispose(); } } public void Dispose() { Dispose(true); } } }
25.670103
67
0.564257
[ "MIT" ]
Atomadeus/WzComparerR2
WzComparerR2.MapRender/IWcR2Font.cs
2,492
C#
using System; namespace _11NumbersInIntervalDividableByGivenNumber { class Program { static void Main() { int p = 0; int j = 0; int start = int.Parse(Console.ReadLine()); int end = int.Parse(Console.ReadLine()); int[] k = new int[end]; for(int i = start;i<=end;i++) { if (i % 5 == 0) { k[j] = i; j++; } } Console.Write("p = {0} Coments:",j); for (int i = 0; i < j; i++) Console.Write("{0}, ", k[i]); } } }
22.258065
54
0.355072
[ "MIT" ]
GoranGit/CSharp
Homework/4-Console-In-and-Out/11NumbersInIntervalDividableByGivenNumber/Program.cs
692
C#
namespace YunXun.Dapper.DataFactory { /// <summary> /// Defines the DatabaseType. /// </summary> public enum DatabaseType { /// <summary> /// Defines the SqlServer. /// </summary> SqlServer, /// <summary> /// Defines the MySQL. /// </summary> MySQL } }
18.052632
36
0.483965
[ "MIT" ]
castorhrio/CoreWebApi
YunXun.Dapper/DataFactory/DatabaseType.cs
345
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HERENCIA { public class SuperPoderes: villano { public string TipoPoder { get; set; } } }
16.2
45
0.695473
[ "MIT" ]
lelhernandez/ventass
HERENCIA/HERENCIA/SuperPoderes.cs
245
C#
using System; using System.Collections.Generic; using System.Linq; using Foundation; using UIKit; using Plugin.PushNotification; namespace PushNotificationSample.iOS { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to // application events from iOS. [Register("AppDelegate")] public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate { // // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); LoadApplication(new App()); PushNotificationManager.Initialize(options); return base.FinishedLaunching(app, options); } public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken) { PushNotificationManager.DidRegisterRemoteNotifications(deviceToken); } public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error) { PushNotificationManager.RemoteNotificationRegistrationFailed(error); } // To receive notifications in foregroung on iOS 9 and below. // To receive notifications in background in any iOS version public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action<UIBackgroundFetchResult> completionHandler) { PushNotificationManager.DidReceiveMessage(userInfo); } } }
37.240741
158
0.704625
[ "MIT" ]
BlueChilli/PushNotificationPlugin
samples/PushNotificationSample/PushNotificationSample.iOS/AppDelegate.cs
2,013
C#
// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; using lro = Google.LongRunning; using wkt = Google.Protobuf.WellKnownTypes; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; using stt = System.Threading.Tasks; using xunit = Xunit; namespace Google.Cloud.AssuredWorkloads.V1Beta1.Tests { /// <summary>Generated unit tests.</summary> public sealed class GeneratedAssuredWorkloadsServiceClientTest { [xunit::FactAttribute] public void UpdateWorkloadRequestObject() { moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); UpdateWorkloadRequest request = new UpdateWorkloadRequest { Workload = new Workload(), UpdateMask = new wkt::FieldMask(), }; Workload expectedResponse = new Workload { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), DisplayName = "display_name137f65c2", Resources = { new Workload.Types.ResourceInfo(), }, ComplianceRegime = Workload.Types.ComplianceRegime.FedrampHigh, CreateTime = new wkt::Timestamp(), BillingAccount = "billing_account2062abb6", Il4Settings = new Workload.Types.IL4Settings(), CjisSettings = new Workload.Types.CJISSettings(), Etag = "etage8ad7218", Labels = { { "key8a0b6e3c", "value60c16320" }, }, FedrampHighSettings = new Workload.Types.FedrampHighSettings(), FedrampModerateSettings = new Workload.Types.FedrampModerateSettings(), }; mockGrpcClient.Setup(x => x.UpdateWorkload(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null); Workload response = client.UpdateWorkload(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task UpdateWorkloadRequestObjectAsync() { moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); UpdateWorkloadRequest request = new UpdateWorkloadRequest { Workload = new Workload(), UpdateMask = new wkt::FieldMask(), }; Workload expectedResponse = new Workload { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), DisplayName = "display_name137f65c2", Resources = { new Workload.Types.ResourceInfo(), }, ComplianceRegime = Workload.Types.ComplianceRegime.FedrampHigh, CreateTime = new wkt::Timestamp(), BillingAccount = "billing_account2062abb6", Il4Settings = new Workload.Types.IL4Settings(), CjisSettings = new Workload.Types.CJISSettings(), Etag = "etage8ad7218", Labels = { { "key8a0b6e3c", "value60c16320" }, }, FedrampHighSettings = new Workload.Types.FedrampHighSettings(), FedrampModerateSettings = new Workload.Types.FedrampModerateSettings(), }; mockGrpcClient.Setup(x => x.UpdateWorkloadAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Workload>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null); Workload responseCallSettings = await client.UpdateWorkloadAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Workload responseCancellationToken = await client.UpdateWorkloadAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void UpdateWorkload() { moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); UpdateWorkloadRequest request = new UpdateWorkloadRequest { Workload = new Workload(), UpdateMask = new wkt::FieldMask(), }; Workload expectedResponse = new Workload { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), DisplayName = "display_name137f65c2", Resources = { new Workload.Types.ResourceInfo(), }, ComplianceRegime = Workload.Types.ComplianceRegime.FedrampHigh, CreateTime = new wkt::Timestamp(), BillingAccount = "billing_account2062abb6", Il4Settings = new Workload.Types.IL4Settings(), CjisSettings = new Workload.Types.CJISSettings(), Etag = "etage8ad7218", Labels = { { "key8a0b6e3c", "value60c16320" }, }, FedrampHighSettings = new Workload.Types.FedrampHighSettings(), FedrampModerateSettings = new Workload.Types.FedrampModerateSettings(), }; mockGrpcClient.Setup(x => x.UpdateWorkload(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null); Workload response = client.UpdateWorkload(request.Workload, request.UpdateMask); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task UpdateWorkloadAsync() { moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); UpdateWorkloadRequest request = new UpdateWorkloadRequest { Workload = new Workload(), UpdateMask = new wkt::FieldMask(), }; Workload expectedResponse = new Workload { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), DisplayName = "display_name137f65c2", Resources = { new Workload.Types.ResourceInfo(), }, ComplianceRegime = Workload.Types.ComplianceRegime.FedrampHigh, CreateTime = new wkt::Timestamp(), BillingAccount = "billing_account2062abb6", Il4Settings = new Workload.Types.IL4Settings(), CjisSettings = new Workload.Types.CJISSettings(), Etag = "etage8ad7218", Labels = { { "key8a0b6e3c", "value60c16320" }, }, FedrampHighSettings = new Workload.Types.FedrampHighSettings(), FedrampModerateSettings = new Workload.Types.FedrampModerateSettings(), }; mockGrpcClient.Setup(x => x.UpdateWorkloadAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Workload>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null); Workload responseCallSettings = await client.UpdateWorkloadAsync(request.Workload, request.UpdateMask, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Workload responseCancellationToken = await client.UpdateWorkloadAsync(request.Workload, request.UpdateMask, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void DeleteWorkloadRequestObject() { moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); DeleteWorkloadRequest request = new DeleteWorkloadRequest { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), Etag = "etage8ad7218", }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteWorkload(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null); client.DeleteWorkload(request); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task DeleteWorkloadRequestObjectAsync() { moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); DeleteWorkloadRequest request = new DeleteWorkloadRequest { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), Etag = "etage8ad7218", }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteWorkloadAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null); await client.DeleteWorkloadAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); await client.DeleteWorkloadAsync(request, st::CancellationToken.None); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void DeleteWorkload() { moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); DeleteWorkloadRequest request = new DeleteWorkloadRequest { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteWorkload(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null); client.DeleteWorkload(request.Name); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task DeleteWorkloadAsync() { moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); DeleteWorkloadRequest request = new DeleteWorkloadRequest { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteWorkloadAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null); await client.DeleteWorkloadAsync(request.Name, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); await client.DeleteWorkloadAsync(request.Name, st::CancellationToken.None); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void DeleteWorkloadResourceNames() { moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); DeleteWorkloadRequest request = new DeleteWorkloadRequest { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteWorkload(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null); client.DeleteWorkload(request.WorkloadName); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task DeleteWorkloadResourceNamesAsync() { moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); DeleteWorkloadRequest request = new DeleteWorkloadRequest { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteWorkloadAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null); await client.DeleteWorkloadAsync(request.WorkloadName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); await client.DeleteWorkloadAsync(request.WorkloadName, st::CancellationToken.None); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void GetWorkloadRequestObject() { moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); GetWorkloadRequest request = new GetWorkloadRequest { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), }; Workload expectedResponse = new Workload { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), DisplayName = "display_name137f65c2", Resources = { new Workload.Types.ResourceInfo(), }, ComplianceRegime = Workload.Types.ComplianceRegime.FedrampHigh, CreateTime = new wkt::Timestamp(), BillingAccount = "billing_account2062abb6", Il4Settings = new Workload.Types.IL4Settings(), CjisSettings = new Workload.Types.CJISSettings(), Etag = "etage8ad7218", Labels = { { "key8a0b6e3c", "value60c16320" }, }, FedrampHighSettings = new Workload.Types.FedrampHighSettings(), FedrampModerateSettings = new Workload.Types.FedrampModerateSettings(), }; mockGrpcClient.Setup(x => x.GetWorkload(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null); Workload response = client.GetWorkload(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task GetWorkloadRequestObjectAsync() { moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); GetWorkloadRequest request = new GetWorkloadRequest { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), }; Workload expectedResponse = new Workload { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), DisplayName = "display_name137f65c2", Resources = { new Workload.Types.ResourceInfo(), }, ComplianceRegime = Workload.Types.ComplianceRegime.FedrampHigh, CreateTime = new wkt::Timestamp(), BillingAccount = "billing_account2062abb6", Il4Settings = new Workload.Types.IL4Settings(), CjisSettings = new Workload.Types.CJISSettings(), Etag = "etage8ad7218", Labels = { { "key8a0b6e3c", "value60c16320" }, }, FedrampHighSettings = new Workload.Types.FedrampHighSettings(), FedrampModerateSettings = new Workload.Types.FedrampModerateSettings(), }; mockGrpcClient.Setup(x => x.GetWorkloadAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Workload>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null); Workload responseCallSettings = await client.GetWorkloadAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Workload responseCancellationToken = await client.GetWorkloadAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void GetWorkload() { moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); GetWorkloadRequest request = new GetWorkloadRequest { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), }; Workload expectedResponse = new Workload { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), DisplayName = "display_name137f65c2", Resources = { new Workload.Types.ResourceInfo(), }, ComplianceRegime = Workload.Types.ComplianceRegime.FedrampHigh, CreateTime = new wkt::Timestamp(), BillingAccount = "billing_account2062abb6", Il4Settings = new Workload.Types.IL4Settings(), CjisSettings = new Workload.Types.CJISSettings(), Etag = "etage8ad7218", Labels = { { "key8a0b6e3c", "value60c16320" }, }, FedrampHighSettings = new Workload.Types.FedrampHighSettings(), FedrampModerateSettings = new Workload.Types.FedrampModerateSettings(), }; mockGrpcClient.Setup(x => x.GetWorkload(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null); Workload response = client.GetWorkload(request.Name); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task GetWorkloadAsync() { moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); GetWorkloadRequest request = new GetWorkloadRequest { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), }; Workload expectedResponse = new Workload { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), DisplayName = "display_name137f65c2", Resources = { new Workload.Types.ResourceInfo(), }, ComplianceRegime = Workload.Types.ComplianceRegime.FedrampHigh, CreateTime = new wkt::Timestamp(), BillingAccount = "billing_account2062abb6", Il4Settings = new Workload.Types.IL4Settings(), CjisSettings = new Workload.Types.CJISSettings(), Etag = "etage8ad7218", Labels = { { "key8a0b6e3c", "value60c16320" }, }, FedrampHighSettings = new Workload.Types.FedrampHighSettings(), FedrampModerateSettings = new Workload.Types.FedrampModerateSettings(), }; mockGrpcClient.Setup(x => x.GetWorkloadAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Workload>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null); Workload responseCallSettings = await client.GetWorkloadAsync(request.Name, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Workload responseCancellationToken = await client.GetWorkloadAsync(request.Name, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public void GetWorkloadResourceNames() { moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); GetWorkloadRequest request = new GetWorkloadRequest { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), }; Workload expectedResponse = new Workload { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), DisplayName = "display_name137f65c2", Resources = { new Workload.Types.ResourceInfo(), }, ComplianceRegime = Workload.Types.ComplianceRegime.FedrampHigh, CreateTime = new wkt::Timestamp(), BillingAccount = "billing_account2062abb6", Il4Settings = new Workload.Types.IL4Settings(), CjisSettings = new Workload.Types.CJISSettings(), Etag = "etage8ad7218", Labels = { { "key8a0b6e3c", "value60c16320" }, }, FedrampHighSettings = new Workload.Types.FedrampHighSettings(), FedrampModerateSettings = new Workload.Types.FedrampModerateSettings(), }; mockGrpcClient.Setup(x => x.GetWorkload(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null); Workload response = client.GetWorkload(request.WorkloadName); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] public async stt::Task GetWorkloadResourceNamesAsync() { moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient> mockGrpcClient = new moq::Mock<AssuredWorkloadsService.AssuredWorkloadsServiceClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object); GetWorkloadRequest request = new GetWorkloadRequest { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), }; Workload expectedResponse = new Workload { WorkloadName = WorkloadName.FromOrganizationLocationWorkload("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"), DisplayName = "display_name137f65c2", Resources = { new Workload.Types.ResourceInfo(), }, ComplianceRegime = Workload.Types.ComplianceRegime.FedrampHigh, CreateTime = new wkt::Timestamp(), BillingAccount = "billing_account2062abb6", Il4Settings = new Workload.Types.IL4Settings(), CjisSettings = new Workload.Types.CJISSettings(), Etag = "etage8ad7218", Labels = { { "key8a0b6e3c", "value60c16320" }, }, FedrampHighSettings = new Workload.Types.FedrampHighSettings(), FedrampModerateSettings = new Workload.Types.FedrampModerateSettings(), }; mockGrpcClient.Setup(x => x.GetWorkloadAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Workload>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AssuredWorkloadsServiceClient client = new AssuredWorkloadsServiceClientImpl(mockGrpcClient.Object, null); Workload responseCallSettings = await client.GetWorkloadAsync(request.WorkloadName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Workload responseCancellationToken = await client.GetWorkloadAsync(request.WorkloadName, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } } }
58.054845
224
0.63166
[ "Apache-2.0" ]
fayssalmartanigcp/google-cloud-dotnet
apis/Google.Cloud.AssuredWorkloads.V1Beta1/Google.Cloud.AssuredWorkloads.V1Beta1.Tests/AssuredWorkloadsServiceClientTest.g.cs
31,756
C#
namespace GoogleTestUI { using System; using OpenQA.Selenium; using OpenQA.Selenium.Support.UI; using static CommonUtils; public class Wait { public static readonly int defaultTimeout = GetIntSetting("defaultTimeout"); public static readonly int pollingInterval = GetIntSetting("pollingInterval"); public object ObjectToReturn = null; public int WebTimeoutElement = defaultTimeout; public int PollingInterval = pollingInterval; public Type IgnoreExceptionType = null; public string Message = ""; public bool Until(Func<bool> condition) { Func<object, bool> func = (x) => condition(); var result = WaitUntil(func); if (result == null) return false; else return true; } public IWebElement Until(Func<IWebElement, bool> condition, IWebElement webElement) { ObjectToReturn = webElement; return WaitUntil(condition); } private T WaitUntil<T>(Func<T, bool> condition) { if (Message == "") Message = condition.ToString() + " did not happened in defaultTimeout: " + defaultTimeout.ToString(); if (ObjectToReturn == null) ObjectToReturn = CurrentPage.ActiveWebElement; IWait<T> wait = new DefaultWait<T>((T)ObjectToReturn) { Timeout = TimeSpan.FromSeconds(WebTimeoutElement), Message = Message, PollingInterval = TimeSpan.FromMilliseconds(PollingInterval), }; if (IgnoreExceptionType != null) wait.IgnoreExceptionTypes(IgnoreExceptionType); try { wait.Until(condition); } catch (TimeoutException) { return default(T); } return (T)ObjectToReturn; } } }
31.95
132
0.585811
[ "Apache-2.0" ]
jenyabak/GoogleTestsUI
GoogleTestsUI/FrameWork/Wripper/Wait.cs
1,919
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the autoscaling-2011-01-01.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AutoScaling.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; namespace Amazon.AutoScaling.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ServiceLinkedRoleFailureException operation /// </summary> public class ServiceLinkedRoleFailureExceptionUnmarshaller : IErrorResponseUnmarshaller<ServiceLinkedRoleFailureException, XmlUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public ServiceLinkedRoleFailureException Unmarshall(XmlUnmarshallerContext context) { return this.Unmarshall(context, new ErrorResponse()); } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="errorResponse"></param> /// <returns></returns> public ServiceLinkedRoleFailureException Unmarshall(XmlUnmarshallerContext context, ErrorResponse errorResponse) { ServiceLinkedRoleFailureException response = new ServiceLinkedRoleFailureException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) targetDepth += 2; while (context.ReadAtDepth(originalDepth)) { if (context.IsStartElement || context.IsAttribute) { } } return response; } private static ServiceLinkedRoleFailureExceptionUnmarshaller _instance = new ServiceLinkedRoleFailureExceptionUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ServiceLinkedRoleFailureExceptionUnmarshaller Instance { get { return _instance; } } } }
36.431818
150
0.660636
[ "Apache-2.0" ]
ChristopherButtars/aws-sdk-net
sdk/src/Services/AutoScaling/Generated/Model/Internal/MarshallTransformations/ServiceLinkedRoleFailureExceptionUnmarshaller.cs
3,206
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Linq.Expressions; using System.Net; using System.Net.Http; using System.Net.Http.Formatting; using System.Net.Http.Headers; using System.Threading; using System.Threading.Tasks; using System.Web.Http.Controllers; using System.Web.Http.ModelBinding; using Microsoft.TestCommon; using Moq; namespace System.Web.Http.Results { public class InvalidModelStateResultTests { [Fact] public void Constructor_Throws_WhenModelStateIsNull() { // Arrange ModelStateDictionary modelState = null; bool includeErrorDetail = true; IContentNegotiator contentNegotiator = CreateDummyContentNegotiator(); using (HttpRequestMessage request = CreateRequest()) { IEnumerable<MediaTypeFormatter> formatters = CreateFormatters(); // Act & Assert Assert.ThrowsArgumentNull(() => { CreateProductUnderTest(modelState, includeErrorDetail, contentNegotiator, request, formatters); }, "modelState"); } } [Fact] public void Constructor_Throws_WhenContentNegotiatorIsNull() { // Arrange ModelStateDictionary modelState = CreateModelState(); bool includeErrorDetail = true; IContentNegotiator contentNegotiator = null; using (HttpRequestMessage request = CreateRequest()) { IEnumerable<MediaTypeFormatter> formatters = CreateFormatters(); // Act & Assert Assert.ThrowsArgumentNull(() => { CreateProductUnderTest(modelState, includeErrorDetail, contentNegotiator, request, formatters); }, "contentNegotiator"); } } [Fact] public void Constructor_Throws_WhenRequestIsNull() { // Arrange ModelStateDictionary modelState = CreateModelState(); bool includeErrorDetail = true; IContentNegotiator contentNegotiator = CreateDummyContentNegotiator(); HttpRequestMessage request = null; IEnumerable<MediaTypeFormatter> formatters = CreateFormatters(); // Act & Assert Assert.ThrowsArgumentNull(() => { CreateProductUnderTest(modelState, includeErrorDetail, contentNegotiator, request, formatters); }, "request"); } [Fact] public void Constructor_Throws_WhenFormattersIsNull() { // Arrange ModelStateDictionary modelState = CreateModelState(); bool includeErrorDetail = true; IContentNegotiator contentNegotiator = CreateDummyContentNegotiator(); using (HttpRequestMessage request = CreateRequest()) { IEnumerable<MediaTypeFormatter> formatters = null; // Act & Assert Assert.ThrowsArgumentNull(() => { CreateProductUnderTest(modelState, includeErrorDetail, contentNegotiator, request, formatters); }, "formatters"); } } [Fact] public void ModelState_ReturnsInstanceProvided() { // Arrange ModelStateDictionary expectedModelState = CreateModelState(); bool includeErrorDetail = true; IContentNegotiator contentNegotiator = CreateDummyContentNegotiator(); using (HttpRequestMessage request = CreateRequest()) { IEnumerable<MediaTypeFormatter> formatters = CreateFormatters(); InvalidModelStateResult result = CreateProductUnderTest(expectedModelState, includeErrorDetail, contentNegotiator, request, formatters); // Act ModelStateDictionary modelState = result.ModelState; // Assert Assert.Same(expectedModelState, modelState); } } [Fact] public void IncludeErrorDetail_ReturnsValueProvided() { // Arrange ModelStateDictionary modelState = CreateModelState(); bool expectedIncludeErrorDetail = true; IContentNegotiator contentNegotiator = CreateDummyContentNegotiator(); using (HttpRequestMessage request = CreateRequest()) { IEnumerable<MediaTypeFormatter> formatters = CreateFormatters(); InvalidModelStateResult result = CreateProductUnderTest(modelState, expectedIncludeErrorDetail, contentNegotiator, request, formatters); // Act bool includeErrorDetail = result.IncludeErrorDetail; // Assert Assert.Equal(expectedIncludeErrorDetail, includeErrorDetail); } } [Fact] public void ContentNegotiator_ReturnsInstanceProvided() { // Arrange ModelStateDictionary modelState = CreateModelState(); bool includeErrorDetail = true; IContentNegotiator expectedContentNegotiator = CreateDummyContentNegotiator(); using (HttpRequestMessage request = CreateRequest()) { IEnumerable<MediaTypeFormatter> formatters = CreateFormatters(); InvalidModelStateResult result = CreateProductUnderTest(modelState, includeErrorDetail, expectedContentNegotiator, request, formatters); // Act IContentNegotiator contentNegotiator = result.ContentNegotiator; // Assert Assert.Same(expectedContentNegotiator, contentNegotiator); } } [Fact] public void Request_ReturnsInstanceProvided() { // Arrange ModelStateDictionary modelState = CreateModelState(); bool includeErrorDetail = true; IContentNegotiator contentNegotiator = CreateDummyContentNegotiator(); using (HttpRequestMessage expectedRequest = CreateRequest()) { IEnumerable<MediaTypeFormatter> formatters = CreateFormatters(); InvalidModelStateResult result = CreateProductUnderTest(modelState, includeErrorDetail, contentNegotiator, expectedRequest, formatters); // Act HttpRequestMessage request = result.Request; // Assert Assert.Same(expectedRequest, request); } } [Fact] public void Formatters_ReturnsInstanceProvided() { // Arrange ModelStateDictionary modelState = CreateModelState(); bool includeErrorDetail = true; IContentNegotiator contentNegotiator = CreateDummyContentNegotiator(); using (HttpRequestMessage request = CreateRequest()) { IEnumerable<MediaTypeFormatter> expectedFormatters = CreateFormatters(); InvalidModelStateResult result = CreateProductUnderTest(modelState, includeErrorDetail, contentNegotiator, request, expectedFormatters); // Act IEnumerable<MediaTypeFormatter> formatters = result.Formatters; // Assert Assert.Same(expectedFormatters, formatters); } } [Fact] public async Task ExecuteAsync_ReturnsCorrectResponse_WhenContentNegotiationSucceedsAndIncludeErrorDetailIsTrue() { // Arrange ModelStateDictionary modelState = CreateModelState(); string expectedModelStateKey = "ModelStateKey"; string expectedModelStateExceptionMessage = "ModelStateExceptionMessage"; modelState.AddModelError(expectedModelStateKey, new InvalidOperationException( expectedModelStateExceptionMessage)); bool includeErrorDetail = true; MediaTypeFormatter expectedFormatter = CreateFormatter(); MediaTypeHeaderValue expectedMediaType = CreateMediaType(); ContentNegotiationResult negotiationResult = new ContentNegotiationResult(expectedFormatter, expectedMediaType); using (HttpRequestMessage expectedRequest = CreateRequest()) { IEnumerable<MediaTypeFormatter> expectedFormatters = CreateFormatters(); Mock<IContentNegotiator> spy = new Mock<IContentNegotiator>(); spy.Setup(n => n.Negotiate(typeof(HttpError), expectedRequest, expectedFormatters)).Returns( negotiationResult); IContentNegotiator contentNegotiator = spy.Object; IHttpActionResult result = CreateProductUnderTest(modelState, includeErrorDetail, contentNegotiator, expectedRequest, expectedFormatters); // Act Task<HttpResponseMessage> task = result.ExecuteAsync(CancellationToken.None); // Assert Assert.NotNull(task); using (HttpResponseMessage response = await task) { Assert.NotNull(response); Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); HttpContent content = response.Content; ObjectContent<HttpError> typedContent = Assert.IsType<ObjectContent<HttpError>>(content); HttpError error = (HttpError)typedContent.Value; Assert.NotNull(error); HttpError modelStateError = error.ModelState; Assert.NotNull(modelStateError); Assert.True(modelState.ContainsKey(expectedModelStateKey)); object modelStateValue = modelStateError[expectedModelStateKey]; string[] typedModelStateValues = Assert.IsType<string[]>(modelStateValue); string typedModelStateValue = Assert.Single(typedModelStateValues); Assert.Same(expectedModelStateExceptionMessage, typedModelStateValue); Assert.Same(expectedFormatter, typedContent.Formatter); Assert.NotNull(typedContent.Headers); Assert.Equal(expectedMediaType, typedContent.Headers.ContentType); Assert.Same(expectedRequest, response.RequestMessage); } } } [Fact] public async Task ExecuteAsync_ReturnsCorrectResponse_WhenContentNegotiationSucceedsAndIncludeErrorDetailIsFalse() { // Arrange ModelStateDictionary modelState = CreateModelState(); string expectedModelStateKey = "ModelStateKey"; string expectedModelStateErrorMessage = "ModelStateErrorMessage"; ModelState originalModelStateItem = new ModelState(); originalModelStateItem.Errors.Add(new ModelError(new InvalidOperationException(), expectedModelStateErrorMessage)); modelState.Add(expectedModelStateKey, originalModelStateItem); bool includeErrorDetail = false; MediaTypeFormatter expectedFormatter = CreateFormatter(); MediaTypeHeaderValue expectedMediaType = CreateMediaType(); ContentNegotiationResult negotiationResult = new ContentNegotiationResult(expectedFormatter, expectedMediaType); using (HttpRequestMessage expectedRequest = CreateRequest()) { IEnumerable<MediaTypeFormatter> expectedFormatters = CreateFormatters(); Mock<IContentNegotiator> spy = new Mock<IContentNegotiator>(); spy.Setup(n => n.Negotiate(typeof(HttpError), expectedRequest, expectedFormatters)).Returns( negotiationResult); IContentNegotiator contentNegotiator = spy.Object; IHttpActionResult result = CreateProductUnderTest(modelState, includeErrorDetail, contentNegotiator, expectedRequest, expectedFormatters); // Act Task<HttpResponseMessage> task = result.ExecuteAsync(CancellationToken.None); // Assert Assert.NotNull(task); using (HttpResponseMessage response = await task) { Assert.NotNull(response); Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); HttpContent content = response.Content; ObjectContent<HttpError> typedContent = Assert.IsType<ObjectContent<HttpError>>(content); HttpError error = (HttpError)typedContent.Value; Assert.NotNull(error); HttpError modelStateError = error.ModelState; Assert.NotNull(modelStateError); Assert.True(modelState.ContainsKey(expectedModelStateKey)); object modelStateValue = modelStateError[expectedModelStateKey]; string[] typedModelStateValues = Assert.IsType<string[]>(modelStateValue); string typedModelStateValue = Assert.Single(typedModelStateValues); Assert.Same(expectedModelStateErrorMessage, typedModelStateValue); Assert.Same(expectedFormatter, typedContent.Formatter); Assert.NotNull(typedContent.Headers); Assert.Equal(expectedMediaType, typedContent.Headers.ContentType); Assert.Same(expectedRequest, response.RequestMessage); } } } [Fact] public async Task ExecuteAsync_ReturnsCorrectResponse_WhenContentNegotiationFails() { // Arrange ModelStateDictionary modelState = CreateModelStateWithError(); bool includeErrorDetail = true; ContentNegotiationResult negotiationResult = null; using (HttpRequestMessage expectedRequest = CreateRequest()) { IEnumerable<MediaTypeFormatter> expectedFormatters = CreateFormatters(); Mock<IContentNegotiator> spy = new Mock<IContentNegotiator>(); spy.Setup(n => n.Negotiate(typeof(ModelStateDictionary), expectedRequest, expectedFormatters)).Returns( negotiationResult); IContentNegotiator contentNegotiator = spy.Object; IHttpActionResult result = CreateProductUnderTest(modelState, includeErrorDetail, contentNegotiator, expectedRequest, expectedFormatters); // Act Task<HttpResponseMessage> task = result.ExecuteAsync(CancellationToken.None); // Assert Assert.NotNull(task); using (HttpResponseMessage response = await task) { Assert.NotNull(response); Assert.Equal(HttpStatusCode.NotAcceptable, response.StatusCode); Assert.Same(expectedRequest, response.RequestMessage); } } } [Fact] public void Constructor_ForApiController_Throws_WhenControllerIsNull() { // Arrange ModelStateDictionary modelState = CreateModelState(); ApiController controller = null; // Act & Assert Assert.ThrowsArgumentNull(() => { CreateProductUnderTest(modelState, controller); }, "controller"); } [Fact] public async Task ExecuteAsync_ForApiController_ReturnsCorrectResponse_WhenContentNegotationSucceeds() { // Arrange ModelStateDictionary modelState = CreateModelState(); string expectedModelStateKey = "ModelStateKey"; string expectedModelStateExceptionMessage = "ModelStateExceptionMessage"; modelState.AddModelError(expectedModelStateKey, new InvalidOperationException( expectedModelStateExceptionMessage)); ApiController controller = CreateController(); MediaTypeFormatter expectedInputFormatter = CreateFormatter(); MediaTypeFormatter expectedOutputFormatter = CreateFormatter(); MediaTypeHeaderValue expectedMediaType = CreateMediaType(); ContentNegotiationResult negotiationResult = new ContentNegotiationResult(expectedOutputFormatter, expectedMediaType); Expression<Func<IEnumerable<MediaTypeFormatter>, bool>> formattersMatch = (f) => f != null && f.AsArray().Length == 1 && f.AsArray()[0] == expectedInputFormatter; using (HttpRequestMessage expectedRequest = CreateRequest()) { Mock<IContentNegotiator> spy = new Mock<IContentNegotiator>(); spy.Setup(n => n.Negotiate(typeof(HttpError), expectedRequest, It.Is(formattersMatch))).Returns( negotiationResult); IContentNegotiator contentNegotiator = spy.Object; using (HttpConfiguration configuration = CreateConfiguration(expectedInputFormatter, contentNegotiator)) { controller.RequestContext = new HttpRequestContext { Configuration = configuration, IncludeErrorDetail = true }; controller.Request = expectedRequest; IHttpActionResult result = CreateProductUnderTest(modelState, controller); // Act Task<HttpResponseMessage> task = result.ExecuteAsync(CancellationToken.None); // Assert Assert.NotNull(task); using (HttpResponseMessage response = await task) { Assert.NotNull(response); Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); HttpContent content = response.Content; ObjectContent<HttpError> typedContent = Assert.IsType<ObjectContent<HttpError>>(content); HttpError error = (HttpError)typedContent.Value; Assert.NotNull(error); HttpError modelStateError = error.ModelState; Assert.NotNull(modelStateError); Assert.True(modelState.ContainsKey(expectedModelStateKey)); object modelStateValue = modelStateError[expectedModelStateKey]; string[] typedModelStateValues = Assert.IsType<string[]>(modelStateValue); string typedModelStateValue = Assert.Single(typedModelStateValues); Assert.Same(expectedModelStateExceptionMessage, typedModelStateValue); Assert.Same(expectedOutputFormatter, typedContent.Formatter); Assert.NotNull(typedContent.Headers); Assert.Equal(expectedMediaType, typedContent.Headers.ContentType); Assert.Same(expectedRequest, response.RequestMessage); } } } } [Fact] public void IncludeErrorDetail_ForApiController_EvaluatesLazily() { // Arrange ModelStateDictionary modelState = CreateModelState(); ApiController controller = CreateController(); using (HttpConfiguration configuration = CreateConfiguration(CreateFormatter(), CreateDummyContentNegotiator())) { configuration.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always; controller.Configuration = configuration; using (HttpRequestMessage request = CreateRequest()) { controller.Request = request; InvalidModelStateResult result = CreateProductUnderTest(modelState, controller); configuration.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Never; // Act IContentNegotiator contentNegotiator = result.ContentNegotiator; // Assert Assert.False(result.IncludeErrorDetail); } } } [Fact] public void ContentNegotiator_ForApiController_EvaluatesLazily() { // Arrange ModelStateDictionary modelState = CreateModelState(); ApiController controller = CreateController(); using (HttpConfiguration configuration = CreateConfiguration(CreateFormatter(), CreateDummyContentNegotiator())) { controller.Configuration = configuration; using (HttpRequestMessage request = CreateRequest()) { controller.Request = request; InvalidModelStateResult result = CreateProductUnderTest(modelState, controller); IContentNegotiator expectedContentNegotiator = CreateDummyContentNegotiator(); configuration.Services.Replace(typeof(IContentNegotiator), expectedContentNegotiator); // Act IContentNegotiator contentNegotiator = result.ContentNegotiator; // Assert Assert.Same(expectedContentNegotiator, contentNegotiator); } } } [Fact] public void Request_ForApiController_EvaluatesLazily() { // Arrange ModelStateDictionary modelState = CreateModelState(); MediaTypeFormatter formatter = CreateFormatter(); MediaTypeHeaderValue mediaType = CreateMediaType(); ApiController controller = CreateController(); using (HttpConfiguration configuration = CreateConfiguration(CreateFormatter(), CreateDummyContentNegotiator())) { controller.Configuration = configuration; InvalidModelStateResult result = CreateProductUnderTest(modelState, controller); using (HttpRequestMessage expectedRequest = CreateRequest()) { controller.Request = expectedRequest; // Act HttpRequestMessage request = result.Request; // Assert Assert.Same(expectedRequest, request); } } } [Fact] public void Formatters_ForApiController_EvaluatesLazily() { // Arrange ModelStateDictionary modelState = CreateModelState(); ApiController controller = CreateController(); IContentNegotiator contentNegotiator = CreateDummyContentNegotiator(); using (HttpConfiguration earlyConfiguration = CreateConfiguration(CreateFormatter(), contentNegotiator)) using (HttpRequestMessage request = CreateRequest()) { controller.Configuration = earlyConfiguration; controller.Request = request; InvalidModelStateResult result = CreateProductUnderTest(modelState, controller); MediaTypeFormatter expectedFormatter = CreateFormatter(); using (HttpConfiguration lateConfiguration = CreateConfiguration(expectedFormatter, contentNegotiator)) { controller.Configuration = lateConfiguration; // Act IEnumerable<MediaTypeFormatter> formatters = result.Formatters; // Assert Assert.NotNull(formatters); MediaTypeFormatter formatter = Assert.Single(formatters); Assert.Same(expectedFormatter, formatter); } } } [Fact] public void IncludeErrorDetail_ForApiController_EvaluatesOnce() { // Arrange ModelStateDictionary modelState = CreateModelState(); ApiController controller = CreateController(); using (HttpConfiguration configuration = CreateConfiguration(CreateFormatter(), CreateDummyContentNegotiator())) using (HttpRequestMessage request = CreateRequest()) { HttpRequestContext requestContext = new HttpRequestContext { Configuration = configuration, IncludeErrorDetail = true }; controller.RequestContext = requestContext; controller.Request = request; InvalidModelStateResult result = CreateProductUnderTest(modelState, controller); bool ignore = result.IncludeErrorDetail; requestContext.IncludeErrorDetail = false; // Act bool includeErrorDetail = result.IncludeErrorDetail; // Assert Assert.True(includeErrorDetail); } } [Fact] public void ContentNegotiator_ForApiController_EvaluatesOnce() { // Arrange ModelStateDictionary modelState = CreateModelState(); IContentNegotiator expectedContentNegotiator = CreateDummyContentNegotiator(); ApiController controller = CreateController(); using (HttpConfiguration configuration = CreateConfiguration(CreateFormatter(), expectedContentNegotiator)) using (HttpRequestMessage request = CreateRequest()) { controller.Configuration = configuration; controller.Request = request; InvalidModelStateResult result = CreateProductUnderTest(modelState, controller); IContentNegotiator ignore = result.ContentNegotiator; configuration.Services.Replace(typeof(IContentNegotiator), CreateDummyContentNegotiator()); // Act IContentNegotiator contentNegotiator = result.ContentNegotiator; // Assert Assert.Same(expectedContentNegotiator, contentNegotiator); } } [Fact] public void Request_ForApiController_EvaluatesOnce() { // Arrange ModelStateDictionary modelState = CreateModelState(); ApiController controller = CreateController(); using (HttpConfiguration configuration = CreateConfiguration(CreateFormatter(), CreateDummyContentNegotiator())) { controller.Configuration = configuration; InvalidModelStateResult result = CreateProductUnderTest(modelState, controller); using (HttpRequestMessage expectedRequest = CreateRequest()) { controller.Request = expectedRequest; HttpRequestMessage ignore = result.Request; using (HttpRequestMessage otherRequest = CreateRequest()) { controller.Request = otherRequest; // Act HttpRequestMessage request = result.Request; // Assert Assert.Same(expectedRequest, request); } } } } [Fact] public void Formatters_ForApiController_EvaluatesOnce() { // Arrange ModelStateDictionary modelState = CreateModelState(); ApiController controller = CreateController(); MediaTypeFormatter expectedFormatter = CreateFormatter(); IContentNegotiator contentNegotiator = CreateDummyContentNegotiator(); using (HttpConfiguration earlyConfiguration = CreateConfiguration(expectedFormatter, contentNegotiator)) using (HttpRequestMessage request = CreateRequest()) { controller.Configuration = earlyConfiguration; controller.Request = request; InvalidModelStateResult result = CreateProductUnderTest(modelState, controller); IEnumerable<MediaTypeFormatter> ignore = result.Formatters; using (HttpConfiguration lateConfiguration = CreateConfiguration(CreateFormatter(), contentNegotiator)) { controller.Configuration = lateConfiguration; // Act IEnumerable<MediaTypeFormatter> formatters = result.Formatters; // Assert Assert.NotNull(formatters); MediaTypeFormatter formatter = Assert.Single(formatters); Assert.Same(expectedFormatter, formatter); } } } [Fact] public void IncludeErrorDetail_ForApiController_Throws_WhenControllerRequestIsNull() { // Arrange ModelStateDictionary modelState = CreateModelState(); ApiController controller = CreateController(); Assert.Null(controller.Request); using (HttpConfiguration configuration = CreateConfiguration(CreateFormatter(), CreateDummyContentNegotiator())) { controller.Configuration = configuration; InvalidModelStateResult result = CreateProductUnderTest(modelState, controller); // Act & Assert InvalidOperationException exception = Assert.Throws<InvalidOperationException>(() => { bool ignore = result.IncludeErrorDetail; }, "ApiController.Request must not be null."); } } [Fact] public void ContentNegotiator_ForApiController_Throws_WhenConfigurationIsNull() { // Arrange ModelStateDictionary modelState = CreateModelState(); ApiController controller = CreateController(); HttpControllerContext context = new HttpControllerContext(); using (HttpRequestMessage request = CreateRequest()) { controller.ControllerContext = context; InvalidModelStateResult result = CreateProductUnderTest(modelState, controller); // Act & Assert Assert.Throws<InvalidOperationException>( () => { IContentNegotiator ignore = result.ContentNegotiator; }, "HttpControllerContext.Configuration must not be null."); } } [Fact] public void ContentNegotiator_ForApiController_Throws_WhenServiceIsNull() { // Arrange ModelStateDictionary modelState = CreateModelState(); ApiController controller = CreateController(); using (HttpConfiguration configuration = CreateConfiguration(CreateFormatter(), null)) using (HttpRequestMessage request = CreateRequest()) { controller.Request = request; controller.Configuration = configuration; InvalidModelStateResult result = CreateProductUnderTest(modelState, controller); // Act & Assert Assert.Throws<InvalidOperationException>( () => { IContentNegotiator ignore = result.ContentNegotiator; }, "The provided configuration does not have an instance of the " + "'System.Net.Http.Formatting.IContentNegotiator' service registered."); } } [Fact] public void ApiControllerBadRequest_WithModelStateDictionary_CreatesCorrectResult() { // Arrange ModelStateDictionary expectedModelState = CreateModelState(); ApiController controller = CreateController(); // Act InvalidModelStateResult result = controller.BadRequest(expectedModelState); // Assert Assert.NotNull(result); Assert.Same(expectedModelState, result.ModelState); using (HttpConfiguration configuration = CreateConfiguration(CreateFormatter(), CreateDummyContentNegotiator())) using (HttpRequestMessage expectedRequest = CreateRequest()) { controller.Configuration = configuration; controller.Request = expectedRequest; Assert.Same(expectedRequest, result.Request); } } private static HttpConfiguration CreateConfiguration(MediaTypeFormatter formatter, IContentNegotiator contentNegotiator) { HttpConfiguration configuration = new HttpConfiguration(); configuration.Formatters.Clear(); configuration.Formatters.Add(formatter); configuration.Services.Replace(typeof(IContentNegotiator), contentNegotiator); return configuration; } private static ApiController CreateController() { return new FakeController(); } private static IContentNegotiator CreateDummyContentNegotiator() { return new Mock<IContentNegotiator>(MockBehavior.Strict).Object; } private static MediaTypeFormatter CreateFormatter() { return new StubMediaTypeFormatter(); } private static IEnumerable<MediaTypeFormatter> CreateFormatters() { return new MediaTypeFormatter[0]; } private static MediaTypeHeaderValue CreateMediaType() { return new MediaTypeHeaderValue("text/plain"); } private static ModelStateDictionary CreateModelState() { return new ModelStateDictionary(); } private static ModelStateDictionary CreateModelStateWithError() { ModelStateDictionary modelState = new ModelStateDictionary(); modelState.AddModelError(String.Empty, String.Empty); return modelState; } private static InvalidModelStateResult CreateProductUnderTest(ModelStateDictionary modelState, bool includeErrorDetail, IContentNegotiator contentNegotiator, HttpRequestMessage request, IEnumerable<MediaTypeFormatter> formatters) { return new InvalidModelStateResult(modelState, includeErrorDetail, contentNegotiator, request, formatters); } private static InvalidModelStateResult CreateProductUnderTest(ModelStateDictionary modelState, ApiController controller) { return new InvalidModelStateResult(modelState, controller); } private static HttpRequestMessage CreateRequest() { return new HttpRequestMessage(); } private class StubMediaTypeFormatter : MediaTypeFormatter { public override bool CanReadType(Type type) { return true; } public override bool CanWriteType(Type type) { return true; } } private class FakeController : ApiController { } } }
41.49768
122
0.607643
[ "Apache-2.0" ]
1508553303/AspNetWebStack
test/System.Web.Http.Test/Results/InvalidModelStateResultTests.cs
35,773
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AwsNative.ElasticLoadBalancingV2.Outputs { [OutputType] public sealed class TargetGroupTag { public readonly string Key; public readonly string Value; [OutputConstructor] private TargetGroupTag( string key, string value) { Key = key; Value = value; } } }
22.866667
81
0.642857
[ "Apache-2.0" ]
AaronFriel/pulumi-aws-native
sdk/dotnet/ElasticLoadBalancingV2/Outputs/TargetGroupTag.cs
686
C#
using System.Windows.Controls; namespace StudentsCalendar.Desktop { /// <summary> /// Interaction logic for PopupsView.xaml /// </summary> public partial class PopupsView : UserControl { public PopupsView() { InitializeComponent(); } } }
15.9375
46
0.701961
[ "MIT" ]
jakubfijalkowski/studentscalendar
StudentsCalendar.Desktop/PopupsView.xaml.cs
257
C#
using System; using Locust.ServiceModel; using Locust.Modules.Api.Model; namespace Locust.Modules.Api.Strategies { public partial class ApiDeleteResponse : BaseServiceResponse<object, ApiDeleteStatus> { public override bool IsSuccessfull() { return Status == ApiDeleteStatus.Success; } public override bool IsFailed() { return Status == ApiDeleteStatus.Failed; } public override bool IsErrored() { return Status == ApiDeleteStatus.Errored; } public override bool IsFaulted() { return Status == ApiDeleteStatus.Faulted; } public ApiDeleteResponse() : this(ApiDeleteStatus.None, default(object)) { } public ApiDeleteResponse(ApiDeleteStatus status,object data) : base(status, data) { } public override void Faulted() { this.Status = ApiDeleteStatus.Faulted; } public override void Succeeded() { this.Status = ApiDeleteStatus.Success; } public override void Failed() { this.Status = ApiDeleteStatus.Failed; } public override void Errored() { this.Status = ApiDeleteStatus.Errored; } public override void NotFound() { throw new NotImplementedException(); } public override bool SetStatus(object status) { var result = ApiDeleteStatus.None; if (status == null || !Enum.TryParse(status.ToString(), true, out result)) { result = ApiDeleteStatus.InvalidStatus; } this.Status = result; return this.Status != ApiDeleteStatus.InvalidStatus; } } }
25.422535
86
0.576177
[ "MIT" ]
mansoor-omrani/Locust.NET
Modules/Locust.Modules.Api/Service/Api/Delete/Response.cs
1,805
C#
using System.Collections.Generic; using AspNetCore3Example.Services; using Microsoft.AspNetCore.Mvc; namespace AspNetCore3Example.Controllers { /// <summary> /// Simple REST API controller that shows Autofac injecting dependencies. /// </summary> /// <seealso cref="Microsoft.AspNetCore.Mvc.Controller" /> [ApiController] [Route("api/[controller]")] public class ValuesController : ControllerBase { private readonly IValuesService _valuesService; private readonly IValuesService2 _valuesService2; public ValuesController(IValuesService valuesService) { this._valuesService = valuesService; } // GET api/values [HttpGet] public IEnumerable<string> Get() { return this._valuesService.FindAll(); } // GET api/values/5 [HttpGet("{id}")] public string Get(int id) { return this._valuesService.Find(id); } } }
25.692308
77
0.628743
[ "MIT" ]
kywvane/Autofac.InjectionAttribute
src/AspNetCore3Example/Controllers/ValuesController.cs
1,004
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by \generate-code.bat. // // Changes to this file will be lost when the code is regenerated. // The build server regenerates the code before each build and a pre-build // step will regenerate the code on each local build. // // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. // Add Extensions\MyQuantityExtensions.cs to decorate quantities with new behavior. // Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. // // </auto-generated> //------------------------------------------------------------------------------ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.Globalization; using System.Text.RegularExpressions; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; // ReSharper disable once CheckNamespace namespace UnitsNet { /// <summary> /// The joule, symbol J, is a derived unit of energy, work, or amount of heat in the International System of Units. It is equal to the energy transferred (or work done) when applying a force of one newton through a distance of one metre (1 newton metre or N·m), or in passing an electric current of one ampere through a resistance of one ohm for one second. Many other units of energy are included. Please do not confuse this definition of the calorie with the one colloquially used by the food industry, the large calorie, which is equivalent to 1 kcal. Thermochemical definition of the calorie is used. For BTU, the IT definition is used. /// </summary> // ReSharper disable once PartialTypeWithSinglePart public partial struct Energy : IComparable, IComparable<Energy> { /// <summary> /// The numeric value this quantity was constructed with. /// </summary> public double Value => _value; /// <summary> /// Get unit abbreviation string. /// </summary> /// <param name="unit">Unit to get abbreviation for.</param> /// <param name="provider">Format to use for localization. Defaults to <see cref="UnitSystem.DefaultCulture" />.</param> /// <returns>Unit abbreviation string.</returns> [UsedImplicitly] public static string GetAbbreviation(EnergyUnit unit, [CanBeNull] IFormatProvider provider) { provider = provider ?? UnitSystem.DefaultCulture; return UnitSystem.GetCached(provider).GetDefaultAbbreviation(unit); } #region Arithmetic Operators public static Energy operator -(Energy right) { return new Energy(-right.Value, right.Unit); } public static Energy operator +(Energy left, Energy right) { return new Energy(left.Value + right.AsBaseNumericType(left.Unit), left.Unit); } public static Energy operator -(Energy left, Energy right) { return new Energy(left.Value - right.AsBaseNumericType(left.Unit), left.Unit); } public static Energy operator *(double left, Energy right) { return new Energy(left * right.Value, right.Unit); } public static Energy operator *(Energy left, double right) { return new Energy(left.Value * right, left.Unit); } public static Energy operator /(Energy left, double right) { return new Energy(left.Value / right, left.Unit); } public static double operator /(Energy left, Energy right) { return left.Joules / right.Joules; } #endregion public static bool operator <=(Energy left, Energy right) { return left.Value <= right.AsBaseNumericType(left.Unit); } public static bool operator >=(Energy left, Energy right) { return left.Value >= right.AsBaseNumericType(left.Unit); } public static bool operator <(Energy left, Energy right) { return left.Value < right.AsBaseNumericType(left.Unit); } public static bool operator >(Energy left, Energy right) { return left.Value > right.AsBaseNumericType(left.Unit); } [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(Energy, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Energy left, Energy right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(Energy, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Energy left, Energy right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value != right.AsBaseNumericType(left.Unit); } #region Parsing /// <summary> /// Parse a string with one or two quantities of the format "&lt;quantity&gt; &lt;unit&gt;". /// </summary> /// <param name="str">String to parse. Typically in the form: {number} {unit}</param> /// <param name="provider">Format to use when parsing number and unit. Defaults to <see cref="UnitSystem.DefaultCulture" />.</param> /// <example> /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// </example> /// <exception cref="ArgumentNullException">The value of 'str' cannot be null. </exception> /// <exception cref="ArgumentException"> /// Expected string to have one or two pairs of quantity and unit in the format /// "&lt;quantity&gt; &lt;unit&gt;". Eg. "5.5 m" or "1ft 2in" /// </exception> /// <exception cref="AmbiguousUnitParseException"> /// More than one unit is represented by the specified unit abbreviation. /// Example: Volume.Parse("1 cup") will throw, because it can refer to any of /// <see cref="VolumeUnit.MetricCup" />, <see cref="VolumeUnit.UsLegalCup" /> and <see cref="VolumeUnit.UsCustomaryCup" />. /// </exception> /// <exception cref="UnitsNetException"> /// If anything else goes wrong, typically due to a bug or unhandled case. /// We wrap exceptions in <see cref="UnitsNetException" /> to allow you to distinguish /// Units.NET exceptions from other exceptions. /// </exception> public static Energy Parse(string str, [CanBeNull] IFormatProvider provider) { if (str == null) throw new ArgumentNullException(nameof(str)); provider = provider ?? UnitSystem.DefaultCulture; return QuantityParser.Parse<Energy, EnergyUnit>(str, provider, delegate(string value, string unit, IFormatProvider formatProvider2) { double parsedValue = double.Parse(value, formatProvider2); EnergyUnit parsedUnit = ParseUnit(unit, formatProvider2); return From(parsedValue, parsedUnit); }, (x, y) => FromJoules(x.Joules + y.Joules)); } /// <summary> /// Try to parse a string with one or two quantities of the format "&lt;quantity&gt; &lt;unit&gt;". /// </summary> /// <param name="str">String to parse. Typically in the form: {number} {unit}</param> /// <param name="provider">Format to use when parsing number and unit. Defaults to <see cref="UnitSystem.DefaultCulture" />.</param> /// <param name="result">Resulting unit quantity if successful.</param> /// <example> /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// </example> public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Energy result) { provider = provider ?? UnitSystem.DefaultCulture; try { result = Parse(str, provider); return true; } catch { result = default(Energy); return false; } } /// <summary> /// Parse a unit string. /// </summary> /// <param name="str">String to parse. Typically in the form: {number} {unit}</param> /// <param name="cultureName">Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to <see cref="UnitSystem" />'s default culture.</param> /// <example> /// Length.ParseUnit("m", new CultureInfo("en-US")); /// </example> /// <exception cref="ArgumentNullException">The value of 'str' cannot be null. </exception> /// <exception cref="UnitsNetException">Error parsing string.</exception> [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] public static EnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) { return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); } /// <summary> /// Parse a unit string. /// </summary> /// <param name="str">String to parse. Typically in the form: {number} {unit}</param> /// <param name="provider">Format to use when parsing number and unit. Defaults to <see cref="UnitSystem.DefaultCulture" />.</param> /// <example> /// Length.ParseUnit("m", new CultureInfo("en-US")); /// </example> /// <exception cref="ArgumentNullException">The value of 'str' cannot be null. </exception> /// <exception cref="UnitsNetException">Error parsing string.</exception> public static EnergyUnit ParseUnit(string str, IFormatProvider provider = null) { if (str == null) throw new ArgumentNullException(nameof(str)); var unitSystem = UnitSystem.GetCached(provider); var unit = unitSystem.Parse<EnergyUnit>(str.Trim()); if (unit == EnergyUnit.Undefined) { var newEx = new UnitsNetException("Error parsing string. The unit is not a recognized EnergyUnit."); newEx.Data["input"] = str; newEx.Data["provider"] = provider?.ToString() ?? "(null)"; throw newEx; } return unit; } #endregion #region ToString Methods /// <summary> /// Get string representation of value and unit. Using two significant digits after radix. /// </summary> /// <param name="unit">Unit representation to use.</param> /// <param name="provider">Format to use for localization and number formatting. Defaults to <see cref="UnitSystem.DefaultCulture" />.</param> /// <returns>String representation.</returns> public string ToString(EnergyUnit unit, [CanBeNull] IFormatProvider provider) { return ToString(unit, provider, 2); } /// <summary> /// Get string representation of value and unit. /// </summary> /// <param name="unit">Unit representation to use.</param> /// <param name="provider">Format to use for localization and number formatting. Defaults to <see cref="UnitSystem.DefaultCulture" />.</param> /// <param name="significantDigitsAfterRadix">The number of significant digits after the radix point.</param> /// <returns>String representation.</returns> [UsedImplicitly] public string ToString(EnergyUnit unit, [CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { double value = As(unit); string format = UnitFormatter.GetFormat(value, significantDigitsAfterRadix); return ToString(unit, provider, format); } /// <summary> /// Get string representation of value and unit. /// </summary> /// <param name="provider">Format to use for localization and number formatting. Defaults to <see cref="UnitSystem.DefaultCulture" />.</param> /// <param name="unit">Unit representation to use.</param> /// <param name="format">String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively."</param> /// <param name="args">Arguments for string format. Value and unit are implictly included as arguments 0 and 1.</param> /// <returns>String representation.</returns> [UsedImplicitly] public string ToString(EnergyUnit unit, [CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); provider = provider ?? UnitSystem.DefaultCulture; double value = As(unit); object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, provider, args); return string.Format(provider, format, formatArgs); } #endregion } }
48.246006
648
0.631548
[ "MIT" ]
Melina-Aero/MelinaAero-UnitsNet
UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs
15,104
C#
namespace StyleChecker.Test.Refactoring.IsNull { using Microsoft.VisualStudio.TestTools.UnitTesting; using StyleChecker.Refactoring.IsNull; using StyleChecker.Test.Framework; [TestClass] public sealed class AnalyzerTest : DiagnosticVerifier { public AnalyzerTest() : base(new Analyzer()) { } [TestMethod] public void Okay() => VerifyDiagnostic(ReadText("Okay"), Atmosphere.Default); } }
24.05
70
0.644491
[ "BSD-2-Clause" ]
MatthewL246/StyleChecker
StyleChecker/StyleChecker.Test/Refactoring/IsNull/AnalyzerTest.cs
481
C#
using System.Collections.Generic; using LightweightCharts.Blazor.Converters; namespace LightweightCharts.Blazor.Customization.Enums { /// <summary> /// Represents the source of data to be used for the horizontal price line.<br/> /// https://tradingview.github.io/lightweight-charts/docs/api/enums/PriceLineSource /// </summary> public enum PriceLineSource { /// <summary> /// Use the last bar data. /// </summary> LastBar = 0, /// <summary> /// Use the last visible data of the chart viewport. /// </summary> LastVisible = 1 } internal class PriceLineSourceConverter : BaseEnumJsonConverter<PriceLineSource> { protected override Dictionary<PriceLineSource, string> GetEnumMapping() => new Dictionary<PriceLineSource, string> { [PriceLineSource.LastBar] = "0", [PriceLineSource.LastVisible] = "1", }; } }
26.4375
116
0.717494
[ "Apache-2.0" ]
mr-azazael/LightweightCharts.Blazor
src/LightweightCharts.Blazor/Customization/Enums/PriceLineSource.cs
848
C#
using System.Reflection; using System.Runtime.InteropServices; using System.Windows; // 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 // 제어됩니다. 어셈블리와 관련된 정보를 수정하려면 // 이러한 특성 값을 변경하세요. [assembly: AssemblyTitle("QuiqCompose (OSS)")] [assembly: AssemblyDescription("The fast, simple, anti-disturb SNS composer - Open Source Software")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("SD SkyKlouD")] [assembly: AssemblyProduct("QuiqCompose")] [assembly: AssemblyCopyright("Copyright © 2018-2019 SD SkyKlouD, All Rights Reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에 // 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면 // 해당 형식에 대해 ComVisible 특성을 true로 설정하세요. [assembly: ComVisible(false)] //지역화 가능 응용 프로그램 빌드를 시작하려면 다음을 설정하세요. //.csproj 파일에서 <PropertyGroup> 내에 <UICulture>CultureYouAreCodingWith</UICulture>를 //설정하십시오. 예를 들어 소스 파일에서 영어(미국)를 //사용하는 경우 <UICulture>를 en-US로 설정합니다. 그런 다음 아래 //NeutralResourceLanguage 특성의 주석 처리를 제거합니다. 아래 줄의 "en-US"를 업데이트하여 //프로젝트 파일의 UICulture 설정과 일치시킵니다. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //테마별 리소스 사전의 위치 //(페이지 또는 응용 프로그램 리소스 사진에 // 리소스가 없는 경우에 사용됨) ResourceDictionaryLocation.SourceAssembly //제네릭 리소스 사전의 위치 //(페이지 또는 응용 프로그램 리소스 사진에 // 리소스가 없는 경우에 사용됨) )] // 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다. // // 주 버전 // 부 버전 // 빌드 번호 // 수정 버전 // // 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호가 자동으로 // 지정되도록 할 수 있습니다. // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.20")] [assembly: AssemblyFileVersion("1.0.0.20")] [assembly: Guid("67D39CF6-1C75-446B-A73A-4E2D7FE77D48")]
34
101
0.656513
[ "MIT" ]
SDSkyKlouD/QuiqCompose-OSS-WPF
QuiqCompose/Properties/AssemblyInfo.cs
2,687
C#
using System; using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyTitle("NuGet.Dialog10")] [assembly: AssemblyDescription("Manage NuGet Package dialog for Visual Studio 2010")] [assembly: CLSCompliant(false)] [assembly: InternalsVisibleTo("NuGet.TestUI")] [assembly: InternalsVisibleTo("NuGet.Dialog.Test")]
34.1
85
0.800587
[ "Apache-2.0" ]
monoman/NugetCracker
Nuget/src/Dialog10/Properties/AssemblyInfo.cs
343
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using dbstore.Models; using dbstore.Interface; using dbstore.Configs; namespace dbstore.Controllers { [Route("api/[controller]")] [ApiController] public class UsersController : ControllerBase { private readonly IUserFunction user_ = new UserFunction(); // GET: api/Users [HttpGet] public async Task<ActionResult<AppResponse>> GetUsers() { try { var dat = await user_.ReadAllUser(); return new SuccessResponse(null, dat); } catch (Exception ex) { return new FailedResponse(ex); } } // GET: api/Users/5 [HttpGet("{id}")] public async Task<ActionResult<AppResponse>> GetUserById(string id) { try { var dat = await user_.ReadUserById(id); return new SuccessResponse(null, dat); } catch (System.Exception ex) { return new FailedResponse(ex); } } // PUT: api/Users/5 [HttpPut("{id}")] public async Task<ActionResult<AppResponse>> PutUser(string id,[FromBody] User user) { if (id != user.Id || user == null) return new FailedResponse("ID user is invalid / user notfound."); try { var dat = await user_.UpdateUser(user); return new SuccessResponse($"User {user.Name} is Updated", user); } catch (System.Exception ex) { return new FailedResponse(ex); } } // POST: api/Users [HttpPost] public async Task<ActionResult<AppResponse>> PostUser([FromBody]User user) { if (user == null) return new FailedResponse("User parameter is not complete."); try { var dat = await user_.CreateUser(user); return new SuccessResponse($"User {user.Name} is Created", user); } catch (System.Exception ex) { return new FailedResponse(ex); } } // DELETE: api/Users/5 [HttpDelete("{id}")] public async Task<ActionResult<AppResponse>> DeleteUser(string id) { if (string.IsNullOrWhiteSpace(id)) return new FailedResponse("ID user is invalid / user notfound."); try { var dat = await user_.DeleteUser(id); return new SuccessResponse($"User {dat.Name} is Deleted", dat); } catch (System.Exception ex) { return new FailedResponse(ex); } } // private bool UserExists(string id) // { // return _context.Users.Any(e => e.Id == id); // } } }
27.690265
112
0.519974
[ "MIT" ]
masalaloe/backend-dbstore
dbstore/Controllers/UsersController.cs
3,131
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.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.IIS.FunctionalTests.Utilities; using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Server.IntegrationTesting.IIS; using Microsoft.AspNetCore.Testing; using Xunit; namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests { [Collection(PublishedSitesCollection.Name)] public class LoggingTests : IISFunctionalTestBase { public LoggingTests(PublishedSitesFixture fixture) : base(fixture) { } public static TestMatrix TestVariants => TestMatrix.ForServers(DeployerSelector.ServerType) .WithTfms(Tfm.Default) .WithApplicationTypes(ApplicationType.Portable) .WithAllHostingModels(); public static TestMatrix InprocessTestVariants => TestMatrix.ForServers(DeployerSelector.ServerType) .WithTfms(Tfm.Default) .WithApplicationTypes(ApplicationType.Portable) .WithHostingModels(HostingModel.InProcess); [ConditionalTheory] [MaximumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10_20H2, SkipReason = "Shutdown hangs https://github.com/dotnet/aspnetcore/issues/25107")] [MemberData(nameof(TestVariants))] public async Task CheckStdoutLoggingToFile(TestVariant variant) { await CheckStdoutToFile(variant, "ConsoleWrite"); } [ConditionalTheory] [MaximumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10_20H2, SkipReason = "Shutdown hangs https://github.com/dotnet/aspnetcore/issues/25107")] [MemberData(nameof(TestVariants))] public async Task CheckStdoutErrLoggingToFile(TestVariant variant) { await CheckStdoutToFile(variant, "ConsoleErrorWrite"); } private async Task CheckStdoutToFile(TestVariant variant, string path) { var deploymentParameters = Fixture.GetBaseDeploymentParameters(variant); deploymentParameters.EnableLogging(LogFolderPath); var deploymentResult = await DeployAsync(deploymentParameters); await Helpers.AssertStarts(deploymentResult, path); StopServer(); var contents = Helpers.ReadAllTextFromFile(Helpers.GetExpectedLogName(deploymentResult, LogFolderPath), Logger); Assert.Contains("TEST MESSAGE", contents); Assert.DoesNotContain("\r\n\r\n", contents); Assert.Contains("\r\n", contents); } // Move to separate file [ConditionalTheory] [MaximumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10_20H2, SkipReason = "Shutdown hangs https://github.com/dotnet/aspnetcore/issues/25107")] [MemberData(nameof(TestVariants))] public async Task InvalidFilePathForLogs_ServerStillRuns(TestVariant variant) { var deploymentParameters = Fixture.GetBaseDeploymentParameters(variant); deploymentParameters.WebConfigActionList.Add( WebConfigHelpers.AddOrModifyAspNetCoreSection("stdoutLogEnabled", "true")); deploymentParameters.WebConfigActionList.Add( WebConfigHelpers.AddOrModifyAspNetCoreSection("stdoutLogFile", Path.Combine("Q:", "std"))); var deploymentResult = await DeployAsync(deploymentParameters); await Helpers.AssertStarts(deploymentResult, "HelloWorld"); StopServer(); if (variant.HostingModel == HostingModel.InProcess) { // Error is getting logged twice, from shim and handler EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.CouldNotStartStdoutFileRedirection("Q:\\std", deploymentResult), Logger, allowMultiple: true); } } [ConditionalTheory] [MemberData(nameof(InprocessTestVariants))] [RequiresNewShim] public async Task StartupMessagesAreLoggedIntoDebugLogFile(TestVariant variant) { var deploymentParameters = Fixture.GetBaseDeploymentParameters(variant); deploymentParameters.HandlerSettings["debugLevel"] = "file"; deploymentParameters.HandlerSettings["debugFile"] = "subdirectory\\debug.txt"; var deploymentResult = await DeployAsync(deploymentParameters); await deploymentResult.HttpClient.GetAsync("/"); AssertLogs(Path.Combine(deploymentResult.ContentRoot, "subdirectory", "debug.txt")); } [ConditionalTheory] [MemberData(nameof(InprocessTestVariants))] public async Task StartupMessagesAreLoggedIntoDefaultDebugLogFile(TestVariant variant) { var deploymentParameters = Fixture.GetBaseDeploymentParameters(variant); deploymentParameters.HandlerSettings["debugLevel"] = "file"; var deploymentResult = await DeployAsync(deploymentParameters); await deploymentResult.HttpClient.GetAsync("/"); AssertLogs(Path.Combine(deploymentResult.ContentRoot, "aspnetcore-debug.log")); } [ConditionalTheory] [RequiresIIS(IISCapability.PoolEnvironmentVariables)] [MemberData(nameof(InprocessTestVariants))] public async Task StartupMessagesAreLoggedIntoDefaultDebugLogFileWhenEnabledWithEnvVar(TestVariant variant) { var deploymentParameters = Fixture.GetBaseDeploymentParameters(variant); deploymentParameters.EnvironmentVariables["ASPNETCORE_MODULE_DEBUG"] = "file"; // Add empty debugFile handler setting to prevent IIS deployer from overriding debug settings deploymentParameters.HandlerSettings["debugFile"] = ""; var deploymentResult = await DeployAsync(deploymentParameters); await deploymentResult.HttpClient.GetAsync("/"); AssertLogs(Path.Combine(deploymentResult.ContentRoot, "aspnetcore-debug.log")); } [ConditionalTheory] [MaximumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10_20H2, SkipReason = "Shutdown hangs https://github.com/dotnet/aspnetcore/issues/25107")] [RequiresIIS(IISCapability.PoolEnvironmentVariables)] [MemberData(nameof(InprocessTestVariants))] public async Task StartupMessagesLogFileSwitchedWhenLogFilePresentInWebConfig(TestVariant variant) { var firstTempFile = Path.GetTempFileName(); var secondTempFile = Path.GetTempFileName(); try { var deploymentParameters = Fixture.GetBaseDeploymentParameters(variant); deploymentParameters.EnvironmentVariables["ASPNETCORE_MODULE_DEBUG_FILE"] = firstTempFile; deploymentParameters.AddDebugLogToWebConfig(secondTempFile); var deploymentResult = await DeployAsync(deploymentParameters); var response = await deploymentResult.HttpClient.GetAsync("/"); StopServer(); var logContents = Helpers.ReadAllTextFromFile(firstTempFile, Logger); Assert.Contains("Switching debug log files to", logContents); AssertLogs(secondTempFile); } finally { File.Delete(firstTempFile); File.Delete(secondTempFile); } } [ConditionalTheory] [MaximumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10_20H2, SkipReason = "Shutdown hangs https://github.com/dotnet/aspnetcore/issues/25107")] [MemberData(nameof(InprocessTestVariants))] public async Task DebugLogsAreWrittenToEventLog(TestVariant variant) { var deploymentParameters = Fixture.GetBaseDeploymentParameters(variant); deploymentParameters.HandlerSettings["debugLevel"] = "file,eventlog"; var deploymentResult = await StartAsync(deploymentParameters); StopServer(); EventLogHelpers.VerifyEventLogEvent(deploymentResult, @"\[aspnetcorev2.dll\] Initializing logs for .*?Description: IIS ASP.NET Core Module V2", Logger); } [ConditionalTheory] [MaximumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10_20H2, SkipReason = "Shutdown hangs https://github.com/dotnet/aspnetcore/issues/25107")] [MemberData(nameof(InprocessTestVariants))] public async Task CheckUTF8File(TestVariant variant) { var path = "CheckConsoleFunctions"; var deploymentParameters = Fixture.GetBaseDeploymentParameters(Fixture.InProcessTestSite, variant.HostingModel); deploymentParameters.TransformArguments((a, _) => $"{a} {path}"); // For standalone this will need to remove space var logFolderPath = LogFolderPath + "\\彡⾔"; deploymentParameters.EnableLogging(logFolderPath); var deploymentResult = await DeployAsync(deploymentParameters); var response = await deploymentResult.HttpClient.GetAsync(path); Assert.False(response.IsSuccessStatusCode); StopServer(); var contents = Helpers.ReadAllTextFromFile(Helpers.GetExpectedLogName(deploymentResult, logFolderPath), Logger); Assert.Contains("彡⾔", contents); EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.InProcessThreadExitStdOut(deploymentResult, "12", "(.*)彡⾔(.*)"), Logger); } [ConditionalTheory] [MaximumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10_20H2, SkipReason = "Shutdown hangs https://github.com/dotnet/aspnetcore/issues/25107")] [MemberData(nameof(InprocessTestVariants))] public async Task OnlyOneFileCreatedWithProcessStartTime(TestVariant variant) { var deploymentParameters = Fixture.GetBaseDeploymentParameters(variant); deploymentParameters.EnableLogging(LogFolderPath); var deploymentResult = await DeployAsync(deploymentParameters); await Helpers.AssertStarts(deploymentResult, "ConsoleWrite"); StopServer(); Assert.Single(Directory.GetFiles(LogFolderPath), Helpers.GetExpectedLogName(deploymentResult, LogFolderPath)); } [ConditionalFact] [MaximumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10_20H2, SkipReason = "Shutdown hangs https://github.com/dotnet/aspnetcore/issues/25107")] public async Task CaptureLogsForOutOfProcessWhenProcessFailsToStart() { var deploymentParameters = Fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess); deploymentParameters.TransformArguments((a, _) => $"{a} ConsoleWriteSingle"); var deploymentResult = await DeployAsync(deploymentParameters); var response = await deploymentResult.HttpClient.GetAsync("Test"); StopServer(); EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.OutOfProcessFailedToStart(deploymentResult, "Wow!"), Logger); } [ConditionalFact] [MaximumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10_20H2, SkipReason = "Shutdown hangs https://github.com/dotnet/aspnetcore/issues/25107")] [RequiresNewShim] public async Task DisableRedirectionNoLogs() { var deploymentParameters = Fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess); deploymentParameters.HandlerSettings["enableOutOfProcessConsoleRedirection"] = "false"; deploymentParameters.TransformArguments((a, _) => $"{a} ConsoleWriteSingle"); var deploymentResult = await DeployAsync(deploymentParameters); var response = await deploymentResult.HttpClient.GetAsync("Test"); StopServer(); EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.OutOfProcessFailedToStart(deploymentResult, ""), Logger); } [ConditionalFact] [MaximumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10_20H2, SkipReason = "Shutdown hangs https://github.com/dotnet/aspnetcore/issues/25107")] public async Task CaptureLogsForOutOfProcessWhenProcessFailsToStart30KbMax() { var deploymentParameters = Fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess); deploymentParameters.TransformArguments((a, _) => $"{a} ConsoleWrite30Kb"); var deploymentResult = await DeployAsync(deploymentParameters); var response = await deploymentResult.HttpClient.GetAsync("Test"); StopServer(); EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.OutOfProcessFailedToStart(deploymentResult, new string('a', 30000)), Logger); } [ConditionalTheory] [MaximumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10_20H2, SkipReason = "Shutdown hangs https://github.com/dotnet/aspnetcore/issues/25107")] [InlineData("ConsoleErrorWriteStartServer")] [InlineData("ConsoleWriteStartServer")] public async Task CheckStdoutLoggingToPipeWithFirstWrite(string path) { var deploymentParameters = Fixture.GetBaseDeploymentParameters(); var firstWriteString = "TEST MESSAGE"; deploymentParameters.TransformArguments((a, _) => $"{a} {path}"); var deploymentResult = await DeployAsync(deploymentParameters); await Helpers.AssertStarts(deploymentResult); StopServer(); if (deploymentParameters.ServerType == ServerType.IISExpress) { // We can't read stdout logs from IIS as they aren't redirected. Assert.Contains(TestSink.Writes, context => context.Message.Contains(firstWriteString)); } } private static string ReadLogs(string logPath) { using (var stream = File.Open(logPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) using (var streamReader = new StreamReader(stream)) { return streamReader.ReadToEnd(); } } private static void AssertLogs(string logPath) { var logContents = ReadLogs(logPath); Assert.Contains("[aspnetcorev2.dll]", logContents); Assert.True(logContents.Contains("[aspnetcorev2_inprocess.dll]") || logContents.Contains("[aspnetcorev2_outofprocess.dll]")); Assert.Contains("Description: IIS ASP.NET Core Module V2. Commit:", logContents); Assert.Contains("Description: IIS ASP.NET Core Module V2 Request Handler. Commit:", logContents); } } }
46.86478
180
0.689391
[ "MIT" ]
FWest98/MicrosoftAspNetCore
src/Servers/IIS/IIS/test/Common.FunctionalTests/LoggingTests.cs
14,915
C#
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using GeneticSharp.Domain.Chromosomes; using GeneticSharp.Domain.Randomizations; namespace GeneticSharp.Domain.Crossovers { /// <summary> /// Ordered Crossover (OX1). /// <remarks> /// Also know as: Order Crossover. /// /// A portion of one parent is mapped to a portion of the other parent. /// From the replaced portion on, the rest is filled up by the remaining genes, where already present genes are omitted and the order is preserved. /// <see href="http://en.wikipedia.org/wiki/Crossover_(genetic_algorithm)#Crossover_for_Ordered_Chromosomes">Crossover for Ordered Chromosomes</see> /// /// The Ordered Crossover method is presented by Goldberg, is used when the problem is of order based, /// for example in Ushaped assembly line balancing etc. Given two parent /// chromosomes, two random crossover points are selected /// partitioning them into a left, middle and right portion. The /// ordered two-point crossover behaves in the following way: /// child1 inherits its left and right section from parent1, and its middle section is determined. /// <see href="http://arxiv.org/ftp/arxiv/papers/1203/1203.3097.pdf">A Comparative Study of Adaptive Crossover Operators for Genetic Algorithms to Resolve the Traveling Salesman Problem</see> /// /// The order crossover operator (Figure 4) was proposed by Davis (1985). /// The OX1 exploits a property of the path representation, that the order of cities (not their positions) are important. /// <see href="http://lev4projdissertation.googlecode.com/svn-history/r100/trunk/reading/read/aiRev99.pdf">Genetic Algorithms for the Travelling Salesman Problem - A Review of Representations and Operators</see> /// /// Order 1 Crossover is a fairly simple permutation crossover. /// Basically, a swath of consecutive alleles from parent 1 drops down, /// and remaining values are placed in the child in the order which they appear in parent 2. /// <see href="http://www.rubicite.com/Tutorials/GeneticAlgorithms/CrossoverOperators/Order1CrossoverOperator.aspx">Order 1 Crossover</see> /// </remarks> /// </summary> [DisplayName("Ordered (OX1)")] public sealed class OrderedCrossover : CrossoverBase { #region Constructors /// <summary> /// Initializes a new instance of the <see cref="GeneticSharp.Domain.Crossovers.OrderedCrossover"/> class. /// </summary> public OrderedCrossover() : base(2, 2) { IsOrdered = true; } #endregion #region Methods /// <summary> /// Performs the cross with specified parents generating the children. /// </summary> /// <param name="parents">Parents.</param> /// <returns>The offspring (children) of the parents.</returns> protected override IList<IChromosome> PerformCross(IList<IChromosome> parents) { var firstParent = parents [0]; var secondParent = parents [1]; if (parents.AnyHasRepeatedGene ()) { throw new CrossoverException(this, "The Ordered Crossover (OX1) can be only used with ordered chromosomes. The specified chromosome has repeated genes."); } var middleSectionIndexes = RandomizationProvider.Current.GetUniqueInts (2, 0, firstParent.Length); Array.Sort (middleSectionIndexes); var middleSectionBeginIndex = middleSectionIndexes [0]; var middleSectionEndIndex = middleSectionIndexes [1]; var firstChild = CreateChild (firstParent, secondParent, middleSectionBeginIndex, middleSectionEndIndex); var secondChild = CreateChild (secondParent, firstParent, middleSectionBeginIndex, middleSectionEndIndex); return new List<IChromosome> () { firstChild, secondChild }; } /// <summary> /// Creates the child. /// </summary> /// <returns>The child.</returns> /// <param name="firstParent">First parent.</param> /// <param name="secondParent">Second parent.</param> /// <param name="middleSectionBeginIndex">Middle section begin index.</param> /// <param name="middleSectionEndIndex">Middle section end index.</param> private static IChromosome CreateChild(IChromosome firstParent, IChromosome secondParent, int middleSectionBeginIndex, int middleSectionEndIndex) { var middleSectionGenes = firstParent.GetGenes ().Skip (middleSectionBeginIndex).Take ((middleSectionEndIndex - middleSectionBeginIndex) + 1); var secondParentRemainingGenes = secondParent.GetGenes ().Except (middleSectionGenes).GetEnumerator (); var child = firstParent.CreateNew (); for(int i = 0; i < firstParent.Length; i++) { var firstParentGene = firstParent.GetGene(i); if (i >= middleSectionBeginIndex && i <= middleSectionEndIndex) { child.ReplaceGene (i, firstParentGene); } else { secondParentRemainingGenes.MoveNext (); child.ReplaceGene (i, secondParentRemainingGenes.Current); } } return child; } #endregion } }
47.850467
213
0.705273
[ "MIT" ]
rfrerebe/GeneticSharp
src/GeneticSharp.Domain/Crossovers/OrderedCrossover.cs
5,122
C#
using System; using System.Xml.Serialization; using System.ComponentModel.DataAnnotations; using BroadWorksConnector.Ocip.Validation; using System.Collections.Generic; namespace BroadWorksConnector.Ocip.Models { /// <summary> /// Requests the list of all domains assigned to a group. /// The response is either GroupDomainGetAssignedListResponse or ErrorResponse. /// <see cref="GroupDomainGetAssignedListResponse"/> /// <see cref="ErrorResponse"/> /// </summary> [Serializable] [XmlRoot(Namespace = "")] [Groups(@"[{""__type"":""Sequence:#BroadWorksConnector.Ocip.Validation"",""id"":""f3a93cf15de4abd7903673e44ee3e07b:5445""}]")] public class GroupDomainGetAssignedListRequest : BroadWorksConnector.Ocip.Models.C.OCIRequest<BroadWorksConnector.Ocip.Models.GroupDomainGetAssignedListResponse> { private string _serviceProviderId; [XmlElement(ElementName = "serviceProviderId", IsNullable = false, Namespace = "")] [Group(@"f3a93cf15de4abd7903673e44ee3e07b:5445")] [MinLength(1)] [MaxLength(30)] public string ServiceProviderId { get => _serviceProviderId; set { ServiceProviderIdSpecified = true; _serviceProviderId = value; } } [XmlIgnore] protected bool ServiceProviderIdSpecified { get; set; } private string _groupId; [XmlElement(ElementName = "groupId", IsNullable = false, Namespace = "")] [Group(@"f3a93cf15de4abd7903673e44ee3e07b:5445")] [MinLength(1)] [MaxLength(30)] public string GroupId { get => _groupId; set { GroupIdSpecified = true; _groupId = value; } } [XmlIgnore] protected bool GroupIdSpecified { get; set; } } }
30.822581
165
0.625327
[ "MIT" ]
ianrathbone/broadworks-connector-net
BroadworksConnector/Ocip/Models/GroupDomainGetAssignedListRequest.cs
1,911
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PathController : MonoBehaviour { private Transform Path; public Transform Path1; public Transform Path2; public Transform Path3; public Transform Path4; public Transform[] Waypoints; private Transform targetWaypoint; private int targetWaypointIndex = 0; private float minDis = 0.1f; private int lastWaypointIndex; public Transform DirectionToLook; private Quaternion rotationToTarget; bool WasZero; public float MovementSpeed = 1.0f; public float RotationSpeed = 5.0f; void Start() { int a = Random.Range(1, 4); if(a == 1) { Path = Path1; } if (a == 2) { Path = Path2; } if (a == 3) { Path = Path3; } if (a == 4) { Path = Path4; } Waypoints = new Transform[Path.transform.childCount]; for (int i=0; i < Path.transform.childCount; i++) { Waypoints[i] = Path.transform.GetChild(i); } lastWaypointIndex = Waypoints.Length - 1; targetWaypoint = Waypoints[targetWaypointIndex]; Quaternion rotationToTarget = Quaternion.LookRotation(targetWaypoint.position - transform.position); } // Update is called once per frame void Update() { float movementStep = MovementSpeed * Time.deltaTime; float rotationStep = RotationSpeed * Time.deltaTime; Vector3 directionToTarget = targetWaypoint.position - transform.position; Vector3 Zero = new Vector3(0, 0, 0); Quaternion ZeroToTarget = Quaternion.LookRotation(Zero); Quaternion directionToLook = Quaternion.LookRotation(DirectionToLook.position); if (rotationToTarget == ZeroToTarget) { rotationToTarget = directionToLook; WasZero = true; return; } else { rotationToTarget = Quaternion.LookRotation(directionToTarget); } if(rotationToTarget == ZeroToTarget && WasZero == true) { rotationToTarget = directionToLook; } transform.rotation = Quaternion.Slerp(transform.rotation, rotationToTarget, rotationStep); float distance = Vector3.Distance(transform.position, targetWaypoint.position); CheckDistanceToWaypoint(distance); transform.position = Vector3.MoveTowards(transform.position, targetWaypoint.position, movementStep); } void CheckDistanceToWaypoint(float currentDistance) { if(currentDistance <= minDis) { targetWaypointIndex++; UpdateTargetWaypoint(); } } void UpdateTargetWaypoint() { if(targetWaypointIndex > lastWaypointIndex) { targetWaypointIndex = lastWaypointIndex; } targetWaypoint = Waypoints[targetWaypointIndex]; } }
26.172414
108
0.612648
[ "MIT" ]
JoshH-H/RetailRush
Scripts/PathController.cs
3,038
C#
using System; using NetRuntimeSystem = System; using System.ComponentModel; using NetOffice.Attributes; namespace NetOffice.PowerPointApi { /// <summary> /// DispatchInterface EffectInformation /// SupportByVersion PowerPoint, 10,11,12,14,15,16 /// </summary> [SupportByVersion("PowerPoint", 10,11,12,14,15,16)] [EntityType(EntityType.IsDispatchInterface)] public class EffectInformation : COMObject { #pragma warning disable #region Type Information /// <summary> /// Instance Type /// </summary> [EditorBrowsable(EditorBrowsableState.Advanced), Browsable(false), Category("NetOffice"), CoreOverridden] public override Type InstanceType { get { return LateBindingApiWrapperType; } } private static Type _type; [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] public static Type LateBindingApiWrapperType { get { if (null == _type) _type = typeof(EffectInformation); return _type; } } #endregion #region Ctor /// <param name="factory">current used factory core</param> /// <param name="parentObject">object there has created the proxy</param> /// <param name="proxyShare">proxy share instead if com proxy</param> public EffectInformation(Core factory, ICOMObject parentObject, COMProxyShare proxyShare) : base(factory, parentObject, proxyShare) { } ///<param name="factory">current used factory core</param> ///<param name="parentObject">object there has created the proxy</param> ///<param name="comProxy">inner wrapped COM proxy</param> public EffectInformation(Core factory, ICOMObject parentObject, object comProxy) : base(factory, parentObject, comProxy) { } ///<param name="parentObject">object there has created the proxy</param> ///<param name="comProxy">inner wrapped COM proxy</param> [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] public EffectInformation(ICOMObject parentObject, object comProxy) : base(parentObject, comProxy) { } ///<param name="factory">current used factory core</param> ///<param name="parentObject">object there has created the proxy</param> ///<param name="comProxy">inner wrapped COM proxy</param> ///<param name="comProxyType">Type of inner wrapped COM proxy"</param> [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] public EffectInformation(Core factory, ICOMObject parentObject, object comProxy, NetRuntimeSystem.Type comProxyType) : base(factory, parentObject, comProxy, comProxyType) { } ///<param name="parentObject">object there has created the proxy</param> ///<param name="comProxy">inner wrapped COM proxy</param> ///<param name="comProxyType">Type of inner wrapped COM proxy"</param> [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] public EffectInformation(ICOMObject parentObject, object comProxy, NetRuntimeSystem.Type comProxyType) : base(parentObject, comProxy, comProxyType) { } ///<param name="replacedObject">object to replaced. replacedObject are not usable after this action</param> [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] public EffectInformation(ICOMObject replacedObject) : base(replacedObject) { } [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] public EffectInformation() : base() { } /// <param name="progId">registered progID</param> [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] public EffectInformation(string progId) : base(progId) { } #endregion #region Properties /// <summary> /// SupportByVersion PowerPoint 10, 11, 12, 14, 15, 16 /// Get /// </summary> [SupportByVersion("PowerPoint", 10,11,12,14,15,16)] public NetOffice.PowerPointApi.Application Application { get { return Factory.ExecuteKnownReferencePropertyGet<NetOffice.PowerPointApi.Application>(this, "Application", NetOffice.PowerPointApi.Application.LateBindingApiWrapperType); } } /// <summary> /// SupportByVersion PowerPoint 10, 11, 12, 14, 15, 16 /// Get /// Unknown COM Proxy /// </summary> [SupportByVersion("PowerPoint", 10,11,12,14,15,16), ProxyResult] public object Parent { get { return Factory.ExecuteReferencePropertyGet(this, "Parent"); } } /// <summary> /// SupportByVersion PowerPoint 10, 11, 12, 14, 15, 16 /// Get /// </summary> [SupportByVersion("PowerPoint", 10,11,12,14,15,16)] public NetOffice.PowerPointApi.Enums.MsoAnimAfterEffect AfterEffect { get { return Factory.ExecuteEnumPropertyGet<NetOffice.PowerPointApi.Enums.MsoAnimAfterEffect>(this, "AfterEffect"); } } /// <summary> /// SupportByVersion PowerPoint 10, 11, 12, 14, 15, 16 /// Get /// </summary> [SupportByVersion("PowerPoint", 10,11,12,14,15,16)] public NetOffice.OfficeApi.Enums.MsoTriState AnimateBackground { get { return Factory.ExecuteEnumPropertyGet<NetOffice.OfficeApi.Enums.MsoTriState>(this, "AnimateBackground"); } } /// <summary> /// SupportByVersion PowerPoint 10, 11, 12, 14, 15, 16 /// Get /// </summary> [SupportByVersion("PowerPoint", 10,11,12,14,15,16)] public NetOffice.OfficeApi.Enums.MsoTriState AnimateTextInReverse { get { return Factory.ExecuteEnumPropertyGet<NetOffice.OfficeApi.Enums.MsoTriState>(this, "AnimateTextInReverse"); } } /// <summary> /// SupportByVersion PowerPoint 10, 11, 12, 14, 15, 16 /// Get /// </summary> [SupportByVersion("PowerPoint", 10,11,12,14,15,16)] public NetOffice.PowerPointApi.Enums.MsoAnimateByLevel BuildByLevelEffect { get { return Factory.ExecuteEnumPropertyGet<NetOffice.PowerPointApi.Enums.MsoAnimateByLevel>(this, "BuildByLevelEffect"); } } /// <summary> /// SupportByVersion PowerPoint 10, 11, 12, 14, 15, 16 /// Get /// </summary> [SupportByVersion("PowerPoint", 10,11,12,14,15,16)] public NetOffice.PowerPointApi.ColorFormat Dim { get { return Factory.ExecuteKnownReferencePropertyGet<NetOffice.PowerPointApi.ColorFormat>(this, "Dim", NetOffice.PowerPointApi.ColorFormat.LateBindingApiWrapperType); } } /// <summary> /// SupportByVersion PowerPoint 10, 11, 12, 14, 15, 16 /// Get /// </summary> [SupportByVersion("PowerPoint", 10,11,12,14,15,16)] public NetOffice.PowerPointApi.PlaySettings PlaySettings { get { return Factory.ExecuteKnownReferencePropertyGet<NetOffice.PowerPointApi.PlaySettings>(this, "PlaySettings", NetOffice.PowerPointApi.PlaySettings.LateBindingApiWrapperType); } } /// <summary> /// SupportByVersion PowerPoint 10, 11, 12, 14, 15, 16 /// Get /// </summary> [SupportByVersion("PowerPoint", 10,11,12,14,15,16)] public NetOffice.PowerPointApi.SoundEffect SoundEffect { get { return Factory.ExecuteKnownReferencePropertyGet<NetOffice.PowerPointApi.SoundEffect>(this, "SoundEffect", NetOffice.PowerPointApi.SoundEffect.LateBindingApiWrapperType); } } /// <summary> /// SupportByVersion PowerPoint 10, 11, 12, 14, 15, 16 /// Get /// </summary> [SupportByVersion("PowerPoint", 10,11,12,14,15,16)] public NetOffice.PowerPointApi.Enums.MsoAnimTextUnitEffect TextUnitEffect { get { return Factory.ExecuteEnumPropertyGet<NetOffice.PowerPointApi.Enums.MsoAnimTextUnitEffect>(this, "TextUnitEffect"); } } #endregion #region Methods #endregion #pragma warning restore } }
30.3
176
0.702442
[ "MIT" ]
DominikPalo/NetOffice
Source/PowerPoint/DispatchInterfaces/EffectInformation.cs
7,577
C#
namespace PetSanctuary.Test.Pipeline { using PetSanctuary.Web.Controllers; using MyTested.AspNetCore.Mvc; using Xunit; using PetSanctuary.Web.ViewModels.Comments; using PetSanctuary.Test.Data; using PetSanctuary.Data.Models; using System.Linq; public class CommentsPipelineTest { [Fact] public void GetBlogShouldReturnDefaultView() => MyPipeline .Configuration() .ShouldMap("/Comments/Blog/TestBlogId") .To<CommentsController>(c => c.Blog("TestBlogId", new CommentQueryModel())) .Which(controller => controller .WithData(BlogCommentsTestData.GetComments(1))) .ShouldReturn() .View(result => result .WithModelOfType<CommentQueryModel>() .Passing(model => model.Comments.Count == 1)); [Fact] public void GetVetShouldReturnDefaultView() => MyPipeline .Configuration() .ShouldMap("/Comments/Vet/TestVetId") .To<CommentsController>(c => c.Vet("TestVetId", new CommentQueryModel())) .Which(controller => controller .WithData(VetCommentsTestData.GetComments(1))) .ShouldReturn() .View(result => result .WithModelOfType<CommentQueryModel>() .Passing(model => model.Comments.Count == 1)); [Fact] public void GetCreateShouldReturnDefault() => MyPipeline .Configuration() .ShouldMap(request => request .WithPath("/Comments/Create") .WithUser() .WithAntiForgeryToken()) .To<CommentsController>(c => c.Create()) .Which() .ShouldHave() .ActionAttributes(attributes => attributes .RestrictingForAuthorizedRequests()) .AndAlso() .ShouldReturn() .View(); [Theory] [InlineData("TestComment1")] [InlineData("TestComment2")] [InlineData("TestComment3")] public void PostCreateForBlogCommentShouldRedirectToProperActionAndShouldHaveValidModelState(string content) => MyPipeline .Configuration() .ShouldMap(request => request .WithMethod(HttpMethod.Post) .WithPath("/Comments/Create/TestBlogId") .WithQuery("type", "Blog") .WithFormFields(new { Content = content }) .WithUser() .WithAntiForgeryToken()) .To<CommentsController>(c => c.Create("TestBlogId", "Blog", new CommentInputModel { Content = content })) .Which() .ShouldHave() .ActionAttributes(attributes => attributes .RestrictingForHttpMethod(HttpMethod.Post) .RestrictingForAuthorizedRequests()) .AndAlso() .ShouldHave() .ValidModelState() .Data(data => data .WithSet<Comment>(data => data.Any())) .AndAlso() .ShouldReturn() .RedirectToAction("Blog", "Comments", new { id = "TestBlogId" }); [Theory] [InlineData("TestComment1")] [InlineData("TestComment2")] [InlineData("TestComment3")] public void PostCreateForVetCommentShouldRedirectToProperActionAndShouldHaveValidModelState(string content) => MyPipeline .Configuration() .ShouldMap(request => request .WithMethod(HttpMethod.Post) .WithPath("/Comments/Create/TestVetId") .WithQuery("type", "Vet") .WithFormFields(new { Content = content }) .WithUser() .WithAntiForgeryToken()) .To<CommentsController>(c => c.Create("TestVetId", "Vet", new CommentInputModel { Content = content })) .Which() .ShouldHave() .ActionAttributes(attributes => attributes .RestrictingForHttpMethod(HttpMethod.Post) .RestrictingForAuthorizedRequests()) .AndAlso() .ShouldHave() .ValidModelState() .Data(data => data .WithSet<Comment>(data => data.Any())) .AndAlso() .ShouldReturn() .RedirectToAction("Vet", "Comments", new { id = "TestVetId" }); [Fact] public void GetEditShouldReturnDefaultViewWithDefaultModel() => MyPipeline .Configuration() .ShouldMap(request => request .WithPath("/Comments/Edit/1") .WithUser() .WithAntiForgeryToken()) .To<CommentsController>(c => c.Edit(1)) .Which(controller => controller .WithData(BlogCommentsTestData.GetComments(1))) .ShouldHave() .ActionAttributes(attributes => attributes .RestrictingForAuthorizedRequests()) .AndAlso() .ShouldReturn() .View(result => result.WithModelOfType<CommentInputModel>()); [Theory] [InlineData("EditedComment")] public void PostEditForBlogShouldReturnDefaultRedirectToActionAndShouldHaveValidModelState(string content) => MyPipeline .Configuration() .ShouldMap(request => request .WithMethod(HttpMethod.Post) .WithPath("/Comments/Edit/1") .WithQuery("type","Blog") .WithFormFields(new { Content = content }) .WithUser() .WithAntiForgeryToken()) .To<CommentsController>(c => c.Edit(1, "Blog", new CommentInputModel { Content = content })) .Which(controller => controller .WithData(BlogCommentsTestData.GetComments(1))) .ShouldHave() .ActionAttributes(attributes => attributes .RestrictingForHttpMethod(HttpMethod.Post) .RestrictingForAuthorizedRequests()) .AndAlso() .ShouldHave() .Data(data => data .WithSet<Comment>(data => data .Any(comment => comment.Content == content))) .AndAlso() .ShouldReturn() .RedirectToAction("Blog", "Comments", new { id = "TestBlogId" }); [Theory] [InlineData("EditedComment")] public void PostEditForVetShouldReturnDefaultRedirectToActionAndShouldHaveValidModelState(string content) => MyPipeline .Configuration() .ShouldMap(request => request .WithMethod(HttpMethod.Post) .WithPath("/Comments/Edit/1") .WithQuery("type", "Vet") .WithFormFields(new { Content = content }) .WithUser() .WithAntiForgeryToken()) .To<CommentsController>(c => c.Edit(1, "Vet", new CommentInputModel { Content = content })) .Which(controller => controller .WithData(VetCommentsTestData.GetComments(1))) .ShouldHave() .ActionAttributes(attributes => attributes .RestrictingForHttpMethod(HttpMethod.Post) .RestrictingForAuthorizedRequests()) .AndAlso() .ShouldHave() .Data(data => data .WithSet<Comment>(data => data .Any(comment => comment.Content == content))) .AndAlso() .ShouldReturn() .RedirectToAction("Vet", "Comments", new { id = "TestVetId" }); [Fact] public void GetDeleteForBlogShouldReturnDefaultRedirectToAction() => MyPipeline .Configuration() .ShouldMap(request => request .WithPath("/Comments/Delete/1") .WithQuery("type", "Blog") .WithUser() .WithAntiForgeryToken()) .To<CommentsController>(c => c.Delete(1, "Blog")) .Which(controller => controller .WithData(BlogCommentsTestData.GetComments(1))) .ShouldHave() .ActionAttributes(attributes => attributes .RestrictingForAuthorizedRequests()) .AndAlso() .ShouldHave() .Data(data => data .WithSet<Comment>(data => !data.Any())) .AndAlso() .ShouldReturn() .RedirectToAction("Blog", "Comments", new { id = "TestBlogId" }); [Fact] public void GetDeleteForVetShouldReturnDefaultRedirectToAction() => MyPipeline .Configuration() .ShouldMap(request => request .WithPath("/Comments/Delete/1") .WithQuery("type", "Vet") .WithUser() .WithAntiForgeryToken()) .To<CommentsController>(c => c.Delete(1, "Vet")) .Which(controller => controller .WithData(VetCommentsTestData.GetComments(1))) .ShouldHave() .ActionAttributes(attributes => attributes .RestrictingForAuthorizedRequests()) .AndAlso() .ShouldHave() .Data(data => data .WithSet<Comment>(data => !data.Any())) .AndAlso() .ShouldReturn() .RedirectToAction("Vet", "Comments", new { id = "TestVetId" }); } }
37.234848
116
0.526246
[ "MIT" ]
aleksanderstoyanov/PetSanctuary
PetSanctuary.Test/Pipeline/CommentsPipelineTest.cs
9,832
C#
/* * THIS FILE WAS GENERATED BY PLOTLY.BLAZOR.GENERATOR */ using System; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Runtime.Serialization.Formatters.Binary; using System.Text.Json.Serialization; namespace Plotly.Blazor.Traces.BarLib.MarkerLib.ColorBarLib.TitleLib { /// <summary> /// The Font class. /// </summary> [System.CodeDom.Compiler.GeneratedCode("Plotly.Blazor.Generator", "1.0.0.0")] [Serializable] public class Font : IEquatable<Font> { /// <summary> /// HTML font family - the typeface that will be applied by the web browser. /// The web browser will only be able to apply a font if it is available on /// the system which it operates. Provide multiple font families, separated /// by commas, to indicate the preference in which to apply fonts if they aren&#39;t /// available on the system. The Chart Studio Cloud (at https://chart-studio.plotly.com /// or on-premise) generates images on a server, where only a select number /// of fonts are installed and supported. These include <c>Arial</c>, <c>Balto</c>, /// &#39;Courier New&#39;, &#39;Droid Sans&#39;,, &#39;Droid Serif&#39;, &#39;Droid /// Sans Mono&#39;, &#39;Gravitas One&#39;, &#39;Old Standard TT&#39;, &#39;Open /// Sans&#39;, <c>Overpass</c>, &#39;PT Sans Narrow&#39;, <c>Raleway</c>, &#39;Times /// New Roman&#39;. /// </summary> [JsonPropertyName(@"family")] public string Family { get; set;} /// <summary> /// Gets or sets the Size. /// </summary> [JsonPropertyName(@"size")] public decimal? Size { get; set;} /// <summary> /// Gets or sets the Color. /// </summary> [JsonPropertyName(@"color")] public object Color { get; set;} /// <inheritdoc /> public override bool Equals(object obj) { if (!(obj is Font other)) return false; return ReferenceEquals(this, obj) || Equals(other); } /// <inheritdoc /> public bool Equals([AllowNull] Font other) { if (other == null) return false; if (ReferenceEquals(this, other)) return true; return ( Family == other.Family || Family != null && Family.Equals(other.Family) ) && ( Size == other.Size || Size != null && Size.Equals(other.Size) ) && ( Color == other.Color || Color != null && Color.Equals(other.Color) ); } /// <inheritdoc /> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; if (Family != null) hashCode = hashCode * 59 + Family.GetHashCode(); if (Size != null) hashCode = hashCode * 59 + Size.GetHashCode(); if (Color != null) hashCode = hashCode * 59 + Color.GetHashCode(); return hashCode; } } /// <summary> /// Checks for equality of the left Font and the right Font. /// </summary> /// <param name="left">Left Font.</param> /// <param name="right">Right Font.</param> /// <returns>Boolean</returns> public static bool operator == (Font left, Font right) { return Equals(left, right); } /// <summary> /// Checks for inequality of the left Font and the right Font. /// </summary> /// <param name="left">Left Font.</param> /// <param name="right">Right Font.</param> /// <returns>Boolean</returns> public static bool operator != (Font left, Font right) { return !Equals(left, right); } /// <summary> /// Gets a deep copy of this instance. /// </summary> /// <returns>Font</returns> public Font DeepClone() { return this.Copy(); } } }
35.024194
99
0.510246
[ "MIT" ]
valu8/Plotly.Blazor
Plotly.Blazor/Traces/BarLib/MarkerLib/ColorBarLib/TitleLib/Font.cs
4,343
C#
using UnityEngine; /// <summary> /// /// </summary> public class BossAttackArea : MonoBehaviour { [SerializeField] private BossEnemyController owner; private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { owner.OnAttackAreaTrigger(); } } }
18.235294
55
0.63871
[ "MIT" ]
maxartDanny/GDDi0000_Roll-a-Ball_Danny
Assets/Scripts/EnemyScripts/BossAttackArea.cs
312
C#
using System; using System.Xml.Serialization; using Newtonsoft.Json; namespace Dots.Core.ViewModels { public interface IIdentity { [XmlAttribute("id"), JsonProperty("id")] Guid Id { get; set; } } }
18.916667
48
0.651982
[ "MIT" ]
SurrealIT/BusinessBase
Dots/Dots.Core/ViewModels/IIdentity.cs
229
C#
using Microsoft.AspNet.Identity.EntityFramework; namespace WebAppPart_I.Models { // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more. public class ApplicationUser : IdentityUser { } public class ApplicationDbContext : IdentityDbContext<ApplicationUser> { public ApplicationDbContext() : base("DefaultConnection") { } } }
29.764706
175
0.699605
[ "MIT" ]
zaheersani/FA18_VP_Demos
WebAppPart_I/Models/IdentityModels.cs
508
C#
using API.Model; using API.Utilities; using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Mvc; using System.Collections; using System.Collections.Generic; using System.Linq; namespace API.Controllers { [EnableCors("SiteCorsPolicy")] [Route("api/[controller]")] public class MetadataController : Controller { private readonly ICollection<RadioStation> _radioStations; private readonly JSONSerializer _serializer; public MetadataController(JSONSerializer serializer) { _serializer = serializer; _radioStations = _serializer.LoadFromFile<RadioStation>("radioStationList.json"); } // GET api/metadata [HttpGet] public ActionResult Get() { return Json(MetadataWorker.SendRequest("http://radio.vgmradio.com:8040/stream")); } // GET api/metadata/5 [HttpGet("{id}")] public ActionResult Get(int id) { RadioStation selectedStation = _radioStations.FirstOrDefault(x => x.Id.Equals(id)); return Json(selectedStation == null ? new SongMetadata() : MetadataWorker.SendRequest(selectedStation.ChannelUrl)); } // POST api/metadata [HttpPost] public void Post([FromBody]string value) { } // PUT api/metadata/5 [HttpPut("{id}")] public void Put(int id, [FromBody]string value) { } // DELETE api/metadata/5 [HttpDelete("{id}")] public void Delete(int id) { } } }
25.548387
127
0.613005
[ "MIT" ]
Ervie/AmnisAPI
Controllers/MetadataController.cs
1,584
C#
using System.Linq; using System.Threading.Tasks; using Abp.Application.Services; using Abp.Application.Services.Dto; using Abp.Authorization; using Abp.Domain.Repositories; using Abp.Extensions; using Abp.IdentityFramework; using Abp.Linq.Extensions; using Abp.MultiTenancy; using Abp.Runtime.Security; using TodoApp.Authorization; using TodoApp.Authorization.Roles; using TodoApp.Authorization.Users; using TodoApp.Editions; using TodoApp.MultiTenancy.Dto; using Microsoft.AspNetCore.Identity; namespace TodoApp.MultiTenancy { [AbpAuthorize(PermissionNames.Pages_Tenants)] public class TenantAppService : AsyncCrudAppService<Tenant, TenantDto, int, PagedTenantResultRequestDto, CreateTenantDto, TenantDto>, ITenantAppService { private readonly TenantManager _tenantManager; private readonly EditionManager _editionManager; private readonly UserManager _userManager; private readonly RoleManager _roleManager; private readonly IAbpZeroDbMigrator _abpZeroDbMigrator; public TenantAppService( IRepository<Tenant, int> repository, TenantManager tenantManager, EditionManager editionManager, UserManager userManager, RoleManager roleManager, IAbpZeroDbMigrator abpZeroDbMigrator) : base(repository) { _tenantManager = tenantManager; _editionManager = editionManager; _userManager = userManager; _roleManager = roleManager; _abpZeroDbMigrator = abpZeroDbMigrator; } public override async Task<TenantDto> CreateAsync(CreateTenantDto input) { CheckCreatePermission(); // Create tenant var tenant = ObjectMapper.Map<Tenant>(input); tenant.ConnectionString = input.ConnectionString.IsNullOrEmpty() ? null : SimpleStringCipher.Instance.Encrypt(input.ConnectionString); var defaultEdition = await _editionManager.FindByNameAsync(EditionManager.DefaultEditionName); if (defaultEdition != null) { tenant.EditionId = defaultEdition.Id; } await _tenantManager.CreateAsync(tenant); await CurrentUnitOfWork.SaveChangesAsync(); // To get new tenant's id. // Create tenant database _abpZeroDbMigrator.CreateOrMigrateForTenant(tenant); // We are working entities of new tenant, so changing tenant filter using (CurrentUnitOfWork.SetTenantId(tenant.Id)) { // Create static roles for new tenant CheckErrors(await _roleManager.CreateStaticRoles(tenant.Id)); await CurrentUnitOfWork.SaveChangesAsync(); // To get static role ids // Grant all permissions to admin role var adminRole = _roleManager.Roles.Single(r => r.Name == StaticRoleNames.Tenants.Admin); await _roleManager.GrantAllPermissionsAsync(adminRole); // Create admin user for the tenant var adminUser = User.CreateTenantAdminUser(tenant.Id, input.AdminEmailAddress); await _userManager.InitializeOptionsAsync(tenant.Id); CheckErrors(await _userManager.CreateAsync(adminUser, User.DefaultPassword)); await CurrentUnitOfWork.SaveChangesAsync(); // To get admin user's id // Assign admin user to role! CheckErrors(await _userManager.AddToRoleAsync(adminUser, adminRole.Name)); await CurrentUnitOfWork.SaveChangesAsync(); } return MapToEntityDto(tenant); } protected override IQueryable<Tenant> CreateFilteredQuery(PagedTenantResultRequestDto input) { return Repository.GetAll() .WhereIf(!input.Keyword.IsNullOrWhiteSpace(), x => x.TenancyName.Contains(input.Keyword) || x.Name.Contains(input.Keyword)) .WhereIf(input.IsActive.HasValue, x => x.IsActive == input.IsActive); } protected override void MapToEntity(TenantDto updateInput, Tenant entity) { // Manually mapped since TenantDto contains non-editable properties too. entity.Name = updateInput.Name; entity.TenancyName = updateInput.TenancyName; entity.IsActive = updateInput.IsActive; } public override async Task DeleteAsync(EntityDto<int> input) { CheckDeletePermission(); var tenant = await _tenantManager.GetByIdAsync(input.Id); await _tenantManager.DeleteAsync(tenant); } private void CheckErrors(IdentityResult identityResult) { identityResult.CheckErrors(LocalizationManager); } } }
39.201613
155
0.662004
[ "MIT" ]
SereneYi/TodoList-Backend
aspnet-core/src/TodoApp.Application/MultiTenancy/TenantAppService.cs
4,863
C#
using EFCore.BulkExtensions.SqlAdapters; using Microsoft.Data.Sqlite; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Data; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Text; using System.Threading; using System.Threading.Tasks; namespace EFCore.BulkExtensions { public class TableInfo { public string Schema { get; set; } public string SchemaFormated => Schema != null ? $"[{Schema}]." : ""; public string TableName { get; set; } public string FullTableName => $"{SchemaFormated}[{TableName}]"; public Dictionary<string, string> PrimaryKeysPropertyColumnNameDict { get; set; } public bool HasSinglePrimaryKey { get; set; } public bool UpdateByPropertiesAreNullable { get; set; } protected string TempDBPrefix => BulkConfig.UseTempDB ? "#" : ""; public string TempTableSufix { get; set; } public string TempTableName => $"{TableName}{TempTableSufix}"; public string FullTempTableName => $"{SchemaFormated}[{TempDBPrefix}{TempTableName}]"; public string FullTempOutputTableName => $"{SchemaFormated}[{TempDBPrefix}{TempTableName}Output]"; public bool CreatedOutputTable => BulkConfig.SetOutputIdentity || BulkConfig.CalculateStats; public bool InsertToTempTable { get; set; } public string IdentityColumnName { get; set; } public bool HasIdentity => IdentityColumnName != null; public bool HasOwnedTypes { get; set; } public bool HasAbstractList { get; set; } public bool ColumnNameContainsSquareBracket { get; set; } public bool LoadOnlyPKColumn { get; set; } public bool HasSpatialType { get; set; } public int NumberOfEntities { get; set; } public BulkConfig BulkConfig { get; set; } public Dictionary<string, string> OutputPropertyColumnNamesDict { get; set; } = new Dictionary<string, string>(); public Dictionary<string, string> PropertyColumnNamesDict { get; set; } = new Dictionary<string, string>(); public Dictionary<string, string> ColumnNamesTypesDict { get; set; } = new Dictionary<string, string>(); public Dictionary<string, IProperty> ColumnToPropertyDictionary { get; set; } = new Dictionary<string, IProperty>(); public Dictionary<string, string> PropertyColumnNamesCompareDict { get; set; } = new Dictionary<string, string>(); public Dictionary<string, string> PropertyColumnNamesUpdateDict { get; set; } = new Dictionary<string, string>(); public Dictionary<string, FastProperty> FastPropertyDict { get; set; } = new Dictionary<string, FastProperty>(); public Dictionary<string, INavigation> AllNavigationsDictionary { get; private set; } public Dictionary<string, INavigation> OwnedTypesDict { get; set; } = new Dictionary<string, INavigation>(); public HashSet<string> ShadowProperties { get; set; } = new HashSet<string>(); public HashSet<string> DefaultValueProperties { get; set; } = new HashSet<string>(); public Dictionary<string, string> ConvertiblePropertyColumnDict { get; set; } = new Dictionary<string, string>(); public Dictionary<string, ValueConverter> ConvertibleColumnConverterDict { get; set; } = new Dictionary<string, ValueConverter>(); public Dictionary<string, int> DateTime2PropertiesPrecisionLessThen7Dict { get; set; } = new Dictionary<string, int>(); public string TimeStampOutColumnType => "varbinary(8)"; public string TimeStampPropertyName { get; set; } public string TimeStampColumnName { get; set; } protected IList<object> EntitiesSortedReference { get; set; } // Operation Merge writes In Output table first Existing that were Updated then for new that were Inserted so this makes sure order is same in list when need to set Output public StoreObjectIdentifier ObjectIdentifier { get; set; } internal SqliteConnection SqliteConnection { get; set; } internal SqliteTransaction SqliteTransaction { get; set; } public static TableInfo CreateInstance<T>(DbContext context, Type type, IList<T> entities, OperationType operationType, BulkConfig bulkConfig) { var tableInfo = new TableInfo { NumberOfEntities = entities.Count, BulkConfig = bulkConfig ?? new BulkConfig() { } }; tableInfo.BulkConfig.OperationType = operationType; bool isExplicitTransaction = context.Database.GetDbConnection().State == ConnectionState.Open; if (tableInfo.BulkConfig.UseTempDB == true && !isExplicitTransaction && (operationType != OperationType.Insert || tableInfo.BulkConfig.SetOutputIdentity)) { throw new InvalidOperationException("When 'UseTempDB' is set then BulkOperation has to be inside Transaction. " + "Otherwise destination table gets dropped too early because transaction ends before operation is finished."); // throws: 'Cannot access destination table' } var isDeleteOperation = operationType == OperationType.Delete; tableInfo.LoadData(context, type, entities, isDeleteOperation); return tableInfo; } #region Main public void LoadData<T>(DbContext context, Type type, IList<T> entities, bool loadOnlyPKColumn) { LoadOnlyPKColumn = loadOnlyPKColumn; var entityType = context.Model.FindEntityType(type); if (entityType == null) { type = entities[0].GetType(); entityType = context.Model.FindEntityType(type); HasAbstractList = true; } if (entityType == null) { throw new InvalidOperationException($"DbContext does not contain EntitySet for Type: { type.Name }"); } //var relationalData = entityType.Relational(); relationalData.Schema relationalData.TableName // DEPRECATED in Core3.0 bool isSqlServer = context.Database.ProviderName.EndsWith(DbServer.SqlServer.ToString()); string defaultSchema = isSqlServer ? "dbo" : null; string customSchema = null; string customTableName = null; if (BulkConfig.CustomDestinationTableName != null) { customTableName = BulkConfig.CustomDestinationTableName; if (customTableName.Contains('.')) { var tableNameSplitList = BulkConfig.CustomDestinationTableName.Split('.'); customSchema = tableNameSplitList[0]; customTableName = tableNameSplitList[1]; } } Schema = customSchema ?? entityType.GetSchema() ?? defaultSchema; TableName = customTableName ?? entityType.GetTableName(); ObjectIdentifier = StoreObjectIdentifier.Table(TableName, entityType.GetSchema()); TempTableSufix = "Temp"; if (BulkConfig.UniqueTableNameTempDb) { TempTableSufix += Guid.NewGuid().ToString().Substring(0, 8); // 8 chars of Guid as tableNameSufix to avoid same name collision with other tables // TODO Consider Hash } var allProperties = new List<IProperty>(); foreach (var entityProperty in entityType.GetProperties()) { var columnName = entityProperty.GetColumnName(ObjectIdentifier); if (columnName == null) continue; allProperties.Add(entityProperty); ColumnNamesTypesDict.Add(columnName, entityProperty.GetColumnType()); ColumnToPropertyDictionary.Add(columnName, entityProperty); if (BulkConfig.DateTime2PrecisionForceRound) { var columnMappings = entityProperty.GetTableColumnMappings(); var firstMapping = columnMappings.FirstOrDefault(); var columnType = firstMapping.Column.StoreType; if (columnType.StartsWith("datetime2(") && !columnType.EndsWith("7)")) { string precisionText = columnType.Substring(10, 1); int precision = int.Parse(precisionText); DateTime2PropertiesPrecisionLessThen7Dict.Add(firstMapping.Property.Name, precision); // SqlBulkCopy does Floor instead of Round so Rounding done in memory } } } bool areSpecifiedUpdateByProperties = BulkConfig.UpdateByProperties?.Count() > 0; var primaryKeys = entityType.FindPrimaryKey()?.Properties?.ToDictionary(a => a.Name, b => b.GetColumnName(ObjectIdentifier)); HasSinglePrimaryKey = primaryKeys?.Count == 1; PrimaryKeysPropertyColumnNameDict = areSpecifiedUpdateByProperties ? BulkConfig.UpdateByProperties.ToDictionary(a => a, b => allProperties.First(p => p.Name == b).GetColumnName(ObjectIdentifier)) : (primaryKeys ?? new Dictionary<string, string>()); // load all derived type properties if (entityType.IsAbstract()) { foreach (var derivedType in entityType.GetDirectlyDerivedTypes()) { foreach (var derivedProperty in derivedType.GetProperties()) { if (!allProperties.Contains(derivedProperty)) allProperties.Add(derivedProperty); } } } var navigations = entityType.GetNavigations(); AllNavigationsDictionary = navigations.ToDictionary(nav => nav.Name, nav => nav); var ownedTypes = navigations.Where(a => a.TargetEntityType.IsOwned()); HasOwnedTypes = ownedTypes.Any(); OwnedTypesDict = ownedTypes.ToDictionary(a => a.Name, a => a); IdentityColumnName = allProperties.SingleOrDefault(a => a.IsPrimaryKey() && (a.ClrType.Name.StartsWith("Byte") || a.ClrType.Name.StartsWith("SByte") || a.ClrType.Name.StartsWith("Int") || a.ClrType.Name.StartsWith("UInt") || (isSqlServer && a.ClrType.Name.StartsWith("Decimal"))) && !a.ClrType.Name.EndsWith("[]") && a.ValueGenerated == ValueGenerated.OnAdd )?.GetColumnName(ObjectIdentifier); // ValueGenerated equals OnAdd even for nonIdentity column like Guid so we only type int as second condition // timestamp/row version properties are only set by the Db, the property has a [Timestamp] Attribute or is configured in FluentAPI with .IsRowVersion() // They can be identified by the columne type "timestamp" or .IsConcurrencyToken in combination with .ValueGenerated == ValueGenerated.OnAddOrUpdate string timestampDbTypeName = nameof(TimestampAttribute).Replace("Attribute", "").ToLower(); // = "timestamp"; IEnumerable<IProperty> timeStampProperties; if (BulkConfig.IgnoreRowVersion) timeStampProperties = new List<IProperty>(); else timeStampProperties = allProperties.Where(a => (a.IsConcurrencyToken && a.ValueGenerated == ValueGenerated.OnAddOrUpdate) || a.GetColumnType() == timestampDbTypeName); TimeStampColumnName = timeStampProperties.FirstOrDefault()?.GetColumnName(ObjectIdentifier); // can be only One TimeStampPropertyName = timeStampProperties.FirstOrDefault()?.Name; // can be only One var allPropertiesExceptTimeStamp = allProperties.Except(timeStampProperties); var properties = allPropertiesExceptTimeStamp.Where(a => a.GetComputedColumnSql() == null); var propertiesWithDefaultValues = allPropertiesExceptTimeStamp.Where(a => a.GetDefaultValue() != null || a.GetDefaultValueSql() != null); foreach (var propertyWithDefaultValue in propertiesWithDefaultValues) { var propertyType = propertyWithDefaultValue.ClrType; var instance = propertyType.IsValueType || propertyType.GetConstructor(Type.EmptyTypes) != null ? Activator.CreateInstance(propertyType) : null; // when type does not have parameterless constructor, like String for example, then default value is 'null' bool listHasAllDefaultValues = !entities.Any(a => a.GetType().GetProperty(propertyWithDefaultValue.Name).GetValue(a, null)?.ToString() != instance?.ToString()); if (listHasAllDefaultValues || PrimaryKeysPropertyColumnNameDict.ContainsKey(propertyWithDefaultValue.Name)) // it is not feasible to have in same list simultaneously both entities groups With and Without default values, they are omitted OnInsert only if all have default values or if it is PK (like Guid DbGenerated) { DefaultValueProperties.Add(propertyWithDefaultValue.Name); } } var propertiesOnCompare = allPropertiesExceptTimeStamp.Where(a => a.GetComputedColumnSql() == null); var propertiesOnUpdate = allPropertiesExceptTimeStamp.Where(a => a.GetComputedColumnSql() == null); // TimeStamp prop. is last column in OutputTable since it is added later with varbinary(8) type in which Output can be inserted var outputProperties = allPropertiesExceptTimeStamp.Where(a => a.GetColumnName(ObjectIdentifier) != null).Concat(timeStampProperties); OutputPropertyColumnNamesDict = outputProperties.ToDictionary(a => a.Name, b => b.GetColumnName(ObjectIdentifier).Replace("]", "]]")); // square brackets have to be escaped bool AreSpecifiedPropertiesToInclude = BulkConfig.PropertiesToInclude?.Count() > 0; bool AreSpecifiedPropertiesToExclude = BulkConfig.PropertiesToExclude?.Count() > 0; bool AreSpecifiedPropertiesToIncludeOnCompare = BulkConfig.PropertiesToIncludeOnCompare?.Count() > 0; bool AreSpecifiedPropertiesToExcludeOnCompare = BulkConfig.PropertiesToExcludeOnCompare?.Count() > 0; bool AreSpecifiedPropertiesToIncludeOnUpdate = BulkConfig.PropertiesToIncludeOnUpdate?.Count() > 0; bool AreSpecifiedPropertiesToExcludeOnUpdate = BulkConfig.PropertiesToExcludeOnUpdate?.Count() > 0; if (AreSpecifiedPropertiesToInclude) { if (areSpecifiedUpdateByProperties) // Adds UpdateByProperties to PropertyToInclude if they are not already explicitly listed { foreach (var updateByProperty in BulkConfig.UpdateByProperties) { if (!BulkConfig.PropertiesToInclude.Contains(updateByProperty)) { BulkConfig.PropertiesToInclude.Add(updateByProperty); } } } else // Adds PrimaryKeys to PropertyToInclude if they are not already explicitly listed { foreach (var primaryKey in PrimaryKeysPropertyColumnNameDict) { if (!BulkConfig.PropertiesToInclude.Contains(primaryKey.Key)) { BulkConfig.PropertiesToInclude.Add(primaryKey.Key); } } } } foreach (var property in allProperties) { if (property.PropertyInfo != null) // skip Shadow Property { FastPropertyDict.Add(property.Name, new FastProperty(property.PropertyInfo)); } var converter = property.GetTypeMapping().Converter; if (converter is not null) { var columnName = property.GetColumnName(ObjectIdentifier); ConvertiblePropertyColumnDict.Add(property.Name, columnName); ConvertibleColumnConverterDict.Add(columnName, converter); } } UpdateByPropertiesAreNullable = properties.Any(a => PrimaryKeysPropertyColumnNameDict.ContainsKey(a.Name) && a.IsNullable); if (AreSpecifiedPropertiesToInclude || AreSpecifiedPropertiesToExclude) { if (AreSpecifiedPropertiesToInclude && AreSpecifiedPropertiesToExclude) { throw new MultiplePropertyListSetException(nameof(BulkConfig.PropertiesToInclude), nameof(BulkConfig.PropertiesToExclude)); } if (AreSpecifiedPropertiesToInclude) { properties = properties.Where(a => BulkConfig.PropertiesToInclude.Contains(a.Name)); ValidateSpecifiedPropertiesList(BulkConfig.PropertiesToInclude, nameof(BulkConfig.PropertiesToInclude)); } if (AreSpecifiedPropertiesToExclude) { properties = properties.Where(a => !BulkConfig.PropertiesToExclude.Contains(a.Name)); ValidateSpecifiedPropertiesList(BulkConfig.PropertiesToExclude, nameof(BulkConfig.PropertiesToExclude)); } } if (AreSpecifiedPropertiesToIncludeOnCompare || AreSpecifiedPropertiesToExcludeOnCompare) { if (AreSpecifiedPropertiesToIncludeOnCompare && AreSpecifiedPropertiesToExcludeOnCompare) { throw new MultiplePropertyListSetException(nameof(BulkConfig.PropertiesToIncludeOnCompare), nameof(BulkConfig.PropertiesToExcludeOnCompare)); } if (AreSpecifiedPropertiesToIncludeOnCompare) { propertiesOnCompare = propertiesOnCompare.Where(a => BulkConfig.PropertiesToIncludeOnCompare.Contains(a.Name)); ValidateSpecifiedPropertiesList(BulkConfig.PropertiesToIncludeOnCompare, nameof(BulkConfig.PropertiesToIncludeOnCompare)); } if (AreSpecifiedPropertiesToExcludeOnCompare) { propertiesOnCompare = propertiesOnCompare.Where(a => !BulkConfig.PropertiesToExcludeOnCompare.Contains(a.Name)); ValidateSpecifiedPropertiesList(BulkConfig.PropertiesToExcludeOnCompare, nameof(BulkConfig.PropertiesToExcludeOnCompare)); } } else { propertiesOnCompare = properties; } if (AreSpecifiedPropertiesToIncludeOnUpdate || AreSpecifiedPropertiesToExcludeOnUpdate) { if (AreSpecifiedPropertiesToIncludeOnUpdate && AreSpecifiedPropertiesToExcludeOnUpdate) { throw new MultiplePropertyListSetException(nameof(BulkConfig.PropertiesToIncludeOnUpdate), nameof(BulkConfig.PropertiesToExcludeOnUpdate)); } if (AreSpecifiedPropertiesToIncludeOnUpdate) { propertiesOnUpdate = propertiesOnUpdate.Where(a => BulkConfig.PropertiesToIncludeOnUpdate.Contains(a.Name)); ValidateSpecifiedPropertiesList(BulkConfig.PropertiesToIncludeOnUpdate, nameof(BulkConfig.PropertiesToIncludeOnUpdate)); } if (AreSpecifiedPropertiesToExcludeOnUpdate) { propertiesOnUpdate = propertiesOnUpdate.Where(a => !BulkConfig.PropertiesToExcludeOnUpdate.Contains(a.Name)); ValidateSpecifiedPropertiesList(BulkConfig.PropertiesToExcludeOnUpdate, nameof(BulkConfig.PropertiesToExcludeOnUpdate)); } } else { propertiesOnUpdate = properties; if (BulkConfig.UpdateByProperties != null) // to remove NonIdentity PK like Guid from SET ID = ID, ... { propertiesOnUpdate = propertiesOnUpdate.Where(a => !BulkConfig.UpdateByProperties.Contains(a.Name)); } else if (primaryKeys != null) { propertiesOnUpdate = propertiesOnUpdate.Where(a => !primaryKeys.ContainsKey(a.Name)); } } PropertyColumnNamesCompareDict = propertiesOnCompare.ToDictionary(a => a.Name, b => b.GetColumnName(ObjectIdentifier).Replace("]", "]]")); PropertyColumnNamesUpdateDict = propertiesOnUpdate.ToDictionary(a => a.Name, b => b.GetColumnName(ObjectIdentifier).Replace("]", "]]")); if (loadOnlyPKColumn) { if (PrimaryKeysPropertyColumnNameDict.Count() == 0) throw new InvalidBulkConfigException("If no PrimaryKey is defined operation requres bulkConfig set with 'UpdatedByProperties'."); PropertyColumnNamesDict = properties.Where(a => PrimaryKeysPropertyColumnNameDict.ContainsKey(a.Name)).ToDictionary(a => a.Name, b => b.GetColumnName(ObjectIdentifier).Replace("]", "]]")); } else { PropertyColumnNamesDict = properties.ToDictionary(a => a.Name, b => b.GetColumnName(ObjectIdentifier).Replace("]", "]]")); ShadowProperties = new HashSet<string>(properties.Where(p => p.IsShadowProperty() && !p.IsForeignKey()).Select(p => p.GetColumnName(ObjectIdentifier))); foreach (var navigation in entityType.GetNavigations().Where(a => !a.IsCollection && !a.TargetEntityType.IsOwned())) { FastPropertyDict.Add(navigation.Name, new FastProperty(navigation.PropertyInfo)); } if (HasOwnedTypes) // Support owned entity property update. TODO: Optimize { foreach (var navigationProperty in ownedTypes) { var property = navigationProperty.PropertyInfo; FastPropertyDict.Add(property.Name, new FastProperty(property)); // If the OwnedType is mapped to the separate table, don't try merge it into its owner if (OwnedTypeUtil.IsOwnedInSameTableAsOwner(navigationProperty) == false) continue; Type navOwnedType = type.Assembly.GetType(property.PropertyType.FullName); var ownedEntityType = context.Model.FindEntityType(property.PropertyType); if (ownedEntityType == null) // when entity has more then one ownedType (e.g. Address HomeAddress, Address WorkAddress) or one ownedType is in multiple Entities like Audit is usually. { ownedEntityType = context.Model.GetEntityTypes().SingleOrDefault(a => a.DefiningNavigationName == property.Name && a.DefiningEntityType.Name == entityType.Name); } var ownedEntityProperties = ownedEntityType.GetProperties().ToList(); var ownedEntityPropertyNameColumnNameDict = new Dictionary<string, string>(); foreach (var ownedEntityProperty in ownedEntityProperties) { if (!ownedEntityProperty.IsPrimaryKey()) { string columnName = ownedEntityProperty.GetColumnName(ObjectIdentifier); ownedEntityPropertyNameColumnNameDict.Add(ownedEntityProperty.Name, columnName); var ownedEntityPropertyFullName = property.Name + "_" + ownedEntityProperty.Name; if (!FastPropertyDict.ContainsKey(ownedEntityPropertyFullName)) { FastPropertyDict.Add(ownedEntityPropertyFullName, new FastProperty(ownedEntityProperty.PropertyInfo)); } } var converter = ownedEntityProperty.GetValueConverter(); if (converter != null) { ConvertibleColumnConverterDict.Add($"{navigationProperty.Name}_{ownedEntityProperty.Name}", converter); } } var ownedProperties = property.PropertyType.GetProperties(); foreach (var ownedProperty in ownedProperties) { if (ownedEntityPropertyNameColumnNameDict.ContainsKey(ownedProperty.Name)) { string ownedPropertyFullName = property.Name + "." + ownedProperty.Name; var ownedPropertyType = Nullable.GetUnderlyingType(ownedProperty.PropertyType) ?? ownedProperty.PropertyType; bool doAddProperty = true; if (AreSpecifiedPropertiesToInclude && !BulkConfig.PropertiesToInclude.Contains(ownedPropertyFullName)) { doAddProperty = false; } if (AreSpecifiedPropertiesToExclude && BulkConfig.PropertiesToExclude.Contains(ownedPropertyFullName)) { doAddProperty = false; } if (doAddProperty) { string columnName = ownedEntityPropertyNameColumnNameDict[ownedProperty.Name]; PropertyColumnNamesDict.Add(ownedPropertyFullName, columnName); PropertyColumnNamesCompareDict.Add(ownedPropertyFullName, columnName); PropertyColumnNamesUpdateDict.Add(ownedPropertyFullName, columnName); OutputPropertyColumnNamesDict.Add(ownedPropertyFullName, columnName); } } } } } } } protected void ValidateSpecifiedPropertiesList(List<string> specifiedPropertiesList, string specifiedPropertiesListName) { foreach (var configSpecifiedPropertyName in specifiedPropertiesList) { if (!FastPropertyDict.Any(a => a.Key == configSpecifiedPropertyName) && !configSpecifiedPropertyName.Contains(".") && // Those with dot "." skiped from validating for now since FastPropertyDict here does not contain them !(specifiedPropertiesListName == nameof(BulkConfig.PropertiesToIncludeOnUpdate) && configSpecifiedPropertyName == "") // In PropsToIncludeOnUpdate empty is allowed as config for skipping Update ) { throw new InvalidOperationException($"PropertyName '{configSpecifiedPropertyName}' specified in '{specifiedPropertiesListName}' not found in Properties."); } } } /// <summary> /// Supports <see cref="Microsoft.Data.SqlClient.SqlBulkCopy"/> /// </summary> /// <typeparam name="T"></typeparam> /// <param name="sqlBulkCopy"></param> /// <param name="entities"></param> /// <param name="setColumnMapping"></param> /// <param name="progress"></param> public void SetSqlBulkCopyConfig<T>(Microsoft.Data.SqlClient.SqlBulkCopy sqlBulkCopy, IList<T> entities, bool setColumnMapping, Action<decimal> progress) { sqlBulkCopy.DestinationTableName = InsertToTempTable ? FullTempTableName : FullTableName; sqlBulkCopy.BatchSize = BulkConfig.BatchSize; sqlBulkCopy.NotifyAfter = BulkConfig.NotifyAfter ?? BulkConfig.BatchSize; sqlBulkCopy.SqlRowsCopied += (sender, e) => { progress?.Invoke(ProgressHelper.GetProgress(entities.Count, e.RowsCopied)); // round to 4 decimal places }; sqlBulkCopy.BulkCopyTimeout = BulkConfig.BulkCopyTimeout ?? sqlBulkCopy.BulkCopyTimeout; sqlBulkCopy.EnableStreaming = BulkConfig.EnableStreaming; if (setColumnMapping) { foreach (var element in PropertyColumnNamesDict) { sqlBulkCopy.ColumnMappings.Add(element.Key, element.Value); } } } #endregion #region SqlCommands public async Task<bool> CheckTableExistAsync(DbContext context, TableInfo tableInfo, CancellationToken cancellationToken, bool isAsync) { if (isAsync) { await context.Database.OpenConnectionAsync(cancellationToken).ConfigureAwait(false); } else { context.Database.OpenConnection(); } bool tableExist = false; try { var sqlConnection = context.Database.GetDbConnection(); var currentTransaction = context.Database.CurrentTransaction; using var command = sqlConnection.CreateCommand(); if (currentTransaction != null) command.Transaction = currentTransaction.GetDbTransaction(); command.CommandText = SqlQueryBuilder.CheckTableExist(tableInfo.FullTempTableName, tableInfo.BulkConfig.UseTempDB); if (isAsync) { using var reader = await command.ExecuteReaderAsync(cancellationToken).ConfigureAwait(false); if (reader.HasRows) { while (await reader.ReadAsync(cancellationToken).ConfigureAwait(false)) { tableExist = (int)reader[0] == 1; } } } else { using var reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { tableExist = (int)reader[0] == 1; } } } } finally { if (isAsync) { await context.Database.CloseConnectionAsync().ConfigureAwait(false); } else { context.Database.CloseConnection(); } } return tableExist; } protected async Task<int> GetNumberUpdatedAsync(DbContext context, CancellationToken cancellationToken, bool isAsync) { var resultParameter = (IDbDataParameter)Activator.CreateInstance(typeof(Microsoft.Data.SqlClient.SqlParameter)); resultParameter.ParameterName = "@result"; resultParameter.DbType = DbType.Int32; resultParameter.Direction = ParameterDirection.Output; string sqlQueryCount = SqlQueryBuilder.SelectCountIsUpdateFromOutputTable(this); var sqlSetResult = $"SET @result = ({sqlQueryCount});"; if (isAsync) { await context.Database.ExecuteSqlRawAsync(sqlSetResult, new object[] { resultParameter }, cancellationToken).ConfigureAwait(false); } else { context.Database.ExecuteSqlRaw(sqlSetResult, resultParameter); } return (int)resultParameter.Value; } protected async Task<int> GetNumberDeletedAsync(DbContext context, CancellationToken cancellationToken, bool isAsync) { var resultParameter = (IDbDataParameter)Activator.CreateInstance(typeof(Microsoft.Data.SqlClient.SqlParameter)); resultParameter.ParameterName = "@result"; resultParameter.DbType = DbType.Int32; resultParameter.Direction = ParameterDirection.Output; string sqlQueryCount = SqlQueryBuilder.SelectCountIsDeleteFromOutputTable(this); var sqlSetResult = $"SET @result = ({sqlQueryCount});"; if (isAsync) { await context.Database.ExecuteSqlRawAsync(sqlSetResult, new object[] { resultParameter }, cancellationToken).ConfigureAwait(false); } else { context.Database.ExecuteSqlRaw(sqlSetResult, resultParameter); } return (int)resultParameter.Value; } #endregion public static string GetUniquePropertyValues(object entity, List<string> propertiesNames, Dictionary<string, FastProperty> fastPropertyDict) { StringBuilder uniqueBuilder = new StringBuilder(1024); string delimiter = "_"; // TODO: Consider making it Config-urable foreach (var propertyName in propertiesNames) { var property = fastPropertyDict[propertyName].Get(entity); if (property is Array propertyArray) { foreach (var element in propertyArray) { uniqueBuilder.Append(element.ToString()); } } else { uniqueBuilder.Append(property.ToString()); } uniqueBuilder.Append(delimiter); } string result = uniqueBuilder.ToString(); result = result.Substring(0, result.Length - 1); // removes last delimiter return result; } #region ReadProcedures public Dictionary<string, string> ConfigureBulkReadTableInfo() { InsertToTempTable = true; var previousPropertyColumnNamesDict = PropertyColumnNamesDict; BulkConfig.PropertiesToInclude = PrimaryKeysPropertyColumnNameDict.Select(a => a.Key).ToList(); PropertyColumnNamesDict = PropertyColumnNamesDict.Where(a => PrimaryKeysPropertyColumnNameDict.ContainsKey(a.Key)).ToDictionary(a => a.Key, a => a.Value); return previousPropertyColumnNamesDict; } internal void UpdateReadEntities<T>(Type type, IList<T> entities, IList<T> existingEntities) { List<string> propertyNames = PropertyColumnNamesDict.Keys.ToList(); if (HasOwnedTypes) { foreach (string ownedTypeName in OwnedTypesDict.Keys) { var ownedTypeProperties = OwnedTypesDict[ownedTypeName].ClrType.GetProperties(); foreach (var ownedTypeProperty in ownedTypeProperties) { propertyNames.Remove(ownedTypeName + "." + ownedTypeProperty.Name); } propertyNames.Add(ownedTypeName); } } List<string> selectByPropertyNames = PropertyColumnNamesDict.Keys.Where(a => PrimaryKeysPropertyColumnNameDict.ContainsKey(a)).ToList(); Dictionary<string, T> existingEntitiesDict = new Dictionary<string, T>(); foreach (var existingEntity in existingEntities) { string uniqueProperyValues = GetUniquePropertyValues(existingEntity, selectByPropertyNames, FastPropertyDict); existingEntitiesDict.TryAdd(uniqueProperyValues, existingEntity); } for (int i = 0; i < NumberOfEntities; i++) { T entity = entities[i]; string uniqueProperyValues = GetUniquePropertyValues(entity, selectByPropertyNames, FastPropertyDict); if (existingEntitiesDict.TryGetValue(uniqueProperyValues, out T existingEntity)) { foreach (var propertyName in propertyNames) { var propertyValue = FastPropertyDict[propertyName].Get(existingEntity); FastPropertyDict[propertyName].Set(entity, propertyValue); } } } } #endregion public void CheckToSetIdentityForPreserveOrder<T>(TableInfo tableInfo, IList<T> entities, bool reset = false) { string identityPropertyName = PropertyColumnNamesDict.SingleOrDefault(a => a.Value == IdentityColumnName).Key; bool doSetIdentityColumnsForInsertOrder = BulkConfig.PreserveInsertOrder && entities.Count() > 1 && PrimaryKeysPropertyColumnNameDict?.Count() == 1 && PrimaryKeysPropertyColumnNameDict?.Select(a => a.Value).First() == IdentityColumnName; var operationType = tableInfo.BulkConfig.OperationType; if (doSetIdentityColumnsForInsertOrder == true) { if (operationType == OperationType.Insert && // Insert should either have all zeros for automatic order, or they can be manually set Convert.ToInt64(FastPropertyDict[identityPropertyName].Get(entities[0])) != 0) // (to check it fast, condition for all 0s is only done on first one) { doSetIdentityColumnsForInsertOrder = false; } } if (doSetIdentityColumnsForInsertOrder) { bool sortEntities = !reset && BulkConfig.SetOutputIdentity && (operationType == OperationType.Update || operationType == OperationType.InsertOrUpdate || operationType == OperationType.InsertOrUpdateDelete); var entitiesExistingDict = new Dictionary<long, T>(); var entitiesNew = new List<T>(); var entitiesSorted = new List<T>(); long i = -entities.Count(); foreach (var entity in entities) { var identityFastProperty = FastPropertyDict[identityPropertyName]; long identityValue = Convert.ToInt64(identityFastProperty.Get(entity)); if (identityValue == 0 || // set only zero(0) values (identityValue < 0 && reset)) // set only negative(-N) values if reset { long value = reset ? 0 : i; object idValue; var idType = identityFastProperty.Property.PropertyType; if (idType == typeof(ushort)) idValue = (ushort)value; if (idType == typeof(short)) idValue = (short)value; else if (idType == typeof(uint)) idValue = (uint)value; else if (idType == typeof(int)) idValue = (int)value; else if (idType == typeof(ulong)) idValue = (ulong)value; else idValue = (long)value; identityFastProperty.Set(entity, idValue); i++; } if (sortEntities) { if (identityValue != 0) entitiesExistingDict.Add(identityValue, entity); // first load existing ones else entitiesNew.Add(entity); } } if (sortEntities) { entitiesSorted = entitiesExistingDict.OrderBy(a => a.Key).Select(a => a.Value).ToList(); entitiesSorted.AddRange(entitiesNew); // then append new ones tableInfo.EntitiesSortedReference = entitiesSorted.Cast<object>().ToList(); } } } protected void UpdateEntitiesIdentity<T>(DbContext context, TableInfo tableInfo, IList<T> entities, IList<object> entitiesWithOutputIdentity) { var identityPropertyName = OutputPropertyColumnNamesDict.SingleOrDefault(a => a.Value == IdentityColumnName).Key; if (BulkConfig.PreserveInsertOrder) // Updates Db changed Columns in entityList { int countDiff = entities.Count - entitiesWithOutputIdentity.Count; if (countDiff > 0) // When some ommited from Merge because of TimeStamp conflict then changes are not loaded but output is set in TimeStampInfo { tableInfo.BulkConfig.TimeStampInfo = new TimeStampInfo { NumberOfSkippedForUpdate = countDiff, EntitiesOutput = entitiesWithOutputIdentity.Cast<object>().ToList() }; return; } if (tableInfo.EntitiesSortedReference != null) { entities = tableInfo.EntitiesSortedReference.Cast<T>().ToList(); } var numberOfOutputEntities = Math.Min(NumberOfEntities, entitiesWithOutputIdentity.Count); for (int i = 0; i < numberOfOutputEntities; i++) { if (identityPropertyName != null) { var identityPropertyValue = FastPropertyDict[identityPropertyName].Get(entitiesWithOutputIdentity[i]); FastPropertyDict[identityPropertyName].Set(entities[i], identityPropertyValue); } if (TimeStampColumnName != null) // timestamp/rowversion is also generated by the SqlServer so if exist should be updated as well { string timeStampPropertyName = OutputPropertyColumnNamesDict.SingleOrDefault(a => a.Value == TimeStampColumnName).Key; var timeStampPropertyValue = FastPropertyDict[timeStampPropertyName].Get(entitiesWithOutputIdentity[i]); FastPropertyDict[timeStampPropertyName].Set(entities[i], timeStampPropertyValue); } var propertiesToLoad = tableInfo.OutputPropertyColumnNamesDict.Keys.Where(a => a != identityPropertyName && a != TimeStampColumnName && // already loaded in segmet above !tableInfo.PropertyColumnNamesDict.ContainsKey(a)); // add Computed and DefaultValues foreach (var outputPropertyName in propertiesToLoad) { var propertyValue = FastPropertyDict[outputPropertyName].Get(entitiesWithOutputIdentity[i]); FastPropertyDict[outputPropertyName].Set(entities[i], propertyValue); } } } else // Clears entityList and then refills it with loaded entites from Db { entities.Clear(); if (typeof(T) == entitiesWithOutputIdentity.FirstOrDefault()?.GetType()) { ((List<T>)entities).AddRange(entitiesWithOutputIdentity.Cast<T>().ToList()); } else { var entitiesObjects = entities.Cast<object>().ToList(); entitiesObjects.AddRange(entitiesWithOutputIdentity); } } } // Compiled queries created manually to avoid EF Memory leak bug when using EF with dynamic SQL: // https://github.com/borisdj/EFCore.BulkExtensions/issues/73 // Once the following Issue gets fixed(expected in EF 3.0) this can be replaced with code segment: DirectQuery // https://github.com/aspnet/EntityFrameworkCore/issues/12905 #region CompiledQuery public async Task LoadOutputDataAsync<T>(DbContext context, Type type, IList<T> entities, TableInfo tableInfo, CancellationToken cancellationToken, bool isAsync) where T : class { bool hasIdentity = OutputPropertyColumnNamesDict.Any(a => a.Value == IdentityColumnName); int totallNumber = entities.Count; if (BulkConfig.SetOutputIdentity && hasIdentity) { string sqlQuery = SqlQueryBuilder.SelectFromOutputTable(this); //var entitiesWithOutputIdentity = await QueryOutputTableAsync<T>(context, sqlQuery).ToListAsync(cancellationToken).ConfigureAwait(false); // TempFIX var entitiesWithOutputIdentity = QueryOutputTable(context, type, sqlQuery).Cast<object>().ToList(); //var entitiesWithOutputIdentity = (typeof(T) == type) ? QueryOutputTable<object>(context, sqlQuery).ToList() : QueryOutputTable(context, type, sqlQuery).Cast<object>().ToList(); //var entitiesObjects = entities.Cast<object>().ToList(); UpdateEntitiesIdentity(context, tableInfo, entities, entitiesWithOutputIdentity); totallNumber = entitiesWithOutputIdentity.Count; } if (BulkConfig.CalculateStats) { int numberUpdated; int numberDeleted; if (isAsync) { numberUpdated = await GetNumberUpdatedAsync(context, cancellationToken, isAsync: true).ConfigureAwait(false); numberDeleted = await GetNumberDeletedAsync(context, cancellationToken, isAsync: true).ConfigureAwait(false); } else { numberUpdated = GetNumberUpdatedAsync(context, cancellationToken, isAsync: false).GetAwaiter().GetResult(); numberDeleted = GetNumberDeletedAsync(context, cancellationToken, isAsync: false).GetAwaiter().GetResult(); } BulkConfig.StatsInfo = new StatsInfo { StatsNumberUpdated = numberUpdated, StatsNumberDeleted = numberDeleted, StatsNumberInserted = totallNumber - numberUpdated - numberDeleted }; } } protected IEnumerable QueryOutputTable(DbContext context, Type type, string sqlQuery) { var compiled = EF.CompileQuery(GetQueryExpression(type, sqlQuery)); var result = compiled(context); return result; } /*protected IEnumerable<T> QueryOutputTable<T>(DbContext context, string sqlQuery) where T : class { var compiled = EF.CompileQuery(GetQueryExpression<T>(sqlQuery)); var result = compiled(context); return result; }*/ /*protected IAsyncEnumerable<T> QueryOutputTableAsync<T>(DbContext context, string sqlQuery) where T : class { var compiled = EF.CompileAsyncQuery(GetQueryExpression<T>(sqlQuery)); var result = compiled(context); return result; }*/ public Expression<Func<DbContext, IQueryable<T>>> GetQueryExpression<T>(string sqlQuery, bool ordered = true) where T : class { Expression<Func<DbContext, IQueryable<T>>> expression = null; if (BulkConfig.TrackingEntities) // If Else can not be replaced with Ternary operator for Expression { expression = (ctx) => ctx.Set<T>().FromSqlRaw(sqlQuery); } else { expression = (ctx) => ctx.Set<T>().FromSqlRaw(sqlQuery).AsNoTracking(); } return ordered ? Expression.Lambda<Func<DbContext, IQueryable<T>>>(OrderBy(typeof(T), expression.Body, PrimaryKeysPropertyColumnNameDict.Select(a => a.Key).ToList()), expression.Parameters) : expression; // ALTERNATIVELY OrderBy with DynamicLinq ('using System.Linq.Dynamic.Core;' NuGet required) that eliminates need for custom OrderBy<T> method with Expression. //var queryOrdered = query.OrderBy(PrimaryKeys[0]); } public Expression<Func<DbContext, IEnumerable>> GetQueryExpression(Type entityType, string sqlQuery, bool ordered = true) { var parameter = Expression.Parameter(typeof(DbContext), "ctx"); var expression = Expression.Call(parameter, "Set", new Type[] { entityType }); expression = Expression.Call(typeof(RelationalQueryableExtensions), "FromSqlRaw", new Type[] { entityType }, expression, Expression.Constant(sqlQuery), Expression.Constant(Array.Empty<object>())); if (BulkConfig.TrackingEntities) // If Else can not be replaced with Ternary operator for Expression { } else { expression = Expression.Call(typeof(EntityFrameworkQueryableExtensions), "AsNoTracking", new Type[] { entityType }, expression); } expression = ordered ? OrderBy(entityType, expression, PrimaryKeysPropertyColumnNameDict.Select(a => a.Key).ToList()) : expression; return Expression.Lambda<Func<DbContext, IEnumerable>>(expression, parameter); // ALTERNATIVELY OrderBy with DynamicLinq ('using System.Linq.Dynamic.Core;' NuGet required) that eliminates need for custom OrderBy<T> method with Expression. //var queryOrdered = query.OrderBy(PrimaryKeys[0]); } private static MethodCallExpression OrderBy(Type entityType, Expression source, List<string> orderings) { var expression = (MethodCallExpression)source; ParameterExpression parameter = Expression.Parameter(entityType); bool firstArgOrderBy = true; foreach (var ordering in orderings) { PropertyInfo property = entityType.GetProperty(ordering); MemberExpression propertyAccess = Expression.MakeMemberAccess(parameter, property); LambdaExpression orderByExp = Expression.Lambda(propertyAccess, parameter); string methodName = firstArgOrderBy ? "OrderBy" : "ThenBy"; expression = Expression.Call(typeof(Queryable), methodName, new Type[] { entityType, property.PropertyType }, expression, Expression.Quote(orderByExp)); firstArgOrderBy = false; } return expression; } #endregion // Currently not used until issue from previous segment is fixed in EFCore #region DirectQuery /*public void UpdateOutputIdentity<T>(DbContext context, IList<T> entities) where T : class { if (HasSinglePrimaryKey) { var entitiesWithOutputIdentity = QueryOutputTable<T>(context).ToList(); UpdateEntitiesIdentity(entities, entitiesWithOutputIdentity); } } public async Task UpdateOutputIdentityAsync<T>(DbContext context, IList<T> entities) where T : class { if (HasSinglePrimaryKey) { var entitiesWithOutputIdentity = await QueryOutputTable<T>(context).ToListAsync().ConfigureAwait(false); UpdateEntitiesIdentity(entities, entitiesWithOutputIdentity); } } protected IQueryable<T> QueryOutputTable<T>(DbContext context) where T : class { string q = SqlQueryBuilder.SelectFromOutputTable(this); var query = context.Set<T>().FromSql(q); if (!BulkConfig.TrackingEntities) { query = query.AsNoTracking(); } var queryOrdered = OrderBy(query, PrimaryKeys[0]); // ALTERNATIVELY OrderBy with DynamicLinq ('using System.Linq.Dynamic.Core;' NuGet required) that eliminates need for custom OrderBy<T> method with Expression. //var queryOrdered = query.OrderBy(PrimaryKeys[0]); return queryOrdered; } private static IQueryable<T> OrderBy<T>(IQueryable<T> source, string ordering) { Type entityType = typeof(T); PropertyInfo property = entityType.GetProperty(ordering); ParameterExpression parameter = Expression.Parameter(entityType); MemberExpression propertyAccess = Expression.MakeMemberAccess(parameter, property); LambdaExpression orderByExp = Expression.Lambda(propertyAccess, parameter); MethodCallExpression resultExp = Expression.Call(typeof(Queryable), "OrderBy", new Type[] { entityType, property.PropertyType }, source.Expression, Expression.Quote(orderByExp)); var orderedQuery = source.Provider.CreateQuery<T>(resultExp); return orderedQuery; }*/ #endregion } }
55.348671
333
0.59295
[ "MIT" ]
qvsmith/EFCore.BulkExtensions
EFCore.BulkExtensions/TableInfo.cs
54,131
C#
using AutoMapper; namespace UltraNuke.Barasingha.AlarmManagement.API.Application.Mappers { /// <summary> /// /// </summary> public class DomainToDTOProfile : Profile { /// <summary> /// /// </summary> public DomainToDTOProfile() { } } }
17.388889
70
0.533546
[ "MIT" ]
zcqiand/Barasingha-WebApi
src/Services/AlarmManagement/AlarmManagement.API/Application/Mappers/DomainToDTOProfile.cs
315
C#
using System; namespace P04.Recharge { public class Robot : Worker, IRechargeable { private int capacity; private int currentPower; public Robot(string id, int capacity) : base(id) { this.capacity = capacity; } public int Capacity { get { return this.capacity; } } public int CurrentPower { get { return this.currentPower; } set { this.currentPower = value; } } public override void Work(int hours) { if (hours > this.currentPower) { hours = currentPower; } base.Work(hours); this.currentPower -= hours; } public void Recharge() { this.currentPower = this.capacity; } } }
20.547619
56
0.486674
[ "MIT" ]
Avarea/OOP-Advanced
SOLID/P04.Recharge/Robot.cs
865
C#
using YJC.Toolkit.Sys; namespace YJC.Toolkit.MetaData { public class TableSchemeExConfigFactory : BaseXmlConfigFactory { public const string REG_NAME = "_tk_xml_TableSchemeEx"; private const string DESCRIPTION = "单表TableSchemeEx配置插件工厂"; public TableSchemeExConfigFactory() : base(REG_NAME, DESCRIPTION) { } } }
25.133333
67
0.671088
[ "BSD-3-Clause" ]
madiantech/tkcore
Core/YJC.Toolkit.MetaData/MetaData/_Xml/TableSchemeExConfigFactory.cs
395
C#
using Newtonsoft.Json.Linq; using System; using System.Configuration; using System.Net.Http; namespace EnhancedQuickStart { class Program { static void Main(string[] args) { try { //Get configuration data from App.config connectionStrings string connectionString = ConfigurationManager.ConnectionStrings["Connect"].ConnectionString; using (HttpClient client = SampleHelpers.GetHttpClient(connectionString, SampleHelpers.clientId, SampleHelpers.redirectUrl)) { // Use the WhoAmI function var response = client.GetAsync("WhoAmI").Result; if (response.IsSuccessStatusCode) { //Get the response content and parse it. JObject body = JObject.Parse(response.Content.ReadAsStringAsync().Result); Guid userId = (Guid)body["UserId"]; Console.WriteLine("Your UserId is {0}", userId); } else { Console.WriteLine("The request failed with a status of '{0}'", response.ReasonPhrase); } Console.WriteLine("Press any key to exit."); Console.ReadLine(); } } catch (Exception ex) { SampleHelpers.DisplayException(ex); Console.WriteLine("Press any key to exit."); Console.ReadLine(); } } } }
35.531915
140
0.498204
[ "MIT" ]
BlueG81/PowerApps-Samples
cds/webapi/C#/EnhancedQuickStart/Program.cs
1,672
C#
using IrcDotNet; using LiveSplit.Model; using LiveSplit.Model.Comparisons; using LiveSplit.Model.Input; using LiveSplit.Options; using LiveSplit.TimeFormatters; using LiveSplit.Updates; using System; using System.Collections.Generic; using System.Drawing; using System.Globalization; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace LiveSplit.Web.SRL { public class SpeedRunsLiveIRC : IDisposable { private RaceState _State; public RaceState RaceState { get { return _State; } set { _State = value; if (StateChanged != null) StateChanged(this, RaceState); } } protected IrcClient Client { get; set; } public ITimerModel Model { get; set; } public bool IsConnected { get { return Client.IsConnected; } } public event EventHandlerT<String> ChannelJoined; public event EventHandlerT<String> RawMessageReceived; public event EventHandlerT<Tuple<String, SRLIRCUser, String>> MessageReceived; public event EventHandlerT<RaceState> StateChanged; public event EventHandler UserListRefreshed; public event EventHandler GoalChanged; public event EventHandler PasswordIncorrect; public event EventHandler NicknameInUse; public event EventHandler Disconnected; public event EventHandler Kicked; public System.Timers.Timer RaceBotResponseTimer { get; set; } public String Username { get; protected set; } protected String Password { get; set; } protected IList<String> ChannelsToJoin { get; set; } public String GameName { get; set; } public String ChannelTopic { get; set; } protected IrcChannel MainChannel { get { return Client.Channels.Where(x => x.Name.Equals("#speedrunslive")).FirstOrDefault(); } } protected IrcChannel LiveSplitChannel { get { return Client.Channels.Where(x => x.Name.EndsWith("-livesplit")).FirstOrDefault(); } } protected IrcChannel RaceChannel { get { return Client.Channels.Where(x => x.Name.StartsWith("#srl") && !x.Name.EndsWith("-livesplit")).FirstOrDefault(); } } public String LiveSplitChannelName { get { return LiveSplitChannel.Name; } } public String RaceChannelName { get { return RaceChannel == null ? null : RaceChannel.Name; } } public SpeedRunsLiveIRC(LiveSplitState state, ITimerModel model, IEnumerable<String> channels) { ChannelsToJoin = channels.ToList(); Client = new IrcClient(); Client.ConnectFailed += Client_ConnectFailed; Client.Connected += Client_Connected; Client.Registered += Client_Registered; Client.RawMessageReceived += Client_RawMessageReceived; Client.ConnectFailed += Client_ConnectFailed; Client.Disconnected += Client_Disconnected; Model = model; state.OnSplit += Model_OnSplit; state.OnUndoSplit += Model_OnUndoSplit; state.OnReset += Model_OnReset; RaceState = RaceState.NotInRace; } void RaceChannel_UserKicked(object sender, IrcChannelUserEventArgs e) { if (e.ChannelUser.User.NickName == Client.LocalUser.NickName && Kicked != null) Kicked(this, null); } void Client_Disconnected(object sender, EventArgs e) { if (Disconnected != null) Disconnected(this, null); } void Model_OnReset(object sender, TimerPhase e) { if (RaceState == RaceState.RaceStarted) QuitRace(); } void RaiseUserListRefreshed(object sender, EventArgs e) { if (UserListRefreshed != null) UserListRefreshed(this, null); } void LocalUser_JoinedChannel(object sender, IrcChannelEventArgs e) { e.Channel.MessageReceived += SpeedRunsLive_MessageReceived; if (e.Channel == RaceChannel) { e.Channel.ModesChanged += RaiseUserListRefreshed; e.Channel.UserJoined += RaiseUserListRefreshed; e.Channel.UserKicked += RaiseUserListRefreshed; e.Channel.UserLeft += RaiseUserListRefreshed; e.Channel.UsersListReceived += RaiseUserListRefreshed; e.Channel.UsersListReceived += Channel_UsersListReceived; RaceChannel.TopicChanged += RaceChannel_TopicChanged; RaceChannel.UserKicked += RaceChannel_UserKicked; } if (e.Channel == LiveSplitChannel) { e.Channel.UsersListReceived += Channel_UsersListReceived; } if (ChannelJoined != null) ChannelJoined(this, e.Channel.Name); } void Channel_UsersListReceived(object sender, EventArgs e) { try { if (RaceChannel != null && LiveSplitChannel != null) { RemoveRaceComparisons(); foreach (var user in GetRaceChannelUsers().Where(x => x.Rights.HasFlag(SRLIRCRights.Voice) && x.Name != Username)) { if (LiveSplitChannel.Users.Select(x => x.User.NickName).Contains(user.Name)) AddComparison(user.Name); } } } catch (Exception ex) { Log.Error(ex); } } void RaceChannel_TopicChanged(object sender, EventArgs e) { ChannelTopic = RaceChannel.Topic; if (GoalChanged != null) GoalChanged(null, null); } private String Escape(String value) { // \ -> \\ // " -> \. return value.Replace("\\", "\\\\").Replace("\"", "\\."); } private String Unescape(String value) { // \. -> " // \\ -> \ return value.Replace("\\.", "\"").Replace("\\\\", "\\"); } void Model_OnSplit(object sender, EventArgs e) { var timeFormatter = new RegularTimeFormatter(TimeAccuracy.Hundredths); if (LiveSplitChannel != null && (RaceState == RaceState.RaceStarted || RaceState == RaceState.RaceEnded)) { if (Model.CurrentState.CurrentSplitIndex > 0) { var split = Model.CurrentState.Run[Model.CurrentState.CurrentSplitIndex - 1]; var timeRTA = "-"; var timeIGT = "-"; if (split.SplitTime.RealTime != null) timeRTA = timeFormatter.Format(split.SplitTime.RealTime); if (split.SplitTime.GameTime != null) timeIGT = timeFormatter.Format(split.SplitTime.GameTime); Client.LocalUser.SendMessage(LiveSplitChannel, String.Format(".time \"{0}\" {1}", Escape(split.Name), timeRTA)); Client.LocalUser.SendMessage(LiveSplitChannel, String.Format(".timeGT \"{0}\" {1}", Escape(split.Name), timeIGT)); } } if (RaceChannel != null) { if (Model.CurrentState.CurrentPhase == TimerPhase.Ended && RaceState == RaceState.RaceStarted) Client.LocalUser.SendMessage(RaceChannel, ".done"); } } void Model_OnUndoSplit(object sender, EventArgs e) { if (LiveSplitChannel != null && RaceState == RaceState.RaceEnded && Model.CurrentState.CurrentSplitIndex == Model.CurrentState.Run.Count - 1) Undone(); if (LiveSplitChannel != null && (RaceState == RaceState.RaceStarted || RaceState == RaceState.RaceEnded)) { var split = Model.CurrentState.CurrentSplit; var time = "-"; Client.LocalUser.SendMessage(LiveSplitChannel, String.Format(".time \"{0}\" {1}", Escape(split.Name), time)); Client.LocalUser.SendMessage(LiveSplitChannel, String.Format(".timeGT \"{0}\" {1}", Escape(split.Name), time)); } } void Client_Registered(object sender, EventArgs e) { Client.LocalUser.SendMessage("NickServ", String.Format("IDENTIFY {0}", Password)); Client.LocalUser.JoinedChannel += LocalUser_JoinedChannel; } void Client_RawMessageReceived(object sender, IrcRawMessageEventArgs e) { if (e.Message.Command == "010") { Client.Disconnect(); Connect("irc2.speedrunslive.com", Username, Password); return; } if (e.Message.Command == "433") { if (NicknameInUse != null) NicknameInUse(this, null); } if (e.Message.Source != null && e.Message.Source.Name == "NickServ" && e.Message.Command == "NOTICE") { if (e.Message.Parameters[1] == "Password accepted - you are now recognized.") { Task.Factory.StartNew(() => { foreach (var channel in ChannelsToJoin) Client.Channels.Join(channel); }); } else if (e.Message.Parameters[1] == "Password incorrect.") { if (PasswordIncorrect != null) PasswordIncorrect(this, null); } } if (RawMessageReceived != null) RawMessageReceived(this, String.Format("{0} - {1}", e.Message.Command, e.Message.Parameters.Where(x => x != null).Aggregate((a, b) => a + " " + b))); } protected void ProcessSplit(String user, String segmentName, TimeSpan? time, TimingMethod method) { var run = Model.CurrentState.Run; var comparisonName = "[Race] " + user; var segment = run.FirstOrDefault(x => x.Name == segmentName); if (segment != null) { var newTime = new Time(segment.Comparisons[comparisonName]); newTime[method] = time; segment.Comparisons[comparisonName] = newTime; } } protected void ProcessRaceChannelMessage(String user, String message) { if (user == "RaceBot") { if (message.Contains("GO!") && RaceState == RaceState.EnteredRaceAndReady) { Model.Start(); RaceState = RaceState.RaceStarted; //Client.LocalUser.SendMessage(LiveSplitChannel, ".enter"); } else if (message == Client.LocalUser.NickName + " has been removed from the race.") { RaceState = RaceState.NotInRace; } else if (message.Contains(" has been removed from the race.")) { var userName = message.Substring(0, message.IndexOf(" ")); if (Model.CurrentState.CurrentComparison.Equals("[Race] " + userName)) Model.CurrentState.CurrentComparison = Run.PersonalBestComparisonName; var comparisonGenerator = Model.CurrentState.Run.ComparisonGenerators.FirstOrDefault(x => x.Name == ("[Race] " + userName)); if (comparisonGenerator != null) Model.CurrentState.Run.ComparisonGenerators.Remove(comparisonGenerator); foreach (var segment in Model.CurrentState.Run) segment.Comparisons["[Race] " + userName] = default(Time); } else if (message.StartsWith(Client.LocalUser.NickName + " enters the race!")) { RaceState = RaceState.EnteredRace; } else if (message.Contains(" enters the race!")) { var userName = message.Substring(0, message.IndexOf(" ")); if (LiveSplitChannel.Users.Select(x => x.User.NickName).Contains(userName)) AddComparison(userName); } else if (message.StartsWith(Client.LocalUser.NickName + " is ready!")) { RaceState = RaceState.EnteredRaceAndReady; } else if (message.StartsWith(Client.LocalUser.NickName + " isn't ready!")) { RaceState = RaceState.EnteredRace; } else if (message.StartsWith(Client.LocalUser.NickName + " has forfeited from the race.")) { RaceState = RaceState.RaceEnded; } else if (message.StartsWith(Client.LocalUser.NickName + " has been undone from the race.")) { RaceState = RaceState.RaceStarted; } else if (message.StartsWith(Client.LocalUser.NickName + " has finished in")) { RaceState = RaceState.RaceEnded; } else if (message == "Rematch!") { RaceState = RaceState.NotInRace; RemoveRaceComparisons(); } } } protected void AddComparison(String userName) { var run = Model.CurrentState.Run; var comparisonName = "[Race] " + userName; if (!run.ComparisonGenerators.Any(x => x.Name == comparisonName)) { CompositeComparisons.AddShortComparisonName(comparisonName, userName); run.ComparisonGenerators.Add(new SRLComparisonGenerator(comparisonName)); } } public void RemoveRaceComparisons() { if (Model.CurrentState.CurrentComparison.StartsWith("[Race] ")) Model.CurrentState.CurrentComparison = Run.PersonalBestComparisonName; for (var ind = 0; ind < Model.CurrentState.Run.ComparisonGenerators.Count; ind++) { if (Model.CurrentState.Run.ComparisonGenerators[ind].Name.StartsWith("[Race] ")) { Model.CurrentState.Run.ComparisonGenerators.RemoveAt(ind); ind--; } } foreach (var segment in Model.CurrentState.Run) { for (var index = 0; index < segment.Comparisons.Count; index++) { var comparison = segment.Comparisons.ElementAt(index); if (comparison.Key.StartsWith("[Race] ")) segment.Comparisons[comparison.Key] = default(Time); } } } protected void ProcessMainChannelMessage(String user, String message) { if ((user == "RaceBot") && RaceChannel == null && message.StartsWith("Race initiated for " + GameName)) { var index = message.IndexOf("#srl"); var channel = message.Substring(index, 10); Client.Channels.Join(channel); Client.Channels.Join(channel + "-livesplit"); RaceBotResponseTimer.Enabled = false; } } protected void ProcessLiveSplitChannelMessage(String user, String message) { /*if (State == RaceState.RaceStarted || State == RaceState.EnteredRaceAndReady) { if (message == ".enter") { var run = Model.CurrentState.Run; var comparisonName = "[Race] " + user; if (!run.ComparisonGenerators.Any(x => x.Name == comparisonName)) { CompositeComparisons.AddShortComparisonName(comparisonName, user); run.ComparisonGenerators.Add(new SRLComparisonGenerator(comparisonName)); } } }*/ if (RaceState == RaceState.RaceStarted || RaceState == RaceState.RaceEnded) { if (message.StartsWith(".time ") || message.StartsWith(".timeGT ")) { var method = message.StartsWith(".timeGT ") ? TimingMethod.GameTime : TimingMethod.RealTime; var cutOff = message.Substring(".time \"".Length + (method == TimingMethod.GameTime ? "GT".Length : 0)); var index = cutOff.IndexOf("\""); var splitName = Unescape(cutOff.Substring(0, index)); var timeString = cutOff.Substring(index + 2); var time = ParseTime(timeString); ProcessSplit(user, splitName, time, method); } } } protected TimeSpan? ParseTime(String timeString) { if (timeString == "-") return null; return TimeSpanParser.Parse(timeString); } void SpeedRunsLive_MessageReceived(object sender, IrcMessageEventArgs e) { if (e.Targets.Count > 0 && e.Targets[0] == RaceChannel) { var realName = RaceChannel.Users.Where(x => x.User.NickName == e.Source.Name).FirstOrDefault().User.RealName; ProcessRaceChannelMessage(e.Source.Name, e.Text); } else if (e.Targets.Count > 0 && e.Targets[0] == LiveSplitChannel) { ProcessLiveSplitChannelMessage(e.Source.Name, e.Text); } else if (e.Targets.Count > 0 && e.Targets[0] == MainChannel) { ProcessMainChannelMessage(e.Source.Name, e.Text); } if (MessageReceived != null) { var rights = SRLIRCRights.Normal; if (e.Targets[0] is IrcChannel) { var target = e.Targets[0] as IrcChannel; var source = target.Users.Where(x => x.User.NickName == e.Source.Name).FirstOrDefault(); if (source != null) { rights = SRLIRCRightsHelper.FromIrcChannelUser(source); } } MessageReceived(this, new Tuple<string, SRLIRCUser, string>(e.Targets[0].Name, new SRLIRCUser(e.Source.Name), e.Text)); } } private void Connect(String server, String username, String password) { Username = username; Password = password; Client.Connect(server, 6667, new IrcUserRegistrationInfo() { UserName = username, NickName = username, #if DEBUG RealName = "xd" #else RealName = "LiveSplit " + UpdateHelper.Version #endif }); } public void Connect(String username, String password) { Connect("irc2.speedrunslive.com", username, password); } void Client_Connected(object sender, EventArgs e) { } void Client_ConnectFailed(object sender, IrcErrorEventArgs e) { } public void Disconnect() { try { Client.Disconnect(); } catch (Exception ex) { Log.Error(ex); } } public void QuitRace() { try { Client.LocalUser.SendMessage(RaceChannel, ".quit"); } catch (Exception ex) { Log.Error(ex); } } public void JoinRace() { try { Client.LocalUser.SendMessage(RaceChannel, ".join"); } catch (Exception ex) { Log.Error(ex); } } public void Ready() { try { Client.LocalUser.SendMessage(RaceChannel, ".ready"); } catch (Exception ex) { Log.Error(ex); } } public void Unready() { try { Client.LocalUser.SendMessage(RaceChannel, ".unready"); } catch (Exception ex) { Log.Error(ex); } } public void Undone() { try { Client.LocalUser.SendMessage(RaceChannel, ".undone"); } catch (Exception ex) { Log.Error(ex); } } public IEnumerable<SRLIRCUser> GetRaceChannelUsers() { if (RaceChannel == null) return new SRLIRCUser[0]; return RaceChannel.Users .Select(x => new SRLIRCUser( x.User.NickName, SRLIRCRightsHelper.FromIrcChannelUser(x) ) ) .OrderBy(x => ((x.Rights == SRLIRCRights.Operator) ? "0" : (x.Rights == SRLIRCRights.Voice) ? "1" : "2") + x.Name ); } public SRLIRCUser GetUser() { return GetRaceChannelUsers().Where(x => x.Name == Client.LocalUser.NickName).FirstOrDefault(); } public void SendRaceChannelMessage(string message) { if (RaceChannel != null) { Client.LocalUser.SendMessage(RaceChannel, message); } } public void SendMainChannelMessage(string message) { Client.LocalUser.SendMessage("#speedrunslive", message); } public void Dispose() { Client.Dispose(); } } }
37.240066
165
0.515805
[ "MIT" ]
glacials/LiveSplit
LiveSplit/LiveSplit.Core/Web/SRL/SpeedRunsLiveIRC.cs
22,495
C#
using Microsoft.UI.Xaml.Controls; namespace WinMLSamplesGallery { /// <summary> /// An empty page that can be used on its own or navigated to within a Frame. /// </summary> public sealed partial class HomePage : Page { public HomePage() { this.InitializeComponent(); SamplesGrid.Navigate(typeof(SamplesGrid)); } } }
23.882353
82
0.581281
[ "MIT" ]
phillipmacon/WinML
Samples/WinMLSamplesGallery/WinMLSamplesGallery/Pages/HomePage.xaml.cs
408
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; using ARX; /// <summary> /// Script holding an ARX_StatQuadBox for debugging in Edit Mode /// </summary> [ExecuteInEditMode] public class ARX_Script_StatBox : MonoBehaviour { public ARX_StatBox_Quad mo_stats = null; void Awake() { if (mo_stats == null) mo_stats = ScriptableObject.CreateInstance<ARX_StatBox_Quad>(); } void Start() { if (mo_stats == null) mo_stats = ScriptableObject.CreateInstance<ARX_StatBox_Quad>(); } }
20.103448
75
0.665523
[ "CC0-1.0" ]
VelvetAlabaster/ARX
Unremastered Files/ARX8.Core/script/ARX_Script_StatBox.cs
585
C#
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using Lucene.Net.Support; namespace Lucene.Net.Analyzers.Payloads { /// <summary> /// Utility methods for encoding payloads. /// </summary> public static class PayloadHelper { public static byte[] EncodeFloat(float payload) { return EncodeFloat(payload, new byte[4], 0); } public static byte[] EncodeFloat(float payload, byte[] data, int offset) { return EncodeInt(Single.FloatToIntBits(payload), data, offset); } public static byte[] EncodeInt(int payload) { return EncodeInt(payload, new byte[4], 0); } public static byte[] EncodeInt(int payload, byte[] data, int offset) { data[offset] = (byte) (payload >> 24); data[offset + 1] = (byte) (payload >> 16); data[offset + 2] = (byte) (payload >> 8); data[offset + 3] = (byte) payload; return data; } /// <summary> /// <p>Decode the payload that was encoded using encodeFloat(float)</p> /// <p>NOTE: the length of the array must be at least offset + 4 long.</p> /// </summary> /// <param name="bytes">The bytes to decode</param> /// <returns>the decoded float</returns> public static float DecodeFloat(byte[] bytes) { return DecodeFloat(bytes, 0); } /// <summary> /// <p>Decode the payload that was encoded using encodeFloat(float)</p> /// <p>NOTE: the length of the array must be at least offset + 4 long.</p> /// </summary> /// <param name="bytes">The bytes to decode</param> /// <param name="offset">The offset into the array.</param> /// <returns>The float that was encoded</returns> public static float DecodeFloat(byte[] bytes, int offset) { return Single.IntBitsToFloat(DecodeInt(bytes, offset)); } public static int DecodeInt(byte[] bytes, int offset) { return ((bytes[offset] & 0xFF) << 24) | ((bytes[offset + 1] & 0xFF) << 16) | ((bytes[offset + 2] & 0xFF) << 8) | (bytes[offset + 3] & 0xFF); } } }
37.6875
86
0.602322
[ "Apache-2.0" ]
dineshkummarc/lucene.net
src/contrib/Analyzers/Payloads/PayloadHelper.cs
3,017
C#
using MvvmCross.Forms.Platforms.Ios.Core; namespace BibleBook.iOS { public class Setup : MvxFormsIosSetup<Core.App, UI.App> { } }
16
59
0.694444
[ "Apache-2.0" ]
paulpiotr/BibleBook
src/BibleBook.iOS/Setup.cs
146
C#
using System; namespace DSA { public class Node { public int Value { get; set; } public Node Next; public Node(int val) { this.Value = val; } } class ClosedLoop { public static bool DetectLoop(Node _head) { Node slow = _head, fast = _head.Next.Next; while (slow != null && fast != null && fast.Next != null) { if (slow == fast) { Console.WriteLine("Loop detected at: " + slow.Value); return true; } slow = slow.Next; //1 step increment fast = fast.Next.Next; //2 step increment } return false; } static void Main(string[] args) { Node tail = new Node(0); Node _actualHead = tail; Node intersection = null; //Creating linked list by adding nodes to the end of the list. for (int i = 1; i < 10; i++) { Node n = new Node(i); tail.Next = n; tail = n; //Taking the loop intersection. Comment below 'if' to avoid loop. if (i == 4) intersection = tail; } //Completing the loop tail.Next = intersection; if (!DetectLoop(_actualHead)) Console.WriteLine("No loop detected"); } } }
26.172414
81
0.438076
[ "MIT" ]
1305Tanmay/algo_ds_101
Data-Structures/LinkedList/Singly_Linked_List/Detect_Cycle/detect_cycle.cs
1,520
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System; using System.Collections.Generic; using System.IO; using System.Runtime.Serialization.Formatters.Binary; using System.Text; using System.Threading; using System.Threading.Tasks; using Azure.Core.Serialization; namespace Azure.DigitalTwins.Core.Tests { /// <summary> /// Custom serializer to pass to the DigitalTwins client. /// </summary> public class TestObjectSerializer : ObjectSerializer { private static readonly JsonObjectSerializer s_serializer = new JsonObjectSerializer(); // This field is used by the tests to confirm the function was called. public bool WasDeserializeCalled { get; set; } // This field is used by the tests to confirm the function was called. public bool WasSerializeCalled { get; set; } public override object Deserialize(Stream stream, Type returnType, CancellationToken cancellationToken) { WasDeserializeCalled = true; return s_serializer.Deserialize(stream, returnType, cancellationToken); } public override async ValueTask<object> DeserializeAsync(Stream stream, Type returnType, CancellationToken cancellationToken) { WasDeserializeCalled = true; return await s_serializer.DeserializeAsync(stream, returnType, cancellationToken); } public override void Serialize(Stream stream, object value, Type inputType, CancellationToken cancellationToken) { WasSerializeCalled = true; s_serializer.Serialize(stream, value, inputType, cancellationToken); } public override async ValueTask SerializeAsync(Stream stream, object value, Type inputType, CancellationToken cancellationToken) { WasSerializeCalled = true; await s_serializer.SerializeAsync(stream, value, inputType, cancellationToken); } } }
37.716981
136
0.708854
[ "MIT" ]
93mishra/azure-sdk-for-net
sdk/digitaltwins/Azure.DigitalTwins.Core/tests/TestObjectSerializer.cs
2,001
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Crestron.SimplSharp; namespace SharpProTouchpanelDemo.UI.Core { /// <summary> /// Used for all events where a string value is changed by the touchpanel. (Text entry events, etc.) /// </summary> public class StringValueChangedEventArgs : EventArgs { /// <summary> /// Initialize a new instance of the <see cref="StringValueChangedEventArgs"/> class. /// </summary> /// <param name="value">The string value.</param> public StringValueChangedEventArgs(string value) { Value = value; } /// <summary> /// Gets the value. /// </summary> public string Value { get; private set; } } }
28.392857
104
0.615094
[ "MIT" ]
ProfessorAire/ElegantPanelScaffolding
src/Elegant Panel Scaffolding/Resources/StringValueChangedEventArgs.g.cs
797
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Runes.Net.Shared { public interface IDescribable { string GetDescription(); } }
16.285714
33
0.723684
[ "MIT" ]
ROM-II/rom_db_editor
Runes.Net.Shared/IDescribable.cs
230
C#
using System; namespace RDPWrapInstaller.Exceptions { public class OperatingSystemNotSupportedException : Exception { } }
16
65
0.708333
[ "MIT" ]
NUlliiON/RDPWrapInstaller
RDPWrapInstaller/Exceptions/OperatingSystemNotSupportedException.cs
146
C#
using System; using System.Collections.Generic; using Plugin.Iconize; using Xamarin.Forms; using Xamarin.Forms.Platform.MacOS; [assembly: ExportRenderer(typeof(IconTabbedPage), typeof(IconTabbedPageRenderer))] namespace Plugin.Iconize { /// <summary> /// Defines the <see cref="IconTabbedPage" /> renderer. /// </summary> /// <seealso cref="Xamarin.Forms.Platform.MacOS.TabbedPageRenderer" /> public class IconTabbedPageRenderer : TabbedPageRenderer { private readonly List<String> _icons = new List<String>(); /// <summary> /// Raises the <see cref="E:ElementChanged" /> event. /// </summary> /// <param name="e">The <see cref="VisualElementChangedEventArgs" /> instance containing the event data.</param> protected override void OnElementChanged(VisualElementChangedEventArgs e) { _icons.Clear(); if (e.NewElement != null) { foreach (var page in ((TabbedPage)e.NewElement).Children) { _icons.Add(page.Icon.File); page.Icon = null; } } base.OnElementChanged(e); } /// <summary> /// Views the will appear. /// </summary> public override void ViewWillAppear() { base.ViewWillAppear(); for (int i = 0; i < TabView.Items.Length; i++) { var icon = Iconize.FindIconForKey(_icons?[i]); if (icon == null) continue; using (var image = icon.ToNSImage(18)) { TabView.Items[i].Image = image; } } } } }
29.745763
120
0.536182
[ "Apache-2.0" ]
stepkillah/Iconize
src/Plugin.Iconize/Platform/macOS/Renderers/IconTabbedPageRenderer.cs
1,757
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("_15.SumReversedNumbers")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("_15.SumReversedNumbers")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("4024ee0a-3fea-4273-91b5-7c7355a05659")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
38.297297
84
0.747354
[ "MIT" ]
V-Uzunov/Soft-Uni-Education
02.ProgrammingFundamentalsC#/07.ArraysAndListExercises/ArraysAndList/15.SumReversedNumbers/Properties/AssemblyInfo.cs
1,420
C#
#if NET_4_0 // TaskTests.cs // // Copyright (c) 2008 Jérémie "Garuma" Laval // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // // using System; using System.Threading; using System.Threading.Tasks; using NUnit.Framework; namespace MonoTests.System.Threading.Tasks { [TestFixture] public class FutureTests { Task<int> InitTestTask() { return Task.Factory.StartNew<int> (() => 5); } [Test] public void SimpleTaskTestCase () { Task<int> f = InitTestTask (); Assert.IsNotNull(f, "#1"); Assert.AreEqual(5, f.Result, "#2"); } [Test] public void TaskContinueWithTestCase () { bool result = false; Task<int> f = InitTestTask (); Task<int> cont = f.ContinueWith ((future) => { result = true; return future.Result * 2; }); f.Wait (); cont.Wait (); Assert.IsNotNull (cont, "#1"); Assert.IsTrue (result, "#2"); Assert.AreEqual (10, cont.Result); } static Task<int> CreateNestedFuture(int level) { if (level == 0) return Task.Factory.StartNew(() => { Thread.Sleep (1); return 1; }); var t = CreateNestedFuture(level - 1); return Task.Factory.StartNew(() => t.Result + 1); } [Test] public void NestedFutureTest () { ParallelTestHelper.Repeat (delegate { var t = CreateNestedFuture(10); var t2 = CreateNestedFuture(100); var t3 = CreateNestedFuture(100); Assert.AreEqual (11, t.Result); Assert.AreEqual (101, t2.Result); Assert.AreEqual (101, t3.Result); }, 50); } [Test] public void FaultedFutureTest () { var thrown = new ApplicationException (); var f = Task<int>.Factory.StartNew (() => { throw thrown; return 42; }); AggregateException ex = null; try { f.Wait (); } catch (AggregateException e) { ex = e; } Assert.IsNotNull (ex); Assert.AreEqual (thrown, ex.InnerException); Assert.AreEqual (thrown, f.Exception.InnerException); Assert.AreEqual (TaskStatus.Faulted, f.Status); ex = null; try { var result = f.Result; } catch (AggregateException e) { ex = e; } Assert.IsNotNull (ex); Assert.AreEqual (TaskStatus.Faulted, f.Status); Assert.AreEqual (thrown, f.Exception.InnerException); Assert.AreEqual (thrown, ex.InnerException); } } } #endif
27.173554
94
0.679136
[ "Apache-2.0" ]
OpenPSS/psm-mono
mcs/class/corlib/Test/System.Threading.Tasks/FutureTests.cs
3,290
C#
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from um/MsHTML.h in the Windows SDK for Windows 10.0.22000.0 // Original source is Copyright © Microsoft. All rights reserved. using NUnit.Framework; using System; using System.Runtime.InteropServices; using static TerraFX.Interop.Windows.IID; namespace TerraFX.Interop.Windows.UnitTests; /// <summary>Provides validation of the <see cref="DispHTMLHeadElement" /> struct.</summary> public static unsafe partial class DispHTMLHeadElementTests { /// <summary>Validates that the <see cref="Guid" /> of the <see cref="DispHTMLHeadElement" /> struct is correct.</summary> [Test] public static void GuidOfTest() { Assert.That(typeof(DispHTMLHeadElement).GUID, Is.EqualTo(IID_DispHTMLHeadElement)); } /// <summary>Validates that the <see cref="DispHTMLHeadElement" /> struct is blittable.</summary> [Test] public static void IsBlittableTest() { Assert.That(Marshal.SizeOf<DispHTMLHeadElement>(), Is.EqualTo(sizeof(DispHTMLHeadElement))); } /// <summary>Validates that the <see cref="DispHTMLHeadElement" /> struct has the right <see cref="LayoutKind" />.</summary> [Test] public static void IsLayoutSequentialTest() { Assert.That(typeof(DispHTMLHeadElement).IsLayoutSequential, Is.True); } /// <summary>Validates that the <see cref="DispHTMLHeadElement" /> struct has the correct size.</summary> [Test] public static void SizeOfTest() { if (Environment.Is64BitProcess) { Assert.That(sizeof(DispHTMLHeadElement), Is.EqualTo(8)); } else { Assert.That(sizeof(DispHTMLHeadElement), Is.EqualTo(4)); } } }
35.921569
145
0.694323
[ "MIT" ]
reflectronic/terrafx.interop.windows
tests/Interop/Windows/Windows/um/MsHTML/DispHTMLHeadElementTests.cs
1,834
C#
// <auto-generated> // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. // </auto-generated> namespace UiPath.Web.Client20191 { using Models; using System.Threading; using System.Threading.Tasks; /// <summary> /// Extension methods for QueueItemEvents. /// </summary> public static partial class QueueItemEventsExtensions { /// <summary> /// Gets the QueueItemEvents. /// </summary> /// <remarks> /// Required permissions: Queues.View and Transactions.View. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='expand'> /// Expands related entities inline. /// </param> /// <param name='filter'> /// Filters the results, based on a Boolean condition. /// </param> /// <param name='select'> /// Selects which properties to include in the response. /// </param> /// <param name='orderby'> /// Sorts the results. /// </param> /// <param name='top'> /// Returns only the first n results. /// </param> /// <param name='skip'> /// Skips the first n results. /// </param> /// <param name='count'> /// Includes a count of the matching results in the response. /// </param> public static ODataResponseListQueueItemEventDto GetQueueItemEvents(this IQueueItemEvents operations, string expand = default(string), string filter = default(string), string select = default(string), string orderby = default(string), int? top = default(int?), int? skip = default(int?), bool? count = default(bool?)) { return operations.GetQueueItemEventsAsync(expand, filter, select, orderby, top, skip, count).GetAwaiter().GetResult(); } /// <summary> /// Gets the QueueItemEvents. /// </summary> /// <remarks> /// Required permissions: Queues.View and Transactions.View. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='expand'> /// Expands related entities inline. /// </param> /// <param name='filter'> /// Filters the results, based on a Boolean condition. /// </param> /// <param name='select'> /// Selects which properties to include in the response. /// </param> /// <param name='orderby'> /// Sorts the results. /// </param> /// <param name='top'> /// Returns only the first n results. /// </param> /// <param name='skip'> /// Skips the first n results. /// </param> /// <param name='count'> /// Includes a count of the matching results in the response. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task<ODataResponseListQueueItemEventDto> GetQueueItemEventsAsync(this IQueueItemEvents operations, string expand = default(string), string filter = default(string), string select = default(string), string orderby = default(string), int? top = default(int?), int? skip = default(int?), bool? count = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetQueueItemEventsWithHttpMessagesAsync(expand, filter, select, orderby, top, skip, count, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// <summary> /// Gets a QueueItemEvent by Id. /// </summary> /// <remarks> /// Required permissions: Queues.View and Transactions.View. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// key: Id /// </param> /// <param name='expand'> /// Expands related entities inline. /// </param> /// <param name='select'> /// Selects which properties to include in the response. /// </param> public static QueueItemEventDto GetById(this IQueueItemEvents operations, long id, string expand = default(string), string select = default(string)) { return operations.GetByIdAsync(id, expand, select).GetAwaiter().GetResult(); } /// <summary> /// Gets a QueueItemEvent by Id. /// </summary> /// <remarks> /// Required permissions: Queues.View and Transactions.View. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// key: Id /// </param> /// <param name='expand'> /// Expands related entities inline. /// </param> /// <param name='select'> /// Selects which properties to include in the response. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task<QueueItemEventDto> GetByIdAsync(this IQueueItemEvents operations, long id, string expand = default(string), string select = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetByIdWithHttpMessagesAsync(id, expand, select, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// <summary> /// Returns a collection of Queue Item Events associated to a Queue Item and /// all its related Queue Items. /// A Queue Item is related to another if it was created as a retry of a failed /// Queue Item. They also share the same Key. /// </summary> /// <remarks> /// Required permissions: Queues.View and Transactions.View. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='queueItemId'> /// The Id of the Queue Item for which the event history is requested. /// </param> /// <param name='expand'> /// Expands related entities inline. /// </param> /// <param name='filter'> /// Filters the results, based on a Boolean condition. /// </param> /// <param name='select'> /// Selects which properties to include in the response. /// </param> /// <param name='orderby'> /// Sorts the results. /// </param> /// <param name='top'> /// Returns only the first n results. /// </param> /// <param name='skip'> /// Skips the first n results. /// </param> /// <param name='count'> /// Includes a count of the matching results in the odata-count header. /// </param> public static ODataResponseListQueueItemEventDto GetQueueItemEventsHistoryByQueueitemid(this IQueueItemEvents operations, long queueItemId, string expand = default(string), string filter = default(string), string select = default(string), string orderby = default(string), int? top = default(int?), int? skip = default(int?), bool? count = default(bool?)) { return operations.GetQueueItemEventsHistoryByQueueitemidAsync(queueItemId, expand, filter, select, orderby, top, skip, count).GetAwaiter().GetResult(); } /// <summary> /// Returns a collection of Queue Item Events associated to a Queue Item and /// all its related Queue Items. /// A Queue Item is related to another if it was created as a retry of a failed /// Queue Item. They also share the same Key. /// </summary> /// <remarks> /// Required permissions: Queues.View and Transactions.View. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='queueItemId'> /// The Id of the Queue Item for which the event history is requested. /// </param> /// <param name='expand'> /// Expands related entities inline. /// </param> /// <param name='filter'> /// Filters the results, based on a Boolean condition. /// </param> /// <param name='select'> /// Selects which properties to include in the response. /// </param> /// <param name='orderby'> /// Sorts the results. /// </param> /// <param name='top'> /// Returns only the first n results. /// </param> /// <param name='skip'> /// Skips the first n results. /// </param> /// <param name='count'> /// Includes a count of the matching results in the odata-count header. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task<ODataResponseListQueueItemEventDto> GetQueueItemEventsHistoryByQueueitemidAsync(this IQueueItemEvents operations, long queueItemId, string expand = default(string), string filter = default(string), string select = default(string), string orderby = default(string), int? top = default(int?), int? skip = default(int?), bool? count = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetQueueItemEventsHistoryByQueueitemidWithHttpMessagesAsync(queueItemId, expand, filter, select, orderby, top, skip, count, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } } }
47.09322
484
0.54004
[ "MIT" ]
AFWberlin/orchestrator-powershell
UiPath.Web.Client/generated20191/QueueItemEventsExtensions.cs
11,114
C#
// QuickGraph Library // // Copyright (c) 2004 Jonathan de Halleux // // This software is provided 'as-is', without any express or implied warranty. // // In no event will the authors be held liable for any damages arising from // the use of this software. // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment in the product // documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, and must // not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source // distribution. // // QuickGraph Library HomePage: http://www.mbunit.com // Author: Jonathan de Halleux namespace QuickGraph.Concepts.Algorithms { using System; using QuickGraph.Concepts.Visitors; /// <summary> /// Defines an algorithm that supports vertex distance recording. /// </summary> public interface IDistanceRecorderAlgorithm : IAlgorithm { /// <summary> /// Add event handlers to the corresponding events. /// </summary> /// <param name="vis">Distance recorder visitor</param> void RegisterDistanceRecorderHandlers(IDistanceRecorderVisitor vis); } }
34.711111
80
0.715749
[ "ECL-2.0", "Apache-2.0" ]
Gallio/mbunit-v2
src/quickgraph/QuickGraph/Concepts/Algorithms/IDistanceRecorderAlgorithm.cs
1,562
C#
using System; namespace AlbLib.Mapping { /// <summary> /// Description of IMinimapVisible. /// </summary> public interface IMinimapVisible { byte MinimapType{get;} bool VisibleOnMinimap{get;} } }
14.857143
36
0.701923
[ "MIT" ]
IllidanS4/AlbLib
Mapping/IMinimapVisible.cs
210
C#
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.Aws.WafV2.Outputs { [OutputType] public sealed class WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementXssMatchStatementTextTransformation { /// <summary> /// Relative processing order for multiple transformations that are defined for a rule statement. AWS WAF processes all transformations, from lowest priority to highest, before inspecting the transformed content. /// </summary> public readonly int Priority; /// <summary> /// Transformation to apply, please refer to the Text Transformation [documentation](https://docs.aws.amazon.com/waf/latest/APIReference/API_TextTransformation.html) for more details. /// </summary> public readonly string Type; [OutputConstructor] private WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementXssMatchStatementTextTransformation( int priority, string type) { Priority = priority; Type = type; } } }
38.777778
220
0.715616
[ "ECL-2.0", "Apache-2.0" ]
chivandikwa/pulumi-aws
sdk/dotnet/WafV2/Outputs/WebAclRuleStatementAndStatementStatementAndStatementStatementOrStatementStatementXssMatchStatementTextTransformation.cs
1,396
C#
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; using System; using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Xml; namespace Miniblog.Core.Models { public class BlogController : Controller { private IBlogService _blog; private IOptionsSnapshot<BlogSettings> _settings; public BlogController(IBlogService blog, IOptionsSnapshot<BlogSettings> settings) { _blog = blog; _settings = settings; } [Route("/{page:int?}")] [OutputCache(Profile = "default")] public async Task<IActionResult> Index([FromRoute]int page = 0) { var posts = await _blog.GetPosts(_settings.Value.PostsPerPage, _settings.Value.PostsPerPage * page); ViewData["Title"] = _settings.Value.Name + " - A blog about ASP.NET & Visual Studio"; ViewData["Description"] = _settings.Value.Description; ViewData["prev"] = $"/{page + 1}/"; ViewData["next"] = $"/{(page <= 1 ? null : page - 1 + "/")}"; return View("Views/Blog/Index.cshtml", posts); } [Route("/blog/category/{category}/{page:int?}")] [OutputCache(Profile = "default")] public async Task<IActionResult> Category(string category, int page = 0) { var posts = (await _blog.GetPostsByCategory(category)).Skip(_settings.Value.PostsPerPage * page).Take(_settings.Value.PostsPerPage); ViewData["Title"] = _settings.Value.Name + " " + category; ViewData["Description"] = $"Articles posted in the {category} category"; ViewData["prev"] = $"/blog/category/{category}/{page + 1}/"; ViewData["next"] = $"/blog/category/{category}/{(page <= 1 ? null : page - 1 + "/")}"; return View("Views/Blog/Index.cshtml", posts); } // This is for redirecting potential existing URLs from the old Miniblog URL format [Route("/post/{slug}")] [HttpGet] public IActionResult Redirects(string slug) { return LocalRedirectPermanent($"/blog/{slug}"); } [Route("/blog/{slug?}")] [OutputCache(Profile = "default")] public async Task<IActionResult> Post(string slug) { var post = await _blog.GetPostBySlug(slug); if (post != null) { return View(post); } return NotFound(); } [Route("/blog/edit/{id?}")] [HttpGet, Authorize] public async Task<IActionResult> Edit(string id) { if (string.IsNullOrEmpty(id)) { return View(new Post()); } var post = await _blog.GetPostById(id); if (post != null) { return View(post); } return NotFound(); } [Route("/blog/{slug?}")] [HttpPost, Authorize, AutoValidateAntiforgeryToken] public async Task<IActionResult> UpdatePost(Post post) { if (!ModelState.IsValid) { return View("Edit", post); } var existing = await _blog.GetPostById(post.ID) ?? post; string categories = Request.Form["categories"]; existing.Categories = categories.Split(",", StringSplitOptions.RemoveEmptyEntries).Select(c => c.Trim().ToLowerInvariant()).ToList(); existing.Title = post.Title.Trim(); existing.Slug = post.Slug.Trim(); existing.Slug = !string.IsNullOrWhiteSpace(post.Slug) ? post.Slug.Trim() : Models.Post.CreateSlug(post.Title); existing.IsPublished = post.IsPublished; existing.Content = post.Content.Trim(); existing.Excerpt = post.Excerpt.Trim(); await _blog.SavePost(existing); await SaveFilesToDisk(existing); return Redirect(post.GetLink()); } private async Task SaveFilesToDisk(Post post) { var imgRegex = new Regex("<img[^>].+ />", RegexOptions.IgnoreCase | RegexOptions.Compiled); var base64Regex = new Regex("data:[^/]+/(?<ext>[a-z]+);base64,(?<base64>.+)", RegexOptions.IgnoreCase); foreach (Match match in imgRegex.Matches(post.Content)) { XmlDocument doc = new XmlDocument(); doc.LoadXml("<root>" + match.Value + "</root>"); var img = doc.FirstChild.FirstChild; var srcNode = img.Attributes["src"]; var fileNameNode = img.Attributes["data-filename"]; // The HTML editor creates base64 DataURIs which we'll have to convert to image files on disk if (srcNode != null && fileNameNode != null) { var base64Match = base64Regex.Match(srcNode.Value); if (base64Match.Success) { byte[] bytes = Convert.FromBase64String(base64Match.Groups["base64"].Value); srcNode.Value = await _blog.SaveFile(bytes, fileNameNode.Value).ConfigureAwait(false); img.Attributes.Remove(fileNameNode); post.Content = post.Content.Replace(match.Value, img.OuterXml); } } } } [Route("/blog/deletepost/{id}")] [HttpPost, Authorize, AutoValidateAntiforgeryToken] public async Task<IActionResult> DeletePost(string id) { var existing = await _blog.GetPostById(id); if (existing != null) { await _blog.DeletePost(existing); return Redirect("/"); } return NotFound(); } [Route("/blog/comment/{postId}")] [HttpPost] public async Task<IActionResult> AddComment(string postId, Comment comment) { var post = await _blog.GetPostById(postId); if (!ModelState.IsValid) { return View("Post", post); } if (post == null || !post.AreCommentsOpen(_settings.Value.CommentsCloseAfterDays)) { return NotFound(); } comment.IsAdmin = User.Identity.IsAuthenticated; comment.Content = comment.Content.Trim(); comment.Author = comment.Author.Trim(); comment.Email = comment.Email.Trim(); // the website form key should have been removed by javascript // unless the comment was posted by a spam robot if (!Request.Form.ContainsKey("website")) { post.Comments.Add(comment); await _blog.SavePost(post); } return Redirect(post.GetLink() + "#" + comment.ID); } [Route("/blog/comment/{postId}/{commentId}")] [Authorize] public async Task<IActionResult> DeleteComment(string postId, string commentId) { var post = await _blog.GetPostById(postId); if (post == null) { return NotFound(); } var comment = post.Comments.FirstOrDefault(c => c.ID.Equals(commentId, StringComparison.OrdinalIgnoreCase)); if (comment == null) { return NotFound(); } post.Comments.Remove(comment); await _blog.SavePost(post); return Redirect(post.GetLink() + "#comments"); } } }
35.410138
145
0.548933
[ "Apache-2.0" ]
aivsim/SimpleGratitude
src/Controllers/BlogController.cs
7,686
C#
using Microsoft.Dynamics.Framework.Tools.Extensibility; using Microsoft.Dynamics.Framework.Tools.MetaModel.Automation.BaseTypes; using Microsoft.Dynamics.Framework.Tools.MetaModel.Automation.Classes; using Microsoft.Dynamics.Framework.Tools.MetaModel.Automation.Forms; using Microsoft.Dynamics.Framework.Tools.MetaModel.Automation.Security; using Microsoft.Dynamics.Framework.Tools.MetaModel.Automation.Tables; using Microsoft.Dynamics.Framework.Tools.MetaModel.Core; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SSD365VSAddIn.ExtensionCommand { /// <summary> /// Creates a Extension from given object /// </summary> [Export(typeof(Microsoft.Dynamics.Framework.Tools.Extensibility.IDesignerMenu))] // IDesignerMenu // If you need to specify any other element, change this AutomationNodeType value. // You can specify multiple DesignerMenuExportMetadata attributes to meet your needs [DesignerMenuExportMetadata(AutomationNodeType = typeof(ISecurityDuty))] [DesignerMenuExportMetadata(AutomationNodeType = typeof(ITable))] [DesignerMenuExportMetadata(AutomationNodeType = typeof(IForm))] [DesignerMenuExportMetadata(AutomationNodeType = typeof(IBaseEnum))] class CreateExtensionCreatorDesignContextMenuAddIn : DesignerMenuBase { #region Member variables private const string addinName = "SSD365VSAddIn.CreateExtensionCreatorDesignContextMenuAddIn"; #endregion #region Properties /// <summary> /// Caption for the menu item. This is what users would see in the menu. /// </summary> public override string Caption { get { return AddinResources.CreateExtension; } } /// <summary> /// Unique name of the add-in /// </summary> public override string Name { get { return CreateExtensionCreatorDesignContextMenuAddIn.addinName; } } #endregion #region Callbacks /// <summary> /// Called when user clicks on the add-in menu /// </summary> /// <param name="e">The context of the VS tools and metadata</param> public override void OnClick(AddinDesignerEventArgs e) { try { if (e.SelectedElement is ISecurityDuty) { SecurityDuty.SecurityDutyCreator.CreateDutyExtension(e.SelectedElement as ISecurityDuty); } else if (e.SelectedElement is ITable) { Tables.TableHelper.CreateTableExtension(e.SelectedElement as ITable); } else if (e.SelectedElement is IForm) { Forms.FormHelper.CreateExtension(e.SelectedElement as IForm); } else if(e.SelectedElement is IBaseEnum) { DataTypes.BaseEnumHelper.CreateExtension(e.SelectedElement as IBaseEnum); } else { CoreUtility.DisplayError("Not implemented yet"); } } catch (Exception ex) { CoreUtility.HandleExceptionWithErrorMessage(ex); } } #endregion } }
37.4375
110
0.609905
[ "MIT" ]
TrudAX/SSD365VSAddIn
SSD365VSAddIn/SSD365VSAddIn/ExtensionCommand/CreateExtensionCreatorDesignContextMenuAddIn.cs
3,596
C#
// Auto generated code using Kernel; using Kernel.Config; using Kernel.Util; using System; using System.IO; namespace GeneratedCode { public class StringSerializer : IConfigSerializer { object IConfigSerializer.Read(IBinaryReader reader, object o) { return Read(reader, (string)o); } public static string Read(IBinaryReader o, string d) { if(o.ReadBoolean() == false) return null; d = o.ReadString(); return d; } void IConfigSerializer.Write(IBinaryWriter writer, object o) { Write(writer, (string)o); } public static void Write(IBinaryWriter o, string d) { o.Write(d != null); if(d == null) return; o.Write(d); } } }
18.589744
64
0.634483
[ "MIT" ]
hsiuqnav/configMgr
configMgr/Assets/GeneratedCode/StringSerializer.cs
725
C#
using BrewLib.Data; using ManagedBass; using System; using System.Diagnostics; namespace BrewLib.Audio { public class AudioSample { private const int MaxSimultaneousPlayBacks = 8; private string path; public string Path => path; private int sample; public readonly AudioManager Manager; internal AudioSample(AudioManager audioManager, string path, ResourceContainer resourceContainer) { Manager = audioManager; this.path = path; sample = Bass.SampleLoad(path, 0, 0, MaxSimultaneousPlayBacks, BassFlags.SampleOverrideLongestPlaying); if (sample != 0) return; var bytes = resourceContainer?.GetBytes(path); if (bytes != null) { sample = Bass.SampleLoad(bytes, 0, 0, MaxSimultaneousPlayBacks, BassFlags.SampleOverrideLongestPlaying); if (sample != 0) return; } Trace.WriteLine($"Failed to load audio sample ({path}): {Bass.LastError}"); } public void Play(float volume = 1) { if (sample == 0) return; var channel = new AudioChannel(Manager, Bass.SampleGetChannel(sample), true) { Volume = volume, }; Manager.RegisterChannel(channel); channel.Playing = true; } #region IDisposable Support private bool disposedValue = false; protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { } if (sample != 0) { Bass.SampleFree(sample); sample = 0; } disposedValue = true; } } ~AudioSample() { Dispose(false); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } #endregion } }
25.62963
120
0.517823
[ "MIT" ]
T0chi/storybrew
brewlib/Audio/AudioSample.cs
2,078
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; /// <summary> /// Get notified after the asset is imported. /// </summary> public interface IOnPostProcessImportAssetCallback { void OnAssetImported(); } /// <summary> /// Get notified before the asset is deleted. /// </summary> public interface IOnWillDeleteAssetCallback { void OnWillDelete(); } /// <summary> /// Get notified before the asset is deleted. /// </summary> public interface IOnWillSaveAssetCallback { void OnWillSave(); } /// <summary> /// Get notified when this asset is moved /// </summary> public interface IOnPostProcessMoveAssetCallback { void OnAssetMoved(); }
18.486486
50
0.723684
[ "MIT" ]
DouglasPotesta/QuestZip
Runtime/AssetCallbacks/AssetProcessingInterfaces.cs
686
C#
using DisasterTrackerApp.Dal.Repositories.Contract; using DisasterTrackerApp.Entities; using Newtonsoft.Json; using StackExchange.Redis; namespace DisasterTrackerApp.Dal.Repositories.Implementation; public class RedisWatchChannelsRepository : IRedisWatchChannelsRepository { private const string WatchChannelsHashSet = "WatchChannelsHashSet"; private const string UserChannelHashSet = "UserChannelHashSet"; private readonly IConnectionMultiplexer _connectionMultiplexer; public RedisWatchChannelsRepository(IConnectionMultiplexer connectionMultiplexer) { _connectionMultiplexer = connectionMultiplexer; } public WatchChannelEntity? GetWatchChannel(string channelToken) { var db = _connectionMultiplexer.GetDatabase(); var hashGet = db.HashGet(WatchChannelsHashSet, channelToken); return !string.IsNullOrEmpty(hashGet) ? JsonConvert.DeserializeObject<WatchChannelEntity>(hashGet) : null; } public WatchChannelEntity? GetWatchChannel(Guid userId) { var db = _connectionMultiplexer.GetDatabase(); var channelToken = db.HashGet(UserChannelHashSet, userId.ToString()).ToString(); if (string.IsNullOrEmpty(channelToken)) { return null; } var hashGet = db.HashGet(WatchChannelsHashSet, channelToken); return !string.IsNullOrEmpty(hashGet) ? JsonConvert.DeserializeObject<WatchChannelEntity>(hashGet) : null; } public string? GetChannelToken(Guid userId) { var db = _connectionMultiplexer.GetDatabase(); var hashGet = db.HashGet(UserChannelHashSet, userId.ToString()); return !string.IsNullOrEmpty(hashGet) ? hashGet.ToString() : null; } public void RemoveWatchChannel(Guid userId) { var db = _connectionMultiplexer.GetDatabase(); var channelToken = db.HashGet(UserChannelHashSet, userId.ToString()).ToString(); if (string.IsNullOrEmpty(channelToken)) { return; } db.HashDelete(UserChannelHashSet, userId.ToString()); db.HashDelete(WatchChannelsHashSet, channelToken); } public void Save(string channelToken, WatchChannelEntity? watchChannelEntity) { if (watchChannelEntity == null) { throw new ArgumentOutOfRangeException(nameof(watchChannelEntity)); } var data = JsonConvert.SerializeObject(watchChannelEntity); var db = _connectionMultiplexer.GetDatabase(); SaveData(db, WatchChannelsHashSet, channelToken, data); SaveData(db, UserChannelHashSet, watchChannelEntity.UserId.ToString(), channelToken); } private void SaveData(IDatabase db, string hashSet, string key, string value) { db.HashSet(hashSet, new HashEntry[] { new(new RedisValue(key), new RedisValue(value)) }); } }
33.977011
114
0.687754
[ "MIT" ]
FairyFox5700/Disaster-Tracker-App
src/Tracking/DisasterTrackerApp.Dal/Repositories/Implementation/RedisWatchChannelsRepository.cs
2,956
C#