commit
stringlengths
40
40
old_file
stringlengths
4
237
new_file
stringlengths
4
237
old_contents
stringlengths
1
4.24k
new_contents
stringlengths
1
4.87k
subject
stringlengths
15
778
message
stringlengths
15
8.75k
lang
stringclasses
266 values
license
stringclasses
13 values
repos
stringlengths
5
127k
0b9b09fa1ebc4e8a911221e3ade68d89273af590
src/Core/Managed/Shared/Extensibility/Implementation/External/ExceptionDetails_types.cs
src/Core/Managed/Shared/Extensibility/Implementation/External/ExceptionDetails_types.cs
//------------------------------------------------------------------------------ // This code was generated by a tool. // // Tool : Bond Compiler 0.4.1.0 // File : ExceptionDetails_types.cs // // Changes to this file may cause incorrect behavior and will be lost when // the code is regenerated. // <auto-generated /> //------------------------------------------------------------------------------ // suppress "Missing XML comment for publicly visible type or member" #pragma warning disable 1591 #region ReSharper warnings // ReSharper disable PartialTypeWithSinglePart // ReSharper disable RedundantNameQualifier // ReSharper disable InconsistentNaming // ReSharper disable CheckNamespace // ReSharper disable UnusedParameter.Local // ReSharper disable RedundantUsingDirective #endregion namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { using System.Collections.Concurrent; using System.Collections.Generic; [System.CodeDom.Compiler.GeneratedCode("gbc", "0.4.1.0")] internal partial class ExceptionDetails { public int id { get; set; } public int outerId { get; set; } public string typeName { get; set; } public string message { get; set; } public bool hasFullStack { get; set; } public string stack { get; set; } public IList<StackFrame> parsedStack { get; set; } public ExceptionDetails() : this("AI.ExceptionDetails", "ExceptionDetails") { } protected ExceptionDetails(string fullName, string name) { typeName = ""; message = ""; hasFullStack = true; stack = ""; parsedStack = new List<StackFrame>(); } } } // AI
//------------------------------------------------------------------------------ // This code was generated by a tool. // // Tool : Bond Compiler 0.4.1.0 // File : ExceptionDetails_types.cs // // Changes to this file may cause incorrect behavior and will be lost when // the code is regenerated. // <auto-generated /> //------------------------------------------------------------------------------ // suppress "Missing XML comment for publicly visible type or member" #pragma warning disable 1591 #region ReSharper warnings // ReSharper disable PartialTypeWithSinglePart // ReSharper disable RedundantNameQualifier // ReSharper disable InconsistentNaming // ReSharper disable CheckNamespace // ReSharper disable UnusedParameter.Local // ReSharper disable RedundantUsingDirective #endregion namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { using System.Collections.Concurrent; using System.Collections.Generic; [System.CodeDom.Compiler.GeneratedCode("gbc", "0.4.1.0")] internal partial class ExceptionDetails { public int id { get; set; } public int outerId { get; set; } public string typeName { get; set; } public string message { get; set; } public bool hasFullStack { get; set; } public string stack { get; set; } public IList<StackFrame> parsedStack { get; set; } public ExceptionDetails() : this("AI.ExceptionDetails", "ExceptionDetails") {} protected ExceptionDetails(string fullName, string name) { typeName = ""; message = ""; hasFullStack = true; stack = ""; parsedStack = new List<StackFrame>(); } } } // AI
Revert the whitespace change of the auto generated file
Revert the whitespace change of the auto generated file
C#
mit
pharring/ApplicationInsights-dotnet,pharring/ApplicationInsights-dotnet,pharring/ApplicationInsights-dotnet,Microsoft/ApplicationInsights-dotnet
69292d88612fa328a47ad3ce207ad94cbf29b105
src/Qowaiv.UnitTests/TestTools/DebuggerDisplayAssert.cs
src/Qowaiv.UnitTests/TestTools/DebuggerDisplayAssert.cs
using NUnit.Framework; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace Qowaiv.UnitTests.TestTools { public static class DebuggerDisplayAssert { public static void HasAttribute(Type type) { Assert.IsNotNull(type, "The supplied type should not be null."); var act = (DebuggerDisplayAttribute)type.GetCustomAttributes(typeof(DebuggerDisplayAttribute), false).FirstOrDefault(); Assert.IsNotNull(act, "The type '{0}' has no DebuggerDisplay attribute.", type); Assert.AreEqual("{DebuggerDisplay}", act.Value, "DebuggerDisplay attribute value is not '{DebuggerDisplay}'."); } public static void HasResult(string expected, object value) { Assert.IsNotNull(value, "The supplied value should not be null."); var type = value.GetType(); var prop = type.GetProperty("DebuggerDisplay", BindingFlags.Instance | BindingFlags.NonPublic); Assert.IsNotNull(prop, "The type '{0}' does not contain a non-public property DebuggerDisplay.", type); var actual = prop.GetValue(value); Assert.AreEqual(expected, actual); } } }
using NUnit.Framework; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace Qowaiv.UnitTests.TestTools { public static class DebuggerDisplayAssert { public static void HasAttribute(Type type) { Assert.IsNotNull(type, "The supplied type should not be null."); var act = (DebuggerDisplayAttribute)type.GetCustomAttributes(typeof(DebuggerDisplayAttribute), false).FirstOrDefault(); Assert.IsNotNull(act, "The type '{0}' has no DebuggerDisplay attribute.", type); Assert.AreEqual("{DebuggerDisplay}", act.Value, "DebuggerDisplay attribute value is not '{DebuggerDisplay}'."); } public static void HasResult(object expected, object value) { Assert.IsNotNull(value, "The supplied value should not be null."); var type = value.GetType(); var prop = type.GetProperty("DebuggerDisplay", BindingFlags.Instance | BindingFlags.NonPublic); Assert.IsNotNull(prop, "The type '{0}' does not contain a non-public property DebuggerDisplay.", type); var actual = prop.GetValue(value); Assert.AreEqual(expected, actual); } } }
Support all objects for debugger display.
Support all objects for debugger display.
C#
mit
Qowaiv/Qowaiv
f07cae787f16ea07ffd1bedd5e8e4346567bb3b5
StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp8/LayoutRules/SA1514CSharp8UnitTests.cs
StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp8/LayoutRules/SA1514CSharp8UnitTests.cs
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. namespace StyleCop.Analyzers.Test.CSharp8.LayoutRules { using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Testing; using StyleCop.Analyzers.Test.CSharp7.LayoutRules; using Xunit; using static StyleCop.Analyzers.Test.Verifiers.StyleCopCodeFixVerifier< StyleCop.Analyzers.LayoutRules.SA1514ElementDocumentationHeaderMustBePrecededByBlankLine, StyleCop.Analyzers.LayoutRules.SA1514CodeFixProvider>; public class SA1514CSharp8UnitTests : SA1514CSharp7UnitTests { /// <summary> /// Verifies that method-like declarations with invalid documentation will produce the expected diagnostics. /// </summary> /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns> [Fact] public async Task TestValidPropertyDeclarationAsync() { var testCode = @"namespace TestNamespace { public class TestClass { /// <summary> /// Gets or sets the value. /// </summary> public string SomeString { get; set; } = null!; /// <summary> /// Gets or sets the value. /// </summary> public string AnotherString { get; set; } = null!; } } "; await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false); } } }
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. namespace StyleCop.Analyzers.Test.CSharp8.LayoutRules { using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Testing; using StyleCop.Analyzers.Test.CSharp7.LayoutRules; using Xunit; using static StyleCop.Analyzers.Test.Verifiers.StyleCopCodeFixVerifier< StyleCop.Analyzers.LayoutRules.SA1514ElementDocumentationHeaderMustBePrecededByBlankLine, StyleCop.Analyzers.LayoutRules.SA1514CodeFixProvider>; public class SA1514CSharp8UnitTests : SA1514CSharp7UnitTests { [Fact] [WorkItem(3067, "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3067")] public async Task TestValidPropertyDeclarationAsync() { var testCode = @"namespace TestNamespace { public class TestClass { /// <summary> /// Gets or sets the value. /// </summary> public string SomeString { get; set; } = null!; /// <summary> /// Gets or sets the value. /// </summary> public string AnotherString { get; set; } = null!; } } "; await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false); } } }
Clean up test and reference original issue
Clean up test and reference original issue
C#
mit
DotNetAnalyzers/StyleCopAnalyzers
2c339da50e228d205d11fd3e0c4953ed2523dacb
src/DocumentDbTests/Bugs/Bug_673_multiple_version_assertions.cs
src/DocumentDbTests/Bugs/Bug_673_multiple_version_assertions.cs
using System; using Marten.Testing.Harness; using Xunit; namespace DocumentDbTests.Bugs { public class Bug_673_multiple_version_assertions: IntegrationContext { [Fact] public void replaces_the_max_version_assertion() { var streamId = Guid.NewGuid(); using (var session = theStore.OpenSession()) { session.Events.Append(streamId, new WhateverEvent(), new WhateverEvent()); session.SaveChanges(); } using (var session = theStore.OpenSession()) { var state = session.Events.FetchStreamState(streamId); // ... do some stuff var expectedVersion = state.Version + 1; session.Events.Append(streamId, expectedVersion, new WhateverEvent()); // ... do some more stuff expectedVersion += 1; session.Events.Append(streamId, expectedVersion, new WhateverEvent()); session.SaveChanges(); } } public Bug_673_multiple_version_assertions(DefaultStoreFixture fixture) : base(fixture) { } } public class WhateverEvent { } }
using System; using Marten.Events; using Marten.Testing.Harness; using Xunit; namespace DocumentDbTests.Bugs { public class Bug_673_multiple_version_assertions: IntegrationContext { [Fact] public void replaces_the_max_version_assertion() { var streamId = Guid.NewGuid(); using (var session = theStore.OpenSession()) { session.Events.Append(streamId, new WhateverEvent(), new WhateverEvent()); session.SaveChanges(); } using (var session = theStore.OpenSession()) { var state = session.Events.FetchStreamState(streamId); // ... do some stuff var expectedVersion = state.Version + 1; session.Events.Append(streamId, expectedVersion, new WhateverEvent()); // ... do some more stuff expectedVersion += 1; session.Events.Append(streamId, expectedVersion, new WhateverEvent()); session.SaveChanges(); } } [Fact] public void replaces_the_max_version_assertion_for_string_identity() { UseStreamIdentity(StreamIdentity.AsString); var streamId = Guid.NewGuid().ToString(); using (var session = theStore.OpenSession()) { session.Events.Append(streamId, new WhateverEvent(), new WhateverEvent()); session.SaveChanges(); } using (var session = theStore.OpenSession()) { var state = session.Events.FetchStreamState(streamId); // ... do some stuff var expectedVersion = state.Version + 1; session.Events.Append(streamId, expectedVersion, new WhateverEvent()); // ... do some more stuff expectedVersion += 1; session.Events.Append(streamId, expectedVersion, new WhateverEvent()); session.SaveChanges(); } } public Bug_673_multiple_version_assertions(DefaultStoreFixture fixture) : base(fixture) { } } public class WhateverEvent { } }
Add failing test for append called several times for string identity
Add failing test for append called several times for string identity
C#
mit
ericgreenmix/marten,ericgreenmix/marten,ericgreenmix/marten,ericgreenmix/marten
2cce76d72e6099d7aba771e0193f9d46b8cde631
src/NQuery.Authoring/CodeActions/CodeRefactoringProvider.cs
src/NQuery.Authoring/CodeActions/CodeRefactoringProvider.cs
using System; using System.Collections.Generic; using System.Linq; namespace NQuery.Authoring.CodeActions { public abstract class CodeRefactoringProvider<T> : ICodeRefactoringProvider where T : SyntaxNode { public IEnumerable<ICodeAction> GetRefactorings(SemanticModel semanticModel, int position) { var syntaxTree = semanticModel.Compilation.SyntaxTree; var syntaxToken = syntaxTree.Root.FindToken(position); var synaxNodes = syntaxToken.Parent.AncestorsAndSelf().OfType<T>(); return synaxNodes.SelectMany(n => GetRefactorings(semanticModel, position, n)); } protected abstract IEnumerable<ICodeAction> GetRefactorings(SemanticModel semanticModel, int position, T node); } }
using System; using System.Collections.Generic; using System.Linq; namespace NQuery.Authoring.CodeActions { public abstract class CodeRefactoringProvider<T> : ICodeRefactoringProvider where T : SyntaxNode { public IEnumerable<ICodeAction> GetRefactorings(SemanticModel semanticModel, int position) { var syntaxTree = semanticModel.Compilation.SyntaxTree; return from t in syntaxTree.Root.FindStartTokens(position) from n in t.Parent.AncestorsAndSelf().OfType<T>() from r in GetRefactorings(semanticModel, position, n) select r; } protected abstract IEnumerable<ICodeAction> GetRefactorings(SemanticModel semanticModel, int position, T node); } }
Fix refactoring provider to correctly handle positions near EOF
Fix refactoring provider to correctly handle positions near EOF
C#
mit
terrajobst/nquery-vnext
715776771a6904c64303bee298afe98adf03d3f5
app/Umbraco/Umbraco.Archetype/Models/ArchetypePreValueProperty.cs
app/Umbraco/Umbraco.Archetype/Models/ArchetypePreValueProperty.cs
using System; using Newtonsoft.Json; namespace Archetype.Models { public class ArchetypePreValueProperty { [JsonProperty("alias")] public string Alias { get; set; } [JsonProperty("remove")] public bool Remove { get; set; } [JsonProperty("collapse")] public bool Collapse { get; set; } [JsonProperty("label")] public string Label { get; set; } [JsonProperty("helpText")] public string HelpText { get; set; } [JsonProperty("dataTypeGuid")] public Guid DataTypeGuid { get; set; } [JsonProperty("propertyEditorAlias")] public string PropertyEditorAlias { get; set; } [JsonProperty("value")] public string Value { get; set; } [JsonProperty("required")] public bool Required { get; set; } [JsonProperty("regEx")] public bool RegEx { get; set; } } }
using System; using Newtonsoft.Json; namespace Archetype.Models { public class ArchetypePreValueProperty { [JsonProperty("alias")] public string Alias { get; set; } [JsonProperty("remove")] public bool Remove { get; set; } [JsonProperty("collapse")] public bool Collapse { get; set; } [JsonProperty("label")] public string Label { get; set; } [JsonProperty("helpText")] public string HelpText { get; set; } [JsonProperty("dataTypeGuid")] public Guid DataTypeGuid { get; set; } [JsonProperty("propertyEditorAlias")] public string PropertyEditorAlias { get; set; } [JsonProperty("value")] public string Value { get; set; } [JsonProperty("required")] public bool Required { get; set; } [JsonProperty("regEx")] public string RegEx { get; set; } } }
Fix deserialization of RegEx enabled properties
Fix deserialization of RegEx enabled properties Fix type mismatch for RegEx (introduced in 6e50301 - my bad, sorry)
C#
mit
kjac/Archetype,imulus/Archetype,Nicholas-Westby/Archetype,kgiszewski/Archetype,tomfulton/Archetype,kgiszewski/Archetype,kipusoep/Archetype,imulus/Archetype,kipusoep/Archetype,tomfulton/Archetype,tomfulton/Archetype,kipusoep/Archetype,kjac/Archetype,Nicholas-Westby/Archetype,kjac/Archetype,imulus/Archetype,Nicholas-Westby/Archetype,kgiszewski/Archetype
d1c84b8b6ec6b01c7d2175aeaea270a121db1224
Topppro.WebSite/Areas/Humanist/Controllers/DashboardController.cs
Topppro.WebSite/Areas/Humanist/Controllers/DashboardController.cs
using System.Configuration; using System.IO; using System.Linq; using System.Web.Helpers; using System.Web.Mvc; using Topppro.WebSite.Areas.Humanist.Models; namespace Topppro.WebSite.Areas.Humanist.Controllers { [Authorize] public class DashboardController : Controller { private readonly static string _dlcFolderPath = ConfigurationManager.AppSettings["RootDownloadsFolderPath"]; public ActionResult Index() { var key = "RootDownloadsFolderPath"; var cached = WebCache.Get(key); if (cached == null) { string dlc_path = Server.MapPath(_dlcFolderPath); DirectoryInfo dlc_folder = new DirectoryInfo(dlc_path); if (!dlc_folder.Exists) return null; cached = dlc_folder.GetFiles() .Select(f => new DLCModel() { Url = UrlHelper.GenerateContentUrl(Path.Combine(_dlcFolderPath, f.Name), HttpContext), Name = Path.GetFileNameWithoutExtension(f.Name), Color = "purple-stripe", Icon = "" }); WebCache.Set(key, cached); } return View(cached); } } }
using System.IO; using System.Linq; using System.Web.Helpers; using System.Web.Mvc; using Topppro.WebSite.Areas.Humanist.Models; using Topppro.WebSite.Settings; namespace Topppro.WebSite.Areas.Humanist.Controllers { [Authorize] public class DashboardController : Controller { public ActionResult Index() { var key = typeof(DownloadSettings).Name; var cached = WebCache.Get(key); if (cached == null) { string dlc_path = Server.MapPath(ToppproSettings.Download.Root); DirectoryInfo dlc_folder = new DirectoryInfo(dlc_path); if (!dlc_folder.Exists) return null; cached = dlc_folder.GetFiles() .Select(f => new DLCModel() { Url = UrlHelper.GenerateContentUrl(Path.Combine(ToppproSettings.Download.Root, f.Name), HttpContext), Name = Path.GetFileNameWithoutExtension(f.Name), Color = "purple-stripe", Icon = "" }); WebCache.Set(key, cached); } return View(cached); } } }
Fix en dashboard. Uso de la clase de configuracion.
Fix en dashboard. Uso de la clase de configuracion.
C#
mit
jmirancid/TropicalNet.Topppro,jmirancid/TropicalNet.Topppro,jmirancid/TropicalNet.Topppro
5ae1c92b39436eb5944333c98b9555f4aec190a7
ndc-sydney/NDC.Build.Core/ViewModels/LoginViewModel.cs
ndc-sydney/NDC.Build.Core/ViewModels/LoginViewModel.cs
using System; using Caliburn.Micro; using NDC.Build.Core.Services; using static System.String; namespace NDC.Build.Core.ViewModels { public class LoginViewModel : Screen { private readonly ICredentialsService credentials; private readonly IAuthenticationService authentication; private readonly IApplicationNavigationService navigation; public LoginViewModel(ICredentialsService credentials, IAuthenticationService authentication, IApplicationNavigationService navigation) { this.credentials = credentials; this.authentication = authentication; this.navigation = navigation; } protected override async void OnInitialize() { var stored = await credentials.GetCredentialsAsync(); if (stored == Credentials.None) return; Account = stored.Account; Token = stored.Token; } public string Account { get; set; } public string Token { get; set; } public string Message { get; private set; } public bool CanLogin => !IsNullOrEmpty(Account) && !IsNullOrEmpty(Token); public async void Login() { var entered = new Credentials(Account, Token); var authenticated = await authentication.AuthenticateCredentialsAsync(entered); if (!authenticated) { Message = "Account / Token is incorrect"; } else { await credentials.StoreAsync(entered); navigation.ToProjects(); } } } }
using System; using Caliburn.Micro; using NDC.Build.Core.Services; using PropertyChanged; using static System.String; namespace NDC.Build.Core.ViewModels { public class LoginViewModel : Screen { private readonly ICredentialsService credentials; private readonly IAuthenticationService authentication; private readonly IApplicationNavigationService navigation; public LoginViewModel(ICredentialsService credentials, IAuthenticationService authentication, IApplicationNavigationService navigation) { this.credentials = credentials; this.authentication = authentication; this.navigation = navigation; } protected override async void OnInitialize() { var stored = await credentials.GetCredentialsAsync(); if (stored == Credentials.None) return; Account = stored.Account; Token = stored.Token; } public string Account { get; set; } public string Token { get; set; } public string Message { get; private set; } [DependsOn(nameof(Account), nameof(Token))] public bool CanLogin => !IsNullOrEmpty(Account) && !IsNullOrEmpty(Token); public async void Login() { var entered = new Credentials(Account, Token); var authenticated = await authentication.AuthenticateCredentialsAsync(entered); if (!authenticated) { Message = "Account / Token is incorrect"; } else { await credentials.StoreAsync(entered); navigation.ToProjects(); } } } }
Fix login view model inpc
Fix login view model inpc
C#
mit
nigel-sampson/talks,nigel-sampson/talks
fa6bb66e3eeb56591498b7525dfe9fc271c8cf4a
src/DotvvmAcademy.Web/Course/030_repeater/20_repeater.dothtml.csx
src/DotvvmAcademy.Web/Course/030_repeater/20_repeater.dothtml.csx
#load "00_constants.csx" using DotvvmAcademy.Validation.Dothtml.Unit; using DotvvmAcademy.Validation.Unit; public DothtmlUnit Unit { get; set; } = new DothtmlUnit(); Unit.GetDirective("/@viewModel") .RequireTypeArgument(ViewModelName); var repeater = Unit.GetControl("/html/body/dot:Repeater"); { repeater.GetProperty("@DataSource") .RequireBinding(ItemsProperty); repeater.GetControl("p/dot:Literal") .GetProperty("@Text") .RequireBinding("_this"); }
#load "00_constants.csx" using DotvvmAcademy.Validation.Dothtml.Unit; using DotvvmAcademy.Validation.Unit; public DothtmlUnit Unit { get; set; } = new DothtmlUnit(); Unit.GetDirective("/@viewModel") .RequireTypeArgument(ViewModelName); var repeater = Unit.GetControl("/html/body/dot:Repeater"); { repeater.GetProperty("@DataSource") .RequireBinding(ItemsProperty) .GetControl("p/dot:Literal") .GetProperty("@Text") .RequireBinding("_this"); }
Fix bug in the repeater step validation
Fix bug in the repeater step validation
C#
apache-2.0
riganti/dotvvm-samples-academy,riganti/dotvvm-samples-academy,riganti/dotvvm-samples-academy
b8616e27a05f22ca16f767309a8b954e276222f4
Assets/EasyButtons/ButtonAttribute.cs
Assets/EasyButtons/ButtonAttribute.cs
using System; namespace EasyButtons { /// <summary> /// Attribute to create a button in the inspector for calling the method it is attached to. /// The method must have no arguments. /// </summary> /// <example> /// [<see cref="ButtonAttribute"/>] /// void MyMethod() /// { /// Debug.Log("Clicked!"); /// } /// </example> [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)] public sealed class ButtonAttribute : Attribute { } }
using System; namespace EasyButtons { /// <summary> /// Attribute to create a button in the inspector for calling the method it is attached to. /// The method must be public and have no arguments. /// </summary> /// <example> /// [<see cref="ButtonAttribute"/>] /// public void MyMethod() /// { /// Debug.Log("Clicked!"); /// } /// </example> [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)] public sealed class ButtonAttribute : Attribute { } }
Update attribute summary and example
Update attribute summary and example
C#
mit
madsbangh/EasyButtons
37a47c96accb8e66694eb6bbacbe2fa8d0202495
GitDiffMargin/EditorDiffMarginFactory.cs
GitDiffMargin/EditorDiffMarginFactory.cs
#region using using System.ComponentModel.Composition; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Utilities; #endregion namespace GitDiffMargin { [Export(typeof (IWpfTextViewMarginProvider))] [Name(EditorDiffMargin.MarginNameConst)] [Order(Before = PredefinedMarginNames.LineNumber)] [MarginContainer(PredefinedMarginNames.LeftSelection)] [ContentType("text")] [TextViewRole(PredefinedTextViewRoles.Editable)] internal sealed class EditorDiffMarginFactory : DiffMarginFactoryBase { public override IWpfTextViewMargin CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin) { var marginCore = TryGetMarginCore(textViewHost); if (marginCore == null) return null; return new EditorDiffMargin(textViewHost.TextView, marginCore); } } }
#region using using System.ComponentModel.Composition; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Utilities; #endregion namespace GitDiffMargin { [Export(typeof (IWpfTextViewMarginProvider))] [Name(EditorDiffMargin.MarginNameConst)] [Order(After = PredefinedMarginNames.Spacer, Before = PredefinedMarginNames.Outlining)] [MarginContainer(PredefinedMarginNames.LeftSelection)] [ContentType("text")] [TextViewRole(PredefinedTextViewRoles.Editable)] internal sealed class EditorDiffMarginFactory : DiffMarginFactoryBase { public override IWpfTextViewMargin CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin) { var marginCore = TryGetMarginCore(textViewHost); if (marginCore == null) return null; return new EditorDiffMargin(textViewHost.TextView, marginCore); } } }
Move diff bar to the right of the line numbers (like in the GitSCC extension)
Move diff bar to the right of the line numbers (like in the GitSCC extension)
C#
mit
laurentkempe/GitDiffMargin,modulexcite/GitDiffMargin
9e2279bdddfd8b5824cda2f92907cd205751e9e6
bindings/csharp/Context.cs
bindings/csharp/Context.cs
using System; using System.Runtime.InteropServices; namespace LibGPhoto2 { public class Context : Object { [DllImport ("libgphoto2.so")] internal static extern IntPtr gp_context_new (); public Context () { this.handle = new HandleRef (this, gp_context_new ()); } [DllImport ("libgphoto2.so")] internal static extern void gp_context_unref (HandleRef context); protected override void Cleanup () { System.Console.WriteLine ("cleanup context"); gp_context_unref(handle); } } }
using System; using System.Runtime.InteropServices; namespace LibGPhoto2 { public class Context : Object { [DllImport ("libgphoto2.so")] internal static extern IntPtr gp_context_new (); public Context () { this.handle = new HandleRef (this, gp_context_new ()); } [DllImport ("libgphoto2.so")] internal static extern void gp_context_unref (HandleRef context); protected override void Cleanup () { gp_context_unref(handle); } } }
Remove random context cleanup console output
Remove random context cleanup console output git-svn-id: 40dd595c6684d839db675001a64203a1457e7319@8996 67ed7778-7388-44ab-90cf-0a291f65f57c
C#
lgpl-2.1
gphoto/libgphoto2.OLDMIGRATION,gphoto/libgphoto2.OLDMIGRATION,gphoto/libgphoto2.OLDMIGRATION,gphoto/libgphoto2.OLDMIGRATION
cc9a800812d0d1bf32b5baa5bc77f8348bf8200f
src/Stripe.net/Services/Accounts/AccountBusinessProfileOptions.cs
src/Stripe.net/Services/Accounts/AccountBusinessProfileOptions.cs
namespace Stripe { using Newtonsoft.Json; public class AccountBusinessProfileOptions : INestedOptions { [JsonProperty("mcc")] public string Mcc { get; set; } [JsonProperty("name")] public string Name { get; set; } [JsonProperty("primary_color")] public string PrimaryColor { get; set; } [JsonProperty("product_description")] public string ProductDescription { get; set; } [JsonProperty("support_email")] public string SupportEmail { get; set; } [JsonProperty("support_phone")] public string SupportPhone { get; set; } [JsonProperty("support_url")] public string SupportUrl { get; set; } [JsonProperty("url")] public string Url { get; set; } } }
namespace Stripe { using System; using Newtonsoft.Json; public class AccountBusinessProfileOptions : INestedOptions { /// <summary> /// The merchant category code for the account. MCCs are used to classify businesses based /// on the goods or services they provide. /// </summary> [JsonProperty("mcc")] public string Mcc { get; set; } /// <summary> /// The customer-facing business name. /// </summary> [JsonProperty("name")] public string Name { get; set; } [Obsolete("Use AccountSettingsBrandingOptions.PrimaryColor instead.")] [JsonProperty("primary_color")] public string PrimaryColor { get; set; } /// <summary> /// Internal-only description of the product sold by, or service provided by, the business. /// Used by Stripe for risk and underwriting purposes. /// </summary> [JsonProperty("product_description")] public string ProductDescription { get; set; } /// <summary> /// A publicly available mailing address for sending support issues to. /// </summary> [JsonProperty("support_address")] public AddressOptions SupportAddress { get; set; } /// <summary> /// A publicly available email address for sending support issues to. /// </summary> [JsonProperty("support_email")] public string SupportEmail { get; set; } /// <summary> /// A publicly available phone number to call with support issues. /// </summary> [JsonProperty("support_phone")] public string SupportPhone { get; set; } /// <summary> /// A publicly available website for handling support issues. /// </summary> [JsonProperty("support_url")] public string SupportUrl { get; set; } /// <summary> /// The business’s publicly available website. /// </summary> [JsonProperty("url")] public string Url { get; set; } } }
Add support for `SupportAddress` on `Account` create and update
Add support for `SupportAddress` on `Account` create and update
C#
apache-2.0
stripe/stripe-dotnet
3cba46608ab2e2ca6a095baf1cf8112010e81036
src/PowerShellEditorServices.Protocol/LanguageServer/References.cs
src/PowerShellEditorServices.Protocol/LanguageServer/References.cs
// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol; namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer { public class ReferencesRequest { public static readonly RequestType<ReferencesParams, Location[], object, object> Type = RequestType<ReferencesParams, Location[], object, object>.Create("textDocument/references"); } public class ReferencesParams : TextDocumentPosition { public ReferencesContext Context { get; set; } } public class ReferencesContext { public bool IncludeDeclaration { get; set; } } }
// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol; namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer { public class ReferencesRequest { public static readonly RequestType<ReferencesParams, Location[], object, TextDocumentRegistrationOptions> Type = RequestType<ReferencesParams, Location[], object, TextDocumentRegistrationOptions>.Create("textDocument/references"); } public class ReferencesParams : TextDocumentPosition { public ReferencesContext Context { get; set; } } public class ReferencesContext { public bool IncludeDeclaration { get; set; } } }
Add registration options for reference request
Add registration options for reference request
C#
mit
PowerShell/PowerShellEditorServices
10e66e24e962b3499edc2ed73050930ab8735379
src/NEventSocket/FreeSwitch/ChannelState.cs
src/NEventSocket/FreeSwitch/ChannelState.cs
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="ChannelState.cs" company="Dan Barua"> // (C) Dan Barua and contributors. Licensed under the Mozilla Public License. // </copyright> // -------------------------------------------------------------------------------------------------------------------- namespace NEventSocket.FreeSwitch { /// <summary> /// Represents the state of a Channel /// </summary> public enum ChannelState { #pragma warning disable 1591 New, Init, Routing, SoftExecute, Execute, ExchangeMedia, Park, ConsumeMedia, Hibernate, Reset, Hangup, Done, Destroy, Reporting #pragma warning restore 1591 } }
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="ChannelState.cs" company="Dan Barua"> // (C) Dan Barua and contributors. Licensed under the Mozilla Public License. // </copyright> // -------------------------------------------------------------------------------------------------------------------- namespace NEventSocket.FreeSwitch { /// <summary> /// Represents the state of a Channel /// </summary> public enum ChannelState { #pragma warning disable 1591 New, Init, Routing, SoftExecute, Execute, ExchangeMedia, Park, ConsumeMedia, Hibernate, Reset, Hangup, Done, Destroy, Reporting, None #pragma warning restore 1591 } }
Add channel state None (CS_NONE)
Add channel state None (CS_NONE)
C#
mpl-2.0
pragmatrix/NEventSocket,pragmatrix/NEventSocket
d7c04cddefaf1868c2b14dac26dd25a601c58d05
Battery-Commander.Web/Models/NavigationViewComponent.cs
Battery-Commander.Web/Models/NavigationViewComponent.cs
using BatteryCommander.Web.Controllers; using BatteryCommander.Web.Services; using Microsoft.AspNetCore.Mvc; using System; using System.Threading.Tasks; namespace BatteryCommander.Web.Models { public class NavigationViewComponent : ViewComponent { private readonly Database db; public Soldier Soldier { get; private set; } public Boolean ShowNavigation => !String.Equals(nameof(HomeController.PrivacyAct), RouteData.Values["action"]); public NavigationViewComponent(Database db) { this.db = db; } public async Task<IViewComponentResult> InvokeAsync() { Soldier = await UserService.FindAsync(db, UserClaimsPrincipal); return View(this); } } }
using BatteryCommander.Web.Controllers; using BatteryCommander.Web.Services; using Microsoft.AspNetCore.Mvc; using System; using System.Threading.Tasks; namespace BatteryCommander.Web.Models { public class NavigationViewComponent : ViewComponent { private readonly Database db; public Soldier Soldier { get; private set; } public Boolean ShowNavigation => Soldier != null && !String.Equals(nameof(HomeController.PrivacyAct), RouteData.Values["action"]); public NavigationViewComponent(Database db) { this.db = db; } public async Task<IViewComponentResult> InvokeAsync() { Soldier = await UserService.FindAsync(db, UserClaimsPrincipal); return View(this); } } }
Fix for no soldier foudn on nav component
Fix for no soldier foudn on nav component
C#
mit
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
b47a7eccfd2e6e0ab765b4d31d0abfde91377c7e
src/SFA.DAS.EmployerUsers.Web/Views/Login/AuthorizeResponse.cshtml
src/SFA.DAS.EmployerUsers.Web/Views/Login/AuthorizeResponse.cshtml
@model IdentityServer3.Core.ViewModels.AuthorizeResponseViewModel @{ ViewBag.PageID = "authorize-response"; ViewBag.Title = "Login Successful"; ViewBag.HideSigninLink = "true"; } <h1 class="heading-xlarge">Login successful</h1> <form id="mainForm" method="post" action="@Model.ResponseFormUri"> <div id="autoRedirect" style="display: none;">Please wait...</div> @Html.Raw(Model.ResponseFormFields) <div id="manualLoginContainer"> <p>It appears you do not have javascript enabled. Please click the continue button to complete your login.</p> <button type="submit" class="button" autofocus="autofocus">Continue</button> </div> </form> @section scripts { <script src="@Url.Content("~/Scripts/AuthorizeResponse.js")"></script> }
@model IdentityServer3.Core.ViewModels.AuthorizeResponseViewModel @{ ViewBag.PageID = "authorize-response"; ViewBag.Title = "Login Successful"; ViewBag.HideSigninLink = "true"; } <h1 class="heading-xlarge">Login successful</h1> <form id="mainForm" method="post" action="@Model.ResponseFormUri"> <div id="autoRedirect" style="display: none;">Please wait...</div> @Html.Raw(Model.ResponseFormFields) <div id="manualLoginContainer"> <p>Please click the continue button to complete your login.</p> <button type="submit" class="button" autofocus="autofocus">Continue</button> </div> </form> @section scripts { <script src="@Url.Content("~/Scripts/AuthorizeResponse.js")"></script> }
Copy change on the logged in page
Copy change on the logged in page
C#
mit
SkillsFundingAgency/das-employerusers,SkillsFundingAgency/das-employerusers,SkillsFundingAgency/das-employerusers
dba328016a5736e4704923b5c531ada4b3f4fac8
MailRuCloud/MailRuCloudApi/Base/Requests/WebM1/MoveRequest.cs
MailRuCloud/MailRuCloudApi/Base/Requests/WebM1/MoveRequest.cs
using System; using System.Net; using System.Text; using YaR.MailRuCloud.Api.Base.Requests.Repo; namespace YaR.MailRuCloud.Api.Base.Requests.WebM1 { class MoveRequest : BaseRequestJson<WebV2.CopyRequest.Result> { private readonly string _sourceFullPath; private readonly string _destinationPath; public MoveRequest(IWebProxy proxy, IAuth auth, string sourceFullPath, string destinationPath) : base(proxy, auth) { _sourceFullPath = sourceFullPath; _destinationPath = destinationPath; } protected override string RelationalUri => $"/api/m1/file/move?access_token={Auth.AccessToken}"; protected override byte[] CreateHttpContent() { var data = Encoding.UTF8.GetBytes($"home={Uri.EscapeDataString(_sourceFullPath)}&email={Auth.Login}&conflict=rename&folder={Uri.EscapeDataString(_destinationPath)}"); return data; } } }
using System; using System.Net; using System.Text; using YaR.MailRuCloud.Api.Base.Requests.Repo; namespace YaR.MailRuCloud.Api.Base.Requests.WebM1 { class MoveRequest : BaseRequestJson<WebV2.CopyRequest.Result> { private readonly string _sourceFullPath; private readonly string _destinationPath; public MoveRequest(IWebProxy proxy, IAuth auth, string sourceFullPath, string destinationPath) : base(proxy, auth) { _sourceFullPath = sourceFullPath; _destinationPath = destinationPath; } protected override string RelationalUri => $"/api/m1/file/move?access_token={Auth.AccessToken}"; protected override byte[] CreateHttpContent() { var data = $"home={Uri.EscapeDataString(_sourceFullPath)}&email={Auth.Login}&conflict=rename&folder={Uri.EscapeDataString(_destinationPath)}"; return Encoding.UTF8.GetBytes(data); } } }
Move request changed for uniformity
WebM1: Move request changed for uniformity
C#
mit
yar229/WebDavMailRuCloud
8dffb0d1f3d62796afd9e4c3ffdda8aad90b375d
Mollie.WebApplicationCoreExample/Views/Payment/Create.cshtml
Mollie.WebApplicationCoreExample/Views/Payment/Create.cshtml
@using Mollie.WebApplicationCoreExample.Framework.Extensions @model CreatePaymentModel @{ ViewData["Title"] = "Create payment"; } <div class="container"> <h2>Create new payment</h2> <form method="post"> <div asp-validation-summary="All"></div> <div class="row"> <div class="col-6"> <div class="form-group"> <label asp-for="Amount"></label> <input class="form-control" asp-for="Amount" /> </div> <div class="form-group"> <label asp-for="Currency"></label> <select class="form-control" asp-for="Currency" asp-items="@Html.GetStaticStringSelectList(typeof(Currency))"></select> </div> <div class="form-group"> <label asp-for="Description"></label> <textarea class="form-control" asp-for="Description" rows="4"></textarea> </div> <input type="submit" name="Save" value="Save" class="btn btn-primary" /> </div> </div> </form> </div>
@using Mollie.WebApplicationCoreExample.Framework.Extensions @model CreatePaymentModel @{ ViewData["Title"] = "Create payment"; } <div class="container"> <h2>Create new payment</h2> <form method="post"> <div asp-validation-summary="All"></div> <div class="row"> <div class="col-6"> <div class="form-group"> <label asp-for="Amount"></label> <input class="form-control" asp-for="Amount" autocomplete="off" /> </div> <div class="form-group"> <label asp-for="Currency"></label> <select class="form-control" asp-for="Currency" asp-items="@Html.GetStaticStringSelectList(typeof(Currency))"></select> </div> <div class="form-group"> <label asp-for="Description"></label> <textarea class="form-control" asp-for="Description" rows="4"></textarea> </div> <input type="submit" name="Save" value="Save" class="btn btn-primary" /> </div> </div> </form> </div>
Disable autocomplete for payment amount
Disable autocomplete for payment amount
C#
mit
Viincenttt/MollieApi,Viincenttt/MollieApi
f0b9bf35cd3a46a0dc04be7ef8e52687c094607a
src/Fixie.Console/Options.cs
src/Fixie.Console/Options.cs
namespace Fixie.Console { public class Options { public Options( string configuration, bool noBuild, string framework, string report) { Configuration = configuration ?? "Debug"; NoBuild = noBuild; Framework = framework; Report = report; } public string Configuration { get; } public bool NoBuild { get; } public bool ShouldBuild => !NoBuild; public string Framework { get; } public string Report { get; } } }
namespace Fixie.Console { public class Options { public Options( string? configuration, bool noBuild, string? framework, string? report) { Configuration = configuration ?? "Debug"; NoBuild = noBuild; Framework = framework; Report = report; } public string Configuration { get; } public bool NoBuild { get; } public bool ShouldBuild => !NoBuild; public string? Framework { get; } public string? Report { get; } } }
Declare the nullability of parsed command line arguments.
Declare the nullability of parsed command line arguments.
C#
mit
fixie/fixie
ac48ff87da15d10a020a3cff56f8b7cdb176defe
Source/HelixToolkit.Wpf.SharpDX.Tests/Controls/CanvasMock.cs
Source/HelixToolkit.Wpf.SharpDX.Tests/Controls/CanvasMock.cs
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="CanvasMock.cs" company="Helix Toolkit"> // Copyright (c) 2014 Helix Toolkit contributors // </copyright> // -------------------------------------------------------------------------------------------------------------------- using System; using SharpDX; using SharpDX.Direct3D11; namespace HelixToolkit.Wpf.SharpDX.Tests.Controls { class CanvasMock : IRenderHost { public CanvasMock() { Device = EffectsManager.Device; RenderTechnique = Techniques.RenderPhong; } public Device Device { get; private set; } Color4 IRenderHost.ClearColor { get; } Device IRenderHost.Device { get; } public Color4 ClearColor { get; private set; } public bool IsShadowMapEnabled { get; private set; } public bool IsMSAAEnabled { get; private set; } public IRenderer Renderable { get; private set; } public void SetDefaultRenderTargets() { throw new NotImplementedException(); } public void SetDefaultColorTargets(DepthStencilView dsv) { throw new NotImplementedException(); } public RenderTechnique RenderTechnique { get; private set; } public double ActualHeight { get; private set; } public double ActualWidth { get; private set; } } }
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="CanvasMock.cs" company="Helix Toolkit"> // Copyright (c) 2014 Helix Toolkit contributors // </copyright> // -------------------------------------------------------------------------------------------------------------------- using System; using SharpDX; using SharpDX.Direct3D11; namespace HelixToolkit.Wpf.SharpDX.Tests.Controls { class CanvasMock : IRenderHost { public CanvasMock() { Device = EffectsManager.Device; RenderTechnique = Techniques.RenderPhong; } public Device Device { get; private set; } public Color4 ClearColor { get; private set; } public bool IsShadowMapEnabled { get; private set; } public bool IsMSAAEnabled { get; private set; } public IRenderer Renderable { get; private set; } public RenderTechnique RenderTechnique { get; private set; } public double ActualHeight { get; private set; } public double ActualWidth { get; private set; } public void SetDefaultRenderTargets() { throw new NotImplementedException(); } public void SetDefaultColorTargets(DepthStencilView dsv) { throw new NotImplementedException(); } } }
Fix and re-enable the canvas mock.
Fix and re-enable the canvas mock. This got busted when we updated SharpDX to 2.6.3.
C#
mit
aparajit-pratap/helix-toolkit,DynamoDS/helix-toolkit,smischke/helix-toolkit,helix-toolkit/helix-toolkit,Iluvatar82/helix-toolkit,jotschgl/helix-toolkit,0x53A/helix-toolkit,holance/helix-toolkit,huoxudong125/helix-toolkit,JeremyAnsel/helix-toolkit,CobraCalle/helix-toolkit,chrkon/helix-toolkit
4ceb9bff5273597fea5723426a03c09ba909fbf5
source/Playnite/CefTools.cs
source/Playnite/CefTools.cs
using CefSharp; using CefSharp.Wpf; using Playnite.Common; using Playnite.Settings; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Playnite { public class CefTools { public static bool IsInitialized { get; private set; } public static void ConfigureCef() { FileSystem.CreateDirectory(PlaynitePaths.BrowserCachePath); var settings = new CefSettings(); settings.WindowlessRenderingEnabled = true; if (!settings.CefCommandLineArgs.ContainsKey("disable-gpu")) { settings.CefCommandLineArgs.Add("disable-gpu", "1"); } if (!settings.CefCommandLineArgs.ContainsKey("disable-gpu-compositing")) { settings.CefCommandLineArgs.Add("disable-gpu-compositing", "1"); } settings.CachePath = PlaynitePaths.BrowserCachePath; settings.PersistSessionCookies = true; settings.LogFile = Path.Combine(PlaynitePaths.ConfigRootPath, "cef.log"); IsInitialized = Cef.Initialize(settings); } public static void Shutdown() { Cef.Shutdown(); IsInitialized = false; } } }
using CefSharp; using CefSharp.Wpf; using Playnite.Common; using Playnite.Settings; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Playnite { public class CefTools { public static bool IsInitialized { get; private set; } public static void ConfigureCef() { FileSystem.CreateDirectory(PlaynitePaths.BrowserCachePath); var settings = new CefSettings(); settings.WindowlessRenderingEnabled = true; if (settings.CefCommandLineArgs.ContainsKey("disable-gpu")) { settings.CefCommandLineArgs.Remove("disable-gpu"); } if (settings.CefCommandLineArgs.ContainsKey("disable-gpu-compositing")) { settings.CefCommandLineArgs.Remove("disable-gpu-compositing"); } settings.CefCommandLineArgs.Add("disable-gpu", "1"); settings.CefCommandLineArgs.Add("disable-gpu-compositing", "1"); settings.CachePath = PlaynitePaths.BrowserCachePath; settings.PersistSessionCookies = true; settings.LogFile = Path.Combine(PlaynitePaths.ConfigRootPath, "cef.log"); IsInitialized = Cef.Initialize(settings); } public static void Shutdown() { Cef.Shutdown(); IsInitialized = false; } } }
Make sure GPU accel. in web view is disabled even if default cefsharp settings change
Make sure GPU accel. in web view is disabled even if default cefsharp settings change
C#
mit
JosefNemec/Playnite,JosefNemec/Playnite,JosefNemec/Playnite
f6ccc4ba6881ef9bd34d6201abf23f0b9af64fe8
VersionInfo.cs
VersionInfo.cs
/* * ****************************************************************************** * Copyright 2014 Spectra Logic Corporation. 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://www.apache.org/licenses/LICENSE-2.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. * **************************************************************************** */ using System.Reflection; // 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.2.1.0")] [assembly: AssemblyFileVersion("1.2.1.0")]
/* * ****************************************************************************** * Copyright 2014 Spectra Logic Corporation. 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://www.apache.org/licenses/LICENSE-2.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. * **************************************************************************** */ using System.Reflection; // 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.2.2.0")] [assembly: AssemblyFileVersion("1.2.2.0")]
Update the version to 1.2.2
Update the version to 1.2.2
C#
apache-2.0
RachelTucker/ds3_net_sdk,rpmoore/ds3_net_sdk,rpmoore/ds3_net_sdk,SpectraLogic/ds3_net_sdk,shabtaisharon/ds3_net_sdk,SpectraLogic/ds3_net_sdk,RachelTucker/ds3_net_sdk,shabtaisharon/ds3_net_sdk,RachelTucker/ds3_net_sdk,shabtaisharon/ds3_net_sdk,SpectraLogic/ds3_net_sdk,rpmoore/ds3_net_sdk
524b151a2d2d9acd9e34199fd7f0a275b0cade89
code/SoftwareThresher/SoftwareThresher/Observations/Observation.cs
code/SoftwareThresher/SoftwareThresher/Observations/Observation.cs
using System.IO; using SoftwareThresher.Settings.Search; using SoftwareThresher.Utilities; namespace SoftwareThresher.Observations { public abstract class Observation { readonly Search search; protected Observation(Search search) { this.search = search; } public virtual bool Failed { get; set; } public abstract string Name { get; } public abstract string Location { get; } public abstract string SystemSpecificString { get; } // TODO - push more logic into this class? public virtual Date LastEdit => search.GetLastEditDate(this); public override string ToString() { return $"{Location}{Path.PathSeparator}{Name}"; } } }
using System.IO; using SoftwareThresher.Settings.Search; using SoftwareThresher.Utilities; namespace SoftwareThresher.Observations { public abstract class Observation { readonly Search search; protected Observation(Search search) { this.search = search; } public virtual bool Failed { get; set; } public abstract string Name { get; } public abstract string Location { get; } public abstract string SystemSpecificString { get; } public virtual Date LastEdit => search.GetLastEditDate(this); public override string ToString() { return $"{Location}{Path.PathSeparator}{Name}"; } } }
Remove comment - no action needed
Remove comment - no action needed
C#
mit
markaschell/SoftwareThresher
1a07273910438d87cc89aea4af337e8615ad6483
Gu.State.Benchmarks/Program.cs
Gu.State.Benchmarks/Program.cs
// ReSharper disable UnusedMember.Local namespace Gu.State.Benchmarks { using System; using System.Collections.Generic; using System.IO; using System.Linq; using BenchmarkDotNet.Reports; using BenchmarkDotNet.Running; public static class Program { public static void Main() { foreach (var summary in RunSingle<EqualByComplexType>()) { CopyResult(summary); } } private static IEnumerable<Summary> RunAll() => new BenchmarkSwitcher(typeof(Program).Assembly).RunAll(); private static IEnumerable<Summary> RunSingle<T>() => new[] { BenchmarkRunner.Run<T>() }; private static void CopyResult(Summary summary) { var sourceFileName = Directory.EnumerateFiles(summary.ResultsDirectoryPath, $"*{summary.Title}-report-github.md") .Single(); var destinationFileName = Path.ChangeExtension(FindCsFile(), ".md"); Console.WriteLine($"Copy: {sourceFileName} -> {destinationFileName}"); File.Copy(sourceFileName, destinationFileName, overwrite: true); string FindCsFile() { return Directory.EnumerateFiles( AppDomain.CurrentDomain.BaseDirectory.Split(new[] { "\\bin\\" }, StringSplitOptions.RemoveEmptyEntries).First(), $"{summary.Title.Split('.').Last()}.cs", SearchOption.AllDirectories) .Single(); } } } }
// ReSharper disable UnusedMember.Local namespace Gu.State.Benchmarks { using System; using System.Collections.Generic; using System.IO; using System.Linq; using BenchmarkDotNet.Reports; using BenchmarkDotNet.Running; public static class Program { public static void Main() { foreach (var summary in RunSingle<EqualByComplexType>()) { CopyResult(summary); } } private static IEnumerable<Summary> RunAll() => new BenchmarkSwitcher(typeof(Program).Assembly).RunAll(); private static IEnumerable<Summary> RunSingle<T>() => new[] { BenchmarkRunner.Run<T>() }; private static void CopyResult(Summary summary) { var trimmedTitle = summary.Title.Split('.').Last().Split('-').First(); Console.WriteLine(trimmedTitle); var sourceFileName = FindMdFile(); var destinationFileName = Path.ChangeExtension(FindCsFile(), ".md"); Console.WriteLine($"Copy: {sourceFileName} -> {destinationFileName}"); File.Copy(sourceFileName, destinationFileName, overwrite: true); string FindMdFile() { return Directory.EnumerateFiles(summary.ResultsDirectoryPath, $"*{trimmedTitle}-report-github.md") .Single(); } string FindCsFile() { return Directory.EnumerateFiles( AppDomain.CurrentDomain.BaseDirectory.Split(new[] { "\\bin\\" }, StringSplitOptions.RemoveEmptyEntries).First(), $"{trimmedTitle}.cs", SearchOption.AllDirectories) .Single(); } } } }
Fix copying of markdown result.
Fix copying of markdown result. Would be nice if there were API for this.
C#
mit
JohanLarsson/Gu.State,JohanLarsson/Gu.ChangeTracking,JohanLarsson/Gu.State
f95d71470ddc80bbe273d85a239a727571f8d121
Blog.Data/Post.cs
Blog.Data/Post.cs
using System; namespace Blog.Data { public class Post { public int Id { get; set; } public string Url { get; set; } public string Title { get; set; } public string Description { get; set; } public string ComputedDescription { get { if (!string.IsNullOrEmpty(this.Description)) { return this.Description; } var description = this.Content.Split(new string[] { "<!-- more -->", "<!--more-->" }, StringSplitOptions.RemoveEmptyEntries); if (description.Length > 0) { return description[0]; } return string.Empty; } } public string Content { get; set; } public DateTime? PublicationDate { get; set; } public int CategoryId { get; set; } public virtual Category Category { get; set; } } }
using System; using System.Linq.Expressions; namespace Blog.Data { public class Post { public int Id { get; set; } public string Url { get; set; } public string Title { get; set; } public string Description { get; set; } public string ComputedDescription { get { if (!string.IsNullOrEmpty(this.Description)) { return this.Description; } var description = this.Content.Split(new string[] { "<!-- more -->", "<!--more-->" }, StringSplitOptions.RemoveEmptyEntries); if (description.Length > 0) { return description[0]; } return string.Empty; } } public string Content { get; set; } public DateTime? PublicationDate { get; set; } public int CategoryId { get; set; } public virtual Category Category { get; set; } public static Expression<Func<Post, bool>> IsPublished = post => post.PublicationDate.HasValue && DateTime.Now > post.PublicationDate; } }
Add expression indicating if a post is published
Add expression indicating if a post is published
C#
mit
sebastieno/sebastienollivier.fr,sebastieno/sebastienollivier.fr
686f0b9ceedceb8ca255ccc6e7ae7fbaf80f239b
RightpointLabs.ConferenceRoom.Services/Controllers/BaseController.cs
RightpointLabs.ConferenceRoom.Services/Controllers/BaseController.cs
using log4net; using RightpointLabs.ConferenceRoom.Services.Attributes; using System.Net.Http; using System.ServiceModel.Channels; using System.Web; using System.Web.Http; namespace RightpointLabs.ConferenceRoom.Services.Controllers { /// <summary> /// Operations dealing with client log messages /// </summary> [ErrorHandler] public abstract class BaseController : ApiController { protected BaseController(ILog log) { this.Log = log; } protected internal ILog Log { get; private set; } protected static string GetClientIp(HttpRequestMessage request = null) { // from https://trikks.wordpress.com/2013/06/27/getting-the-client-ip-via-asp-net-web-api/ if (request.Properties.ContainsKey("MS_HttpContext")) { return ((HttpContextWrapper)request.Properties["MS_HttpContext"]).Request.UserHostAddress; } else if (request.Properties.ContainsKey(RemoteEndpointMessageProperty.Name)) { RemoteEndpointMessageProperty prop = (RemoteEndpointMessageProperty)request.Properties[RemoteEndpointMessageProperty.Name]; return prop.Address; } else if (HttpContext.Current != null) { return HttpContext.Current.Request.UserHostAddress; } else { return null; } } } }
using log4net; using RightpointLabs.ConferenceRoom.Services.Attributes; using System.Net.Http; using System.ServiceModel.Channels; using System.Web; using System.Web.Http; namespace RightpointLabs.ConferenceRoom.Services.Controllers { /// <summary> /// Operations dealing with client log messages /// </summary> [ErrorHandler] public abstract class BaseController : ApiController { protected BaseController(ILog log) { this.Log = log; } protected internal ILog Log { get; private set; } protected string GetClientIp(HttpRequestMessage request = null) { request = request ?? Request; // from https://trikks.wordpress.com/2013/06/27/getting-the-client-ip-via-asp-net-web-api/ if (request.Properties.ContainsKey("MS_HttpContext")) { return ((HttpContextWrapper)request.Properties["MS_HttpContext"]).Request.UserHostAddress; } else if (request.Properties.ContainsKey(RemoteEndpointMessageProperty.Name)) { RemoteEndpointMessageProperty prop = (RemoteEndpointMessageProperty)request.Properties[RemoteEndpointMessageProperty.Name]; return prop.Address; } else if (HttpContext.Current != null) { return HttpContext.Current.Request.UserHostAddress; } else { return null; } } } }
Fix process of requesting access to a room
Fix process of requesting access to a room
C#
mit
RightpointLabs/conference-room,RightpointLabs/conference-room,jorupp/conference-room,jorupp/conference-room,RightpointLabs/conference-room,RightpointLabs/conference-room,jorupp/conference-room,jorupp/conference-room
e827d120113b92a9ad19fb62d921a9afc8057fdb
src/Telegram.Bot/Types/InlineQueryResults/InlineQueryResultGame.cs
src/Telegram.Bot/Types/InlineQueryResults/InlineQueryResultGame.cs
using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using System.ComponentModel; using Telegram.Bot.Types.InputMessageContents; namespace Telegram.Bot.Types.InlineQueryResults { /// <summary> /// Represents a <see cref="Game"/>. /// </summary> /// <seealso cref="InlineQueryResultNew" /> [JsonObject(MemberSerialization = MemberSerialization.OptIn, NamingStrategyType = typeof(SnakeCaseNamingStrategy))] public class InlineQueryResultGame : InlineQueryResult { /// <summary> /// Initializes a new inline query result /// </summary> public InlineQueryResultGame() { Type = InlineQueryResultType.Game; } /// <summary> /// Short name of the game. /// </summary> [JsonProperty(Required = Required.Always)] public string GameShortName { get; set; } #pragma warning disable 1591 [JsonIgnore] [EditorBrowsable(EditorBrowsableState.Never)] public new string Title { get; set; } [JsonIgnore] [EditorBrowsable(EditorBrowsableState.Never)] public new InputMessageContent InputMessageContent { get; set; } #pragma warning restore 1591 } }
using Newtonsoft.Json; using Newtonsoft.Json.Serialization; namespace Telegram.Bot.Types.InlineQueryResults { /// <summary> /// Represents a <see cref="Game"/>. /// </summary> /// <seealso cref="InlineQueryResult" /> [JsonObject(MemberSerialization = MemberSerialization.OptIn, NamingStrategyType = typeof(SnakeCaseNamingStrategy))] public class InlineQueryResultGame : InlineQueryResult { /// <summary> /// Initializes a new inline query result /// </summary> public InlineQueryResultGame() { Type = InlineQueryResultType.Game; } /// <summary> /// Short name of the game. /// </summary> [JsonProperty(Required = Required.Always)] public string GameShortName { get; set; } } }
Fix game inline query result
Fix game inline query result
C#
mit
MrRoundRobin/telegram.bot,TelegramBots/telegram.bot,AndyDingo/telegram.bot
9f6535de2c7e21e17348fb550478c146efdd7b3f
Samples/ProjectTracker/ProjectTracker.AppServerCore/Startup.cs
Samples/ProjectTracker/ProjectTracker.AppServerCore/Startup.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; namespace ProjectTracker.AppServerCore { public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseHsts(); } app.UseHttpsRedirection(); app.UseMvc(); Csla.Configuration.ConfigurationManager.AppSettings["DalManagerType"] = "ProjectTracker.DalMock.DalManager,ProjectTracker.DalMock"; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Csla.Configuration; namespace ProjectTracker.AppServerCore { public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); services.AddCsla(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseHsts(); } app.UseHttpsRedirection(); app.UseMvc(); app.UseCsla(); ConfigurationManager.AppSettings["DalManagerType"] = "ProjectTracker.DalMock.DalManager,ProjectTracker.DalMock"; } } }
Update to use CSLA configuration
Update to use CSLA configuration
C#
mit
rockfordlhotka/csla,JasonBock/csla,MarimerLLC/csla,JasonBock/csla,MarimerLLC/csla,rockfordlhotka/csla,MarimerLLC/csla,JasonBock/csla,rockfordlhotka/csla
6aa592f7c88177076d05888eb33d16d0874063d8
SemanticDataSolution/AddressSpaceComplianceTestTool/Program.cs
SemanticDataSolution/AddressSpaceComplianceTestTool/Program.cs
 using System; using System.IO; namespace UAOOI.SemanticData.AddressSpaceTestTool { class Program { internal static void Main(string[] args) { FileInfo _fileToRead = GetFileToRead(args); ValidateFile(_fileToRead); } internal static void ValidateFile(FileInfo _fileToRead) { throw new NotImplementedException(); } internal static FileInfo GetFileToRead(string[] args) { throw new NotImplementedException(); } } }
 using System; using System.IO; namespace UAOOI.SemanticData.AddressSpaceTestTool { class Program { internal static void Main(string[] args) { try { FileInfo _fileToRead = GetFileToRead(args); ValidateFile(_fileToRead); } catch (Exception ex) { Console.WriteLine(String.Format("Program stoped by the exception: {0}", ex.Message)); } Console.Write("Press ENter to close this window......."); Console.Read(); } internal static void ValidateFile(FileInfo _fileToRead) { throw new NotImplementedException(); } internal static FileInfo GetFileToRead(string[] args) { throw new NotImplementedException(); } } }
Implement AddressSpaceComplianceTestTool - added top level exception handling.
Implement AddressSpaceComplianceTestTool - added top level exception handling.
C#
mit
mpostol/OPC-UA-OOI
b8e24e93bb189eac7f4fc58d7e90512c4ad69720
DataAccessExamples.Core/Services/Employee/LazyOrmEmployeeService.cs
DataAccessExamples.Core/Services/Employee/LazyOrmEmployeeService.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using DataAccessExamples.Core.Actions; using DataAccessExamples.Core.ViewModels; namespace DataAccessExamples.Core.Services.Employee { public class LazyOrmEmployeeService : IEmployeeService { public void AddEmployee(AddEmployee action) { throw new NotImplementedException(); } public EmployeeList ListRecentHires() { throw new NotImplementedException(); } } }
using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Text; using System.Threading.Tasks; using AutoMapper; using DataAccessExamples.Core.Actions; using DataAccessExamples.Core.Data; using DataAccessExamples.Core.ViewModels; namespace DataAccessExamples.Core.Services.Employee { public class LazyOrmEmployeeService : IEmployeeService { private readonly EmployeesContext context; public LazyOrmEmployeeService(EmployeesContext context) { this.context = context; } public void AddEmployee(AddEmployee action) { var employee = Mapper.Map<Data.Employee>(action); employee.DepartmentEmployees.Add(new DepartmentEmployee { Employee = employee, DepartmentCode = action.DepartmentCode, FromDate = action.HireDate, ToDate = DateTime.MaxValue }); context.Employees.Add(employee); context.SaveChanges(); } public EmployeeList ListRecentHires() { return new EmployeeList { Employees = context.Employees .Where(e => e.HireDate > DateTime.Now.AddDays(-7)) .OrderByDescending(e => e.HireDate) }; } } }
Add (intentionally) broken Lazy ORM Employee service
Add (intentionally) broken Lazy ORM Employee service
C#
cc0-1.0
hgcummings/DataAccessExamples,hgcummings/DataAccessExamples
638ebba9c3052a5f34d1051531b84f585eb5fe4a
src/Msg.Acceptance.Tests/TestDoubles/GarbageSpewingClient.cs
src/Msg.Acceptance.Tests/TestDoubles/GarbageSpewingClient.cs
using System.Threading.Tasks; using Version = Msg.Domain.Version; using System; using System.Net.Sockets; using System.Net; namespace Msg.Acceptance.Tests { class GarbageSpewingClient { TcpClient client; public async Task<byte[]> ConnectAsync() { client = new TcpClient (); await client.ConnectAsync (IPAddress.Loopback, 1984); var stream = client.GetStream (); await stream.WriteAsync (new byte[] { 1, 9, 8, 4 }, 0, 4); var buffer = new byte[8]; await stream.ReadAsync (buffer, 0, 8); return buffer; } public bool IsConnected() { return client != null && client.Connected; } } }
using System.Threading.Tasks; using Version = Msg.Domain.Version; using System; using System.Net.Sockets; using System.Net; namespace Msg.Acceptance.Tests.TestDoubles { class GarbageSpewingClient { TcpClient client; public async Task<byte[]> ConnectAsync() { client = new TcpClient (); await client.ConnectAsync (IPAddress.Loopback, 1984); var stream = client.GetStream (); await stream.WriteAsync (new byte[] { 1, 9, 8, 4 }, 0, 4); var buffer = new byte[8]; await stream.ReadAsync (buffer, 0, 8); return buffer; } public bool IsConnected() { return client != null && client.Connected; } } }
Update garbage spewing client to use test doubles namespace.
Update garbage spewing client to use test doubles namespace.
C#
apache-2.0
jagrem/msg
545fa93e4829dc260f966095518c0a8ec80b8396
JabbR/Commands/FlagCommand.cs
JabbR/Commands/FlagCommand.cs
using System; using JabbR.Models; using JabbR.Services; namespace JabbR.Commands { [Command("flag", "Flag_CommandInfo", "Iso 3366-2 Code", "user")] public class FlagCommand : UserCommand { public override void Execute(CommandContext context, CallerContext callerContext, ChatUser callingUser, string[] args) { if (args.Length == 0) { // Clear the flag. callingUser.Flag = null; } else { // Set the flag. string isoCode = String.Join(" ", args[0]).ToLowerInvariant(); ChatService.ValidateIsoCode(isoCode); callingUser.Flag = isoCode; } context.NotificationService.ChangeFlag(callingUser); context.Repository.CommitChanges(); } } }
using System; using JabbR.Models; using JabbR.Services; namespace JabbR.Commands { [Command("flag", "Flag_CommandInfo", "Iso 3166-2 Code", "user")] public class FlagCommand : UserCommand { public override void Execute(CommandContext context, CallerContext callerContext, ChatUser callingUser, string[] args) { if (args.Length == 0) { // Clear the flag. callingUser.Flag = null; } else { // Set the flag. string isoCode = String.Join(" ", args[0]).ToLowerInvariant(); ChatService.ValidateIsoCode(isoCode); callingUser.Flag = isoCode; } context.NotificationService.ChangeFlag(callingUser); context.Repository.CommitChanges(); } } }
Update to use correct ISO code
Update to use correct ISO code
C#
mit
yadyn/JabbR,yadyn/JabbR,M-Zuber/JabbR,JabbR/JabbR,yadyn/JabbR,M-Zuber/JabbR,JabbR/JabbR
15b321ac07e017f9344ba964dc44c7302621f2d4
Source/Lib/TraktApiSharp/Objects/Get/Users/TraktUserImages.cs
Source/Lib/TraktApiSharp/Objects/Get/Users/TraktUserImages.cs
namespace TraktApiSharp.Objects.Get.Users { using Basic; using Newtonsoft.Json; public class TraktUserImages { [JsonProperty(PropertyName = "avatar")] public TraktImage Avatar { get; set; } } }
namespace TraktApiSharp.Objects.Get.Users { using Basic; using Newtonsoft.Json; /// <summary>A collection of images and image sets for a Trakt user.</summary> public class TraktUserImages { /// <summary>Gets or sets the avatar image.</summary> [JsonProperty(PropertyName = "avatar")] public TraktImage Avatar { get; set; } } }
Add get best id method for user images.
Add get best id method for user images.
C#
mit
henrikfroehling/TraktApiSharp
c5dfca606d316027cd1a6d267d4d872c68f62b42
WalletWasabi.Gui/Controls/WalletExplorer/CoinListView.xaml.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinListView.xaml.cs
using Avalonia; using Avalonia.Controls; using Avalonia.Data; using Avalonia.Markup.Xaml; using ReactiveUI; using System; namespace WalletWasabi.Gui.Controls.WalletExplorer { public class CoinListView : UserControl { public static readonly StyledProperty<bool> SelectAllNonPrivateVisibleProperty = AvaloniaProperty.Register<CoinListView, bool>(nameof(SelectAllNonPrivateVisible), defaultBindingMode: BindingMode.TwoWay); public bool SelectAllNonPrivateVisible { get => GetValue(SelectAllNonPrivateVisibleProperty); set => SetValue(SelectAllNonPrivateVisibleProperty, value); } public CoinListView() { InitializeComponent(); SelectAllNonPrivateVisible = true; this.WhenAnyValue(x => x.DataContext) .Subscribe(dataContext => { if (dataContext is CoinListViewModel viewmodel) { viewmodel.SelectAllNonPrivateVisible = SelectAllNonPrivateVisible; } }); } private void InitializeComponent() { AvaloniaXamlLoader.Load(this); } } }
using Avalonia; using Avalonia.Controls; using Avalonia.Data; using Avalonia.Markup.Xaml; using ReactiveUI; using System; using System.Reactive.Linq; namespace WalletWasabi.Gui.Controls.WalletExplorer { public class CoinListView : UserControl { public static readonly StyledProperty<bool> SelectAllNonPrivateVisibleProperty = AvaloniaProperty.Register<CoinListView, bool>(nameof(SelectAllNonPrivateVisible), defaultBindingMode: BindingMode.OneWayToSource); public bool SelectAllNonPrivateVisible { get => GetValue(SelectAllNonPrivateVisibleProperty); set => SetValue(SelectAllNonPrivateVisibleProperty, value); } public CoinListView() { InitializeComponent(); SelectAllNonPrivateVisible = true; this.WhenAnyValue(x => x.DataContext) .Subscribe(dataContext => { if (dataContext is CoinListViewModel viewmodel) { // Value is only propagated when DataContext is set at the beginning. viewmodel.SelectAllNonPrivateVisible = SelectAllNonPrivateVisible; } }); } private void InitializeComponent() { AvaloniaXamlLoader.Load(this); } } }
Add binding mode and comment.
Add binding mode and comment.
C#
mit
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
d8868dd2792b5b1760177ee04a8c24599b2bc354
Site/Views/ProductItem.cshtml
Site/Views/ProductItem.cshtml
@using Site.App_Code @inherits Umbraco.Web.Mvc.UmbracoTemplatePage @{ Layout = "SW_Master.cshtml"; } <div class="clearfix"> @Html.Partial("LeftNavigation",@Model.Content) <div class="" style="float: left;width: 75%;padding-left: 30px;"> <h3> @Model.Content.GetTitleOrName() </h3> <p> @Convert.ToDateTime(Model.Content.UpdateDate).ToString("D") </p> <p> @Html.Raw(Model.Content.GetPropertyValue<string>("bodyText")) </p> </div> @Html.Partial("ContentPanels",@Model.Content) </div>
@using Site.App_Code @inherits Umbraco.Web.Mvc.UmbracoTemplatePage @{ Layout = "SW_Master.cshtml"; } <div class="clearfix"> @Html.Partial("LeftNavigation",@Model.Content) <div class="" style="float: left;width: 75%;padding-left: 30px;"> @*<h3> @Model.Content.GetTitleOrName() </h3> <p> @Convert.ToDateTime(Model.Content.UpdateDate).ToString("D") </p>*@ <p> @Html.Raw(Model.Content.GetPropertyValue<string>("bodyText")) </p> </div> @Html.Partial("ContentPanels",@Model.Content) </div>
Remove title and date from product item page
Remove title and date from product item page
C#
mit
shengoo/umb,shengoo/umb
9d00b88cddb9c602ebdbb083867ebda2007b2a9f
BuildSpritesheet/Program.cs
BuildSpritesheet/Program.cs
#if DNX451 using System; using System.IO; namespace BuildSpritesheet { class Program { static void Main(string[] args) { PrepareOutputDirectory(); SpritePreparer.PrepareSprites(); Console.WriteLine(); Console.WriteLine("Done processing individual files"); Console.WriteLine(); SpritesheetBuilder.BuildSpritesheet(); Console.WriteLine(); Console.WriteLine("Done building spritesheet"); Console.ReadKey(); } private static void PrepareOutputDirectory() { Directory.CreateDirectory(Config.WwwRootSkillsPath); var outputDirectory = new DirectoryInfo(Config.WwwRootSkillsPath); outputDirectory.Empty(); } } } #endif
#if DNX451 using System; using System.IO; namespace BuildSpritesheet { class Program { static void Main(string[] args) { PrepareOutputDirectory(); SpritePreparer.PrepareSprites(); Console.WriteLine(); Console.WriteLine("Done processing individual files"); Console.WriteLine(); SpritesheetBuilder.BuildSpritesheet(); Console.WriteLine(); Console.WriteLine("Done building spritesheet. Press any key to exit."); Console.ReadKey(); } private static void PrepareOutputDirectory() { Directory.CreateDirectory(Config.WwwRootSkillsPath); var outputDirectory = new DirectoryInfo(Config.WwwRootSkillsPath); outputDirectory.Empty(); } } } #endif
Add "Press any key to exit."
Add "Press any key to exit."
C#
mit
OlsonDev/PersonalWebApp,OlsonDev/PersonalWebApp
1a05a6e5097a427e4c8283ee655f41b163112477
AlexPovar.ReSharperHelpers/Build/RunConfigProjectWithSolutionBuild.cs
AlexPovar.ReSharperHelpers/Build/RunConfigProjectWithSolutionBuild.cs
using JetBrains.IDE.RunConfig; namespace AlexPovar.ReSharperHelpers.Build { public class RunConfigProjectWithSolutionBuild : RunConfigBase { public override void Execute(RunConfigContext context) { context.ExecutionProvider.Execute(null); } } }
using System.Windows; using JetBrains.DataFlow; using JetBrains.IDE.RunConfig; using JetBrains.ProjectModel; using JetBrains.VsIntegration.IDE.RunConfig; namespace AlexPovar.ReSharperHelpers.Build { public class RunConfigProjectWithSolutionBuild : RunConfigBase { public override void Execute(RunConfigContext context) { context.ExecutionProvider.Execute(null); } public override IRunConfigEditorAutomation CreateEditor(Lifetime lifetime, IRunConfigCommonAutomation commonEditor, ISolution solution) { //Configure commot editor to hide build options. We support solution build only. commonEditor.IsWholeSolutionChecked.Value = true; commonEditor.WholeSolutionVisibility.Value = Visibility.Collapsed; commonEditor.IsSpecificProjectChecked.Value = false; var casted = commonEditor as RunConfigCommonAutomation; if (casted != null) { casted.ProjectRequiredVisibility.Value = Visibility.Collapsed; } return null; } } }
Hide irrelevant options from build action configuration
Hide irrelevant options from build action configuration
C#
mit
Zvirja/ReSharperHelpers
74c22be3c0cd4d9490453302778852240222f10e
AnimStack.cs
AnimStack.cs
using System; namespace FbxSharp { public class AnimStack : Collection { #region Public Attributes public readonly PropertyT<string> Description = new PropertyT<string>( "Description"); public readonly PropertyT<FbxTime> LocalStart = new PropertyT<FbxTime>("LocalStart"); public readonly PropertyT<FbxTime> LocalStop = new PropertyT<FbxTime>("LocalStop"); public readonly PropertyT<FbxTime> ReferenceStart = new PropertyT<FbxTime>("ReferenceStart"); public readonly PropertyT<FbxTime> ReferenceStop = new PropertyT<FbxTime>("ReferenceStop"); #endregion #region Utility functions. public FbxTimeSpan GetLocalTimeSpan() { return new FbxTimeSpan(LocalStart.Get(), LocalStop.Get()); } public void SetLocalTimeSpan(FbxTimeSpan pTimeSpan) { LocalStart.Set(pTimeSpan.GetStart()); LocalStop.Set(pTimeSpan.GetStop()); } public FbxTimeSpan GetReferenceTimeSpan() { throw new NotImplementedException(); } public void SetReferenceTimeSpan(FbxTimeSpan pTimeSpan) { throw new NotImplementedException(); } public bool BakeLayers(AnimEvaluator pEvaluator, FbxTime pStart, FbxTime pStop, FbxTime pPeriod) { throw new NotImplementedException(); } #endregion } }
using System; namespace FbxSharp { public class AnimStack : Collection { public AnimStack(String name="") : base(name) { Properties.Add(Description); Properties.Add(LocalStart); Properties.Add(LocalStop); Properties.Add(ReferenceStart); Properties.Add(ReferenceStop); } #region Public Attributes public readonly PropertyT<string> Description = new PropertyT<string>( "Description"); public readonly PropertyT<FbxTime> LocalStart = new PropertyT<FbxTime>("LocalStart"); public readonly PropertyT<FbxTime> LocalStop = new PropertyT<FbxTime>("LocalStop"); public readonly PropertyT<FbxTime> ReferenceStart = new PropertyT<FbxTime>("ReferenceStart"); public readonly PropertyT<FbxTime> ReferenceStop = new PropertyT<FbxTime>("ReferenceStop"); #endregion #region Utility functions. public FbxTimeSpan GetLocalTimeSpan() { return new FbxTimeSpan(LocalStart.Get(), LocalStop.Get()); } public void SetLocalTimeSpan(FbxTimeSpan pTimeSpan) { LocalStart.Set(pTimeSpan.GetStart()); LocalStop.Set(pTimeSpan.GetStop()); } public FbxTimeSpan GetReferenceTimeSpan() { throw new NotImplementedException(); } public void SetReferenceTimeSpan(FbxTimeSpan pTimeSpan) { throw new NotImplementedException(); } public bool BakeLayers(AnimEvaluator pEvaluator, FbxTime pStart, FbxTime pStop, FbxTime pPeriod) { throw new NotImplementedException(); } #endregion } }
Add the built-in properties to the Properties collection.
Add the built-in properties to the Properties collection.
C#
lgpl-2.1
izrik/FbxSharp,izrik/FbxSharp,izrik/FbxSharp,izrik/FbxSharp,izrik/FbxSharp
a2006283f0732608009629594609f99b72bcd0d5
src/IFS.Web/Views/Upload/Complete.cshtml
src/IFS.Web/Views/Upload/Complete.cshtml
@model IFS.Web.Core.Upload.UploadedFile @{ ViewBag.Title = $"Upload complete: {Model.Metadata.OriginalFileName}"; } <h2>@ViewBag.Title</h2> <div class="alert alert-success"> The upload of your file has completed: <code>@Model.Metadata.OriginalFileName</code>. </div> @{ string downloadLink = this.Url.RouteUrl("DownloadFile", new {id = Model.Id}, this.Context.Request.Scheme); } <p> Download link to share: <input type="text" value="@downloadLink" class="form-control" readonly="readonly"/> </p> <p> Test link: <a href="@downloadLink">@downloadLink</a> </p> <p> <a asp-action="Index" class="btn btn-primary">Upload another file</a> </p>
@using System.Text.Encodings.Web @model IFS.Web.Core.Upload.UploadedFile @{ ViewBag.Title = $"Upload complete: {Model.Metadata.OriginalFileName}"; } <h2>@ViewBag.Title</h2> <div class="alert alert-success"> The upload of your file has completed: <code>@Model.Metadata.OriginalFileName</code>. </div> @{ string downloadLink = this.Url.RouteUrl("DownloadFile", new {id = Model.Id}, this.Context.Request.Scheme); } <p> Download link to share: <input type="text" value="@downloadLink" class="form-control" readonly="readonly"/> </p> <p> Test link: <a href="@downloadLink">@downloadLink</a> </p> <p> <a asp-action="Index" class="btn btn-primary">Upload another file</a> </p> @section scripts { <script> (function() { // Replace URL for easy copying if ('replaceState' in history) { history.replaceState({}, null, '@JavaScriptEncoder.Default.Encode(downloadLink)'); } })(); </script> }
Replace URL in address bar for easy copying
Replace URL in address bar for easy copying
C#
mit
Sebazzz/IFS,Sebazzz/IFS,Sebazzz/IFS,Sebazzz/IFS
3bc663a1cf8cc232305c1adb3a8e46a6783f8492
SourceCodes/02_Apps/ReCaptcha.Wrapper.WebApp/Views/Home/Index.cshtml
SourceCodes/02_Apps/ReCaptcha.Wrapper.WebApp/Views/Home/Index.cshtml
@using Aliencube.ReCaptcha.Wrapper.Mvc @model Aliencube.ReCaptcha.Wrapper.WebApp.Models.HomeIndexViewModel @{ ViewBag.Title = "Index"; } <h2>@ViewBag.Title</h2> @using (Html.BeginForm(MVC.Home.ActionNames.Index, MVC.Home.Name, FormMethod.Post)) { <div class="form-group"> @Html.LabelFor(m => m.Name) @Html.TextBoxFor(m => m.Name, new Dictionary<string, object>() {{"class", "form-control"}}) </div> @Html.ReCaptcha(new Dictionary<string, object>() { { "class", "form-group" }, { "data-sitekey", Model.SiteKey } }) <input class="btn btn-default" type="submit" name="Submit" /> } @if (IsPost) { <div> <ul> <li>Success: @Model.Success</li> @if (@Model.ErrorCodes != null && @Model.ErrorCodes.Any()) { <li> ErrorCodes: <ul> @foreach (var errorCode in Model.ErrorCodes) { <li>@errorCode</li> } </ul> </li> } <li>ErorCodes: @Model.ErrorCodes</li> </ul> </div> } @section Scripts { @Html.ReCaptchaApiJs(new Dictionary<string, object>() { { "src", Model.ApiUrl } }) }
@using Aliencube.ReCaptcha.Wrapper.Mvc @model Aliencube.ReCaptcha.Wrapper.WebApp.Models.HomeIndexViewModel @{ ViewBag.Title = "Index"; } <h2>@ViewBag.Title</h2> @using (Html.BeginForm(MVC.Home.ActionNames.Index, MVC.Home.Name, FormMethod.Post)) { <div class="form-group"> @Html.LabelFor(m => m.Name) @Html.TextBoxFor(m => m.Name, new Dictionary<string, object>() {{"class", "form-control"}}) </div> @Html.ReCaptcha(new Dictionary<string, object>() { { "class", "form-group" }, { "data-sitekey", Model.SiteKey } }) <input class="btn btn-default" type="submit" name="Submit" /> } @if (IsPost) { <div> <ul> <li>Success: @Model.Success</li> @if (@Model.ErrorCodes != null && @Model.ErrorCodes.Any()) { <li> ErrorCodes: <ul> @foreach (var errorCode in Model.ErrorCodes) { <li>@errorCode</li> } </ul> </li> } <li>ErorCodes: @Model.ErrorCodes</li> </ul> </div> } @section Scripts { @Html.ReCaptchaApiJs(Model.ApiUrl, JsRenderingOptions.Async | JsRenderingOptions.Defer) }
Update reCaptcha API js rendering script
Update reCaptcha API js rendering script
C#
mit
aliencube/ReCaptcha.NET,aliencube/ReCaptcha.NET,aliencube/ReCaptcha.NET
b7f5cafc7172fd8833c326d5bec9fb1edcb72a85
src/Html2Markdown/Properties/AssemblyInfo.cs
src/Html2Markdown/Properties/AssemblyInfo.cs
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("Html2Markdown")] [assembly: AssemblyDescription("A library for converting HTML to markdown syntax in C#")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Simon Baynes")] [assembly: AssemblyProduct("Html2Markdown")] [assembly: AssemblyCopyright("Copyright © 2013")] [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("daf67b0f-5a0c-4789-ac19-799160a5e038")] // 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("2.1.2.*")]
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("Html2Markdown")] [assembly: AssemblyDescription("A library for converting HTML to markdown syntax in C#")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Simon Baynes")] [assembly: AssemblyProduct("Html2Markdown")] [assembly: AssemblyCopyright("Copyright © 2013")] [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("daf67b0f-5a0c-4789-ac19-799160a5e038")] // 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("2.1.3.*")]
Increase move the version number to 2.1.3
Increase move the version number to 2.1.3
C#
apache-2.0
baynezy/Html2Markdown
035fff94c1336b7244daafbd7d820c1c6a15c375
DynamixelServo.Quadruped/Vector3Extensions.cs
DynamixelServo.Quadruped/Vector3Extensions.cs
using System.Numerics; namespace DynamixelServo.Quadruped { public static class Vector3Extensions { public static Vector3 Normal(this Vector3 vector) { float len = vector.Length(); return new Vector3(vector.X / len, vector.Y / len, vector.Z / len); } public static bool Similar(this Vector3 a, Vector3 b, float marginOfError = float.Epsilon) { return Vector3.Distance(a, b) <= marginOfError; } } }
using System.Numerics; namespace DynamixelServo.Quadruped { public static class Vector3Extensions { public static Vector3 Normal(this Vector3 vector) { return Vector3.Normalize(vector); } public static bool Similar(this Vector3 a, Vector3 b, float marginOfError = float.Epsilon) { return Vector3.Distance(a, b) <= marginOfError; } } }
Update normalize extension method to use the built in hardware accelerated static method
Update normalize extension method to use the built in hardware accelerated static method
C#
apache-2.0
dmweis/DynamixelServo,dmweis/DynamixelServo,dmweis/DynamixelServo,dmweis/DynamixelServo
4a3ceaf19daa3f79452572d1a6f7d761063ebde2
src/EditorFeatures/CSharpTest/Organizing/AbstractOrganizerTests.cs
src/EditorFeatures/CSharpTest/Organizing/AbstractOrganizerTests.cs
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Organizing; using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces; using Microsoft.CodeAnalysis.Organizing; using Microsoft.CodeAnalysis.Text; using Xunit; namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Organizing { public abstract class AbstractOrganizerTests { protected void Check(string initial, string final) { CheckResult(initial, final); CheckResult(initial, final, Options.Script); } protected void Check(string initial, string final, bool specialCaseSystem) { CheckResult(initial, final, specialCaseSystem); CheckResult(initial, final, specialCaseSystem, Options.Script); } protected void CheckResult(string initial, string final, bool specialCaseSystem, CSharpParseOptions options = null) { using (var workspace = CSharpWorkspaceFactory.CreateWorkspaceFromFile(initial)) { var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id); var newRoot = OrganizingService.OrganizeAsync(document).Result.GetSyntaxRootAsync().Result; Assert.Equal(final, newRoot.ToFullString()); } } protected void CheckResult(string initial, string final, CSharpParseOptions options = null) { CheckResult(initial, final, false, options); } } }
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Organizing; using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces; using Microsoft.CodeAnalysis.Organizing; using Microsoft.CodeAnalysis.Text; using Roslyn.Test.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Organizing { public abstract class AbstractOrganizerTests { protected void Check(string initial, string final) { CheckResult(initial, final); CheckResult(initial, final, Options.Script); } protected void Check(string initial, string final, bool specialCaseSystem) { CheckResult(initial, final, specialCaseSystem); CheckResult(initial, final, specialCaseSystem, Options.Script); } protected void CheckResult(string initial, string final, bool specialCaseSystem, CSharpParseOptions options = null) { using (var workspace = CSharpWorkspaceFactory.CreateWorkspaceFromFile(initial)) { var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id); var newRoot = OrganizingService.OrganizeAsync(document).Result.GetSyntaxRootAsync().Result; Assert.Equal(final.NormalizeLineEndings(), newRoot.ToFullString()); } } protected void CheckResult(string initial, string final, CSharpParseOptions options = null) { CheckResult(initial, final, false, options); } } }
Test Fixup for a Line Normalization Issue.
Test Fixup for a Line Normalization Issue. This is a workaround for Issue #4109. It normalizes the line endings of the expected text so that the test will compare to the correct expected value even if the input line endings are '\n' isntead of '\r\n'.
C#
apache-2.0
aanshibudhiraja/Roslyn,ValentinRueda/roslyn,tannergooding/roslyn,grianggrai/roslyn,DustinCampbell/roslyn,vcsjones/roslyn,dovzhikova/roslyn,oocx/roslyn,jbhensley/roslyn,devharis/roslyn,AlekseyTs/roslyn,tang7526/roslyn,jcouv/roslyn,huoxudong125/roslyn,leppie/roslyn,paulvanbrenk/roslyn,jmarolf/roslyn,KevinH-MS/roslyn,aelij/roslyn,jeremymeng/roslyn,managed-commons/roslyn,balajikris/roslyn,moozzyk/roslyn,cston/roslyn,jhendrixMSFT/roslyn,CaptainHayashi/roslyn,Shiney/roslyn,CyrusNajmabadi/roslyn,MattWindsor91/roslyn,ahmedshuhel/roslyn,orthoxerox/roslyn,dpoeschl/roslyn,krishnarajbb/roslyn,VShangxiao/roslyn,basoundr/roslyn,xoofx/roslyn,akrisiun/roslyn,bbarry/roslyn,huoxudong125/roslyn,mgoertz-msft/roslyn,taylorjonl/roslyn,physhi/roslyn,abock/roslyn,MichalStrehovsky/roslyn,ErikSchierboom/roslyn,AlexisArce/roslyn,moozzyk/roslyn,nguerrera/roslyn,tvand7093/roslyn,Pvlerick/roslyn,ericfe-ms/roslyn,russpowers/roslyn,RipCurrent/roslyn,VitalyTVA/roslyn,krishnarajbb/roslyn,antiufo/roslyn,lorcanmooney/roslyn,AnthonyDGreen/roslyn,amcasey/roslyn,3F/roslyn,jaredpar/roslyn,mgoertz-msft/roslyn,KevinRansom/roslyn,MatthieuMEZIL/roslyn,YOTOV-LIMITED/roslyn,yeaicc/roslyn,tmeschter/roslyn,CaptainHayashi/roslyn,thomaslevesque/roslyn,nguerrera/roslyn,VSadov/roslyn,bartdesmet/roslyn,nagyistoce/roslyn,jeremymeng/roslyn,Giftednewt/roslyn,Maxwe11/roslyn,AlekseyTs/roslyn,YOTOV-LIMITED/roslyn,pjmagee/roslyn,CaptainHayashi/roslyn,magicbing/roslyn,swaroop-sridhar/roslyn,poizan42/roslyn,poizan42/roslyn,akrisiun/roslyn,vslsnap/roslyn,MattWindsor91/roslyn,balajikris/roslyn,Inverness/roslyn,nemec/roslyn,natgla/roslyn,dovzhikova/roslyn,danielcweber/roslyn,KevinRansom/roslyn,abock/roslyn,jasonmalinowski/roslyn,huoxudong125/roslyn,mseamari/Stuff,VShangxiao/roslyn,xoofx/roslyn,rgani/roslyn,bartdesmet/roslyn,pjmagee/roslyn,MichalStrehovsky/roslyn,kelltrick/roslyn,3F/roslyn,sharadagrawal/Roslyn,zmaruo/roslyn,lisong521/roslyn,natgla/roslyn,v-codeel/roslyn,Shiney/roslyn,robinsedlaczek/roslyn,taylorjonl/roslyn,Giftednewt/roslyn,stephentoub/roslyn,yjfxfjch/roslyn,vslsnap/roslyn,Hosch250/roslyn,zmaruo/roslyn,MattWindsor91/roslyn,vslsnap/roslyn,mattscheffer/roslyn,danielcweber/roslyn,OmarTawfik/roslyn,VShangxiao/roslyn,EricArndt/roslyn,antonssonj/roslyn,evilc0des/roslyn,khyperia/roslyn,wvdd007/roslyn,moozzyk/roslyn,MichalStrehovsky/roslyn,Inverness/roslyn,ilyes14/roslyn,taylorjonl/roslyn,eriawan/roslyn,hanu412/roslyn,YOTOV-LIMITED/roslyn,michalhosala/roslyn,yjfxfjch/roslyn,genlu/roslyn,srivatsn/roslyn,hanu412/roslyn,lorcanmooney/roslyn,stebet/roslyn,dpoeschl/roslyn,stebet/roslyn,ljw1004/roslyn,khellang/roslyn,magicbing/roslyn,mmitche/roslyn,lisong521/roslyn,AArnott/roslyn,ahmedshuhel/roslyn,ljw1004/roslyn,chenxizhang/roslyn,Hosch250/roslyn,jaredpar/roslyn,tmat/roslyn,tmat/roslyn,zooba/roslyn,jasonmalinowski/roslyn,ValentinRueda/roslyn,VPashkov/roslyn,supriyantomaftuh/roslyn,dotnet/roslyn,mattwar/roslyn,khyperia/roslyn,davkean/roslyn,robinsedlaczek/roslyn,jonatassaraiva/roslyn,ilyes14/roslyn,michalhosala/roslyn,FICTURE7/roslyn,jcouv/roslyn,mseamari/Stuff,kelltrick/roslyn,SeriaWei/roslyn,thomaslevesque/roslyn,amcasey/roslyn,abock/roslyn,tang7526/roslyn,AnthonyDGreen/roslyn,jroggeman/roslyn,jbhensley/roslyn,SeriaWei/roslyn,TyOverby/roslyn,jonatassaraiva/roslyn,AlexisArce/roslyn,EricArndt/roslyn,EricArndt/roslyn,shyamnamboodiripad/roslyn,doconnell565/roslyn,nemec/roslyn,drognanar/roslyn,VitalyTVA/roslyn,bbarry/roslyn,VPashkov/roslyn,mavasani/roslyn,KevinH-MS/roslyn,ErikSchierboom/roslyn,KiloBravoLima/roslyn,dpoeschl/roslyn,KirillOsenkov/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,tmeschter/roslyn,aelij/roslyn,jonatassaraiva/roslyn,khyperia/roslyn,natidea/roslyn,sharwell/roslyn,oberxon/roslyn,stephentoub/roslyn,AmadeusW/roslyn,DustinCampbell/roslyn,RipCurrent/roslyn,AnthonyDGreen/roslyn,v-codeel/roslyn,doconnell565/roslyn,rgani/roslyn,VitalyTVA/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,russpowers/roslyn,jaredpar/roslyn,budcribar/roslyn,shyamnamboodiripad/roslyn,HellBrick/roslyn,jkotas/roslyn,dovzhikova/roslyn,drognanar/roslyn,mavasani/roslyn,panopticoncentral/roslyn,vcsjones/roslyn,devharis/roslyn,bbarry/roslyn,jmarolf/roslyn,reaction1989/roslyn,brettfo/roslyn,orthoxerox/roslyn,panopticoncentral/roslyn,yjfxfjch/roslyn,natgla/roslyn,GuilhermeSa/roslyn,leppie/roslyn,v-codeel/roslyn,Hosch250/roslyn,physhi/roslyn,danielcweber/roslyn,paulvanbrenk/roslyn,TyOverby/roslyn,supriyantomaftuh/roslyn,FICTURE7/roslyn,akrisiun/roslyn,tang7526/roslyn,yeaicc/roslyn,antonssonj/roslyn,jamesqo/roslyn,sharadagrawal/Roslyn,heejaechang/roslyn,vcsjones/roslyn,ljw1004/roslyn,brettfo/roslyn,chenxizhang/roslyn,bkoelman/roslyn,KevinRansom/roslyn,russpowers/roslyn,supriyantomaftuh/roslyn,budcribar/roslyn,RipCurrent/roslyn,reaction1989/roslyn,paulvanbrenk/roslyn,agocke/roslyn,khellang/roslyn,aanshibudhiraja/Roslyn,pdelvo/roslyn,panopticoncentral/roslyn,leppie/roslyn,KirillOsenkov/roslyn,oberxon/roslyn,enginekit/roslyn,jasonmalinowski/roslyn,CyrusNajmabadi/roslyn,davkean/roslyn,dotnet/roslyn,agocke/roslyn,OmarTawfik/roslyn,zooba/roslyn,zooba/roslyn,cston/roslyn,diryboy/roslyn,natidea/roslyn,swaroop-sridhar/roslyn,rchande/roslyn,budcribar/roslyn,jkotas/roslyn,xasx/roslyn,natidea/roslyn,aanshibudhiraja/Roslyn,drognanar/roslyn,AArnott/roslyn,gafter/roslyn,GuilhermeSa/roslyn,pdelvo/roslyn,MihaMarkic/roslyn-prank,KirillOsenkov/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,tvand7093/roslyn,weltkante/roslyn,oocx/roslyn,jhendrixMSFT/roslyn,nemec/roslyn,SeriaWei/roslyn,khellang/roslyn,DustinCampbell/roslyn,VSadov/roslyn,KiloBravoLima/roslyn,amcasey/roslyn,ErikSchierboom/roslyn,dotnet/roslyn,MatthieuMEZIL/roslyn,enginekit/roslyn,MihaMarkic/roslyn-prank,CyrusNajmabadi/roslyn,reaction1989/roslyn,evilc0des/roslyn,ericfe-ms/roslyn,gafter/roslyn,mattscheffer/roslyn,tannergooding/roslyn,mmitche/roslyn,rgani/roslyn,Pvlerick/roslyn,bkoelman/roslyn,eriawan/roslyn,tannergooding/roslyn,jamesqo/roslyn,mattwar/roslyn,KamalRathnayake/roslyn,bartdesmet/roslyn,jbhensley/roslyn,antiufo/roslyn,ahmedshuhel/roslyn,weltkante/roslyn,oberxon/roslyn,Shiney/roslyn,mirhagk/roslyn,eriawan/roslyn,jeffanders/roslyn,KiloBravoLima/roslyn,basoundr/roslyn,hanu412/roslyn,AmadeusW/roslyn,bkoelman/roslyn,nagyistoce/roslyn,grianggrai/roslyn,HellBrick/roslyn,ValentinRueda/roslyn,kelltrick/roslyn,ilyes14/roslyn,robinsedlaczek/roslyn,jmarolf/roslyn,xoofx/roslyn,KamalRathnayake/roslyn,nagyistoce/roslyn,oocx/roslyn,diryboy/roslyn,evilc0des/roslyn,weltkante/roslyn,stephentoub/roslyn,enginekit/roslyn,KevinH-MS/roslyn,kienct89/roslyn,antonssonj/roslyn,jeremymeng/roslyn,AmadeusW/roslyn,tvand7093/roslyn,mattscheffer/roslyn,brettfo/roslyn,kienct89/roslyn,TyOverby/roslyn,Maxwe11/roslyn,MattWindsor91/roslyn,KamalRathnayake/roslyn,mattwar/roslyn,shyamnamboodiripad/roslyn,mavasani/roslyn,nguerrera/roslyn,mseamari/Stuff,pdelvo/roslyn,michalhosala/roslyn,basoundr/roslyn,heejaechang/roslyn,FICTURE7/roslyn,zmaruo/roslyn,grianggrai/roslyn,jhendrixMSFT/roslyn,tmat/roslyn,chenxizhang/roslyn,OmarTawfik/roslyn,magicbing/roslyn,wvdd007/roslyn,mmitche/roslyn,stebet/roslyn,AlekseyTs/roslyn,genlu/roslyn,HellBrick/roslyn,jeffanders/roslyn,mirhagk/roslyn,mirhagk/roslyn,kienct89/roslyn,Pvlerick/roslyn,sharadagrawal/Roslyn,jroggeman/roslyn,cston/roslyn,srivatsn/roslyn,wvdd007/roslyn,AlexisArce/roslyn,doconnell565/roslyn,managed-commons/roslyn,lorcanmooney/roslyn,a-ctor/roslyn,tmeschter/roslyn,yeaicc/roslyn,sharwell/roslyn,VSadov/roslyn,3F/roslyn,MatthieuMEZIL/roslyn,jeffanders/roslyn,GuilhermeSa/roslyn,jkotas/roslyn,AArnott/roslyn,physhi/roslyn,swaroop-sridhar/roslyn,mgoertz-msft/roslyn,thomaslevesque/roslyn,xasx/roslyn,diryboy/roslyn,antiufo/roslyn,balajikris/roslyn,davkean/roslyn,ericfe-ms/roslyn,pjmagee/roslyn,a-ctor/roslyn,orthoxerox/roslyn,krishnarajbb/roslyn,lisong521/roslyn,rchande/roslyn,jroggeman/roslyn,Giftednewt/roslyn,gafter/roslyn,Inverness/roslyn,a-ctor/roslyn,srivatsn/roslyn,sharwell/roslyn,genlu/roslyn,jcouv/roslyn,devharis/roslyn,agocke/roslyn,aelij/roslyn,poizan42/roslyn,MihaMarkic/roslyn-prank,jamesqo/roslyn,heejaechang/roslyn,Maxwe11/roslyn,rchande/roslyn,xasx/roslyn,managed-commons/roslyn,VPashkov/roslyn
bb6918cafc7f2645b7e8ea77cfc6f5cdbacc4478
src/Microsoft.DotNet.Build.Tasks/UpdatePackageDependencyVersion.cs
src/Microsoft.DotNet.Build.Tasks/UpdatePackageDependencyVersion.cs
using Microsoft.Build.Framework; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; namespace Microsoft.DotNet.Build.Tasks { public class UpdatePackageDependencyVersion : VisitProjectDependencies { [Required] public string PackageId { get; set; } [Required] public string OldVersion { get; set; } [Required] public string NewVersion { get; set; } public override bool VisitPackage(JProperty package, string projectJsonPath) { var dependencyIdentifier = package.Name; string dependencyVersion; if (package.Value is JObject) { dependencyVersion = package.Value["version"].Value<string>(); } else if (package.Value is JValue) { dependencyVersion = package.Value.ToObject<string>(); } else { throw new ArgumentException(string.Format( "Unrecognized dependency element for {0} in {1}", package.Name, projectJsonPath)); } if (dependencyIdentifier == PackageId && dependencyVersion == OldVersion) { Log.LogMessage( "Changing {0} {1} to {2} in {3}", dependencyIdentifier, dependencyVersion, NewVersion, projectJsonPath); if (package.Value is JObject) { package.Value["version"] = NewVersion; } else { package.Value = NewVersion; } return true; } return false; } } }
using Microsoft.Build.Framework; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; namespace Microsoft.DotNet.Build.Tasks { public class UpdatePackageDependencyVersion : VisitProjectDependencies { [Required] public string PackageId { get; set; } [Required] public string OldVersion { get; set; } [Required] public string NewVersion { get; set; } public override bool VisitPackage(JProperty package, string projectJsonPath) { var dependencyIdentifier = package.Name; string dependencyVersion; if (package.Value is JObject) { dependencyVersion = package.Value["version"]?.Value<string>(); } else if (package.Value is JValue) { dependencyVersion = package.Value.ToObject<string>(); } else { throw new ArgumentException(string.Format( "Unrecognized dependency element for {0} in {1}", package.Name, projectJsonPath)); } if (dependencyVersion == null) { return false; } if (dependencyIdentifier == PackageId && dependencyVersion == OldVersion) { Log.LogMessage( "Changing {0} {1} to {2} in {3}", dependencyIdentifier, dependencyVersion, NewVersion, projectJsonPath); if (package.Value is JObject) { package.Value["version"] = NewVersion; } else { package.Value = NewVersion; } return true; } return false; } } }
Remove requirement for dependency nodes to have a version.
Remove requirement for dependency nodes to have a version. In corefx this fixes references to 'test-runtime' and 'net46-test-runtime'.
C#
mit
dotnet/buildtools,roncain/buildtools,schaabs/buildtools,karajas/buildtools,chcosta/buildtools,AlexGhiondea/buildtools,AlexGhiondea/buildtools,ChadNedzlek/buildtools,roncain/buildtools,maririos/buildtools,naamunds/buildtools,mmitche/buildtools,stephentoub/buildtools,nguerrera/buildtools,stephentoub/buildtools,ChadNedzlek/buildtools,JeremyKuhne/buildtools,tarekgh/buildtools,weshaggard/buildtools,nguerrera/buildtools,jhendrixMSFT/buildtools,crummel/dotnet_buildtools,roncain/buildtools,ChadNedzlek/buildtools,jhendrixMSFT/buildtools,karajas/buildtools,weshaggard/buildtools,MattGal/buildtools,jthelin/dotnet-buildtools,ianhays/buildtools,ericstj/buildtools,ianhays/buildtools,joperezr/buildtools,tarekgh/buildtools,schaabs/buildtools,chcosta/buildtools,ianhays/buildtools,schaabs/buildtools,MattGal/buildtools,jthelin/dotnet-buildtools,alexperovich/buildtools,mmitche/buildtools,ericstj/buildtools,schaabs/buildtools,dotnet/buildtools,MattGal/buildtools,maririos/buildtools,JeremyKuhne/buildtools,crummel/dotnet_buildtools,chcosta/buildtools,JeremyKuhne/buildtools,karajas/buildtools,maririos/buildtools,weshaggard/buildtools,mmitche/buildtools,mmitche/buildtools,joperezr/buildtools,stephentoub/buildtools,MattGal/buildtools,stephentoub/buildtools,dotnet/buildtools,maririos/buildtools,naamunds/buildtools,AlexGhiondea/buildtools,ericstj/buildtools,karajas/buildtools,dotnet/buildtools,ianhays/buildtools,alexperovich/buildtools,ChadNedzlek/buildtools,alexperovich/buildtools,jhendrixMSFT/buildtools,joperezr/buildtools,jthelin/dotnet-buildtools,roncain/buildtools,naamunds/buildtools,MattGal/buildtools,joperezr/buildtools,tarekgh/buildtools,crummel/dotnet_buildtools,tarekgh/buildtools,nguerrera/buildtools,weshaggard/buildtools,nguerrera/buildtools,joperezr/buildtools,crummel/dotnet_buildtools,AlexGhiondea/buildtools,naamunds/buildtools,JeremyKuhne/buildtools,jthelin/dotnet-buildtools,alexperovich/buildtools,chcosta/buildtools,ericstj/buildtools,mmitche/buildtools,jhendrixMSFT/buildtools,tarekgh/buildtools,alexperovich/buildtools
7058bb60c1f734410c11a9c0667b981396d0037b
RedditSharp/CreatedThing.cs
RedditSharp/CreatedThing.cs
using System; using Newtonsoft.Json.Linq; using Newtonsoft.Json; namespace RedditSharp { public class CreatedThing : Thing { private Reddit Reddit { get; set; } public CreatedThing(Reddit reddit, JToken json) : base(json) { Reddit = reddit; JsonConvert.PopulateObject(json["data"].ToString(), this, reddit.JsonSerializerSettings); } [JsonProperty("created")] [JsonConverter(typeof(UnixTimestampConverter))] public DateTime Created { get; set; } } }
using System; using Newtonsoft.Json.Linq; using Newtonsoft.Json; namespace RedditSharp { public class CreatedThing : Thing { private Reddit Reddit { get; set; } public CreatedThing(Reddit reddit, JToken json) : base(json) { Reddit = reddit; JsonConvert.PopulateObject(json["data"].ToString(), this, reddit.JsonSerializerSettings); } [JsonProperty("created")] [JsonConverter(typeof(UnixTimestampConverter))] public DateTime Created { get; set; } [JsonProperty("created_utc")] [JsonConverter(typeof(UnixTimestampConverter))] public DateTime CreatedUTC { get; set; } } }
Add CreatedUTC to Created Thing
Add CreatedUTC to Created Thing For International purposes.
C#
mit
CrustyJew/RedditSharp,chuggafan/RedditSharp-1,Jinivus/RedditSharp,justcool393/RedditSharp-1,tomnolan95/RedditSharp,IAmAnubhavSaini/RedditSharp,ekaralar/RedditSharpWindowsStore,epvanhouten/RedditSharp,angelotodaro/RedditSharp,pimanac/RedditSharp,SirCmpwn/RedditSharp,RobThree/RedditSharp,nyanpasudo/RedditSharp,theonlylawislove/RedditSharp
6e27a6aa6cdd9a06e517a6bb8ff156f1d2afb501
Assets/Scripts/Building/AttackBuilding.cs
Assets/Scripts/Building/AttackBuilding.cs
using UnityEngine; using System.Collections; public class AttackBuilding : MonoBehaviour { BuildingProperties properties; SphereCollider collider; void Start () { properties = GetComponent<BuildingProperties> (); collider = gameObject.AddComponent<SphereCollider> (); collider.isTrigger = true; collider.radius = properties.radius; } void OnTriggerEnter (Collider col) { // TODO: target enemy } }
using UnityEngine; using System.Collections; public class AttackBuilding : MonoBehaviour { BuildingProperties properties; SphereCollider attackZone; void Start () { properties = GetComponent<BuildingProperties> (); attackZone = gameObject.AddComponent<SphereCollider> (); attackZone.isTrigger = true; attackZone.radius = properties.radius; } void OnTriggerEnter (Collider col) { // TODO: target enemy } }
Refactor collider name for attack behaviour
Refactor collider name for attack behaviour
C#
mit
bastuijnman/ludum-dare-36
70b3a27f4b9b27443a960e06c0d6d0cc84e12311
src/Pickles/Pickles.Test/ObjectModel/MapperTestsForDocString.cs
src/Pickles/Pickles.Test/ObjectModel/MapperTestsForDocString.cs
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="MapperTestsForDocString.cs" company="PicklesDoc"> // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors // // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // </copyright> // -------------------------------------------------------------------------------------------------------------------- using System; using NFluent; using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; namespace PicklesDoc.Pickles.Test.ObjectModel { [TestFixture] public class MapperTestsForDocString { [Test] public void MapToStringDocString_NullArgument_ReturnsNull() { var mapper = CreateMapper(); string docString = mapper.MapToString((Gherkin3.Ast.DocString) null); Check.That(docString).IsNull(); } private static Mapper CreateMapper() { return FactoryMethods.CreateMapper(); } } }
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="MapperTestsForDocString.cs" company="PicklesDoc"> // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors // // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // </copyright> // -------------------------------------------------------------------------------------------------------------------- using System; using NFluent; using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; using G = Gherkin3.Ast; namespace PicklesDoc.Pickles.Test.ObjectModel { [TestFixture] public class MapperTestsForDocString { [Test] public void MapToStringDocString_NullArgument_ReturnsNull() { var mapper = CreateMapper(); string docString = mapper.MapToString((G.DocString) null); Check.That(docString).IsNull(); } private static Mapper CreateMapper() { return FactoryMethods.CreateMapper(); } } }
Add namespace alias for Gherkin3.Ast
Add namespace alias for Gherkin3.Ast
C#
apache-2.0
dirkrombauts/pickles,picklesdoc/pickles,picklesdoc/pickles,dirkrombauts/pickles,dirkrombauts/pickles,picklesdoc/pickles,dirkrombauts/pickles,blorgbeard/pickles,picklesdoc/pickles,blorgbeard/pickles,blorgbeard/pickles,blorgbeard/pickles,magicmonty/pickles,magicmonty/pickles,ludwigjossieaux/pickles,magicmonty/pickles,ludwigjossieaux/pickles,magicmonty/pickles,ludwigjossieaux/pickles
051f200ffe41c49ded19745c6213e45086c0f41f
ShellHookLauncher32/ShellHookConstants.cs
ShellHookLauncher32/ShellHookConstants.cs
namespace ShellHookLauncher { internal static partial class ShellHookHelper { public const string DllFileName = "ShellHook64.dll"; public const string PanelessNamedPipe = "PanelessHookId64-5b4f1ea2-c775-11e2-8888-47c85008ead5"; } }
namespace ShellHookLauncher { internal static partial class ShellHookHelper { public const string DllFileName = "ShellHook32.dll"; public const string PanelessNamedPipe = "PanelessHookId32-5b4f1ea2-c775-11e2-8888-47c85008ead5"; } }
Fix up 32 bit constants.
Fix up 32 bit constants.
C#
mit
TomPeters/WindowMessageLogger,TomPeters/WindowMessageLogger
9fff4ae69c2473140930b9a6edcd315566cb40c8
Perplex.Umbraco.Forms/FieldTypes/PerplexImageUpload.cs
Perplex.Umbraco.Forms/FieldTypes/PerplexImageUpload.cs
using PerplexUmbraco.Forms.Code.Configuration; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Web; using static PerplexUmbraco.Forms.Code.Constants; using Umbraco.Forms.Core; namespace PerplexUmbraco.Forms.FieldTypes { public class PerplexImageUpload : PerplexBaseFileFieldType { protected override PerplexBaseFileConfig Config => PerplexUmbracoFormsConfig.Get.PerplexImageUpload; public PerplexImageUpload() { Id = new Guid("11fff56b-7e0e-4bfc-97ba-b5126158d33d"); Name = "Perplex image upload"; FieldTypeViewName = $"FieldType.{ nameof(PerplexImageUpload) }.cshtml"; Description = "Renders an upload field"; Icon = "icon-download-alt"; DataType = FieldDataType.String; SortOrder = 10; Category = "Simple"; } } }
using PerplexUmbraco.Forms.Code.Configuration; using System; using System.Collections.Generic; using Umbraco.Forms.Core; using Umbraco.Forms.Core.Attributes; namespace PerplexUmbraco.Forms.FieldTypes { public class PerplexImageUpload : PerplexBaseFileFieldType { protected override PerplexBaseFileConfig Config => PerplexUmbracoFormsConfig.Get.PerplexImageUpload; public PerplexImageUpload() { Id = new Guid("11fff56b-7e0e-4bfc-97ba-b5126158d33d"); Name = "Perplex image upload"; FieldTypeViewName = $"FieldType.{ nameof(PerplexImageUpload) }.cshtml"; Description = "Renders an upload field"; Icon = "icon-download-alt"; DataType = FieldDataType.String; SortOrder = 10; Category = "Simple"; } public override Dictionary<string, Setting> Settings() { Dictionary<string, Setting> settings = base.Settings() ?? new Dictionary<string, Setting>(); settings.Add("MultiUpload", new Setting("Multi upload") { description = "If checked, allows the user to upload multiple files", view = "checkbox" }); return settings; } } }
Fix for missing multiple image uploads checkbox on image upload field type.
Fix for missing multiple image uploads checkbox on image upload field type.
C#
mit
PerplexInternetmarketing/Perplex-Umbraco-Forms,PerplexInternetmarketing/Perplex-Umbraco-Forms,PerplexInternetmarketing/Perplex-Umbraco-Forms
a8bd9120c27a17546bc7603030fbd580436dbbc6
src/ProjectEuler/Puzzles/Puzzle010.cs
src/ProjectEuler/Puzzles/Puzzle010.cs
// Copyright (c) Martin Costello, 2015. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. namespace MartinCostello.ProjectEuler.Puzzles { using System; using System.Linq; /// <summary> /// A class representing the solution to <c>https://projecteuler.net/problem=10</c>. This class cannot be inherited. /// </summary> internal sealed class Puzzle010 : Puzzle { /// <inheritdoc /> public override string Question => "Find the sum of all the primes below the specified value."; /// <inheritdoc /> protected override int MinimumArguments => 1; /// <inheritdoc /> protected override int SolveCore(string[] args) { int max; if (!TryParseInt32(args[0], out max) || max < 2) { Console.Error.WriteLine("The specified number is invalid."); return -1; } long sum = ParallelEnumerable.Range(3, max - 3) .Where((p) => p % 2 != 0) .Where((p) => Maths.IsPrime(p)) .Select((p) => (long)p) .Sum(); Answer = sum + 2; return 0; } } }
// Copyright (c) Martin Costello, 2015. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. namespace MartinCostello.ProjectEuler.Puzzles { using System; using System.Linq; /// <summary> /// A class representing the solution to <c>https://projecteuler.net/problem=10</c>. This class cannot be inherited. /// </summary> internal sealed class Puzzle010 : Puzzle { /// <inheritdoc /> public override string Question => "Find the sum of all the primes below the specified value."; /// <inheritdoc /> protected override int MinimumArguments => 1; /// <inheritdoc /> protected override int SolveCore(string[] args) { int max; if (!TryParseInt32(args[0], out max) || max < 2) { Console.Error.WriteLine("The specified number is invalid."); return -1; } long sum = ParallelEnumerable.Range(3, max - 3) .Where((p) => Maths.IsPrime(p)) .Select((p) => (long)p) .Sum(); Answer = sum + 2; return 0; } } }
Remove special case for odd numbers
Remove special case for odd numbers Remove Where() that filters out even numbers that was added to improve performance as Maths.IsPrime() now special cases even numbers.
C#
apache-2.0
martincostello/project-euler
c627cd0dee7d4f169a8f7bdd89994a5e389203c4
assets/CommonAssemblyInfo.cs
assets/CommonAssemblyInfo.cs
using System.Reflection; [assembly: AssemblyVersion("2.0.0.0")] [assembly: AssemblyFileVersion("2.1.0.0")] [assembly: AssemblyInformationalVersion("2.1.0")]
using System.Reflection; // These "special" version numbers are found and replaced at build time. [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.1.1.1")] [assembly: AssemblyInformationalVersion("1.0.0")]
Revert to fixed versioning scheme used by build
Revert to fixed versioning scheme used by build
C#
apache-2.0
serilog-trace-listener/SerilogTraceListener
5976e11abb46010314de6fb1eaee78dcb53c7b06
src/Jasper.Testing/Transports/Tcp/LightweightTcpTransportCompliance.cs
src/Jasper.Testing/Transports/Tcp/LightweightTcpTransportCompliance.cs
using Jasper.Util; using TestingSupport.Compliance; using Xunit; namespace Jasper.Testing.Transports.Tcp { public class Sender : JasperOptions { public Sender() { Endpoints.ListenForMessagesFrom($"tcp://localhost:2289/incoming".ToUri()); } } public class Receiver : JasperOptions { public Receiver() { Endpoints.ListenForMessagesFrom($"tcp://localhost:2288/incoming".ToUri()); } } [Collection("compliance")] public class LightweightTcpTransportCompliance : SendingCompliance { public LightweightTcpTransportCompliance() : base($"tcp://localhost:2288/incoming".ToUri()) { SenderIs<Sender>(); ReceiverIs<Receiver>(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.NetworkInformation; using System.Net.Sockets; using Jasper.Util; using TestingSupport.Compliance; using Xunit; namespace Jasper.Testing.Transports.Tcp { public class Sender : JasperOptions { public Sender(int portNumber) { Endpoints.ListenForMessagesFrom($"tcp://localhost:{portNumber}/incoming".ToUri()); } public Sender() : this(2389) { } } public class Receiver : JasperOptions { public Receiver(int portNumber) { Endpoints.ListenForMessagesFrom($"tcp://localhost:{portNumber}/incoming".ToUri()); } public Receiver() : this(2388) { } } public class PortFinder { private static readonly IPEndPoint DefaultLoopbackEndpoint = new IPEndPoint(IPAddress.Loopback, port: 0); public static int GetAvailablePort() { using var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); socket.Bind(DefaultLoopbackEndpoint); var port = ((IPEndPoint)socket.LocalEndPoint).Port; return port; } } [Collection("compliance")] public class LightweightTcpTransportCompliance : SendingCompliance { public LightweightTcpTransportCompliance() : base($"tcp://localhost:{PortFinder.GetAvailablePort()}/incoming".ToUri()) { SenderIs(new Sender(PortFinder.GetAvailablePort())); ReceiverIs(new Receiver(theOutboundAddress.Port)); } } }
Allow passing port number to test setup
Allow passing port number to test setup
C#
mit
JasperFx/jasper,JasperFx/jasper,JasperFx/jasper
291b871862adb735f2463b02ee678ddfaaf8f817
src/Testity.EngineComponents.Unity3D/Scripting/ITestityBehaviour.cs
src/Testity.EngineComponents.Unity3D/Scripting/ITestityBehaviour.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Testity.EngineComponents; namespace Testity.EngineComponents.Unity3D { public interface ITestityBehaviour<out TScriptComponentType> : ITestityBehaviour where TScriptComponentType : EngineScriptComponent { TScriptComponentType ScriptComponent { get; } } public interface ITestityBehaviour { void Initialize(); } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Testity.EngineComponents; namespace Testity.EngineComponents.Unity3D { public interface ITestityBehaviour<out TScriptComponentType> : ITestityBehaviour where TScriptComponentType : EngineScriptComponent { TScriptComponentType ScriptComponent { get; } } public interface ITestityBehaviour { void Initialize(); object GetUntypedScriptComponent { get; } } }
Add Untyped Getter for EngineScriptComponent
Add Untyped Getter for EngineScriptComponent
C#
mit
HelloKitty/Testity,HelloKitty/Testity
5c1e4bd22f46403a4ee8c23a7cc16d2978eafb59
src/SharpArchContrib.Data/NHibernate/TransactionManagerBase.cs
src/SharpArchContrib.Data/NHibernate/TransactionManagerBase.cs
using System; using System.Threading; using log4net; namespace SharpArchContrib.Data.NHibernate { [Serializable] public abstract class TransactionManagerBase : ITransactionManager { private static readonly ILog logger = LogManager.GetLogger(typeof(TransactionManagerBase)); private static int transactionDepth; #region ITransactionManager Members public int TransactionDepth { get { return transactionDepth; } } public virtual object PushTransaction(string factoryKey, object transactionState) { Interlocked.Increment(ref transactionDepth); Log(string.Format("Push Transaction to Depth {0}", transactionDepth)); return transactionState; } public abstract bool TransactionIsActive(string factoryKey); public virtual object PopTransaction(string factoryKey, object transactionState) { Interlocked.Decrement(ref transactionDepth); Log(string.Format("Pop Transaction to Depth {0}", transactionDepth)); return transactionState; } public abstract object RollbackTransaction(string factoryKey, object transactionState); public abstract object CommitTransaction(string factoryKey, object transactionState); public abstract string Name { get; } #endregion protected void Log(string message) { logger.Debug(string.Format("{0}: {1}", Name, message)); } } }
using System; using System.Threading; using log4net; namespace SharpArchContrib.Data.NHibernate { [Serializable] public abstract class TransactionManagerBase : ITransactionManager { private static readonly ILog logger = LogManager.GetLogger(typeof(TransactionManagerBase)); [ThreadStatic] private static int transactionDepth; #region ITransactionManager Members public int TransactionDepth { get { return transactionDepth; } } public virtual object PushTransaction(string factoryKey, object transactionState) { Interlocked.Increment(ref transactionDepth); Log(string.Format("Push Transaction to Depth {0}", transactionDepth)); return transactionState; } public abstract bool TransactionIsActive(string factoryKey); public virtual object PopTransaction(string factoryKey, object transactionState) { Interlocked.Decrement(ref transactionDepth); Log(string.Format("Pop Transaction to Depth {0}", transactionDepth)); return transactionState; } public abstract object RollbackTransaction(string factoryKey, object transactionState); public abstract object CommitTransaction(string factoryKey, object transactionState); public abstract string Name { get; } #endregion protected void Log(string message) { logger.Debug(string.Format("{0}: {1}", Name, message)); } } }
Fix thread safety issue in TransactionManager. The depth should be per-thread.
Fix thread safety issue in TransactionManager. The depth should be per-thread.
C#
bsd-3-clause
ysdiong/Sharp-Architecture-Contrib,barser/Sharp-Architecture-Contrib,sharparchitecture/Sharp-Architecture-Contrib
ae53b063d5d33bd98d296f87ec7e0e7f4e0c5eb9
CSharp/Core.SQLite/Command.cs
CSharp/Core.SQLite/Command.cs
using Microsoft.Data.Sqlite; using System.Collections.Generic; namespace Business.Core.SQLite { public class Command : ICommand { IReader Reader { get; set; } public SqliteConnection SQLiteConnection { get; set; } public SqliteCommand SQLiteCommand { get; set; } public SqliteDataReader SQLiteReader { get; set; } public List<Parameter> Parameters { get; set; } public Command() { SQLiteCommand = new SqliteCommand(); Parameters = new List<Parameter>(); } public string CommandText { get { return SQLiteCommand?.CommandText; } set { SQLiteCommand.CommandText = value; } } public IReader ExecuteReader() { SQLiteCommand.Connection = SQLiteConnection; foreach(var parameter in Parameters) { SQLiteCommand.Parameters.Add(new SqliteParameter(parameter.Name, parameter.Value)); } SQLiteReader = SQLiteCommand.ExecuteReader(); Reader = new Reader() { SQLiteReader = SQLiteReader }; return Reader; } public object ExecuteScalar() { throw new System.NotImplementedException(); } } }
using Microsoft.Data.Sqlite; using System.Collections.Generic; namespace Business.Core.SQLite { public class Command : ICommand { IReader Reader { get; set; } public SqliteConnection SQLiteConnection { get; set; } public SqliteCommand SQLiteCommand { get; set; } public SqliteDataReader SQLiteReader { get; set; } public List<Parameter> Parameters { get; set; } public Command() { SQLiteCommand = new SqliteCommand(); Parameters = new List<Parameter>(); } public string CommandText { get { return SQLiteCommand?.CommandText; } set { SQLiteCommand.CommandText = value; } } public IReader ExecuteReader() { MakeReady(); SQLiteReader = SQLiteCommand.ExecuteReader(); Reader = new Reader() { SQLiteReader = SQLiteReader }; return Reader; } public object ExecuteScalar() { MakeReady(); return SQLiteCommand.ExecuteScalar(); } private void MakeReady() { SQLiteCommand.Connection = SQLiteConnection; foreach (var parameter in Parameters) { SQLiteCommand.Parameters.Add(new SqliteParameter(parameter.Name, parameter.Value)); } } } }
Refactor and add ExecuteScalar to SQLite wrapper
Refactor and add ExecuteScalar to SQLite wrapper
C#
mit
jazd/Business,jazd/Business,jazd/Business
66deaf0b3fb935027730cf470cf6a331e69f2cee
test/WebSites/RazorPagesWebSite/HelloWorldWithPageModelHandler.cshtml
test/WebSites/RazorPagesWebSite/HelloWorldWithPageModelHandler.cshtml
@page @model RazorPagesWebSite.HelloWorldWithPageModelHandler Hello, @Model.Message! @using (Html.BeginForm()) { @Html.AntiForgeryToken() }
@page @model RazorPagesWebSite.HelloWorldWithPageModelHandler Hello, @Model.Message! @using (Html.BeginForm()) { @Html.AntiForgeryToken() }
Make test of @page/@model whitespace
Make test of @page/@model whitespace
C#
apache-2.0
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
87cafb476f33a7b1ea2acdad5bfaee2f528c9312
ExcelLaunchPad/Rawr.LaunchPad.Installer/RegistryEditor.cs
ExcelLaunchPad/Rawr.LaunchPad.Installer/RegistryEditor.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Win32; namespace Rawr.LaunchPad.Installer { public class RegistryEditor { readonly string targetPath; readonly List<string> keyNames = new List<string> { "Excel.CSV", "Excel.Sheet.8", "Excel.Macrosheet", "Excel.SheetBinaryMacroEnabled.12", "Excel.Addin", "Excel.AddInMacroEnabled", "Excel.SheetMacroEnabled.12", "Excel.Sheet.12", "Excel.Template.8", }; public RegistryEditor(string targetPath) { this.targetPath = targetPath; } public void AddEntries() { foreach (var name in keyNames) { using (var registryKey = Registry.ClassesRoot.OpenSubKey(name, true)) { var shell = registryKey.CreateSubKey("shell"); var newWindow = shell.CreateSubKey("Open in new window"); var command = newWindow.CreateSubKey("command"); command.SetValue(null, $"{targetPath} -f \"%1\""); } } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Win32; namespace Rawr.LaunchPad.Installer { public class RegistryEditor { readonly List<string> keyNames = new List<string> { "Excel.CSV", "Excel.Sheet.8", "Excel.Macrosheet", "Excel.SheetBinaryMacroEnabled.12", "Excel.Addin", "Excel.AddInMacroEnabled", "Excel.SheetMacroEnabled.12", "Excel.Sheet.12", "Excel.Template.8", }; public void AddEntries(string targetPath) { foreach (var name in keyNames.Take(1)) { using (var registryKey = Registry.ClassesRoot.OpenSubKey(name, true)) using (var shell = registryKey?.CreateSubKey("shell")) using (var newWindow = shell?.CreateSubKey("Open in new window")) using (var command = newWindow?.CreateSubKey("command")) { if (command == null) throw new InvalidOperationException($"Unable to set key for '{name}'. Command subkey returned as null. This is likely a permissions issue."); command.SetValue(null, $"{targetPath} -f \"%1\""); } } } public void RemoveEntries() { foreach (var name in keyNames.Take(1)) { using (var registryKey = Registry.ClassesRoot.OpenSubKey(name, true)) using (var shell = registryKey?.OpenSubKey("shell", true)) { if (shell == null) continue; try { // Assumption: the key simply doesn't exist shell.DeleteSubKey("Open in new window"); } catch (Exception e) { Console.WriteLine(e); } } } } } }
Remove registry entries on uninstall + refactor
Remove registry entries on uninstall + refactor
C#
mit
refactorsaurusrex/ExcelLaunchPad
8334a0f25bacfaceda39d50177d11a5452dcd195
src/CompetitionPlatform/Views/Shared/AuthenticationFailed.cshtml
src/CompetitionPlatform/Views/Shared/AuthenticationFailed.cshtml
@{ ViewData["Title"] = "Access Denied"; } <div class="container"> <h1 class="text-danger">Error.</h1> <h2 class="text-danger">Authentication Failed.</h2> <p> You have denied Competition Platform access to your resources. </p> </div>
@{ ViewData["Title"] = "Access Denied"; } <div class="container"> <h1 class="text-danger">Error.</h1> <h2 class="text-danger">Authentication Failed.</h2> <p> There was a remote failure during Authentication. </p> </div>
Change authentication failed error message.
Change authentication failed error message.
C#
mit
LykkeCity/CompetitionPlatform,LykkeCity/CompetitionPlatform,LykkeCity/CompetitionPlatform
18cd832be40a7b8e89e7c037e87958eb419dbe83
UnityProject/Assets/Plugins/Zenject/OptionalExtras/Async/Runtime/Binders/AsyncFromBinderGeneric.cs
UnityProject/Assets/Plugins/Zenject/OptionalExtras/Async/Runtime/Binders/AsyncFromBinderGeneric.cs
using System; using System.Threading.Tasks; #if EXTENJECT_INCLUDE_ADDRESSABLE_BINDINGS using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.AddressableAssets; #endif namespace Zenject { [NoReflectionBaking] public class AsyncFromBinderGeneric<TContract, TConcrete> : AsyncFromBinderBase where TConcrete : TContract { public AsyncFromBinderGeneric( DiContainer container, BindInfo bindInfo, BindStatement bindStatement) : base(container, typeof(TContract), bindInfo) { BindStatement = bindStatement; } protected BindStatement BindStatement { get; private set; } protected IBindingFinalizer SubFinalizer { set { BindStatement.SetFinalizer(value); } } public AsyncFromBinderBase FromMethod(Func<Task<TConcrete>> method) { BindInfo.RequireExplicitScope = false; // Don't know how it's created so can't assume here that it violates AsSingle BindInfo.MarkAsCreationBinding = false; SubFinalizer = new ScopableBindingFinalizer( BindInfo, (container, originalType) => new AsyncMethodProviderSimple<TContract, TConcrete>(method)); return this; } } }
using System; using System.Threading; using System.Threading.Tasks; namespace Zenject { [NoReflectionBaking] public class AsyncFromBinderGeneric<TContract, TConcrete> : AsyncFromBinderBase where TConcrete : TContract { public AsyncFromBinderGeneric( DiContainer container, BindInfo bindInfo, BindStatement bindStatement) : base(container, typeof(TContract), bindInfo) { BindStatement = bindStatement; } protected BindStatement BindStatement { get; private set; } protected IBindingFinalizer SubFinalizer { set { BindStatement.SetFinalizer(value); } } public AsyncFromBinderBase FromMethod(Func<Task<TConcrete>> method) { BindInfo.RequireExplicitScope = false; // Don't know how it's created so can't assume here that it violates AsSingle BindInfo.MarkAsCreationBinding = false; SubFinalizer = new ScopableBindingFinalizer( BindInfo, (container, originalType) => new AsyncMethodProviderSimple<TContract, TConcrete>(method)); return this; } public AsyncFromBinderBase FromMethod(Func<CancellationToken, Task<TConcrete>> method) { BindInfo.RequireExplicitScope = false; // Don't know how it's created so can't assume here that it violates AsSingle BindInfo.MarkAsCreationBinding = false; SubFinalizer = new ScopableBindingFinalizer( BindInfo, (container, originalType) => new AsyncMethodProviderSimple<TContract, TConcrete>(method)); return this; } } }
Add cancel token variant for FromMethod
Add cancel token variant for FromMethod
C#
mit
modesttree/Zenject,modesttree/Zenject,modesttree/Zenject
0a7220718461141d1ba4558909254d9cc2e2260b
netfx-cs/db-pdftest/Program.cs
netfx-cs/db-pdftest/Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using dbticket; namespace db_pdftest { class Program { static void Main(string[] args) { if (args.Length < 2) { Console.WriteLine("Invalid argument count. You must pass the path to a file.\nPress a key to exit."); Console.ReadKey(); return; } TicketCheck tc_1 = new TicketCheck(args[1]); Console.Write("Result: "); Console.Write(String.Format("{0} of {1} points\n"), tc_1.Result, TicketCheck.MaximumScore); Console.WriteLine("Press a key to exit."); Console.ReadKey(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using dbticket; namespace db_pdftest { class Program { static void Main(string[] args) { if (args.Length < 1) { Console.WriteLine("Invalid argument count. You must pass the path to a file.\nPress a key to exit."); Console.ReadKey(); return; } TicketCheck tc_1 = new TicketCheck(args[0]); Console.Write("Result: "); Console.Write(String.Format("{0} of {1} points\n", tc_1.Result, TicketCheck.MaximumScore)); Console.WriteLine("Press a key to exit."); Console.ReadKey(); } } }
Fix for three bugs in three lines.
Fix for three bugs in three lines.
C#
mit
jhinder/db-ticket
957ec1807c5fb0b0282298e4f971325bd3661a8d
src/AspNet.Identity.MongoDB/MongoDBIdentitySettings.cs
src/AspNet.Identity.MongoDB/MongoDBIdentitySettings.cs
using System; using System.Configuration; namespace AspNet.Identity.MongoDB { public class MongoDBIdentitySettings : ConfigurationSection { private static MongoDBIdentitySettings settings = ConfigurationManager.GetSection("mongoDBIdentitySettings") as MongoDBIdentitySettings; private const String userCollectionName = "userCollectionName"; private const String roleCollectionName = "roleCollectionName"; public static MongoDBIdentitySettings Settings { get { return settings; } } //[ConfigurationProperty("frontPagePostCount", DefaultValue = 20, IsRequired = false)] //[IntegerValidator(MinValue = 1, MaxValue = 100)] //public int FrontPagePostCount { // get { return (int)this["frontPagePostCount"]; } // set { this["frontPagePostCount"] = value; } //} [ConfigurationProperty(userCollectionName, IsRequired = true)] [RegexStringValidator("^[a-zA-Z]+$")] public String UserCollectionName { get { return (String)this[userCollectionName]; } set { this[userCollectionName] = value; } } [ConfigurationProperty(roleCollectionName, IsRequired = true)] [RegexStringValidator("^[a-zA-Z]+$")] public String RoleCollectionName { get { return (String)this[roleCollectionName]; } set { this[roleCollectionName] = value; } } } }
using System; using System.Configuration; namespace AspNet.Identity.MongoDB { public class MongoDBIdentitySettings : ConfigurationSection { private static MongoDBIdentitySettings settings = ConfigurationManager.GetSection("mongoDBIdentitySettings") as MongoDBIdentitySettings; private const String userCollectionName = "userCollectionName"; private const String roleCollectionName = "roleCollectionName"; public static MongoDBIdentitySettings Settings { get { return settings; } } //[ConfigurationProperty("frontPagePostCount", DefaultValue = 20, IsRequired = false)] //[IntegerValidator(MinValue = 1, MaxValue = 100)] //public int FrontPagePostCount { // get { return (int)this["frontPagePostCount"]; } // set { this["frontPagePostCount"] = value; } //} [ConfigurationProperty(userCollectionName, IsRequired = true, DefaultValue = "user")] [RegexStringValidator("^[a-zA-Z]+$")] public String UserCollectionName { get { return (String)this[userCollectionName]; } set { this[userCollectionName] = value; } } [ConfigurationProperty(roleCollectionName, IsRequired = true, DefaultValue = "role")] [RegexStringValidator("^[a-zA-Z]+$")] public String RoleCollectionName { get { return (String)this[roleCollectionName]; } set { this[roleCollectionName] = value; } } } }
Fix issue "Unexpected RegexStringValidator failure in Configuration Property"
Fix issue "Unexpected RegexStringValidator failure in Configuration Property"
C#
mit
steentottrup/AspNet.Identity.MongoDB
456925d4dde40511c568a15857b174326433c35e
src/SDKs/CognitiveServices/dataPlane/Vision/ComputerVision/ComputerVision/Properties/AssemblyInfo.cs
src/SDKs/CognitiveServices/dataPlane/Vision/ComputerVision/ComputerVision/Properties/AssemblyInfo.cs
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using System.Reflection; using System.Resources; [assembly: AssemblyTitle("Microsoft Cognitive Services ComputerVision SDK")] [assembly: AssemblyDescription("Provides access to the Microsoft Cognitive Services ComputerVision APIs.")] [assembly: AssemblyVersion("3.1.0.0")] [assembly: AssemblyFileVersion("3.1.0.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Azure .NET SDK")] [assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")]
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using System.Reflection; using System.Resources; [assembly: AssemblyTitle("Microsoft Cognitive Services ComputerVision SDK")] [assembly: AssemblyDescription("Provides access to the Microsoft Cognitive Services ComputerVision APIs.")] [assembly: AssemblyVersion("3.0.0.0")] [assembly: AssemblyFileVersion("3.1.0.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Azure .NET SDK")] [assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")]
Address AssemblyVersion issue as suggested.
Address AssemblyVersion issue as suggested.
C#
mit
shahabhijeet/azure-sdk-for-net,hyonholee/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,stankovski/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,stankovski/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,jamestao/azure-sdk-for-net,jamestao/azure-sdk-for-net,pilor/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,pilor/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,hyonholee/azure-sdk-for-net,hyonholee/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,jamestao/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,hyonholee/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,jamestao/azure-sdk-for-net,markcowl/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,pilor/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,hyonholee/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net
fd38e0a25df5488a97ba556407470bc7ed9fe6cb
test/build.cake
test/build.cake
#addin "Cake.IIS" ////////////////////////////////////////////////////////////////////// // ARGUMENTS ////////////////////////////////////////////////////////////////////// var target = Argument("target", "Default"); var configuration = Argument("configuration", "Release"); /////////////////////////////////////////////////////////////////////////////// // SETUP / TEARDOWN /////////////////////////////////////////////////////////////////////////////// Setup(context => { //Executed BEFORE the first task. Information("Tools dir: {0}.", EnvironmentVariable("CAKE_PATHS_TOOLS")); }); /////////////////////////////////////////////////////////////////////////////// // TASK DEFINITIONS /////////////////////////////////////////////////////////////////////////////// Task("ApplicationPool-Create") .Description("Create a ApplicationPool") .Does(() => { CreatePool(new ApplicationPoolSettings() { Name = "Test", IdentityType = IdentityType.NetworkService }); }); Task("Website-Create") .Description("Create a Website") .IsDependentOn("ApplicationPool-Create") .Does(() => { CreateWebsite(new WebsiteSettings() { Name = "MyBlog", HostName = "blog.website.com", PhysicalDirectory = "C:/Websites/Blog", ApplicationPool = new ApplicationPoolSettings() { Name = "Test" } }); }); ////////////////////////////////////////////////////////////////////// // TASK TARGETS ////////////////////////////////////////////////////////////////////// Task("Default") .IsDependentOn("Website-Create"); /////////////////////////////////////////////////////////////////////////////// // EXECUTION /////////////////////////////////////////////////////////////////////////////// RunTarget(target);
#addin "Cake.IIS" ////////////////////////////////////////////////////////////////////// // ARGUMENTS ////////////////////////////////////////////////////////////////////// var target = Argument("target", "Default"); var configuration = Argument("configuration", "Release"); /////////////////////////////////////////////////////////////////////////////// // SETUP / TEARDOWN /////////////////////////////////////////////////////////////////////////////// Setup(context => { //Executed BEFORE the first task. Information("Tools dir: {0}.", EnvironmentVariable("CAKE_PATHS_TOOLS")); }); /////////////////////////////////////////////////////////////////////////////// // TASK DEFINITIONS /////////////////////////////////////////////////////////////////////////////// Task("ApplicationPool-Create") .Description("Create a ApplicationPool") .Does(() => { CreatePool(new ApplicationPoolSettings() { Name = "Test", IdentityType = IdentityType.NetworkService }); }); Task("Website-Create") .Description("Create a Website") .IsDependentOn("ApplicationPool-Create") .Does(() => { CreateWebsite(new WebsiteSettings() { Name = "MyBlog", PhysicalDirectory = "C:/Websites/Blog", ApplicationPool = new ApplicationPoolSettings() { Name = "Test" } }); }); ////////////////////////////////////////////////////////////////////// // TASK TARGETS ////////////////////////////////////////////////////////////////////// Task("Default") .IsDependentOn("Website-Create"); /////////////////////////////////////////////////////////////////////////////// // EXECUTION /////////////////////////////////////////////////////////////////////////////// RunTarget(target);
Fix issue related to task execution Website-Create.
Fix issue related to task execution Website-Create.
C#
mit
SharpeRAD/Cake.IIS
58c344c79a9d3415c8196c91f5a4b13ff9660b16
samples/Silverpop.Client.WebTester/Infrastructure/CustomBootstrapper.cs
samples/Silverpop.Client.WebTester/Infrastructure/CustomBootstrapper.cs
using Microsoft.Extensions.Configuration; using Nancy; using Nancy.TinyIoc; namespace Silverpop.Client.WebTester.Infrastructure { public class CustomBootstrapper : DefaultNancyBootstrapper { public CustomBootstrapper() { var builder = new ConfigurationBuilder() .SetBasePath(RootPathProvider.GetRootPath()) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile("appsettings.dev.json", optional: true, reloadOnChange: true) .AddEnvironmentVariables(); Configuration = builder.Build(); } public IConfigurationRoot Configuration { get; } protected override void ConfigureApplicationContainer(TinyIoCContainer container) { var transactClientConfiguration = new TransactClientConfiguration(); var configuration = Configuration.GetSection("silverpop"); configuration.Bind(transactClientConfiguration); container.Register(new TransactClient(transactClientConfiguration)); } } }
using Microsoft.Extensions.Configuration; using Nancy; using Nancy.Configuration; using Nancy.Diagnostics; using Nancy.TinyIoc; namespace Silverpop.Client.WebTester.Infrastructure { public class CustomBootstrapper : DefaultNancyBootstrapper { public CustomBootstrapper() { var builder = new ConfigurationBuilder() .SetBasePath(RootPathProvider.GetRootPath()) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile("appsettings.dev.json", optional: true, reloadOnChange: true) .AddEnvironmentVariables(); Configuration = builder.Build(); } public IConfigurationRoot Configuration { get; } public override void Configure(INancyEnvironment environment) { var dashboardPassword = Configuration.GetValue<string>("NancyDashboardPassword"); if (!string.IsNullOrWhiteSpace(dashboardPassword)) { environment.Diagnostics(true, dashboardPassword); } base.Configure(environment); } protected override void ConfigureApplicationContainer(TinyIoCContainer container) { var transactClientConfiguration = new TransactClientConfiguration(); var configuration = Configuration.GetSection("silverpop"); configuration.Bind(transactClientConfiguration); container.Register(new TransactClient(transactClientConfiguration)); } } }
Add NancyDashboardPassword setting used to enable dashboard
Add NancyDashboardPassword setting used to enable dashboard
C#
mit
ritterim/silverpop-dotnet-api
757b2fc5b11fc58c126dd0a3f8a4382db993e17d
src/Marvin.Cache.Headers/Extensions/ServicesExtensions.cs
src/Marvin.Cache.Headers/Extensions/ServicesExtensions.cs
// Any comments, input: @KevinDockx // Any issues, requests: https://github.com/KevinDockx/HttpCacheHeaders using Marvin.Cache.Headers; using Marvin.Cache.Headers.Interfaces; using Marvin.Cache.Headers.Stores; using Microsoft.Extensions.DependencyInjection; using System; namespace Microsoft.Extensions.DependencyInjection { /// <summary> /// Extension methods for the HttpCache middleware (on IServiceCollection) /// </summary> public static class ServicesExtensions { public static IServiceCollection AddHttpCacheHeaders(this IServiceCollection services) { if (services == null) { throw new ArgumentNullException(nameof(services)); } services.Add(ServiceDescriptor.Singleton<IValidationValueStore, InMemoryValidationValueStore>()); return services; } } }
// Any comments, input: @KevinDockx // Any issues, requests: https://github.com/KevinDockx/HttpCacheHeaders using Marvin.Cache.Headers; using Marvin.Cache.Headers.Interfaces; using Marvin.Cache.Headers.Stores; using Microsoft.Extensions.DependencyInjection; using System; namespace Microsoft.Extensions.DependencyInjection { /// <summary> /// Extension methods for the HttpCache middleware (on IServiceCollection) /// </summary> public static class ServicesExtensions { public static IServiceCollection AddHttpCacheHeaders(this IServiceCollection services) { if (services == null) { throw new ArgumentNullException(nameof(services)); } services.Add(ServiceDescriptor.Singleton<IValidationValueStore, InMemoryValidationValueStore>()); return services; } public static IServiceCollection AddHttpCacheHeaders(this IServiceCollection services, Action<ExpirationModelOptions> configureExpirationModelOptions) { if (services == null) { throw new ArgumentNullException(nameof(services)); } if (configureExpirationModelOptions == null) { throw new ArgumentNullException(nameof(configureExpirationModelOptions)); } services.Configure(configureExpirationModelOptions); services.AddHttpCacheHeaders(); return services; } public static IServiceCollection AddHttpCacheHeaders(this IServiceCollection services, Action<ValidationModelOptions> configureValidationModelOptions) { if (services == null) { throw new ArgumentNullException(nameof(services)); } if (configureValidationModelOptions == null) { throw new ArgumentNullException(nameof(configureValidationModelOptions)); } services.Configure(configureValidationModelOptions); services.AddHttpCacheHeaders(); return services; } public static IServiceCollection AddHttpCacheHeaders(this IServiceCollection services, Action<ExpirationModelOptions> configureExpirationModelOptions, Action<ValidationModelOptions> configureValidationModelOptions) { if (services == null) { throw new ArgumentNullException(nameof(services)); } if (configureExpirationModelOptions == null) { throw new ArgumentNullException(nameof(configureExpirationModelOptions)); } if (configureValidationModelOptions == null) { throw new ArgumentNullException(nameof(configureValidationModelOptions)); } services.Configure(configureExpirationModelOptions); services.Configure(configureValidationModelOptions); services.AddHttpCacheHeaders(); return services; } } }
Add overloads for configuring options when adding services
Add overloads for configuring options when adding services
C#
mit
KevinDockx/HttpCacheHeaders
cfaeb79a0c76c7c72e16c7cf635064fd489fac9c
src/Common/src/Interop/Windows/mincore/Interop.Console.cs
src/Common/src/Interop/Windows/mincore/Interop.Console.cs
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; internal static partial class Interop { private static class Libraries { internal const string Process = "api-ms-win-core-processenvironment-l1-1-0.dll"; internal const string Console = "api-ms-win-core-console-l1-1-0.dll"; } internal static unsafe partial class mincore { [DllImport("Libraries.Process")] internal static extern IntPtr GetStdHandle(int nStdHandle); [DllImport("Libraries.Console", EntryPoint = "WriteConsoleW")] internal static unsafe extern bool WriteConsole(IntPtr hConsoleOutput, byte* lpBuffer, int nNumberOfCharsToWrite, out int lpNumberOfCharsWritten, IntPtr lpReservedMustBeNull); } }
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; internal static partial class Interop { private static class Libraries { internal const string Process = "api-ms-win-core-processenvironment-l1-1-0.dll"; internal const string Console = "api-ms-win-core-console-l1-1-0.dll"; } internal static unsafe partial class mincore { [DllImport(Libraries.Process)] internal static extern IntPtr GetStdHandle(int nStdHandle); [DllImport(Libraries.Console, EntryPoint = "WriteConsoleW")] internal static unsafe extern bool WriteConsole(IntPtr hConsoleOutput, byte* lpBuffer, int nNumberOfCharsToWrite, out int lpNumberOfCharsWritten, IntPtr lpReservedMustBeNull); } }
Fix the name of DLL in DllImport.
Fix the name of DLL in DllImport.
C#
mit
kyulee1/corert,manu-silicon/corert,mjp41/corert,schellap/corert,gregkalapos/corert,sandreenko/corert,botaberg/corert,schellap/corert,gregkalapos/corert,krytarowski/corert,kyulee1/corert,manu-silicon/corert,manu-silicon/corert,gregkalapos/corert,schellap/corert,tijoytom/corert,botaberg/corert,mjp41/corert,yizhang82/corert,manu-silicon/corert,kyulee1/corert,mjp41/corert,mjp41/corert,tijoytom/corert,krytarowski/corert,yizhang82/corert,gregkalapos/corert,mjp41/corert,shrah/corert,sandreenko/corert,sandreenko/corert,shrah/corert,manu-silicon/corert,schellap/corert,schellap/corert,yizhang82/corert,kyulee1/corert,krytarowski/corert,shrah/corert,shrah/corert,tijoytom/corert,sandreenko/corert,yizhang82/corert,botaberg/corert,krytarowski/corert,tijoytom/corert,botaberg/corert
e83f08eb7824083532530b83bb22b82985460f2b
src/Arango/Arango.Client/API/Collections/ArangoCollectionOperation.cs
src/Arango/Arango.Client/API/Collections/ArangoCollectionOperation.cs
using Arango.Client.Protocol; namespace Arango.Client { public class ArangoCollectionOperation { private CollectionOperation _collectionOperation; internal ArangoCollectionOperation(CollectionOperation collectionOperation) { _collectionOperation = collectionOperation; } public ArangoCollection Get(string name) { return _collectionOperation.Get(name); } public void Create(ArangoCollection collection) { _collectionOperation.Post(collection); } public bool Delete(string name) { return _collectionOperation.Delete(name); } public bool Clear(string name) { return _collectionOperation.PutTruncate(name); } } }
using Arango.Client.Protocol; namespace Arango.Client { public class ArangoCollectionOperation { private CollectionOperation _collectionOperation; internal ArangoCollectionOperation(CollectionOperation collectionOperation) { _collectionOperation = collectionOperation; } /// <summary> /// Retrieves collection object from database identified by its name. /// </summary> public ArangoCollection Get(string name) { return _collectionOperation.Get(name); } /// <summary> /// Creates collection in database and assigns additional data to referenced object. /// </summary> public void Create(ArangoCollection collection) { _collectionOperation.Post(collection); } /// <summary> /// Deletes specified collection from database and returnes boolean value which indicates if the operation was successful. /// </summary> public bool Delete(string name) { return _collectionOperation.Delete(name); } /// <summary> /// Removes all documnets from specified collection and returns boolean values which indicates if the operation was successful. /// </summary> public bool Clear(string name) { return _collectionOperation.PutTruncate(name); } } }
Add xml docs to collection operations.
Add xml docs to collection operations.
C#
mit
kangkot/ArangoDB-NET,yojimbo87/ArangoDB-NET
7aeb68f950b809d84e3969010d2aba1157813c3e
Ets.Mobile/Ets.Mobile.UWP/Content/Grade/GradeSummary.xaml.cs
Ets.Mobile/Ets.Mobile.UWP/Content/Grade/GradeSummary.xaml.cs
using System.ComponentModel; using System.Runtime.CompilerServices; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Media; namespace Ets.Mobile.Content.Grade { public sealed partial class GradeSummary : UserControl, INotifyPropertyChanged { public GradeSummary() { InitializeComponent(); } public static readonly DependencyProperty TitleProperty = DependencyProperty.Register("Title", typeof(string), typeof(GradeSummary), null); public string Title { get { return GetValue(TitleProperty).ToString(); } set { SetValueDp(TitleProperty, value); } } #region Grade public static readonly DependencyProperty GradeProperty = DependencyProperty.Register("Grade", typeof(string), typeof(GradeSummary), null); public string Grade { get { return GetValue(GradeProperty).ToString(); } set { SetValueDp(GradeProperty, value); } } #endregion public static readonly DependencyProperty BackgroundBrushProperty = DependencyProperty.Register("BackgroundBrush", typeof(Brush), typeof(GradeSummary), null); public Brush BackgroundBrush { get { return (Brush)GetValue(BackgroundBrushProperty); } set { SetValueDp(BackgroundBrushProperty, value); } } #region PropertyChanged public event PropertyChangedEventHandler PropertyChanged; private void SetValueDp(DependencyProperty property, object value, [CallerMemberName] string propertyName = null) { SetValue(property, value); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } #endregion } }
using System.ComponentModel; using System.Runtime.CompilerServices; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Media; namespace Ets.Mobile.Content.Grade { public sealed partial class GradeSummary : UserControl, INotifyPropertyChanged { public GradeSummary() { InitializeComponent(); } public static readonly DependencyProperty TitleProperty = DependencyProperty.Register("Title", typeof(string), typeof(GradeSummary), null); public string Title { get { return GetValue(TitleProperty).ToString(); } set { SetValueDp(TitleProperty, value); } } public static readonly DependencyProperty GradeProperty = DependencyProperty.Register("Grade", typeof(string), typeof(GradeSummary), null); public string Grade { get { return GetValue(GradeProperty).ToString(); } set { SetValueDp(GradeProperty, value); } } public static readonly DependencyProperty BackgroundBrushProperty = DependencyProperty.Register("BackgroundBrush", typeof(Brush), typeof(GradeSummary), null); public Brush BackgroundBrush { get { return (Brush)GetValue(BackgroundBrushProperty); } set { SetValueDp(BackgroundBrushProperty, value); } } #region PropertyChanged public event PropertyChangedEventHandler PropertyChanged; private void SetValueDp(DependencyProperty property, object value, [CallerMemberName] string propertyName = null) { SetValue(property, value); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } #endregion } }
Remove Unecessary region in Grade Summary
Remove Unecessary region in Grade Summary
C#
apache-2.0
ApplETS/ETSMobile-WindowsPlatforms,ApplETS/ETSMobile-WindowsPlatforms
3f55a20689394edd18dcf45f4c466c1ce43279b7
SolidworksAddinFramework/OpenGl/Animation/LinearAnimation.cs
SolidworksAddinFramework/OpenGl/Animation/LinearAnimation.cs
using System; using System.Diagnostics; using System.Numerics; using ReactiveUI; namespace SolidworksAddinFramework.OpenGl.Animation { public class LinearAnimation<T> : ReactiveObject, IAnimationSection where T : IInterpolatable<T> { public T From { get; } public T To { get; } public TimeSpan Duration { get; } public LinearAnimation(TimeSpan duration, T @from, T to) { Duration = duration; From = @from; To = to; } public Matrix4x4 Transform( TimeSpan deltaTime) { var beta = deltaTime.TotalMilliseconds/Duration.TotalMilliseconds; return BlendTransform(beta); } public Matrix4x4 BlendTransform(double beta) { Debug.Assert(beta>=0 && beta<=1); return From.Interpolate(To, beta).Transform(); } } public static class LinearAnimation { public static LinearAnimation<T> Create<T>(TimeSpan duration, T from, T to) where T : IInterpolatable<T> { return new LinearAnimation<T>(duration, from, to); } } }
using System; using System.Diagnostics; using System.Numerics; using ReactiveUI; namespace SolidworksAddinFramework.OpenGl.Animation { public class LinearAnimation<T> : ReactiveObject, IAnimationSection where T : IInterpolatable<T> { public T From { get; } public T To { get; } public TimeSpan Duration { get; } public LinearAnimation(TimeSpan duration, T from, T to) { Duration = duration; From = from; To = to; } public Matrix4x4 Transform( TimeSpan deltaTime) { var beta = deltaTime.TotalMilliseconds/Duration.TotalMilliseconds; return BlendTransform(beta); } public Matrix4x4 BlendTransform(double beta) { Debug.Assert(beta>=0 && beta<=1); return From.Interpolate(To, beta).Transform(); } } public static class LinearAnimation { public static LinearAnimation<T> Create<T>(TimeSpan duration, T from, T to) where T : IInterpolatable<T> { return new LinearAnimation<T>(duration, from, to); } } }
Remove unnecessary '@' before arg name
Remove unnecessary '@' before arg name
C#
mit
Weingartner/SolidworksAddinFramework
581c2282b05c2068a5c73522eacbdcdd20396ca2
src/Smooth.IoC.Dapper.Repository.UnitOfWork/Data/DbTransaction.cs
src/Smooth.IoC.Dapper.Repository.UnitOfWork/Data/DbTransaction.cs
using System; using System.Data; namespace Smooth.IoC.Dapper.Repository.UnitOfWork.Data { public abstract class DbTransaction : IDbTransaction { private readonly IDbFactory _factory; protected bool Disposed; public IDbTransaction Transaction { get; set; } public IDbConnection Connection => Transaction.Connection; public IsolationLevel IsolationLevel => Transaction?.IsolationLevel ?? IsolationLevel.Unspecified; protected DbTransaction(IDbFactory factory) { _factory = factory; } public void Commit() { if (Connection?.State == ConnectionState.Open) { Transaction?.Commit(); } } public void Rollback() { if (Connection?.State == ConnectionState.Open) { Transaction?.Rollback(); } } ~DbTransaction() { Dispose(false); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } private void Dispose(bool disposing) { if (Disposed) return; Disposed = true; if (!disposing) return; if (Transaction?.Connection == null) return; try { Commit(); Transaction?.Dispose(); } catch { Rollback(); throw; } finally { Transaction = null; _factory.Release(this); } } } }
using System; using System.Data; namespace Smooth.IoC.Dapper.Repository.UnitOfWork.Data { public abstract class DbTransaction : IDbTransaction { private readonly IDbFactory _factory; protected bool Disposed; protected ISession Session; public IDbTransaction Transaction { get; set; } public IDbConnection Connection => Transaction.Connection; public IsolationLevel IsolationLevel => Transaction?.IsolationLevel ?? IsolationLevel.Unspecified; protected DbTransaction(IDbFactory factory) { _factory = factory; } public void Commit() { if (Connection?.State == ConnectionState.Open) { Transaction?.Commit(); } } public void Rollback() { if (Connection?.State == ConnectionState.Open) { Transaction?.Rollback(); } } ~DbTransaction() { Dispose(false); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } private void Dispose(bool disposing) { if (Disposed) return; Disposed = true; if (!disposing) return; DisposeTransaction(); DisposeSessionIfSessionIsNotNull(); } private void DisposeTransaction() { if (Transaction?.Connection == null) return; try { Commit(); Transaction?.Dispose(); } catch { Rollback(); throw; } finally { Transaction = null; _factory.Release(this); } } private void DisposeSessionIfSessionIsNotNull() { Session?.Dispose(); Session = null; } } }
Add dispose for session if the session is not null. This means that the session is created with the uow
Add dispose for session if the session is not null. This means that the session is created with the uow
C#
mit
generik0/Smooth.IoC.Dapper.Repository.UnitOfWork,generik0/Smooth.IoC.Dapper.Repository.UnitOfWork
d6b304d71aad4caeef1e6bd82f0f29bc52bdaa2e
Gu.Analyzers.Test/GU0009UseNamedParametersForBooleansTests/Diagnostics.cs
Gu.Analyzers.Test/GU0009UseNamedParametersForBooleansTests/Diagnostics.cs
namespace Gu.Analyzers.Test.GU0009UseNamedParametersForBooleansTests { using System.Threading.Tasks; using NUnit.Framework; internal class Diagnostics : DiagnosticVerifier<Analyzers.GU0009UseNamedParametersForBooleans> { [Test] public async Task UnnamedBooleanParameters() { var testCode = @" using System; using System.Collections.Generic; using System.Xml.Serialization; public class Foo { public void Floof(int howMuch, bool useFluffyBuns) { } public void Another() { Floof(42, ↓false); } }"; var expected = this.CSharpDiagnostic() .WithLocationIndicated(ref testCode) .WithMessage("The boolean parameter is not named."); await this.VerifyCSharpDiagnosticAsync(new[] { testCode }, expected) .ConfigureAwait(false); } } }
namespace Gu.Analyzers.Test.GU0009UseNamedParametersForBooleansTests { using System.Threading.Tasks; using NUnit.Framework; internal class Diagnostics : DiagnosticVerifier<Analyzers.GU0009UseNamedParametersForBooleans> { [Test] public async Task UnnamedBooleanParameters() { var testCode = @" using System; using System.Collections.Generic; using System.Xml.Serialization; public class Foo { public void Floof(int howMuch, bool useFluffyBuns) { } public void Another() { Floof(42, ↓false); } }"; var expected = this.CSharpDiagnostic() .WithLocationIndicated(ref testCode) .WithMessage("The boolean parameter is not named."); await this.VerifyCSharpDiagnosticAsync(new[] { testCode }, expected) .ConfigureAwait(false); } [Test] public async Task HandlesAnAlias() { var testCode = @" using System; using System.Collections.Generic; using System.Xml.Serialization; using Alias = System.Boolean; public class Foo { public void Floof(int howMuch, Alias useFluffyBuns) { } public void Another() { Floof(42, ↓false); } }"; var expected = this.CSharpDiagnostic() .WithLocationIndicated(ref testCode) .WithMessage("The boolean parameter is not named."); await this.VerifyCSharpDiagnosticAsync(new[] { testCode }, expected) .ConfigureAwait(false); } [Test] public async Task HandlesAFullyQualifiedName() { var testCode = @" using System; using System.Collections.Generic; using System.Xml.Serialization; public class Foo { public void Floof(int howMuch, System.Boolean useFluffyBuns) { } public void Another() { Floof(42, ↓false); } }"; var expected = this.CSharpDiagnostic() .WithLocationIndicated(ref testCode) .WithMessage("The boolean parameter is not named."); await this.VerifyCSharpDiagnosticAsync(new[] { testCode }, expected) .ConfigureAwait(false); } } }
Test for different named for bool
Test for different named for bool
C#
mit
JohanLarsson/Gu.Analyzers
c2d6262beca7359a79b90f6ec4df2d9022bff480
RobinhoodDesktop/RobinhoodDesktop/HomePage/HomePageForm.cs
RobinhoodDesktop/RobinhoodDesktop/HomePage/HomePageForm.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using BasicallyMe.RobinhoodNet; namespace RobinhoodDesktop.HomePage { public partial class HomePageForm : Form { public HomePageForm() { InitializeComponent(); //HomePage.AccountSummaryChart accountChart = new HomePage.AccountSummaryChart(); //accountChart.Size = new Size(this.Width - 20, this.Height - 20); //this.Controls.Add(accountChart); StockChart plot = new StockChart(); plot.SetChartData(GenerateExampleData()); this.Controls.Add(plot.Canvas); } private static System.Data.DataTable GenerateExampleData() { System.Data.DataTable dt = new System.Data.DataTable(); dt.Columns.Add("Time", typeof(DateTime)); dt.Columns.Add("Price", typeof(float)); ; try { var rh = new RobinhoodClient(); var history = rh.DownloadHistory("AMD", "5minute", "week").Result; foreach (var p in history.HistoricalInfo) { dt.Rows.Add(p.BeginsAt, (float)p.OpenPrice); } } catch { Environment.Exit(1); } return dt; } } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using BasicallyMe.RobinhoodNet; namespace RobinhoodDesktop.HomePage { public partial class HomePageForm : Form { public HomePageForm() { InitializeComponent(); //HomePage.AccountSummaryChart accountChart = new HomePage.AccountSummaryChart(); //accountChart.Size = new Size(this.Width - 20, this.Height - 20); //this.Controls.Add(accountChart); StockChart plot = new StockChart(); plot.SetChartData(GenerateExampleData()); this.Controls.Add(plot.Canvas); } private static System.Data.DataTable GenerateExampleData() { System.Data.DataTable dt = new System.Data.DataTable(); dt.Columns.Add("Time", typeof(DateTime)); dt.Columns.Add("Price", typeof(float)); try { var rh = new RobinhoodClient(); var history = rh.DownloadHistory("AMD", "5minute", "week").Result; foreach (var p in history.HistoricalInfo) { dt.Rows.Add(p.BeginsAt.ToLocalTime(), (float)p.OpenPrice); } } catch(Exception ex) { Environment.Exit(1); } return dt; } } }
Convert time received from Robinhood to local before charting it.
Convert time received from Robinhood to local before charting it.
C#
bsd-2-clause
Terohnon/RobinhoodDesktop
a89c29c5cd0304ffcfb5c3b264aae5c8da2357dd
src/CGO.Web/NinjectModules/RavenModule.cs
src/CGO.Web/NinjectModules/RavenModule.cs
using Ninject; using Ninject.Modules; using Ninject.Web.Common; using Raven.Client; using Raven.Client.Embedded; namespace CGO.Web.NinjectModules { public class RavenModule : NinjectModule { public override void Load() { Kernel.Bind<IDocumentStore>().ToMethod(_ => InitialiseDocumentStore()).InSingletonScope(); Kernel.Bind<IDocumentSession>().ToMethod(_ => Kernel.Get<IDocumentStore>().OpenSession()).InRequestScope(); } private static IDocumentStore InitialiseDocumentStore() { var documentStore = new EmbeddableDocumentStore { DataDirectory = "CGO.raven", UseEmbeddedHttpServer = true }; documentStore.InitializeProfiling(); documentStore.Initialize(); return documentStore; } } }
using Ninject; using Ninject.Modules; using Ninject.Web.Common; using Raven.Client; using Raven.Client.Embedded; namespace CGO.Web.NinjectModules { public class RavenModule : NinjectModule { public override void Load() { Kernel.Bind<IDocumentStore>().ToMethod(_ => InitialiseDocumentStore()).InSingletonScope(); Kernel.Bind<IDocumentSession>().ToMethod(_ => Kernel.Get<IDocumentStore>().OpenSession()).InRequestScope(); } private static IDocumentStore InitialiseDocumentStore() { var documentStore = new EmbeddableDocumentStore { DataDirectory = "CGO.raven", UseEmbeddedHttpServer = true, Configuration = { Port = 28645 } }; documentStore.InitializeProfiling(); documentStore.Initialize(); return documentStore; } } }
Fix RavenConfiguration for Embedded mode.
Fix RavenConfiguration for Embedded mode. Poorly-documented, but there we go: in embedded mode, Raven assumes the same port number as the web application, which caused no end of issues.
C#
mit
alastairs/cgowebsite,alastairs/cgowebsite
5e402220be25d892c40aad57d3009bbd4163c317
Framework/Source/Tralus.Framework.Migration/Migrations/Configuration.cs
Framework/Source/Tralus.Framework.Migration/Migrations/Configuration.cs
using System; using Tralus.Framework.BusinessModel.Entities; namespace Tralus.Framework.Migration.Migrations { using System.Data.Entity.Migrations; public sealed class Configuration : TralusDbMigrationConfiguration<Data.FrameworkDbContext> { public Configuration() { AutomaticMigrationsEnabled = false; } protected override void Seed(Tralus.Framework.Data.FrameworkDbContext context) { base.Seed(context); // This method will be called after migrating to the latest version. // You can use the DbSet<T>.AddOrUpdate() helper extension method // to avoid creating duplicate seed data. E.g. // // context.People.AddOrUpdate( // p => p.FullName, // new Person { FullName = "Andrew Peters" }, // new Person { FullName = "Brice Lambson" }, // new Person { FullName = "Rowan Miller" } // ); // //var administratorRole = new Role(true) //{ // Name = "Administrators", // IsAdministrative = true, // CanEditModel = true, //}; context.Set<Role>().AddOrUpdate(new Role(true) { Id = new Guid("F011D97A-CDA4-46F4-BE33-B48C4CAB9A3E"), Name = "Administrators", IsAdministrative = true, CanEditModel = true, }); } } }
using System; using Tralus.Framework.BusinessModel.Entities; namespace Tralus.Framework.Migration.Migrations { using System.Data.Entity.Migrations; public sealed class Configuration : TralusDbMigrationConfiguration<Data.FrameworkDbContext> { public Configuration() { AutomaticMigrationsEnabled = false; } protected override void Seed(Tralus.Framework.Data.FrameworkDbContext context) { base.Seed(context); // This method will be called after migrating to the latest version. // You can use the DbSet<T>.AddOrUpdate() helper extension method // to avoid creating duplicate seed data. E.g. // // context.People.AddOrUpdate( // p => p.FullName, // new Person { FullName = "Andrew Peters" }, // new Person { FullName = "Brice Lambson" }, // new Person { FullName = "Rowan Miller" } // ); // //var administratorRole = new Role(true) //{ // Name = "Administrators", // IsAdministrative = true, // CanEditModel = true, //}; context.Set<Role>().AddOrUpdate(new Role(true) { Id = new Guid("F011D97A-CDA4-46F4-BE33-B48C4CAB9A3E"), Name = "Administrators", IsAdministrative = false, CanEditModel = true, }); } } }
Correct Administrators Role (set IsAdministrator to false)
Correct Administrators Role (set IsAdministrator to false)
C#
apache-2.0
mehrandvd/Tralus,mehrandvd/Tralus
0fe1a91cac01c81d737f60fd7ac57d5eb1dc7774
src/EditorFeatures/Core/Implementation/Suggestions/SuggestionsOptions.cs
src/EditorFeatures/Core/Implementation/Suggestions/SuggestionsOptions.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using Microsoft.CodeAnalysis.Options; namespace Microsoft.CodeAnalysis.Editor.Implementation.Suggestions { internal static class SuggestionsOptions { private const string FeatureName = "SuggestionsOptions"; public static readonly Option2<bool> Asynchronous = new(FeatureName, nameof(Asynchronous), defaultValue: true, new RoamingProfileStorageLocation("TextEditor.Specific.Suggestions.Asynchronous2")); public static readonly Option2<bool> AsynchronousQuickActionsDisableFeatureFlag = new(FeatureName, nameof(AsynchronousQuickActionsDisableFeatureFlag), defaultValue: false, new FeatureFlagStorageLocation("Roslyn.AsynchronousQuickActionsDisable")); } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using Microsoft.CodeAnalysis.Options; namespace Microsoft.CodeAnalysis.Editor.Implementation.Suggestions { internal static class SuggestionsOptions { private const string FeatureName = "SuggestionsOptions"; public static readonly Option2<bool> Asynchronous = new(FeatureName, nameof(Asynchronous), defaultValue: true, new RoamingProfileStorageLocation("TextEditor.Specific.Suggestions.Asynchronous3")); public static readonly Option2<bool> AsynchronousQuickActionsDisableFeatureFlag = new(FeatureName, nameof(AsynchronousQuickActionsDisableFeatureFlag), defaultValue: false, new FeatureFlagStorageLocation("Roslyn.AsynchronousQuickActionsDisable")); } }
Add new option so anyone who set the option value in 17.0 doesn't forever disable async lightbulbs in 17.1 and onwards
Add new option so anyone who set the option value in 17.0 doesn't forever disable async lightbulbs in 17.1 and onwards
C#
mit
shyamnamboodiripad/roslyn,jasonmalinowski/roslyn,diryboy/roslyn,jasonmalinowski/roslyn,mavasani/roslyn,weltkante/roslyn,KevinRansom/roslyn,diryboy/roslyn,CyrusNajmabadi/roslyn,sharwell/roslyn,shyamnamboodiripad/roslyn,KevinRansom/roslyn,mavasani/roslyn,sharwell/roslyn,weltkante/roslyn,shyamnamboodiripad/roslyn,bartdesmet/roslyn,sharwell/roslyn,dotnet/roslyn,bartdesmet/roslyn,CyrusNajmabadi/roslyn,bartdesmet/roslyn,jasonmalinowski/roslyn,diryboy/roslyn,mavasani/roslyn,CyrusNajmabadi/roslyn,dotnet/roslyn,weltkante/roslyn,dotnet/roslyn,KevinRansom/roslyn
a4825133f40ca378b539cd06d7c1386a6f4adc07
spanner/api/Spanner.Samples.Tests/QueryDataWithArrayOfStructAsyncTest.cs
spanner/api/Spanner.Samples.Tests/QueryDataWithArrayOfStructAsyncTest.cs
// Copyright 2020 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Xunit; [Collection(nameof(SpannerFixture))] public class QueryDataWithArrayOfStructAsyncTest { private readonly SpannerFixture _spannerFixture; public QueryDataWithArrayOfStructAsyncTest(SpannerFixture spannerFixture) { _spannerFixture = spannerFixture; } [Fact] public async Task TestQueryDataWithArrayOfStructAsync() { QueryDataWithArrayOfStructAsyncSample sample = new QueryDataWithArrayOfStructAsyncSample(); var singerIds = await sample.QueryDataWithArrayOfStructAsync(_spannerFixture.ProjectId, _spannerFixture.InstanceId, _spannerFixture.DatabaseId); var expectedSingerIds = new List<int> { 8, 7, 6 }; Assert.Equal(singerIds.Intersect(expectedSingerIds), expectedSingerIds); } }
// Copyright 2020 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using System.Threading.Tasks; using Xunit; [Collection(nameof(SpannerFixture))] public class QueryDataWithArrayOfStructAsyncTest { private readonly SpannerFixture _spannerFixture; public QueryDataWithArrayOfStructAsyncTest(SpannerFixture spannerFixture) { _spannerFixture = spannerFixture; } [Fact] public async Task TestQueryDataWithArrayOfStructAsync() { QueryDataWithArrayOfStructAsyncSample sample = new QueryDataWithArrayOfStructAsyncSample(); var singerIds = await sample.QueryDataWithArrayOfStructAsync(_spannerFixture.ProjectId, _spannerFixture.InstanceId, _spannerFixture.DatabaseId); Assert.Contains(6, singerIds); Assert.Contains(7, singerIds); Assert.Contains(8, singerIds); } }
Test was expecting ordered data without order by.
fix(Spanner): Test was expecting ordered data without order by.
C#
apache-2.0
GoogleCloudPlatform/dotnet-docs-samples,GoogleCloudPlatform/dotnet-docs-samples,GoogleCloudPlatform/dotnet-docs-samples,GoogleCloudPlatform/dotnet-docs-samples
360d1ee35498c537ae5b18ef1f602a833346a074
SPAD.Interfaces/Configuration/IProfileOptionsProvider.cs
SPAD.Interfaces/Configuration/IProfileOptionsProvider.cs
using SPAD.neXt.Interfaces.Profile; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace SPAD.neXt.Interfaces.Configuration { public interface ISettingsProvider : IProfileOptionsProvider, IWindowPlacementProvider { } public interface IProfileOptionsProvider { IProfileOption AddOption(string key, Interfaces.Profile.ProfileOptionTypes type, string defaultValue, bool needrestart = false, bool editable = false, bool hidden = false,string groupName="Other"); IProfileOption GetOption(string key); void SetOption(string key, string value); } public interface IWindowPlacementProvider { IWindowPlacement GetWindowPlacement(string key); void SetWindowPlacement(IWindowPlacement placement); } public interface IWindowPlacement { string Key { get; } double Top { get; set; } double Left { get; set; } double Height { get; set; } double Width { get; set; } bool HasValues { get; } void ApplyPlacement(Window w); bool SavePlacement(Window w); T GetOption<T>(string key, T defaultValue = default(T)); void SetOption(string key, object value); } }
using SPAD.neXt.Interfaces.Profile; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace SPAD.neXt.Interfaces.Configuration { public interface ISettingsProvider : IProfileOptionsProvider, IWindowPlacementProvider { } public interface IProfileOptionsProvider { IProfileOption AddOption(string key, Interfaces.Profile.ProfileOptionTypes type, string defaultValue, bool needrestart = false, bool editable = false, bool hidden = false,string groupName="Other"); IProfileOption GetOption(string key); void SetOption(string key, string value); } public interface IWindowPlacementProvider { IWindowPlacement GetWindowPlacement(string key); void SetWindowPlacement(IWindowPlacement placement); } public interface IWindowPlacement { string Key { get; } double Top { get; set; } double Left { get; set; } double Height { get; set; } double Width { get; set; } bool HasValues { get; } void ApplyPlacement(Window w, bool force = false); bool SavePlacement(Window w); T GetOption<T>(string key, T defaultValue = default(T)); void SetOption(string key, object value); } }
Add option to enforce placement even if turned off
Add option to enforce placement even if turned off
C#
mit
c0nnex/SPAD.neXt,c0nnex/SPAD.neXt
054543f58fd8a0ec7641047635d1b8c9d6ff821c
osu.Game.Tournament.Tests/Components/TestSceneTournamentBeatmapPanel.cs
osu.Game.Tournament.Tests/Components/TestSceneTournamentBeatmapPanel.cs
// 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 osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Online.API.Requests; using osu.Game.Online.API.Requests.Responses; using osu.Game.Tournament.Components; namespace osu.Game.Tournament.Tests.Components { public class TestSceneTournamentBeatmapPanel : TournamentTestScene { [BackgroundDependencyLoader] private void load() { var req = new GetBeatmapRequest(new APIBeatmap { OnlineID = 1091460 }); req.Success += success; API.Queue(req); } private void success(APIBeatmap beatmap) { Add(new TournamentBeatmapPanel(beatmap) { Anchor = Anchor.Centre, Origin = Anchor.Centre }); } } }
// 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 osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Online.API.Requests.Responses; using osu.Game.Tests.Visual; using osu.Game.Tournament.Components; namespace osu.Game.Tournament.Tests.Components { public class TestSceneTournamentBeatmapPanel : TournamentTestScene { /// <remarks> /// Warning: the below API instance is actually the online API, rather than the dummy API provided by the test. /// It cannot be trivially replaced because setting <see cref="OsuTestScene.UseOnlineAPI"/> to <see langword="true"/> causes <see cref="OsuTestScene.API"/> to no longer be usable. /// </remarks> [Resolved] private IAPIProvider api { get; set; } [BackgroundDependencyLoader] private void load() { var req = new GetBeatmapRequest(new APIBeatmap { OnlineID = 1091460 }); req.Success += success; api.Queue(req); } private void success(APIBeatmap beatmap) { Add(new TournamentBeatmapPanel(beatmap) { Anchor = Anchor.Centre, Origin = Anchor.Centre }); } } }
Revert tournament beatmap panel test change with comment
Revert tournament beatmap panel test change with comment
C#
mit
NeoAdonis/osu,ppy/osu,ppy/osu,peppy/osu,peppy/osu,NeoAdonis/osu,peppy/osu,ppy/osu,NeoAdonis/osu
2c57deea2bd2724a0a333146f58c2002c18e0c22
osu.Game/Skinning/IPooledSampleProvider.cs
osu.Game/Skinning/IPooledSampleProvider.cs
// 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 JetBrains.Annotations; using osu.Game.Audio; namespace osu.Game.Skinning { /// <summary> /// Provides pooled samples to be used by <see cref="SkinnableSound"/>s. /// </summary> internal interface IPooledSampleProvider { /// <summary> /// Retrieves a <see cref="PoolableSkinnableSample"/> from a pool. /// </summary> /// <param name="sampleInfo">The <see cref="SampleInfo"/> describing the sample to retrieve..</param> /// <returns>The <see cref="PoolableSkinnableSample"/>.</returns> [CanBeNull] PoolableSkinnableSample GetPooledSample(ISampleInfo sampleInfo); } }
// 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 JetBrains.Annotations; using osu.Game.Audio; namespace osu.Game.Skinning { /// <summary> /// Provides pooled samples to be used by <see cref="SkinnableSound"/>s. /// </summary> internal interface IPooledSampleProvider { /// <summary> /// Retrieves a <see cref="PoolableSkinnableSample"/> from a pool. /// </summary> /// <param name="sampleInfo">The <see cref="SampleInfo"/> describing the sample to retrieve.</param> /// <returns>The <see cref="PoolableSkinnableSample"/>.</returns> [CanBeNull] PoolableSkinnableSample GetPooledSample(ISampleInfo sampleInfo); } }
Trim double full-stop in xmldoc
Trim double full-stop in xmldoc
C#
mit
peppy/osu,peppy/osu-new,smoogipoo/osu,smoogipoo/osu,ppy/osu,UselessToucan/osu,NeoAdonis/osu,NeoAdonis/osu,ppy/osu,smoogipooo/osu,ppy/osu,UselessToucan/osu,smoogipoo/osu,peppy/osu,NeoAdonis/osu,peppy/osu,UselessToucan/osu
b1a8734e0682a9975161f93ae94374030da3ba4c
src/SilentHunter.FileFormats/Extensions/DebugExtensions.cs
src/SilentHunter.FileFormats/Extensions/DebugExtensions.cs
#if DEBUG using System; using System.IO; using System.Reflection; using SilentHunter.FileFormats.IO; namespace SilentHunter.FileFormats.Extensions { internal static class DebugExtensions { internal static string GetBaseStreamName(this Stream s) { Stream baseStream = s; if (baseStream is RegionStream) { baseStream = ((RegionStream)s).BaseStream; } // TODO: can we remove reflection to get base stream?? Even though we only use this in DEBUG.. if (baseStream is BufferedStream) { // Get the private field _s. baseStream = (Stream)typeof(BufferedStream).GetField("_stream", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(baseStream); } Type t = baseStream.GetType(); if (t.Name == "SyncStream") { baseStream = (Stream)t.GetField("_stream", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(baseStream); } if (baseStream is BufferedStream) { // Get the private field _s. baseStream = (Stream)typeof(BufferedStream).GetField("_stream", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(baseStream); } if (baseStream is FileStream fileStream) { return fileStream.Name; } return null; } } } #endif
#if DEBUG using System; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Reflection; using SilentHunter.FileFormats.IO; namespace SilentHunter.FileFormats.Extensions { [ExcludeFromCodeCoverage] internal static class DebugExtensions { internal static string GetBaseStreamName(this Stream s) { Stream baseStream = s; if (baseStream is RegionStream) { baseStream = ((RegionStream)s).BaseStream; } // TODO: can we remove reflection to get base stream?? Even though we only use this in DEBUG.. if (baseStream is BufferedStream) { // Get the private field _s. baseStream = (Stream)typeof(BufferedStream).GetField("_stream", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(baseStream); } Type t = baseStream.GetType(); if (t.Name == "SyncStream") { baseStream = (Stream)t.GetField("_stream", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(baseStream); } if (baseStream is BufferedStream) { // Get the private field _s. baseStream = (Stream)typeof(BufferedStream).GetField("_stream", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(baseStream); } if (baseStream is FileStream fileStream) { return fileStream.Name; } return null; } } } #endif
Exclude debug extensions from coverage
Exclude debug extensions from coverage
C#
apache-2.0
skwasjer/SilentHunter
68bfb31cd4450311f0cc44d644bc4904c07f6706
CompleteSample/CompleteSample.Authentication/AuthenticationMiddleware.cs
CompleteSample/CompleteSample.Authentication/AuthenticationMiddleware.cs
using Microsoft.Owin; using System.Linq; using System.Security.Principal; using System.Threading.Tasks; namespace CompleteSample.Authentication { public class AuthenticationMiddleware : OwinMiddleware { public AuthenticationMiddleware(OwinMiddleware next) : base(next) { } public override Task Invoke(IOwinContext context) { string[] values; BasicAuthenticationCredentials credentials; if (context.Request.Headers.TryGetValue("Authorization", out values) && BasicAuthenticationCredentials.TryParse(values.First(), out credentials)) { if (Authenticate(credentials.UserName, credentials.Password)) { var identity = new GenericIdentity(credentials.UserName); context.Request.User = new GenericPrincipal(identity, new string[0]); } else { context.Response.StatusCode = 401; // Unauthorized } } return Next.Invoke(context); } private static bool Authenticate(string userName, string password) { // TODO: use a better authentication mechanism ;-) return userName == "fvilers" && password == "test"; } } }
using Microsoft.Owin; using System.Linq; using System.Security.Principal; using System.Threading.Tasks; namespace CompleteSample.Authentication { public class AuthenticationMiddleware : OwinMiddleware { public AuthenticationMiddleware(OwinMiddleware next) : base(next) { } public override Task Invoke(IOwinContext context) { string[] values; BasicAuthenticationCredentials credentials; if (context.Request.Headers.TryGetValue("Authorization", out values) && BasicAuthenticationCredentials.TryParse(values.First(), out credentials) && Authenticate(credentials.UserName, credentials.Password)) { var identity = new GenericIdentity(credentials.UserName); context.Request.User = new GenericPrincipal(identity, new string[0]); } else { context.Response.StatusCode = 401; // Unauthorized } return Next.Invoke(context); } private static bool Authenticate(string userName, string password) { // TODO: use a better authentication mechanism ;-) return userName == "fvilers" && password == "test"; } } }
Update how the 401 status code is returned when authenticating
Update how the 401 status code is returned when authenticating
C#
mit
fvilers/OWIN-Katana
f6c0441fe27d75c6b333cfbd7d89463d6948c9c1
PackageExplorer/Converters/FrameworkAssemblyReferenceConverter.cs
PackageExplorer/Converters/FrameworkAssemblyReferenceConverter.cs
using System; using System.Collections.Generic; using System.Runtime.Versioning; using System.Windows; using System.Windows.Data; using NuGet; namespace PackageExplorer { public class FrameworkAssemblyReferenceConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { var frameworkNames = (IEnumerable<FrameworkName>)value; return frameworkNames == null ? String.Empty : String.Join("; ", frameworkNames); } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { string stringValue = (string)value; if (!String.IsNullOrEmpty(stringValue)) { string[] parts = stringValue.Split(new char[] {';', ','}, StringSplitOptions.RemoveEmptyEntries); if (parts.Length > 0) { FrameworkName[] names = new FrameworkName[parts.Length]; for (int i = 0; i < parts.Length; i++) { try { names[i] = VersionUtility.ParseFrameworkName(parts[i]); if (names[i] == VersionUtility.UnsupportedFrameworkName) { return DependencyProperty.UnsetValue; } } catch (ArgumentException) { return DependencyProperty.UnsetValue; } } return names; } } return DependencyProperty.UnsetValue; } } }
using System; using System.Collections.Generic; using System.Runtime.Versioning; using System.Windows; using System.Windows.Data; using NuGet; namespace PackageExplorer { public class FrameworkAssemblyReferenceConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { var frameworkNames = (IEnumerable<FrameworkName>)value; return frameworkNames == null ? String.Empty : String.Join("; ", frameworkNames); } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { string stringValue = (string)value; if (!String.IsNullOrEmpty(stringValue)) { string[] parts = stringValue.Split(new char[] { ';', ',' }, StringSplitOptions.RemoveEmptyEntries); if (parts.Length > 0) { FrameworkName[] names = new FrameworkName[parts.Length]; for (int i = 0; i < parts.Length; i++) { try { names[i] = VersionUtility.ParseFrameworkName(parts[i]); if (names[i] == VersionUtility.UnsupportedFrameworkName) { return DependencyProperty.UnsetValue; } } catch (ArgumentException) { return DependencyProperty.UnsetValue; } } return names; } } return new FrameworkName[0]; } } }
Fix an issue with the binding converter of framework assembly reference.
Fix an issue with the binding converter of framework assembly reference. --HG-- branch : 2.0
C#
mit
NuGetPackageExplorer/NuGetPackageExplorer,campersau/NuGetPackageExplorer,dsplaisted/NuGetPackageExplorer,BreeeZe/NuGetPackageExplorer,NuGetPackageExplorer/NuGetPackageExplorer
529a5e10d94d9c8022cbb557cdfdd2afb5f19123
src/Umbraco.Core/Logging/SerilogExtensions/Log4NetLevelMapperEnricher.cs
src/Umbraco.Core/Logging/SerilogExtensions/Log4NetLevelMapperEnricher.cs
using Serilog.Core; using Serilog.Events; namespace Umbraco.Core.Logging.SerilogExtensions { /// <summary> /// This is used to create a new property in Logs called 'Log4NetLevel' /// So that we can map Serilog levels to Log4Net levels - so log files stay consistent /// </summary> public class Log4NetLevelMapperEnricher : ILogEventEnricher { public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) { var log4NetLevel = string.Empty; switch (logEvent.Level) { case LogEventLevel.Debug: log4NetLevel = "DEBUG"; break; case LogEventLevel.Error: log4NetLevel = "ERROR"; break; case LogEventLevel.Fatal: log4NetLevel = "FATAL"; break; case LogEventLevel.Information: log4NetLevel = "INFO "; break; case LogEventLevel.Verbose: log4NetLevel = "ALL "; break; case LogEventLevel.Warning: log4NetLevel = "WARN "; break; } logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("Log4NetLevel", log4NetLevel)); } } }
using Serilog.Core; using Serilog.Events; namespace Umbraco.Core.Logging.SerilogExtensions { /// <summary> /// This is used to create a new property in Logs called 'Log4NetLevel' /// So that we can map Serilog levels to Log4Net levels - so log files stay consistent /// </summary> public class Log4NetLevelMapperEnricher : ILogEventEnricher { public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) { var log4NetLevel = string.Empty; switch (logEvent.Level) { case LogEventLevel.Debug: log4NetLevel = "DEBUG"; break; case LogEventLevel.Error: log4NetLevel = "ERROR"; break; case LogEventLevel.Fatal: log4NetLevel = "FATAL"; break; case LogEventLevel.Information: log4NetLevel = "INFO"; break; case LogEventLevel.Verbose: log4NetLevel = "ALL"; break; case LogEventLevel.Warning: log4NetLevel = "WARN"; break; } //Pad string so that all log levels are 5 chars long (needed to keep the txt log file lined up nicely) log4NetLevel = log4NetLevel.PadRight(5); logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("Log4NetLevel", log4NetLevel)); } } }
Use string.PadRight to be more explicit with what we are doing with the Log4Net level property enricher
Use string.PadRight to be more explicit with what we are doing with the Log4Net level property enricher
C#
mit
dawoe/Umbraco-CMS,abryukhov/Umbraco-CMS,WebCentrum/Umbraco-CMS,marcemarc/Umbraco-CMS,abryukhov/Umbraco-CMS,tcmorris/Umbraco-CMS,arknu/Umbraco-CMS,umbraco/Umbraco-CMS,hfloyd/Umbraco-CMS,KevinJump/Umbraco-CMS,hfloyd/Umbraco-CMS,lars-erik/Umbraco-CMS,robertjf/Umbraco-CMS,NikRimington/Umbraco-CMS,abjerner/Umbraco-CMS,leekelleher/Umbraco-CMS,tcmorris/Umbraco-CMS,tompipe/Umbraco-CMS,lars-erik/Umbraco-CMS,arknu/Umbraco-CMS,tcmorris/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,dawoe/Umbraco-CMS,bjarnef/Umbraco-CMS,NikRimington/Umbraco-CMS,marcemarc/Umbraco-CMS,tcmorris/Umbraco-CMS,KevinJump/Umbraco-CMS,tcmorris/Umbraco-CMS,robertjf/Umbraco-CMS,lars-erik/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,leekelleher/Umbraco-CMS,robertjf/Umbraco-CMS,robertjf/Umbraco-CMS,hfloyd/Umbraco-CMS,bjarnef/Umbraco-CMS,lars-erik/Umbraco-CMS,arknu/Umbraco-CMS,umbraco/Umbraco-CMS,robertjf/Umbraco-CMS,marcemarc/Umbraco-CMS,leekelleher/Umbraco-CMS,rasmuseeg/Umbraco-CMS,arknu/Umbraco-CMS,mattbrailsford/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,tompipe/Umbraco-CMS,hfloyd/Umbraco-CMS,dawoe/Umbraco-CMS,madsoulswe/Umbraco-CMS,tompipe/Umbraco-CMS,mattbrailsford/Umbraco-CMS,rasmuseeg/Umbraco-CMS,abryukhov/Umbraco-CMS,dawoe/Umbraco-CMS,hfloyd/Umbraco-CMS,bjarnef/Umbraco-CMS,NikRimington/Umbraco-CMS,abryukhov/Umbraco-CMS,dawoe/Umbraco-CMS,marcemarc/Umbraco-CMS,marcemarc/Umbraco-CMS,rasmuseeg/Umbraco-CMS,bjarnef/Umbraco-CMS,leekelleher/Umbraco-CMS,abjerner/Umbraco-CMS,leekelleher/Umbraco-CMS,abjerner/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,WebCentrum/Umbraco-CMS,madsoulswe/Umbraco-CMS,mattbrailsford/Umbraco-CMS,madsoulswe/Umbraco-CMS,mattbrailsford/Umbraco-CMS,lars-erik/Umbraco-CMS,KevinJump/Umbraco-CMS,KevinJump/Umbraco-CMS,KevinJump/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,umbraco/Umbraco-CMS,abjerner/Umbraco-CMS,WebCentrum/Umbraco-CMS,umbraco/Umbraco-CMS,tcmorris/Umbraco-CMS
ab7fed434523204d2ed6adcee84ae63abd91c678
Source/Engine/AGS.Engine/UI/Text/Dialogs/AGSDialogLayout.cs
Source/Engine/AGS.Engine/UI/Text/Dialogs/AGSDialogLayout.cs
using System; using AGS.API; using System.Collections.Generic; using System.Threading.Tasks; namespace AGS.Engine { public class AGSDialogLayout : IDialogLayout { private IGame _game; public AGSDialogLayout(IGame game) { _game = game; } #region IDialogLayout implementation public async Task LayoutAsync(IObject dialogGraphics, IList<IDialogOption> options) { float y = 0f; for (int index = options.Count - 1; index >= 0; index--) { IDialogOption option = options[index]; _game.State.UI.Add(option.Label); if (!option.Label.Visible) continue; option.Label.Y = y; int retries = 100; while (option.Label.TextHeight <= 5f && retries > 0) { await Task.Delay(1); //todo: find a better way (we need to wait at least one render loop for the text height to be correct) retries--; } y += option.Label.TextHeight; } if (dialogGraphics.Image == null) { dialogGraphics.Image = new EmptyImage (_game.Settings.VirtualResolution.Width, y); } dialogGraphics.Animation.Sprite.ScaleTo(_game.Settings.VirtualResolution.Width, y); } #endregion } }
using System; using AGS.API; using System.Collections.Generic; using System.Threading.Tasks; namespace AGS.Engine { public class AGSDialogLayout : IDialogLayout { private IGame _game; public AGSDialogLayout(IGame game) { _game = game; } #region IDialogLayout implementation public async Task LayoutAsync(IObject dialogGraphics, IList<IDialogOption> options) { float y = 0f; for (int index = options.Count - 1; index >= 0; index--) { IDialogOption option = options[index]; _game.State.UI.Add(option.Label); if (!option.Label.Visible) continue; option.Label.Y = y; int retries = 1000; while (option.Label.TextHeight <= 5f && retries > 0) { await Task.Delay(1); //todo: find a better way (we need to wait at least one render loop for the text height to be correct) retries--; } y += option.Label.TextHeight; } if (dialogGraphics.Image == null) { dialogGraphics.Image = new EmptyImage (_game.Settings.VirtualResolution.Width, y); } dialogGraphics.Animation.Sprite.ScaleTo(_game.Settings.VirtualResolution.Width, y); } #endregion } }
Increase the amount of retries when rendering the dialog
Increase the amount of retries when rendering the dialog This is to have the dialog render properly even at very low FPS.
C#
artistic-2.0
tzachshabtay/MonoAGS
8e9ac6f6ef2a00d5032d038fc481c0d7032f612a
dotnet/Packages/Apollo/Middleware/ExceptionMiddleware.cs
dotnet/Packages/Apollo/Middleware/ExceptionMiddleware.cs
using System; using System.Collections.Generic; using System.Net; using System.Threading.Tasks; using Apollo.Converters; using Branch.Packages.Exceptions; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; namespace Apollo.Middleware { public static class ExceptionMiddleware { private static JsonSerializerSettings jsonSerializerSettings = new JsonSerializerSettings { Converters = new List<JsonConverter> { new ExceptionConverter() }, ContractResolver = new DefaultContractResolver { NamingStrategy = new SnakeCaseNamingStrategy() }, }; public static async Task Handle(HttpContext ctx, Func<Task> next) { try { await next.Invoke(); } catch (Exception ex) { // TODO(0xdeafcafe): Handle this if (!(ex is BranchException)) { Console.WriteLine(ex); throw; } var json = JsonConvert.SerializeObject(ex, jsonSerializerSettings); ctx.Response.StatusCode = (int) HttpStatusCode.InternalServerError;; ctx.Response.ContentType = "application/json"; await ctx.Response.WriteAsync(json); } } } }
using System; using System.Collections.Generic; using System.Net; using System.Threading.Tasks; using Apollo.Converters; using Branch.Packages.Exceptions; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; namespace Apollo.Middleware { public static class ExceptionMiddleware { private static JsonSerializerSettings jsonSerializerSettings = new JsonSerializerSettings { Converters = new List<JsonConverter> { new ExceptionConverter() }, ContractResolver = new DefaultContractResolver { NamingStrategy = new SnakeCaseNamingStrategy() }, }; public static async Task Handle(HttpContext ctx, Func<Task> next) { try { await next.Invoke(); } catch (Exception ex) { var branchEx = ex as BranchException; // TODO(0xdeafcafe): Handle this if (!(ex is BranchException)) { Console.WriteLine(ex); branchEx = new BranchException("unknown_error"); } var json = JsonConvert.SerializeObject(branchEx, jsonSerializerSettings); ctx.Response.StatusCode = (int) HttpStatusCode.InternalServerError; ctx.Response.ContentType = "application/json"; await ctx.Response.WriteAsync(json); } } } }
Return some error if we fuck up hard
Return some error if we fuck up hard
C#
mit
TheTree/branch,TheTree/branch,TheTree/branch
43b9cc9b4f50fcd948fce7f110674979ab8032aa
CatchAllRule/CatchAllRule/Controllers/EverythingController.cs
CatchAllRule/CatchAllRule/Controllers/EverythingController.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace CatchAllRule.Controllers { public class EverythingController : Controller { // GET: Everything public ActionResult Index() { return View(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace CatchAllRule.Controllers { public class EverythingController : Controller { // GET: Everything public ActionResult Index() { // use your logger to track outdated links: System.Diagnostics.Debug.WriteLine( $"Update link on page '{Request.UrlReferrer}' for '{Request.Url}'" ); return View(); } } }
Add log statement to track outdated links
CatchAllRule: Add log statement to track outdated links
C#
apache-2.0
jgraber/Blog_Snippets,jgraber/Blog_Snippets,jgraber/Blog_Snippets,jgraber/Blog_Snippets
ad6a3752f5e717bc5136183ccea4f0d4ff08663f
FluentAutomation.Tests/Pages/InputsPage.cs
FluentAutomation.Tests/Pages/InputsPage.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace FluentAutomation.Tests.Pages { public class InputsPage : PageObject<InputsPage> { public InputsPage(FluentTest test) : base(test) { this.Url = "/Inputs"; } public string TextControlSelector = "#text-control"; public string TextareaControlSelector = "#textarea-control"; public string SelectControlSelector = "#select-control"; public string MultiSelectControlSelector = "#multi-select-control"; public string ButtonControlSelector = "#button-control"; public string InputButtonControlSelector = "#input-button-control"; public string TextChangedTextSelector = "#text-changed"; public string ButtonClickedTextSelector = "#button-clicked"; } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace FluentAutomation.Tests.Pages { public class InputsPage : PageObject<InputsPage> { public InputsPage(FluentTest test) : base(test) { this.Url = "/Inputs"; } public string TextControlSelector = "#text-control"; public string TextareaControlSelector = "#textarea-control"; public string SelectControlSelector = "#select-control"; public string MultiSelectControlSelector = "#multi-select-control"; public string ButtonControlSelector = "#button-control"; public string InputButtonControlSelector = "#input-button-control"; public string TextChangedTextSelector = "#text-control-changed"; public string ButtonClickedTextSelector = "#button-clicked"; } }
Fix for text-changed selector in tests
Fix for text-changed selector in tests
C#
mit
stirno/FluentAutomation,jorik041/FluentAutomation,tablesmit/FluentAutomation,stirno/FluentAutomation,tablesmit/FluentAutomation,tablesmit/FluentAutomation,jorik041/FluentAutomation,mirabeau-nl/WbTstr.Net,jorik041/FluentAutomation,stirno/FluentAutomation,mirabeau-nl/WbTstr.Net
046f5ec2bc36bfb1a2085d12d59c5a35916ceceb
src/AppHarbor/Commands/LoginAuthCommand.cs
src/AppHarbor/Commands/LoginAuthCommand.cs
using System; using RestSharp; using RestSharp.Contrib; namespace AppHarbor.Commands { [CommandHelp("Login to AppHarbor")] public class LoginAuthCommand : ICommand { private readonly IAccessTokenConfiguration _accessTokenConfiguration; public LoginAuthCommand(IAccessTokenConfiguration accessTokenConfiguration) { _accessTokenConfiguration = accessTokenConfiguration; } public void Execute(string[] arguments) { if (_accessTokenConfiguration.GetAccessToken() != null) { throw new CommandException("You're already logged in"); } Console.WriteLine("Username:"); var username = Console.ReadLine(); Console.WriteLine("Password:"); var password = Console.ReadLine(); var accessToken = GetAccessToken(username, password); _accessTokenConfiguration.SetAccessToken(accessToken); } public virtual string GetAccessToken(string username, string password) { //NOTE: Remove when merged into AppHarbor.NET library var restClient = new RestClient("https://appharbor-token-client.apphb.com"); var request = new RestRequest("/token", Method.POST); request.AddParameter("username", username); request.AddParameter("password", password); var response = restClient.Execute(request); return HttpUtility.ParseQueryString(response.Content.Split('=', '&')[1])["access_token"]; } } }
using System; using RestSharp; using RestSharp.Contrib; namespace AppHarbor.Commands { [CommandHelp("Login to AppHarbor")] public class LoginAuthCommand : ICommand { private readonly IAccessTokenConfiguration _accessTokenConfiguration; public LoginAuthCommand(IAccessTokenConfiguration accessTokenConfiguration) { _accessTokenConfiguration = accessTokenConfiguration; } public void Execute(string[] arguments) { if (_accessTokenConfiguration.GetAccessToken() != null) { throw new CommandException("You're already logged in"); } Console.WriteLine("Username:"); var username = Console.ReadLine(); Console.WriteLine("Password:"); var password = Console.ReadLine(); var accessToken = GetAccessToken(username, password); _accessTokenConfiguration.SetAccessToken(accessToken); } public virtual string GetAccessToken(string username, string password) { //NOTE: Remove when merged into AppHarbor.NET library var restClient = new RestClient("https://appharbor-token-client.apphb.com"); var request = new RestRequest("/token", Method.POST); request.AddParameter("username", username); request.AddParameter("password", password); var response = restClient.Execute(request); var accessToken = HttpUtility.ParseQueryString(response.Content.Split('=', '&')[1])["access_token"]; if (accessToken == null) { throw new CommandException("Couldn't log in. Try again"); } return accessToken; } } }
Throw exception if access token is null
Throw exception if access token is null
C#
mit
appharbor/appharbor-cli
aee81948b19e19440acd26be4b3561ced5c4a6e8
src/Glimpse.Server.Web/Resources/HelloGlimpseResource.cs
src/Glimpse.Server.Web/Resources/HelloGlimpseResource.cs
using Glimpse.Web; using System; using System.Text; using System.Threading.Tasks; namespace Glimpse.Server.Web.Resources { public class HelloGlimpseResource : IRequestHandler { public bool WillHandle(IContext context) { return context.Request.Path.StartsWith("/Glimpse"); } public async Task Handle(IContext context) { var response = context.Response; response.SetHeader("Content-Type", "text/plain"); var data = Encoding.UTF8.GetBytes("Hello world, Glimpse!"); await response.WriteAsync(data); } } }
using Glimpse.Web; using System; using System.Text; using System.Threading.Tasks; namespace Glimpse.Server.Web.Resources { public class HelloGlimpseResource : IRequestHandler { public bool WillHandle(IContext context) { return context.Request.Path == "/Glimpse"; } public async Task Handle(IContext context) { var response = context.Response; response.SetHeader("Content-Type", "text/plain"); var data = Encoding.UTF8.GetBytes("Hello world, Glimpse!"); await response.WriteAsync(data); } } }
Make test resource more specific
Make test resource more specific
C#
mit
pranavkm/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,zanetdev/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,pranavkm/Glimpse.Prototype,zanetdev/Glimpse.Prototype,pranavkm/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,pranavkm/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,Glimpse/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,zanetdev/Glimpse.Prototype,Glimpse/Glimpse.Prototype
82352d45e1d97f84bfdc866521bbe70311be117b
src/Engine/CommonInfo.cs
src/Engine/CommonInfo.cs
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyCompany("lozanotek")] [assembly: AssemblyProduct("MvcTurbine")] [assembly: AssemblyCopyright("Copyright © lozanotek, inc. 2010")] [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)] [assembly: AssemblyVersion("3.2.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyCompany("lozanotek")] [assembly: AssemblyProduct("MvcTurbine")] [assembly: AssemblyCopyright("Copyright © lozanotek, inc. 2010")] [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)] [assembly: AssemblyVersion("3.2.1.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
Update the version to 3.2.1.
Update the version to 3.2.1.
C#
apache-2.0
lozanotek/mvcturbine,lozanotek/mvcturbine
7c8888e4eaa8499005ed54931c57b7eac1e33259
util/AttributeCollection.cs
util/AttributeCollection.cs
using System.Collections.Generic; using System.Linq; namespace NMaier.SimpleDlna.Utilities { using Attribute = KeyValuePair<string, string>; using System; public sealed class AttributeCollection : IEnumerable<Attribute> { private readonly IList<Attribute> list = new List<Attribute>(); public int Count { get { return list.Count; } } public ICollection<string> Keys { get { return (from i in list select i.Key).ToList(); } } public ICollection<string> Values { get { return (from i in list select i.Value).ToList(); } } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return list.GetEnumerator(); } public void Add(Attribute item) { list.Add(item); } public void Add(string key, string value) { list.Add(new Attribute(key, value)); } public void Clear() { list.Clear(); } public bool Contains(Attribute item) { return list.Contains(item); } public IEnumerator<Attribute> GetEnumerator() { return list.GetEnumerator(); } public IEnumerable<string> GetValuesForKey(string key) { return from i in list where StringComparer.CurrentCultureIgnoreCase.Equals(i.Key, key) select i.Value; } } }
using System; using System.Collections.Generic; using System.Linq; namespace NMaier.SimpleDlna.Utilities { using Attribute = KeyValuePair<string, string>; public sealed class AttributeCollection : IEnumerable<Attribute> { private readonly IList<Attribute> list = new List<Attribute>(); public int Count { get { return list.Count; } } public ICollection<string> Keys { get { return (from i in list select i.Key).ToList(); } } public ICollection<string> Values { get { return (from i in list select i.Value).ToList(); } } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return list.GetEnumerator(); } public void Add(Attribute item) { list.Add(item); } public void Add(string key, string value) { list.Add(new Attribute(key, value)); } public void Clear() { list.Clear(); } public bool Contains(Attribute item) { return list.Contains(item); } public IEnumerator<Attribute> GetEnumerator() { return list.GetEnumerator(); } public IEnumerable<string> GetValuesForKey(string key) { return from i in list where StringComparer.CurrentCultureIgnoreCase.Equals(i.Key, key) select i.Value; } } }
Move using where it belongs
Move using where it belongs
C#
bsd-2-clause
antonio-bakula/simpleDLNA,itamar82/simpleDLNA,bra1nb3am3r/simpleDLNA,nmaier/simpleDLNA
d557d2c9ed02254f7d66351a9a10dbc87b7ac611
Examples/Authentication/TraktOAuthAuthenticationExample/Program.cs
Examples/Authentication/TraktOAuthAuthenticationExample/Program.cs
namespace TraktOAuthAuthenticationExample { class Program { static void Main(string[] args) { } } }
namespace TraktOAuthAuthenticationExample { using System; using System.Threading.Tasks; using TraktApiSharp; using TraktApiSharp.Authentication; using TraktApiSharp.Exceptions; class Program { private const string CLIENT_ID = "ENTER_CLIENT_ID_HERE"; private const string CLIENT_SECRET = "ENTER_CLIENT_SECRET_HERE"; private static TraktClient _client = null; static void Main(string[] args) { try { SetupClient(); TryToOAuthAuthenticate().Wait(); var authorization = _client.Authorization; if (authorization == null || !authorization.IsValid) throw new InvalidOperationException("Trakt Client not authenticated for requests, that require OAuth"); } catch (TraktException ex) { Console.WriteLine("-------------- Trakt Exception --------------"); Console.WriteLine($"Exception message: {ex.Message}"); Console.WriteLine($"Status code: {ex.StatusCode}"); Console.WriteLine($"Request URL: {ex.RequestUrl}"); Console.WriteLine($"Request message: {ex.RequestBody}"); Console.WriteLine($"Request response: {ex.Response}"); Console.WriteLine($"Server Reason Phrase: {ex.ServerReasonPhrase}"); Console.WriteLine("---------------------------------------------"); } catch (Exception ex) { Console.WriteLine("-------------- Exception --------------"); Console.WriteLine($"Exception message: {ex.Message}"); Console.WriteLine("---------------------------------------"); } Console.ReadLine(); } static void SetupClient() { if (_client == null) { _client = new TraktClient(CLIENT_ID, CLIENT_SECRET); if (!_client.IsValidForAuthenticationProcess) throw new InvalidOperationException("Trakt Client not valid for authentication"); } } static async Task TryToOAuthAuthenticate() { var authorizationUrl = _client.OAuth.CreateAuthorizationUrl(); if (!string.IsNullOrEmpty(authorizationUrl)) { Console.WriteLine("You have to authenticate this application."); Console.WriteLine("Please visit the following webpage:"); Console.WriteLine($"{authorizationUrl}\n"); Console.Write("Enter the PIN code from Trakt.tv: "); var code = Console.ReadLine(); if (!string.IsNullOrEmpty(code)) { TraktAuthorization authorization = await _client.OAuth.GetAuthorizationAsync(code); if (authorization != null && authorization.IsValid) { Console.WriteLine("-------------- Authentication successful --------------"); Console.WriteLine($"Created (UTC): {authorization.Created}"); Console.WriteLine($"Access Scope: {authorization.AccessScope.DisplayName}"); Console.WriteLine($"Refresh Possible: {authorization.IsRefreshPossible}"); Console.WriteLine($"Valid: {authorization.IsValid}"); Console.WriteLine($"Token Type: {authorization.TokenType.DisplayName}"); Console.WriteLine($"Access Token: {authorization.AccessToken}"); Console.WriteLine($"Refresh Token: {authorization.RefreshToken}"); Console.WriteLine($"Token Expired: {authorization.IsExpired}"); Console.WriteLine($"Expires in {authorization.ExpiresIn / 3600 / 24} days"); Console.WriteLine("-------------------------------------------------------"); } } } } } }
Add implementation for oauth authentication example.
Add implementation for oauth authentication example.
C#
mit
henrikfroehling/TraktApiSharp
8f296752af28d18b3f18ec31798d5c14a7fbf578
src/NBench.VisualStudio.TestAdapter/NBenchTestDiscoverer.cs
src/NBench.VisualStudio.TestAdapter/NBenchTestDiscoverer.cs
namespace NBench.VisualStudio.TestAdapter { using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using System; using System.Collections.Generic; using System.Linq; public class NBenchTestDiscoverer : ITestDiscoverer { public void DiscoverTests(IEnumerable<string> sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink) { if (sources == null) { throw new ArgumentNullException("sources", "The sources collection you have passed in is null. The source collection must be populated."); } else if (!sources.Any()) { throw new ArgumentException("The sources collection you have passed in is empty. The source collection must be populated.", "sources"); } else if (discoveryContext == null) { throw new ArgumentNullException("discoveryContext", "The discovery context you have passed in is null. The discovery context must not be null."); } else if (logger == null) { throw new ArgumentNullException("logger", "The message logger you have passed in is null. The message logger must not be null."); } else if (discoverySink == null) { throw new ArgumentNullException( "discoverySink", "The test case discovery sink you have passed in is null. The test case discovery sink must not be null."); } throw new NotImplementedException(); } } }
namespace NBench.VisualStudio.TestAdapter { using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using System; using System.Collections.Generic; using System.Linq; public class NBenchTestDiscoverer : ITestDiscoverer { public void DiscoverTests(IEnumerable<string> sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink) { if (sources == null) { throw new ArgumentNullException("sources", "The sources collection you have passed in is null. The source collection must be populated."); } else if (!sources.Any()) { throw new ArgumentException("The sources collection you have passed in is empty. The source collection must be populated.", "sources"); } else if (discoveryContext == null) { throw new ArgumentNullException("discoveryContext", "The discovery context you have passed in is null. The discovery context must not be null."); } else if (logger == null) { throw new ArgumentNullException("logger", "The message logger you have passed in is null. The message logger must not be null."); } else if (discoverySink == null) { throw new ArgumentNullException("discoverySink", "The test case discovery sink you have passed in is null. The test case discovery sink must not be null."); } throw new NotImplementedException(); } } }
Remove the test for the situation whree all the parameters are valid.
Remove the test for the situation whree all the parameters are valid.
C#
apache-2.0
SeanFarrow/NBench.VisualStudio
c777fd1a5ef0cc71ee32e662dcaa4c0019640184
Debugger/LoadingExtension.cs
Debugger/LoadingExtension.cs
using System; using ColossalFramework; using ICities; namespace ModTools { public class LoadingExtension : LoadingExtensionBase { public override void OnCreated(ILoading loading) { base.OnCreated(loading); ModToolsBootstrap.inMainMenu = false; ModToolsBootstrap.Bootstrap(); } public override void OnLevelLoaded(LoadMode mode) { base.OnLevelLoaded(mode); CustomPrefabs.Bootstrap(); var appMode = Singleton<ToolManager>.instance.m_properties.m_mode; if (ModTools.Instance.config.extendGamePanels && appMode == ItemClass.Availability.Game) { ModTools.Instance.gameObject.AddComponent<GamePanelExtender>(); } } public override void OnReleased() { base.OnReleased(); CustomPrefabs.Revert(); ModToolsBootstrap.inMainMenu = true; ModToolsBootstrap.initialized = false; } } }
using System; using ColossalFramework; using ICities; namespace ModTools { public class LoadingExtension : LoadingExtensionBase { public override void OnCreated(ILoading loading) { base.OnCreated(loading); ModToolsBootstrap.inMainMenu = false; ModToolsBootstrap.initialized = false; ModToolsBootstrap.Bootstrap(); } public override void OnLevelLoaded(LoadMode mode) { base.OnLevelLoaded(mode); CustomPrefabs.Bootstrap(); var appMode = Singleton<ToolManager>.instance.m_properties.m_mode; if (ModTools.Instance.config.extendGamePanels && appMode == ItemClass.Availability.Game) { ModTools.Instance.gameObject.AddComponent<GamePanelExtender>(); } } public override void OnReleased() { base.OnReleased(); CustomPrefabs.Revert(); ModToolsBootstrap.inMainMenu = true; ModToolsBootstrap.initialized = false; } } }
Set initialized to false in OnCreated
Set initialized to false in OnCreated
C#
mit
joaofarias/Unity-ModTools,earalov/Skylines-ModTools
fa4e997380a25b47817edbb2e3cbff6740505575
Source/Qvision.Umbraco.PollIt/Controllers/ApiControllers/AnswerApiController.cs
Source/Qvision.Umbraco.PollIt/Controllers/ApiControllers/AnswerApiController.cs
namespace Qvision.Umbraco.PollIt.Controllers.ApiControllers { using System.Net; using System.Net.Http; using System.Web.Http; using global::Umbraco.Web.Editors; using Qvision.Umbraco.PollIt.Attributes; using Qvision.Umbraco.PollIt.CacheRefresher; using Qvision.Umbraco.PollIt.Models.Pocos; using Qvision.Umbraco.PollIt.Models.Repositories; [CamelCase] public class AnswerApiController : UmbracoAuthorizedJsonController { [HttpPost] public HttpResponseMessage Post(Answer answer) { var result = AnswerRepository.Current.Save(answer); if (result != null) { PollItCacheRefresher.ClearCache(answer.QuestionId); this.Request.CreateResponse(HttpStatusCode.OK, answer); } return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Can't save answer"); } [HttpDelete] public HttpResponseMessage Delete(int id, int questionId) { using (var transaction = this.ApplicationContext.DatabaseContext.Database.GetTransaction()) { if (ResponseRepository.Current.DeleteByAnswerId(id) && AnswerRepository.Current.Delete(id)) { transaction.Complete(); PollItCacheRefresher.ClearCache(questionId); return this.Request.CreateResponse(HttpStatusCode.OK); } } return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Can't delete answer"); } } }
namespace Qvision.Umbraco.PollIt.Controllers.ApiControllers { using System.Net; using System.Net.Http; using System.Web.Http; using global::Umbraco.Web.Editors; using Qvision.Umbraco.PollIt.Attributes; using Qvision.Umbraco.PollIt.CacheRefresher; using Qvision.Umbraco.PollIt.Models.Pocos; using Qvision.Umbraco.PollIt.Models.Repositories; [CamelCase] public class AnswerApiController : UmbracoAuthorizedJsonController { [HttpPost] public HttpResponseMessage Post(Answer answer) { var result = AnswerRepository.Current.Save(answer); if (result != null) { PollItCacheRefresher.ClearCache(answer.QuestionId); return this.Request.CreateResponse(HttpStatusCode.OK, answer); } return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Can't save answer"); } [HttpDelete] public HttpResponseMessage Delete(int id, int questionId) { using (var transaction = this.ApplicationContext.DatabaseContext.Database.GetTransaction()) { if (ResponseRepository.Current.DeleteByAnswerId(id) && AnswerRepository.Current.Delete(id)) { transaction.Complete(); PollItCacheRefresher.ClearCache(questionId); return this.Request.CreateResponse(HttpStatusCode.OK); } } return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Can't delete answer"); } } }
Add missing return when creating Answer
Add missing return when creating Answer
C#
mit
janvanhelvoort/qvision-poll-it,janvanhelvoort/qvision-poll-it,janvanhelvoort/qvision-poll-it
269334230bb922b6bb63f425bb658e7905551905
src/GogoKit/Models/Response/Seating.cs
src/GogoKit/Models/Response/Seating.cs
using System.Runtime.Serialization; namespace GogoKit.Models.Response { [DataContract] public class Seating { [DataMember(Name = "section")] public string Section { get; set; } [DataMember(Name = "row")] public string Row { get; set; } [DataMember(Name = "seat_from")] public string SeatFrom { get; set; } [DataMember(Name = "seat_to")] public string SeatTo { get; set; } [DataMember(Name = "mapping_status")] public MappingStatus MappingStatus { get; set; } } public class MappingStatus { [DataMember(Name = "status")] public MappingStatusEnum Status { get; set; } [DataMember(Name = "description")] public string Description { get; set; } } public enum MappingStatusEnum { Unknown = 0, Mapped = 1, Unmapped = 2, Ignored = 3, Rejected = 4 } }
using System.Runtime.Serialization; namespace GogoKit.Models.Response { [DataContract] public class Seating { [DataMember(Name = "section")] public string Section { get; set; } [DataMember(Name = "row")] public string Row { get; set; } [DataMember(Name = "seat_from")] public string SeatFrom { get; set; } [DataMember(Name = "seat_to")] public string SeatTo { get; set; } [DataMember(Name = "mapping_status")] public MappingStatus MappingStatus { get; set; } } public class MappingStatus { [DataMember(Name = "status")] public ApiMappingState Status { get; set; } } public enum ApiMappingState { Unknown = 0, Mapped = 1, Unmapped = 2, Ignored = 3, Rejected = 4 } }
Update status enum to match current data base setup
Update status enum to match current data base setup
C#
mit
viagogo/gogokit.net
10ccbc76d3c32169efe793b2a032d475c0e56908
src/WebHost/App_Start/SwaggerConfig.cs
src/WebHost/App_Start/SwaggerConfig.cs
using System.Web.Http; using Swashbuckle.Application; using System; namespace WebHost { internal static class SwaggerConfig { public static void Register(HttpConfiguration httpConfigurations) { var thisAssembly = typeof(SwaggerConfig).Assembly; httpConfigurations .EnableSwagger(c => { c.SingleApiVersion("v1", "Enttoi API"); c.IncludeXmlComments($"{AppDomain.CurrentDomain.BaseDirectory}\\bin\\Core.XML"); c.IncludeXmlComments($"{AppDomain.CurrentDomain.BaseDirectory}\\bin\\WebHost.XML"); }) .EnableSwaggerUi(); } } }
using System.Web.Http; using Swashbuckle.Application; using System; using System.IO; namespace WebHost { internal static class SwaggerConfig { public static void Register(HttpConfiguration httpConfigurations) { var thisAssembly = typeof(SwaggerConfig).Assembly; var coreXml = new FileInfo($"{AppDomain.CurrentDomain.BaseDirectory}\\bin\\Core.XML"); var hostXml = new FileInfo($"{AppDomain.CurrentDomain.BaseDirectory}\\bin\\WebHost.XML"); httpConfigurations .EnableSwagger(c => { c.SingleApiVersion("v1", "Enttoi API"); if (coreXml.Exists) c.IncludeXmlComments(coreXml.FullName); if (hostXml.Exists) c.IncludeXmlComments(hostXml.FullName); }) .EnableSwaggerUi(); } } }
Check of XML file existance
Check of XML file existance
C#
mit
Enttoi/enttoi-api,Enttoi/enttoi-api,Enttoi/enttoi-api-dotnet,Enttoi/enttoi-api-dotnet
99af62c825c27d26a63f019f6aee8f705fbb8eb4
hnb/Views/Shared/_Head.cshtml
hnb/Views/Shared/_Head.cshtml
<title>Hearts and Bones Dog Rescue - Pet Adoption - @ViewBag.Title</title> @* Recommended meta tags for bootstrap *@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="Hearts &amp; Bones Rescue is a 501(c)3 non-profit organization dedicated to saving the lives of at-risk dogs and finding them loving, forever homes."> <link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Droid+Serif:400,700|Permanent+Marker" rel="stylesheet"> <link rel="stylesheet" href="/Styles/materialize/materialize.min.css"> <link rel="stylesheet" href="/Styles/site.min.css">
<title>Hearts &amp; Bones Dog Rescue - Pet Adoption - @ViewBag.Title</title> @* Recommended meta tags for bootstrap *@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="Hearts &amp; Bones Rescue is a 501(c)3 non-profit organization dedicated to saving the lives of at-risk dogs and finding them loving, forever homes."> <link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Droid+Serif:400,700|Permanent+Marker" rel="stylesheet"> <link rel="stylesheet" href="/Styles/materialize/materialize.min.css"> <link rel="stylesheet" href="/Styles/site.min.css">
Update page title to ampersand
Update page title to ampersand
C#
unlicense
jcolebrand/hnb,jcolebrand/hnb
afda150f522678269805321546bf693b9bacdfd1
UnityProject/Assets/Plugins/Zenject/Source/Editor/Editors/SceneContextEditor.cs
UnityProject/Assets/Plugins/Zenject/Source/Editor/Editors/SceneContextEditor.cs
#if !ODIN_INSPECTOR using UnityEditor; namespace Zenject { [CanEditMultipleObjects] [CustomEditor(typeof(SceneContext))] public class SceneContextEditor : RunnableContextEditor { SerializedProperty _contractNameProperty; SerializedProperty _parentNamesProperty; SerializedProperty _parentContractNameProperty; SerializedProperty _parentNewObjectsUnderRootProperty; public override void OnEnable() { base.OnEnable(); _contractNameProperty = serializedObject.FindProperty("_contractNames"); _parentNamesProperty = serializedObject.FindProperty("_parentContractNames"); _parentContractNameProperty = serializedObject.FindProperty("_parentContractName"); _parentNewObjectsUnderRootProperty = serializedObject.FindProperty("_parentNewObjectsUnderRoot"); } protected override void OnGui() { base.OnGui(); EditorGUILayout.PropertyField(_contractNameProperty, true); EditorGUILayout.PropertyField(_parentNamesProperty, true); EditorGUILayout.PropertyField(_parentContractNameProperty); EditorGUILayout.PropertyField(_parentNewObjectsUnderRootProperty); } } } #endif
#if !ODIN_INSPECTOR using UnityEditor; namespace Zenject { [CanEditMultipleObjects] [CustomEditor(typeof(SceneContext))] public class SceneContextEditor : RunnableContextEditor { SerializedProperty _contractNameProperty; SerializedProperty _parentNamesProperty; SerializedProperty _parentNewObjectsUnderRootProperty; public override void OnEnable() { base.OnEnable(); _contractNameProperty = serializedObject.FindProperty("_contractNames"); _parentNamesProperty = serializedObject.FindProperty("_parentContractNames"); _parentNewObjectsUnderRootProperty = serializedObject.FindProperty("_parentNewObjectsUnderRoot"); } protected override void OnGui() { base.OnGui(); EditorGUILayout.PropertyField(_contractNameProperty, true); EditorGUILayout.PropertyField(_parentNamesProperty, true); EditorGUILayout.PropertyField(_parentNewObjectsUnderRootProperty); } } } #endif
Fix for scene context editor crash
Fix for scene context editor crash
C#
mit
modesttree/Zenject,modesttree/Zenject,modesttree/Zenject