commit
stringlengths
40
40
subject
stringlengths
4
1.73k
repos
stringlengths
5
127k
old_file
stringlengths
2
751
new_file
stringlengths
2
751
new_contents
stringlengths
1
8.98k
old_contents
stringlengths
0
6.59k
license
stringclasses
13 values
lang
stringclasses
23 values
5d36a8c037cd83488acc8c98f8b4e0dc7ae74af0
Fix example of strings exercise
exercism/xcsharp,exercism/xcsharp
exercises/concept/strings/.meta/Example.cs
exercises/concept/strings/.meta/Example.cs
static class LogLine { public static string Message(string logLine) { return logLine.Substring(logLine.IndexOf(":") + 1).Trim(); } public static string LogLevel(string logLine) { return logLine.Substring(1, logLine.IndexOf("]") - 1).ToLower(); } public static string Reformat(string logLine) { return $"{Message(logLine)} ({LogLevel(logLine)})"; } }
static class LogLine { public static string Message(string logLine) { return logLine.Substring(logLine.IndexOf(":") + 1).Trim(); } public static string LogLevel(string logLine) { return logLine.Substring(1, (logLine.IndexOf("]") - 1).ToLower(); } public static string Reformat(string logLine) { return $"{Message(logLine)} ({LogLevel(logLine)})"; } }
mit
C#
3962ddadab85b7d4c3d5086e9ed18b54051c3c04
clone pb fix
Terradue/DotNetOpenSearch
Terradue.OpenSearch/Terradue/OpenSearch/Response/AtomOpenSearchResponse.cs
Terradue.OpenSearch/Terradue/OpenSearch/Response/AtomOpenSearchResponse.cs
// // AtomOpenSearchResponse.cs // // Author: // Emmanuel Mathot <emmanuel.mathot@terradue.com> // // Copyright (c) 2014 Terradue using System; using System.Collections.Specialized; using System.Threading; using Terradue.ServiceModel.Syndication; using System.Collections.Generic; using System.IO; using System.Xml; using System.Diagnostics; using Terradue.OpenSearch.Result; namespace Terradue.OpenSearch.Response { public class AtomOpenSearchResponse : OpenSearchResponse<AtomFeed> { protected TimeSpan timeSpan; public AtomOpenSearchResponse(AtomFeed result, TimeSpan timeSpan) : base(result) { this.timeSpan = timeSpan; } #region implemented abstract members of OpenSearchResponse public override object GetResponseObject() { return payload; } public override TimeSpan RequestTime { get { return this.timeSpan; } } public override string ContentType { get { return "application/atom+xml"; } } public override IOpenSearchResponse CloneForCache() { return new AtomOpenSearchResponse(new AtomFeed(payload, true), RequestTime); } #endregion } }
// // AtomOpenSearchResponse.cs // // Author: // Emmanuel Mathot <emmanuel.mathot@terradue.com> // // Copyright (c) 2014 Terradue using System; using System.Collections.Specialized; using System.Threading; using Terradue.ServiceModel.Syndication; using System.Collections.Generic; using System.IO; using System.Xml; using System.Diagnostics; using Terradue.OpenSearch.Result; namespace Terradue.OpenSearch.Response { public class AtomOpenSearchResponse : OpenSearchResponse<AtomFeed> { protected TimeSpan timeSpan; public AtomOpenSearchResponse(AtomFeed result, TimeSpan timeSpan) : base(result) { this.timeSpan = timeSpan; } #region implemented abstract members of OpenSearchResponse public override object GetResponseObject() { return payload; } public override TimeSpan RequestTime { get { return this.timeSpan; } } public override string ContentType { get { return "application/atom+xml"; } } public override IOpenSearchResponse CloneForCache() { return new AtomOpenSearchResponse(new AtomFeed(payload.Clone(true)), RequestTime); } #endregion } }
agpl-3.0
C#
8d99bfb5f477e5c37de9d785b5cb588d66165a55
Fix version to 0.2
demiurghg/FusionEngine,demiurghg/FusionEngine,demiurghg/FusionEngine
Fusion/Properties/AssemblyInfo.cs
Fusion/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle( "Fusion" )] [assembly: AssemblyDescription( "" )] [assembly: AssemblyConfiguration( "" )] [assembly: AssemblyCompany( "" )] [assembly: AssemblyProduct( "Fusion" )] [assembly: AssemblyCopyright( "" )] [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( "e2614143-bd55-4b83-b39b-a2aa41473544" )] // 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( "0.2.*" )] //[assembly: AssemblyFileVersion( "0.8.*" )]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle( "Fusion" )] [assembly: AssemblyDescription( "" )] [assembly: AssemblyConfiguration( "" )] [assembly: AssemblyCompany( "" )] [assembly: AssemblyProduct( "Fusion" )] [assembly: AssemblyCopyright( "" )] [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( "e2614143-bd55-4b83-b39b-a2aa41473544" )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion( "1.1.*" )] //[assembly: AssemblyFileVersion( "0.8.*" )]
mit
C#
73abaa98e5478af223a63f46dc700e07a9513564
remove ToString override forcing from Result
acple/ParsecSharp
ParsecSharp/Core/Result/Result.cs
ParsecSharp/Core/Result/Result.cs
using System; namespace ParsecSharp { public abstract class Result<TToken, T> { public abstract T Value { get; } protected IParsecStateStream<TToken> Rest { get; } protected Result(IParsecStateStream<TToken> state) { this.Rest = state; } internal abstract Result<TToken, TResult> Next<TNext, TResult>(Func<T, Parser<TToken, TNext>> next, Func<Result<TToken, TNext>, Result<TToken, TResult>> cont); public abstract TResult CaseOf<TResult>(Func<Fail<TToken, T>, TResult> fail, Func<Success<TToken, T>, TResult> success); internal Suspended Suspend() => new Suspended(this); public readonly struct Suspended { private readonly Result<TToken, T> _result; internal Suspended(Result<TToken, T> result) { this._result = result; } public void Deconstruct(out Result<TToken, T> result, out IParsecStateStream<TToken> rest) { result = this._result; rest = this._result.Rest; } } } }
using System; namespace ParsecSharp { public abstract class Result<TToken, T> { public abstract T Value { get; } protected IParsecStateStream<TToken> Rest { get; } protected Result(IParsecStateStream<TToken> state) { this.Rest = state; } internal abstract Result<TToken, TResult> Next<TNext, TResult>(Func<T, Parser<TToken, TNext>> next, Func<Result<TToken, TNext>, Result<TToken, TResult>> cont); public abstract TResult CaseOf<TResult>(Func<Fail<TToken, T>, TResult> fail, Func<Success<TToken, T>, TResult> success); public abstract override string ToString(); internal Suspended Suspend() => new Suspended(this); public readonly struct Suspended { private readonly Result<TToken, T> _result; internal Suspended(Result<TToken, T> result) { this._result = result; } public void Deconstruct(out Result<TToken, T> result, out IParsecStateStream<TToken> rest) { result = this._result; rest = this._result.Rest; } } } }
mit
C#
89f8675875f1e6c352a0b6ebd95cda30b631d66a
Correct private field name.
baks/code-cracker,andrecarlucci/code-cracker,GuilhermeSa/code-cracker,code-cracker/code-cracker,adraut/code-cracker,AlbertoMonteiro/code-cracker,kindermannhubert/code-cracker,eriawan/code-cracker,akamud/code-cracker,thomaslevesque/code-cracker,jhancock93/code-cracker,thorgeirk11/code-cracker,ElemarJR/code-cracker,jwooley/code-cracker,carloscds/code-cracker,carloscds/code-cracker,giggio/code-cracker,robsonalves/code-cracker,code-cracker/code-cracker
src/CSharp/CodeCracker/Extensions/CSharpGeneratedCodeAnalysisExtensions.cs
src/CSharp/CodeCracker/Extensions/CSharpGeneratedCodeAnalysisExtensions.cs
using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; using System.Linq; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp; namespace CodeCracker { public static class CSharpGeneratedCodeAnalysisExtensions { public static bool IsGenerated(this SyntaxNodeAnalysisContext context) => (context.SemanticModel?.SyntaxTree?.IsGenerated() ?? false) || (context.Node?.IsGenerated() ?? false); private static readonly string[] generatedCodeAttributes = new string[] { "DebuggerNonUserCode", "GeneratedCode", "DebuggerNonUserCodeAttribute", "GeneratedCodeAttribute" }; public static bool IsGenerated(this SyntaxNode node) => node.HasAttributeOnAncestorOrSelf(generatedCodeAttributes); public static bool IsGenerated(this SyntaxTreeAnalysisContext context) => context.Tree?.IsGenerated() ?? false; public static bool IsGenerated(this SymbolAnalysisContext context) { if (context.Symbol == null) return false; foreach (var syntaxReference in context.Symbol.DeclaringSyntaxReferences) { if (syntaxReference.SyntaxTree.IsGenerated()) return true; var root = syntaxReference.SyntaxTree.GetRoot(); var node = root?.FindNode(syntaxReference.Span); if (node.IsGenerated()) return true; } return false; } public static bool IsGenerated(this SyntaxTree tree) => (tree.FilePath?.IsOnGeneratedFile() ?? false) || tree.HasAutoGeneratedComment(); public static bool HasAutoGeneratedComment(this SyntaxTree tree) { var root = tree.GetRoot(); if (root == null) return false; var firstToken = root.GetFirstToken(); SyntaxTriviaList trivia; if (firstToken == default(SyntaxToken)) { var token = ((CompilationUnitSyntax)root).EndOfFileToken; if (!token.HasLeadingTrivia) return false; trivia = token.LeadingTrivia; } else { if (!firstToken.HasLeadingTrivia) return false; trivia = firstToken.LeadingTrivia; } var commentLines = trivia.Where(t => t.IsKind(SyntaxKind.SingleLineCommentTrivia)).Take(2).ToList(); if (commentLines.Count != 2) return false; return commentLines[1].ToString() == "// <auto-generated>"; } } }
using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; using System.Linq; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp; namespace CodeCracker { public static class CSharpGeneratedCodeAnalysisExtensions { public static bool IsGenerated(this SyntaxNodeAnalysisContext context) => (context.SemanticModel?.SyntaxTree?.IsGenerated() ?? false) || (context.Node?.IsGenerated() ?? false); private static readonly string[] _generatedCodeAttributes = new string[] { "DebuggerNonUserCode", "GeneratedCode", "DebuggerNonUserCodeAttribute", "GeneratedCodeAttribute" }; public static bool IsGenerated(this SyntaxNode node) => node.HasAttributeOnAncestorOrSelf(_generatedCodeAttributes); public static bool IsGenerated(this SyntaxTreeAnalysisContext context) => context.Tree?.IsGenerated() ?? false; public static bool IsGenerated(this SymbolAnalysisContext context) { if (context.Symbol == null) return false; foreach (var syntaxReference in context.Symbol.DeclaringSyntaxReferences) { if (syntaxReference.SyntaxTree.IsGenerated()) return true; var root = syntaxReference.SyntaxTree.GetRoot(); var node = root?.FindNode(syntaxReference.Span); if (node.IsGenerated()) return true; } return false; } public static bool IsGenerated(this SyntaxTree tree) => (tree.FilePath?.IsOnGeneratedFile() ?? false) || tree.HasAutoGeneratedComment(); public static bool HasAutoGeneratedComment(this SyntaxTree tree) { var root = tree.GetRoot(); if (root == null) return false; var firstToken = root.GetFirstToken(); SyntaxTriviaList trivia; if (firstToken == default(SyntaxToken)) { var token = ((CompilationUnitSyntax)root).EndOfFileToken; if (!token.HasLeadingTrivia) return false; trivia = token.LeadingTrivia; } else { if (!firstToken.HasLeadingTrivia) return false; trivia = firstToken.LeadingTrivia; } var commentLines = trivia.Where(t => t.IsKind(SyntaxKind.SingleLineCommentTrivia)).Take(2).ToList(); if (commentLines.Count != 2) return false; return commentLines[1].ToString() == "// <auto-generated>"; } } }
apache-2.0
C#
fb1906e2bad0727c89a6ee20ef05105adef31e61
Fix DebuggerDisplay for GraphQLFragmentDefinition (#249)
graphql-dotnet/parser
src/GraphQLParser/AST/Definitions/GraphQLFragmentDefinition.cs
src/GraphQLParser/AST/Definitions/GraphQLFragmentDefinition.cs
using System.Diagnostics; namespace GraphQLParser.AST; /// <summary> /// AST node for <see cref="ASTNodeKind.FragmentDefinition"/>. /// </summary> [DebuggerDisplay("GraphQLFragmentDefinition: {FragmentName.Name.StringValue}")] public class GraphQLFragmentDefinition : GraphQLExecutableDefinition { /// <inheritdoc/> public override ASTNodeKind Kind => ASTNodeKind.FragmentDefinition; /// <summary> /// Fragment name represented as a nested AST node. /// </summary> public GraphQLFragmentName FragmentName { get; set; } = null!; /// <summary> /// Nested <see cref="GraphQLTypeCondition"/> AST node with type condition of this fragment. /// </summary> public GraphQLTypeCondition TypeCondition { get; set; } = null!; } internal sealed class GraphQLFragmentDefinitionWithLocation : GraphQLFragmentDefinition { private GraphQLLocation _location; public override GraphQLLocation Location { get => _location; set => _location = value; } } internal sealed class GraphQLFragmentDefinitionWithComment : GraphQLFragmentDefinition { private List<GraphQLComment>? _comments; public override List<GraphQLComment>? Comments { get => _comments; set => _comments = value; } } internal sealed class GraphQLFragmentDefinitionFull : GraphQLFragmentDefinition { private GraphQLLocation _location; private List<GraphQLComment>? _comments; public override GraphQLLocation Location { get => _location; set => _location = value; } public override List<GraphQLComment>? Comments { get => _comments; set => _comments = value; } }
using System.Diagnostics; namespace GraphQLParser.AST; /// <summary> /// AST node for <see cref="ASTNodeKind.FragmentDefinition"/>. /// </summary> [DebuggerDisplay("GraphQLFragmentDefinition: {Name}")] public class GraphQLFragmentDefinition : GraphQLExecutableDefinition { /// <inheritdoc/> public override ASTNodeKind Kind => ASTNodeKind.FragmentDefinition; /// <summary> /// Fragment name represented as a nested AST node. /// </summary> public GraphQLFragmentName FragmentName { get; set; } = null!; /// <summary> /// Nested <see cref="GraphQLTypeCondition"/> AST node with type condition of this fragment. /// </summary> public GraphQLTypeCondition TypeCondition { get; set; } = null!; } internal sealed class GraphQLFragmentDefinitionWithLocation : GraphQLFragmentDefinition { private GraphQLLocation _location; public override GraphQLLocation Location { get => _location; set => _location = value; } } internal sealed class GraphQLFragmentDefinitionWithComment : GraphQLFragmentDefinition { private List<GraphQLComment>? _comments; public override List<GraphQLComment>? Comments { get => _comments; set => _comments = value; } } internal sealed class GraphQLFragmentDefinitionFull : GraphQLFragmentDefinition { private GraphQLLocation _location; private List<GraphQLComment>? _comments; public override GraphQLLocation Location { get => _location; set => _location = value; } public override List<GraphQLComment>? Comments { get => _comments; set => _comments = value; } }
mit
C#
5976e8bfeb6142583fdf1422d2902356055a51f7
Use new Process interface in tests
lou1306/CIV,lou1306/CIV
CIV.Test/Common.cs
CIV.Test/Common.cs
using System; using System.Collections.Generic; using CIV.Ccs; using CIV.Interfaces; using Moq; namespace CIV.Test { public static class Common { /// <summary> /// Setup a mock process that can only do the given action. /// </summary> /// <returns>The mock process.</returns> /// <param name="action">Action.</param> public static CcsProcess SetupMockProcess(String action = "action") { return Mock.Of<CcsProcess>(p => p.GetTransitions() == new List<Transition> { SetupTransition(action) } ); } static Transition SetupTransition(String label) { return new Transition { Label = label, Process = Mock.Of<CcsProcess>() }; } } }
using System; using System.Collections.Generic; using CIV.Ccs; using CIV.Interfaces; using Moq; namespace CIV.Test { public static class Common { /// <summary> /// Setup a mock process that can only do the given action. /// </summary> /// <returns>The mock process.</returns> /// <param name="action">Action.</param> public static CcsProcess SetupMockProcess(String action = "action") { return Mock.Of<CcsProcess>(p => p.Transitions() == new List<Transition> { SetupTransition(action) } ); } static Transition SetupTransition(String label) { return new Transition { Label = label, Process = Mock.Of<CcsProcess>() }; } } }
mit
C#
aa4489a98f00250efedfc5023cf22cafbeceea0c
Use BenchmarkRunner
martincostello/project-euler
tests/ProjectEuler.Benchmarks/Program.cs
tests/ProjectEuler.Benchmarks/Program.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.Benchmarks { using BenchmarkDotNet.Running; /// <summary> /// A console application that runs performance benchmarks for the puzzles. This class cannot be inherited. /// </summary> internal static class Program { /// <summary> /// The main entry-point to the application. /// </summary> /// <param name="args">The arguments to the application.</param> internal static void Main(string[] args) => BenchmarkRunner.Run<PuzzleBenchmarks>(args: args); } }
// 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.Benchmarks { using BenchmarkDotNet.Running; /// <summary> /// A console application that runs performance benchmarks for the puzzles. This class cannot be inherited. /// </summary> internal static class Program { /// <summary> /// The main entry-point to the application. /// </summary> /// <param name="args">The arguments to the application.</param> internal static void Main(string[] args) { var switcher = BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly); if (args?.Length == 0) { switcher.RunAll(); } else { switcher.Run(args); } } } }
apache-2.0
C#
789006d97fc24883c32042151447d5102103523a
Update NeilFifteen.cs
planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell
src/Firehose.Web/Authors/NeilFifteen.cs
src/Firehose.Web/Authors/NeilFifteen.cs
using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel.Syndication; using System.Web; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class NeilFifteen : IAmACommunityMember { public string FirstName => "Neil"; public string LastName => "Fifteen"; public string ShortBioOrTagLine => "PowerShell, Whiskey, Buttons and Wires."; public string StateOrRegion => "Ashleworth, England"; public string EmailAddress => "neil@digitalfifteen.com"; public string TwitterHandle => "digitalfifteen"; public string GitHubHandle => "digitalfifteen"; public string GravatarHash => "0e3cb9812dc19014dfbb000a7953b764"; public GeoPosition Position => new GeoPosition(51.930364, -2.274356); public Uri WebSite => new Uri("https://digitalfifteen.com"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://digitalfifteen.co.uk/feed.xml"); } } public string FeedLanguageCode => "en"; } }
using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel.Syndication; using System.Web; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class NeilFifteen : IAmACommunityMember { public string FirstName => "Neil"; public string LastName => "Fifteen"; public string ShortBioOrTagLine => "My adventures found in PowerShell..."; public string StateOrRegion => "Cheltenham, England"; public string EmailAddress => "neil@digitalfifteen.com"; public string TwitterHandle => "neil_fifteen"; public string GitHubHandle => "neilfifteen"; public string GravatarHash => "68ffe557305106c5c399682b5c869cd7"; public GeoPosition Position => new GeoPosition(51.897991, -2.071310); public Uri WebSite => new Uri("https://digitalfifteen.com"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://digitalfifteen.co.uk/feed.xml"); } } public string FeedLanguageCode => "en"; } }
mit
C#
d9550fe606affedef1afba8df3ebc5925a4634fa
Drop unused "Attribute"
stormleoxia/xsp,stormleoxia/xsp,stormleoxia/xsp,murador/xsp,arthot/xsp,stormleoxia/xsp,arthot/xsp,murador/xsp,murador/xsp,arthot/xsp,murador/xsp,arthot/xsp
src/Mono.WebServer.Fpm/SocketPassing.cs
src/Mono.WebServer.Fpm/SocketPassing.cs
using System; using System.IO; using System.Net.Sockets; using System.Runtime.InteropServices; using Mono.Unix; namespace Mono.WebServer.Fpm { public static class SocketPassing { public static void SendTo (Socket connection, IntPtr passing) { send_fd (connection.Handle, passing); } public static Stream ReceiveFrom (Socket connection) { IntPtr fd; recv_fd (connection.Handle, out fd); return new UnixStream (fd.ToInt32 ()); } [DllImport ("fpm_helper")] static extern void send_fd (IntPtr sock, IntPtr fd); [DllImport ("fpm_helper")] static extern void recv_fd (IntPtr sock, out IntPtr fd); } }
using System; using System.IO; using System.Net.Sockets; using System.Runtime.InteropServices; using Mono.Unix; namespace Mono.WebServer.Fpm { public static class SocketPassing { public static void SendTo (Socket connection, IntPtr passing) { send_fd (connection.Handle, passing); } public static Stream ReceiveFrom (Socket connection) { IntPtr fd; recv_fd (connection.Handle, out fd); return new UnixStream (fd.ToInt32 ()); } [DllImportAttribute("fpm_helper")] static extern void send_fd(IntPtr sock, IntPtr fd); [DllImportAttribute("fpm_helper")] static extern void recv_fd(IntPtr sock, out IntPtr fd); } }
mit
C#
9000e50731c04d2ec227964bb3fa3bb6a22cf57b
Fix failing test. Replace company number with no information with one that has
LiberisLabs/CompaniesHouse.NET,kevbite/CompaniesHouse.NET
src/CompaniesHouse.IntegrationTests/Tests/CompanyFilingHistoryTests/CompanyFilingHistoryTestsValid.cs
src/CompaniesHouse.IntegrationTests/Tests/CompanyFilingHistoryTests/CompanyFilingHistoryTestsValid.cs
using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using CompaniesHouse.Response.CompanyFiling; using NUnit.Framework; namespace CompaniesHouse.IntegrationTests.Tests.CompanyFilingHistoryTests { [TestFixtureSource(nameof(TestCases))] public class CompanyFilingHistoryTestsValid : CompanyFilingHistoryTestBase { private readonly string _companyNumber; private List<FilingHistoryItem> _results; public CompanyFilingHistoryTestsValid(string companyNumber) { _companyNumber = companyNumber; } public static string[] TestCases() { return new[] { "03977902", // Google "00445790", // Tesco "00002065", // Lloyds Bank PLC "09965459", // Amazebytes "06768813", // TEST & COOL LTD, "00059337", "SC171417", "09018331" }; } protected override async Task When() { var page = 0; var size = 100; _results = new List<FilingHistoryItem>(); CompaniesHouseClientResponse<CompanyFilingHistory> result; do { result = await _client.GetCompanyFilingHistoryAsync(_companyNumber, page++ * size, size); _results.AddRange(result.Data.Items); } while (result.Data.Items.Any()); } [Test] public void ThenTheDataItemsAreNotEmpty() { Assert.That(_results, Is.Not.Empty); } } }
using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using CompaniesHouse.Response.CompanyFiling; using NUnit.Framework; namespace CompaniesHouse.IntegrationTests.Tests.CompanyFilingHistoryTests { [TestFixtureSource(nameof(TestCases))] public class CompanyFilingHistoryTestsValid : CompanyFilingHistoryTestBase { private readonly string _companyNumber; private List<FilingHistoryItem> _results; public CompanyFilingHistoryTestsValid(string companyNumber) { _companyNumber = companyNumber; } public static string[] TestCases() { return new[] { "03977902", // Google "00445790", // Tesco "00002065", // Lloyds Bank PLC "09965459", // Amazebytes "06768813", // TEST & COOL LTD, "00059337", "06484911", "09018331" }; } protected override async Task When() { var page = 0; var size = 100; _results = new List<FilingHistoryItem>(); CompaniesHouseClientResponse<CompanyFilingHistory> result; do { result = await _client.GetCompanyFilingHistoryAsync(_companyNumber, page++ * size, size); _results.AddRange(result.Data.Items); } while (result.Data.Items.Any()); } [Test] public void ThenTheDataItemsAreNotEmpty() { Assert.That(_results, Is.Not.Empty); } } }
mit
C#
12fe58f8dde0ec2da1903a1e039ddfd0a9b92f2e
add Debug to request model
SnapMD/connectedcare-sdk,dhawalharsora/connectedcare-sdk
SnapMD.VirtualCare.ApiModels/Rules/RegistrationAvailabilityRequest.cs
SnapMD.VirtualCare.ApiModels/Rules/RegistrationAvailabilityRequest.cs
namespace SnapMD.VirtualCare.ApiModels.Rules { /// <summary> /// Request model for RegistrationAvailability /// </summary> public class RegistrationAvailabilityRequest { /// <summary> /// Gets or sets the country. /// </summary> /// <value> /// The country. /// </value> public string Country { get; set; } /// <summary> /// Gets or sets the state. /// </summary> /// <value> /// The state. /// </value> public string State { get; set; } /// <summary> /// Gets or sets the postal code. /// </summary> /// <value> /// The postal code. /// </value> public string PostalCode { get; set; } /// <summary> /// Gets or sets the geo location. /// </summary> /// <value> /// The geo location. /// </value> public GeoCoordinate GeoLocation { get; set; } /// <summary> /// Gets or sets the organization identifier. /// </summary> /// <value> /// The organization identifier. /// </value> public int? OrganizationId { get; set; } /// <summary> /// Gets or sets the location identifier. /// </summary> /// <value> /// The location identifier. /// </value> public int? LocationId { get; set; } /// <summary> /// Gets or sets a value indicating whether this <see cref="RegistrationAvailabilityRequest"/> is debug. /// </summary> /// <value> /// <c>true</c> if debug; otherwise, <c>false</c>. /// </value> public bool Debug { get; set; } } }
namespace SnapMD.VirtualCare.ApiModels.Rules { /// <summary> /// Request model for RegistrationAvailability /// </summary> public class RegistrationAvailabilityRequest { /// <summary> /// Gets or sets the country. /// </summary> /// <value> /// The country. /// </value> public string Country { get; set; } /// <summary> /// Gets or sets the state. /// </summary> /// <value> /// The state. /// </value> public string State { get; set; } /// <summary> /// Gets or sets the postal code. /// </summary> /// <value> /// The postal code. /// </value> public string PostalCode { get; set; } /// <summary> /// Gets or sets the geo location. /// </summary> /// <value> /// The geo location. /// </value> public GeoCoordinate GeoLocation { get; set; } /// <summary> /// Gets or sets the organization identifier. /// </summary> /// <value> /// The organization identifier. /// </value> public int? OrganizationId { get; set; } /// <summary> /// Gets or sets the location identifier. /// </summary> /// <value> /// The location identifier. /// </value> public int? LocationId { get; set; } } }
apache-2.0
C#
9109758ed0ed1586900fb0b55790579a781e441b
Update EllipseDrawNode.cs
wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D
src/Core2D/Modules/Renderer/SkiaSharp/Nodes/EllipseDrawNode.cs
src/Core2D/Modules/Renderer/SkiaSharp/Nodes/EllipseDrawNode.cs
#nullable enable using Core2D.Model.Renderer; using Core2D.Model.Renderer.Nodes; using Core2D.ViewModels.Shapes; using Core2D.ViewModels.Style; using SkiaSharp; using Core2D.Spatial; namespace Core2D.Modules.Renderer.SkiaSharp.Nodes; internal class EllipseDrawNode : DrawNode, IEllipseDrawNode { public EllipseShapeViewModel Ellipse { get; set; } public SKRect Rect { get; set; } public EllipseDrawNode(EllipseShapeViewModel ellipse, ShapeStyleViewModel style) { Style = style; Ellipse = ellipse; UpdateGeometry(); } public sealed override void UpdateGeometry() { ScaleThickness = Ellipse.State.HasFlag(ShapeStateFlags.Thickness); ScaleSize = Ellipse.State.HasFlag(ShapeStateFlags.Size); if (Ellipse.TopLeft is { } && Ellipse.BottomRight is { }) { var rect2 = Rect2.FromPoints(Ellipse.TopLeft.X, Ellipse.TopLeft.Y, Ellipse.BottomRight.X, Ellipse.BottomRight.Y); Rect = SKRect.Create((float)rect2.X, (float)rect2.Y, (float)rect2.Width, (float)rect2.Height); Center = new SKPoint(Rect.MidX, Rect.MidY); } else { Rect = SKRect.Empty; Center = SKPoint.Empty; } } public override void OnDraw(object? dc, double zoom) { if (dc is not SKCanvas canvas) { return; } if (Ellipse.IsFilled) { canvas.DrawOval(Rect, Fill); } if (Ellipse.IsStroked) { canvas.DrawOval(Rect, Stroke); } } }
#nullable enable using Core2D.Model.Renderer; using Core2D.Model.Renderer.Nodes; using Core2D.ViewModels.Shapes; using Core2D.ViewModels.Style; using SkiaSharp; using Core2D.Spatial; namespace Core2D.Modules.Renderer.SkiaSharp.Nodes; internal class EllipseDrawNode : DrawNode, IEllipseDrawNode { public EllipseShapeViewModel Ellipse { get; set; } public SKRect Rect { get; set; } public EllipseDrawNode(EllipseShapeViewModel ellipse, ShapeStyleViewModel style) : base() { Style = style; Ellipse = ellipse; UpdateGeometry(); } public sealed override void UpdateGeometry() { ScaleThickness = Ellipse.State.HasFlag(ShapeStateFlags.Thickness); ScaleSize = Ellipse.State.HasFlag(ShapeStateFlags.Size); if (Ellipse.TopLeft is { } && Ellipse.BottomRight is { }) { var rect2 = Rect2.FromPoints(Ellipse.TopLeft.X, Ellipse.TopLeft.Y, Ellipse.BottomRight.X, Ellipse.BottomRight.Y); Rect = SKRect.Create((float)rect2.X, (float)rect2.Y, (float)rect2.Width, (float)rect2.Height); Center = new SKPoint(Rect.MidX, Rect.MidY); } else { Rect = SKRect.Empty; Center = SKPoint.Empty; } } public override void OnDraw(object? dc, double zoom) { if (dc is not SKCanvas canvas) { return; } if (Ellipse.IsFilled) { canvas.DrawOval(Rect, Fill); } if (Ellipse.IsStroked) { canvas.DrawOval(Rect, Stroke); } } }
mit
C#
1273be73d1f5d5059d3048e5f36cb2b2ed758c85
Fix incorrect row type.
paulyoder/LinqToExcel
src/LinqToExcel.Tests/PersistentConnection_IntegrationTests.cs
src/LinqToExcel.Tests/PersistentConnection_IntegrationTests.cs
using System; using System.IO; using System.Linq; using NUnit.Framework; namespace LinqToExcel.Tests { [Author("Andrew Corkery", "andrew.corkery@gmail.com")] [Category("Integration")] [TestFixture] public class PersistentConnection_IntegrationTests { private IExcelQueryFactory _factory; [OneTimeSetUp] public void fs() { string testDirectory = AppDomain.CurrentDomain.BaseDirectory; string excelFilesDirectory = Path.Combine(testDirectory, "ExcelFiles"); string excelFileName = Path.Combine(excelFilesDirectory, "Companies.xlsm"); _factory = new ExcelQueryFactory(excelFileName, new LogManagerFactory()); _factory.UsePersistentConnection = true; } [Test] public void WorksheetRangeNoHeader_returns_7_companies() { var companies = from c in _factory.WorksheetRangeNoHeader("A2", "D8", "Sheet1") select c; Assert.AreEqual(7, companies.Count()); } [Test] public void WorksheetRangeNoHeader_can_query_sheet_500_times_on_same_connection() { IQueryable<RowNoHeader> rows = null; int totalRows = 0; for (int i = 0; i < 500; i++) { rows = from cm in _factory.WorksheetRangeNoHeader("A2", "D8", "Sheet1") select cm; totalRows += rows.Count(); } Assert.AreEqual((500*7), totalRows); } [OneTimeTearDown] public void td() { //dispose of the factory (and persistent connection) _factory.Dispose(); } } }
using System; using System.IO; using System.Linq; using NUnit.Framework; namespace LinqToExcel.Tests { [Author("Andrew Corkery", "andrew.corkery@gmail.com")] [Category("Integration")] [TestFixture] public class PersistentConnection_IntegrationTests { private IExcelQueryFactory _factory; [OneTimeSetUp] public void fs() { string testDirectory = AppDomain.CurrentDomain.BaseDirectory; string excelFilesDirectory = Path.Combine(testDirectory, "ExcelFiles"); string excelFileName = Path.Combine(excelFilesDirectory, "Companies.xlsm"); _factory = new ExcelQueryFactory(excelFileName, new LogManagerFactory()); _factory.UsePersistentConnection = true; } [Test] public void WorksheetRangeNoHeader_returns_7_companies() { var companies = from c in _factory.WorksheetRangeNoHeader("A2", "D8", "Sheet1") select c; Assert.AreEqual(7, companies.Count()); } [Test] public void WorksheetRangeNoHeader_can_query_sheet_500_times_on_same_connection() { IQueryable<Row> rows = null; int totalRows = 0; for (int i = 0; i < 500; i++) { rows = from cm in _factory.WorksheetRange("A2", "D8", "Sheet1") select cm; totalRows += rows.Count(); } Assert.AreEqual((500*7), totalRows); } [OneTimeTearDown] public void td() { //dispose of the factory (and persistent connection) _factory.Dispose(); } } }
mit
C#
0a550a23091095e98b778ef09987043f8ccc1ff9
Add Link method to compare string with wildcards
witoong623/TirkxDownloader,witoong623/TirkxDownloader
Framework/Extension.cs
Framework/Extension.cs
using System; using System.Collections.Generic; using System.Net; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; namespace TirkxDownloader.Framework { public static class Extension { public static async Task<HttpWebResponse> GetResponseAsync(this HttpWebRequest request, CancellationToken ct) { using (ct.Register(() => request.Abort(), useSynchronizationContext: false)) { try { var response = await request.GetResponseAsync(); ct.ThrowIfCancellationRequested(); return (HttpWebResponse)response; } catch (WebException webEx) { if (ct.IsCancellationRequested) { throw new OperationCanceledException(webEx.Message, webEx, ct); } throw; } } } public static T[] Dequeue<T>(this Queue<T> queue, int count) { T[] list = new T[count]; for (int i = 0; i < count; i++) { list[i] = queue.Dequeue(); } return list; } /// <summary> /// Compares the string against a given pattern. /// </summary> /// <param name="str">The string.</param> /// <param name="pattern">The pattern to match, where "*" means any sequence of characters, and "?" means any single character.</param> /// <returns><c>true</c> if the string matches the given pattern; otherwise <c>false</c>.</returns> public static bool Like(this string str, string pattern) { return new Regex( "^" + Regex.Escape(pattern).Replace(@"\*", ".*").Replace(@"\?", ".") + "$", RegexOptions.IgnoreCase | RegexOptions.Singleline ).IsMatch(str); } } }
using System; using System.Collections.Generic; using System.Net; using System.Threading; using System.Threading.Tasks; namespace TirkxDownloader.Framework { public static class Extension { public static async Task<HttpWebResponse> GetResponseAsync(this HttpWebRequest request, CancellationToken ct) { using (ct.Register(() => request.Abort(), useSynchronizationContext: false)) { try { var response = await request.GetResponseAsync(); ct.ThrowIfCancellationRequested(); return (HttpWebResponse)response; } catch (WebException webEx) { if (ct.IsCancellationRequested) { throw new OperationCanceledException(webEx.Message, webEx, ct); } throw; } } } public static T[] Dequeue<T>(this Queue<T> queue, int count) { T[] list = new T[count]; for (int i = 0; i < count; i++) { list[i] = queue.Dequeue(); } return list; } } }
mit
C#
d37f9a16178c118074b88ee1facf04645d67d853
Modify OperationsClientPartial to reflect codegen changes
chrisdunelm/google-cloud-dotnet,evildour/google-cloud-dotnet,benwulfe/google-cloud-dotnet,jskeet/google-cloud-dotnet,iantalarico/google-cloud-dotnet,googleapis/google-cloud-dotnet,evildour/google-cloud-dotnet,jskeet/google-cloud-dotnet,iantalarico/google-cloud-dotnet,chrisdunelm/google-cloud-dotnet,benwulfe/google-cloud-dotnet,evildour/google-cloud-dotnet,benwulfe/google-cloud-dotnet,googleapis/google-cloud-dotnet,googleapis/google-cloud-dotnet,jskeet/google-cloud-dotnet,jskeet/google-cloud-dotnet,jskeet/gcloud-dotnet,iantalarico/google-cloud-dotnet,jskeet/google-cloud-dotnet,chrisdunelm/gcloud-dotnet,chrisdunelm/google-cloud-dotnet
apis/Google.LongRunning/Google.LongRunning/OperationsClientPartial.cs
apis/Google.LongRunning/Google.LongRunning/OperationsClientPartial.cs
// Copyright 2016 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using Google.Api.Gax; using Google.Api.Gax.Grpc; using System; namespace Google.LongRunning { public partial class OperationsClient { /// <summary> /// The clock used for timeouts, retries and polling. /// </summary> public virtual IClock Clock { get { throw new NotImplementedException(); } } /// <summary> /// The scheduler used for timeouts, retries and polling. /// </summary> public virtual IScheduler Scheduler { get { throw new NotImplementedException(); } } /// <summary> /// Return the <see cref="CallSettings"/> that would be used by a call to /// <see cref="GetOperation(GetOperationRequest, CallSettings)"/>, using the base /// settings of this client and the specified per-call overrides. /// </summary> /// <remarks> /// This method is used when polling, to determine the appropriate timeout and cancellation /// token to use for each call. /// </remarks> /// <param name="callSettings">The per-call override, if any.</param> /// <returns>The effective call settings for a GetOperation RPC.</returns> protected internal virtual CallSettings GetEffectiveCallSettingsForGetOperation(CallSettings callSettings) { throw new NotImplementedException(); } } public partial class OperationsClientImpl { private IClock _clock; private IScheduler _scheduler; /// <inheritdoc /> public override IClock Clock => _clock; /// <inheritdoc /> public override IScheduler Scheduler => _scheduler; // Note: if we ever have a partial Modify_GetOperationRequest call body, // we'd want to call it here, but cope with not providing a request. /// <inheritdoc /> protected internal override CallSettings GetEffectiveCallSettingsForGetOperation(CallSettings callSettings) => _callGetOperation.BaseCallSettings.MergedWith(callSettings); partial void OnConstruction(Operations.OperationsClient grpcClient, OperationsSettings effectiveSettings, ClientHelper clientHelper) { _clock = clientHelper.Clock; _scheduler = clientHelper.Scheduler; } } }
// Copyright 2016 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using Google.Api.Gax; using Google.Api.Gax.Grpc; using System; namespace Google.LongRunning { public partial class OperationsClient { /// <summary> /// The clock used for timeouts, retries and polling. /// </summary> public virtual IClock Clock { get { throw new NotImplementedException(); } } /// <summary> /// The scheduler used for timeouts, retries and polling. /// </summary> public virtual IScheduler Scheduler { get { throw new NotImplementedException(); } } /// <summary> /// Return the <see cref="CallSettings"/> that would be used by a call to /// <see cref="GetOperation(GetOperationRequest, CallSettings)"/>, using the base /// settings of this client and the specified per-call overrides. /// </summary> /// <remarks> /// This method is used when polling, to determine the appropriate timeout and cancellation /// token to use for each call. /// </remarks> /// <param name="callSettings">The per-call override, if any.</param> /// <returns>The effective call settings for a GetOperation RPC.</returns> protected internal virtual CallSettings GetEffectiveCallSettingsForGetOperation(CallSettings callSettings) { throw new NotImplementedException(); } } public partial class OperationsClientImpl { /// <inheritdoc /> public override IClock Clock => _clientHelper.Clock; /// <inheritdoc /> public override IScheduler Scheduler => _clientHelper.Scheduler; // Note: if we ever have a partial Modify_GetOperationRequest call body, // we'd want to call it here, but cope with not providing a request. /// <inheritdoc /> protected internal override CallSettings GetEffectiveCallSettingsForGetOperation(CallSettings callSettings) => _callGetOperation.BaseCallSettings.MergedWith(callSettings); } }
apache-2.0
C#
d9ca36843489e3035a08b47aac1e7563d20e8ed3
Build fix.
Squidex/squidex,Squidex/squidex,Squidex/squidex,Squidex/squidex,Squidex/squidex
backend/tests/Squidex.Infrastructure.Tests/Orleans/AsyncLocalTests.cs
backend/tests/Squidex.Infrastructure.Tests/Orleans/AsyncLocalTests.cs
// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschraenkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using System.Threading; using System.Threading.Tasks; using Orleans; using Orleans.TestingHost; using Xunit; namespace Squidex.Infrastructure.Orleans { [Trait("Category", "Dependencies")] public class AsyncLocalTests { public interface IAsyncLocalGrain : IGrainWithStringKey { public Task<int> GetValueAsync(); } public class AsyncLocalGrain : Grain, IAsyncLocalGrain { private readonly AsyncLocal<int> temp = new AsyncLocal<int>(); public Task<int> GetValueAsync() { temp.Value++; return Task.FromResult(temp.Value); } } [Fact] public async Task Should_use_async_local() { var cluster = new TestClusterBuilder(1) .Build(); await cluster.DeployAsync(); try { var grain = cluster.GrainFactory.GetGrain<IAsyncLocalGrain>(SingleGrain.Id); var result1 = await grain.GetValueAsync(); var result2 = await grain.GetValueAsync(); await cluster.KillSiloAsync(cluster.Silos[0]); await cluster.StartAdditionalSiloAsync(); var result3 = await grain.GetValueAsync(); Assert.Equal(1, result1); Assert.Equal(1, result2); Assert.Equal(1, result3); } finally { await Task.WhenAny(Task.Delay(2000), cluster.StopAllSilosAsync()); } } } }
// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschraenkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using System.Threading; using System.Threading.Tasks; using Orleans; using Orleans.TestingHost; using Xunit; namespace Squidex.Infrastructure.Orleans { [Trait("Category", "Dependencies")] public class AsyncLocalTests { public interface IAsyncLocalGrain : IGrainWithStringKey { public Task<int> GetValueAsync(); } public class AsyncLocalGrain : Grain, IAsyncLocalGrain { private readonly AsyncLocal<int> temp = new AsyncLocal<int>(); public Task<int> GetValueAsync() { temp.Value++; return Task.FromResult(temp.Value); } } [Fact] public async Task Should_use_async_local() { var cluster = new TestClusterBuilder(1) .Build(); await cluster.DeployAsync(); try { var grain = cluster.GrainFactory.GetGrain<IAsyncLocalGrain>(SingleGrain.Id); var result1 = await grain.GetValueAsync(); var result2 = await grain.GetValueAsync(); await cluster.KillSiloAsync(cluster.Silos[0]); await cluster.StartAdditionalSiloAsync(); var result3 = await grain.GetValueAsync(); Assert.Equal(1, result1); Assert.Equal(1, result2); Assert.Equal(1, result3); finally { await Task.WhenAny(Task.Delay(2000), cluster.StopAllSilosAsync()); } } } }
mit
C#
9efd12da93d7a47050715fe7859d86ac6559ba5a
Fix unit tests on Unix
DustinCampbell/omnisharp-roslyn,OmniSharp/omnisharp-roslyn,OmniSharp/omnisharp-roslyn,DustinCampbell/omnisharp-roslyn
tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs
tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs
using System.IO; using Microsoft.Extensions.Logging; using OmniSharp.MSBuild.ProjectFile; using TestUtility; using Xunit; using Xunit.Abstractions; namespace OmniSharp.MSBuild.Tests { public class ProjectFileInfoTests { private readonly TestAssets _testAssets; private readonly ILogger _logger; public ProjectFileInfoTests(ITestOutputHelper output) { this._testAssets = TestAssets.Instance; this._logger = new TestLogger(output); MSBuildEnvironment.Initialize(this._logger); } [Fact] public void HelloWorld_has_correct_property_values() { var projectFolder = _testAssets.GetTestProjectFolder("HelloWorld"); var projectFilePath = Path.Combine(projectFolder, "HelloWorld.csproj"); var projectFileInfo = ProjectFileInfo.Create(projectFilePath, projectFolder, this._logger); Assert.NotNull(projectFileInfo); Assert.Equal(projectFilePath, projectFileInfo.ProjectFilePath); Assert.Equal(1, projectFileInfo.TargetFrameworks.Count); Assert.Equal("netcoreapp1.0", projectFileInfo.TargetFrameworks[0]); Assert.Equal("bin/Debug/netcoreapp1.0/", projectFileInfo.OutputPath.Replace('\\', '/')); } [Fact] public void NetStandardAndNetCoreApp_has_correct_property_values() { var projectFolder = _testAssets.GetTestProjectFolder("NetStandardAndNetCoreApp"); var projectFilePath = Path.Combine(projectFolder, "NetStandardAndNetCoreApp.csproj"); var projectFileInfo = ProjectFileInfo.Create(projectFilePath, projectFolder, this._logger); Assert.NotNull(projectFileInfo); Assert.Equal(projectFilePath, projectFileInfo.ProjectFilePath); Assert.Equal(2, projectFileInfo.TargetFrameworks.Count); Assert.Equal("netcoreapp1.0", projectFileInfo.TargetFrameworks[0]); Assert.Equal("netstandard1.5", projectFileInfo.TargetFrameworks[1]); Assert.Equal(@"bin/Debug/netcoreapp1.0/", projectFileInfo.OutputPath.Replace('\\', '/')); } } }
using System.IO; using Microsoft.Extensions.Logging; using OmniSharp.MSBuild.ProjectFile; using TestUtility; using Xunit; using Xunit.Abstractions; namespace OmniSharp.MSBuild.Tests { public class ProjectFileInfoTests { private readonly TestAssets _testAssets; private readonly ILogger _logger; public ProjectFileInfoTests(ITestOutputHelper output) { this._testAssets = TestAssets.Instance; this._logger = new TestLogger(output); MSBuildEnvironment.Initialize(this._logger); } [Fact] public void HelloWorld_has_correct_property_values() { var projectFolder = _testAssets.GetTestProjectFolder("HelloWorld"); var projectFilePath = Path.Combine(projectFolder, "HelloWorld.csproj"); var projectFileInfo = ProjectFileInfo.Create(projectFilePath, projectFolder, this._logger); Assert.NotNull(projectFileInfo); Assert.Equal(projectFilePath, projectFileInfo.ProjectFilePath); Assert.Equal(1, projectFileInfo.TargetFrameworks.Count); Assert.Equal("netcoreapp1.0", projectFileInfo.TargetFrameworks[0]); Assert.Equal(@"bin\Debug\netcoreapp1.0\", projectFileInfo.OutputPath); } [Fact] public void NetStandardAndNetCoreApp_has_correct_property_values() { var projectFolder = _testAssets.GetTestProjectFolder("NetStandardAndNetCoreApp"); var projectFilePath = Path.Combine(projectFolder, "NetStandardAndNetCoreApp.csproj"); var projectFileInfo = ProjectFileInfo.Create(projectFilePath, projectFolder, this._logger); Assert.NotNull(projectFileInfo); Assert.Equal(projectFilePath, projectFileInfo.ProjectFilePath); Assert.Equal(2, projectFileInfo.TargetFrameworks.Count); Assert.Equal("netcoreapp1.0", projectFileInfo.TargetFrameworks[0]); Assert.Equal("netstandard1.5", projectFileInfo.TargetFrameworks[1]); Assert.Equal(@"bin\Debug\netcoreapp1.0\", projectFileInfo.OutputPath); } } }
mit
C#
ae1436ad3b314432923b3e18048d99ce27338681
Add parameter for a REQUEST type API Gateway Custom Authorizer
thedevopsmachine/aws-lambda-dotnet,thedevopsmachine/aws-lambda-dotnet,thedevopsmachine/aws-lambda-dotnet,thedevopsmachine/aws-lambda-dotnet
Libraries/src/Amazon.Lambda.APIGatewayEvents/APIGatewayCustomAuthorizerRequest.cs
Libraries/src/Amazon.Lambda.APIGatewayEvents/APIGatewayCustomAuthorizerRequest.cs
using System.Collections.Generic; namespace Amazon.Lambda.APIGatewayEvents { /// <summary> /// For requests coming in to a custom API Gateway authorizer function. /// </summary> public class APIGatewayCustomAuthorizerRequest { /// <summary> /// Gets or sets the 'type' property. /// </summary> public string Type { get; set; } /// <summary> /// Gets or sets the 'authorizationToken' property. /// </summary> public string AuthorizationToken { get; set; } /// <summary> /// Gets or sets the 'methodArn' property. /// </summary> public string MethodArn { get; set; } /// <summary> /// The url path for the caller. For Request type API Gateway Custom Authorizer only. /// </summary> public string Path { get; set; } /// <summary> /// The HTTP method used. For Request type API Gateway Custom Authorizer only. /// </summary> public string HttpMethod { get; set; } /// <summary> /// The headers sent with the request. For Request type API Gateway Custom Authorizer only. /// </summary> public IDictionary<string, string> Headers {get;set;} /// <summary> /// The query string parameters that were part of the request. For Request type API Gateway Custom Authorizer only. /// </summary> public IDictionary<string, string> QueryStringParameters { get; set; } /// <summary> /// The path parameters that were part of the request. For Request type API Gateway Custom Authorizer only. /// </summary> public IDictionary<string, string> PathParameters { get; set; } /// <summary> /// The stage variables defined for the stage in API Gateway. For Request type API Gateway Custom Authorizer only. /// </summary> public IDictionary<string, string> StageVariables { get; set; } /// <summary> /// The request context for the request. For Request type API Gateway Custom Authorizer only. /// </summary> public APIGatewayProxyRequest.ProxyRequestContext RequestContext { get; set; } } }
namespace Amazon.Lambda.APIGatewayEvents { /// <summary> /// For requests coming in to a custom API Gateway authorizer function. /// </summary> public class APIGatewayCustomAuthorizerRequest { /// <summary> /// Gets or sets the 'type' property. /// </summary> public string Type { get; set; } /// <summary> /// Gets or sets the 'authorizationToken' property. /// </summary> public string AuthorizationToken { get; set; } /// <summary> /// Gets or sets the 'methodArn' property. /// </summary> public string MethodArn { get; set; } } }
apache-2.0
C#
aeb33f4a2d99880721b5007e61f140635da7f939
fix misleading variable name
explunit/saml-samples
saml-samples/Program.cs
saml-samples/Program.cs
using System; using System.IdentityModel.Tokens; using System.IO; using System.Security.Cryptography.X509Certificates; namespace saml_samples { class Program { static void Main( string[] args ) { var response = @"<saml2p:Response xmlns:saml2p=""urn:oasis:names:tc:SAML:2.0:protocol"" xmlns:saml2=""urn:oasis:names:tc:SAML:2.0:assertion"" ID = ""_{0}"" Version=""2.0"" IssueInstant=""2015-01-01T00:00:00Z""> <saml2:Issuer>https://idp.example.com</saml2:Issuer> <saml2p:Status> <saml2p:StatusCode Value=""urn:oasis:names:tc:SAML:2.0:status:Success"" /> </saml2p:Status> {1} </saml2p:Response>"; var assertion = new Saml2Assertion( new Saml2NameIdentifier( "https://idp.example.com" ) ); assertion.Subject = new Saml2Subject( new Saml2NameIdentifier( "SomeUser" ) ); assertion.Subject.SubjectConfirmations.Add( new Saml2SubjectConfirmation( new Uri( "urn:oasis:names:tc:SAML:2.0:cm:bearer" ) ) ); assertion.Conditions = new Saml2Conditions { NotOnOrAfter = new DateTime( 2100, 1, 1 ) }; assertion.Statements.Add( new Saml2AttributeStatement( new Saml2Attribute( "FooID", "12345" ) ) ); var signingCert = new X509Certificate2( @"C:\Dev\STS.pfx", "somepassword" ); var assertionHelper = new AssertionHelper( signingCert ); var signedAssertion = assertionHelper.SignAssertion( assertion ); var fullResponse = string.Format( response, Guid.NewGuid().ToString(), signedAssertion ); File.WriteAllText( @"C:\dev\samlResponse.xml", fullResponse ); } } }
using System; using System.IdentityModel.Tokens; using System.IO; using System.Security.Cryptography.X509Certificates; namespace saml_samples { class Program { static void Main( string[] args ) { var response = @"<saml2p:Response xmlns:saml2p=""urn:oasis:names:tc:SAML:2.0:protocol"" xmlns:saml2=""urn:oasis:names:tc:SAML:2.0:assertion"" ID = ""_{0}"" Version=""2.0"" IssueInstant=""2015-01-01T00:00:00Z""> <saml2:Issuer>https://idp.example.com</saml2:Issuer> <saml2p:Status> <saml2p:StatusCode Value=""urn:oasis:names:tc:SAML:2.0:status:Success"" /> </saml2p:Status> {1} </saml2p:Response>"; var assertion = new Saml2Assertion( new Saml2NameIdentifier( "https://idp.example.com" ) ); assertion.Subject = new Saml2Subject( new Saml2NameIdentifier( "SomeUser" ) ); assertion.Subject.SubjectConfirmations.Add( new Saml2SubjectConfirmation( new Uri( "urn:oasis:names:tc:SAML:2.0:cm:bearer" ) ) ); assertion.Conditions = new Saml2Conditions { NotOnOrAfter = new DateTime( 2100, 1, 1 ) }; assertion.Statements.Add( new Saml2AttributeStatement( new Saml2Attribute( "FooID", "12345" ) ) ); var signingCert = new X509Certificate2( @"C:\Dev\STS.pfx", "somepassword" ); var assertionHelper = new AssertionHelper( signingCert ); var encryptedAssertion = assertionHelper.SignAssertion( assertion ); var fullResponse = string.Format( response, Guid.NewGuid().ToString(), encryptedAssertion ); File.WriteAllText( @"C:\dev\samlResponse.xml", fullResponse ); } } }
mit
C#
ae442ecb3fa52e58001acbfe481fe2e5c8841258
Update file version to 2.2.1.5
JKennedy24/Xamarin.Forms.GoogleMaps,JKennedy24/Xamarin.Forms.GoogleMaps,amay077/Xamarin.Forms.GoogleMaps
Xamarin.Forms.GoogleMaps/Xamarin.Forms.GoogleMaps/Internals/ProductInformation.cs
Xamarin.Forms.GoogleMaps/Xamarin.Forms.GoogleMaps/Internals/ProductInformation.cs
using System; namespace Xamarin.Forms.GoogleMaps.Internals { internal class ProductInformation { public const string Author = "amay077"; public const string Name = "Xamarin.Forms.GoogleMaps"; public const string Copyright = "Copyright © amay077. 2016 - 2017"; public const string Trademark = ""; public const string Version = "2.2.1.5"; } }
using System; namespace Xamarin.Forms.GoogleMaps.Internals { internal class ProductInformation { public const string Author = "amay077"; public const string Name = "Xamarin.Forms.GoogleMaps"; public const string Copyright = "Copyright © amay077. 2016 - 2017"; public const string Trademark = ""; public const string Version = "2.2.1.4"; } }
mit
C#
61778232d8b76436458a87cd60a18d2443159d6d
Rewrite inline comment
2yangk23/osu,NeoAdonis/osu,ppy/osu,ppy/osu,UselessToucan/osu,smoogipoo/osu,peppy/osu,EVAST9919/osu,smoogipoo/osu,smoogipooo/osu,peppy/osu,EVAST9919/osu,johnneijzen/osu,UselessToucan/osu,2yangk23/osu,peppy/osu-new,NeoAdonis/osu,johnneijzen/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,UselessToucan/osu,peppy/osu
osu.Game/Skinning/LegacyBeatmapSkin.cs
osu.Game/Skinning/LegacyBeatmapSkin.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.Audio; using osu.Framework.IO.Stores; using osu.Game.Beatmaps; namespace osu.Game.Skinning { public class LegacyBeatmapSkin : LegacySkin { // Disallow default colours fallback on beatmap skins to allow using parent skin combo colours. (via SkinProvidingContainer) protected override bool AllowDefaultColoursFallback => false; public LegacyBeatmapSkin(BeatmapInfo beatmap, IResourceStore<byte[]> storage, AudioManager audioManager) : base(createSkinInfo(beatmap), new LegacySkinResourceStore<BeatmapSetFileInfo>(beatmap.BeatmapSet, storage), audioManager, beatmap.Path) { } private static SkinInfo createSkinInfo(BeatmapInfo beatmap) => new SkinInfo { Name = beatmap.ToString(), Creator = beatmap.Metadata.Author.ToString() }; } }
// 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.Audio; using osu.Framework.IO.Stores; using osu.Game.Beatmaps; namespace osu.Game.Skinning { public class LegacyBeatmapSkin : LegacySkin { // Null should be returned in the case of no colours provided to fallback into current skin's colours. protected override bool AllowDefaultColoursFallback => false; public LegacyBeatmapSkin(BeatmapInfo beatmap, IResourceStore<byte[]> storage, AudioManager audioManager) : base(createSkinInfo(beatmap), new LegacySkinResourceStore<BeatmapSetFileInfo>(beatmap.BeatmapSet, storage), audioManager, beatmap.Path) { } private static SkinInfo createSkinInfo(BeatmapInfo beatmap) => new SkinInfo { Name = beatmap.ToString(), Creator = beatmap.Metadata.Author.ToString() }; } }
mit
C#
c34465fd5f7ee63992bd3c9726ebc716fc6f623f
Fix wrong variable names
insthync/LiteNetLibManager,insthync/LiteNetLibManager
Scripts/Transports/MixTransport/MixTransportFactory.cs
Scripts/Transports/MixTransport/MixTransportFactory.cs
using UnityEngine; namespace LiteNetLibManager { public class MixTransportFactory : BaseTransportFactory { public override bool CanUseWithWebGL { get { return true; } } public string connectKey = "SampleConnectKey"; public int webSocketPortOffset = 100; public bool webSocketSecure = false; public string webSocketCertificateFilePath = string.Empty; public string webSocketCertificatePassword = string.Empty; [Range(1, 64)] public byte clientDataChannelsCount = 16; [Range(1, 64)] public byte serverDataChannelsCount = 16; public override ITransport Build() { return new MixTransport(connectKey, webSocketPortOffset, webSocketSecure, webSocketCertificateFilePath, webSocketCertificatePassword, clientDataChannelsCount, serverDataChannelsCount); } } }
using UnityEngine; namespace LiteNetLibManager { public class MixTransportFactory : BaseTransportFactory { public override bool CanUseWithWebGL { get { return true; } } public string connectKey = "SampleConnectKey"; public int webSocketPortOffset = 100; public bool webScoketSecure = false; public string webScoketCertificateFilePath = string.Empty; public string webScoketCertificatePassword = string.Empty; [Range(1, 64)] public byte clientDataChannelsCount = 16; [Range(1, 64)] public byte serverDataChannelsCount = 16; public override ITransport Build() { return new MixTransport(connectKey, webSocketPortOffset, webScoketSecure, webScoketCertificateFilePath, webScoketCertificatePassword, clientDataChannelsCount, serverDataChannelsCount); } } }
mit
C#
2cb49e60ccd3e07ca65f086cb92cace6d643b7d8
add ThemeYearCount indexes
zmira/abremir.AllMyBricks
abremir.AllMyBricks.Data/Services/RepositoryService.cs
abremir.AllMyBricks.Data/Services/RepositoryService.cs
using abremir.AllMyBricks.Data.Configuration; using abremir.AllMyBricks.Data.Interfaces; using abremir.AllMyBricks.Data.Models; using abremir.AllMyBricks.Providers; using LiteDB; namespace abremir.AllMyBricks.Data.Services { public class RepositoryService : IRepositoryService { private readonly IFilePathProvider _filePathProvider; public RepositoryService(IFilePathProvider filePathProvider) { _filePathProvider = filePathProvider; } public LiteRepository GetRepository() { var liteRepository = new LiteRepository(_filePathProvider.GetLocalPathToFile(Constants.AllMyBricksDbFile)); SetupIndexes(liteRepository.Engine); return liteRepository; } public static void SetupIndexes(LiteEngine liteEngine) { if (liteEngine.UserVersion == 0) { liteEngine.EnsureIndex(nameof(Theme), "YearFrom"); liteEngine.EnsureIndex(nameof(Theme), "YearTo"); liteEngine.EnsureIndex(nameof(Subtheme), "YearFrom"); liteEngine.EnsureIndex(nameof(Subtheme), "YearTo"); liteEngine.EnsureIndex(nameof(Subtheme), "Theme.Name"); liteEngine.EnsureIndex(nameof(ThemeYearCount), "Theme.Name"); liteEngine.EnsureIndex(nameof(ThemeYearCount), "Year"); liteEngine.UserVersion = 1; } } } }
using abremir.AllMyBricks.Data.Configuration; using abremir.AllMyBricks.Data.Interfaces; using abremir.AllMyBricks.Data.Models; using abremir.AllMyBricks.Providers; using LiteDB; namespace abremir.AllMyBricks.Data.Services { public class RepositoryService : IRepositoryService { private readonly IFilePathProvider _filePathProvider; public RepositoryService(IFilePathProvider filePathProvider) { _filePathProvider = filePathProvider; } public LiteRepository GetRepository() { var liteRepository = new LiteRepository(_filePathProvider.GetLocalPathToFile(Constants.AllMyBricksDbFile)); SetupIndexes(liteRepository.Engine); return liteRepository; } public static void SetupIndexes(LiteEngine liteEngine) { if (liteEngine.UserVersion == 0) { liteEngine.EnsureIndex(nameof(Theme), "YearFrom"); liteEngine.EnsureIndex(nameof(Theme), "YearTo"); liteEngine.EnsureIndex(nameof(Subtheme), "YearFrom"); liteEngine.EnsureIndex(nameof(Subtheme), "YearTo"); liteEngine.EnsureIndex(nameof(Subtheme), "Theme.Name"); liteEngine.UserVersion = 1; } } } }
mit
C#
eb30c04c4df5f82a9eee34a391158309cd8d689a
Save newly created csproj files without BOM
ex/godot,ex/godot,ex/godot,ex/godot,ex/godot,ex/godot,ex/godot,ex/godot
modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs
modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs
using System; using System.IO; using System.Text; using Microsoft.Build.Construction; using Microsoft.Build.Evaluation; namespace GodotTools.ProjectEditor { public static class ProjectGenerator { public const string GodotSdkVersionToUse = "3.2.3"; public static string GodotSdkAttrValue => $"Godot.NET.Sdk/{GodotSdkVersionToUse}"; public static ProjectRootElement GenGameProject(string name) { if (name.Length == 0) throw new ArgumentException("Project name is empty", nameof(name)); var root = ProjectRootElement.Create(NewProjectFileOptions.None); root.Sdk = GodotSdkAttrValue; var mainGroup = root.AddPropertyGroup(); mainGroup.AddProperty("TargetFramework", "net472"); string sanitizedName = IdentifierUtils.SanitizeQualifiedIdentifier(name, allowEmptyIdentifiers: true); // If the name is not a valid namespace, manually set RootNamespace to a sanitized one. if (sanitizedName != name) mainGroup.AddProperty("RootNamespace", sanitizedName); return root; } public static string GenAndSaveGameProject(string dir, string name) { if (name.Length == 0) throw new ArgumentException("Project name is empty", nameof(name)); string path = Path.Combine(dir, name + ".csproj"); var root = GenGameProject(name); // Save (without BOM) root.Save(path, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); return Guid.NewGuid().ToString().ToUpper(); } } }
using System; using System.IO; using Microsoft.Build.Construction; using Microsoft.Build.Evaluation; namespace GodotTools.ProjectEditor { public static class ProjectGenerator { public const string GodotSdkVersionToUse = "3.2.3"; public static string GodotSdkAttrValue => $"Godot.NET.Sdk/{GodotSdkVersionToUse}"; public static ProjectRootElement GenGameProject(string name) { if (name.Length == 0) throw new ArgumentException("Project name is empty", nameof(name)); var root = ProjectRootElement.Create(NewProjectFileOptions.None); root.Sdk = GodotSdkAttrValue; var mainGroup = root.AddPropertyGroup(); mainGroup.AddProperty("TargetFramework", "net472"); string sanitizedName = IdentifierUtils.SanitizeQualifiedIdentifier(name, allowEmptyIdentifiers: true); // If the name is not a valid namespace, manually set RootNamespace to a sanitized one. if (sanitizedName != name) mainGroup.AddProperty("RootNamespace", sanitizedName); return root; } public static string GenAndSaveGameProject(string dir, string name) { if (name.Length == 0) throw new ArgumentException("Project name is empty", nameof(name)); string path = Path.Combine(dir, name + ".csproj"); var root = GenGameProject(name); root.Save(path); return Guid.NewGuid().ToString().ToUpper(); } } }
mit
C#
63dadb296d1a5736ebe214e9877df6e964f2fa64
add missing configure await
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
src/SFA.DAS.EmployerApprenticeshipsService.Application/Services/EmployerAccountsApi/EmployerAccountsApiService.cs
src/SFA.DAS.EmployerApprenticeshipsService.Application/Services/EmployerAccountsApi/EmployerAccountsApiService.cs
using System.Net.Http; using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json; using SFA.DAS.EAS.Application.Http; using SFA.DAS.EAS.Application.Services.EmployerAccountsApi.Http; using SFA.DAS.EmployerAccounts.Api.Types; using SFA.DAS.NLog.Logger; namespace SFA.DAS.EAS.Application.Services.EmployerAccountsApi { public class EmployerAccountsApiService : IEmployerAccountsApiService { private readonly ILog _log; private readonly HttpClient _httpClient; public EmployerAccountsApiService(IEmployerAccountsApiHttpClientFactory employerAccountsApiHttpClientFactory, ILog log) { _log = log; //todo: using RestHttpClient would be better, but would need to upgrade the api, which might be a bit much for this story!? _httpClient = employerAccountsApiHttpClientFactory.CreateHttpClient(); } public async Task<Statistics> GetStatistics(CancellationToken cancellationToken = default(CancellationToken)) { _log.Info($"Getting statistics"); var response = await _httpClient.GetAsync("/api/statistics", cancellationToken).ConfigureAwait(false); var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); if (!response.IsSuccessStatusCode) throw new RestHttpClientException(response, content); return JsonConvert.DeserializeObject<Statistics>(content); } } }
using System.Net.Http; using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json; using SFA.DAS.EAS.Application.Http; using SFA.DAS.EAS.Application.Services.EmployerAccountsApi.Http; using SFA.DAS.EmployerAccounts.Api.Types; using SFA.DAS.NLog.Logger; namespace SFA.DAS.EAS.Application.Services.EmployerAccountsApi { public class EmployerAccountsApiService : IEmployerAccountsApiService { private readonly ILog _log; private readonly HttpClient _httpClient; public EmployerAccountsApiService(IEmployerAccountsApiHttpClientFactory employerAccountsApiHttpClientFactory, ILog log) { _log = log; //todo: using RestHttpClient would be better, but would need to upgrade the api, which might be a bit much for this story!? _httpClient = employerAccountsApiHttpClientFactory.CreateHttpClient(); } public async Task<Statistics> GetStatistics(CancellationToken cancellationToken = default(CancellationToken)) { _log.Info($"Getting statistics"); var response = await _httpClient.GetAsync("/api/statistics", cancellationToken); var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); if (!response.IsSuccessStatusCode) throw new RestHttpClientException(response, content); return JsonConvert.DeserializeObject<Statistics>(content); } } }
mit
C#
352aa0cc961f6998ccd824b6125307e8c22df4dd
Improve create button on ListPart (#3412)
stevetayloruk/Orchard2,petedavis/Orchard2,petedavis/Orchard2,stevetayloruk/Orchard2,stevetayloruk/Orchard2,petedavis/Orchard2,stevetayloruk/Orchard2,xkproject/Orchard2,xkproject/Orchard2,xkproject/Orchard2,petedavis/Orchard2,xkproject/Orchard2,OrchardCMS/Brochard,xkproject/Orchard2,stevetayloruk/Orchard2,OrchardCMS/Brochard,OrchardCMS/Brochard
src/OrchardCore.Modules/OrchardCore.Lists/Views/ListPart.DetailAdmin.cshtml
src/OrchardCore.Modules/OrchardCore.Lists/Views/ListPart.DetailAdmin.cshtml
@model OrchardCore.Lists.ViewModels.ListPartViewModel @using OrchardCore.ContentManagement @using OrchardCore.ContentManagement.Metadata.Models; @inject OrchardCore.ContentManagement.Display.IContentItemDisplayManager ContentItemDisplayManager @if (!Model.ContainedContentTypeDefinitions.Any()) { <p class="alert alert-warning"> <a asp-action="EditTypePart" asp-controller="Admin" asp-route-area="OrchardCore.ContentTypes" asp-route-id="@Model.ListPart.ContentItem.ContentType" asp-route-name="ListPart">@T["Please specify at least one contained content type."]</a> </p> } else { if (Model.ContainedContentTypeDefinitions.Count() == 1) { var contentTypeDefinition = Model.ContainedContentTypeDefinitions.FirstOrDefault(); <p> <a class="btn btn-primary" asp-action="Create" asp-controller="Admin" asp-route-id="@contentTypeDefinition.Name" asp-route-area="OrchardCore.Contents" asp-route-ListPart.ContainerId="@Model.ListPart.ContentItem.ContentItemId"> @T["Create {0}", contentTypeDefinition.DisplayName] </a> </p> } else { <p> <div class="dropdown"> <a class="btn btn-primary dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> @T["Create"] </a> <div class="dropdown-menu" aria-labelledby="dropdownMenuLink"> @foreach (var containedContentTypeDefinition in Model.ContainedContentTypeDefinitions) { <a class="dropdown-item" asp-action="Create" asp-controller="Admin" asp-route-id="@containedContentTypeDefinition.Name" asp-route-area="OrchardCore.Contents" asp-route-ListPart.ContainerId="@Model.ListPart.ContentItem.ContentItemId">@containedContentTypeDefinition.DisplayName</a> } </div> </div> </p> } @if (Model.ContentItems.Any()) { <ul class="list-group"> @foreach (var contentItem in Model.ContentItems) { var contentItemSummary = await ContentItemDisplayManager.BuildDisplayAsync(contentItem, Model.Context.Updater, "SummaryAdmin", Model.Context.GroupId); <li class="list-group-item"> @await DisplayAsync(contentItemSummary) </li> } </ul> @await DisplayAsync(Model.Pager) } else { <p class="alert alert-warning">@T["The list is empty."]</p> } }
@model OrchardCore.Lists.ViewModels.ListPartViewModel @using OrchardCore.ContentManagement @using OrchardCore.ContentManagement.Metadata.Models; @inject OrchardCore.ContentManagement.Display.IContentItemDisplayManager ContentItemDisplayManager @if (!Model.ContainedContentTypeDefinitions.Any()) { <p class="alert alert-warning"> <a asp-action="EditTypePart" asp-controller="Admin" asp-route-area="OrchardCore.ContentTypes" asp-route-id="@Model.ListPart.ContentItem.ContentType" asp-route-name="ListPart">@T["Please specify at least one contained content type."]</a> </p> } else { <p> <div class="dropdown"> <a class="btn btn-primary dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> @T["Create"] </a> <div class="dropdown-menu" aria-labelledby="dropdownMenuLink"> @foreach (var containedContentTypeDefinition in Model.ContainedContentTypeDefinitions) { <a class="dropdown-item" asp-action="Create" asp-controller="Admin" asp-route-id="@containedContentTypeDefinition.Name" asp-route-area="OrchardCore.Contents" asp-route-ListPart.ContainerId="@Model.ListPart.ContentItem.ContentItemId">@containedContentTypeDefinition.DisplayName</a> } </div> </div> </p> @if (Model.ContentItems.Any()) { <ul class="list-group"> @foreach (var contentItem in Model.ContentItems) { var contentItemSummary = await ContentItemDisplayManager.BuildDisplayAsync(contentItem, Model.Context.Updater, "SummaryAdmin", Model.Context.GroupId); <li class="list-group-item"> @await DisplayAsync(contentItemSummary) </li> } </ul> @await DisplayAsync(Model.Pager) } else { <p class="alert alert-warning">@T["The list is empty."]</p> } }
bsd-3-clause
C#
9fe3247197a83ff1e459c1d6ea947cd0f2477ad3
fix underscore error in water type enum
brnkhy/MapzenGo,brnkhy/MapzenGo
Assets/MapzenGo/Models/Enums/WaterType.cs
Assets/MapzenGo/Models/Enums/WaterType.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace MapzenGo.Models.Enums { public enum WaterType { Basin, Dock, Lake, Ocean, Playa, Riverbank, Swimming_Pool, Water, } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace MapzenGo.Models.Enums { public enum WaterType { Basin, Dock, Lake, Ocean, Playa, Riverbank, SwimmingPool, Water, } }
mit
C#
b87cd1087c36a2e8fdc6576da936fd372f635333
Bump version for release
Harteex/GCWZeroManager
GCWZeroManager/Properties/AssemblyInfo.cs
GCWZeroManager/Properties/AssemblyInfo.cs
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("GCWZeroManager")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("GCWZeroManager")] [assembly: AssemblyCopyright("Copyright © Harteex 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("GCWZeroManager")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("GCWZeroManager")] [assembly: AssemblyCopyright("Copyright © Harteex 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.9.0.0")] [assembly: AssemblyFileVersion("0.9.0.0")]
mit
C#
2595ccd012b2372e55ac80576e402674534a8caf
Test fix
ErikEJ/EntityFramework7.SqlServerCompact,ErikEJ/EntityFramework.SqlServerCompact
test/EntityFramework.SqlServerCompact.Tests/SqlCeDataStoreConnectionTest.cs
test/EntityFramework.SqlServerCompact.Tests/SqlCeDataStoreConnectionTest.cs
using System.Data.SqlServerCe; using Microsoft.Data.Entity; using Microsoft.Data.Entity.Infrastructure; using Microsoft.Data.Entity.Storage.Internal; using Microsoft.Framework.Logging; using Xunit; namespace ErikEJ.Data.Entity.SqlServerCe.Tests { public class SqlCeDataStoreConnectionTest { [Fact] public void Creates_SQL_ServerCe_connection_string() { using (var connection = new SqlCeDatabaseConnection(CreateOptions(), new Logger<SqlCeDatabaseConnection>(new LoggerFactory()))) { Assert.IsType<SqlCeConnection>(connection.DbConnection); } } public static IDbContextOptions CreateOptions() { var optionsBuilder = new DbContextOptionsBuilder(); optionsBuilder.UseSqlCe(@"Data Source=C:\data\EF7SQLCE.sdf;"); return optionsBuilder.Options; } } }
using System.Data.SqlServerCe; using Microsoft.Data.Entity; using Microsoft.Data.Entity.Infrastructure; using Microsoft.Data.Entity.Storage.Internal; using Microsoft.Framework.Logging; using Xunit; namespace ErikEJ.Data.Entity.SqlServerCe.Tests { public class SqlCeDataStoreConnectionTest { [Fact] public void Creates_SQL_ServerCe_connection_string() { using (var connection = new SqlCeDatabaseConnection(CreateOptions(), new LoggerFactory())) { Assert.IsType<SqlCeConnection>(connection.DbConnection); } } public static IDbContextOptions CreateOptions() { var optionsBuilder = new DbContextOptionsBuilder(); optionsBuilder.UseSqlCe(@"Data Source=C:\data\EF7SQLCE.sdf;"); return optionsBuilder.Options; } } }
apache-2.0
C#
3ab794c285fb9d845e52b0dd55ca2a02dabe4791
add ObjectValue
corvusalba/my-little-lispy,corvusalba/my-little-lispy
src/CorvusAlba.MyLittleLispy.Runtime/Value.cs
src/CorvusAlba.MyLittleLispy.Runtime/Value.cs
using System; namespace CorvusAlba.MyLittleLispy.Runtime { public abstract class Value { public virtual Value<T> Cast<T>() { if (typeof(T) == typeof(bool) && !(this is Bool)) { return (Value<T>) (object) new Bool(true); } return (Value<T>) this; } public virtual T To<T>() { return Cast<T>().GetClrValue(); } public virtual Value Add(Value arg) { throw new InvalidOperationException(); } public virtual Value Substract(Value arg) { throw new InvalidOperationException(); } public virtual Value Negate() { throw new InvalidOperationException(); } public virtual Value Multiple(Value arg) { throw new InvalidOperationException(); } public virtual Value Divide(Value arg) { throw new InvalidOperationException(); } public Value EqualWithNull(Value arg) { if (object.ReferenceEquals(arg, Null.Value)) { return new Bool(object.ReferenceEquals(this, Null.Value)); } return Equal(arg); } public virtual Value Equal(Value arg) { throw new InvalidOperationException(); } public virtual Value Lesser(Value arg) { throw new InvalidOperationException(); } public virtual Value Greater(Value arg) { throw new InvalidOperationException(); } public virtual Value Not() { return new Bool(!this.To<bool>()); } public virtual Value Car() { throw new InvalidOperationException(); } public virtual Value Cdr() { throw new InvalidOperationException(); } public abstract Node ToExpression(); } public abstract class Value<T> : Value { protected T ClrValue; protected Value(T value) { ClrValue = value; } public T GetClrValue() { return ClrValue; } public override string ToString() { return ClrValue.ToString(); } public override Node ToExpression() { return new Constant(this); } } public class ObjectValue: Value<object> { public ObjectValue(object value) : base(value) { } } }
using System; namespace CorvusAlba.MyLittleLispy.Runtime { public abstract class Value { public virtual Value<T> Cast<T>() { if (typeof(T) == typeof(bool) && !(this is Bool)) { return (Value<T>) (object) new Bool(true); } return (Value<T>) this; } public virtual T To<T>() { return Cast<T>().GetClrValue(); } public virtual Value Add(Value arg) { throw new InvalidOperationException(); } public virtual Value Substract(Value arg) { throw new InvalidOperationException(); } public virtual Value Negate() { throw new InvalidOperationException(); } public virtual Value Multiple(Value arg) { throw new InvalidOperationException(); } public virtual Value Divide(Value arg) { throw new InvalidOperationException(); } public Value EqualWithNull(Value arg) { if (object.ReferenceEquals(arg, Null.Value)) { return new Bool(object.ReferenceEquals(this, Null.Value)); } return Equal(arg); } public virtual Value Equal(Value arg) { throw new InvalidOperationException(); } public virtual Value Lesser(Value arg) { throw new InvalidOperationException(); } public virtual Value Greater(Value arg) { throw new InvalidOperationException(); } public virtual Value Not() { return new Bool(!this.To<bool>()); } public virtual Value Car() { throw new InvalidOperationException(); } public virtual Value Cdr() { throw new InvalidOperationException(); } public abstract Node ToExpression(); } public abstract class Value<T> : Value { protected T ClrValue; protected Value(T value) { ClrValue = value; } public T GetClrValue() { return ClrValue; } public override string ToString() { return ClrValue.ToString(); } public override Node ToExpression() { return new Constant(this); } } }
mit
C#
d960685693d667d948c3fda5ebfe4037144eb87c
reformat PaymentType.cs
leotsarev/joinrpg-net,joinrpg/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net
JoinRpg.DataModel/Finances/PaymentType.cs
JoinRpg.DataModel/Finances/PaymentType.cs
using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using JoinRpg.Helpers; namespace JoinRpg.DataModel { // ReSharper disable once ClassWithVirtualMembersNeverInherited.Global required by LINQ public class PaymentType : IProjectEntity, IValidatableObject, IDeletableSubEntity { public int PaymentTypeId { get; set; } public int ProjectId { get; set; } public virtual Project Project { get; set; } public string Name { get; set; } public int UserId { get; set; } public virtual User User { get; set; } public bool IsCash { get; set; } public bool IsActive { get; set; } public bool IsDefault { get; set; } public virtual ICollection<FinanceOperation> Operations { get; set; } #region interface implementations public bool CanBePermanentlyDeleted => !Operations.Any(); int IOrderableEntity.Id => ProjectId; #endregion public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) { if (string.IsNullOrWhiteSpace(Name)) { yield return new ValidationResult("Name is required"); } } public static PaymentType CreateCash(int user) { return new PaymentType() { IsCash = true, IsActive = true, Name = "cash", UserId = user, }; } } }
using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using JoinRpg.Helpers; namespace JoinRpg.DataModel { // ReSharper disable once ClassWithVirtualMembersNeverInherited.Global required by LINQ public class PaymentType : IProjectEntity, IValidatableObject, IDeletableSubEntity { public int PaymentTypeId { get; set; } public int ProjectId { get; set; } public virtual Project Project { get; set; } public string Name { get; set; } public int UserId { get; set; } public virtual User User { get; set; } public bool IsCash { get; set; } public bool IsActive { get; set; } public bool IsDefault { get; set; } public virtual ICollection<FinanceOperation> Operations { get; set; } #region interface implementations public bool CanBePermanentlyDeleted => !Operations.Any(); int IOrderableEntity.Id => ProjectId; #endregion public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) { if (string.IsNullOrWhiteSpace(Name)) { yield return new ValidationResult("Name is required"); } } public static PaymentType CreateCash(int user) { return new PaymentType() { IsCash = true, IsActive = true, Name = "cash", UserId = user, }; } } }
mit
C#
4f9dcd85f817ff6d2959459f7063c22a424771cc
Remove unused members of ExecuteCases.
fixie/fixie
src/Fixie/Execution/Behaviors/ExecuteCases.cs
src/Fixie/Execution/Behaviors/ExecuteCases.cs
namespace Fixie.Execution.Behaviors { using System; using System.Diagnostics; class ExecuteCases { public void Execute(Fixture fixture, CaseAction caseLifecycle) { foreach (var @case in fixture.Cases) { using (var console = new RedirectedConsole()) { @case.Fixture = fixture; var stopwatch = new Stopwatch(); stopwatch.Start(); try { caseLifecycle(@case); } catch (Exception exception) { @case.Fail(exception); } stopwatch.Stop(); @case.Fixture = null; @case.Duration += stopwatch.Elapsed; @case.Output = console.Output; } Console.Write(@case.Output); } } } }
namespace Fixie.Execution.Behaviors { using System; using System.Diagnostics; class ExecuteCases { readonly BehaviorChain<Case> caseBehaviors; public ExecuteCases(BehaviorChain<Case> caseBehaviors = null) { this.caseBehaviors = caseBehaviors; } public void Execute(Fixture fixture, Action next) { Execute(fixture, caseBehaviors.Execute); } public void Execute(Fixture fixture, CaseAction caseLifecycle) { foreach (var @case in fixture.Cases) { using (var console = new RedirectedConsole()) { @case.Fixture = fixture; var stopwatch = new Stopwatch(); stopwatch.Start(); try { caseLifecycle(@case); } catch (Exception exception) { @case.Fail(exception); } stopwatch.Stop(); @case.Fixture = null; @case.Duration += stopwatch.Elapsed; @case.Output = console.Output; } Console.Write(@case.Output); } } } }
mit
C#
ad3a1d6226a9d97fc9a8379ec53dbfdf55fe8ae8
Update NSucceed.cs
NMSLanX/Natasha
src/Natasha/Core/Engine/LogModule/NSucceed.cs
src/Natasha/Core/Engine/LogModule/NSucceed.cs
using Microsoft.CodeAnalysis.CSharp; using Natasha.Log.Model; using System; using System.Reflection; namespace Natasha.Log { public class NSucceed : ALogWrite { public static bool Enabled; static NSucceed() => Enabled = true; public override void Write() { NWriter<NSucceed>.Recoder(Buffer); } public void Handler(CSharpCompilation compilation) { Buffer.AppendLine($"\r\n\r\n========================Succeed : {compilation.AssemblyName}========================\r\n"); WrapperCode(compilation.SyntaxTrees); Buffer.AppendLine("\r\n\r\n-----------------------------------------------succeed------------------------------------------------"); Buffer.AppendLine($"\r\n Time :\t\t{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Buffer.AppendLine($"\r\n Lauguage :\t{compilation.Language} & {compilation.LanguageVersion}"); Buffer.AppendLine($"\r\n Target :\t{compilation.AssemblyName}"); Buffer.AppendLine($"\r\n Assembly : \t{compilation.AssemblyName}"); Buffer.AppendLine("\r\n--------------------------------------------------------------------------------------------------------"); Buffer.AppendLine("\r\n===================================================================="); } } }
using Microsoft.CodeAnalysis.CSharp; using Natasha.Log.Model; using System; using System.Reflection; namespace Natasha.Log { public class NSucceed : ALogWrite { public static bool Enabled; static NSucceed() => Enabled = true; public override void Write() { NWriter<NSucceed>.Recoder(Buffer); } public void Handler(CSharpCompilation compilation) { Buffer.AppendLine($"\r\n\r\n========================Succeed : {compilation.AssemblyName}========================\r\n"); WrapperCode(compilation.SyntaxTrees); Buffer.AppendLine("\r\n\r\n-----------------------------------------------succeed------------------------------------------------"); Buffer.AppendLine($"\r\n Time :\t\t{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Buffer.AppendLine($"\r\n Lauguage :\t{compilation.Language} & {compilation.LanguageVersion}"); Buffer.AppendLine($"\r\n Target :\t\t{compilation.AssemblyName}"); Buffer.AppendLine($"\r\n Assembly : \t{compilation.AssemblyName}"); Buffer.AppendLine("\r\n--------------------------------------------------------------------------------------------------------"); Buffer.AppendLine("\r\n===================================================================="); } } }
mpl-2.0
C#
b495c692af079450e8e81e68605e10b3dc159962
Fix Callback Example
sinch/nuget-serversdk
Examples/Sinch.Verification.Callback.Example/Controllers/VerificationController.cs
Examples/Sinch.Verification.Callback.Example/Controllers/VerificationController.cs
using System.Threading.Tasks; using System.Web.Http; using Sinch.ServerSdk.Callback.WebApi; using Sinch.ServerSdk.Verification.Models; using System; using Newtonsoft.Json; #pragma warning disable 1998 namespace Sinch.Verification.Callback.Example.Controllers { [SinchCallback] public class VerificationController : ApiController { [Route] public async Task<VerificationRequestEventResponse> Post() { //based on this example, the value for your application callback url should be {server address}/api/verification string jsonContent = await Request.Content.ReadAsStringAsync(); if (jsonContent.Contains("VerificationRequestEvent")) { VerificationRequestEvent request = JsonConvert.DeserializeObject<VerificationRequestEvent>(jsonContent); bool isValid = true; //do w/e do decide if the request is allowed return new VerificationRequestEventResponse { Action = isValid ? "allow" : "deny" }; } else if (jsonContent.Contains("VerificationResultEvent")) { VerificationResultEvent result = JsonConvert.DeserializeObject<VerificationResultEvent>(jsonContent); //code for dealing with result of Verification return null; } else { throw new NotImplementedException("Unknown event type!"); } } } }
using System.Threading.Tasks; using System.Web.Http; using Sinch.ServerSdk.Callback.WebApi; using Sinch.ServerSdk.Verification.Models; #pragma warning disable 1998 namespace Sinch.Verification.Callback.Example.Controllers { [SinchCallback] public class VerificationController : ApiController { // POST: api/verification/request [Route("request")] public async Task<VerificationRequestEventResponse> Post([FromBody] VerificationRequestEvent request) { // Let us know what to do with this verification request. Possible actions are "allow" or "deny". return new VerificationRequestEventResponse { Action = "deny" }; } // POST: api/verification/result [Route("result")] public async Task Post([FromBody] VerificationResultEvent result) { // The verification has been processed and here's the result... } } }
mit
C#
e4480bf181c8d217363448c14e14004c73b07ee1
Fix tests 9.1 compilation
controlflow/resharper-postfix
PostfixTemplates/Tests/PostfixTestBase.cs
PostfixTemplates/Tests/PostfixTestBase.cs
#if RESHARPER8 using JetBrains.ReSharper.Feature.Services.Tests.CSharp.FeatureServices.CodeCompletion; #elif RESHARPER9 using JetBrains.ReSharper.FeaturesTestFramework.Completion; #endif namespace JetBrains.ReSharper.PostfixTemplates { public abstract class PostfixCodeCompletionTestBase : CodeCompletionTestBase { #if RESHARPER8 protected override bool ExecuteAction { get { return true; } } #elif RESHARPER9 protected override CodeCompletionTestType TestType { get { return CodeCompletionTestType.Action; } } #endif protected override bool CheckAutomaticCompletionDefault() { return true; } } public abstract class PostfixCodeCompletionListTestBase : CodeCompletionTestBase { #if RESHARPER8 protected override bool ExecuteAction { get { return true; } } #elif RESHARPER9 protected override CodeCompletionTestType TestType { get { return CodeCompletionTestType.List; } } #endif protected override bool CheckAutomaticCompletionDefault() { return true; } } }
#if RESHARPER8 using JetBrains.ReSharper.Feature.Services.Tests.CSharp.FeatureServices.CodeCompletion; #elif RESHARPER9 using JetBrains.ReSharper.FeaturesTestFramework.Completion; #endif namespace JetBrains.ReSharper.PostfixTemplates { public abstract class PostfixCodeCompletionTestBase : CodeCompletionTestBase { protected override bool ExecuteAction { get { return true; } } protected override bool CheckAutomaticCompletionDefault() { return true; } } public abstract class PostfixCodeCompletionListTestBase : CodeCompletionTestBase { protected override bool ExecuteAction { get { return false; } } protected override bool CheckAutomaticCompletionDefault() { return true; } } }
mit
C#
a86681d3bf1d39c9b9e591f5c315af19f90f3d1d
Enable hadware encoding/decoding
fuyuno/Norma
Source/Norma/Models/Browser/CefSetting.cs
Source/Norma/Models/Browser/CefSetting.cs
using System; using CefSharp; using Norma.Eta; namespace Norma.Models.Browser { // CefSharp Settings internal static class CefSetting { internal static void Init() { var settings = new CefSettings { CachePath = NormaConstants.CefCacheDir, MultiThreadedMessageLoop = true, WindowlessRenderingEnabled = true }; settings.CefCommandLineArgs.Add("disable-extensions", "1"); settings.CefCommandLineArgs.Add("disable-pdf-extension", "1"); settings.CefCommandLineArgs.Add("disable-surfaces", "1"); settings.CefCommandLineArgs.Add("disable-gpu", "1"); settings.CefCommandLineArgs.Add("disable-gpu-compositing", "1"); settings.CefCommandLineArgs.Add("enable-begin-frame-scheduling", "1"); settings.CefCommandLineArgs.Add("enable-webrtc-hw-h264-encoding", "1"); settings.CefCommandLineArgs.Add("enable-webrtc-hw-h264-decoding", "1"); Cef.OnContextInitialized = () => { var cookieManager = Cef.GetGlobalCookieManager(); cookieManager.SetStoragePath(NormaConstants.CefCookiesDir, true); }; if (!Cef.Initialize(settings, true, false)) throw new Exception("Unable to Initialize Chromium Embedded Framework"); } } }
using System; using CefSharp; using Norma.Eta; namespace Norma.Models.Browser { // CefSharp Settings internal static class CefSetting { internal static void Init() { var settings = new CefSettings { CachePath = NormaConstants.CefCacheDir, MultiThreadedMessageLoop = true, WindowlessRenderingEnabled = true }; settings.CefCommandLineArgs.Add("disable-extensions", "1"); settings.CefCommandLineArgs.Add("disable-pdf-extension", "1"); settings.CefCommandLineArgs.Add("disable-surfaces", "1"); settings.CefCommandLineArgs.Add("disable-gpu", "1"); settings.CefCommandLineArgs.Add("disable-gpu-compositing", "1"); settings.CefCommandLineArgs.Add("enable-begin-frame-scheduling", "1"); Cef.OnContextInitialized = () => { var cookieManager = Cef.GetGlobalCookieManager(); cookieManager.SetStoragePath(NormaConstants.CefCookiesDir, true); }; if (!Cef.Initialize(settings, true, false)) throw new Exception("Unable to Initialize Chromium Embedded Framework"); } } }
mit
C#
4470ff1fc8e841c0c14c30421bd7e4794a05f624
Make AppCommand implement ICommand
appharbor/appharbor-cli
src/AppHarbor/Commands/AppCommand.cs
src/AppHarbor/Commands/AppCommand.cs
using System; namespace AppHarbor.Commands { public class AppCommand : ICommand { public void Execute(string[] arguments) { throw new NotImplementedException(); } } }
namespace AppHarbor.Commands { public class AppCommand { } }
mit
C#
a7e5f1f74e96eb91f4b3aff320ee000f4357c2aa
Update GroupBox.cs
Core2D/Core2D,wieslawsoltes/Core2D,Core2D/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D
src/Core2D/Editor/Layout/GroupBox.cs
src/Core2D/Editor/Layout/GroupBox.cs
using System; using System.Collections.Generic; using Core2D.Shapes; namespace Core2D.Editor.Layout { public struct GroupBox { public readonly List<ShapeBox> Boxes; public Box Bounds; public GroupBox(List<IBaseShape> shapes) { Boxes = new List<ShapeBox>(shapes.Count); for (int i = 0; i < shapes.Count; i++) { Boxes.Add(new ShapeBox(shapes[i])); } Bounds = new Box(); Update(ref Bounds); } public void Update(ref Box bounds) { for (int i = 0; i < Boxes.Count; i++) { var box = Boxes[i]; box.Update(ref box.Bounds); } bounds.Left = double.MaxValue; bounds.Top = double.MaxValue; bounds.Right = double.MinValue; bounds.Bottom = double.MinValue; for (int i = 0; i < Boxes.Count; i++) { var box = Boxes[i]; bounds.Left = Math.Min(bounds.Left, box.Bounds.Left); bounds.Top = Math.Min(bounds.Top, box.Bounds.Top); bounds.Right = Math.Max(bounds.Right, box.Bounds.Right); bounds.Bottom = Math.Max(bounds.Bottom, box.Bounds.Bottom); } bounds.CenterX = (bounds.Left + bounds.Right) / 2.0; bounds.CenterY = (bounds.Top + bounds.Bottom) / 2.0; bounds.Width = Math.Abs(bounds.Right - bounds.Left); bounds.Height = Math.Abs(bounds.Bottom - bounds.Top); } } }
using System; using System.Collections.Generic; using Core2D.Shapes; namespace Core2D.Editor.Layout { public struct GroupBox { public readonly List<ShapeBox> Boxes; public Box Bounds; public GroupBox(List<IBaseShape> shapes) { Boxes = new List<ShapeBox>(shapes.Count); for (int i = 0; i < shapes.Count; i++) { Boxes.Add(new ShapeBox(shapes[i])); } Bounds = new Box(); Update(ref Bounds); } public void Update(ref Box bounds) { for (int i = 0; i < Boxes.Count; i++) { var box = Boxes[i]; box.Update(ref box.Bounds); } bounds.Left = double.MaxValue; bounds.Top = double.MaxValue; bounds.Right = double.MinValue; bounds.Bottom = double.MinValue; foreach (var box in Boxes) { bounds.Left = Math.Min(bounds.Left, box.Bounds.Left); bounds.Top = Math.Min(bounds.Top, box.Bounds.Top); bounds.Right = Math.Max(bounds.Right, box.Bounds.Right); bounds.Bottom = Math.Max(bounds.Bottom, box.Bounds.Bottom); } bounds.CenterX = (bounds.Left + bounds.Right) / 2.0; bounds.CenterY = (bounds.Top + bounds.Bottom) / 2.0; bounds.Width = Math.Abs(bounds.Right - bounds.Left); bounds.Height = Math.Abs(bounds.Bottom - bounds.Top); } } }
mit
C#
0a423ff84d438f48422876781708eaf73d999dd6
Use HTML template compiler in example.
BluewireTechnologies/cassette,honestegg/cassette,BluewireTechnologies/cassette,honestegg/cassette,honestegg/cassette,andrewdavey/cassette,damiensawyer/cassette,andrewdavey/cassette,damiensawyer/cassette,andrewdavey/cassette,damiensawyer/cassette
src/Example/CassetteConfiguration.cs
src/Example/CassetteConfiguration.cs
using System.Text.RegularExpressions; using Cassette; using Cassette.HtmlTemplates; using Cassette.Scripts; using Cassette.Stylesheets; namespace Example { public class CassetteConfiguration : ICassetteConfiguration { public void Configure(ModuleConfiguration modules) { modules.Add( new PerSubDirectorySource<ScriptModule>("Scripts") { FilePattern = "*.js", Exclude = new Regex("-vsdoc\\.js$") }, new ExternalScriptModule("twitter", "http://platform.twitter.com/widgets.js") { Location = "body" } ); modules.Add(new DirectorySource<StylesheetModule>("Styles") { FilePattern = "*.css;*.less" }); modules.Add(new PerSubDirectorySource<HtmlTemplateModule>("HtmlTemplates")); modules.Customize<StylesheetModule>(m => m.Processor = new StylesheetPipeline { CompileLess = true, ConvertImageUrlsToDataUris = true }); modules.Customize<HtmlTemplateModule>(m => m.Processor = new JQueryTmplPipeline{KnockoutJS = true}); } } }
using System.Text.RegularExpressions; using Cassette; using Cassette.HtmlTemplates; using Cassette.Scripts; using Cassette.Stylesheets; namespace Example { public class CassetteConfiguration : ICassetteConfiguration { public void Configure(ModuleConfiguration modules) { modules.Add( new PerSubDirectorySource<ScriptModule>("Scripts") { FilePattern = "*.js", Exclude = new Regex("-vsdoc\\.js$") }, new ExternalScriptModule("twitter", "http://platform.twitter.com/widgets.js") { Location = "body" } ); modules.Add(new DirectorySource<StylesheetModule>("Styles") { FilePattern = "*.css;*.less" }); modules.Add(new PerSubDirectorySource<HtmlTemplateModule>("HtmlTemplates")); modules.Customize<StylesheetModule>(m => m.Processor = new StylesheetPipeline { CompileLess = true, ConvertImageUrlsToDataUris = true }); } } }
mit
C#
04cd484684aa98b8d7cddee8541d5f3aac494868
Add missing assembly keys.
OmniSharp/omnisharp-roslyn,OmniSharp/omnisharp-roslyn
src/OmniSharp.Roslyn/AssemblyInfo.cs
src/OmniSharp.Roslyn/AssemblyInfo.cs
using System.Runtime.CompilerServices; using OmniSharp; [assembly: InternalsVisibleTo("OmniSharp.Tests" + OmniSharpPublicKey.Key)] [assembly: InternalsVisibleTo("OmniSharp.Roslyn.CSharp" + OmniSharpPublicKey.Key)]
using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("OmniSharp.Tests")] [assembly: InternalsVisibleTo("OmniSharp.Roslyn.CSharp")]
mit
C#
3c7fddf5c5772bb3d741c5ff5fa3e3cf2fa588b7
Add comment.
mrtska/SRNicoNico,mrtska/SRNicoNico,mrtska/SRNicoNico,mrtska/SRNicoNico
SRNicoNico/App.xaml.cs
SRNicoNico/App.xaml.cs
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Linq; using System.Windows; using System.Threading.Tasks; using SRNicoNico.ViewModels; using SRNicoNico.Views; using SRNicoNico.Models.NicoNicoViewer; using Livet; using Microsoft.Win32; namespace SRNicoNico { /// <summary> /// App.xaml の相互作用ロジック /// </summary> public partial class App : Application { //メインウィンドウのViewModel public static MainWindowViewModel ViewModelRoot { get; private set; } private void Application_Startup(object sender, StartupEventArgs e) { } protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); //UIスレッドのディスパッチャを登録しておく DispatcherHelper.UIDispatcher = Dispatcher; AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); //WebBrowserコントロールのIEバージョンを最新にする 古いとUI崩れるからね //レジストリを弄るのはここだけ Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", "SRNicoNico.exe", 0x00002AF9, Microsoft.Win32.RegistryValueKind.DWord); ViewModelRoot = new MainWindowViewModel(); MainWindow = new MainWindow { DataContext = ViewModelRoot }; MainWindow.Show(); } //集約エラーハンドラ private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { //ハンドルされない例外の処理 このメソッドが終わると例外を吐いた MessageBox.Show( "不明なエラーが発生しました。可能であれば、この文章をコピーして作者に報告していただれば幸いです。Ctrl+Cでコピーできます。\n ExceptionObject:" + e.ExceptionObject, "エラー", MessageBoxButton.OK, MessageBoxImage.Error); } } }
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Linq; using System.Windows; using System.Threading.Tasks; using SRNicoNico.ViewModels; using SRNicoNico.Views; using SRNicoNico.Models.NicoNicoViewer; using Livet; using Microsoft.Win32; namespace SRNicoNico { /// <summary> /// App.xaml の相互作用ロジック /// </summary> public partial class App : Application { public static MainWindowViewModel ViewModelRoot { get; private set; } private void Application_Startup(object sender, StartupEventArgs e) { } protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); DispatcherHelper.UIDispatcher = Dispatcher; AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", "SRNicoNico.exe", 0x00002AF9, Microsoft.Win32.RegistryValueKind.DWord); ViewModelRoot = new MainWindowViewModel(); MainWindow = new MainWindow { DataContext = ViewModelRoot }; MainWindow.Show(); } //集約エラーハンドラ private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { //TODO:ロギング処理など MessageBox.Show( "不明なエラーが発生しました。可能であれば、この文章をコピーして作者に報告していただれば幸いです。Ctrl+Cでコピーできます。\n ExceptionObject:" + e.ExceptionObject, "エラー", MessageBoxButton.OK, MessageBoxImage.Error); } } }
mit
C#
5eaf6240fe248c0f444fd038445c42e2a4f3bae5
Update GoogleApiException.cs
googleapis/google-api-dotnet-client,ivannaranjo/google-api-dotnet-client,Duikmeester/google-api-dotnet-client,googleapis/google-api-dotnet-client,Duikmeester/google-api-dotnet-client,Duikmeester/google-api-dotnet-client,chrisdunelm/google-api-dotnet-client,jskeet/google-api-dotnet-client,googleapis/google-api-dotnet-client,hurcane/google-api-dotnet-client,Duikmeester/google-api-dotnet-client,peleyal/google-api-dotnet-client,hurcane/google-api-dotnet-client,hurcane/google-api-dotnet-client,ivannaranjo/google-api-dotnet-client,jskeet/google-api-dotnet-client,chrisdunelm/google-api-dotnet-client,hurcane/google-api-dotnet-client,ivannaranjo/google-api-dotnet-client,jskeet/google-api-dotnet-client,peleyal/google-api-dotnet-client,chrisdunelm/google-api-dotnet-client,peleyal/google-api-dotnet-client,chrisdunelm/google-api-dotnet-client,ivannaranjo/google-api-dotnet-client
Src/GoogleApis.Core/GoogleApiException.cs
Src/GoogleApis.Core/GoogleApiException.cs
/* Copyright 2010 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; using System.Net; using Google.Apis.Requests; using Google.Apis.Util; namespace Google { /// <summary>Represents an exception thrown by an API Service.</summary> public class GoogleApiException : Exception { private readonly string serviceName; /// <summary>Gets the service name which related to this exception.</summary> public string ServiceName { get { return serviceName; } } /// <summary>Creates an API Service exception.</summary> public GoogleApiException(string serviceName, string message, Exception inner) : base(message, inner) { serviceName.ThrowIfNull("serviceName"); this.serviceName = serviceName; } /// <summary>Creates an API Service exception.</summary> public GoogleApiException(string serviceName, string message) : this(serviceName, message, null) { } /// <summary>The Error which was returned from the server, or <c>null</c> if unavailable.</summary> public RequestError Error { get; set; } /// <summary>The HTTP status code which was returned along with this error, or 0 if unavailable.</summary> public HttpStatusCode HttpStatusCode { get; set; } public override string ToString() { return string.Format("The service {1} has thrown an exception: {0}", base.ToString(), serviceName); } } }
/* Copyright 2010 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; using System.Net; using Google.Apis.Requests; using Google.Apis.Util; namespace Google { /// <summary>Represents an exception thrown by an API Service.</summary> public class GoogleApiException : Exception { private readonly string serviceName; /// <summary>Gets the service name which related to this exception.</summary> public string ServiceName { get { return serviceName; } } /// <summary>Creates an API Service exception.</summary> public GoogleApiException(string serviceName, string message, Exception inner) : base(message, inner) { serviceName.ThrowIfNull("serviceName"); this.serviceName = serviceName; } /// <summary>Creates an API Service exception.</summary> public GoogleApiException(string serviceName, string message) : this(serviceName, message, null) { } /// <summary>The Error which was returned from the server, or null if unavailable.</summary> public RequestError Error { get; set; } /// <summary>The HTTP status code which was returned along with this error, or 0 if unavailable.</summary> public HttpStatusCode HttpStatusCode { get; set; } public override string ToString() { return string.Format("The service {1} has thrown an exception: {0}", base.ToString(), serviceName); } } }
apache-2.0
C#
0069dd116744d2583914faad9e1f726edf6bfb84
Append 'Info' suffix to structs to alleviate naming conflicts
SICU-Stress-Measurement-System/frontend-cs
StressMeasurementSystem/Models/Patient.cs
StressMeasurementSystem/Models/Patient.cs
using System; using System.Collections.Generic; using System.Net.Mail; namespace StressMeasurementSystem.Models { public class Patient { #region Structs public struct NameInfo { public string Prefix { get; set; } public string First { get; set; } public string Middle { get; set; } public string Last { get; set; } public string Suffix { get; set; } public override string ToString() { return Prefix + " " + First + " " + Middle + " " + Last + ", " + Suffix; } } public struct OrganizationInfo { public string Company { get; set; } public string JobTitle { get; set; } } public struct PhoneInfo { public enum Type { Mobile, Home, Work, Main, WorkFax, HomeFax, Pager, Other } public string Number { get; set; } public Type T { get; set; } } public struct EmailInfo { public enum Type { Home, Work, Other } public MailAddress Address { get; set; } public Type T { get; set; } } #endregion #region Properties public NameInfo? Name { get; set; } public DateTime? DateOfBirth { get; set; } public OrganizationInfo? Organization { get; set; } public List<PhoneInfo> PhoneNumbers { get; set; } public List<EmailInfo> EmailAddresses { get; set; } #endregion #region Constructors public Patient() { Name = null; DateOfBirth = null; Organization = null; PhoneNumbers = null; EmailAddresses = null; } public Patient(NameInfo? nameInfo, DateTime? dateOfBirth, OrganizationInfo? organizationInfo, List<PhoneInfo> phoneNumbers, List<EmailInfo> emailAddresses) { Name = nameInfo; DateOfBirth = dateOfBirth; Organization = organizationInfo; PhoneNumbers = phoneNumbers; EmailAddresses = emailAddresses; } #endregion } }
using System; using System.Collections.Generic; using System.Net.Mail; namespace StressMeasurementSystem.Models { public class Patient { #region Structs public struct Name { public string Prefix { get; set; } public string First { get; set; } public string Middle { get; set; } public string Last { get; set; } public string Suffix { get; set; } public override string ToString() { return Prefix + " " + First + " " + Middle + " " + Last + ", " + Suffix; } } public struct Organization { public string Company { get; set; } public string JobTitle { get; set; } } public struct PhoneNumber { public enum Type { Mobile, Home, Work, Main, WorkFax, HomeFax, Pager, Other } public string Number { get; set; } public Type T { get; set; } } public struct EmailAddress { public enum Type { Home, Work, Other } public MailAddress Address { get; set; } public Type T { get; set; } } #endregion #region Properties public Name? NameOf { get; set; } public DateTime? DateOfBirth { get; set; } public Organization? OrganizationOf { get; set; } public List<PhoneNumber> PhoneNumbers { get; set; } public List<EmailAddress> EmailAddresses { get; set; } #endregion #region Constructors public Patient() { NameOf = null; DateOfBirth = null; OrganizationOf = null; PhoneNumbers = null; EmailAddresses = null; } public Patient(Name? name, DateTime? dateOfBirth, Organization? organization, List<PhoneNumber> phoneNumbers, List<EmailAddress> emailAddresses) { NameOf = name; DateOfBirth = dateOfBirth; OrganizationOf = organization; PhoneNumbers = phoneNumbers; EmailAddresses = emailAddresses; } #endregion } }
apache-2.0
C#
85410231b5cc8a90f1dba2aa382b73455eacc6fd
add Duplicate<T>()
TakeAsh/cs-TakeAshUtility
TakeAshUtility/GenericExtensionMethods.cs
TakeAshUtility/GenericExtensionMethods.cs
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; namespace TakeAshUtility { public static class GenericExtensionMethods { private const BindingFlags _flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly; /// <summary> /// Duplicate properties from source to destination. /// </summary> /// <typeparam name="T">Type of destination and source</typeparam> /// <param name="destination">Destination to be overwrited</param> /// <param name="source">Source of properties</param> /// <remarks> /// Properties to be Duplicated are Instance | Public | DeclaredOnly property. /// </remarks> public static void Duplicate<T>(this T destination, T source) { var properties = typeof(T).GetProperties(_flags) .Where(property => property.CanWrite == true && property.GetSetMethod() != null && property.GetGetMethod() != null && property.GetIndexParameters().Length == 0 ).SafeToArray(); if (destination == null || source == null || properties == null) { return; } properties.ForEach(property => property.SetValue(destination, property.GetValue(source, null), null)); } /// <summary> /// Duplicate properties from source to destination. /// </summary> /// <typeparam name="T">Type of destination and source</typeparam> /// <param name="destination">Destination to be overwrited</param> /// <param name="source">Source of properties</param> /// <param name="properties">Property names to be duplicated</param> public static void Duplicate<T>(this T destination, T source, IEnumerable<string> properties) { properties.ForEach(property => { var pi = typeof(T).GetProperty(property, Type.EmptyTypes); pi.SetValue(destination, pi.GetValue(source, null), null); }); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; namespace TakeAshUtility { public static class GenericExtensionMethods { private const BindingFlags _flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly; /// <summary> /// Duplicate properties from source to destination. /// </summary> /// <typeparam name="T">Type of destination and source</typeparam> /// <param name="destination">Destination to be overwrited</param> /// <param name="source">Source of properties</param> public static void Duplicate<T>(this T destination, T source) { var _properties = typeof(T).GetProperties(_flags) .Where(property => property.CanWrite == true && property.GetSetMethod() != null && property.GetGetMethod() != null && property.GetIndexParameters().Length == 0 ).SafeToArray(); if (destination == null || source == null || _properties == null) { return; } _properties.ForEach(property => property.SetValue(destination, property.GetValue(source, null), null)); } } }
mit
C#
bf3617f3b3005350286d698273a5807ab00ee833
Revert "fixed null ref exception"
OfficeDev/PnP-Sites-Core,OfficeDev/PnP-Sites-Core,OfficeDev/PnP-Sites-Core
Core/OfficeDevPnP.Core/Framework/Provisioning/Providers/Xml/Resolvers/V201801/AppCatalogFromModelToSchemaTypeResolver.cs
Core/OfficeDevPnP.Core/Framework/Provisioning/Providers/Xml/Resolvers/V201801/AppCatalogFromModelToSchemaTypeResolver.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml; using System.Xml.Linq; namespace OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.Resolvers.V201801 { internal class AppCatalogFromModelToSchemaTypeResolver : ITypeResolver { public string Name => this.GetType().Name; public bool CustomCollectionResolver => false; public AppCatalogFromModelToSchemaTypeResolver() { } public object Resolve(object source, Dictionary<String, IResolver> resolvers = null, Boolean recursive = false) { Object result = null; // Try with the tenant-wide AppCatalog var tenant = source as Model.ProvisioningTenant; var appCatalog = tenant?.AppCatalog; if (null == appCatalog) { // If that one is missing, let's try with the local Site Collection App Catalog var alm = source as Model.ApplicationLifecycleManagement; appCatalog = alm.AppCatalog; } if (null != appCatalog) { var appCatalogPackageTypeName = $"{PnPSerializationScope.Current?.BaseSchemaNamespace}.AppCatalogPackage, {PnPSerializationScope.Current?.BaseSchemaAssemblyName}"; var appCatalogPackageType = Type.GetType(appCatalogPackageTypeName, true); resolvers = new Dictionary<string, IResolver>(); resolvers.Add($"{appCatalogPackageType}.SkipFeatureDeploymentSpecified", new ExpressionValueResolver(() => true)); var resolver = new CollectionFromModelToSchemaTypeResolver(appCatalogPackageType); result = resolver.Resolve(appCatalog.Packages, resolvers, true); } return (result); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml; using System.Xml.Linq; namespace OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.Resolvers.V201801 { internal class AppCatalogFromModelToSchemaTypeResolver : ITypeResolver { public string Name => this.GetType().Name; public bool CustomCollectionResolver => false; public AppCatalogFromModelToSchemaTypeResolver() { } public object Resolve(object source, Dictionary<String, IResolver> resolvers = null, Boolean recursive = false) { Object result = null; // Try with the tenant-wide AppCatalog var tenant = source as Model.ProvisioningTenant; var appCatalog = tenant?.AppCatalog; if (null == appCatalog) { // If that one is missing, let's try with the local Site Collection App Catalog var alm = source as Model.ApplicationLifecycleManagement; if (alm != null && alm is Model.ApplicationLifecycleManagement) { appCatalog = alm.AppCatalog; } } if (null != appCatalog) { var appCatalogPackageTypeName = $"{PnPSerializationScope.Current?.BaseSchemaNamespace}.AppCatalogPackage, {PnPSerializationScope.Current?.BaseSchemaAssemblyName}"; var appCatalogPackageType = Type.GetType(appCatalogPackageTypeName, true); resolvers = new Dictionary<string, IResolver>(); resolvers.Add($"{appCatalogPackageType}.SkipFeatureDeploymentSpecified", new ExpressionValueResolver(() => true)); var resolver = new CollectionFromModelToSchemaTypeResolver(appCatalogPackageType); result = resolver.Resolve(appCatalog.Packages, resolvers, true); } return (result); } } }
mit
C#
9bb3e56bb3a22875f746175fee15640489713232
Implement half-width overflows
NeoAdonis/osu,ppy/osu,johnneijzen/osu,naoey/osu,peppy/osu,peppy/osu-new,naoey/osu,EVAST9919/osu,smoogipooo/osu,naoey/osu,2yangk23/osu,UselessToucan/osu,NeoAdonis/osu,peppy/osu,ppy/osu,2yangk23/osu,EVAST9919/osu,NeoAdonis/osu,ZLima12/osu,DrabWeb/osu,smoogipoo/osu,ppy/osu,DrabWeb/osu,smoogipoo/osu,smoogipoo/osu,UselessToucan/osu,UselessToucan/osu,DrabWeb/osu,peppy/osu,johnneijzen/osu,ZLima12/osu
osu.Game/Screens/Edit/Screens/Compose/Timeline/ScrollingTimelineContainer.cs
osu.Game/Screens/Edit/Screens/Compose/Timeline/ScrollingTimelineContainer.cs
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Beatmaps; using osu.Game.Graphics; namespace osu.Game.Screens.Edit.Screens.Compose.Timeline { public class ScrollingTimelineContainer : ScrollContainer { public readonly Bindable<bool> WaveformVisible = new Bindable<bool>(); public readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>(); private readonly Container waveformContainer; private readonly BeatmapWaveformGraph waveform; public ScrollingTimelineContainer() : base(Direction.Horizontal) { Masking = true; Child = waveformContainer = new Container { RelativeSizeAxes = Axes.Y, Child = waveform = new BeatmapWaveformGraph { RelativeSizeAxes = Axes.Both, Colour = OsuColour.FromHex("222"), Depth = float.MaxValue } }; waveform.Beatmap.BindTo(Beatmap); WaveformVisible.ValueChanged += waveformVisibilityChanged; } private float zoom = 10; protected override void Update() { base.Update(); waveformContainer.Margin = new MarginPadding { Horizontal = DrawWidth / 2 }; waveformContainer.Width = DrawWidth * zoom; } private void waveformVisibilityChanged(bool visible) => waveform.FadeTo(visible ? 1 : 0, 200, Easing.OutQuint); } }
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Beatmaps; using osu.Game.Graphics; namespace osu.Game.Screens.Edit.Screens.Compose.Timeline { public class ScrollingTimelineContainer : ScrollContainer { public readonly Bindable<bool> WaveformVisible = new Bindable<bool>(); public readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>(); private readonly BeatmapWaveformGraph waveform; public ScrollingTimelineContainer() : base(Direction.Horizontal) { Masking = true; Content.AutoSizeAxes = Axes.None; Content.RelativeSizeAxes = Axes.Both; Add(waveform = new BeatmapWaveformGraph { RelativeSizeAxes = Axes.Both, Colour = OsuColour.FromHex("222"), Depth = float.MaxValue }); waveform.Beatmap.BindTo(Beatmap); WaveformVisible.ValueChanged += waveformVisibilityChanged; } private void waveformVisibilityChanged(bool visible) => waveform.FadeTo(visible ? 1 : 0, 200, Easing.OutQuint); } }
mit
C#
0f0a3cc285de7d8d7d0e1a5b4e7312f771e614fc
Change Notifier.PropertyChanged event into explicit implementation.
Grabacr07/MetroTrilithon
source/MetroTrilithon/Mvvm/Notifier.cs
source/MetroTrilithon/Mvvm/Notifier.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Runtime.CompilerServices; using System.Threading.Tasks; namespace MetroTrilithon.Mvvm { /// <summary> /// プロパティ変更通知をサポートします。 /// </summary> public class Notifier : INotifyPropertyChanged { private event PropertyChangedEventHandler _propertyChanged; event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged { add { this._propertyChanged += value; } remove { this._propertyChanged -= value; } } /// <summary> /// <see cref="INotifyPropertyChanged.PropertyChanged"/> イベントを発生させます。 /// </summary> /// <param name="propertyName"></param> protected virtual void RaisePropertyChanged([CallerMemberName] string propertyName = null) { this._propertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Runtime.CompilerServices; using System.Threading.Tasks; namespace MetroTrilithon.Mvvm { public class Notifier : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; protected virtual void RaisePropertyChanged([CallerMemberName] string propertyName = null) { this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } }
mit
C#
0006492f3aaff8f962a9607c3af69eceae1953de
Fix typo in AdjacentPosition.cs
AngleSharp/AngleSharp,AngleSharp/AngleSharp,AngleSharp/AngleSharp,AngleSharp/AngleSharp,AngleSharp/AngleSharp
src/AngleSharp/Dom/AdjacentPosition.cs
src/AngleSharp/Dom/AdjacentPosition.cs
namespace AngleSharp.Dom { using AngleSharp.Attributes; /// <summary> /// Enumeration with possible values for the adjacent position insertion. /// </summary> public enum AdjacentPosition : byte { /// <summary> /// Before the element itself. /// </summary> [DomName("beforebegin")] BeforeBegin, /// <summary> /// Just inside the element, before its first child. /// </summary> [DomName("afterbegin")] AfterBegin, /// <summary> /// Just inside the element, after its last child. /// </summary> [DomName("beforeend")] BeforeEnd, /// <summary> /// After the element itself. /// </summary> [DomName("afterend")] AfterEnd } }
namespace AngleSharp.Dom { using AngleSharp.Attributes; /// <summary> /// Enumeration with possible values for the adjacent position insertation. /// </summary> public enum AdjacentPosition : byte { /// <summary> /// Before the element itself. /// </summary> [DomName("beforebegin")] BeforeBegin, /// <summary> /// Just inside the element, before its first child. /// </summary> [DomName("afterbegin")] AfterBegin, /// <summary> /// Just inside the element, after its last child. /// </summary> [DomName("beforeend")] BeforeEnd, /// <summary> /// After the element itself. /// </summary> [DomName("afterend")] AfterEnd } }
mit
C#
c150a145990a662258e685ea204a8e83a7333111
Add missing method
wtgodbe/corefx,shimingsg/corefx,shimingsg/corefx,ericstj/corefx,wtgodbe/corefx,ViktorHofer/corefx,ViktorHofer/corefx,BrennanConroy/corefx,ericstj/corefx,ericstj/corefx,wtgodbe/corefx,wtgodbe/corefx,BrennanConroy/corefx,shimingsg/corefx,BrennanConroy/corefx,wtgodbe/corefx,shimingsg/corefx,ericstj/corefx,shimingsg/corefx,ericstj/corefx,shimingsg/corefx,ericstj/corefx,ViktorHofer/corefx,ericstj/corefx,ViktorHofer/corefx,wtgodbe/corefx,shimingsg/corefx,ViktorHofer/corefx,ViktorHofer/corefx,ViktorHofer/corefx,wtgodbe/corefx
src/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.CountersUap.cs
src/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.CountersUap.cs
namespace System.Diagnostics.Tracing { public partial class EventCounter : System.IDisposable { public EventCounter(string name, System.Diagnostics.Tracing.EventSource eventSource) { } public void Dispose() { } public void WriteMetric(float value) { } } }
namespace System.Diagnostics.Tracing { public partial class EventCounter : System.IDisposable { public EventCounter(string name, System.Diagnostics.Tracing.EventSource eventSource) { } public void WriteMetric(float value) { } } }
mit
C#
804a6327910ed5ddde81c1a0ef2fcb6350ec3f9d
fix typo
chocolatey/nuget-chocolatey,jholovacs/NuGet,pratikkagda/nuget,ctaggart/nuget,mono/nuget,antiufo/NuGet2,mrward/NuGet.V2,GearedToWar/NuGet2,jholovacs/NuGet,xoofx/NuGet,jmezach/NuGet2,mrward/nuget,jmezach/NuGet2,jmezach/NuGet2,RichiCoder1/nuget-chocolatey,RichiCoder1/nuget-chocolatey,jholovacs/NuGet,rikoe/nuget,pratikkagda/nuget,antiufo/NuGet2,pratikkagda/nuget,oliver-feng/nuget,RichiCoder1/nuget-chocolatey,GearedToWar/NuGet2,chocolatey/nuget-chocolatey,alluran/node.net,alluran/node.net,xoofx/NuGet,alluran/node.net,jholovacs/NuGet,pratikkagda/nuget,RichiCoder1/nuget-chocolatey,indsoft/NuGet2,ctaggart/nuget,xoofx/NuGet,mrward/nuget,akrisiun/NuGet,jmezach/NuGet2,ctaggart/nuget,oliver-feng/nuget,mrward/NuGet.V2,ctaggart/nuget,OneGet/nuget,xoofx/NuGet,oliver-feng/nuget,OneGet/nuget,mrward/NuGet.V2,chocolatey/nuget-chocolatey,chocolatey/nuget-chocolatey,indsoft/NuGet2,mrward/nuget,oliver-feng/nuget,jmezach/NuGet2,dolkensp/node.net,rikoe/nuget,mono/nuget,indsoft/NuGet2,mrward/nuget,RichiCoder1/nuget-chocolatey,alluran/node.net,mono/nuget,indsoft/NuGet2,jholovacs/NuGet,jmezach/NuGet2,RichiCoder1/nuget-chocolatey,antiufo/NuGet2,dolkensp/node.net,GearedToWar/NuGet2,antiufo/NuGet2,indsoft/NuGet2,GearedToWar/NuGet2,pratikkagda/nuget,oliver-feng/nuget,oliver-feng/nuget,chocolatey/nuget-chocolatey,mrward/nuget,GearedToWar/NuGet2,xoofx/NuGet,pratikkagda/nuget,jholovacs/NuGet,OneGet/nuget,dolkensp/node.net,OneGet/nuget,mrward/NuGet.V2,rikoe/nuget,GearedToWar/NuGet2,xoofx/NuGet,mrward/NuGet.V2,indsoft/NuGet2,mrward/NuGet.V2,antiufo/NuGet2,antiufo/NuGet2,mono/nuget,dolkensp/node.net,akrisiun/NuGet,chocolatey/nuget-chocolatey,mrward/nuget,rikoe/nuget
src/Core/FileModifiers/Preprocessor.cs
src/Core/FileModifiers/Preprocessor.cs
using NuGet.Resources; using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Text.RegularExpressions; namespace NuGet { /// <summary> /// Simple token replacement system for content files. /// </summary> public class Preprocessor : IPackageFileTransformer { private static readonly Regex _tokenRegex = new Regex(@"\$(?<propertyName>\w+)\$"); public void TransformFile(IPackageFile file, string targetPath, IProjectSystem projectSystem) { ProjectSystemExtensions.TryAddFile(projectSystem, targetPath, () => Process(file, projectSystem).AsStream()); } public void RevertFile(IPackageFile file, string targetPath, IEnumerable<IPackageFile> matchingFiles, IProjectSystem projectSystem) { Func<Stream> streamFactory = () => Process(file, projectSystem).AsStream(); FileSystemExtensions.DeleteFileSafe(projectSystem, targetPath, streamFactory); } internal static string Process(IPackageFile file, IPropertyProvider propertyProvider) { using (var stream = file.GetStream()) { return Process(stream, propertyProvider, throwIfNotFound: false); } } public static string Process(Stream stream, IPropertyProvider propertyProvider, bool throwIfNotFound = true) { // Fix for bug https://nuget.codeplex.com/workitem/3174, source code transformations must support BOM byte[] bytes = stream.ReadAllBytes(); string text = Encoding.UTF8.GetString(bytes); return _tokenRegex.Replace(text, match => ReplaceToken(match, propertyProvider, throwIfNotFound)); } private static string ReplaceToken(Match match, IPropertyProvider propertyProvider, bool throwIfNotFound) { string propertyName = match.Groups["propertyName"].Value; var value = propertyProvider.GetPropertyValue(propertyName); if (value == null && throwIfNotFound) { throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, NuGetResources.TokenHasNoValue, propertyName)); } return value; } } }
using NuGet.Resources; using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Text.RegularExpressions; namespace NuGet { /// <summary> /// Simple token replacement system for content files. /// </summary> public class Preprocessor : IPackageFileTransformer { private static readonly Regex _tokenRegex = new Regex(@"\$(?<propertyName>\w+)\$"); public void TransformFile(IPackageFile file, string targetPath, IProjectSystem projectSystem) { ProjectSystemExtensions.TryAddFile(projectSystem, targetPath, () => Process(file, projectSystem).AsStream()); } public void RevertFile(IPackageFile file, string targetPath, IEnumerable<IPackageFile> matchingFiles, IProjectSystem projectSystem) { Func<Stream> streamFactory = () => Process(file, projectSystem).AsStream(); FileSystemExtensions.DeleteFileSafe(projectSystem, targetPath, streamFactory); } internal static string Process(IPackageFile file, IPropertyProvider propertyProvider) { using (var stream = file.GetStream()) { return Process(stream, propertyProvider, throwIfNotFound: false); } } public static string Process(Stream stream, IPropertyProvider propertyProvider, bool throwIfNotFound = true) { // Fix for bug https://nuget.codeplex.com/workitem/3174, source code transfomation to support BOM byte[] bytes = stream.ReadAllBytes(); string text = Encoding.UTF8.GetString(bytes); return _tokenRegex.Replace(text, match => ReplaceToken(match, propertyProvider, throwIfNotFound)); } private static string ReplaceToken(Match match, IPropertyProvider propertyProvider, bool throwIfNotFound) { string propertyName = match.Groups["propertyName"].Value; var value = propertyProvider.GetPropertyValue(propertyName); if (value == null && throwIfNotFound) { throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, NuGetResources.TokenHasNoValue, propertyName)); } return value; } } }
apache-2.0
C#
b0d4d1155f8e396955c01a3d7c5c2d888ddfbedf
Remove unused code
Ackara/Daterpillar
src/Daterpillar.CommandLine/Program.cs
src/Daterpillar.CommandLine/Program.cs
using Gigobyte.Daterpillar.Arguments; using Gigobyte.Daterpillar.Commands; using System; namespace Gigobyte.Daterpillar { public class Program { internal static void Main(string[] args) { InitializeWindow(); var options = new Options(); if (args.Length > 0) { CommandLine.Parser.Default.ParseArguments(args, options, onVerbCommand: (verb, arg) => { ICommand command = new CommandFactory().CrateInstance(verb); try { _exitCode = command.Execute(arg); } catch (Exception ex) { _exitCode = ExitCode.UnhandledException; Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(ex); } }); } else Console.WriteLine(options.GetHelp()); Environment.Exit(_exitCode); } #region Private Members private static int _exitCode; private static void InitializeWindow() { Console.Title = $"{nameof(Daterpillar)} CLI"; } #endregion Private Members } }
using Gigobyte.Daterpillar.Arguments; using Gigobyte.Daterpillar.Commands; using System; namespace Gigobyte.Daterpillar { public class Program { internal static void Main(string[] args) { InitializeWindow(); int exitCode = 0; var options = new Options(); if (args.Length > 0) { var errorOccurred = CommandLine.Parser.Default.ParseArguments(args, options, onVerbCommand: (verb, arg) => { ICommand command = new CommandFactory().CrateInstance(verb); try { exitCode = command.Execute(arg); } catch (Exception ex) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(ex); exitCode = 1; } }); } else Console.WriteLine(options.GetHelp()); Environment.Exit(exitCode); } #region Private Members private static readonly string _logo = @" _____ _ _ _ _ | __ \ | | (_) | | | | | | __ _| |_ ___ _ __ _ __ _| | | __ _ _ __ | | | |/ _` | __/ _ \ '__| '_ \| | | |/ _` | '__| | |__| | (_| | || __/ | | |_) | | | | (_| | | |_____/ \__,_|\__\___|_| | .__/|_|_|_|\__,_|_| | | |_| "; private static void InitializeWindow() { Console.Title = $"{nameof(Daterpillar)} CLI"; Console.WriteLine(_logo.Trim()); } #endregion Private Members } }
mit
C#
f31bfb1be4c0b71208738dc75feb03b78afe3f5e
Add explicit test to create database schema scripts
peopleware/net-ppwcode-vernacular-nhibernate
src/II.Tests/ConventionMappingTests.cs
src/II.Tests/ConventionMappingTests.cs
// Copyright 2017 by PeopleWare n.v.. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using System; using NHibernate.Cfg; using NHibernate.Cfg.MappingSchema; using NHibernate.Mapping; using NHibernate.Mapping.ByCode; using NHibernate.Tool.hbm2ddl; using NUnit.Framework; using PPWCode.Vernacular.NHibernate.II.SqlServer; using PPWCode.Vernacular.NHibernate.II.Tests.Models; namespace PPWCode.Vernacular.NHibernate.II.Tests { [TestFixture] public class ConventionMappingTests { [Test] [Explicit] public void DatabaseScript() { Configuration configuration = new Configuration() .DataBaseIntegration(db => db.Dialect<MsSqlDialect>()) .Configure(); IPpwHbmMapping mapper = new TestsSimpleModelMapper(new TestsMappingAssemblies()); HbmMapping hbmMapping = mapper.HbmMapping; configuration.AddMapping(hbmMapping); IAuxiliaryDatabaseObject[] auxiliaryDatabaseObjects = { new TestHighLowPerTableAuxiliaryDatabaseObject(mapper), new UniqueConstraintsForExtendedCompany(mapper) }; foreach (IAuxiliaryDatabaseObject auxiliaryDatabaseObject in auxiliaryDatabaseObjects) { IPpwAuxiliaryDatabaseObject ppwAuxiliaryDatabaseObject = auxiliaryDatabaseObject as IPpwAuxiliaryDatabaseObject; ppwAuxiliaryDatabaseObject?.SetConfiguration(configuration); configuration.AddAuxiliaryDatabaseObject(auxiliaryDatabaseObject); } SchemaExport schemaExport = new SchemaExport(configuration); schemaExport.Create(true, false); } [Test] [Explicit] public void XmlMapping() { IPpwHbmMapping mapper = new TestsSimpleModelMapper(new TestsMappingAssemblies()); HbmMapping hbmMapping = mapper.HbmMapping; Console.WriteLine(hbmMapping.AsString()); } } }
// Copyright 2017 by PeopleWare n.v.. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using System; using NHibernate.Cfg.MappingSchema; using NHibernate.Mapping.ByCode; using NUnit.Framework; namespace PPWCode.Vernacular.NHibernate.II.Tests { [TestFixture] public class ConventionMappingTests { [Test] [Explicit] public void XmlMapping() { IPpwHbmMapping mapper = new TestsSimpleModelMapper(new TestsMappingAssemblies()); HbmMapping hbmMapping = mapper.HbmMapping; Console.WriteLine(hbmMapping.AsString()); } } }
apache-2.0
C#
ec6f93773b7785fd3d166ef156cd3be8d97d1e24
Fix build
cwensley/maccore,mono/maccore,beni55/maccore,jorik041/maccore
src/Foundation/NSCoder.cs
src/Foundation/NSCoder.cs
// // NSCoder support // // Author: // Miguel de Icaza // // Copyright 2010, Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Runtime.InteropServices; namespace MonoMac.Foundation { public partial class NSCoder { public void Encode (byte [] buffer, string key) { if (buffer == null) throw new ArgumentNullException ("buffer"); if (key == null) throw new ArgumentNullException ("key"); unsafe { fixed (byte *p = &buffer[0]){ EncodeBlock ((IntPtr) p, buffer.Length, key); } } } public void Encode (byte [] buffer, int offset, int count, string key) { if (buffer == null) throw new ArgumentNullException ("buffer"); if (key == null) throw new ArgumentNullException ("key"); if (offset < 0) throw new ArgumentException ("offset < 0"); if (count < 0) throw new ArgumentException ("count < 0"); if (offset > buffer.Length - count) throw new ArgumentException ("Reading would overrun buffer"); unsafe { fixed (byte *p = &buffer[0]){ EncodeBlock ((IntPtr) p, buffer.Length, key); } } } public byte [] DecodeBytes (string key) { unsafe { int len = 0; int *pl = &len; IntPtr ret = DecodeBytes (key, (IntPtr) pl); if (ret == IntPtr.Zero) return null; byte [] retarray = new byte [len]; Marshal.Copy (ret, retarray, 0, len); return retarray; } } } }
// // NSCoder support // // Author: // Miguel de Icaza // // Copyright 2010, Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace MonoMac.Foundation { public partial class NSCoder { public void Encode (byte [] buffer, string key) { if (buffer == null) throw new ArgumentNullException ("buffer"); if (key == null) throw new ArgumentNullException ("key"); unsafe { fixed (byte *p = &buffer[0]){ EncodeBlock ((IntPtr) p, buffer.Length, key); } } } public void Encode (byte [] buffer, int offset, int count, string key) { if (buffer == null) throw new ArgumentNullException ("buffer"); if (key == null) throw new ArgumentNullException ("key"); if (offset < 0) throw new ArgumentException ("offset < 0"); if (count < 0) throw new ArgumentException ("count < 0"); if (offset > buffer.Length - count) throw new ArgumentException ("Reading would overrun buffer"); unsafe { fixed (byte *p = &buffer[0]){ EncodeBlock ((IntPtr) p, buffer.Length, key); } } } public byte [] DecodeBytes (string key) { unsafe { int len = 0; int *pl = &len; IntPtr ret = DecodeBytes (key, (IntPtr) pl); if (ret == IntPtr.Zero) return null; byte [] retarray = new byte [len]; Marshal.Copy (ret, retarray, 0, len); return retarray; } } } }
apache-2.0
C#
963bb6b24d586159f86a41705621b628c366d96d
Write line after getting password
appharbor/appharbor-cli
src/AppHarbor/Commands/LoginAuthCommand.cs
src/AppHarbor/Commands/LoginAuthCommand.cs
using System.IO; using RestSharp; using RestSharp.Contrib; namespace AppHarbor.Commands { [CommandHelp("Login to AppHarbor", alias: "login")] public class LoginAuthCommand : ICommand { private readonly IAccessTokenConfiguration _accessTokenConfiguration; private readonly IMaskedInput _maskedInput; private readonly TextReader _reader; private readonly TextWriter _writer; public LoginAuthCommand(IAccessTokenConfiguration accessTokenConfiguration, IMaskedInput maskedInput, TextReader reader, TextWriter writer) { _accessTokenConfiguration = accessTokenConfiguration; _maskedInput = maskedInput; _reader = reader; _writer = writer; } public void Execute(string[] arguments) { if (_accessTokenConfiguration.GetAccessToken() != null) { throw new CommandException("You're already logged in"); } _writer.Write("Username: "); var username = _reader.ReadLine(); _writer.Write("Password: "); var password = _maskedInput.Get(); _writer.WriteLine(); var accessToken = GetAccessToken(username, password); _accessTokenConfiguration.SetAccessToken(accessToken); _writer.WriteLine("Successfully logged in as {0}", username); } 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)["access_token"]; if (accessToken == null) { throw new CommandException("Couldn't log in. Try again"); } return accessToken; } } }
using System.IO; using RestSharp; using RestSharp.Contrib; namespace AppHarbor.Commands { [CommandHelp("Login to AppHarbor", alias: "login")] public class LoginAuthCommand : ICommand { private readonly IAccessTokenConfiguration _accessTokenConfiguration; private readonly IMaskedInput _maskedInput; private readonly TextReader _reader; private readonly TextWriter _writer; public LoginAuthCommand(IAccessTokenConfiguration accessTokenConfiguration, IMaskedInput maskedInput, TextReader reader, TextWriter writer) { _accessTokenConfiguration = accessTokenConfiguration; _maskedInput = maskedInput; _reader = reader; _writer = writer; } public void Execute(string[] arguments) { if (_accessTokenConfiguration.GetAccessToken() != null) { throw new CommandException("You're already logged in"); } _writer.Write("Username: "); var username = _reader.ReadLine(); _writer.Write("Password: "); var password = _maskedInput.Get(); var accessToken = GetAccessToken(username, password); _accessTokenConfiguration.SetAccessToken(accessToken); _writer.WriteLine("Successfully logged in as {0}", username); } 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)["access_token"]; if (accessToken == null) { throw new CommandException("Couldn't log in. Try again"); } return accessToken; } } }
mit
C#
03e8e5ec24f3d524d2af2322a7556fefaebe0e1c
Add comment explaining why testcase is commented out.
EamonNerbonne/a-vs-an,EamonNerbonne/a-vs-an,EamonNerbonne/a-vs-an,EamonNerbonne/a-vs-an
A-vs-An/AvsAn-Test/StandardCasesWork.cs
A-vs-An/AvsAn-Test/StandardCasesWork.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using AvsAnLib; using ExpressionToCodeLib; using Xunit.Extensions; namespace AvsAn_Test { public class StandardCasesWork { [Theory] [InlineData("an", "unanticipated result")] [InlineData("a", "unanimous vote")] [InlineData("an", "honest decision")] [InlineData("a", "honeysuckle shrub")] [InlineData("an", "0800 number")] //[InlineData("an", "∞ of oregano")]//no longer reliable in latest wikidump! [InlineData("a", "NASA scientist")] [InlineData("an", "NSA analyst")] [InlineData("a", "FIAT car")] [InlineData("an", "FAA policy")] [InlineData("an", "A")] [InlineData("a", "uniformed agent")] [InlineData("an", "unissued permit")] [InlineData("an", "unilluminating argument")] public void DoTest(string article, string word) { PAssert.That(() => AvsAn.Query(word).Article == article); } [Theory] [InlineData("a", "", "")] [InlineData("a", "'", "'")] [InlineData("an", "N", "N ")] [InlineData("a", "NASA", "NAS")] public void CheckOddPrefixes(string article, string word, string prefix) { PAssert.That(() => AvsAn.Query(word).Article == article && AvsAn.Query(word).Prefix == prefix); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using AvsAnLib; using ExpressionToCodeLib; using Xunit.Extensions; namespace AvsAn_Test { public class StandardCasesWork { [Theory] [InlineData("an", "unanticipated result")] [InlineData("a", "unanimous vote")] [InlineData("an", "honest decision")] [InlineData("a", "honeysuckle shrub")] [InlineData("an", "0800 number")] //[InlineData("an", "∞ of oregano")] [InlineData("a", "NASA scientist")] [InlineData("an", "NSA analyst")] [InlineData("a", "FIAT car")] [InlineData("an", "FAA policy")] [InlineData("an", "A")] [InlineData("a", "uniformed agent")] [InlineData("an", "unissued permit")] [InlineData("an", "unilluminating argument")] public void DoTest(string article, string word) { PAssert.That(() => AvsAn.Query(word).Article == article); } [Theory] [InlineData("a", "", "")] [InlineData("a", "'", "'")] [InlineData("an", "N", "N ")] [InlineData("a", "NASA", "NAS")] public void CheckOddPrefixes(string article, string word, string prefix) { PAssert.That(() => AvsAn.Query(word).Article == article && AvsAn.Query(word).Prefix == prefix); } } }
apache-2.0
C#
f51894c850ef89db4eafe25f8e76819e86c0e767
Increment library version as version on pre-release line messed up versioning
volak/Aggregates.NET,volak/Aggregates.NET
src/SharedAssemblyInfo.cs
src/SharedAssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyProduct("Aggregates.NET")] [assembly: AssemblyDescription(".NET event sourced domain driven design model via NServiceBus and EventStore")] [assembly: AssemblyCopyright("Copyright © Charles Solar 2017")] [assembly: AssemblyVersion("0.13.0.0")] [assembly: AssemblyFileVersion("0.13.0.0")] [assembly: AssemblyInformationalVersion("0.13.0.0")] [assembly: InternalsVisibleTo("Aggregates.NET.UnitTests")] [assembly: InternalsVisibleTo("Aggregates.NET")] [assembly: InternalsVisibleTo("Aggregates.NET.EventStore")] [assembly: InternalsVisibleTo("Aggregates.NET.NServiceBus")] [assembly: InternalsVisibleTo("Aggregates.NET.NewtonsoftJson")] [assembly: InternalsVisibleTo("Aggregates.NET.StructureMap")] [assembly: InternalsVisibleTo("Aggregates.NET.SimpleInjector")]
using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyProduct("Aggregates.NET")] [assembly: AssemblyDescription(".NET event sourced domain driven design model via NServiceBus and EventStore")] [assembly: AssemblyCopyright("Copyright © Charles Solar 2017")] [assembly: AssemblyVersion("0.12.0.0")] [assembly: AssemblyFileVersion("0.12.0.0")] [assembly: AssemblyInformationalVersion("0.12.0.0")] [assembly: InternalsVisibleTo("Aggregates.NET.UnitTests")] [assembly: InternalsVisibleTo("Aggregates.NET")] [assembly: InternalsVisibleTo("Aggregates.NET.EventStore")] [assembly: InternalsVisibleTo("Aggregates.NET.NServiceBus")] [assembly: InternalsVisibleTo("Aggregates.NET.NewtonsoftJson")] [assembly: InternalsVisibleTo("Aggregates.NET.StructureMap")] [assembly: InternalsVisibleTo("Aggregates.NET.SimpleInjector")]
mit
C#
fbe6cc576e1ac55c3b42cdf12474ebdc9e6e4c3a
Make EventArgs base class serializable (dotnet/coreclr#15541)
Ermiar/corefx,shimingsg/corefx,ViktorHofer/corefx,ericstj/corefx,Jiayili1/corefx,ViktorHofer/corefx,ptoonen/corefx,ericstj/corefx,zhenlan/corefx,ravimeda/corefx,Ermiar/corefx,BrennanConroy/corefx,ericstj/corefx,Jiayili1/corefx,ravimeda/corefx,ptoonen/corefx,ViktorHofer/corefx,ptoonen/corefx,mmitche/corefx,wtgodbe/corefx,zhenlan/corefx,wtgodbe/corefx,ptoonen/corefx,ravimeda/corefx,mmitche/corefx,ericstj/corefx,ericstj/corefx,wtgodbe/corefx,ravimeda/corefx,shimingsg/corefx,mmitche/corefx,Jiayili1/corefx,Jiayili1/corefx,Ermiar/corefx,shimingsg/corefx,ptoonen/corefx,zhenlan/corefx,mmitche/corefx,ptoonen/corefx,BrennanConroy/corefx,shimingsg/corefx,shimingsg/corefx,wtgodbe/corefx,ravimeda/corefx,ptoonen/corefx,Ermiar/corefx,ViktorHofer/corefx,shimingsg/corefx,zhenlan/corefx,ericstj/corefx,mmitche/corefx,zhenlan/corefx,ViktorHofer/corefx,wtgodbe/corefx,Ermiar/corefx,zhenlan/corefx,mmitche/corefx,mmitche/corefx,ViktorHofer/corefx,zhenlan/corefx,wtgodbe/corefx,wtgodbe/corefx,ravimeda/corefx,ViktorHofer/corefx,Jiayili1/corefx,shimingsg/corefx,ravimeda/corefx,Ermiar/corefx,Jiayili1/corefx,ericstj/corefx,Jiayili1/corefx,BrennanConroy/corefx,Ermiar/corefx
src/Common/src/CoreLib/System/EventArgs.cs
src/Common/src/CoreLib/System/EventArgs.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 System; namespace System { // The base class for all event classes. [Serializable] [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] public class EventArgs { public static readonly EventArgs Empty = new EventArgs(); public EventArgs() { } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; namespace System { // The base class for all event classes. public class EventArgs { public static readonly EventArgs Empty = new EventArgs(); public EventArgs() { } } }
mit
C#
8d3ca463f56c034185ce4e1c73e37c0a57a5d5af
Apply recommendation from resharper
aluxnimm/outlookcaldavsynchronizer
CalDavSynchronizer/Ui/ConnectionTests/CalendarOwnerProperties.cs
CalDavSynchronizer/Ui/ConnectionTests/CalendarOwnerProperties.cs
// This file is Part of CalDavSynchronizer (http://outlookcaldavsynchronizer.sourceforge.net/) // Copyright (c) 2015 Gerhard Zehetbauer // Copyright (c) 2015 Alexander Nimmervoll // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. using System; namespace CalDavSynchronizer.Ui.ConnectionTests { public class CalendarOwnerProperties { public CalendarOwnerProperties (string calendarOwnerEmail, bool isSharedCalendar) { CalendarOwnerEmail = calendarOwnerEmail; IsSharedCalendar = isSharedCalendar; } public string CalendarOwnerEmail { get; } public bool IsSharedCalendar { get; } } }
// This file is Part of CalDavSynchronizer (http://outlookcaldavsynchronizer.sourceforge.net/) // Copyright (c) 2015 Gerhard Zehetbauer // Copyright (c) 2015 Alexander Nimmervoll // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. using System; namespace CalDavSynchronizer.Ui.ConnectionTests { public class CalendarOwnerProperties { private readonly string _calendarOwnerEmail; private readonly bool _isSharedCalendar; public CalendarOwnerProperties (string calendarOwnerEmail, bool isSharedCalendar) { _calendarOwnerEmail = calendarOwnerEmail; _isSharedCalendar = isSharedCalendar; } public string CalendarOwnerEmail { get { return _calendarOwnerEmail; } } public bool IsSharedCalendar { get { return _isSharedCalendar; } } } }
agpl-3.0
C#
45a371723d3242c4ec9e2d4ff703a45306d0269d
Allow TouchInput to receive more than one touch to apply with
ZLima12/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,ppy/osu-framework,ppy/osu-framework,EVAST9919/osu-framework
osu.Framework/Input/StateChanges/TouchInput.cs
osu.Framework/Input/StateChanges/TouchInput.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 System.Collections.Generic; using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Input.StateChanges.Events; using osu.Framework.Input.States; namespace osu.Framework.Input.StateChanges { /// <summary> /// Denotes a change of a touch input. /// </summary> public class TouchInput : IInput { /// <summary> /// The list of touch structures each providing the source and position to move to. /// </summary> public readonly IEnumerable<Touch> Touches; /// <summary> /// Whether to activate the provided <see cref="Touches"/>. /// </summary> public readonly bool Activate; /// <summary> /// Constructs a new <see cref="TouchInput"/>. /// </summary> /// <param name="touch">The <see cref="Touch"/>.</param> /// <param name="activate">Whether to activate the provided <param ref="touch"/>, must be true if changing position only.</param> public TouchInput(Touch touch, bool activate) : this(touch.Yield(), activate) { } /// <summary> /// Constructs a new <see cref="TouchInput"/>. /// </summary> /// <param name="touches">The list of <see cref="Touch"/>es.</param> /// <param name="activate">Whether to activate the provided <param ref="touches"/>, must be true if changing position only.</param> public TouchInput(IEnumerable<Touch> touches, bool activate) { Touches = touches; Activate = activate; } public void Apply(InputState state, IInputStateChangeHandler handler) { var touches = state.Touch; foreach (var touch in Touches) { var lastPosition = touches.GetTouchPosition(touch.Source); touches.TouchPositions[(int)touch.Source] = touch.Position; bool activityChanged = touches.ActiveSources.SetPressed(touch.Source, Activate); var positionChanged = lastPosition != null && touch.Position != lastPosition; if (activityChanged || positionChanged) { handler.HandleInputStateChange(new TouchStateChangeEvent(state, this, touch, !activityChanged ? (bool?)null : Activate, !positionChanged ? null : lastPosition )); } } } } }
// 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.Input.StateChanges.Events; using osu.Framework.Input.States; namespace osu.Framework.Input.StateChanges { /// <summary> /// Denotes a change of a touch input. /// </summary> public class TouchInput : IInput { /// <summary> /// The touch structure providing the source and position to move to. /// </summary> public readonly Touch Touch; /// <summary> /// Whether to activate the provided <see cref="Touch"/>. /// </summary> public readonly bool Activate; /// <summary> /// Constructs a new <see cref="TouchInput"/>. /// </summary> /// <param name="touch">The <see cref="Touch"/>.</param> /// <param name="activate">Whether to activate the provided <see cref="Touch"/>, must be true if changing position only.</param> public TouchInput(Touch touch, bool activate) { Touch = touch; Activate = activate; } public void Apply(InputState state, IInputStateChangeHandler handler) { var touches = state.Touch; var lastPosition = touches.GetTouchPosition(Touch.Source); touches.TouchPositions[(int)Touch.Source] = Touch.Position; bool activityChanged = touches.ActiveSources.SetPressed(Touch.Source, Activate); var positionChanged = lastPosition != null && Touch.Position != lastPosition; if (activityChanged || positionChanged) { handler.HandleInputStateChange(new TouchStateChangeEvent(state, this, Touch, !activityChanged ? (bool?)null : Activate, !positionChanged ? null : lastPosition )); } } } }
mit
C#
ddbd240d7604e85ed40ded8c6bdba8e6719a35e8
Fix settings checkboxes not being searchable (#5003)
johnneijzen/osu,EVAST9919/osu,peppy/osu-new,NeoAdonis/osu,2yangk23/osu,ppy/osu,EVAST9919/osu,ZLima12/osu,smoogipooo/osu,UselessToucan/osu,NeoAdonis/osu,NeoAdonis/osu,peppy/osu,UselessToucan/osu,peppy/osu,ppy/osu,UselessToucan/osu,2yangk23/osu,smoogipoo/osu,peppy/osu,ZLima12/osu,johnneijzen/osu,ppy/osu,smoogipoo/osu,smoogipoo/osu
osu.Game/Overlays/Settings/SettingsCheckbox.cs
osu.Game/Overlays/Settings/SettingsCheckbox.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.Graphics; using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Settings { public class SettingsCheckbox : SettingsItem<bool> { private OsuCheckbox checkbox; private string labelText; protected override Drawable CreateControl() => checkbox = new OsuCheckbox(); public override string LabelText { get => labelText; set => checkbox.LabelText = labelText = value; } } }
// 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.Graphics; using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Settings { public class SettingsCheckbox : SettingsItem<bool> { private OsuCheckbox checkbox; protected override Drawable CreateControl() => checkbox = new OsuCheckbox(); public override string LabelText { set => checkbox.LabelText = value; } } }
mit
C#
4c65e1f20041a9dd9d719a7fc745b989ab1492b7
Add labels to add form
mattgwagner/Cash-Flow-Projection,mattgwagner/Cash-Flow-Projection,mattgwagner/Cash-Flow-Projection,mattgwagner/Cash-Flow-Projection
src/Cash-Flow-Projection/Views/Home/Add.cshtml
src/Cash-Flow-Projection/Views/Home/Add.cshtml
@model Cash_Flow_Projection.Models.Entry @using (Html.BeginForm("Add", "Home", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { @Html.AntiForgeryToken() @Html.ValidationSummary() <div class="form-group form-group-xlg"> @Html.DisplayNameFor(m => m.Date) @Html.EditorFor(m => m.Date, new { @class = "form-control", required = "required", placeholder = Html.DisplayNameFor(x => x.Date) }) </div> <div class="form-group form-group-xlg"> @Html.DisplayNameFor(m => m.Amount) @Html.TextBoxFor(m => m.Amount, new { @class = "form-control", required = "required", placeholder = Html.DisplayNameFor(x => x.Amount) }) </div> <div class="form-group form-group-xlg"> @Html.DisplayNameFor(m => m.Description) @Html.TextBoxFor(m => m.Description, new { @class = "form-control", placeholder = Html.DisplayNameFor(x => x.Description) }) </div> <button type="submit">Add Entry</button> }
@model Cash_Flow_Projection.Models.Entry @using (Html.BeginForm("Add", "Home", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { @Html.AntiForgeryToken() @Html.ValidationSummary() <div class="form-group form-group-xlg"> @Html.EditorFor(m => m.Date, new { @class = "form-control", required = "required", placeholder = Html.DisplayNameFor(x => x.Date) }) </div> <div class="form-group form-group-xlg"> @Html.TextBoxFor(m => m.Amount, new { @class = "form-control", required = "required", placeholder = Html.DisplayNameFor(x => x.Amount) }) </div> <div class="form-group form-group-xlg"> @Html.TextBoxFor(m => m.Description, new { @class = "form-control", placeholder = Html.DisplayNameFor(x => x.Description) }) </div> <button type="submit">Add Entry</button> }
mit
C#
82bf37f9751d0ecfb2e5ad57532fd6b70d2ec89b
Update client properties
pardahlman/RawRabbit,northspb/RawRabbit
src/RawRabbit/Common/ClientPropertyProvider.cs
src/RawRabbit/Common/ClientPropertyProvider.cs
using System; using System.Collections.Generic; using System.Reflection; using RawRabbit.Configuration; namespace RawRabbit.Common { public interface IClientPropertyProvider { IDictionary<string, object> GetClientProperties(RawRabbitConfiguration cfg = null, BrokerConfiguration brokerCfg = null); } public class ClientPropertyProvider : IClientPropertyProvider { public IDictionary<string, object> GetClientProperties(RawRabbitConfiguration cfg = null, BrokerConfiguration brokerCfg = null) { var props = new Dictionary<string, object> { { "product", "RawRabbit" }, { "version", typeof(BusClient).Assembly.GetName().Version.ToString() }, { "platform", ".NET" }, { "client_directory", typeof(BusClient).Assembly.CodeBase}, { "client_server", Environment.MachineName }, }; if (brokerCfg != null) { props.Add("broker_username", brokerCfg.Username); } if (cfg != null) { props.Add("request_timeout", cfg.RequestTimeout.ToString("g")); } return props; } } }
using System; using System.Collections.Generic; using RawRabbit.Configuration; namespace RawRabbit.Common { public interface IClientPropertyProvider { IDictionary<string, object> GetClientProperties(RawRabbitConfiguration cfg = null, BrokerConfiguration brokerCfg = null); } public class ClientPropertyProvider : IClientPropertyProvider { public IDictionary<string, object> GetClientProperties(RawRabbitConfiguration cfg = null, BrokerConfiguration brokerCfg = null) { var props = new Dictionary<string, object> { { "client_api", "RawRabbit" }, { "client_version", typeof(BusClient).Assembly.GetName().Version.ToString() }, { "client_directory", typeof(BusClient).Assembly.CodeBase}, { "client_connected", DateTime.UtcNow.ToString("u") }, { "client_server", Environment.MachineName }, }; if (brokerCfg != null) { props.Add("broker_username", brokerCfg.Username); } if (cfg != null) { props.Add("request_timeout", cfg.RequestTimeout.ToString("g")); } return props; } } }
mit
C#
eadcf990f864234d4368570fb97eb18869b6ec7f
AJuste Campos Produto!
AutomacaoNet/MotorTributarioNet
src/TestMotorTributarioNet/Entidade/Produto.cs
src/TestMotorTributarioNet/Entidade/Produto.cs
using MotorTributarioNet.Flags; using MotorTributarioNet.Impostos; namespace TestCalculosTributarios.Entidade { public class Produto : ITributavel, IIbpt { public Produto() { Documento = Documento.NFe; } public Documento Documento { get; set; } public CstIpi CstIpi { get; set; } public CstPisCofins CstPisCofins { get; set; } public IIbpt Ibpt { get; set; } public bool IsServico { get; set; } public MotorTributarioNet.Flags.Cst Cst { get; set; } public MotorTributarioNet.Flags.Csosn Csosn { get; set; } public decimal ValorProduto { get; set; } public decimal Frete { get; set; } public decimal Seguro { get; set; } public decimal OutrasDespesas { get; set; } public decimal Desconto { get; set; } public decimal ValorIpi { get; set; } public decimal PercentualReducao { get; set; } public decimal QuantidadeProduto { get; set; } public decimal PercentualIcms { get; set; } public decimal PercentualCredito { get; set; } public decimal PercentualDifalInterna { get; set; } public decimal PercentualDifalInterestadual { get; set; } public decimal PercentualFcp { get; set; } public decimal PercentualMva { get; set; } public decimal PercentualIcmsSt { get; set; } public decimal PercentualIpi { get; set; } public decimal PercentualCofins { get; set; } public decimal PercentualPis { get; set; } public decimal PercentualReducaoSt { get; set; } public decimal PercentualFederal { get; set; } public decimal PercentualFederalImportados { get; set; } public decimal PercentualEstadual { get; set; } public decimal PercentualMunicipal { get; set; } public decimal PercentualDiferimento { get ; set ; } public decimal PercentualIssqn { get; set; } public decimal PercentualRetPis { get; set; } public decimal PercentualRetCofins { get; set; } public decimal PercentualRetCsll { get; set; } public decimal PercentualRetIrrf { get; set; } public decimal PercentualRetInss { get; set; } } }
using MotorTributarioNet.Flags; using MotorTributarioNet.Impostos; namespace TestCalculosTributarios.Entidade { public class Produto : ITributavel, IIbpt { public Produto() { Documento = Documento.NFe; } public Documento Documento { get; set; } public MotorTributarioNet.Flags.Cst Cst { get; set; } public MotorTributarioNet.Flags.Csosn Csosn { get; set; } public decimal ValorProduto { get; set; } public decimal Frete { get; set; } public decimal Seguro { get; set; } public decimal OutrasDespesas { get; set; } public decimal Desconto { get; set; } public decimal ValorIpi { get; set; } public decimal PercentualReducao { get; set; } public decimal QuantidadeProduto { get; set; } public decimal PercentualIcms { get; set; } public decimal PercentualCredito { get; set; } public decimal PercentualDifalInterna { get; set; } public decimal PercentualDifalInterestadual { get; set; } public decimal PercentualFcp { get; set; } public decimal PercentualMva { get; set; } public decimal PercentualIcmsSt { get; set; } public decimal PercentualIpi { get; set; } public decimal PercentualCofins { get; set; } public decimal PercentualPis { get; set; } public decimal PercentualReducaoSt { get; set; } public decimal PercentualFederal { get; set; } public decimal PercentualFederalImportados { get; set; } public decimal PercentualEstadual { get; set; } public decimal PercentualMunicipal { get; set; } public decimal PercentualDiferimento { get ; set ; } public decimal PercentualIssqn { get; set; } public decimal PercentualRetPis { get; set; } public decimal PercentualRetCofins { get; set; } public decimal PercentualRetCsll { get; set; } public decimal PercentualRetIrrf { get; set; } public decimal PercentualRetInss { get; set; } public CstIpi CstIpi { get; set; } public CstPisCofins CstPisCofins { get; set; } } }
lgpl-2.1
C#
293cbe5e8093ff224cb46d729a3f1785a278c4af
remove now-unnecessary TODO
DasAllFolks/SharpGraphs
Graph/Graph.cs
Graph/Graph.cs
using System; namespace Graph { public class Vertex { private bool hasLabel; private string label; public Vertex () { } // XXXX: Remind self how to link to private field? public bool HasLabel { get; set; } public string Label { get { if (!this.hasLabel) { throw NoLabelFoundException("This vertex is unlabeled."); } } set; } public class NoLabelFoundException : Exception { } } public class Edge { public Edge () { } } public class Graph { public Graph () { } public void AddVertex () { } public void AddVertex (int label) { } public void AddVertex (string label) { } }
using System; namespace Graph { public class Vertex { private bool hasLabel; private string label; public Vertex () { } // XXXX: Remind self how to link to private field? public bool HasLabel { get; set; } public string Label { get { if (!this.hasLabel) { throw NoLabelFoundException("This vertex is unlabeled."); } } set; } // XXXX: Remind self how to add message string. public class NoLabelFoundException : Exception { } } public class Edge { public Edge () { } } public class Graph { public Graph () { } public void AddVertex () { } public void AddVertex (int label) { } public void AddVertex (string label) { } }
apache-2.0
C#
64448d9095d0e0e721877f74c02a3736bb398c3b
Fix to MarshalEx.ReadSecurityDescriptor
vurdalakov/usbdevices
src/UsbDevicesDotNet/MarshalEx.cs
src/UsbDevicesDotNet/MarshalEx.cs
namespace Vurdalakov.UsbDevicesDotNet { using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Security.AccessControl; using System.Text; internal static class MarshalEx { public static Byte[] ReadByteArray(IntPtr source, Int32 startIndex, Int32 length) { Byte[] byteArray = new Byte[length]; Marshal.Copy(source, byteArray, startIndex, length); return byteArray; } public static Byte[] ReadByteArray(IntPtr source, Int32 length) { return MarshalEx.ReadByteArray(source, 0, length); } public static Guid ReadGuid(IntPtr source, Int32 length) { Byte[] byteArray = MarshalEx.ReadByteArray(source, 0, length); return new Guid(byteArray); } public static String[] ReadMultiSzStringList(IntPtr source, Int32 length) { Byte[] byteArray = MarshalEx.ReadByteArray(source, 0, length); String multiSz = Encoding.Unicode.GetString(byteArray, 0, length); List<String> strings = new List<String>(); Int32 start = 0; Int32 end = multiSz.IndexOf('\0', start); while (end > start) { strings.Add(multiSz.Substring(start, end - start)); start = end + 1; end = multiSz.IndexOf('\0', start); } return strings.ToArray(); } public static DateTime ReadFileTime(IntPtr source) { Int64 fileTime = Marshal.ReadInt64(source); return DateTime.FromFileTimeUtc(fileTime); } // TODO: not tested public static RawSecurityDescriptor ReadSecurityDescriptor(IntPtr source, Int32 length) { Byte[] byteArray = MarshalEx.ReadByteArray(source, 0, length); return new RawSecurityDescriptor(byteArray, 0); } } }
namespace Vurdalakov.UsbDevicesDotNet { using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Security.AccessControl; using System.Text; internal static class MarshalEx { public static Byte[] ReadByteArray(IntPtr source, Int32 startIndex, Int32 length) { Byte[] byteArray = new Byte[length]; Marshal.Copy(source, byteArray, startIndex, length); return byteArray; } public static Byte[] ReadByteArray(IntPtr source, Int32 length) { return MarshalEx.ReadByteArray(source, 0, length); } public static Guid ReadGuid(IntPtr source, Int32 length) { Byte[] byteArray = MarshalEx.ReadByteArray(source, 0, length); return new Guid(byteArray); } public static String[] ReadMultiSzStringList(IntPtr source, Int32 length) { Byte[] byteArray = MarshalEx.ReadByteArray(source, 0, length); String multiSz = Encoding.Unicode.GetString(byteArray, 0, length); List<String> strings = new List<String>(); Int32 start = 0; Int32 end = multiSz.IndexOf('\0', start); while (end > start) { strings.Add(multiSz.Substring(start, end - start)); start = end + 1; end = multiSz.IndexOf('\0', start); } return strings.ToArray(); } public static DateTime ReadFileTime(IntPtr source) { Int64 fileTime = Marshal.ReadInt64(source); return DateTime.FromFileTimeUtc(fileTime); } // TODO: not tested public static RawSecurityDescriptor ReadSecurityDescriptor(IntPtr source, Int32 length) { Byte[] byteArray = MarshalEx.ReadByteArray(source, 0, length); return new RawSecurityDescriptor(byteArray, length); } } }
mit
C#
ad882939d9b97f4d466759a0e65b876a3504c25a
Add description for magic params
hey-red/Mime
src/Mime/MagicParams.cs
src/Mime/MagicParams.cs
namespace HeyRed.Mime { public enum MagicParams { /// <summary> /// The parameter controls how many levels of recursion will be followed for indirect magic entries. /// </summary> MAGIC_PARAM_INDIR_MAX = 0, /// <summary> /// The parameter controls the maximum number of calls for name/use. /// </summary> MAGIC_PARAM_NAME_MAX, /// <summary> /// The parameter controls how many ELF program sections will be processed. /// </summary> MAGIC_PARAM_ELF_PHNUM_MAX, /// <summary> /// The parameter controls how many ELF sections will be processed. /// </summary> MAGIC_PARAM_ELF_SHNUM_MAX, /// <summary> /// The parameter controls how many ELF notes will be processed. /// </summary> MAGIC_PARAM_ELF_NOTES_MAX, MAGIC_PARAM_REGEX_MAX, MAGIC_PARAM_BYTES_MAX } }
namespace HeyRed.Mime { public enum MagicParams { MAGIC_PARAM_INDIR_MAX = 0, MAGIC_PARAM_NAME_MAX, MAGIC_PARAM_ELF_PHNUM_MAX, MAGIC_PARAM_ELF_SHNUM_MAX, MAGIC_PARAM_ELF_NOTES_MAX, MAGIC_PARAM_REGEX_MAX, MAGIC_PARAM_BYTES_MAX } }
mit
C#
c1f3bf124f06c73259b7f488e2899d3011179157
Make main screen a bit more identifiable
peppy/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,ZLima12/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,peppy/osu-framework,ZLima12/osu-framework,ppy/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework
template-game/TemplateGame.Game/MainScreen.cs
template-game/TemplateGame.Game/MainScreen.cs
using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Screens; using osuTK.Graphics; namespace TemplateGame.Game { public class MainScreen : Screen { [BackgroundDependencyLoader] private void load() { InternalChildren = new Drawable[] { new Box { Colour = Color4.Violet, RelativeSizeAxes = Axes.Both, }, new SpriteText { Y = 20, Text = "Main Screen", Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Font = FontUsage.Default.With(size: 40) }, new SpinningBox { Anchor = Anchor.Centre, } }; } } }
using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Screens; namespace TemplateGame.Game { public class MainScreen : Screen { [BackgroundDependencyLoader] private void load() { AddInternal(new SpinningBox { Anchor = Anchor.Centre, }); } } }
mit
C#
f95852e0ee6f3852a6ecd2ae0fcb32bfe6c37e5e
Use Cors
leonaascimento/Neblina
src/Neblina.Api/Startup.cs
src/Neblina.Api/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.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Neblina.Api.Persistence; using Neblina.Api.Core; using Neblina.Api.Core.Commands; using Neblina.Api.Commands; namespace Neblina.Api { public class Startup { public Startup(IHostingEnvironment env) { var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) .AddEnvironmentVariables(); Configuration = builder.Build(); } public IConfigurationRoot Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { // Add framework services. services.AddDbContext<Persistence.BankingContext>( options => options.UseSqlite("Data Source=banking.db")); services.AddCors(); services.AddMvc(); // Add application services. services.AddTransient<IUnitOfWork, UnitOfWork>(); services.AddTransient<IDepositCommand, DepositCommand>(); services.AddTransient<IWithdrawalCommand, WithdrawalCommand>(); services.AddTransient<ITransferCommand, TransferCommand>(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); app.UseCors(builder => builder.AllowAnyOrigin() .AllowAnyHeader() .AllowAnyMethod()); app.UseMvc(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Neblina.Api.Persistence; using Neblina.Api.Core; using Neblina.Api.Core.Commands; using Neblina.Api.Commands; namespace Neblina.Api { public class Startup { public Startup(IHostingEnvironment env) { var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) .AddEnvironmentVariables(); Configuration = builder.Build(); } public IConfigurationRoot Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { // Add framework services. services.AddDbContext<Persistence.BankingContext>( options => options.UseSqlite("Data Source=banking.db")); services.AddCors(); services.AddMvc(); // Add application services. services.AddTransient<IUnitOfWork, UnitOfWork>(); services.AddTransient<IDepositCommand, DepositCommand>(); services.AddTransient<IWithdrawalCommand, WithdrawalCommand>(); services.AddTransient<ITransferCommand, TransferCommand>(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); app.UseCors(builder => builder.AllowAnyOrigin() .AllowAnyHeader()); app.UseMvc(); } } }
mit
C#
db2bacc5b064a8aabad0d80a1809c67d105eac84
remove unused namespaces from bool latch
dpvreony/Dhgms.AspNetCoreContrib,dpvreony/Dhgms.AspNetCoreContrib,dpvreony/Dhgms.AspNetCoreContrib
src/Dhgms.AspNetCoreContrib.App/Features/Bitwise/BooleanLatch.cs
src/Dhgms.AspNetCoreContrib.App/Features/Bitwise/BooleanLatch.cs
namespace Dhgms.AspNetCoreContrib.App.Features.Bitwise { /// <summary> /// A single set latch, used for where you need to flag something like an update flag where updates /// can be caused by multiple sources. /// This is designed to reduce the risk of using a boolean flag and manually applying the logic. /// </summary> public sealed class BooleanLatch { /// <summary> /// A flag indicating whether the latch has been set to true. /// </summary> private bool _internalValue; /// <summary> /// Gets a value indicating whether the flag has been set. /// </summary> public bool Value { get => _internalValue; private set => _internalValue = value; } /// <summary> /// Triggers the latch. /// </summary> public void Set() { Value = true; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Dhgms.AspNetCoreContrib.App.Features.Bitwise { /// <summary> /// A single set latch, used for where you need to flag something like an update flag where updates /// can be caused by multiple sources. /// This is designed to reduce the risk of using a boolean flag and manually applying the logic. /// </summary> public sealed class BooleanLatch { /// <summary> /// A flag indicating whether the latch has been set to true. /// </summary> private bool _internalValue; /// <summary> /// Gets a value indicating whether the flag has been set. /// </summary> public bool Value { get => _internalValue; private set => _internalValue = value; } /// <summary> /// Triggers the latch. /// </summary> public void Set() { Value = true; } } }
apache-2.0
C#
2af05dc13c2d6866c98767c9e6663aa618f45edf
remove unused var
parkitectLab/statMaster
Notice.cs
Notice.cs
using UnityEngine; using System.Collections.Generic; using System; namespace StatMaster { class Notice { public bool showWindow = false; public uint windowWidth = 450; private Rect _window = new Rect(50, 50, 1, 1); private List<string> _textLines = new List<string>(); public string title = "StatMaster Notice"; private bool _updateWindowRect = false; public void addText(string text) { _textLines.Add(text); _updateWindowRect = true; } public void addText(List<string>texts) { _textLines.AddRange(texts); _updateWindowRect = true; } private Rect _rect(int index) { const int height = 20; const int margin = 5; return new Rect(10, 20 + (height + margin) * index, windowWidth - 20, height); } private void _doWindow(int id) { var index = 0; for (int i = 0; i < _textLines.Count; i++) GUI.Label(_rect(index++), _textLines[i]); if (GUI.Button(_rect(index++), "Close")) showWindow = false; GUI.DragWindow(new Rect(0, 0, 10000, 10000)); } public void OnGUI() { if (!showWindow) return; if (_updateWindowRect) { // set window to center of screen with default size uint windowHeight = Convert.ToUInt32(_textLines.Count) * 30 + 30; _window = new Rect( Screen.width / 2 - windowWidth / 2, Screen.height / 2 - windowHeight / 2, windowWidth, windowHeight ); _updateWindowRect = false; } _window = GUI.Window(0, _window, _doWindow, title); } } }
using UnityEngine; using System.Collections.Generic; using System; namespace StatMaster { class Notice { private uint _windowRectsCount = 14; public bool showWindow = false; public uint windowWidth = 450; private Rect _window = new Rect(50, 50, 1, 1); private List<string> _textLines = new List<string>(); public string title = "StatMaster Notice"; private bool _updateWindowRect = false; public void addText(string text) { _textLines.Add(text); _updateWindowRect = true; } public void addText(List<string>texts) { _textLines.AddRange(texts); _updateWindowRect = true; } private Rect _rect(int index) { const int height = 20; const int margin = 5; return new Rect(10, 20 + (height + margin) * index, windowWidth - 20, height); } private void _doWindow(int id) { var index = 0; for (int i = 0; i < _textLines.Count; i++) GUI.Label(_rect(index++), _textLines[i]); if (GUI.Button(_rect(index++), "Close")) showWindow = false; GUI.DragWindow(new Rect(0, 0, 10000, 10000)); } public void OnGUI() { if (!showWindow) return; if (_updateWindowRect) { // set window to center of screen with default size uint windowHeight = Convert.ToUInt32(_textLines.Count) * 30 + 30; _window = new Rect( Screen.width / 2 - windowWidth / 2, Screen.height / 2 - windowHeight / 2, windowWidth, windowHeight ); _updateWindowRect = false; } _window = GUI.Window(0, _window, _doWindow, title); } } }
mit
C#
8712f36b277006bfa1bb8c91101759700f5121ef
Update version to 0.3.3
elcattivo/CloudFlareUtilities
CloudFlareUtilities/Properties/AssemblyInfo.cs
CloudFlareUtilities/Properties/AssemblyInfo.cs
using System; using System.Resources; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("CloudFlare Utilities")] [assembly: AssemblyDescription("A .NET PCL to bypass Cloudflare's Anti-DDoS measure (JavaScript challenge) using a DelegatingHandler.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("El Cattivo")] [assembly: AssemblyProduct("CloudFlare Utilities")] [assembly: AssemblyCopyright("Copyright © El Cattivo 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] [assembly: AssemblyVersion("0.3.3.0")] [assembly: AssemblyFileVersion("0.3.3.0")] [assembly: AssemblyInformationalVersion("0.3.3-alpha")] [assembly:CLSCompliant(true)] [assembly:ComVisible(false)] [assembly: InternalsVisibleTo("CloudFlareUtilities.Tests")]
using System; using System.Resources; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("CloudFlare Utilities")] [assembly: AssemblyDescription("A .NET PCL to bypass Cloudflare's Anti-DDoS measure (JavaScript challenge) using a DelegatingHandler.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("El Cattivo")] [assembly: AssemblyProduct("CloudFlare Utilities")] [assembly: AssemblyCopyright("Copyright © El Cattivo 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] [assembly: AssemblyVersion("0.3.2.0")] [assembly: AssemblyFileVersion("0.3.2.0")] [assembly: AssemblyInformationalVersion("0.3.2-alpha")] [assembly:CLSCompliant(true)] [assembly:ComVisible(false)] [assembly: InternalsVisibleTo("CloudFlareUtilities.Tests")]
mit
C#
7569473dd569bac4d9611a5f6b945cc42695e801
Change expiry job back to 28th
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
src/SFA.DAS.EmployerFinance.Jobs/ScheduledJobs/ExpireFundsJob.cs
src/SFA.DAS.EmployerFinance.Jobs/ScheduledJobs/ExpireFundsJob.cs
using System.Threading.Tasks; using Microsoft.Azure.WebJobs; using Microsoft.Extensions.Logging; using NServiceBus; using SFA.DAS.EmployerFinance.Messages.Commands; namespace SFA.DAS.EmployerFinance.Jobs.ScheduledJobs { public class ExpireFundsJob { private readonly IMessageSession _messageSession; public ExpireFundsJob(IMessageSession messageSession) { _messageSession = messageSession; } public Task Run([TimerTrigger("0 0 0 28 * *")] TimerInfo timer, ILogger logger) { return _messageSession.Send(new ExpireFundsCommand()); } } }
using System.Threading.Tasks; using Microsoft.Azure.WebJobs; using Microsoft.Extensions.Logging; using NServiceBus; using SFA.DAS.EmployerFinance.Messages.Commands; namespace SFA.DAS.EmployerFinance.Jobs.ScheduledJobs { public class ExpireFundsJob { private readonly IMessageSession _messageSession; public ExpireFundsJob(IMessageSession messageSession) { _messageSession = messageSession; } public Task Run([TimerTrigger("0 0 0 10 * *")] TimerInfo timer, ILogger logger) { return _messageSession.Send(new ExpireFundsCommand()); } } }
mit
C#
49c70503b8765eb7cc0df786617a49c3fd6927ae
Change the long description of B2_DOWNLOAD_URL_OPTION, #3654
mnaiman/duplicati,mnaiman/duplicati,mnaiman/duplicati,duplicati/duplicati,sitofabi/duplicati,duplicati/duplicati,sitofabi/duplicati,duplicati/duplicati,duplicati/duplicati,duplicati/duplicati,mnaiman/duplicati,sitofabi/duplicati,sitofabi/duplicati,sitofabi/duplicati,mnaiman/duplicati
Duplicati/Library/Backend/Backblaze/Strings.cs
Duplicati/Library/Backend/Backblaze/Strings.cs
using Duplicati.Library.Localization.Short; namespace Duplicati.Library.Backend.Strings { internal static class B2 { public static string B2applicationkeyDescriptionShort { get { return LC.L(@"The ""B2 Cloud Storage Application Key"" can be obtained after logging into your Backblaze account, this can also be supplied through the ""auth-password"" property"); } } public static string B2applicationkeyDescriptionLong { get { return LC.L(@"The ""B2 Cloud Storage Application Key"""); } } public static string B2accountidDescriptionLong { get { return LC.L(@"The ""B2 Cloud Storage Account ID"" can be obtained after logging into your Backblaze account, this can also be supplied through the ""auth-username"" property"); } } public static string B2accountidDescriptionShort { get { return LC.L(@"The ""B2 Cloud Storage Account ID"""); } } public static string DisplayName { get { return LC.L(@"B2 Cloud Storage"); } } public static string AuthPasswordDescriptionLong { get { return LC.L(@"The password used to connect to the server. This may also be supplied as the environment variable ""AUTH_PASSWORD""."); } } public static string AuthPasswordDescriptionShort { get { return LC.L(@"Supplies the password used to connect to the server"); } } public static string AuthUsernameDescriptionLong { get { return LC.L(@"The username used to connect to the server. This may also be supplied as the environment variable ""AUTH_USERNAME""."); } } public static string AuthUsernameDescriptionShort { get { return LC.L(@"Supplies the username used to connect to the server"); } } public static string NoB2KeyError { get { return LC.L(@"No ""B2 Cloud Storage Application Key"" given"); } } public static string NoB2UserIDError { get { return LC.L(@"No ""B2 Cloud Storage Account ID"" given"); } } public static string Description { get { return LC.L(@"This backend can read and write data to the Backblaze B2 Cloud Storage. Allowed formats are: ""b2://bucketname/prefix"""); } } public static string B2createbuckettypeDescriptionLong { get { return LC.L(@"By default, a private bucket is created. Use this option to set the bucket type. Refer to the B2 documentation for allowed types "); } } public static string B2createbuckettypeDescriptionShort { get { return LC.L(@"The bucket type used when creating a bucket"); } } public static string B2pagesizeDescriptionLong { get { return LC.L(@"Use this option to set the page size for listing contents of B2 buckets. A lower number means less data, but can increase the number of Class C transaction on B2. Suggested values are between 100 and 1000"); } } public static string B2pagesizeDescriptionShort { get { return LC.L(@"The size of file-listing pages"); } } public static string B2downloadurlDescriptionLong { get { return LC.L(@"Change this if you want to use your custom domain to download files, and uploading will not be affected. The default download url depends on your account and looks like ""https://f00X.backblazeb2.com"""); } } public static string B2downloadurlDescriptionShort { get { return LC.L(@"The base URL to use for downloading files"); } } public static string InvalidPageSizeError(string argname, string value) { return LC.L(@"The setting ""{0}"" is invalid for ""{1}"", it must be an integer larger than zero", value, argname); } } }
using Duplicati.Library.Localization.Short; namespace Duplicati.Library.Backend.Strings { internal static class B2 { public static string B2applicationkeyDescriptionShort { get { return LC.L(@"The ""B2 Cloud Storage Application Key"" can be obtained after logging into your Backblaze account, this can also be supplied through the ""auth-password"" property"); } } public static string B2applicationkeyDescriptionLong { get { return LC.L(@"The ""B2 Cloud Storage Application Key"""); } } public static string B2accountidDescriptionLong { get { return LC.L(@"The ""B2 Cloud Storage Account ID"" can be obtained after logging into your Backblaze account, this can also be supplied through the ""auth-username"" property"); } } public static string B2accountidDescriptionShort { get { return LC.L(@"The ""B2 Cloud Storage Account ID"""); } } public static string DisplayName { get { return LC.L(@"B2 Cloud Storage"); } } public static string AuthPasswordDescriptionLong { get { return LC.L(@"The password used to connect to the server. This may also be supplied as the environment variable ""AUTH_PASSWORD""."); } } public static string AuthPasswordDescriptionShort { get { return LC.L(@"Supplies the password used to connect to the server"); } } public static string AuthUsernameDescriptionLong { get { return LC.L(@"The username used to connect to the server. This may also be supplied as the environment variable ""AUTH_USERNAME""."); } } public static string AuthUsernameDescriptionShort { get { return LC.L(@"Supplies the username used to connect to the server"); } } public static string NoB2KeyError { get { return LC.L(@"No ""B2 Cloud Storage Application Key"" given"); } } public static string NoB2UserIDError { get { return LC.L(@"No ""B2 Cloud Storage Account ID"" given"); } } public static string Description { get { return LC.L(@"This backend can read and write data to the Backblaze B2 Cloud Storage. Allowed formats are: ""b2://bucketname/prefix"""); } } public static string B2createbuckettypeDescriptionLong { get { return LC.L(@"By default, a private bucket is created. Use this option to set the bucket type. Refer to the B2 documentation for allowed types "); } } public static string B2createbuckettypeDescriptionShort { get { return LC.L(@"The bucket type used when creating a bucket"); } } public static string B2pagesizeDescriptionLong { get { return LC.L(@"Use this option to set the page size for listing contents of B2 buckets. A lower number means less data, but can increase the number of Class C transaction on B2. Suggested values are between 100 and 1000"); } } public static string B2pagesizeDescriptionShort { get { return LC.L(@"The size of file-listing pages"); } } public static string B2downloadurlDescriptionLong { get { return LC.L(@"Change this if you want to use your custom domain to download files, and uploading will not be affected. The default download url is ""https://f00X.backblazeb2.com"""); } } public static string B2downloadurlDescriptionShort { get { return LC.L(@"The base URL to use for downloading files"); } } public static string InvalidPageSizeError(string argname, string value) { return LC.L(@"The setting ""{0}"" is invalid for ""{1}"", it must be an integer larger than zero", value, argname); } } }
lgpl-2.1
C#
8c46bcca9aa37906746e6490b033a72e531dd5eb
Improve key/value pattern values enclosed in quotation marks
tommarien/zenini
src/Zenini/Patterns/KeyValuePattern.cs
src/Zenini/Patterns/KeyValuePattern.cs
using System; using System.Text.RegularExpressions; namespace Zenini.Patterns { public class KeyValuePattern { private static readonly Regex KeyValueRegex = new Regex(@"^\s*(.+?)\s*=\s*(?:"")?(.+?)(?:\"")?\s*$", RegexOptions.Compiled); public virtual bool Matches(string line) { return KeyValueRegex.IsMatch(line); } public virtual Tuple<string, string> Extract(string line) { MatchCollection collection = KeyValueRegex.Matches(line); string key = collection[0].Groups[1].Value; string value = collection[0].Groups[2].Value; return new Tuple<string, string>(key, value); } } }
using System; using System.Text.RegularExpressions; namespace Zenini.Patterns { public class KeyValuePattern { private static readonly Regex KeyValueRegex = new Regex(@"^\s*(.+?)\s*=\s*(.+?)\s*$", RegexOptions.Compiled); public virtual bool Matches(string line) { return KeyValueRegex.IsMatch(line); } public virtual Tuple<string, string> Extract(string line) { MatchCollection collection = KeyValueRegex.Matches(line); string key = collection[0].Groups[1].Value; string value = collection[0].Groups[2].Value; if (value.StartsWith("\"") && value.EndsWith("\"")) value = value.Substring(1, value.Length - 2); return new Tuple<string, string>(key, value); } } }
mit
C#
61baa3179920f2e0a588982d7ee332bb67b4d2b3
Fix for Net 2.0
castleproject/Castle.Transactions,castleproject/Castle.Transactions,codereflection/Castle.Components.Scheduler,castleproject/castle-READONLY-SVN-dump,castleproject/Castle.Facilities.Wcf-READONLY,castleproject/castle-READONLY-SVN-dump,castleproject/Castle.Transactions,castleproject/castle-READONLY-SVN-dump,carcer/Castle.Components.Validator,castleproject/Castle.Facilities.Wcf-READONLY
Tools/DynamicProxy/DynamicProxy/Builder/CodeBuilder/SimpleAST/MethodTokenExpression.cs
Tools/DynamicProxy/DynamicProxy/Builder/CodeBuilder/SimpleAST/MethodTokenExpression.cs
// Copyright 2004-2005 Castle Project - http://www.castleproject.org/ // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. namespace Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST { using System; using System.Reflection; using System.Reflection.Emit; /// <summary> /// Summary description for MethodTokenExpression. /// </summary> public class MethodTokenExpression : Expression { private MethodInfo _method; public MethodTokenExpression( MethodInfo method ) { _method = method; } public override void Emit(IEasyMember member, ILGenerator gen) { gen.Emit(OpCodes.Ldtoken, _method); MethodInfo minfo = typeof(MethodBase).GetMethod( "GetMethodFromHandle", BindingFlags.Static|BindingFlags.Public, null, new Type[] { typeof(RuntimeMethodHandle) }, null); gen.Emit(OpCodes.Call, minfo); gen.Emit(OpCodes.Castclass, typeof(MethodInfo)); } } }
<<<<<<< .mine // Copyright 2004-2005 Castle Project - http://www.castleproject.org/ // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. namespace Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST { using System; using System.Reflection; using System.Reflection.Emit; /// <summary> /// Summary description for MethodTokenExpression. /// </summary> public class MethodTokenExpression : Expression { private MethodInfo _method; public MethodTokenExpression( MethodInfo method ) { _method = method; } public override void Emit(IEasyMember member, ILGenerator gen) { gen.Emit(OpCodes.Ldtoken, _method); MethodInfo minfo = typeof(MethodBase).GetMethod( "GetMethodFromHandle", BindingFlags.Static|BindingFlags.Public, null, new Type[] { typeof(RuntimeMethodHandle) }, null); gen.Emit(OpCodes.Call, minfo); gen.Emit(OpCodes.Castclass, typeof(MethodInfo)); } } } ======= // Copyright 2004-2005 Castle Project - http://www.castleproject.org/ // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. namespace Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST { using System; using System.Reflection; using System.Reflection.Emit; /// <summary> /// Summary description for MethodTokenExpression. /// </summary> public class MethodTokenExpression : Expression { private MethodInfo _method; public MethodTokenExpression( MethodInfo method ) { _method = method; } public override void Emit(IEasyMember member, ILGenerator gen) { gen.Emit(OpCodes.Ldtoken, _method); gen.Emit(OpCodes.Call, typeof(MethodBase).GetMethod( "GetMethodFromHandle", new Type[] { typeof(RuntimeMethodHandle) })); gen.Emit(OpCodes.Castclass, typeof(MethodInfo)); } } } >>>>>>> .r637
apache-2.0
C#
18b0fb4a776654880e3e27fa7e3895c6cbd7f436
fix user repo
passenger-stack/Passenger,passenger-stack/Passenger
Passenger.Core/Repositories/IUserRepository.cs
Passenger.Core/Repositories/IUserRepository.cs
using System; using System.Collections.Generic; using System.Threading.Tasks; using Passenger.Core.Domain; namespace Passenger.Core.Repositories { public interface IUserRepository { Task<User> GetAsync(Guid id); Task<User> GetAsync(string email); Task<IEnumerable<User>> GetAllAsync(); Task AddAsync(User user); Task UpdateAsync(User user); Task RemoveAsync(Guid id); } }
using System; using System.Collections.Generic; using System.Threading.Tasks; using Passenger.Core.Domain; namespace Passenger.Core.Repositories { public interface IUserRepository { Task<User> GetAsync(Guid id); Task<User> GetAsync(string email); Task<IEnumerable<User>> GetAllAsync(); Task AddAsync(User user); Task UpdateAsync(User user); Task RemoveAsync(Guid id); void GetAsync(string v1, string v2); } }
mit
C#
83679539e6790da908ed443f379114b613f24753
Implement ArrowKeyController. Use CharacterAnimationActions in ArrowKeyController
ethanmoffat/EndlessClient
EndlessClient/Controllers/ArrowKeyController.cs
EndlessClient/Controllers/ArrowKeyController.cs
// Original Work Copyright (c) Ethan Moffat 2014-2016 // This file is subject to the GPL v2 License // For additional details, see the LICENSE file using EndlessClient.Rendering.Character; using EOLib; using EOLib.Domain.Character; namespace EndlessClient.Controllers { public class ArrowKeyController : IArrowKeyController { private readonly ICharacterAnimationActions _characterAnimationActions; private readonly ICharacterProvider _characterProvider; public ArrowKeyController(ICharacterAnimationActions characterAnimationActions, ICharacterProvider characterProvider) { _characterAnimationActions = characterAnimationActions; _characterProvider = characterProvider; } public bool MoveLeft() { if (!CurrentActionIsStanding()) return false; FaceOrStartWalking(EODirection.Left); return true; } public bool MoveRight() { if (!CurrentActionIsStanding()) return false; FaceOrStartWalking(EODirection.Right); return true; } public bool MoveUp() { if (!CurrentActionIsStanding()) return false; FaceOrStartWalking(EODirection.Up); return true; } public bool MoveDown() { if (!CurrentActionIsStanding()) return false; FaceOrStartWalking(EODirection.Down); return true; } private bool CurrentActionIsStanding() { return _characterProvider.MainCharacter.RenderProperties.CurrentAction == CharacterActionState.Standing; } private bool CurrentDirectionIs(EODirection direction) { return _characterProvider.MainCharacter.RenderProperties.Direction == direction; } private void FaceOrStartWalking(EODirection direction) { if (!CurrentDirectionIs(direction)) _characterAnimationActions.Face(direction); else _characterAnimationActions.StartWalking(); } } }
// Original Work Copyright (c) Ethan Moffat 2014-2016 // This file is subject to the GPL v2 License // For additional details, see the LICENSE file namespace EndlessClient.Controllers { public class ArrowKeyController : IArrowKeyController { public bool MoveLeft() { return false; } public bool MoveRight() { return false; } public bool MoveUp() { return false; } public bool MoveDown() { return false; } } }
mit
C#
8df5e890cee462384277eb7e20b70ea389b86d37
Fix leaderboard conditions
DragonEyes7/ConcoursUBI17,DragonEyes7/ConcoursUBI17
Proto/Assets/Scripts/Leaderboard/Leaderboard.cs
Proto/Assets/Scripts/Leaderboard/Leaderboard.cs
using System.Collections.Generic; using Newtonsoft.Json; using UnityEngine; public class Leaderboard { private readonly List<Score> _scores; private FileManager _fileManager; public Leaderboard(string file) { _scores = Load(file); } private List<Score> Load(string file) { _fileManager = new FileManager(file); var json = _fileManager.Read(); return json == "" ? new List<Score>() : JsonConvert.DeserializeObject<List<Score>>(json); } public void Show(RectTransform list) { foreach (var score in _scores) { var leaderboardEntry = (GameObject)Object.Instantiate(Resources.Load("LeaderboardField"), list); leaderboardEntry.GetComponent<LeaderboardEntry>().SetInfo(score); } } public void AddScore(Score newScore) { if (_scores.Count == 0) { _scores.Add(newScore); return; } var inserted = false; //This should keep the list ordered for (var i = 0; i < _scores.Count; i++) { var score = _scores[i]; if (score.Time < newScore.Time) continue; _scores.Insert(i, newScore); inserted = true; break; } //If we don't yet have 10 scores and this one is the highest one, insert at the end if(!inserted && _scores.Count < 10)_scores.Insert(_scores.Count, newScore); } public void Save() { //This should keep the list with at most 10 elements if (_scores.Count > 10) { _scores.RemoveRange(9, _scores.Count - 10); } _fileManager.Write(JsonConvert.SerializeObject(_scores, Formatting.Indented)); } }
using System.Collections.Generic; using Newtonsoft.Json; using UnityEngine; public class Leaderboard { private readonly List<Score> _scores; private FileManager _fileManager; public Leaderboard(string file) { _scores = Load(file); } private List<Score> Load(string file) { _fileManager = new FileManager(file); var json = _fileManager.Read(); return json == "" ? new List<Score>() : JsonConvert.DeserializeObject<List<Score>>(json); } public void Show(RectTransform list) { foreach (var score in _scores) { var leaderboardEntry = (GameObject)Object.Instantiate(Resources.Load("LeaderboardField"), list); leaderboardEntry.GetComponent<LeaderboardEntry>().SetInfo(score); } } public void AddScore(Score newScore) { if (_scores.Count == 0) { _scores.Add(newScore); return; } //This should keep the list ordered for (var i = 0; i < _scores.Count; i++) { var score = _scores[i]; if (score.Time < newScore.Time) continue; _scores.Insert(i, newScore); break; } } public void Save() { //This should keep the list with at most 10 elements if (_scores.Count > 10) { _scores.RemoveRange(9, _scores.Count - 10); } _fileManager.Write(JsonConvert.SerializeObject(_scores, Formatting.Indented)); } }
mit
C#
ede59ba6528071d0a7ca91a0abd18f442c1e21f3
fix in ContestViewModel - mapping was not implemented
KENTRIOSI/KentriosiPhotoContest,KENTRIOSI/KentriosiPhotoContest,KENTRIOSI/KentriosiPhotoContest
KentriosiPhotosContests.MVC/Models/ViewModels/ContestViewModel.cs
KentriosiPhotosContests.MVC/Models/ViewModels/ContestViewModel.cs
namespace KentriosiPhotoContest.MVC.Models { using KentriosiPhotoContest.Models; using Infrastructure.Mapping; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using AutoMapper; public class ContestViewModel : IMapFrom<Contest>, IHaveCustomMappings { public int? ContestImageId { get; set; } public string ContestImageUrl { get; set; } public void CreateMappings(IConfiguration configuration) { configuration.CreateMap<Contest, ContestViewModel>() .ForMember(cvm => cvm.ContestImageUrl, opt => opt.MapFrom(c => c.ContestImage.Path)) .ReverseMap(); } } }
namespace KentriosiPhotoContest.MVC.Models { using KentriosiPhotoContest.Models; using Infrastructure.Mapping; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using AutoMapper; public class ContestViewModel :IMapFrom<Contest> //IHaveCustomMappings { public int ContestImageId { get; set; } public string ContestImageUrl { get; set; } //TODO //public void CreateMappings(IConfiguration configuration) //{ // throw new NotImplementedException(); //} } }
mit
C#
9dd4e29f18c5894d503a8852840a67e17ff2ad28
Change text in Contact.cshtml
MarianNikolov/ROM,MarianNikolov/ROM
RestaurantOrganizationalManager/ROM.Web/Views/Home/Contact.cshtml
RestaurantOrganizationalManager/ROM.Web/Views/Home/Contact.cshtml
@{ ViewBag.Title = "Contact"; } <h2 page-title animated lightSpeedIn class="text-center main-page-title">@ViewBag.Title us</h2> <div class="container"> <div class="row"> <div> <div class="panel panel-default"> <div class="panel-body text-center"> <div style="height: 400px"> <iframe width="100%" height="100%" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?q=place_id:ChIJa-QiA5SGqkARIbhz0Ykqz50&key=AIzaSyDiutvJ3KdOgx2gcp6eQE-5Wq_Z_DMFwBQ" allowfullscreen></iframe> </div> </div> </div> </div> </div> </div> <address> <p>Bulgaria,</p> <p>Sofia 1324,</p> <p>Phone number: +359 99 46 16 12</p> <p><strong>Marketing:</strong> <a href="mailto:marian.nikolov.net.com">Marian.Nikolov.NET.com</a></p> </address> <div class="clearfix"></div>
@{ ViewBag.Title = "Contact"; } <h2 page-title animated lightSpeedIn class="text-center main-page-title">@ViewBag.Title us</h2> <div class="container"> <div class="row"> <div> <div class="panel panel-default"> <div class="panel-body text-center"> <div style="height: 400px"> <iframe width="100%" height="100%" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?q=place_id:ChIJa-QiA5SGqkARIbhz0Ykqz50&key=AIzaSyDiutvJ3KdOgx2gcp6eQE-5Wq_Z_DMFwBQ" allowfullscreen></iframe> </div> </div> </div> </div> </div> </div> <address> <p>Bulgaria,</p> <p>Sofia 1322,</p> <p>Phone number: +359 99 46 16 12</p> <p><strong>Marketing:</strong> <a href="mailto:marian.nikolov.net.com">Marian.Nikolov.NET.com</a></p> </address> <div class="clearfix"></div>
mit
C#
2e68951e0f6c45c392008160c54fa521b808280a
Use file version as client version
SeanFeldman/azure-event-hubs-dotnet,jtaubensee/azure-event-hubs-dotnet
src/Microsoft.Azure.EventHubs/Primitives/ClientInfo.cs
src/Microsoft.Azure.EventHubs/Primitives/ClientInfo.cs
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Microsoft.Azure.EventHubs { using System; using System.Reflection; using System.Runtime.Versioning; using Microsoft.Azure.Amqp; static class ClientInfo { static readonly string product; static readonly string version; static readonly string framework; static readonly string platform; static ClientInfo() { try { Assembly assembly = typeof(ClientInfo).GetTypeInfo().Assembly; product = GetAssemblyAttributeValue<AssemblyProductAttribute>(assembly, p => p.Product); version = GetAssemblyAttributeValue<AssemblyFileVersionAttribute>(assembly, v => v.Version); framework = GetAssemblyAttributeValue<TargetFrameworkAttribute>(assembly, f => f.FrameworkName); #if NETSTANDARD platform = System.Runtime.InteropServices.RuntimeInformation.OSDescription; #else platform = Environment.OSVersion.VersionString; #endif } catch { } } public static void Add(AmqpConnectionSettings settings) { settings.AddProperty("product", product); settings.AddProperty("version", version); settings.AddProperty("framework", framework); settings.AddProperty("platform", platform); } static string GetAssemblyAttributeValue<T>(Assembly assembly, Func<T, string> getter) where T : Attribute { var attribute = assembly.GetCustomAttribute(typeof(T)) as T; return attribute == null ? null : getter(attribute); } } }
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Microsoft.Azure.EventHubs { using System; using System.Reflection; using System.Runtime.Versioning; using Microsoft.Azure.Amqp; static class ClientInfo { static readonly string product; static readonly string version; static readonly string framework; static readonly string platform; static ClientInfo() { try { Assembly assembly = typeof(ClientInfo).GetTypeInfo().Assembly; product = GetAssemblyAttributeValue<AssemblyProductAttribute>(assembly, p => p.Product); version = GetAssemblyAttributeValue<AssemblyVersionAttribute>(assembly, v => v.Version); framework = GetAssemblyAttributeValue<TargetFrameworkAttribute>(assembly, f => f.FrameworkName); #if NETSTANDARD platform = System.Runtime.InteropServices.RuntimeInformation.OSDescription; #else platform = Environment.OSVersion.VersionString; #endif } catch { } } public static void Add(AmqpConnectionSettings settings) { settings.AddProperty("product", product); settings.AddProperty("version", version); settings.AddProperty("framework", framework); settings.AddProperty("platform", platform); } static string GetAssemblyAttributeValue<T>(Assembly assembly, Func<T, string> getter) where T : Attribute { var attribute = assembly.GetCustomAttribute(typeof(T)) as T; return attribute == null ? null : getter(attribute); } } }
mit
C#
c561e61fdd9825baf779ea4f6ecaa37a444befc5
Fix #65 and #54
TestStack/TestStack.ConventionTests
TestStack.ConventionTests/Conventions/ClassTypeHasSpecificNamespace.cs
TestStack.ConventionTests/Conventions/ClassTypeHasSpecificNamespace.cs
namespace TestStack.ConventionTests.Conventions { using System; using System.Linq; using TestStack.ConventionTests.ConventionData; /// <summary> /// This convention allows you to enforce a particular type of class is under a namespace, for instance. /// /// Dto must be under App.Contracts.Dtos /// Domain Objects must be under App.Domain /// Event Handlers must be under App.Handlers /// /// This is a Symmetric convention, and will verify all of a Class Type lives in the namespace, but also that only that class type is in that namespace /// </summary> public class ClassTypeHasSpecificNamespace : IConvention<Types> { readonly Func<Type, bool> classIsApplicable; readonly string namespaceToCheck; readonly string classType; /// <summary> /// Ctor /// </summary> /// <param name="classIsApplicable">Predicate to verify if the class is the right type</param> /// <param name="namespaceToCheck"></param> /// <param name="classType">The class type. ie, Dto, Domain Object, Event Handler</param> public ClassTypeHasSpecificNamespace(Func<Type, bool> classIsApplicable, string namespaceToCheck, string classType) { this.classIsApplicable = classIsApplicable; this.namespaceToCheck = namespaceToCheck; this.classType = classType; } public void Execute(Types data, IConventionResultContext result) { result.IsSymmetric( string.Format("{0}s must be under the '{1}' namespace", classType, namespaceToCheck), string.Format("Non-{0}s must not be under the '{1}' namespace", classType, namespaceToCheck), classIsApplicable, TypeLivesInSpecifiedNamespace, data.TypesToVerify.Where(t => !t.IsCompilerGenerated())); } public string ConventionReason { get { return "To simplify project structure and allow developers to know where this type of class should live in the project"; } } bool TypeLivesInSpecifiedNamespace(Type t) { return t.Namespace == null || (t.Namespace.StartsWith(namespaceToCheck + ".") || t.Namespace == namespaceToCheck); } } }
namespace TestStack.ConventionTests.Conventions { using System; using TestStack.ConventionTests.ConventionData; /// <summary> /// This convention allows you to enforce a particular type of class is under a namespace, for instance. /// /// Dto must be under App.Contracts.Dtos /// Domain Objects must be under App.Domain /// Event Handlers must be under App.Handlers /// /// This is a Symmetric convention, and will verify all of a Class Type lives in the namespace, but also that only that class type is in that namespace /// </summary> public class ClassTypeHasSpecificNamespace : IConvention<Types> { readonly Func<Type, bool> classIsApplicable; readonly string namespaceToCheck; readonly string classType; /// <summary> /// Ctor /// </summary> /// <param name="classIsApplicable">Predicate to verify if the class is the right type</param> /// <param name="namespaceToCheck"></param> /// <param name="classType">The class type. ie, Dto, Domain Object, Event Handler</param> public ClassTypeHasSpecificNamespace(Func<Type, bool> classIsApplicable, string namespaceToCheck, string classType) { this.classIsApplicable = classIsApplicable; this.namespaceToCheck = namespaceToCheck; this.classType = classType; } public void Execute(Types data, IConventionResultContext result) { result.IsSymmetric( string.Format("{0}s must be under the '{1}' namespace", classType, namespaceToCheck), string.Format("Non-{0}s must not be under the '{1}' namespace", classType, namespaceToCheck), classIsApplicable, TypeLivesInSpecifiedNamespace, data.TypesToVerify); } public string ConventionReason { get { return "To simplify project structure and allow developers to know where this type of class should live in the project"; } } bool TypeLivesInSpecifiedNamespace(Type t) { return t.Namespace == null || t.Namespace.StartsWith(namespaceToCheck); } } }
mit
C#
5da857510a888fc2e584ec667d4354b1f060995a
Build and publish nuget package
RockFramework/Rock.Logging
Rock.Logging/Properties/AssemblyInfo.cs
Rock.Logging/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Rock.Logging")] [assembly: AssemblyDescription("Rock logger.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Quicken Loans")] [assembly: AssemblyProduct("Rock.Logging")] [assembly: AssemblyCopyright("Copyright © Quicken Loans 2014")] [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("71736a4b-21bc-46f3-9bb7-f9c9a260f723")] // 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("0.9.0.0")] [assembly: AssemblyFileVersion("0.9.4")] [assembly: AssemblyInformationalVersion("0.9.4")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Rock.Logging")] [assembly: AssemblyDescription("Rock logger.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Quicken Loans")] [assembly: AssemblyProduct("Rock.Logging")] [assembly: AssemblyCopyright("Copyright © Quicken Loans 2014")] [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("71736a4b-21bc-46f3-9bb7-f9c9a260f723")] // 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("0.9.0.0")] [assembly: AssemblyFileVersion("0.9.3")] [assembly: AssemblyInformationalVersion("0.9.3")]
mit
C#
b77f485fee9337ed565774965c71c1eb0513b1d3
Update binary assembly version
drmohundro/Jump-Location,tkellogg/Jump-Location,drmohundro/Jump-Location
Jump.Location/Properties/AssemblyInfo.cs
Jump.Location/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Jump.Location")] [assembly: AssemblyDescription("Powershell Cmdlet to jump around")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Tim Kellogg")] [assembly: AssemblyProduct("Jump.Location")] [assembly: AssemblyCopyright("Copyright © Tim Kellogg 2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("f0e2fb34-f28f-4fd9-bbf2-0e58ec55b429")] // 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("0.6.0.0")] [assembly: AssemblyFileVersion("0.6.0.0")] [assembly: InternalsVisibleTo("Jump.Location.Specs")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Jump.Location")] [assembly: AssemblyDescription("Powershell Cmdlet to jump around")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Tim Kellogg")] [assembly: AssemblyProduct("Jump.Location")] [assembly: AssemblyCopyright("Copyright © Tim Kellogg 2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("f0e2fb34-f28f-4fd9-bbf2-0e58ec55b429")] // 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("0.4.1.0")] [assembly: AssemblyFileVersion("0.4.1.0")] [assembly: InternalsVisibleTo("Jump.Location.Specs")]
mit
C#
68f326ca1906c4c28326072e0d661c10b702c93d
Update assembly info
tony311/PartArranger
KSPPartSorter/Properties/AssemblyInfo.cs
KSPPartSorter/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("PartArranger")] [assembly: AssemblyDescription("A custom part sorting plugin for Kerbal Space Program")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("KSPPartSorter")] [assembly: AssemblyCopyright("Copyright © Anthony Myre 2014")] [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("d1c320e8-2197-4eee-ac14-3b6ffc1ca898")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("KSPPartSorter")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("KSPPartSorter")] [assembly: AssemblyCopyright("Copyright © 2014")] [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("d1c320e8-2197-4eee-ac14-3b6ffc1ca898")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
b15374e39c851b0540d36974bdf26c3ad86f2e84
Fix project version number.
dneelyep/MonoGameUtils
MonoGameUtils/Properties/AssemblyInfo.cs
MonoGameUtils/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("MonoGameUtils")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("MonoGameUtils")] [assembly: AssemblyCopyright("")] [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("4ecedc75-1f2d-4915-9efe-368a5d104e41")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.2")] [assembly: AssemblyFileVersion("1.0.0.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("MonoGameUtils")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("MonoGameUtils")] [assembly: AssemblyCopyright("")] [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("4ecedc75-1f2d-4915-9efe-368a5d104e41")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.1.0")] [assembly: AssemblyFileVersion("1.0.1.0")]
mit
C#
3fa2f16949c1c9ac02a7bbf0f6d8be49c953d241
use ReferenceEquals for singleton equality check
acple/ParsecSharp
ParsecSharp/Data/Internal/EmptyStream.cs
ParsecSharp/Data/Internal/EmptyStream.cs
using System; namespace ParsecSharp.Internal { public sealed class EmptyStream<TToken> : IParsecStateStream<TToken> { public static IParsecStateStream<TToken> Instance { get; } = new EmptyStream<TToken>(); public TToken Current => default!; public bool HasValue => false; public IPosition Position => EmptyPosition.Initial; public IDisposable? InnerResource => default; public IParsecStateStream<TToken> Next => this; private EmptyStream() { } public void Dispose() { } public bool Equals(IParsecState<TToken> other) => ReferenceEquals(this, other); public sealed override bool Equals(object? obj) => ReferenceEquals(this, obj); public sealed override int GetHashCode() => 0; public sealed override string ToString() => "<EndOfStream>"; } }
using System; namespace ParsecSharp.Internal { public sealed class EmptyStream<TToken> : IParsecStateStream<TToken> { public static IParsecStateStream<TToken> Instance { get; } = new EmptyStream<TToken>(); public TToken Current => default!; public bool HasValue => false; public IPosition Position => EmptyPosition.Initial; public IDisposable? InnerResource => default; public IParsecStateStream<TToken> Next => this; private EmptyStream() { } public void Dispose() { } public bool Equals(IParsecState<TToken> other) => other is EmptyStream<TToken>; public sealed override bool Equals(object? obj) => obj is EmptyStream<TToken>; public sealed override int GetHashCode() => 0; public sealed override string ToString() => "<EndOfStream>"; } }
mit
C#
790019faf47c6de1233968237711f7cddcd5d2b9
Fix icon picker initialization (#3271)
xkproject/Orchard2,petedavis/Orchard2,OrchardCMS/Brochard,stevetayloruk/Orchard2,petedavis/Orchard2,petedavis/Orchard2,xkproject/Orchard2,stevetayloruk/Orchard2,stevetayloruk/Orchard2,xkproject/Orchard2,xkproject/Orchard2,OrchardCMS/Brochard,petedavis/Orchard2,OrchardCMS/Brochard,stevetayloruk/Orchard2,xkproject/Orchard2,stevetayloruk/Orchard2
src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-IconPicker.Edit.cshtml
src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-IconPicker.Edit.cshtml
@model OrchardCore.ContentFields.ViewModels.EditTextFieldViewModel @using OrchardCore.ContentManagement.Metadata.Models @using OrchardCore.ContentFields.Settings; @{ var settings = Model.PartFieldDefinition.Settings.ToObject<TextFieldSettings>(); } <style name="fontpickerStyle" at="Head" asp-src="~/OrchardCore.ContentFields/Styles/fontawesome-iconpicker.min.css" debug-src="~/OrchardCore.ContentFields/Styles/fontawesome-iconpicker.css"></style> <style name="fontpickerCustomStyle" at="Head" asp-src="~/OrchardCore.ContentFields/Styles/iconpicker-custom.css"></style> <script name="fontpickerScript" asp-src="~/OrchardCore.ContentFields/Scripts/fontawesome-iconpicker.min.js" debug-src="~/OrchardCore.ContentFields/Scripts/fontawesome-iconpicker.js" at="Foot" depends-on="jquery"></script> <script name="iconpickerCustomScript" asp-src="~/OrchardCore.ContentFields/Scripts/iconpicker-custom.js" at="Foot"></script> <fieldset class="form-group"> <label asp-for="Text">@Model.PartFieldDefinition.DisplayName()</label> <input type="hidden" asp-for="Text" id="@Html.IdFor(m=>m.Text)" /> <div class="btn-group input-group"> <button type="button" class="btn btn-primary iconpicker-component"> <i class="fa fa-fw fa-heart"></i> </button> <button type="button" id="@Html.IdForModel()" class="icp icp-dd btn btn-primary dropdown-toggle" data-selected="fa-car" data-toggle="dropdown"> <span class="caret"></span> <span class="sr-only">Toggle Dropdown</span> </button> <div class="dropdown-menu"></div> </div> @if (!String.IsNullOrEmpty(settings.Hint)) { <span class="hint">@settings.Hint</span> } </fieldset> <script at="Foot"> $(function () { $('#@Html.IdForModel()').iconpicker(); var storedIcon = $('#@Html.IdFor(m=>m.Text)').val(); if (storedIcon) { $('#@Html.IdForModel()').data('iconpicker').update(storedIcon); } $('#@Html.IdForModel()').on('iconpickerSelected', function (e) { $('#@Html.IdFor(m=>m.Text)').val(e.iconpickerInstance.options.fullClassFormatter(e.iconpickerValue)); }); }); </script>
@model OrchardCore.ContentFields.ViewModels.EditTextFieldViewModel @using OrchardCore.ContentManagement.Metadata.Models @using OrchardCore.ContentFields.Settings; @{ var settings = Model.PartFieldDefinition.Settings.ToObject<TextFieldSettings>(); } <style name="fontpickerStyle" at="Head" asp-src="~/OrchardCore.ContentFields/Styles/fontawesome-iconpicker.min.css" debug-src="~/OrchardCore.ContentFields/Styles/fontawesome-iconpicker.css"></style> <style name="fontpickerCustomStyle" at="Head" asp-src="~/OrchardCore.ContentFields/Styles/iconpicker-custom.css"></style> <script name="fontpickerScript" asp-src="~/OrchardCore.ContentFields/Scripts/fontawesome-iconpicker.min.js" debug-src="~/OrchardCore.ContentFields/Scripts/fontawesome-iconpicker.js" at="Foot" depends-on="jquery"></script> <script name="iconpickerCustomScript" asp-src="~/OrchardCore.ContentFields/Scripts/iconpicker-custom.js" at="Foot"></script> <fieldset class="form-group"> <label asp-for="Text">@Model.PartFieldDefinition.DisplayName()</label> <input type="hidden" asp-for="Text" id="@Html.IdFor(m=>m.Text)" /> <div class="btn-group input-group"> <button type="button" class="btn btn-primary iconpicker-component"> <i class="fa fa-fw fa-heart"></i> </button> <button type="button" id="@Html.IdForModel()" class="icp icp-dd btn btn-primary dropdown-toggle" data-selected="fa-car" data-toggle="dropdown"> <span class="caret"></span> <span class="sr-only">Toggle Dropdown</span> </button> <div class="dropdown-menu"></div> </div> @if (!String.IsNullOrEmpty(settings.Hint)) { <span class="hint">@settings.Hint</span> } </fieldset> <script at="Foot"> $(function () { $('#@Html.IdForModel()').iconpicker(); var storedIcon = $('#@Html.IdFor(m=>m.Text)').val(); if (storedIcon) { $('#@Html.IdForModel()').data('iconpicker').update(storedIcon); $('#@Html.IdForModel()').on('iconpickerSelected', function (e) { $('#@Html.IdFor(m=>m.Text)').val(e.iconpickerInstance.options.fullClassFormatter(e.iconpickerValue)); }); } }); </script>
bsd-3-clause
C#
3660df631373f7fc2f0e41286a61db0e22052f49
Add SetCursor and LoadCursor to NativeMethods
stefan-baumann/AeroSuite
AeroSuite/NativeMethods.cs
AeroSuite/NativeMethods.cs
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace AeroSuite { /// <summary> /// Provides some methods from the user32 and uxtheme libraries. /// </summary> internal static class NativeMethods { private const string user32 = "user32.dll"; private const string uxtheme = "uxtheme.dll"; [DllImport(user32)] public static extern IntPtr SendMessage(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam); [DllImport(user32, CharSet = CharSet.Unicode)] public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, string lParam); [DllImport(user32)] public static extern IntPtr LoadCursor(IntPtr hInstance, int lpCursorName); [DllImport(user32)] public static extern IntPtr SetCursor(IntPtr hCursor); [DllImport(uxtheme, CharSet = CharSet.Unicode)] public extern static int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string pszSubIdList); } }
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace AeroSuite { /// <summary> /// Provides some methods from the user32 and uxtheme libraries. /// </summary> internal static class NativeMethods { private const string user32 = "user32.dll"; private const string uxtheme = "uxtheme.dll"; [DllImport(user32)] public static extern IntPtr SendMessage(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam); [DllImport(user32, CharSet = CharSet.Unicode)] public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, string lParam); [DllImport(uxtheme, CharSet = CharSet.Unicode)] public extern static int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string pszSubIdList); } }
mit
C#
2c34a9de89bad3632a3b41a5d0f80d60b62e5823
Make different mod name in patched version
earalov/Skylines-ElevatedTrainStationTrack
Mod.cs
Mod.cs
using ICities; using MetroOverhaul.OptionsFramework.Extensions; namespace MetroOverhaul { public class Mod : IUserMod { #if IS_PATCH public const bool isPatch = true; #else public const bool isPatch = false; #endif public string Name => "Metro Overhaul" + (isPatch ? " [Patched]" : ""); public string Description => "Brings metro depots, ground and elevated metro tracks"; public void OnSettingsUI(UIHelperBase helper) { helper.AddOptionsGroup<Options>(); } } }
using ICities; using MetroOverhaul.OptionsFramework.Extensions; namespace MetroOverhaul { public class Mod : IUserMod { public string Name => "Metro Overhaul"; public string Description => "Brings metro depots, ground and elevated metro tracks"; public void OnSettingsUI(UIHelperBase helper) { helper.AddOptionsGroup<Options>(); } } }
mit
C#
6759d4e414ea49c605be2bd104ab0df65c81ee9e
handle partial transmissions
DMagic1/Orbital-Science,Kerbas-ad-astra/Orbital-Science
Source/Scenario/DMTransmissionWatcher.cs
Source/Scenario/DMTransmissionWatcher.cs
#region license /* DMagic Orbital Science - DM Transmission Watcher * Monobehaviour to watch for science data transmission * * Copyright (c) 2014, David Grandy <david.grandy@gmail.com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #endregion using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; namespace DMagic { class DMTransmissionWatcher : MonoBehaviour { private void Start() { DMUtils.DebugLog("Starting Transmission Watcher"); GameEvents.OnScienceRecieved.Add(scienceReceived); } private void OnDestroy() { DMUtils.DebugLog("Stopping Transmission Watcher"); GameEvents.OnScienceRecieved.Remove(scienceReceived); } private void scienceReceived(float sci, ScienceSubject sub) { DMUtils.DebugLog("Science Data Transmitted For {0} Science", sci); foreach (DMScienceScenario.DMScienceData DMData in DMScienceScenario.SciScenario.recoveredScienceList) { if (sub.title == DMData.title) { DMScienceScenario.SciScenario.submitDMScience(DMData, sub, sci); break; } } } } }
#region license /* DMagic Orbital Science - DM Transmission Watcher * Monobehaviour to watch for science data transmission * * Copyright (c) 2014, David Grandy <david.grandy@gmail.com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #endregion using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; namespace DMagic { class DMTransmissionWatcher : MonoBehaviour { private void Start() { DMUtils.DebugLog("Starting Transmission Watcher"); GameEvents.OnScienceRecieved.Add(scienceReceived); } private void OnDestroy() { DMUtils.DebugLog("Stopping Transmission Watcher"); GameEvents.OnScienceRecieved.Remove(scienceReceived); } private void scienceReceived(float sci, ScienceSubject sub) { DMUtils.DebugLog("Science Data Transmitted For {0} Science", sci); foreach (DMScienceScenario.DMScienceData DMData in DMScienceScenario.SciScenario.recoveredScienceList) { if (sub.title == DMData.title) { DMScienceScenario.SciScenario.submitDMScience(DMData, sub); DMScienceScenario.SciScenario.updateRemainingData(); break; } } } } }
bsd-3-clause
C#
83573182e7d99e3c20e66ea44d9d17173e174fc6
fix AutomationRunMode item type in class.
Willster419/RelicModManager,Willster419/RelhaxModpack,Willster419/RelhaxModpack
RelhaxModpack/RelhaxModpack/Settings/AutomationRunnerSettings.cs
RelhaxModpack/RelhaxModpack/Settings/AutomationRunnerSettings.cs
using RelhaxModpack.Utilities.Enums; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace RelhaxModpack.Settings { /// <summary> /// Defines settings used in the database automation runner window /// </summary> public class AutomationRunnerSettings : ISettingsFile { public const string RepoDefaultBranch = "master"; /// <summary> /// The name of the xml file on disk /// </summary> public string Filename { get; } = "AutomationRunnerSettings.xml"; /// <summary> /// A list of properties and fields to exclude from saving/loading to and from xml /// </summary> public string[] MembersToExclude { get { return new string[] { nameof(MembersToExclude), nameof(Filename), nameof(RepoDefaultBranch) }; } } /// <summary> /// The name of the branch on github that the user specifies to download the automation scripts from /// </summary> public string SelectedBranch { get; set; } = "master"; public bool OpenLogWindowOnStartup { get; set; } = true; public string BigmodsUsername { get; set; } = string.Empty; public string BigmodsPassword { get; set; } = string.Empty; public string DatabaseSavePath { get; set; } = string.Empty; /// <summary> /// Toggle to dump the parsed macros to the log file before every sequence run /// </summary> public bool DumpParsedMacrosPerSequenceRun { get; set; } = false; public bool DumpShellEnvironmentVarsPerSequenceRun { get; set; } = false; public bool UseLocalRunnerDatabase { get; set; } = false; public string LocalRunnerDatabaseRoot { get; set; } = string.Empty; public string WoTClientInstallLocation { get; set; } = string.Empty; public bool SequenceDebugMode { get; set; } = false; public AutomationRunMode AutomationRunMode { get; set; } = AutomationRunMode.Interactive; } }
using RelhaxModpack.Utilities.Enums; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace RelhaxModpack.Settings { /// <summary> /// Defines settings used in the database automation runner window /// </summary> public class AutomationRunnerSettings : ISettingsFile { public const string RepoDefaultBranch = "master"; /// <summary> /// The name of the xml file on disk /// </summary> public string Filename { get; } = "AutomationRunnerSettings.xml"; /// <summary> /// A list of properties and fields to exclude from saving/loading to and from xml /// </summary> public string[] MembersToExclude { get { return new string[] { nameof(MembersToExclude), nameof(Filename), nameof(RepoDefaultBranch) }; } } /// <summary> /// The name of the branch on github that the user specifies to download the automation scripts from /// </summary> public string SelectedBranch { get; set; } = "master"; public bool OpenLogWindowOnStartup { get; set; } = true; public string BigmodsUsername { get; set; } = string.Empty; public string BigmodsPassword { get; set; } = string.Empty; public string DatabaseSavePath { get; set; } = string.Empty; /// <summary> /// Toggle to dump the parsed macros to the log file before every sequence run /// </summary> public bool DumpParsedMacrosPerSequenceRun { get; set; } = false; public bool DumpShellEnvironmentVarsPerSequenceRun { get; set; } = false; public bool UseLocalRunnerDatabase { get; set; } = false; public string LocalRunnerDatabaseRoot { get; set; } = string.Empty; public string WoTClientInstallLocation { get; set; } = string.Empty; public bool SequenceDebugMode { get; set; } = false; public AutomationRunMode AutomationRunMode = AutomationRunMode.Interactive; } }
apache-2.0
C#
5962e9855590515c7183db0b904e85e83693e710
use Sha1.create
dkackman/FakeHttp
FakeHttp.Desktop/DesktopMessageFormatter.cs
FakeHttp.Desktop/DesktopMessageFormatter.cs
using System; using System.Text; using System.Security.Cryptography; namespace FakeHttp.Desktop { sealed class DesktopMessageFormatter : MessageFormatter { public DesktopMessageFormatter() : this(new ResponseCallbacks()) // by default do not filter any query parameters { } public DesktopMessageFormatter(IResponseCallbacks callbacks) : base(callbacks) { } public override string ToSha1Hash(string text) { if (string.IsNullOrEmpty(text)) { return string.Empty; } using (var sha1 = SHA1.Create()) { byte[] textData = Encoding.UTF8.GetBytes(text); byte[] hash = sha1.ComputeHash(textData); return BitConverter.ToString(hash).Replace("-", string.Empty); } } } }
using System; using System.Text; using System.Security.Cryptography; namespace FakeHttp.Desktop { sealed class DesktopMessageFormatter : MessageFormatter { public DesktopMessageFormatter() : this(new ResponseCallbacks()) // by default do not filter any query parameters { } public DesktopMessageFormatter(IResponseCallbacks callbacks) : base(callbacks) { } public override string ToSha1Hash(string text) { if (string.IsNullOrEmpty(text)) { return string.Empty; } using (var sha1 = new SHA1Managed()) { byte[] textData = Encoding.UTF8.GetBytes(text); byte[] hash = sha1.ComputeHash(textData); return BitConverter.ToString(hash).Replace("-", string.Empty); } } } }
apache-2.0
C#
5562a230a085711168bda33f70761f9bc7f91c32
Fix flaky test (#46763)
genlu/roslyn,dotnet/roslyn,AlekseyTs/roslyn,wvdd007/roslyn,dotnet/roslyn,tannergooding/roslyn,weltkante/roslyn,physhi/roslyn,eriawan/roslyn,AlekseyTs/roslyn,wvdd007/roslyn,jasonmalinowski/roslyn,CyrusNajmabadi/roslyn,jasonmalinowski/roslyn,bartdesmet/roslyn,sharwell/roslyn,stephentoub/roslyn,mavasani/roslyn,panopticoncentral/roslyn,mgoertz-msft/roslyn,jmarolf/roslyn,mavasani/roslyn,tmat/roslyn,eriawan/roslyn,tannergooding/roslyn,ErikSchierboom/roslyn,gafter/roslyn,diryboy/roslyn,KevinRansom/roslyn,aelij/roslyn,genlu/roslyn,jmarolf/roslyn,diryboy/roslyn,weltkante/roslyn,stephentoub/roslyn,ErikSchierboom/roslyn,mgoertz-msft/roslyn,KirillOsenkov/roslyn,mgoertz-msft/roslyn,mavasani/roslyn,weltkante/roslyn,brettfo/roslyn,tannergooding/roslyn,physhi/roslyn,bartdesmet/roslyn,heejaechang/roslyn,diryboy/roslyn,tmat/roslyn,KevinRansom/roslyn,shyamnamboodiripad/roslyn,physhi/roslyn,shyamnamboodiripad/roslyn,AmadeusW/roslyn,KirillOsenkov/roslyn,stephentoub/roslyn,brettfo/roslyn,heejaechang/roslyn,aelij/roslyn,AmadeusW/roslyn,jasonmalinowski/roslyn,tmat/roslyn,genlu/roslyn,CyrusNajmabadi/roslyn,panopticoncentral/roslyn,dotnet/roslyn,KevinRansom/roslyn,AmadeusW/roslyn,sharwell/roslyn,gafter/roslyn,shyamnamboodiripad/roslyn,wvdd007/roslyn,eriawan/roslyn,KirillOsenkov/roslyn,brettfo/roslyn,ErikSchierboom/roslyn,gafter/roslyn,AlekseyTs/roslyn,heejaechang/roslyn,bartdesmet/roslyn,CyrusNajmabadi/roslyn,jmarolf/roslyn,panopticoncentral/roslyn,sharwell/roslyn,aelij/roslyn
src/Compilers/Server/VBCSCompilerTests/TestableClientConnectionHost.cs
src/Compilers/Server/VBCSCompilerTests/TestableClientConnectionHost.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.CommandLine; using System; using System.Collections.Generic; using System.IO.Pipes; using System.Threading; using System.Threading.Tasks; #nullable enable namespace Microsoft.CodeAnalysis.CompilerServer.UnitTests { internal sealed class TestableClientConnectionHost : IClientConnectionHost { private readonly object _guard = new object(); private TaskCompletionSource<IClientConnection>? _finalTaskCompletionSource; private Queue<Func<Task<IClientConnection>>> _waitingTasks = new Queue<Func<Task<IClientConnection>>>(); public bool IsListening { get; set; } public TestableClientConnectionHost() { } public void BeginListening() { IsListening = true; _finalTaskCompletionSource = new TaskCompletionSource<IClientConnection>(); } public void EndListening() { IsListening = false; lock (_guard) { _waitingTasks.Clear(); _finalTaskCompletionSource?.SetCanceled(); _finalTaskCompletionSource = null; } } public Task<IClientConnection> GetNextClientConnectionAsync() { Func<Task<IClientConnection>>? func = null; lock (_guard) { if (_waitingTasks.Count == 0) { if (_finalTaskCompletionSource is null) { _finalTaskCompletionSource = new TaskCompletionSource<IClientConnection>(); } return _finalTaskCompletionSource.Task; } func = _waitingTasks.Dequeue(); } return func(); } public void Add(Func<Task<IClientConnection>> func) { lock (_guard) { if (_finalTaskCompletionSource is object) { throw new InvalidOperationException("All Adds must be called before they are exhausted"); } _waitingTasks.Enqueue(func); } } } }
// 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.CommandLine; using System; using System.Collections.Generic; using System.IO.Pipes; using System.Threading; using System.Threading.Tasks; #nullable enable namespace Microsoft.CodeAnalysis.CompilerServer.UnitTests { internal sealed class TestableClientConnectionHost : IClientConnectionHost { private readonly object _guard = new object(); private Queue<Func<Task<IClientConnection>>> _waitingTasks = new Queue<Func<Task<IClientConnection>>>(); public bool IsListening { get; set; } public TestableClientConnectionHost() { } public void BeginListening() { IsListening = true; } public void EndListening() { IsListening = false; lock (_guard) { _waitingTasks.Clear(); } } public Task<IClientConnection> GetNextClientConnectionAsync() { Func<Task<IClientConnection>>? func = null; lock (_guard) { if (_waitingTasks.Count == 0) { throw new InvalidOperationException(); } func = _waitingTasks.Dequeue(); } return func(); } public void Add(Func<Task<IClientConnection>> func) { lock (_guard) { _waitingTasks.Enqueue(func); } } } }
mit
C#
4a5e64f4db3ebd375ed89b3e61b94d5c7d088238
add mapping tryGetValue
dlmelendez/identityazuretable,dlmelendez/identityazuretable,dlmelendez/identityazuretable
src/ElCamino.AspNetCore.Identity.AzureTable/Helpers/EntityMapHelper.cs
src/ElCamino.AspNetCore.Identity.AzureTable/Helpers/EntityMapHelper.cs
// MIT License Copyright 2020 (c) David Melendez. All rights reserved. See License.txt in the project root for license information. using Azure.Data.Tables; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; namespace ElCamino.AspNetCore.Identity.AzureTable.Helpers { public static class EntityMapHelper { private readonly static ConcurrentDictionary<string, PropertyInfo[]> TypeProperties = new ConcurrentDictionary<string, PropertyInfo[]>(); private static PropertyInfo[] GetProperties(Type type) { return TypeProperties.GetOrAdd(type.FullName, (name) => type.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.SetProperty) .Where(w => w.GetCustomAttribute(typeof(IgnoreDataMemberAttribute)) == null) .ToArray()); } public static T MapTableEntity<T>(this TableEntity dte) where T : ITableEntity, new() { T t = new(); foreach (var prop in GetProperties(typeof(T))) { if (dte.TryGetValue(prop.Name, out object obj)) { prop.SetValue(t, obj); } } return t; } } }
using Azure.Data.Tables; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; namespace ElCamino.AspNetCore.Identity.AzureTable.Helpers { public static class EntityMapHelper { private readonly static ConcurrentDictionary<string, PropertyInfo[]> TypeProperties = new ConcurrentDictionary<string, PropertyInfo[]>(); private static PropertyInfo[] GetProperties(Type type) { return TypeProperties.GetOrAdd(type.FullName, (name) => type.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.SetProperty) .Where(w => w.GetCustomAttribute(typeof(IgnoreDataMemberAttribute)) == null) .ToArray()); } public static T MapTableEntity<T>(this TableEntity dte) where T : ITableEntity, new() { T t = new(); var properties = GetProperties(typeof(T)); foreach (var prop in properties) { prop.SetValue(t, dte[prop.Name]); } return t; } } }
mit
C#
004af6e9b8f07222971ca85bdcbf2af53128f994
Update SettingFontUnderlineType.cs
asposecells/Aspose_Cells_NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET
Examples/CSharp/Formatting/DealingWithFontSettings/SettingFontUnderlineType.cs
Examples/CSharp/Formatting/DealingWithFontSettings/SettingFontUnderlineType.cs
using System.IO; using Aspose.Cells; namespace Aspose.Cells.Examples.Formatting.DealingWithFontSettings { public class SettingFontUnderlineType { public static void Main(string[] args) { //ExStart:1 // The path to the documents directory. string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); // Create directory if it is not already present. bool IsExists = System.IO.Directory.Exists(dataDir); if (!IsExists) System.IO.Directory.CreateDirectory(dataDir); //Instantiating a Workbook object Workbook workbook = new Workbook(); //Adding a new worksheet to the Excel object int i = workbook.Worksheets.Add(); //Obtaining the reference of the newly added worksheet by passing its sheet index Worksheet worksheet = workbook.Worksheets[i]; //Accessing the "A1" cell from the worksheet Aspose.Cells.Cell cell = worksheet.Cells["A1"]; //Adding some value to the "A1" cell cell.PutValue("Hello Aspose!"); //Obtaining the style of the cell Style style = cell.GetStyle(); //Setting the font to be underlined style.Font.Underline = FontUnderlineType.Single; //Applying the style to the cell cell.SetStyle(style); //Saving the Excel file workbook.Save(dataDir + "book1.out.xls", SaveFormat.Excel97To2003); //ExEnd:1 } } }
using System.IO; using Aspose.Cells; namespace Aspose.Cells.Examples.Formatting.DealingWithFontSettings { public class SettingFontUnderlineType { public static void Main(string[] args) { // The path to the documents directory. string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); // Create directory if it is not already present. bool IsExists = System.IO.Directory.Exists(dataDir); if (!IsExists) System.IO.Directory.CreateDirectory(dataDir); //Instantiating a Workbook object Workbook workbook = new Workbook(); //Adding a new worksheet to the Excel object int i = workbook.Worksheets.Add(); //Obtaining the reference of the newly added worksheet by passing its sheet index Worksheet worksheet = workbook.Worksheets[i]; //Accessing the "A1" cell from the worksheet Aspose.Cells.Cell cell = worksheet.Cells["A1"]; //Adding some value to the "A1" cell cell.PutValue("Hello Aspose!"); //Obtaining the style of the cell Style style = cell.GetStyle(); //Setting the font to be underlined style.Font.Underline = FontUnderlineType.Single; //Applying the style to the cell cell.SetStyle(style); //Saving the Excel file workbook.Save(dataDir + "book1.out.xls", SaveFormat.Excel97To2003); } } }
mit
C#
694e6fdbb96a403ff31da7056f570c983dbb53d6
Fix spelling mistake.
gheeres/PDFSharp.Extensions
Properties/AssemblyInfo.cs
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("PDFSharp.Extensions")] [assembly: AssemblyDescription("A set of extensions for the PDFSharp.NET library.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("n/a")] [assembly: AssemblyProduct("PDFSharp.Extensions")] [assembly: AssemblyCopyright("Copyright © 2014, George Heeres (gheeres@gmail.com)")] [assembly: AssemblyTrademark("Licensed under MIT")] [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("047162b6-b659-496b-bab3-57dc8be2c677")] // 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("0.1.0.0")] [assembly: AssemblyFileVersion("0.1.0.0")]
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("PDFSharp.Extensions")] [assembly: AssemblyDescription("A set of extensions fpr the PDFSharp.NET library.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("n/a")] [assembly: AssemblyProduct("PDFSharp.Extensions")] [assembly: AssemblyCopyright("Copyright © 2014, George Heeres (gheeres@gmail.com)")] [assembly: AssemblyTrademark("Licensed under MIT")] [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("047162b6-b659-496b-bab3-57dc8be2c677")] // 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("0.1.0.0")] [assembly: AssemblyFileVersion("0.1.0.0")]
mit
C#
12e4a0eb5e093d734dd4bc43743eea3c4c3543f7
Update assembly information
goguvi/WooCommerce.NET,XiaoFaye/WooCommerce.NET,tablesmit/WooCommerce.NET
Properties/AssemblyInfo.cs
Properties/AssemblyInfo.cs
using System.Resources; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("WooCommerce.NET")] [assembly: AssemblyDescription("A .NET Wrapper for WooCommerce REST API")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("JamesYang@NZ")] [assembly: AssemblyProduct("WooCommerce.NET")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // 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("0.2.0.0")] [assembly: AssemblyFileVersion("0.2.0.0")]
using System.Resources; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("WooCommerce.NET")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("WooCommerce.NET")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
1ed85f9a2d9d8ba21e516dc1a3078e2c3b82db84
rename parameter
LayoutFarm/PixelFarm
src/PixelFarm/PixelFarm.DrawingCanvas/5_Agg_DrawElements/VertexSource/VertexStoreBuilder.cs
src/PixelFarm/PixelFarm.DrawingCanvas/5_Agg_DrawElements/VertexSource/VertexStoreBuilder.cs
//BSD, 2014-2018, WinterDev //---------------------------------------------------------------------------- // Anti-Grain Geometry - Version 2.4 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // // C# Port port by: Lars Brubaker // larsbrubaker@gmail.com // Copyright (C) 2007 // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // //---------------------------------------------------------------------------- // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://www.antigrain.com //---------------------------------------------------------------------------- using System.Collections.Generic; using PixelFarm.Drawing; namespace PixelFarm.Agg { public static class VertexStoreBuilder { public static VertexStore CreateVxs(IEnumerable<VertexData> iter, VertexStore output) { foreach (VertexData v in iter) { output.AddVertex(v.x, v.y, v.command); } return output; } } }
//BSD, 2014-2018, WinterDev //---------------------------------------------------------------------------- // Anti-Grain Geometry - Version 2.4 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // // C# Port port by: Lars Brubaker // larsbrubaker@gmail.com // Copyright (C) 2007 // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // //---------------------------------------------------------------------------- // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://www.antigrain.com //---------------------------------------------------------------------------- using System.Collections.Generic; using PixelFarm.Drawing; namespace PixelFarm.Agg { public static class VertexStoreBuilder { public static VertexStore CreateVxs(IEnumerable<VertexData> iter, VertexStore vxs) { foreach (VertexData v in iter) { vxs.AddVertex(v.x, v.y, v.command); } return vxs; } } }
bsd-2-clause
C#