commit
stringlengths
40
40
old_file
stringlengths
4
237
new_file
stringlengths
4
237
old_contents
stringlengths
1
4.24k
new_contents
stringlengths
1
4.87k
subject
stringlengths
15
778
message
stringlengths
15
8.75k
lang
stringclasses
266 values
license
stringclasses
13 values
repos
stringlengths
5
127k
ba63be2b636316459437e9ce95c467be3c03f48c
BankingManagementClient.Host.Web/Views/Home/Index.cshtml
BankingManagementClient.Host.Web/Views/Home/Index.cshtml
@model IEnumerable<BankingManagementClient.ProjectionStore.Projections.Client.ClientProjection> @{ ViewBag.Title = "Index"; } <h2>Index</h2> <p> @Html.ActionLink("Create New", "Create") </p> <table class="table"> <tr> <th> @Html.DisplayNameFor(model => model.ElementAt(0) .ClientId) </th> <th> @Html.DisplayNameFor(model => model.ElementAt(0) .ClientName) </th> <th></th> </tr> @foreach (var clientProjection in Model) { <tr> <td> @Html.ActionLink(clientProjection.ClientId.ToString(), "Details", new { id = clientProjection.ClientId }) </td> <td> @Html.DisplayFor(modelItem => clientProjection.ClientName) </td> </tr> } </table>
@model IEnumerable<BankingManagementClient.ProjectionStore.Projections.Client.ClientProjection> @{ ViewBag.Title = "Index"; } <h2>Clients</h2> @if (Model.Any()) { <table class="table"> <tr> <th> @Html.DisplayNameFor(model => model.ElementAt(0) .ClientId) </th> <th> @Html.DisplayNameFor(model => model.ElementAt(0) .ClientName) </th> <th></th> </tr> @foreach (var clientProjection in Model) { <tr> <td> @Html.ActionLink(clientProjection.ClientId.ToString(), "Details", new {id = clientProjection.ClientId}) </td> <td> @Html.DisplayFor(modelItem => clientProjection.ClientName) </td> </tr> } </table> } else { <p>No clients found.</p> }
Check if there are any Clients on the list page
Check if there are any Clients on the list page
C#
mit
andrewgunn/CodeUtopia,andrewgunn/CodeUtopia,andrewgunn/CodeUtopia
9014b1dc1fb68e8bbda2da6fe2a74404010ab1fa
src/ApiContractGenerator.MSBuild/GenerateApiContract.cs
src/ApiContractGenerator.MSBuild/GenerateApiContract.cs
using System.IO; using ApiContractGenerator.AssemblyReferenceResolvers; using ApiContractGenerator.MetadataReferenceResolvers; using ApiContractGenerator.Source; using Microsoft.Build.Framework; namespace ApiContractGenerator.MSBuild { public sealed class GenerateApiContract : ITask { public IBuildEngine BuildEngine { get; set; } public ITaskHost HostObject { get; set; } [Required] public ITaskItem[] Assemblies { get; set; } public string[] IgnoredNamespaces { get; set; } public bool Execute() { if (Assemblies.Length == 0) return true; var generator = new ApiContractGenerator(); generator.IgnoredNamespaces.UnionWith(IgnoredNamespaces); foreach (var assembly in Assemblies) { var assemblyPath = assembly.GetMetadata("ResolvedAssemblyPath"); var outputPath = assembly.GetMetadata("ResolvedOutputPath"); var assemblyResolver = new CompositeAssemblyReferenceResolver( new GacAssemblyReferenceResolver(), new SameDirectoryAssemblyReferenceResolver(Path.GetDirectoryName(assemblyPath))); using (var metadataReferenceResolver = new MetadataReaderReferenceResolver(() => File.OpenRead(assemblyPath), assemblyResolver)) using (var source = new MetadataReaderSource(File.OpenRead(assemblyPath), metadataReferenceResolver)) using (var outputFile = File.CreateText(outputPath)) generator.Generate(source, new CSharpTextFormatter(outputFile, metadataReferenceResolver)); } return true; } } }
using System.IO; using ApiContractGenerator.AssemblyReferenceResolvers; using ApiContractGenerator.MetadataReferenceResolvers; using ApiContractGenerator.Source; using Microsoft.Build.Framework; namespace ApiContractGenerator.MSBuild { public sealed class GenerateApiContract : ITask { public IBuildEngine BuildEngine { get; set; } public ITaskHost HostObject { get; set; } [Required] public ITaskItem[] Assemblies { get; set; } public string[] IgnoredNamespaces { get; set; } public bool Execute() { if (Assemblies == null || Assemblies.Length == 0) return true; var generator = new ApiContractGenerator(); if (IgnoredNamespaces != null) generator.IgnoredNamespaces.UnionWith(IgnoredNamespaces); foreach (var assembly in Assemblies) { var assemblyPath = assembly.GetMetadata("ResolvedAssemblyPath"); var outputPath = assembly.GetMetadata("ResolvedOutputPath"); var assemblyResolver = new CompositeAssemblyReferenceResolver( new GacAssemblyReferenceResolver(), new SameDirectoryAssemblyReferenceResolver(Path.GetDirectoryName(assemblyPath))); using (var metadataReferenceResolver = new MetadataReaderReferenceResolver(() => File.OpenRead(assemblyPath), assemblyResolver)) using (var source = new MetadataReaderSource(File.OpenRead(assemblyPath), metadataReferenceResolver)) using (var outputFile = File.CreateText(outputPath)) generator.Generate(source, new CSharpTextFormatter(outputFile, metadataReferenceResolver)); } return true; } } }
Handle null arrays when MSBuild doesn't initialize task properties
Handle null arrays when MSBuild doesn't initialize task properties
C#
mit
jnm2/ApiContractGenerator,jnm2/ApiContractGenerator
535d5853aa85e72e8a3f9fdc5a4180dc41a39f9c
DesktopWidgets/Widgets/CountdownClock/Settings.cs
DesktopWidgets/Widgets/CountdownClock/Settings.cs
using System; using System.Collections.Generic; using System.ComponentModel; using DesktopWidgets.WidgetBase.Settings; namespace DesktopWidgets.Widgets.CountdownClock { public class Settings : WidgetClockSettingsBase { public Settings() { DateTimeFormat = new List<string> {"{dd}d {hh}h {mm}m"}; } [Category("End")] [DisplayName("Date/Time")] public DateTime EndDateTime { get; set; } = DateTime.Now; [Browsable(false)] [DisplayName("Last End Date/Time")] public DateTime LastEndDateTime { get; set; } = DateTime.Now; [Category("Style")] [DisplayName("Continue Counting")] public bool EndContinueCounting { get; set; } = false; [Category("End Sync")] [DisplayName("Sync Next Year")] public bool SyncYear { get; set; } = false; [Category("End Sync")] [DisplayName("Sync Next Month")] public bool SyncMonth { get; set; } = false; [Category("End Sync")] [DisplayName("Sync Next Day")] public bool SyncDay { get; set; } = false; [Category("End Sync")] [DisplayName("Sync Next Hour")] public bool SyncHour { get; set; } = false; [Category("End Sync")] [DisplayName("Sync Next Minute")] public bool SyncMinute { get; set; } = false; [Category("End Sync")] [DisplayName("Sync Next Second")] public bool SyncSecond { get; set; } = false; } }
using System; using System.Collections.Generic; using System.ComponentModel; using DesktopWidgets.WidgetBase.Settings; using Xceed.Wpf.Toolkit.PropertyGrid.Attributes; namespace DesktopWidgets.Widgets.CountdownClock { public class Settings : WidgetClockSettingsBase { public Settings() { DateTimeFormat = new List<string> {"{dd}d {hh}h {mm}m"}; } [Category("End")] [DisplayName("Date/Time")] public DateTime EndDateTime { get; set; } = DateTime.Now; [Browsable(false)] [DisplayName("Last End Date/Time")] public DateTime LastEndDateTime { get; set; } = DateTime.Now; [Category("Style")] [DisplayName("Continue Counting")] public bool EndContinueCounting { get; set; } = false; [PropertyOrder(0)] [Category("End Sync")] [DisplayName("Sync Next Year")] public bool SyncYear { get; set; } = false; [PropertyOrder(1)] [Category("End Sync")] [DisplayName("Sync Next Month")] public bool SyncMonth { get; set; } = false; [PropertyOrder(2)] [Category("End Sync")] [DisplayName("Sync Next Day")] public bool SyncDay { get; set; } = false; [PropertyOrder(3)] [Category("End Sync")] [DisplayName("Sync Next Hour")] public bool SyncHour { get; set; } = false; [PropertyOrder(4)] [Category("End Sync")] [DisplayName("Sync Next Minute")] public bool SyncMinute { get; set; } = false; [PropertyOrder(5)] [Category("End Sync")] [DisplayName("Sync Next Second")] public bool SyncSecond { get; set; } = false; } }
Change "Countdown" "End Sync" properties order
Change "Countdown" "End Sync" properties order
C#
apache-2.0
danielchalmers/DesktopWidgets
edd8eb261c434dd6256621f3f05e842356d48bf9
src/Abp.Zero.NHibernate/Zero/NHibernate/EntityMappings/AbpTenantMap.cs
src/Abp.Zero.NHibernate/Zero/NHibernate/EntityMappings/AbpTenantMap.cs
using Abp.Authorization.Users; using Abp.MultiTenancy; using Abp.NHibernate.EntityMappings; namespace Abp.Zero.NHibernate.EntityMappings { /// <summary> /// Base class to map classes derived from <see cref="AbpTenant{TTenant,TUser}"/> /// </summary> /// <typeparam name="TTenant">Tenant type</typeparam> /// <typeparam name="TUser">User type</typeparam> public abstract class AbpTenantMap<TTenant, TUser> : EntityMap<TTenant> where TTenant : AbpTenant<TUser> where TUser : AbpUser<TUser> { /// <summary> /// Constructor. /// </summary> protected AbpTenantMap() : base("AbpTenants") { References(x => x.Edition).Column("EditionId").Nullable(); Map(x => x.TenancyName); Map(x => x.Name); Map(x => x.IsActive); this.MapFullAudited(); Polymorphism.Explicit(); } } }
using Abp.Authorization.Users; using Abp.MultiTenancy; using Abp.NHibernate.EntityMappings; namespace Abp.Zero.NHibernate.EntityMappings { /// <summary> /// Base class to map classes derived from <see cref="AbpTenant{TUser}"/> /// </summary> /// <typeparam name="TTenant">Tenant type</typeparam> /// <typeparam name="TUser">User type</typeparam> public abstract class AbpTenantMap<TTenant, TUser> : EntityMap<TTenant> where TTenant : AbpTenant<TUser> where TUser : AbpUser<TUser> { /// <summary> /// Constructor. /// </summary> protected AbpTenantMap() : base("AbpTenants") { References(x => x.Edition).Column("EditionId").Nullable(); Map(x => x.TenancyName); Map(x => x.Name); Map(x => x.IsActive); this.MapFullAudited(); Polymorphism.Explicit(); } } }
Fix cref attribute in XML comment
Fix cref attribute in XML comment
C#
mit
aspnetboilerplate/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,ryancyq/aspnetboilerplate,luchaoshuai/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,ryancyq/aspnetboilerplate,ryancyq/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,ryancyq/aspnetboilerplate,luchaoshuai/aspnetboilerplate
ca01a2f2e82323df678c784ec967c0f80f12d284
Octokit.Tests.Integration/Reactive/ObservableRepositoriesClientTests.cs
Octokit.Tests.Integration/Reactive/ObservableRepositoriesClientTests.cs
using System.Linq; using System.Reactive.Linq; using System.Threading.Tasks; using Octokit.Reactive; using Xunit; namespace Octokit.Tests.Integration { public class ObservableRepositoriesClientTests { public class TheGetMethod { [IntegrationTest] public async Task ReturnsSpecifiedRepository() { var github = Helper.GetAuthenticatedClient(); var client = new ObservableRepositoriesClient(github); var observable = client.Get("haacked", "seegit"); var repository = await observable; var repository2 = await observable; Assert.Equal("https://github.com/Haacked/SeeGit.git", repository.CloneUrl); Assert.False(repository.Private); Assert.False(repository.Fork); Assert.Equal("https://github.com/Haacked/SeeGit.git", repository2.CloneUrl); Assert.False(repository2.Private); Assert.False(repository2.Fork); } } public class TheGetAllPublicSinceMethod { [IntegrationTest] public async Task ReturnsAllPublicReposSinceLastSeen() { var github = Helper.GetAuthenticatedClient(); var client = new ObservableRepositoriesClient(github); var request = new PublicRepositoryRequest { Since = 32732250 }; var repositories = await client.GetAllPublic(request).ToArray(); Assert.NotNull(repositories); Assert.True(repositories.Any()); Assert.Equal(32732252, repositories[0].Id); Assert.False(repositories[0].Private); Assert.Equal("zad19", repositories[0].Name); } } } }
using System.Linq; using System.Reactive.Linq; using System.Threading.Tasks; using Octokit.Reactive; using Xunit; namespace Octokit.Tests.Integration { public class ObservableRepositoriesClientTests { public class TheGetMethod { [IntegrationTest] public async Task ReturnsSpecifiedRepository() { var github = Helper.GetAuthenticatedClient(); var client = new ObservableRepositoriesClient(github); var observable = client.Get("haacked", "seegit"); var repository = await observable; var repository2 = await observable; Assert.Equal("https://github.com/Haacked/SeeGit.git", repository.CloneUrl); Assert.False(repository.Private); Assert.False(repository.Fork); Assert.Equal("https://github.com/Haacked/SeeGit.git", repository2.CloneUrl); Assert.False(repository2.Private); Assert.False(repository2.Fork); } } public class TheGetAllPublicSinceMethod { [IntegrationTest(Skip = "This will take a very long time to return, so will skip it for now.")] public async Task ReturnsAllPublicReposSinceLastSeen() { var github = Helper.GetAuthenticatedClient(); var client = new ObservableRepositoriesClient(github); var request = new PublicRepositoryRequest { Since = 32732250 }; var repositories = await client.GetAllPublic(request).ToArray(); Assert.NotEmpty(repositories); Assert.Equal(32732252, repositories[0].Id); Assert.False(repositories[0].Private); Assert.Equal("zad19", repositories[0].Name); } } } }
Update Assert call and mute the test
Update Assert call and mute the test
C#
mit
shiftkey/octokit.net,adamralph/octokit.net,Sarmad93/octokit.net,alfhenrik/octokit.net,darrelmiller/octokit.net,brramos/octokit.net,dlsteuer/octokit.net,forki/octokit.net,gdziadkiewicz/octokit.net,nsrnnnnn/octokit.net,octokit-net-test/octokit.net,nsnnnnrn/octokit.net,ChrisMissal/octokit.net,mminns/octokit.net,geek0r/octokit.net,shiftkey-tester-org-blah-blah/octokit.net,mminns/octokit.net,dampir/octokit.net,ivandrofly/octokit.net,devkhan/octokit.net,chunkychode/octokit.net,alfhenrik/octokit.net,rlugojr/octokit.net,ivandrofly/octokit.net,takumikub/octokit.net,SamTheDev/octokit.net,rlugojr/octokit.net,eriawan/octokit.net,gabrielweyer/octokit.net,hitesh97/octokit.net,magoswiat/octokit.net,hahmed/octokit.net,cH40z-Lord/octokit.net,TattsGroup/octokit.net,shiftkey/octokit.net,octokit/octokit.net,khellang/octokit.net,editor-tools/octokit.net,thedillonb/octokit.net,daukantas/octokit.net,shana/octokit.net,SamTheDev/octokit.net,SmithAndr/octokit.net,SLdragon1989/octokit.net,naveensrinivasan/octokit.net,michaKFromParis/octokit.net,octokit/octokit.net,thedillonb/octokit.net,chunkychode/octokit.net,fffej/octokit.net,Sarmad93/octokit.net,shiftkey-tester/octokit.net,bslliw/octokit.net,gabrielweyer/octokit.net,shiftkey-tester-org-blah-blah/octokit.net,editor-tools/octokit.net,octokit-net-test-org/octokit.net,Red-Folder/octokit.net,khellang/octokit.net,hahmed/octokit.net,octokit-net-test-org/octokit.net,kolbasov/octokit.net,dampir/octokit.net,shana/octokit.net,TattsGroup/octokit.net,gdziadkiewicz/octokit.net,fake-organization/octokit.net,shiftkey-tester/octokit.net,M-Zuber/octokit.net,devkhan/octokit.net,M-Zuber/octokit.net,eriawan/octokit.net,SmithAndr/octokit.net,kdolan/octokit.net
9e872d77c1b2eafd1caf18d93cc19630bc1f249e
ExtensionsTests/XmlTests.cs
ExtensionsTests/XmlTests.cs
using System.Xml.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Tyrrrz.Extensions.Tests { [TestClass] public class XmlTests { [TestMethod] public void StripNamespacesTest() { var ns = XNamespace.Get("http://schemas.domain.com/orders"); var xml = new XElement(ns + "order", new XElement(ns + "customer", "Foo", new XAttribute(ns + "hello", "world")), new XElement("purchases", new XElement(ns + "purchase", "Unicycle", new XAttribute("price", "100.00")), new XElement("purchase", "Bicycle"), new XElement(ns + "purchase", "Tricycle", new XAttribute("price", "300.00"), new XAttribute(XNamespace.Xml.GetName("space"), "preserve") ) ) ); var stripped = xml.StripNamespaces(); var xCustomer = stripped.Element("customer"); var xHello = xCustomer?.Attribute("hello"); Assert.IsNotNull(xCustomer); Assert.IsNotNull(xHello); Assert.AreEqual("world", xHello.Value); } } }
using System.Xml.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Tyrrrz.Extensions.Tests { [TestClass] public class XmlTests { [TestMethod] public void StripNamespacesTest() { var ns = XNamespace.Get("http://schemas.domain.com/orders"); var xml = new XElement(ns + "order", new XElement(ns + "customer", "Foo", new XAttribute(ns + "hello", "world")), new XElement("purchases", new XElement(ns + "purchase", "Unicycle", new XAttribute("price", "100.00")), new XElement("purchase", "Bicycle"), new XElement(ns + "purchase", "Tricycle", new XAttribute("price", "300.00"), new XAttribute(XNamespace.Xml.GetName("space"), "preserve") ) ) ); var stripped = xml.StripNamespaces(); var xCustomer = stripped.Element("customer"); var xHello = xCustomer?.Attribute("hello"); Assert.AreNotSame(xml, stripped); Assert.IsNotNull(xCustomer); Assert.IsNotNull(xHello); Assert.AreEqual("world", xHello.Value); } } }
Add mutability test to StripNamespaces
Add mutability test to StripNamespaces
C#
mit
Tyrrrz/Extensions
d253f1a2560ebf38ff3bf3034e21f32d7f05b935
projects/LockSample/source/LockSample.App/Program.cs
projects/LockSample/source/LockSample.App/Program.cs
//----------------------------------------------------------------------- // <copyright file="Program.cs" company="Brian Rogers"> // Copyright (c) Brian Rogers. All rights reserved. // </copyright> //----------------------------------------------------------------------- namespace LockSample { using System; internal sealed class Program { private static void Main(string[] args) { } } }
//----------------------------------------------------------------------- // <copyright file="Program.cs" company="Brian Rogers"> // Copyright (c) Brian Rogers. All rights reserved. // </copyright> //----------------------------------------------------------------------- namespace LockSample { using System; using System.Collections.Generic; using System.Globalization; using System.Threading; using System.Threading.Tasks; internal sealed class Program { private static void Main(string[] args) { Random random = new Random(); ExclusiveLock l = new ExclusiveLock(); List<int> list = new List<int>(); using (CancellationTokenSource cts = new CancellationTokenSource()) { Task task = LoopAsync(random, l, list, cts.Token); Thread.Sleep(1000); cts.Cancel(); task.Wait(); } } private static async Task LoopAsync(Random random, ExclusiveLock l, IList<int> list, CancellationToken token) { while (!token.IsCancellationRequested) { switch (random.Next(1)) { case 0: await EnumerateListAsync(l, list); break; } } } private static async Task EnumerateListAsync(ExclusiveLock l, IList<int> list) { ExclusiveLock.Token token = await l.AcquireAsync(); await Task.Yield(); try { int lastItem = 0; foreach (int item in list) { if (lastItem != (item - 1)) { throw new InvalidOperationException(string.Format( CultureInfo.InvariantCulture, "State corruption detected; expected {0} but saw {1} in next list entry.", lastItem + 1, item)); } await Task.Yield(); } } finally { l.Release(token); } } } }
Add basic integration test skeleton
Add basic integration test skeleton
C#
unlicense
brian-dot-net/writeasync,brian-dot-net/writeasync,brian-dot-net/writeasync
898166d264b7c81f748c28ff3e57d2366f495bc3
src/CVaS.Web/Filters/HttpExceptionFilterAttribute.cs
src/CVaS.Web/Filters/HttpExceptionFilterAttribute.cs
using System; using System.Net; using CVaS.Shared.Exceptions; using CVaS.Web.Models; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; namespace CVaS.Web.Filters { /// <summary> /// Exception filter that catch exception of known type /// and transform them into specific HTTP status code with /// error message /// </summary> public class HttpExceptionFilterAttribute : ExceptionFilterAttribute { public override void OnException(ExceptionContext context) { switch (context.Exception) { case ApiException apiException: var apiError = new ApiError(apiException.Message); context.ExceptionHandled = true; context.HttpContext.Response.StatusCode = apiException.StatusCode; context.Result = new ObjectResult(apiError); break; case NotImplementedException _: context.HttpContext.Response.StatusCode = (int)HttpStatusCode.NotImplemented; context.ExceptionHandled = true; break; case UnauthorizedAccessException _: context.HttpContext.Response.StatusCode = (int)HttpStatusCode.Unauthorized; context.ExceptionHandled = true; break; } base.OnException(context); } } }
using System; using System.Net; using CVaS.Shared.Exceptions; using CVaS.Web.Models; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; namespace CVaS.Web.Filters { /// <summary> /// Exception filter that catch exception of known type /// and transform them into specific HTTP status code with /// error message /// </summary> public class HttpExceptionFilterAttribute : ExceptionFilterAttribute { public override void OnException(ExceptionContext context) { switch (context.Exception) { case ApiException apiException: var apiError = new ApiError(apiException.Message); context.ExceptionHandled = true; context.HttpContext.Response.StatusCode = apiException.StatusCode; context.Result = new ObjectResult(apiError); break; case NotImplementedException _: context.HttpContext.Response.StatusCode = (int)HttpStatusCode.NotImplemented; context.ExceptionHandled = true; break; case UnauthorizedAccessException _: context.HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden; context.ExceptionHandled = true; break; } base.OnException(context); } } }
Return 403 instead of 401
Return 403 instead of 401
C#
mit
adamjez/CVaS,adamjez/CVaS,adamjez/CVaS
2b1306e8b34f494bbe5fe48f90f90bd6c0c480e1
proj/SecurityServer/proj/Common/SecurityHelper.cs
proj/SecurityServer/proj/Common/SecurityHelper.cs
using System.Configuration; using System.IdentityModel.Tokens; using System.IO; using System.Security.Cryptography.X509Certificates; using System.Web.Hosting; namespace Dragon.SecurityServer.Common { public class SecurityHelper { public static X509SigningCredentials CreateSignupCredentialsFromConfig() { return new X509SigningCredentials(new X509Certificate2(X509Certificate.CreateFromCertFile( Path.Combine(HostingEnvironment.ApplicationPhysicalPath, ConfigurationManager.AppSettings["SigningCertificateName"])))); } } }
using System.Configuration; using System.IdentityModel.Tokens; using System.IO; using System.Security.Cryptography.X509Certificates; using System.Web.Hosting; namespace Dragon.SecurityServer.Common { public class SecurityHelper { public static X509SigningCredentials CreateSignupCredentialsFromConfig() { var certificateFilePath = Path.Combine(HostingEnvironment.ApplicationPhysicalPath, ConfigurationManager.AppSettings["SigningCertificateName"]); var data = File.ReadAllBytes(certificateFilePath); var certificate = new X509Certificate2(data, string.Empty, X509KeyStorageFlags.MachineKeySet); return new X509SigningCredentials(certificate); } } }
Allow reading certificates from local files
Allow reading certificates from local files
C#
mit
jbinder/dragon,jbinder/dragon,aduggleby/dragon,jbinder/dragon,aduggleby/dragon,aduggleby/dragon
7a0aba8b50a7ddb2d745dfac8f826fd44989e5ce
compiler/NUnit.Tests/MiddleEnd/InstructionTests.cs
compiler/NUnit.Tests/MiddleEnd/InstructionTests.cs
using compiler.middleend.ir; using NUnit.Framework; namespace NUnit.Tests.MiddleEnd { [TestFixture] public class InstructionTests { [Test] public void ToStringTest() { var inst1 = new Instruction(IrOps.Add, new Operand(Operand.OpType.Constant, 10), new Operand(Operand.OpType.Identifier, 10)); var inst2 = new Instruction(IrOps.Add, new Operand(Operand.OpType.Constant, 05), new Operand(inst1)); Assert.AreEqual( inst2.Num.ToString() + " Add #5 (" + inst1.Num.ToString() + ")",inst2.ToString()); } } }
using compiler.middleend.ir; using NUnit.Framework; namespace NUnit.Tests.MiddleEnd { [TestFixture] public class InstructionTests { [Test] public void ToStringTest() { var inst1 = new Instruction(IrOps.Add, new Operand(Operand.OpType.Constant, 10), new Operand(Operand.OpType.Identifier, 10)); var inst2 = new Instruction(IrOps.Add, new Operand(Operand.OpType.Constant, 05), new Operand(inst1)); Assert.AreEqual( inst2.Num.ToString() + ": Add #5 (" + inst1.Num.ToString() + ")",inst2.ToString()); } } }
Fix error in unit test from changing the ToString
Fix error in unit test from changing the ToString
C#
mit
ilovepi/Compiler,ilovepi/Compiler
305caa10dca2afd98a56218ba5e875ae22603d98
Properties/AssemblyInfo.cs
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("Tomato")] [assembly: AssemblyDescription("Pomodoro Timer")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Software Punt")] [assembly: AssemblyProduct("Tomato")] [assembly: AssemblyCopyright("Copyright © Software Punt 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("e5f59157-7a01-4616-86e3-c9a924d8a218")] // 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("Tomato")] [assembly: AssemblyDescription("Pomodoro Timer")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Software Punt")] [assembly: AssemblyProduct("Tomato")] [assembly: AssemblyCopyright("Copyright © Software Punt 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("e5f59157-7a01-4616-86e3-c9a924d8a218")] // 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")]
Update copyright statement to 2014
Update copyright statement to 2014
C#
apache-2.0
SoftwarePunt/Pomodoro
10f69b18c6dbf6fb1bf713be760c15d70a054602
Properties/AssemblyInfo.cs
Properties/AssemblyInfo.cs
using System.Reflection; [assembly: AssemblyTitle("Autofac.Tests.Integration.Mef")] [assembly: AssemblyDescription("")]
using System.Reflection; [assembly: AssemblyTitle("Autofac.Tests.Integration.Mef")]
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major.
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major.
C#
mit
autofac/Autofac.Mef
17767009b4c6e2b4781345a44ed26adc7c73b091
core/UnityPackage/Assets/Middlewares/EntityNetwork/ClientEntityFactory.cs
core/UnityPackage/Assets/Middlewares/EntityNetwork/ClientEntityFactory.cs
using System; using EntityNetwork; using EntityNetwork.Unity3D; using UnityEngine; public class ClientEntityFactory : IClientEntityFactory { private static ClientEntityFactory _default; public static ClientEntityFactory Default { get { return _default ?? (_default = new ClientEntityFactory()); } } public Transform RootTransform { get; set; } IClientEntity IClientEntityFactory.Create(Type protoTypeType) { var resource = Resources.Load("Client" + protoTypeType.Name.Substring(1)); var go = (GameObject)GameObject.Instantiate(resource); if (RootTransform != null) go.transform.SetParent(RootTransform, false); return go.GetComponent<IClientEntity>(); } void IClientEntityFactory.Delete(IClientEntity entity) { var enb = ((EntityNetworkBehaviour)entity); GameObject.Destroy(enb.gameObject); } }
using System; using System.Collections.Concurrent; using EntityNetwork; using EntityNetwork.Unity3D; using UnityEngine; public class ClientEntityFactory : IClientEntityFactory { private static ClientEntityFactory _default; public static ClientEntityFactory Default { get { return _default ?? (_default = new ClientEntityFactory()); } } public Transform RootTransform { get; set; } private readonly ConcurrentDictionary<Type, Type> _clientEntityToProtoTypeMap = new ConcurrentDictionary<Type, Type>(); Type IClientEntityFactory.GetProtoType(Type entityType) { return _clientEntityToProtoTypeMap.GetOrAdd(entityType, t => { var type = entityType; while (type != null && type != typeof(object)) { if (type.Name.EndsWith("ClientBase")) { var typePrefix = type.Namespace.Length > 0 ? type.Namespace + "." : ""; var protoType = type.Assembly.GetType(typePrefix + "I" + type.Name.Substring(0, type.Name.Length - 10)); if (protoType != null && typeof(IEntityPrototype).IsAssignableFrom(protoType)) { return protoType; } } type = type.BaseType; } return null; }); } IClientEntity IClientEntityFactory.Create(Type protoType) { var resourceName = "Client" + protoType.Name.Substring(1); var resource = Resources.Load(resourceName); if (resource == null) throw new InvalidOperationException("Failed to load resource(" + resourceName + ")"); var go = (GameObject)GameObject.Instantiate(resource); if (go == null) throw new InvalidOperationException("Failed to instantiate resource(" + resourceName + ")"); if (RootTransform != null) go.transform.SetParent(RootTransform, false); return go.GetComponent<IClientEntity>(); } void IClientEntityFactory.Delete(IClientEntity entity) { var enb = ((EntityNetworkBehaviour)entity); GameObject.Destroy(enb.gameObject); } }
Fix a build error of UnityPackage
Fix a build error of UnityPackage
C#
mit
SaladbowlCreative/EntityNetwork
6484f7d6930c7aa09a65e8c861260c5ada3e2ca0
src/Moq/Moq/contentFiles/cs/netstandard2.0/Mocks/Mock.cs
src/Moq/Moq/contentFiles/cs/netstandard2.0/Mocks/Mock.cs
namespace Moq { using System; using System.CodeDom.Compiler; using System.Reflection; using System.Runtime.CompilerServices; using Moq.Sdk; /// <summary> /// Instantiates mocks for the specified types. /// </summary> [GeneratedCode("Moq", "5.0")] [CompilerGenerated] partial class Mock { /// <summary> /// Creates the mock instance by using the specified types to /// lookup the mock type in the assembly defining this class. /// </summary> private static T Create<T>(MockBehavior behavior, object[] constructorArgs, params Type[] interfaces) { var mocked = (IMocked)MockFactory.Default.CreateMock(typeof(Mock).GetTypeInfo().Assembly, typeof(T), interfaces, constructorArgs); mocked.Initialize(behavior); return (T)mocked; } } }
using System; using System.CodeDom.Compiler; using System.Reflection; using System.Runtime.CompilerServices; using Moq.Sdk; namespace Moq { /// <summary> /// Instantiates mocks for the specified types. /// </summary> [GeneratedCode("Moq", "5.0")] [CompilerGenerated] partial class Mock { /// <summary> /// Creates the mock instance by using the specified types to /// lookup the mock type in the assembly defining this class. /// </summary> private static T Create<T>(MockBehavior behavior, object[] constructorArgs, params Type[] interfaces) { var mocked = (IMocked)MockFactory.Default.CreateMock(typeof(Mock).GetTypeInfo().Assembly, typeof(T), interfaces, constructorArgs); mocked.Initialize(behavior); return (T)mocked; } } }
Unify namespace placement with the .Overloads partial class
Unify namespace placement with the .Overloads partial class
C#
apache-2.0
Moq/moq
c11221ffa8dd5f95ed110fcde269955c735077b6
Collections/Paging/PagingHelpers.cs
Collections/Paging/PagingHelpers.cs
using System; using System.Linq; namespace Smartrak.Collections.Paging { public static class PagingHelpers { /// <summary> /// Gets a paged list of entities with the total appended to each row in the resultset. This is a faster way of doing things than using 2 seperate queries /// </summary> /// <typeparam name="T">The type of the entity, can be inferred by the type of queryable you pass</typeparam> /// <param name="entities">A queryable of entities</param> /// <param name="page">the 1 indexed page number you are interested in, cannot be zero or negative</param> /// <param name="pageSize">the size of the page you want, cannot be zero or negative</param> /// <returns>A queryable of the page of entities with counts appended.</returns> public static IQueryable<EntityWithCount<T>> GetPageWithTotal<T>(this IQueryable<T> entities, int page, int pageSize) where T : class { if (entities == null) { throw new ArgumentNullException("entities"); } if (page < 1) { throw new ArgumentException("Must be positive", "page"); } if (pageSize < 1) { throw new ArgumentException("Must be positive", "pageSize"); } return entities .Select(e => new EntityWithCount<T> { Entity = e, Count = entities.Count() }) .Skip(page - 1 * pageSize) .Take(pageSize); } } }
using System; using System.Linq; namespace Smartrak.Collections.Paging { public static class PagingHelpers { /// <summary> /// Gets a paged list of entities with the total appended to each row in the resultset. This is a faster way of doing things than using 2 seperate queries /// </summary> /// <typeparam name="T">The type of the entity, can be inferred by the type of queryable you pass</typeparam> /// <param name="entities">A queryable of entities</param> /// <param name="page">the 1 indexed page number you are interested in, cannot be zero or negative</param> /// <param name="pageSize">the size of the page you want, cannot be zero or negative</param> /// <returns>A queryable of the page of entities with counts appended.</returns> public static IQueryable<EntityWithCount<T>> GetPageWithTotalzzz<T>(this IQueryable<T> entities, int page, int pageSize) where T : class { if (entities == null) { throw new ArgumentNullException("entities"); } if (page < 1) { throw new ArgumentException("Must be positive", "page"); } if (pageSize < 1) { throw new ArgumentException("Must be positive", "pageSize"); } return entities .Select(e => new EntityWithCount<T> { Entity = e, Count = entities.Count() }) .Skip(page - 1 * pageSize) .Take(pageSize); } } }
Revert "Removing 'zzz' from method name"
Revert "Removing 'zzz' from method name" This reverts commit 05e1115699ce4f4550dd112b06bb8ba107daacd0.
C#
mit
Smartrak/Smartrak.Library
ff125f4c71a4f6ee0d8cd746469b3fbb9530bc6d
osu.Game.Tournament.Tests/TestCaseLadderManager.cs
osu.Game.Tournament.Tests/TestCaseLadderManager.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 System.Collections.Generic; using System.IO; using Newtonsoft.Json; using osu.Framework.Allocation; using osu.Game.Tests.Visual; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; namespace osu.Game.Tournament.Tests { public class TestCaseLadderManager : OsuTestCase { [Cached] private readonly LadderManager manager; public TestCaseLadderManager() { var teams = JsonConvert.DeserializeObject<List<TournamentTeam>>(File.ReadAllText(@"teams.json")); var ladder = JsonConvert.DeserializeObject<LadderInfo>(File.ReadAllText(@"bracket.json")) ?? new LadderInfo(); Child = manager = new LadderManager(ladder, teams); } protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); File.WriteAllText(@"bracket.json", JsonConvert.SerializeObject(manager.Info)); } } }
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; using System.IO; using Newtonsoft.Json; using osu.Framework.Allocation; using osu.Game.Tests.Visual; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; namespace osu.Game.Tournament.Tests { public class TestCaseLadderManager : OsuTestCase { [Cached] private readonly LadderManager manager; public TestCaseLadderManager() { var teams = JsonConvert.DeserializeObject<List<TournamentTeam>>(File.ReadAllText(@"teams.json")); var ladder = File.Exists(@"bracket.json") ? JsonConvert.DeserializeObject<LadderInfo>(File.ReadAllText(@"bracket.json")) : new LadderInfo(); Child = manager = new LadderManager(ladder, teams); } protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); File.WriteAllText(@"bracket.json", JsonConvert.SerializeObject(manager.Info, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore })); } } }
Reduce noise in json output and handle the case the file doesn't exist
Reduce noise in json output and handle the case the file doesn't exist
C#
mit
smoogipoo/osu,ZLima12/osu,UselessToucan/osu,smoogipooo/osu,2yangk23/osu,smoogipoo/osu,smoogipoo/osu,NeoAdonis/osu,NeoAdonis/osu,ppy/osu,ppy/osu,ZLima12/osu,peppy/osu-new,2yangk23/osu,NeoAdonis/osu,peppy/osu,peppy/osu,johnneijzen/osu,johnneijzen/osu,EVAST9919/osu,UselessToucan/osu,ppy/osu,EVAST9919/osu,UselessToucan/osu,peppy/osu
b4577dcb45603aba46bc037154a039cca2835ce3
MoviesSystem/WpfMovieSystem/Views/InsertWindowView.xaml.cs
MoviesSystem/WpfMovieSystem/Views/InsertWindowView.xaml.cs
using MoviesSystem.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace WpfMovieSystem.Views { /// <summary> /// Interaction logic for InsertWindowView.xaml /// </summary> public partial class InsertWindowView : Window { public InsertWindowView() { InitializeComponent(); } private void CreateButton_Click(object sender, RoutedEventArgs e) { using (MoviesSystemDbContext context = new MoviesSystemDbContext()) { var firstName = FirstNameTextBox.Text; var lastName = LastNameTextBox.Text; var movies = MoviesTextBox.Text.Split(','); var newActor = new Actor { FirstName = firstName, LastName = lastName, Movies = new List<Movie>() }; foreach (var movie in movies) { newActor.Movies.Add(new Movie { Title = movie }); } context.Actors.Add(newActor); context.SaveChanges(); } FirstNameTextBox.Text = ""; LastNameTextBox.Text = ""; MoviesTextBox.Text = ""; } } }
using MoviesSystem.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace WpfMovieSystem.Views { /// <summary> /// Interaction logic for InsertWindowView.xaml /// </summary> public partial class InsertWindowView : Window { public InsertWindowView() { InitializeComponent(); } private void CreateButton_Click(object sender, RoutedEventArgs e) { using (MoviesSystemDbContext context = new MoviesSystemDbContext()) { var firstName = FirstNameTextBox.Text; var lastName = LastNameTextBox.Text; var movies = MoviesTextBox.Text.Split(','); var newActor = new Actor { FirstName = firstName, LastName = lastName, Movies = new List<Movie>() }; foreach (var movie in movies) { newActor.Movies.Add(LoadOrCreateMovie(context, movie)); } context.Actors.Add(newActor); context.SaveChanges(); } FirstNameTextBox.Text = ""; LastNameTextBox.Text = ""; MoviesTextBox.Text = ""; } private static Movie LoadOrCreateMovie(MoviesSystemDbContext context, string movieTitle) { var movie = context.Movies .FirstOrDefault(m => m.Title.ToLower() == movieTitle.ToLower()); if (movie == null) { movie = new Movie { Title = movieTitle }; } return movie; } } }
Add restrictions when creating the movie collection
Add restrictions when creating the movie collection
C#
mit
Brevering/Databases_2017_Teamwork
46a20a12b243fc98c3d960848f48a0da62a54d62
Source/Lib/TraktApiSharp/Objects/Get/Shows/TraktShowIds.cs
Source/Lib/TraktApiSharp/Objects/Get/Shows/TraktShowIds.cs
namespace TraktApiSharp.Objects.Get.Shows { using Basic; public class TraktShowIds : TraktIds { } }
namespace TraktApiSharp.Objects.Get.Shows { using Basic; /// <summary>A collection of ids for various web services, including the Trakt id, for a Trakt show.</summary> public class TraktShowIds : TraktIds { } }
Add documentation for show ids.
Add documentation for show ids.
C#
mit
henrikfroehling/TraktApiSharp
37480c80bea1c36168e4a1331e32fc20bceb66e8
src/DiplomContentSystem/Requests/RequestService.cs
src/DiplomContentSystem/Requests/RequestService.cs
using System; using System.Net.Http; using Newtonsoft.Json; using System.Threading.Tasks; using System.Collections.Generic; using System.Linq; using System.IO; namespace DiplomContentSystem.Requests { public class RequestService { public async Task<Stream> SendRequest(object data) { using (var client = new HttpClient()) { try { var content = new StringContent(JsonConvert.SerializeObject(data) ); client.BaseAddress = new Uri("http://localhost:1337"); var response = await client.PostAsync("api/docx", content); response.EnsureSuccessStatusCode(); // Throw in not success return await response.Content.ReadAsStreamAsync(); } catch (HttpRequestException e) { Console.WriteLine($"Request exception: {e.Message}"); throw (e); } } } } }
using System; using System.Net.Http; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using System.Threading.Tasks; using System.Collections.Generic; using System.Linq; using System.IO; namespace DiplomContentSystem.Requests { public class RequestService { public async Task<Stream> SendRequest(object data) { using (var client = new HttpClient()) { try { var content = new StringContent(JsonConvert.SerializeObject(data, new JsonSerializerSettings() { ContractResolver = new CamelCasePropertyNamesContractResolver() }), System.Text.Encoding.UTF8, "application/json"); client.BaseAddress = new Uri("http://localhost:1337"); var response = await client.PostAsync("api/docx",content); response.EnsureSuccessStatusCode(); // Throw in not success return await response.Content.ReadAsStreamAsync(); } catch (HttpRequestException e) { Console.WriteLine($"Request exception: {e.Message}"); throw (e); } } } } }
Update json.net to use new MIME, encoding and camelCase formatting
DCS-30: Update json.net to use new MIME, encoding and camelCase formatting
C#
apache-2.0
denismaster/DiplomContentSystem,denismaster/DiplomContentSystem,denismaster/DiplomContentSystem,denismaster/DiplomContentSystem
a8910f646288d38aa5614da78036961b76e3f893
src/Dapper.FluentMap/Utils/DictionaryExtensions.cs
src/Dapper.FluentMap/Utils/DictionaryExtensions.cs
using System.Collections.Generic; namespace Dapper.FluentMap.Utils { internal static class DictionaryExtensions { internal static void AddOrUpdate<TKey, TValue>(this IDictionary<TKey, IList<TValue>> dict, TKey key, TValue value) { if (dict.ContainsKey(key)) { dict[key].Add(value); } else { dict.Add(key, new[] { value }); } } } }
using System.Collections.Generic; namespace Dapper.FluentMap.Utils { internal static class DictionaryExtensions { internal static void AddOrUpdate<TKey, TValue>(this IDictionary<TKey, IList<TValue>> dict, TKey key, TValue value) { if (dict.ContainsKey(key)) { dict[key].Add(value); } else { dict.Add(key, new List<TValue> { value }); } } } }
Use a list rather than a fixed-size array.
Use a list rather than a fixed-size array.
C#
mit
bondarenkod/Dapper-FluentMap,henkmollema/Dapper-FluentMap,arumata/Dapper-FluentMap,thomasbargetz/Dapper-FluentMap,henkmollema/Dapper-FluentMap
e93d3ac5865df32386a49bd8796b90e47b34cb5b
src/Edulinq/Repeat.cs
src/Edulinq/Repeat.cs
#region Copyright and license information // Copyright 2010-2011 Jon Skeet // // 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. #endregion using System; using System.Collections.Generic; namespace Edulinq { public static partial class Enumerable { public static IEnumerable<TResult> Repeat<TResult>(this TResult element, int count) { if (count < 0) { throw new ArgumentOutOfRangeException("count"); } return RepeatImpl(element, count); } public static IEnumerable<TResult> RepeatImpl<TResult>(TResult element, int count) { for (int i = 0; i < count; i++) { yield return element; } } } }
#region Copyright and license information // Copyright 2010-2011 Jon Skeet // // 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. #endregion using System; using System.Collections.Generic; namespace Edulinq { public static partial class Enumerable { public static IEnumerable<TResult> Repeat<TResult>(this TResult element, int count) { if (count < 0) { throw new ArgumentOutOfRangeException("count"); } return RepeatImpl(element, count); } private static IEnumerable<TResult> RepeatImpl<TResult>(TResult element, int count) { for (int i = 0; i < count; i++) { yield return element; } } } }
Make the implementation method private.
Make the implementation method private.
C#
apache-2.0
jskeet/edulinq,pyaria/edulinq,zhangz/edulinq,pyaria/edulinq,jskeet/edulinq,jskeet/edulinq,zhangz/edulinq,iainholder/edulinq,iainholder/edulinq
1ede8bce480c355f9172995c384d75ca6211769a
Mycroft.Tests/TestCommandConnection.cs
Mycroft.Tests/TestCommandConnection.cs
using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Mycroft; using System.IO; using System.Diagnostics; namespace Mycroft.Tests { [TestClass] public class TestCommandConnection { [TestMethod] public async Task TestBodylessMessage(){ var s = new MemoryStream(Encoding.UTF8.GetBytes("6\nAPP_UP")); var cmd = new CommandConnection(s); var msg = await cmd.getCommandAsync(); Trace.WriteLine(msg); if (msg != "APP_UP") throw new Exception("Incorrect message!"); } [TestMethod] public async Task TestBodaciousMessage() { var input = "30\nMSG_BROADCAST {\"key\": \"value\"}"; var s = new MemoryStream(Encoding.UTF8.GetBytes(input)); var cmd = new CommandConnection(s); var msg = await cmd.getCommandAsync(); Trace.WriteLine(msg); Trace.WriteLine(input.Substring(3)); if (msg != input.Substring(3)) throw new Exception("Incorrect message!"); } } }
using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Mycroft; using System.IO; using System.Diagnostics; namespace Mycroft.Tests { [TestClass] public class TestCommandConnection { [TestMethod] public async Task TestBodylessMessage(){ var s = new MemoryStream(Encoding.UTF8.GetBytes("6\nAPP_UP")); var cmd = new CommandConnection(s); var msg = await cmd.GetCommandAsync(); Trace.WriteLine(msg); if (msg != "APP_UP") throw new Exception("Incorrect message!"); } [TestMethod] public async Task TestBodaciousMessage() { var input = "30\nMSG_BROADCAST {\"key\": \"value\"}"; var s = new MemoryStream(Encoding.UTF8.GetBytes(input)); var cmd = new CommandConnection(s); var msg = await cmd.GetCommandAsync(); Trace.WriteLine(msg); Trace.WriteLine(input.Substring(3)); if (msg != input.Substring(3)) throw new Exception("Incorrect message!"); } } }
Fix CommandConnection methods in Test
Fix CommandConnection methods in Test
C#
bsd-3-clause
rit-sse-mycroft/core
9a21ab0ef479a944b1c5ad54339eeb36c20277e9
app/Umbraco/Umbraco.Archetype/Models/ArchetypePreValueProperty.cs
app/Umbraco/Umbraco.Archetype/Models/ArchetypePreValueProperty.cs
using System; using Newtonsoft.Json; namespace Archetype.Models { public class ArchetypePreValueProperty { [JsonProperty("alias")] public string Alias { get; set; } [JsonProperty("remove")] public bool Remove { get; set; } [JsonProperty("collapse")] public bool Collapse { get; set; } [JsonProperty("label")] public string Label { get; set; } [JsonProperty("helpText")] public string HelpText { get; set; } [JsonProperty("dataTypeGuid")] public Guid DataTypeGuid { get; set; } [JsonProperty("propertyEditorAlias")] public string PropertyEditorAlias { get; set; } [JsonProperty("value")] public string Value { get; set; } [JsonProperty("required")] public bool Required { get; set; } [JsonProperty("regEx")] public bool RegEx { get; set; } } }
using System; using Newtonsoft.Json; namespace Archetype.Models { public class ArchetypePreValueProperty { [JsonProperty("alias")] public string Alias { get; set; } [JsonProperty("remove")] public bool Remove { get; set; } [JsonProperty("collapse")] public bool Collapse { get; set; } [JsonProperty("label")] public string Label { get; set; } [JsonProperty("helpText")] public string HelpText { get; set; } [JsonProperty("dataTypeGuid")] public Guid DataTypeGuid { get; set; } [JsonProperty("propertyEditorAlias")] public string PropertyEditorAlias { get; set; } [JsonProperty("value")] public string Value { get; set; } [JsonProperty("required")] public bool Required { get; set; } [JsonProperty("regEx")] public string RegEx { get; set; } } }
Fix deserialization of RegEx enabled properties
Fix deserialization of RegEx enabled properties Fix type mismatch for RegEx (introduced in 6e50301 - my bad, sorry)
C#
mit
imulus/Archetype,tomfulton/Archetype,kgiszewski/Archetype,kgiszewski/Archetype,tomfulton/Archetype,kjac/Archetype,kgiszewski/Archetype,Nicholas-Westby/Archetype,kjac/Archetype,kipusoep/Archetype,tomfulton/Archetype,kipusoep/Archetype,kjac/Archetype,imulus/Archetype,kipusoep/Archetype,Nicholas-Westby/Archetype,imulus/Archetype,Nicholas-Westby/Archetype
ab27fe4236fb34433257ed883f966f5deb51cbac
test/FunctionalTestUtils/BackTelemetryChannel.cs
test/FunctionalTestUtils/BackTelemetryChannel.cs
namespace FunctionalTestUtils { using System; using System.Collections.Generic; using Microsoft.ApplicationInsights.Channel; public class BackTelemetryChannel : ITelemetryChannel { private IList<ITelemetry> buffer; public BackTelemetryChannel() { this.buffer = new List<ITelemetry>(); } public IList<ITelemetry> Buffer { get { return this.buffer; } } public bool? DeveloperMode { get { return true; } set { } } public string EndpointAddress { get { return "https://dc.services.visualstudio.com/v2/track"; } set { } } public void Dispose() { } public void Flush() { throw new NotImplementedException(); } public void Send(ITelemetry item) { this.buffer.Add(item); } } }
namespace FunctionalTestUtils { using System; using System.Collections.Generic; using Microsoft.ApplicationInsights.Channel; public class BackTelemetryChannel : ITelemetryChannel { private IList<ITelemetry> buffer; public BackTelemetryChannel() { this.buffer = new List<ITelemetry>(); } public IList<ITelemetry> Buffer { get { return this.buffer; } } public bool? DeveloperMode { get { return true; } set { } } public string EndpointAddress { get { return "https://dc.services.visualstudio.com/v2/track"; } set { } } public void Dispose() { } public void Flush() { } public void Send(ITelemetry item) { this.buffer.Add(item); } } }
Add flush for mock channel
Add flush for mock channel
C#
mit
Microsoft/ApplicationInsights-aspnetcore,Microsoft/ApplicationInsights-aspnet5,Microsoft/ApplicationInsights-aspnetcore,Microsoft/ApplicationInsights-aspnet5,Microsoft/ApplicationInsights-aspnetcore,Microsoft/ApplicationInsights-aspnet5
b706a1667f3c1a901930345a225da1fa27bc1c81
src/SharedAssemblyInfo.cs
src/SharedAssemblyInfo.cs
using System.Reflection; [assembly: AssemblyCompany("Andrew Davey")] [assembly: AssemblyProduct("Cassette")] [assembly: AssemblyCopyright("Copyright © 2011 Andrew Davey")] // NOTE: When changing this version, also update Cassette.MSBuild\Cassette.targets to match. [assembly: AssemblyInformationalVersion("2.0.0")] [assembly: AssemblyVersion("2.0.0.*")] [assembly: AssemblyFileVersion("2.0.0.0")]
using System.Reflection; [assembly: AssemblyCompany("Andrew Davey")] [assembly: AssemblyProduct("Cassette")] [assembly: AssemblyCopyright("Copyright © 2011 Andrew Davey")] [assembly: AssemblyInformationalVersion("2.0.0-beta1")] [assembly: AssemblyVersion("2.0.0.*")] [assembly: AssemblyFileVersion("2.0.0.0")]
Set nuget package version to 2.0.0-beta1
Set nuget package version to 2.0.0-beta1
C#
mit
damiensawyer/cassette,honestegg/cassette,andrewdavey/cassette,honestegg/cassette,BluewireTechnologies/cassette,andrewdavey/cassette,honestegg/cassette,damiensawyer/cassette,damiensawyer/cassette,andrewdavey/cassette,BluewireTechnologies/cassette
18ac0e45c7b406abf50cf02f69a9626ee9f5d324
src/DotVVM.Framework/Diagnostics/DotvvmDiagnosticsConfiguration.cs
src/DotVVM.Framework/Diagnostics/DotvvmDiagnosticsConfiguration.cs
using System; using System.Collections.Generic; using System.IO; using System.Text; using Newtonsoft.Json; namespace DotVVM.Framework.Diagnostics { public class DotvvmDiagnosticsConfiguration { public DotvvmDiagnosticsConfiguration() { LoadConfiguration(); } private DiagnosticsServerConfiguration configuration; public string DiagnosticsServerHostname { get { if (configuration == null) LoadConfiguration(); return configuration.HostName; } } public int? DiagnosticsServerPort { get { if (configuration == null) LoadConfiguration(); return configuration?.Port; } } private void LoadConfiguration() { try { var diagnosticsJson = File.ReadAllText(DiagnosticsServerConfiguration.DiagnosticsFilePath); configuration = JsonConvert.DeserializeObject<DiagnosticsServerConfiguration>(diagnosticsJson); } catch { // ignored } } } }
using System; using System.Collections.Generic; using System.IO; using System.Text; using Newtonsoft.Json; namespace DotVVM.Framework.Diagnostics { public class DotvvmDiagnosticsConfiguration { public DotvvmDiagnosticsConfiguration() { LoadConfiguration(); } private DiagnosticsServerConfiguration configuration; public string DiagnosticsServerHostname => configuration.HostName; public int? DiagnosticsServerPort => configuration?.Port; private void LoadConfiguration() { try { var diagnosticsJson = File.ReadAllText(DiagnosticsServerConfiguration.DiagnosticsFilePath); configuration = JsonConvert.DeserializeObject<DiagnosticsServerConfiguration>(diagnosticsJson); } catch { // ignored } } } }
Remove redundant configuration loading of diagnostics configuration
Remove redundant configuration loading of diagnostics configuration
C#
apache-2.0
riganti/dotvvm,riganti/dotvvm,riganti/dotvvm,riganti/dotvvm
cf180b9f1497f2c08bd4745e3820cc9a334bfec3
src/OmniSharp.Roslyn.CSharp/Helpers/LocationExtensions.cs
src/OmniSharp.Roslyn.CSharp/Helpers/LocationExtensions.cs
using System; using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis; using OmniSharp.Models; namespace OmniSharp.Helpers { public static class LocationExtensions { public static QuickFix GetQuickFix(this Location location, OmniSharpWorkspace workspace) { if (!location.IsInSource) throw new Exception("Location is not in the source tree"); var lineSpan = location.GetMappedLineSpan(); var path = lineSpan.Path; var documents = workspace.GetDocuments(path); var line = lineSpan.StartLinePosition.Line; var text = location.SourceTree.GetText().Lines[line].ToString(); return new QuickFix { Text = text.Trim(), FileName = path, Line = line, Column = lineSpan.HasMappedPath ? 0 : lineSpan.StartLinePosition.Character, // when a #line directive maps into a separate file, assume columns (0,0) EndLine = lineSpan.EndLinePosition.Line, EndColumn = lineSpan.HasMappedPath ? 0 : lineSpan.EndLinePosition.Character, Projects = documents.Select(document => document.Project.Name).ToArray() }; } } }
using System; using System.IO; using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis; using OmniSharp.Models; namespace OmniSharp.Helpers { public static class LocationExtensions { public static QuickFix GetQuickFix(this Location location, OmniSharpWorkspace workspace) { if (!location.IsInSource) throw new Exception("Location is not in the source tree"); var lineSpan = Path.GetExtension(location.SourceTree.FilePath).Equals(".cake", StringComparison.OrdinalIgnoreCase) ? location.GetLineSpan() : location.GetMappedLineSpan(); var path = lineSpan.Path; var documents = workspace.GetDocuments(path); var line = lineSpan.StartLinePosition.Line; var text = location.SourceTree.GetText().Lines[line].ToString(); return new QuickFix { Text = text.Trim(), FileName = path, Line = line, Column = lineSpan.HasMappedPath ? 0 : lineSpan.StartLinePosition.Character, // when a #line directive maps into a separate file, assume columns (0,0) EndLine = lineSpan.EndLinePosition.Line, EndColumn = lineSpan.HasMappedPath ? 0 : lineSpan.EndLinePosition.Character, Projects = documents.Select(document => document.Project.Name).ToArray() }; } } }
Exclude Cake files from line span mapping
Exclude Cake files from line span mapping
C#
mit
OmniSharp/omnisharp-roslyn,OmniSharp/omnisharp-roslyn
2a8a89bb9937b83969ed3a1e417cc5d11de2dcbd
src/Slp.Evi.Storage/Slp.Evi.Test.System/Sparql/Vendor/MsSqlSparqlTestSuite.cs
src/Slp.Evi.Storage/Slp.Evi.Test.System/Sparql/Vendor/MsSqlSparqlTestSuite.cs
using System.Linq; using Microsoft.Extensions.Configuration; using Slp.Evi.Storage.Database; using Slp.Evi.Storage.Database.Vendor.MsSql; using Xunit; namespace Slp.Evi.Test.System.Sparql.Vendor { public sealed class MsSqlSparqlFixture : SparqlFixture { public MsSqlSparqlFixture() { // Prepare all databases beforehand var bootUp = SparqlTestSuite.TestData.Select(x => x[0]).Cast<string>().Distinct() .Select(x => base.GetStorage(x)); } protected override ISqlDatabase GetSqlDb() { var builder = new ConfigurationBuilder() .AddJsonFile("database.json") .AddEnvironmentVariables(); var config = builder.Build(); var connectionString = config.GetConnectionString("mssql"); return (new MsSqlDbFactory()).CreateSqlDb(connectionString, 30); } } public class MsSqlSparqlTestSuite : SparqlTestSuite, IClassFixture<MsSqlSparqlFixture> { public MsSqlSparqlTestSuite(MsSqlSparqlFixture fixture) : base(fixture) { } } }
using System.Linq; using Microsoft.Extensions.Configuration; using Slp.Evi.Storage.Database; using Slp.Evi.Storage.Database.Vendor.MsSql; using Xunit; namespace Slp.Evi.Test.System.Sparql.Vendor { public sealed class MsSqlSparqlFixture : SparqlFixture { public MsSqlSparqlFixture() { // Prepare all databases beforehand var datasetsToBootup = SparqlTestSuite.TestData.Select(x => x[0]).Cast<string>().Distinct(); foreach (var dataset in datasetsToBootup) { GetStorage(dataset); } } protected override ISqlDatabase GetSqlDb() { var builder = new ConfigurationBuilder() .AddJsonFile("database.json") .AddEnvironmentVariables(); var config = builder.Build(); var connectionString = config.GetConnectionString("mssql"); return (new MsSqlDbFactory()).CreateSqlDb(connectionString, 30); } } public class MsSqlSparqlTestSuite : SparqlTestSuite, IClassFixture<MsSqlSparqlFixture> { public MsSqlSparqlTestSuite(MsSqlSparqlFixture fixture) : base(fixture) { } } }
Improve way how fixture is bootup.
Improve way how fixture is bootup.
C#
mit
mchaloupka/EVI
2d9918d6a895a239bd5fe619ecf58ae08eeb8e4f
Assets/Alensia/Core/UI/Legacy/CursorDefinition.cs
Assets/Alensia/Core/UI/Legacy/CursorDefinition.cs
using System; using UnityEngine; namespace Alensia.Core.UI.Legacy { [Serializable] public class CursorDefinition { public bool Visible; public CursorLockMode LockMode; public Vector2 Hotspot; public Texture2D Image; public void Apply() { Cursor.visible = Visible; Cursor.lockState = LockMode; Cursor.SetCursor(Image, Hotspot, CursorMode.Auto); } public static CursorDefinition Hidden = new CursorDefinition { Visible = false, LockMode = CursorLockMode.Locked }; public static CursorDefinition Default = new CursorDefinition { Visible = true, LockMode = CursorLockMode.None }; } }
using System; using UnityEngine; namespace Alensia.Core.UI.Legacy { [Serializable] public class CursorDefinition { public bool Visible; public CursorLockMode LockMode; public Vector2 Hotspot; public Texture2D Image; public void Apply() { UnityEngine.Cursor.visible = Visible; UnityEngine.Cursor.lockState = LockMode; UnityEngine.Cursor.SetCursor(Image, Hotspot, CursorMode.Auto); } public static CursorDefinition Hidden = new CursorDefinition { Visible = false, LockMode = CursorLockMode.Locked }; public static CursorDefinition Default = new CursorDefinition { Visible = true, LockMode = CursorLockMode.None }; } }
Fix compile error with namespace conflict
Fix compile error with namespace conflict
C#
apache-2.0
mysticfall/Alensia
b5d86cb5c13127b2a273f2a6688fad462ea8ead5
src/AsmResolver.PE/Debug/DefaultDebugDataReader.cs
src/AsmResolver.PE/Debug/DefaultDebugDataReader.cs
using AsmResolver.PE.Debug.CodeView; namespace AsmResolver.PE.Debug { /// <summary> /// Provides a default implementation of the <see cref="IDebugDataReader"/> interface. /// </summary> public class DefaultDebugDataReader : IDebugDataReader { /// <inheritdoc /> public IDebugDataSegment ReadDebugData(PEReaderContext context, DebugDataType type, IBinaryStreamReader reader) { if (type == DebugDataType.CodeView) return CodeViewDataSegment.FromReader(reader); return new CustomDebugDataSegment(type, DataSegment.FromReader(reader)); } } }
using AsmResolver.PE.Debug.CodeView; namespace AsmResolver.PE.Debug { /// <summary> /// Provides a default implementation of the <see cref="IDebugDataReader"/> interface. /// </summary> public class DefaultDebugDataReader : IDebugDataReader { /// <inheritdoc /> public IDebugDataSegment ReadDebugData(PEReaderContext context, DebugDataType type, IBinaryStreamReader reader) { return type switch { DebugDataType.CodeView => CodeViewDataSegment.FromReader(reader, context), _ => new CustomDebugDataSegment(type, DataSegment.FromReader(reader)) }; } } }
Change if to switch expression
Change if to switch expression
C#
mit
Washi1337/AsmResolver,Washi1337/AsmResolver,Washi1337/AsmResolver,Washi1337/AsmResolver
630bef1d9b795110b1f700dfe4be6a6632db1188
SimpSim.NET/StateSaver.cs
SimpSim.NET/StateSaver.cs
using System.IO; using System.Runtime.Serialization.Formatters.Binary; namespace SimpSim.NET { public class StateSaver { public virtual void SaveMemory(Memory memory, FileInfo file) { Save(memory, file); } public virtual Memory LoadMemory(FileInfo file) { return Load<Memory>(file); } public virtual void SaveRegisters(Registers registers, FileInfo file) { Save(registers, file); } public virtual Registers LoadRegisters(FileInfo file) { return Load<Registers>(file); } public virtual void SaveMachine(Machine machine, FileInfo file) { Save(machine, file); } public virtual Machine LoadMachine(FileInfo file) { return Load<Machine>(file); } private void Save(object @object, FileInfo file) { using (var fileStream = file.Create()) new BinaryFormatter().Serialize(fileStream, @object); } private T Load<T>(FileInfo file) { using (var fileStream = file.OpenRead()) return (T)new BinaryFormatter().Deserialize(fileStream); } } }
using System.IO; using System.Text.Json; namespace SimpSim.NET { public class StateSaver { public virtual void SaveMemory(Memory memory, FileInfo file) { Save(memory, file); } public virtual Memory LoadMemory(FileInfo file) { return Load<Memory>(file); } public virtual void SaveRegisters(Registers registers, FileInfo file) { Save(registers, file); } public virtual Registers LoadRegisters(FileInfo file) { return Load<Registers>(file); } public virtual void SaveMachine(Machine machine, FileInfo file) { Save(machine, file); } public virtual Machine LoadMachine(FileInfo file) { return Load<Machine>(file); } private void Save(object @object, FileInfo file) { using (var streamWriter = file.CreateText()) streamWriter.Write(JsonSerializer.Serialize(@object)); } private T Load<T>(FileInfo file) { using (var streamReader = file.OpenText()) return JsonSerializer.Deserialize<T>(streamReader.ReadToEnd()); } } }
Replace BinaryFormatter with JsonSerializer due to the former being obsoleted. Tests still fail.
Replace BinaryFormatter with JsonSerializer due to the former being obsoleted. Tests still fail.
C#
mit
ryanjfitz/SimpSim.NET
3d1f9c6e54398a89d239bef272685b895bb866a9
Assets/OCDRoomEscape/Scripts/Interaction/DeskLampPuzzle.cs
Assets/OCDRoomEscape/Scripts/Interaction/DeskLampPuzzle.cs
using UnityEngine; using System.Collections; public class DeskLampPuzzle : Puzzle { private bool isLampOn = false; private bool hasLampBeenTurnedOn = false; private InteractableSwitch lampSwitch; // Use this for initialization public override void Start () { base.Start(); lampSwitch = GetComponent<InteractableSwitch>(); } // Update is called once per frame void Update () { if (isLampOn != lampSwitch.turnedOn) { isLampOn = lampSwitch.turnedOn; hasLampBeenTurnedOn = true; base.CompletePuzzle(); } } }
using UnityEngine; using System.Collections; public class DeskLampPuzzle : Puzzle { private bool isLampOn = false; private bool hasLampBeenTurnedOn = false; private InteractableSwitch lampSwitch; // Use this for initialization public override void Start () { base.Start(); lampSwitch = GetComponent<InteractableSwitch>(); } // Update is called once per frame void Update () { if (isLampOn != lampSwitch.turnedOn) { isLampOn = lampSwitch.turnedOn; if (!hasLampBeenTurnedOn) { base.CompletePuzzle(); } hasLampBeenTurnedOn = true; } } }
Check that the puzzle has not already been solved.
Check that the puzzle has not already been solved.
C#
apache-2.0
gadauto/OCDEscape
644021383639d599a978e6170ae3db7c5d787015
src/EloWeb/Models/Games.cs
src/EloWeb/Models/Games.cs
using System.Collections.Generic; using System.Linq; namespace EloWeb.Models { public class Games { public enum GamesSortOrder { MostRecentFirst = 1, MostRecentLast = 2 } private static List<Game> _games = new List<Game>(); public static void Initialise(IEnumerable<Game> gameEntities) { _games = gameEntities.ToList(); foreach(var game in _games) Players.UpdateRatings(game); } public static void Add(Game game) { _games.Add(game); } public static IEnumerable<Game> All() { return _games.AsEnumerable(); } public static IEnumerable<Game> MostRecent(int howMany, GamesSortOrder sortOrder) { var games = _games.AsEnumerable() .OrderBy(g => g.WhenPlayed) .Reverse() .Take(howMany); if (sortOrder == GamesSortOrder.MostRecentLast) return games.Reverse(); return games; } public static IEnumerable<Game> GamesByPlayer(string name) { return _games.Where(game => game.Winner == name || game.Loser == name); } } }
using System.Collections.Generic; using System.Linq; namespace EloWeb.Models { public class Games { public enum GamesSortOrder { MostRecentFirst = 1, MostRecentLast = 2 } private static List<Game> _games = new List<Game>(); public static void Initialise(IEnumerable<Game> gameEntities) { _games = gameEntities .OrderBy(g => g.WhenPlayed) .ToList(); foreach(var game in _games) Players.UpdateRatings(game); } public static void Add(Game game) { _games.Add(game); } public static IEnumerable<Game> All() { return _games.AsEnumerable(); } public static IEnumerable<Game> MostRecent(int howMany, GamesSortOrder sortOrder) { var games = _games.AsEnumerable() .OrderBy(g => g.WhenPlayed) .Reverse() .Take(howMany); if (sortOrder == GamesSortOrder.MostRecentLast) return games.Reverse(); return games; } public static IEnumerable<Game> GamesByPlayer(string name) { return _games.Where(game => game.Winner == name || game.Loser == name); } } }
Fix order of games when calculating ratings
Fix order of games when calculating ratings
C#
unlicense
Variares/ELOSYSTEM,richardadalton/EloRate,richardadalton/EloRate,Variares/ELOSYSTEM
2827e28ba62e8582bc5c21dcf8891d2deca1959b
DioLive.Cache/src/DioLive.Cache.WebUI/Views/Shared/_SelectLanguagePartial.cshtml
DioLive.Cache/src/DioLive.Cache.WebUI/Views/Shared/_SelectLanguagePartial.cshtml
@using System.Globalization @using Microsoft.AspNetCore.Builder @using Microsoft.AspNetCore.Http @using Microsoft.AspNetCore.Localization @using Microsoft.Extensions.Options @inject IViewLocalizer Localizer @inject IOptions<RequestLocalizationOptions> LocOptions @{ var cultureItems = new SelectList(LocOptions.Value.SupportedUICultures, nameof(CultureInfo.Name), nameof(CultureInfo.DisplayName)); } <div> <form id="selectLanguage" asp-area="" asp-controller="Home" asp-action="SetLanguage" asp-route-returnUrl="@Context.Request.Path" method="post" class="form-horizontal" role="form"> @Localizer["Language:"] <select name="culture" asp-for="@Context.GetCurrentCulture()" asp-items="cultureItems"></select> <button>OK</button> </form> </div>
@using System.Globalization @using Microsoft.AspNetCore.Builder @using Microsoft.AspNetCore.Http @using Microsoft.AspNetCore.Localization @using Microsoft.Extensions.Options @inject IViewLocalizer Localizer @inject IOptions<RequestLocalizationOptions> LocOptions @{ var cultureItems = new SelectList(LocOptions.Value.SupportedUICultures, nameof(CultureInfo.Name), nameof(CultureInfo.DisplayName)); var currentCulture = Context.GetCurrentCulture(); } <div> <form id="selectLanguage" asp-area="" asp-controller="Home" asp-action="SetLanguage" asp-route-returnUrl="@Context.Request.Path" method="post" class="form-horizontal" role="form"> @Localizer["Language:"] <select name="culture" asp-for="@currentCulture" asp-items="cultureItems"></select> <button>OK</button> </form> </div>
Fix issue with tagHelper that requries field or property to target for
Fix issue with tagHelper that requries field or property to target for
C#
mit
diolive/cache,diolive/cache
3bd72be798d1d5858ce5f9c5af5739c653b65e12
Credentials/src/Credentials/Properties/AssemblyInfo.cs
Credentials/src/Credentials/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: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Security")] [assembly: AssemblyTrademark("")] // 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("ea66be4b-3391-49c4-96e8-b1b9044397b9")]
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: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Credentials")] [assembly: AssemblyTrademark("")] // 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("ea66be4b-3391-49c4-96e8-b1b9044397b9")]
Correct AssemblyProduct name from Security to Credentials
Correct AssemblyProduct name from Security to Credentials
C#
mit
alansav/credentials
d3d61cc54f4f9cc2a589d3e5d8d57bda2d6a1fe6
sdk/xamarin/ios/Microsoft.WindowsAzure.Mobile.Ext.iOS/Properties/AssemblyInfo.cs
sdk/xamarin/ios/Microsoft.WindowsAzure.Mobile.Ext.iOS/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("Microsoft.WindowsAzure.Mobile.Ext.iOS")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Xamarin Inc.")] [assembly: AssemblyProduct("Microsoft.WindowsAzure.Mobile.Ext.iOS")] [assembly: AssemblyCopyright("Copyright © Xamarin Inc. 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("9453e5ef-4541-4491-941f-d20f4e39c967")] // 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("Microsoft.WindowsAzure.Mobile.Ext.iOS")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Xamarin Inc.")] [assembly: AssemblyProduct("Microsoft.WindowsAzure.Mobile.Ext.iOS")] [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("9453e5ef-4541-4491-941f-d20f4e39c967")] // 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")]
Drop the Xamarin copyright after the CLA has been signed to contribute this back to Microsoft
Drop the Xamarin copyright after the CLA has been signed to contribute this back to Microsoft
C#
apache-2.0
erichedstrom/azure-mobile-services,dcristoloveanu/azure-mobile-services,paulbatum/azure-mobile-services,paulbatum/azure-mobile-services,intellitour/azure-mobile-services,soninaren/azure-mobile-services,intellitour/azure-mobile-services,Reminouche/azure-mobile-services,jeremy50dj/azure-mobile-services,marianosz/azure-mobile-services,shrishrirang/azure-mobile-services,Azure/azure-mobile-services,daemun/azure-mobile-services,Reminouche/azure-mobile-services,dhei/azure-mobile-services,marianosz/azure-mobile-services,baumatron/azure-mobile-services-baumatron,fabiocav/azure-mobile-services,apuyana/azure-mobile-services,cmatskas/azure-mobile-services,phvannor/azure-mobile-services,cmatskas/azure-mobile-services,cmatskas/azure-mobile-services,paulbatum/azure-mobile-services,baumatron/azure-mobile-services-baumatron,YOTOV-LIMITED/azure-mobile-services,phvannor/azure-mobile-services,erichedstrom/azure-mobile-services,Azure/azure-mobile-services,Reminouche/azure-mobile-services,baumatron/azure-mobile-services-baumatron,phvannor/azure-mobile-services,daemun/azure-mobile-services,gb92/azure-mobile-services,pragnagopa/azure-mobile-services,yuqiqian/azure-mobile-services,intellitour/azure-mobile-services,shrishrirang/azure-mobile-services,soninaren/azure-mobile-services,apuyana/azure-mobile-services,Reminouche/azure-mobile-services,baumatron/azure-mobile-services-baumatron,dcristoloveanu/azure-mobile-services,ysxu/azure-mobile-services,marianosz/azure-mobile-services,gb92/azure-mobile-services,mauricionr/azure-mobile-services,phvannor/azure-mobile-services,ysxu/azure-mobile-services,shrishrirang/azure-mobile-services,daemun/azure-mobile-services,gb92/azure-mobile-services,fabiocav/azure-mobile-services,dhei/azure-mobile-services,mauricionr/azure-mobile-services,marianosz/azure-mobile-services,Reminouche/azure-mobile-services,apuyana/azure-mobile-services,Azure/azure-mobile-services,soninaren/azure-mobile-services,fabiocav/azure-mobile-services,daemun/azure-mobile-services,marianosz/azure-mobile-services,intellitour/azure-mobile-services,mauricionr/azure-mobile-services,ysxu/azure-mobile-services,pragnagopa/azure-mobile-services,dhei/azure-mobile-services,jeremy50dj/azure-mobile-services,jeremy50dj/azure-mobile-services,Azure/azure-mobile-services,YOTOV-LIMITED/azure-mobile-services,yuqiqian/azure-mobile-services,mauricionr/azure-mobile-services,shrishrirang/azure-mobile-services,YOTOV-LIMITED/azure-mobile-services,paulbatum/azure-mobile-services,erichedstrom/azure-mobile-services,dcristoloveanu/azure-mobile-services,pragnagopa/azure-mobile-services,fabiocav/azure-mobile-services,ysxu/azure-mobile-services,erichedstrom/azure-mobile-services,yuqiqian/azure-mobile-services,cmatskas/azure-mobile-services,jeremy50dj/azure-mobile-services,baumatron/azure-mobile-services-baumatron,dcristoloveanu/azure-mobile-services,gb92/azure-mobile-services,Redth/azure-mobile-services,paulbatum/azure-mobile-services,intellitour/azure-mobile-services,Redth/azure-mobile-services,Azure/azure-mobile-services,YOTOV-LIMITED/azure-mobile-services,soninaren/azure-mobile-services,gb92/azure-mobile-services,dcristoloveanu/azure-mobile-services,jeremy50dj/azure-mobile-services,YOTOV-LIMITED/azure-mobile-services,baumatron/azure-mobile-services-baumatron,YOTOV-LIMITED/azure-mobile-services,Azure/azure-mobile-services,erichedstrom/azure-mobile-services,daemun/azure-mobile-services,daemun/azure-mobile-services,Redth/azure-mobile-services,ysxu/azure-mobile-services,cmatskas/azure-mobile-services,cmatskas/azure-mobile-services,dhei/azure-mobile-services,yuqiqian/azure-mobile-services,soninaren/azure-mobile-services,marianosz/azure-mobile-services,dcristoloveanu/azure-mobile-services,paulbatum/azure-mobile-services,baumatron/azure-mobile-services-baumatron,apuyana/azure-mobile-services,soninaren/azure-mobile-services,phvannor/azure-mobile-services,yuqiqian/azure-mobile-services,cmatskas/azure-mobile-services,ysxu/azure-mobile-services,Redth/azure-mobile-services,yuqiqian/azure-mobile-services,fabiocav/azure-mobile-services,daemun/azure-mobile-services,Reminouche/azure-mobile-services,apuyana/azure-mobile-services,shrishrirang/azure-mobile-services,fabiocav/azure-mobile-services,mauricionr/azure-mobile-services,marianosz/azure-mobile-services,pragnagopa/azure-mobile-services,shrishrirang/azure-mobile-services,mauricionr/azure-mobile-services,dhei/azure-mobile-services,pragnagopa/azure-mobile-services,jeremy50dj/azure-mobile-services,pragnagopa/azure-mobile-services,Redth/azure-mobile-services,intellitour/azure-mobile-services,gb92/azure-mobile-services,apuyana/azure-mobile-services,phvannor/azure-mobile-services,erichedstrom/azure-mobile-services,Redth/azure-mobile-services
9e28040206f71ed8bfcee34f3d981afbdad55f54
src/Arkivverket.Arkade.Core/Base/ArkadeTestNameProvider.cs
src/Arkivverket.Arkade.Core/Base/ArkadeTestNameProvider.cs
using Arkivverket.Arkade.Core.Base.Addml.Processes; using Arkivverket.Arkade.Core.Resources; using Arkivverket.Arkade.Core.Util; namespace Arkivverket.Arkade.Core.Base { public static class ArkadeTestNameProvider { public static string GetDisplayName(IArkadeTest arkadeTest) { TestId testId = arkadeTest.GetId(); string testName = GetTestName(testId); string displayName = testName != null ? string.Format(ArkadeTestDisplayNames.DisplayNameFormat, testId, testName) : GetFallBackDisplayName(arkadeTest); return displayName; } private static string GetTestName(TestId testId) { string resourceDisplayNameKey = testId.ToString().Replace('.', '_'); if (testId.Version.Equals("5.5")) resourceDisplayNameKey = $"{resourceDisplayNameKey}v5_5"; return ArkadeTestDisplayNames.ResourceManager.GetString(resourceDisplayNameKey); } private static string GetFallBackDisplayName(IArkadeTest arkadeTest) { try { return ((AddmlProcess) arkadeTest).GetName(); // Process name } catch { return arkadeTest.GetType().Name; // Class name } } } }
using Arkivverket.Arkade.Core.Resources; using Arkivverket.Arkade.Core.Util; namespace Arkivverket.Arkade.Core.Base { public static class ArkadeTestNameProvider { public static string GetDisplayName(IArkadeTest arkadeTest) { TestId testId = arkadeTest.GetId(); string testName = GetTestName(testId); return string.Format(ArkadeTestDisplayNames.DisplayNameFormat, testId, testName); } private static string GetTestName(TestId testId) { string resourceDisplayNameKey = testId.ToString().Replace('.', '_'); if (testId.Version.Equals("5.5")) resourceDisplayNameKey = $"{resourceDisplayNameKey}v5_5"; return ArkadeTestDisplayNames.ResourceManager.GetString(resourceDisplayNameKey); } } }
Remove no longer needed display name fallback
Remove no longer needed display name fallback
C#
agpl-3.0
arkivverket/arkade5,arkivverket/arkade5,arkivverket/arkade5
f580a2ca8bcbcc6fb8d6657d90c09c9c48bb33f2
src/CGO.Web/Areas/Admin/Views/Shared/_Layout.cshtml
src/CGO.Web/Areas/Admin/Views/Shared/_Layout.cshtml
<!DOCTYPE html> <html lang="en"> <head> <meta name="viewport" content="width=device-width" /> <title>@ViewBag.Title</title> </head> <body> <div> @RenderBody() </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta name="viewport" content="width=device-width" /> <title>@ViewBag.Title</title> @Styles.Render("~/Content/bootstrap.min.css") </head> <body> <div> @RenderBody() </div> @RenderSection("Scripts", false) </body> </html>
Add Scripts section and Bootstrap styling.
Add Scripts section and Bootstrap styling.
C#
mit
alastairs/cgowebsite,alastairs/cgowebsite
a7f00bac976a2a3bfe75670e60dcbb6413c79f55
data/mango-tool/layouts/default/StaticContentModule.cs
data/mango-tool/layouts/default/StaticContentModule.cs
using System; using System.IO; using Mango; // // This the default StaticContentModule that comes with all Mango apps // if you do not wish to serve any static content with Mango you can // remove its route handler from <YourApp>.cs's constructor and delete // this file. // // All Content placed on the Content/ folder should be handled by this // module. // namespace AppNameFoo { public class StaticContentModule : MangoModule { public StaticContentModule () { Get ("*", Content); } public static void Content (IMangoContext ctx) { string path = ctx.Request.LocalPath; if (path.StartsWith ("/")) path = path.Substring (1); if (File.Exists (path)) { ctx.Response.SendFile (path); } else ctx.Response.StatusCode = 404; } } }
using System; using System.IO; using Mango; // // This the default StaticContentModule that comes with all Mango apps // if you do not wish to serve any static content with Mango you can // remove its route handler from <YourApp>.cs's constructor and delete // this file. // // All Content placed on the Content/ folder should be handled by this // module. // namespace $APPNAME { public class StaticContentModule : MangoModule { public StaticContentModule () { Get ("*", Content); } public static void Content (IMangoContext ctx) { string path = ctx.Request.LocalPath; if (path.StartsWith ("/")) path = path.Substring (1); if (File.Exists (path)) { ctx.Response.SendFile (path); } else ctx.Response.StatusCode = 404; } } }
Use the correct namespace on the static content module.
Use the correct namespace on the static content module.
C#
mit
mdavid/manos-spdy,jacksonh/manos,jacksonh/manos,jacksonh/manos,jacksonh/manos,mdavid/manos-spdy,jacksonh/manos,jmptrader/manos,jmptrader/manos,jacksonh/manos,mdavid/manos-spdy,jmptrader/manos,jmptrader/manos,mdavid/manos-spdy,jacksonh/manos,mdavid/manos-spdy,jacksonh/manos,mdavid/manos-spdy,mdavid/manos-spdy,jmptrader/manos,jmptrader/manos,jmptrader/manos,jmptrader/manos
c54a4ea61b7724974a541d5ab28721e99e46b153
GridDomain.CQRS.Messaging/MessageRouting/ProjectionGroup.cs
GridDomain.CQRS.Messaging/MessageRouting/ProjectionGroup.cs
using System; using System.Collections.Generic; namespace GridDomain.CQRS.Messaging.MessageRouting { public class ProjectionGroup: IProjectionGroup { private readonly IServiceLocator _locator; readonly Dictionary<Type, List<Action<object>>> _handlers = new Dictionary<Type, List<Action<object>>>(); public ProjectionGroup(IServiceLocator locator) { _locator = locator; } public void Add<TMessage, THandler>(string correlationPropertyName ) where THandler : IHandler<TMessage> { var handler = _locator.Resolve<THandler>(); List<Action<object>> builderList; if (!_handlers.TryGetValue(typeof (TMessage), out builderList)) { builderList = new List<Action<object>>(); _handlers[typeof (TMessage)] = builderList; } builderList.Add(o => handler.Handle((TMessage) o)); _acceptMessages.Add(new MessageRoute(typeof(TMessage), correlationPropertyName)); } public void Project(object message) { var msgType = message.GetType(); foreach(var handler in _handlers[msgType]) handler(message); } private readonly List<MessageRoute> _acceptMessages = new List<MessageRoute>(); public IReadOnlyCollection<MessageRoute> AcceptMessages => _acceptMessages; } }
using System; using System.Collections.Generic; using System.Linq; namespace GridDomain.CQRS.Messaging.MessageRouting { public class ProjectionGroup: IProjectionGroup { private readonly IServiceLocator _locator; readonly Dictionary<Type, List<Action<object>>> _handlers = new Dictionary<Type, List<Action<object>>>(); public ProjectionGroup(IServiceLocator locator) { _locator = locator; } public void Add<TMessage, THandler>(string correlationPropertyName ) where THandler : IHandler<TMessage> { var handler = _locator.Resolve<THandler>(); List<Action<object>> builderList; if (!_handlers.TryGetValue(typeof (TMessage), out builderList)) { builderList = new List<Action<object>>(); _handlers[typeof (TMessage)] = builderList; } builderList.Add(o => handler.Handle((TMessage) o)); if(_acceptMessages.All(m => m.MessageType != typeof (TMessage))) _acceptMessages.Add(new MessageRoute(typeof(TMessage), correlationPropertyName)); } public void Project(object message) { var msgType = message.GetType(); foreach(var handler in _handlers[msgType]) handler(message); } private readonly List<MessageRoute> _acceptMessages = new List<MessageRoute>(); public IReadOnlyCollection<MessageRoute> AcceptMessages => _acceptMessages; } }
Fix for several handlers for one message in projection group
Fix for several handlers for one message in projection group
C#
apache-2.0
linkelf/GridDomain,andreyleskov/GridDomain
610a1c7b8fddceb0dcee2f395a15d1a904a76f51
src/Takenet.MessagingHub.Client.Test/MessagingHubClientTests_SendCommand.cs
src/Takenet.MessagingHub.Client.Test/MessagingHubClientTests_SendCommand.cs
using Lime.Protocol; using NSubstitute; using NUnit.Framework; using Shouldly; using System; using System.Threading; using System.Threading.Tasks; namespace Takenet.MessagingHub.Client.Test { [TestFixture] internal class MessagingHubClientTests_SendCommand : MessagingHubClientTestBase { [SetUp] protected override void Setup() { base.Setup(); } [TearDown] protected override void TearDown() { base.TearDown(); } [Test] public async Task Send_Command_And_Receive_Response_With_Success() { //Arrange var commandId = Guid.NewGuid(); var commandResponse = new Command { Id = commandId, Status = CommandStatus.Success, }; ClientChannel.ProcessCommandAsync(null, CancellationToken.None).ReturnsForAnyArgs(commandResponse); await MessagingHubClient.StartAsync(); //Act var result = MessagingHubClient.SendCommandAsync(new Command { Id = commandId }).Result; //Assert ClientChannel.ReceivedWithAnyArgs().ReceiveCommandAsync(CancellationToken.None); result.ShouldNotBeNull(); result.Status.ShouldBe(CommandStatus.Success); result.Id.ShouldBe(commandId); } [Test] public void Send_Command_Without_Start_Should_Throw_Exception() { //Act / Assert Should.ThrowAsync<InvalidOperationException>(async () => await MessagingHubClient.SendCommandAsync(Arg.Any<Command>()).ConfigureAwait(false)).Wait(); } } }
using Lime.Protocol; using NSubstitute; using NUnit.Framework; using Shouldly; using System; using System.Threading; using System.Threading.Tasks; namespace Takenet.MessagingHub.Client.Test { [TestFixture] internal class MessagingHubClientTests_SendCommand : MessagingHubClientTestBase { [SetUp] protected override void Setup() { base.Setup(); } [TearDown] protected override void TearDown() { base.TearDown(); } [Test] public async Task Send_Command_And_Receive_Response_With_Success() { //Arrange var commandId = Guid.NewGuid(); var commandResponse = new Command { Id = commandId, Status = CommandStatus.Success, }; ClientChannel.ProcessCommandAsync(null, CancellationToken.None).ReturnsForAnyArgs(commandResponse); await MessagingHubClient.StartAsync(); //Act var result = await MessagingHubClient.SendCommandAsync(new Command { Id = commandId }); await Task.Delay(TIME_OUT); //Assert ClientChannel.ReceivedWithAnyArgs().ReceiveCommandAsync(CancellationToken.None); result.ShouldNotBeNull(); result.Status.ShouldBe(CommandStatus.Success); result.Id.ShouldBe(commandId); } [Test] public void Send_Command_Without_Start_Should_Throw_Exception() { //Act / Assert Should.ThrowAsync<InvalidOperationException>(async () => await MessagingHubClient.SendCommandAsync(Arg.Any<Command>()).ConfigureAwait(false)).Wait(); } } }
Use await um command tests
Use await um command tests
C#
apache-2.0
takenet/messaginghub-client-csharp
1dd354120b1013759d210e49902e08393c6d18b9
osu.Game.Tests/Visual/Editing/TestSceneTimingScreen.cs
osu.Game.Tests/Visual/Editing/TestSceneTimingScreen.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 NUnit.Framework; using osu.Framework.Allocation; using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu.Beatmaps; using osu.Game.Screens.Edit; using osu.Game.Screens.Edit.Timing; namespace osu.Game.Tests.Visual.Editing { [TestFixture] public class TestSceneTimingScreen : EditorClockTestScene { [Cached(typeof(EditorBeatmap))] [Cached(typeof(IBeatSnapProvider))] private readonly EditorBeatmap editorBeatmap; public TestSceneTimingScreen() { editorBeatmap = new EditorBeatmap(CreateBeatmap(new OsuRuleset().RulesetInfo)); } [BackgroundDependencyLoader] private void load() { Beatmap.Value = CreateWorkingBeatmap(editorBeatmap.PlayableBeatmap); Child = new TimingScreen(); } } }
// 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 NUnit.Framework; using osu.Framework.Allocation; using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Osu; using osu.Game.Screens.Edit; using osu.Game.Screens.Edit.Timing; namespace osu.Game.Tests.Visual.Editing { [TestFixture] public class TestSceneTimingScreen : EditorClockTestScene { [Cached(typeof(EditorBeatmap))] [Cached(typeof(IBeatSnapProvider))] private readonly EditorBeatmap editorBeatmap; public TestSceneTimingScreen() { editorBeatmap = new EditorBeatmap(CreateBeatmap(new OsuRuleset().RulesetInfo)); } [BackgroundDependencyLoader] private void load() { Beatmap.Value = CreateWorkingBeatmap(editorBeatmap.PlayableBeatmap); Beatmap.Disabled = true; Child = new TimingScreen(); } protected override void Dispose(bool isDisposing) { Beatmap.Disabled = false; base.Dispose(isDisposing); } } }
Fix beatmap potentially changing in test scene
Fix beatmap potentially changing in test scene
C#
mit
smoogipoo/osu,peppy/osu,UselessToucan/osu,NeoAdonis/osu,peppy/osu,smoogipooo/osu,NeoAdonis/osu,UselessToucan/osu,smoogipoo/osu,peppy/osu-new,ppy/osu,UselessToucan/osu,peppy/osu,smoogipoo/osu,ppy/osu,ppy/osu,NeoAdonis/osu
5bcb20245c4b801d5e59ec7b5d3d89829bd30fe3
Battery-Commander.Web/Models/NavigationViewComponent.cs
Battery-Commander.Web/Models/NavigationViewComponent.cs
using BatteryCommander.Web.Controllers; using BatteryCommander.Web.Services; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace BatteryCommander.Web.Models { public class NavigationViewComponent : ViewComponent { private readonly Database db; public Soldier Soldier { get; private set; } public Boolean ShowNavigation => !String.Equals(nameof(HomeController.PrivacyAct), RouteData.Values["action"]); public IEnumerable<Embed> NavItems { get { // TODO Only for nav items // TODO Only for the logged in unit yield return new Embed { Name = "PO Tracker" }; yield return new Embed { Name = "SUTA" }; //return // db // .Embeds // .ToList(); } } public NavigationViewComponent(Database db) { this.db = db; } public async Task<IViewComponentResult> InvokeAsync() { Soldier = await UserService.FindAsync(db, UserClaimsPrincipal); return View(this); } } }
using BatteryCommander.Web.Controllers; using BatteryCommander.Web.Services; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace BatteryCommander.Web.Models { public class NavigationViewComponent : ViewComponent { private readonly Database db; public Soldier Soldier { get; private set; } public Boolean ShowNavigation => !String.Equals(nameof(HomeController.PrivacyAct), RouteData.Values["action"]); public IEnumerable<Embed> NavItems { get { // TODO Only for nav items // TODO Only for the logged in uni return db .Embeds .ToList(); } } public NavigationViewComponent(Database db) { this.db = db; } public async Task<IViewComponentResult> InvokeAsync() { Soldier = await UserService.FindAsync(db, UserClaimsPrincipal); return View(this); } } }
Use the actual db data
Use the actual db data
C#
mit
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
3d4c7bc35c0bf1ffd1137655184acc4da1d0aa30
src/Jasper.ConfluentKafka/KafkaTransportProtocol.cs
src/Jasper.ConfluentKafka/KafkaTransportProtocol.cs
using System.Text; using Confluent.Kafka; using Jasper.Transports; namespace Jasper.ConfluentKafka { public class KafkaTransportProtocol<TKey, TVal> : ITransportProtocol<Message<TKey, TVal>> { public Message<TKey, TVal> WriteFromEnvelope(Envelope envelope) => new Message<TKey, TVal> { Headers = new Headers(), Value = (TVal) envelope.Message }; public Envelope ReadEnvelope(Message<TKey, TVal> message) { var env = new Envelope(); foreach (var header in message.Headers) { env.Headers.Add(header.Key, Encoding.UTF8.GetString(header.GetValueBytes())); } env.Message = message.Value; return env; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Confluent.Kafka; using Jasper.Transports; namespace Jasper.ConfluentKafka { public class KafkaTransportProtocol<TKey, TVal> : ITransportProtocol<Message<TKey, TVal>> { private const string JasperMessageIdHeader = "Jasper_MessageId"; public Message<TKey, TVal> WriteFromEnvelope(Envelope envelope) { var message = new Message<TKey, TVal> { Headers = new Headers(), Value = (TVal) envelope.Message }; foreach (KeyValuePair<string, string> h in envelope.Headers) { Header header = new Header(h.Key, Encoding.UTF8.GetBytes(h.Value)); message.Headers.Add(header); } message.Headers.Add(JasperMessageIdHeader, Encoding.UTF8.GetBytes(envelope.Id.ToString())); return message; } public Envelope ReadEnvelope(Message<TKey, TVal> message) { var env = new Envelope(); foreach (var header in message.Headers.Where(h => !h.Key.StartsWith("Jasper"))) { env.Headers.Add(header.Key, Encoding.UTF8.GetString(header.GetValueBytes())); } var messageIdHeader = message.Headers.Single(h => h.Key.Equals(JasperMessageIdHeader)); env.Id = Guid.Parse(Encoding.UTF8.GetString(messageIdHeader.GetValueBytes())); env.Message = message.Value; return env; } } }
Make sure Jasper MessageId goes across the wire
Make sure Jasper MessageId goes across the wire
C#
mit
JasperFx/jasper,JasperFx/jasper,JasperFx/jasper
9a2425f316903a8725da40f6d0374afa91aebe8c
osu.Game/Beatmaps/Drawables/Cards/Buttons/DownloadButton.cs
osu.Game/Beatmaps/Drawables/Cards/Buttons/DownloadButton.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.Sprites; using osu.Game.Online.API.Requests.Responses; namespace osu.Game.Beatmaps.Drawables.Cards.Buttons { public class DownloadButton : BeatmapCardIconButton { private readonly APIBeatmapSet beatmapSet; public DownloadButton(APIBeatmapSet beatmapSet) { this.beatmapSet = beatmapSet; Icon.Icon = FontAwesome.Solid.FileDownload; } // TODO: implement behaviour } }
// 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.Sprites; using osu.Game.Online.API.Requests.Responses; namespace osu.Game.Beatmaps.Drawables.Cards.Buttons { public class DownloadButton : BeatmapCardIconButton { public DownloadButton(APIBeatmapSet beatmapSet) { Icon.Icon = FontAwesome.Solid.FileDownload; } // TODO: implement behaviour } }
Remove unused field for now to appease inspectcode
Remove unused field for now to appease inspectcode
C#
mit
peppy/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,NeoAdonis/osu,peppy/osu,smoogipoo/osu,peppy/osu,ppy/osu,ppy/osu,smoogipooo/osu,NeoAdonis/osu,smoogipoo/osu
37640d1c0820ba9cf1ab8cddbdaacf38d7aa6af4
src/Orchard.Web/Modules/Orchard.Lists/Migrations.cs
src/Orchard.Web/Modules/Orchard.Lists/Migrations.cs
using Orchard.ContentManagement.MetaData; using Orchard.Core.Contents.Extensions; using Orchard.Data.Migration; namespace Orchard.Lists { public class Migrations : DataMigrationImpl { public int Create() { ContentDefinitionManager.AlterTypeDefinition("List", cfg=>cfg .WithPart("CommonPart") .WithPart("RoutePart") .WithPart("ContainerPart") .WithPart("MenuPart") .WithPart("AdminMenuPart", p => p.WithSetting("AdminMenuPartTypeSettings.DefaultPosition", "2")) .Creatable()); return 3; } public int UpdateFrom1() { ContentDefinitionManager.AlterTypeDefinition("List", cfg => cfg.WithPart("AdminMenuPart", p => p.WithSetting("AdminMenuPartTypeSettings.DefaultPosition", "2"))); return 3; } public int UpdateFrom2() { ContentDefinitionManager.AlterTypeDefinition("List", cfg => cfg.WithPart("AdminMenuPart", p => p.WithSetting("AdminMenuPartTypeSettings.DefaultPosition", "2"))); return 3; } } }
using Orchard.ContentManagement.MetaData; using Orchard.Core.Contents.Extensions; using Orchard.Data.Migration; namespace Orchard.Lists { public class Migrations : DataMigrationImpl { public int Create() { ContentDefinitionManager.AlterTypeDefinition("List", cfg=>cfg .WithPart("CommonPart") .WithPart("TitlePart") .WithPart("AutoroutePart") .WithPart("ContainerPart") .WithPart("MenuPart") .WithPart("AdminMenuPart", p => p.WithSetting("AdminMenuPartTypeSettings.DefaultPosition", "2")) .Creatable()); return 4; } public int UpdateFrom1() { ContentDefinitionManager.AlterTypeDefinition("List", cfg => cfg.WithPart("AdminMenuPart", p => p.WithSetting("AdminMenuPartTypeSettings.DefaultPosition", "2"))); return 3; } public int UpdateFrom2() { ContentDefinitionManager.AlterTypeDefinition("List", cfg => cfg.WithPart("AdminMenuPart", p => p.WithSetting("AdminMenuPartTypeSettings.DefaultPosition", "2"))); return 3; } public int UpdateFrom3() { // TODO: (PH:Autoroute) Copy paths, routes, etc. ContentDefinitionManager.AlterTypeDefinition("List", cfg => cfg .RemovePart("RoutePart") .WithPart("TitlePart") .WithPart("AutoroutePart")); return 4; } } }
Update Lists migrations for Autoroute
Update Lists migrations for Autoroute --HG-- branch : autoroute
C#
bsd-3-clause
qt1/orchard4ibn,Anton-Am/Orchard,escofieldnaxos/Orchard,TalaveraTechnologySolutions/Orchard,LaserSrl/Orchard,salarvand/Portal,Praggie/Orchard,jchenga/Orchard,Anton-Am/Orchard,escofieldnaxos/Orchard,SouleDesigns/SouleDesigns.Orchard,emretiryaki/Orchard,dcinzona/Orchard-Harvest-Website,spraiin/Orchard,neTp9c/Orchard,armanforghani/Orchard,vard0/orchard.tan,harmony7/Orchard,fassetar/Orchard,aaronamm/Orchard,ehe888/Orchard,ericschultz/outercurve-orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,planetClaire/Orchard-LETS,qt1/Orchard,caoxk/orchard,li0803/Orchard,hhland/Orchard,TalaveraTechnologySolutions/Orchard,jtkech/Orchard,luchaoshuai/Orchard,bigfont/orchard-cms-modules-and-themes,Praggie/Orchard,phillipsj/Orchard,brownjordaninternational/OrchardCMS,SeyDutch/Airbrush,tobydodds/folklife,armanforghani/Orchard,hbulzy/Orchard,bigfont/orchard-cms-modules-and-themes,kgacova/Orchard,armanforghani/Orchard,IDeliverable/Orchard,smartnet-developers/Orchard,dcinzona/Orchard-Harvest-Website,yersans/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,tobydodds/folklife,jagraz/Orchard,hhland/Orchard,marcoaoteixeira/Orchard,yersans/Orchard,cooclsee/Orchard,sfmskywalker/Orchard,stormleoxia/Orchard,alejandroaldana/Orchard,jaraco/orchard,oxwanawxo/Orchard,sfmskywalker/Orchard,vard0/orchard.tan,emretiryaki/Orchard,andyshao/Orchard,cryogen/orchard,angelapper/Orchard,Fogolan/OrchardForWork,asabbott/chicagodevnet-website,smartnet-developers/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,vard0/orchard.tan,Serlead/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,andyshao/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,xiaobudian/Orchard,RoyalVeterinaryCollege/Orchard,angelapper/Orchard,omidnasri/Orchard,Lombiq/Orchard,AdvantageCS/Orchard,infofromca/Orchard,bedegaming-aleksej/Orchard,planetClaire/Orchard-LETS,MetSystem/Orchard,bigfont/orchard-continuous-integration-demo,AndreVolksdorf/Orchard,NIKASoftwareDevs/Orchard,hbulzy/Orchard,Serlead/Orchard,jerryshi2007/Orchard,harmony7/Orchard,asabbott/chicagodevnet-website,arminkarimi/Orchard,Morgma/valleyviewknolls,stormleoxia/Orchard,infofromca/Orchard,geertdoornbos/Orchard,qt1/orchard4ibn,mvarblow/Orchard,oxwanawxo/Orchard,rtpHarry/Orchard,jerryshi2007/Orchard,dcinzona/Orchard-Harvest-Website,Codinlab/Orchard,jaraco/orchard,bedegaming-aleksej/Orchard,Cphusion/Orchard,vairam-svs/Orchard,jtkech/Orchard,xiaobudian/Orchard,angelapper/Orchard,bedegaming-aleksej/Orchard,abhishekluv/Orchard,Sylapse/Orchard.HttpAuthSample,escofieldnaxos/Orchard,dcinzona/Orchard,neTp9c/Orchard,mgrowan/Orchard,AdvantageCS/Orchard,huoxudong125/Orchard,mgrowan/Orchard,li0803/Orchard,caoxk/orchard,Ermesx/Orchard,tobydodds/folklife,cooclsee/Orchard,geertdoornbos/Orchard,arminkarimi/Orchard,OrchardCMS/Orchard,neTp9c/Orchard,IDeliverable/Orchard,rtpHarry/Orchard,DonnotRain/Orchard,bigfont/orchard-cms-modules-and-themes,hbulzy/Orchard,marcoaoteixeira/Orchard,jchenga/Orchard,TaiAivaras/Orchard,TaiAivaras/Orchard,Anton-Am/Orchard,marcoaoteixeira/Orchard,dozoft/Orchard,omidnasri/Orchard,SzymonSel/Orchard,abhishekluv/Orchard,sebastienros/msc,dcinzona/Orchard-Harvest-Website,Dolphinsimon/Orchard,AdvantageCS/Orchard,Ermesx/Orchard,jersiovic/Orchard,enspiral-dev-academy/Orchard,austinsc/Orchard,fortunearterial/Orchard,grapto/Orchard.CloudBust,vairam-svs/Orchard,omidnasri/Orchard,alejandroaldana/Orchard,patricmutwiri/Orchard,andyshao/Orchard,emretiryaki/Orchard,stormleoxia/Orchard,li0803/Orchard,austinsc/Orchard,Sylapse/Orchard.HttpAuthSample,mgrowan/Orchard,openbizgit/Orchard,planetClaire/Orchard-LETS,harmony7/Orchard,arminkarimi/Orchard,rtpHarry/Orchard,jimasp/Orchard,SeyDutch/Airbrush,TalaveraTechnologySolutions/Orchard,geertdoornbos/Orchard,jagraz/Orchard,SouleDesigns/SouleDesigns.Orchard,johnnyqian/Orchard,jchenga/Orchard,Sylapse/Orchard.HttpAuthSample,dmitry-urenev/extended-orchard-cms-v10.1,MetSystem/Orchard,mgrowan/Orchard,Lombiq/Orchard,geertdoornbos/Orchard,hannan-azam/Orchard,yonglehou/Orchard,asabbott/chicagodevnet-website,omidnasri/Orchard,MetSystem/Orchard,bedegaming-aleksej/Orchard,AndreVolksdorf/Orchard,johnnyqian/Orchard,ericschultz/outercurve-orchard,gcsuk/Orchard,sebastienros/msc,huoxudong125/Orchard,fassetar/Orchard,planetClaire/Orchard-LETS,Fogolan/OrchardForWork,neTp9c/Orchard,jtkech/Orchard,jaraco/orchard,jersiovic/Orchard,enspiral-dev-academy/Orchard,dozoft/Orchard,grapto/Orchard.CloudBust,RoyalVeterinaryCollege/Orchard,fortunearterial/Orchard,arminkarimi/Orchard,alejandroaldana/Orchard,OrchardCMS/Orchard-Harvest-Website,dburriss/Orchard,spraiin/Orchard,TalaveraTechnologySolutions/Orchard,angelapper/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,hannan-azam/Orchard,Inner89/Orchard,dcinzona/Orchard-Harvest-Website,Serlead/Orchard,hbulzy/Orchard,mvarblow/Orchard,AndreVolksdorf/Orchard,alejandroaldana/Orchard,smartnet-developers/Orchard,dozoft/Orchard,bigfont/orchard-continuous-integration-demo,tobydodds/folklife,sfmskywalker/Orchard,Cphusion/Orchard,tobydodds/folklife,mvarblow/Orchard,abhishekluv/Orchard,grapto/Orchard.CloudBust,kouweizhong/Orchard,yonglehou/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,OrchardCMS/Orchard-Harvest-Website,dcinzona/Orchard-Harvest-Website,Ermesx/Orchard,emretiryaki/Orchard,jagraz/Orchard,spraiin/Orchard,IDeliverable/Orchard,DonnotRain/Orchard,omidnasri/Orchard,MpDzik/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,infofromca/Orchard,sfmskywalker/Orchard,salarvand/Portal,abhishekluv/Orchard,yersans/Orchard,Dolphinsimon/Orchard,fassetar/Orchard,Codinlab/Orchard,andyshao/Orchard,bigfont/orchard-continuous-integration-demo,luchaoshuai/Orchard,smartnet-developers/Orchard,salarvand/Portal,patricmutwiri/Orchard,OrchardCMS/Orchard-Harvest-Website,SzymonSel/Orchard,Codinlab/Orchard,Codinlab/Orchard,bigfont/orchard-continuous-integration-demo,Ermesx/Orchard,AdvantageCS/Orchard,KeithRaven/Orchard,openbizgit/Orchard,SzymonSel/Orchard,SouleDesigns/SouleDesigns.Orchard,kgacova/Orchard,brownjordaninternational/OrchardCMS,hhland/Orchard,abhishekluv/Orchard,Cphusion/Orchard,KeithRaven/Orchard,jersiovic/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,LaserSrl/Orchard,abhishekluv/Orchard,harmony7/Orchard,xiaobudian/Orchard,qt1/Orchard,RoyalVeterinaryCollege/Orchard,dcinzona/Orchard,phillipsj/Orchard,sfmskywalker/Orchard,Morgma/valleyviewknolls,xkproject/Orchard,enspiral-dev-academy/Orchard,xiaobudian/Orchard,AEdmunds/beautiful-springtime,NIKASoftwareDevs/Orchard,huoxudong125/Orchard,xkproject/Orchard,Dolphinsimon/Orchard,fortunearterial/Orchard,kouweizhong/Orchard,salarvand/Portal,kgacova/Orchard,harmony7/Orchard,infofromca/Orchard,Praggie/Orchard,RoyalVeterinaryCollege/Orchard,planetClaire/Orchard-LETS,li0803/Orchard,AdvantageCS/Orchard,OrchardCMS/Orchard,rtpHarry/Orchard,angelapper/Orchard,openbizgit/Orchard,ehe888/Orchard,Anton-Am/Orchard,jimasp/Orchard,jtkech/Orchard,cooclsee/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,m2cms/Orchard,NIKASoftwareDevs/Orchard,salarvand/orchard,oxwanawxo/Orchard,OrchardCMS/Orchard,Ermesx/Orchard,sebastienros/msc,RoyalVeterinaryCollege/Orchard,JRKelso/Orchard,vairam-svs/Orchard,cooclsee/Orchard,fortunearterial/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,Sylapse/Orchard.HttpAuthSample,fassetar/Orchard,patricmutwiri/Orchard,aaronamm/Orchard,patricmutwiri/Orchard,caoxk/orchard,omidnasri/Orchard,SeyDutch/Airbrush,MpDzik/Orchard,ehe888/Orchard,Lombiq/Orchard,Anton-Am/Orchard,JRKelso/Orchard,Morgma/valleyviewknolls,rtpHarry/Orchard,brownjordaninternational/OrchardCMS,jersiovic/Orchard,jagraz/Orchard,AndreVolksdorf/Orchard,grapto/Orchard.CloudBust,salarvand/orchard,kouweizhong/Orchard,SzymonSel/Orchard,austinsc/Orchard,kouweizhong/Orchard,smartnet-developers/Orchard,escofieldnaxos/Orchard,phillipsj/Orchard,bedegaming-aleksej/Orchard,mvarblow/Orchard,Fogolan/OrchardForWork,phillipsj/Orchard,TalaveraTechnologySolutions/Orchard,patricmutwiri/Orchard,dburriss/Orchard,TaiAivaras/Orchard,hhland/Orchard,omidnasri/Orchard,MetSystem/Orchard,LaserSrl/Orchard,m2cms/Orchard,cooclsee/Orchard,DonnotRain/Orchard,dozoft/Orchard,stormleoxia/Orchard,gcsuk/Orchard,TalaveraTechnologySolutions/Orchard,ericschultz/outercurve-orchard,JRKelso/Orchard,MpDzik/Orchard,brownjordaninternational/OrchardCMS,TaiAivaras/Orchard,openbizgit/Orchard,gcsuk/Orchard,Dolphinsimon/Orchard,huoxudong125/Orchard,Lombiq/Orchard,salarvand/Portal,kgacova/Orchard,oxwanawxo/Orchard,m2cms/Orchard,dcinzona/Orchard,jersiovic/Orchard,Lombiq/Orchard,Cphusion/Orchard,yonglehou/Orchard,qt1/orchard4ibn,Fogolan/OrchardForWork,huoxudong125/Orchard,yonglehou/Orchard,jerryshi2007/Orchard,salarvand/orchard,TaiAivaras/Orchard,SouleDesigns/SouleDesigns.Orchard,salarvand/orchard,yersans/Orchard,caoxk/orchard,qt1/orchard4ibn,yonglehou/Orchard,spraiin/Orchard,cryogen/orchard,xkproject/Orchard,jchenga/Orchard,KeithRaven/Orchard,SeyDutch/Airbrush,austinsc/Orchard,sfmskywalker/Orchard,phillipsj/Orchard,armanforghani/Orchard,johnnyqian/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,dozoft/Orchard,johnnyqian/Orchard,gcsuk/Orchard,jaraco/orchard,AEdmunds/beautiful-springtime,AndreVolksdorf/Orchard,ehe888/Orchard,grapto/Orchard.CloudBust,jimasp/Orchard,jtkech/Orchard,DonnotRain/Orchard,SzymonSel/Orchard,ericschultz/outercurve-orchard,bigfont/orchard-cms-modules-and-themes,aaronamm/Orchard,MpDzik/Orchard,Inner89/Orchard,spraiin/Orchard,grapto/Orchard.CloudBust,Serlead/Orchard,Codinlab/Orchard,dburriss/Orchard,enspiral-dev-academy/Orchard,Fogolan/OrchardForWork,yersans/Orchard,luchaoshuai/Orchard,DonnotRain/Orchard,dcinzona/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,mgrowan/Orchard,hbulzy/Orchard,xkproject/Orchard,OrchardCMS/Orchard,marcoaoteixeira/Orchard,vard0/orchard.tan,LaserSrl/Orchard,MetSystem/Orchard,Praggie/Orchard,TalaveraTechnologySolutions/Orchard,LaserSrl/Orchard,kouweizhong/Orchard,m2cms/Orchard,Cphusion/Orchard,SouleDesigns/SouleDesigns.Orchard,Praggie/Orchard,infofromca/Orchard,vairam-svs/Orchard,hannan-azam/Orchard,Serlead/Orchard,sfmskywalker/Orchard,salarvand/orchard,TalaveraTechnologySolutions/Orchard,arminkarimi/Orchard,OrchardCMS/Orchard-Harvest-Website,KeithRaven/Orchard,stormleoxia/Orchard,sebastienros/msc,johnnyqian/Orchard,enspiral-dev-academy/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,sebastienros/msc,KeithRaven/Orchard,jimasp/Orchard,jerryshi2007/Orchard,m2cms/Orchard,jagraz/Orchard,aaronamm/Orchard,SeyDutch/Airbrush,Inner89/Orchard,OrchardCMS/Orchard-Harvest-Website,AEdmunds/beautiful-springtime,jerryshi2007/Orchard,NIKASoftwareDevs/Orchard,MpDzik/Orchard,hhland/Orchard,oxwanawxo/Orchard,Morgma/valleyviewknolls,omidnasri/Orchard,luchaoshuai/Orchard,cryogen/orchard,neTp9c/Orchard,emretiryaki/Orchard,gcsuk/Orchard,vard0/orchard.tan,geertdoornbos/Orchard,cryogen/orchard,qt1/Orchard,MpDzik/Orchard,austinsc/Orchard,xkproject/Orchard,armanforghani/Orchard,IDeliverable/Orchard,sfmskywalker/Orchard,Sylapse/Orchard.HttpAuthSample,ehe888/Orchard,Morgma/valleyviewknolls,omidnasri/Orchard,li0803/Orchard,qt1/orchard4ibn,qt1/Orchard,fortunearterial/Orchard,JRKelso/Orchard,marcoaoteixeira/Orchard,andyshao/Orchard,dburriss/Orchard,escofieldnaxos/Orchard,dburriss/Orchard,vairam-svs/Orchard,qt1/Orchard,qt1/orchard4ibn,openbizgit/Orchard,AEdmunds/beautiful-springtime,bigfont/orchard-cms-modules-and-themes,xiaobudian/Orchard,OrchardCMS/Orchard-Harvest-Website,hannan-azam/Orchard,Dolphinsimon/Orchard,Inner89/Orchard,luchaoshuai/Orchard,NIKASoftwareDevs/Orchard,mvarblow/Orchard,brownjordaninternational/OrchardCMS,kgacova/Orchard,JRKelso/Orchard,tobydodds/folklife,Inner89/Orchard,IDeliverable/Orchard,fassetar/Orchard,aaronamm/Orchard,jimasp/Orchard,jchenga/Orchard,vard0/orchard.tan,hannan-azam/Orchard,alejandroaldana/Orchard,asabbott/chicagodevnet-website,OrchardCMS/Orchard,dcinzona/Orchard
48cf40b195efe0aaa453a158313538a338a9f6ba
src/GogoKit/Models/Response/Carrier.cs
src/GogoKit/Models/Response/Carrier.cs
using HalKit.Json; using HalKit.Models.Response; using System.Collections.Generic; using System.Runtime.Serialization; namespace GogoKit.Models.Response { /// <summary> /// A carrier (e.g. UPS) that will collect tickets that are to be delivered. /// </summary> /// <remarks>See http://developer.viagogo.net/#carrier</remarks> [DataContract(Name = "carrier")] public class Carrier { /// <summary> /// The carrier identifier. /// </summary> [DataMember(Name = "id")] public int? Id { get; set; } /// <summary> /// The name of the carrier. /// </summary> [DataMember(Name = "name")] public string Name { get; set; } /// <summary> /// The windows available for ticket collection. /// </summary> [DataMember(Name = "pickup_windows")] public IList<PickupWindow> PickupWindows { get; set; } /// <summary> /// Creates a new pickup for the ticket(s). /// </summary> /// <remarks>See http://developer.viagogo.net/#carriercreatepickup</remarks> [Rel("carrier:createpickup")] public Link CreatePickupLink { get; set; } } }
using HalKit.Json; using HalKit.Models.Response; using System.Collections.Generic; using System.Runtime.Serialization; namespace GogoKit.Models.Response { /// <summary> /// A carrier (e.g. UPS) that will collect tickets that are to be delivered. /// </summary> /// <remarks>See http://developer.viagogo.net/#carrier</remarks> [DataContract(Name = "carrier")] public class Carrier : Resource { /// <summary> /// The carrier identifier. /// </summary> [DataMember(Name = "id")] public int? Id { get; set; } /// <summary> /// The name of the carrier. /// </summary> [DataMember(Name = "name")] public string Name { get; set; } /// <summary> /// The windows available for ticket collection. /// </summary> [DataMember(Name = "pickup_windows")] public IList<PickupWindow> PickupWindows { get; set; } /// <summary> /// Creates a new pickup for the ticket(s). /// </summary> /// <remarks>See http://developer.viagogo.net/#carriercreatepickup</remarks> [Rel("carrier:createpickup")] public Link CreatePickupLink { get; set; } } }
Add missing resource base class
Add missing resource base class
C#
mit
viagogo/gogokit.net
3aaf2c6255945841c443c07bb0c80cce5604a59a
Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
using System.Collections.Generic; using Promact.Trappist.DomainModel.Models.Question; using System.Linq; using Promact.Trappist.DomainModel.DbContext; namespace Promact.Trappist.Repository.Questions { public class QuestionRepository : IQuestionRepository { private readonly TrappistDbContext _dbContext; public QuestionRepository(TrappistDbContext dbContext) { _dbContext = dbContext; } /// <summary> /// Get all questions /// </summary> /// <returns>Question list</returns> public List<SingleMultipleAnswerQuestion> GetAllQuestions() { var questions = _dbContext.SingleMultipleAnswerQuestion.ToList(); return questions; } /// <summary> /// Add single multiple answer question into SingleMultipleAnswerQuestion model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion) { _dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion); _dbContext.SaveChanges(); } /// <summary> /// Add option of single multiple answer question into SingleMultipleAnswerQuestionOption model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> public void AddSingleMultipleAnswerQuestionOption(SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption) { _dbContext.SingleMultipleAnswerQuestionOption.Add(singleMultipleAnswerQuestionOption); _dbContext.SaveChanges(); } } }
using System.Collections.Generic; using Promact.Trappist.DomainModel.Models.Question; using System.Linq; using Promact.Trappist.DomainModel.DbContext; namespace Promact.Trappist.Repository.Questions { public class QuestionRepository : IQuestionRepository { private readonly TrappistDbContext _dbContext; public QuestionRepository(TrappistDbContext dbContext) { _dbContext = dbContext; } /// <summary> /// Get all questions /// </summary> /// <returns>Question list</returns> public List<SingleMultipleAnswerQuestion> GetAllQuestions() { var question = _dbContext.SingleMultipleAnswerQuestion.ToList(); return question; } /// <summary> /// Add single multiple answer question into SingleMultipleAnswerQuestion model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion) { _dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion); _dbContext.SaveChanges(); } /// <summary> /// Add option of single multiple answer question into SingleMultipleAnswerQuestionOption model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> public void AddSingleMultipleAnswerQuestionOption(SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption) { _dbContext.SingleMultipleAnswerQuestionOption.Add(singleMultipleAnswerQuestionOption); _dbContext.SaveChanges(); } } }
Create server side API for single multiple answer question
Create server side API for single multiple answer question
C#
mit
Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist
6915fe85ef7676da171bfad173cffc4aded426af
Line.Messaging/Messages/RichMenu/ResponseRichMenu.cs
Line.Messaging/Messages/RichMenu/ResponseRichMenu.cs
namespace Line.Messaging { /// <summary> /// Rich menu response object. /// https://developers.line.me/en/docs/messaging-api/reference/#rich-menu-response-object /// </summary> public class ResponseRichMenu : RichMenu { /// <summary> /// Rich menu ID /// </summary> public string RichMenuId { get; set; } /// <summary> /// Constructor /// </summary> /// <param name="richMenuId"> /// Rich menu ID /// </param> /// <param name="source"> /// Rich menu object /// </param> public ResponseRichMenu(string richMenuId, RichMenu source) { RichMenuId = richMenuId; Size = source.Size; Selected = source.Selected; Name = source.Name; ChatBarText = source.ChatBarText; Areas = source.Areas; } internal static ResponseRichMenu CreateFrom(dynamic dynamicObject) { var menu = new RichMenu() { Name = (string)dynamicObject?.name, Size = new ImagemapSize((int)(dynamicObject?.size?.width ?? 0), (int)(dynamicObject?.size?.height ?? 0)), Selected = (bool)(dynamicObject?.selected ?? false), ChatBarText = (string)dynamicObject?.chatBarText }; return new ResponseRichMenu((string)dynamicObject?.richMenuId, menu); } } }
namespace Line.Messaging { /// <summary> /// Rich menu response object. /// https://developers.line.me/en/docs/messaging-api/reference/#rich-menu-response-object /// </summary> public class ResponseRichMenu : RichMenu { /// <summary> /// Rich menu ID /// </summary> public string RichMenuId { get; set; } /// <summary> /// Constructor /// </summary> /// <param name="richMenuId"> /// Rich menu ID /// </param> /// <param name="source"> /// Rich menu object /// </param> public ResponseRichMenu(string richMenuId, RichMenu source) { RichMenuId = richMenuId; Size = source.Size; Selected = source.Selected; Name = source.Name; ChatBarText = source.ChatBarText; Areas = source.Areas; } internal static ResponseRichMenu CreateFrom(dynamic dynamicObject) { var menu = new RichMenu() { Name = (string)dynamicObject?.name, Size = new ImagemapSize((int)(dynamicObject?.size?.width ?? 0), (int)(dynamicObject?.size?.height ?? 0)), Selected = (bool)(dynamicObject?.selected ?? false), ChatBarText = (string)dynamicObject?.chatBarText, Areas = ActionArea.CreateFrom(dynamicObject?.areas) }; return new ResponseRichMenu((string)dynamicObject?.richMenuId, menu); } } }
Fix Areas property is not deserialized, In the return value of the GetRichMenuListAsync method.
Fix Areas property is not deserialized, In the return value of the GetRichMenuListAsync method.
C#
mit
pierre3/LineMessagingApi,pierre3/LineMessagingApi
a86ebccf5c478c5d76d3e4e3385e0f68f22f4903
Staxel.Trace/TraceScope.cs
Staxel.Trace/TraceScope.cs
using System; namespace Staxel.Trace { public struct TraceScope : IDisposable { public TraceKey Key; public TraceScope(TraceKey key) { Key = key; TraceRecorder.Enter(Key); } public void Dispose() { TraceRecorder.Leave(Key); } } }
using System; using System.Diagnostics; using System.Runtime; using System.Runtime.CompilerServices; namespace Staxel.Trace { public struct TraceScope : IDisposable { public TraceKey Key; [TargetedPatchingOptOut("")] [MethodImpl(MethodImplOptions.AggressiveInlining)] public TraceScope(TraceKey key) { Key = key; TraceRecorder.Enter(Key); } [Conditional("TRACE")] [TargetedPatchingOptOut("")] [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Dispose() { TraceRecorder.Leave(Key); } } }
Patch out the Tracescope for as far as possible when applicable.
Patch out the Tracescope for as far as possible when applicable.
C#
unlicense
bartwe/StaxelTraceViewer
e7c86dc7c535e2e99d313e104a24eee64151c2d4
osu.Framework.Tests/Visual/Containers/TestSceneEnumerator.cs
osu.Framework.Tests/Visual/Containers/TestSceneEnumerator.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. #nullable disable using System; using NUnit.Framework; using osu.Framework.Graphics.Containers; namespace osu.Framework.Tests.Visual.Containers { public class TestSceneEnumerator : FrameworkTestScene { private Container parent; [Test] public void TestAddChildDuringEnumerationFails() { AddStep("create hierarchy", () => Child = parent = new Container { Child = new Container { } }); AddStep("iterate through parent doing nothing", () => Assert.DoesNotThrow(() => { foreach (var child in parent) { } })); AddStep("adding child during enumeration fails", () => Assert.Throws<InvalidOperationException>(() => { foreach (var child in parent) { parent.Add(new Container()); } })); } [Test] public void TestRemoveChildDuringEnumerationFails() { AddStep("create hierarchy", () => Child = parent = new Container { Child = new Container { } }); AddStep("iterate through parent doing nothing", () => Assert.DoesNotThrow(() => { foreach (var child in parent) { } })); AddStep("removing child during enumeration fails", () => Assert.Throws<InvalidOperationException>(() => { foreach (var child in parent) { parent.Remove(child, true); } })); } } }
// 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. #nullable disable using System; using NUnit.Framework; using osu.Framework.Graphics.Containers; namespace osu.Framework.Tests.Visual.Containers { public class TestSceneEnumerator : FrameworkTestScene { private Container parent; [SetUp] public void SetUp() { Child = parent = new Container { Child = new Container { } }; } [Test] public void TestEnumeratingNormally() { AddStep("iterate through parent doing nothing", () => Assert.DoesNotThrow(() => { foreach (var child in parent) { } })); } [Test] public void TestAddChildDuringEnumerationFails() { AddStep("adding child during enumeration fails", () => Assert.Throws<InvalidOperationException>(() => { foreach (var child in parent) { parent.Add(new Container()); } })); } [Test] public void TestRemoveChildDuringEnumerationFails() { AddStep("removing child during enumeration fails", () => Assert.Throws<InvalidOperationException>(() => { foreach (var child in parent) { parent.Remove(child, true); } })); } [Test] public void TestClearDuringEnumerationFails() { AddStep("clearing children during enumeration fails", () => Assert.Throws<InvalidOperationException>(() => { foreach (var child in parent) { parent.Clear(); } })); } } }
Use SetUp for tests, add test for clearing children
Use SetUp for tests, add test for clearing children
C#
mit
ppy/osu-framework,peppy/osu-framework,peppy/osu-framework,ppy/osu-framework,peppy/osu-framework,ppy/osu-framework
58c2736361674eb4752394b3694cee344ac1e6df
NitroNet.ViewEngine.TemplateHandler/ComponentHelperHandler.cs
NitroNet.ViewEngine.TemplateHandler/ComponentHelperHandler.cs
using System; using System.Collections.Generic; using System.Linq; using Veil; using Veil.Helper; namespace NitroNet.ViewEngine.TemplateHandler { internal class ComponentHelperHandler : IHelperHandler { private readonly INitroTemplateHandler _handler; public ComponentHelperHandler(INitroTemplateHandler handler) { _handler = handler; } public bool IsSupported(string name) { return name.StartsWith("component", StringComparison.OrdinalIgnoreCase); } public void Evaluate(object model, RenderingContext context, IDictionary<string, string> parameters) { RenderingParameter template; var firstParameter = parameters.FirstOrDefault(); if (string.IsNullOrEmpty(firstParameter.Value)) { template = new RenderingParameter("name") { Value = firstParameter.Key.Trim('"', '\'') }; } else { template = CreateRenderingParameter("name", parameters); } var skin = CreateRenderingParameter("template", parameters); var dataVariation = CreateRenderingParameter("data", parameters); _handler.RenderComponent(template, skin, dataVariation, model, context); } private RenderingParameter CreateRenderingParameter(string name, IDictionary<string, string> parameters) { var renderingParameter = new RenderingParameter(name); if (parameters.ContainsKey(renderingParameter.Name)) { var value = parameters[renderingParameter.Name]; if (!value.StartsWith("\"") && !value.StartsWith("'")) { renderingParameter.IsDynamic = true; } renderingParameter.Value = value.Trim('"', '\''); } return renderingParameter; } } }
using System; using System.Collections.Generic; using System.Linq; using Veil; using Veil.Helper; namespace NitroNet.ViewEngine.TemplateHandler { internal class ComponentHelperHandler : IHelperHandler { private readonly INitroTemplateHandler _handler; public ComponentHelperHandler(INitroTemplateHandler handler) { _handler = handler; } public bool IsSupported(string name) { return name.StartsWith("component", StringComparison.OrdinalIgnoreCase) || name.StartsWith("pattern", StringComparison.OrdinalIgnoreCase); } public void Evaluate(object model, RenderingContext context, IDictionary<string, string> parameters) { RenderingParameter template; var firstParameter = parameters.FirstOrDefault(); if (string.IsNullOrEmpty(firstParameter.Value)) { template = new RenderingParameter("name") { Value = firstParameter.Key.Trim('"', '\'') }; } else { template = CreateRenderingParameter("name", parameters); } var skin = CreateRenderingParameter("template", parameters); var dataVariation = CreateRenderingParameter("data", parameters); _handler.RenderComponent(template, skin, dataVariation, model, context); } private RenderingParameter CreateRenderingParameter(string name, IDictionary<string, string> parameters) { var renderingParameter = new RenderingParameter(name); if (parameters.ContainsKey(renderingParameter.Name)) { var value = parameters[renderingParameter.Name]; if (!value.StartsWith("\"") && !value.StartsWith("'")) { renderingParameter.IsDynamic = true; } renderingParameter.Value = value.Trim('"', '\''); } return renderingParameter; } } }
Enable pattern helper as equivalent of component helper
Enable pattern helper as equivalent of component helper
C#
mit
namics/NitroNet,namics/NitroNet
e53f897b9b59b5e05d08c071f8ab8ec18dd8330b
NHibernate.Sessions.Operations/AbstractCachedDatabaseQuery.cs
NHibernate.Sessions.Operations/AbstractCachedDatabaseQuery.cs
using System; namespace NHibernate.Sessions.Operations { public abstract class AbstractCachedDatabaseQuery<T> : DatabaseOperation { protected abstract void ConfigureCache(CacheConfig cacheConfig); protected abstract T QueryDatabase(ISessionManager sessionManager); public virtual string CacheKeyPrefix { get { return GetType().FullName; } } protected T GetDatabaseResult(ISessionManager sessionManager, IDatabaseQueryCache databaseQueryCache = null) { var cacheConfig = CacheConfig.None; ConfigureCache(cacheConfig); if (databaseQueryCache == null || cacheConfig.AbsoluteDuration == TimeSpan.Zero) return QueryDatabase(sessionManager); return databaseQueryCache.Get(() => QueryDatabase(sessionManager), cacheConfig.BuildCacheKey(CacheKeyPrefix), cacheConfig.AbsoluteDuration, cacheConfig.CacheNulls); } } }
using System; namespace NHibernate.Sessions.Operations { public abstract class AbstractCachedDatabaseQuery<T> : DatabaseOperation { protected abstract void ConfigureCache(CacheConfig cacheConfig); protected abstract T QueryDatabase(ISessionManager sessionManager); protected virtual string CacheKeyPrefix { get { return GetType().FullName; } } protected T GetDatabaseResult(ISessionManager sessionManager, IDatabaseQueryCache databaseQueryCache = null) { var cacheConfig = CacheConfig.None; ConfigureCache(cacheConfig); if (databaseQueryCache == null || cacheConfig.AbsoluteDuration == TimeSpan.Zero) return QueryDatabase(sessionManager); return databaseQueryCache.Get(() => QueryDatabase(sessionManager), cacheConfig.BuildCacheKey(CacheKeyPrefix), cacheConfig.AbsoluteDuration, cacheConfig.CacheNulls); } } }
Make the CackeKeyPrefix protected instead of Public
Make the CackeKeyPrefix protected instead of Public
C#
mit
shaynevanasperen/NHibernate.Sessions.Operations
a5611da9485b474c4ea5552b34fe26bc86e7423c
Snowflake.API/Core/EventDelegate/JsonRPCEventDelegate.cs
Snowflake.API/Core/EventDelegate/JsonRPCEventDelegate.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Collections.Specialized; using Newtonsoft.Json; using System.IO; namespace Snowflake.Core.EventDelegate { public class JsonRPCEventDelegate { private string RPCUrl; public JsonRPCEventDelegate(int port) { this.RPCUrl = "http://localhost:" + port.ToString() + @"/"; } public void Notify(string eventName, dynamic eventData) { WebRequest request = WebRequest.Create (this.RPCUrl); request.ContentType = "application/json-rpc"; request.Method = "POST"; var values = new Dictionary<string, dynamic>(){ {"method", "notify"}, {"params", JsonConvert.SerializeObject(eventData)}, {"id", "null"} }; var data = JsonConvert.SerializeObject(values); byte[] byteArray = Encoding.UTF8.GetBytes(data); request.ContentLength = byteArray.Length; Stream dataStream = request.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Flush(); dataStream.Close(); WebResponse response = request.GetResponse(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Collections.Specialized; using Newtonsoft.Json; using System.IO; namespace Snowflake.Core.EventDelegate { public class JsonRPCEventDelegate { private string RPCUrl; public JsonRPCEventDelegate(int port) { this.RPCUrl = "http://localhost:" + port.ToString() + @"/"; } public WebResponse InvokeMethod(string method, string methodParams, string id) { WebRequest request = WebRequest.Create(this.RPCUrl); request.ContentType = "application/json-rpc"; request.Method = "POST"; var values = new Dictionary<string, dynamic>(){ {"method", method}, {"params", methodParams}, {"id", id} }; var data = JsonConvert.SerializeObject(values); byte[] byteArray = Encoding.UTF8.GetBytes(data); request.ContentLength = byteArray.Length; Stream dataStream = request.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Flush(); dataStream.Close(); return request.GetResponse(); } public void Notify(string eventName, dynamic eventData) { var response = this.InvokeMethod( "notify", JsonConvert.SerializeObject( new Dictionary<string, dynamic>(){ {"eventData", eventData}, {"eventName", eventName} }), "null" ); } } }
Create generic invoke method for RPC
Create generic invoke method for RPC
C#
mpl-2.0
faint32/snowflake-1,RonnChyran/snowflake,RonnChyran/snowflake,faint32/snowflake-1,SnowflakePowered/snowflake,SnowflakePowered/snowflake,RonnChyran/snowflake,faint32/snowflake-1,SnowflakePowered/snowflake
d14711290d7a6f32dc40332b888502717bacda40
Postolego/PostolegoMapper.cs
Postolego/PostolegoMapper.cs
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; using System.Threading.Tasks; using System.Windows.Navigation; namespace Postolego { public class PostolegoMapper : UriMapperBase { public override Uri MapUri(Uri uri) { var tempUri = HttpUtility.UrlDecode(uri.ToString()); if(tempUri.Contains("postolego:")) { if(tempUri.Contains("authorize")) { return new Uri("/Pages/SignInPage.xaml", UriKind.Relative); } else { return uri; } } else { if((App.Current.Resources["PostolegoData"] as PostolegoData).PocketSession == null || !(App.Current.Resources["PostolegoData"] as PostolegoData).PocketSession.IsAuthenticated) { return new Uri("/Pages/SignInPage.xaml", UriKind.Relative); } else { return uri; } } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; using System.Threading.Tasks; using System.Windows.Navigation; namespace Postolego { public class PostolegoMapper : UriMapperBase { public override Uri MapUri(Uri uri) { var tempUri = HttpUtility.UrlDecode(uri.ToString()); if(tempUri.Contains("postolego:")) { if(tempUri.Contains("authorize")) { return new Uri("/Pages/SignInPage.xaml", UriKind.Relative); } } if((App.Current.Resources["PostolegoData"] as PostolegoData).PocketSession == null || !(App.Current.Resources["PostolegoData"] as PostolegoData).PocketSession.IsAuthenticated) { return new Uri("/Pages/SignInPage.xaml", UriKind.Relative); } else { return uri; } } } }
Fix uri mapper return invalid uri
Fix uri mapper return invalid uri
C#
mit
jonstodle/Postolego
64b7f6ba3c5fe153bf90dcbc747fd99f1109fc11
ConsoleApps/Repack/Repack/Program.cs
ConsoleApps/Repack/Repack/Program.cs
using System; using Humanizer; namespace Repack { internal class Program { public static void Main(string[] args) { Console.WriteLine("Usage: repack [date]"); Console.WriteLine("Prints how long it is until your birthday."); Console.WriteLine("If you don't supply your birthday, it uses mine."); DateTime birthDay = GetBirthday(args); Console.WriteLine(); var span = GetSpan(birthDay); Console.WriteLine("{0} until your birthday", span.Humanize()); } private static TimeSpan GetSpan(DateTime birthDay) { var span = birthDay - DateTime.Now; if (span.Days < 0) { // If the supplied birthday has already happened, then find the next one that will occur. int years = span.Days / -365; span = span.Add(TimeSpan.FromDays((years + 1) * 365)); } return span; } private static DateTime GetBirthday(string[] args) { string day = null; if (args != null && args.Length > 0) { day = args[0]; } return GetBirthday(day); } private static DateTime GetBirthday(string day) { DateTime parsed; if (DateTime.TryParse(day, out parsed)) { return parsed; } else { return new DateTime(DateTime.Now.Year, 8, 20); } } } }
using System; using Humanizer; namespace Repack { internal class Program { public static void Main(string[] args) { Console.WriteLine("Usage: repack [date]"); Console.WriteLine("Prints how long it is until your birthday."); Console.WriteLine("If you don't supply your birthday, it uses mine."); DateTime birthDay = GetBirthday(args); Console.WriteLine(); var span = GetSpan(birthDay); Console.WriteLine("{0} until your birthday", span.Humanize()); } private static TimeSpan GetSpan(DateTime birthDay) { var span = birthDay.Date - DateTime.Now.Date; if (span.Days < 0) { // If the supplied birthday has already happened, then find the next one that will occur. int years = span.Days / -365; if (span.Days % 365 != 0) years++; span = span.Add(TimeSpan.FromDays(years * 365)); } return span; } private static DateTime GetBirthday(string[] args) { string day = null; if (args != null && args.Length > 0) { day = args[0]; } return GetBirthday(day); } private static DateTime GetBirthday(string day) { DateTime parsed; if (DateTime.TryParse(day, out parsed)) { return parsed; } else { return new DateTime(DateTime.Now.Year, 8, 20); } } } }
Make sure date processing is accurate
Make sure date processing is accurate
C#
mit
jquintus/spikes,jquintus/spikes,jquintus/spikes,jquintus/spikes
aab810f233c6211b4106f8bc06c018a31827cff8
src/Tests/MyCouch.IntegrationTests/TestClientFactory.cs
src/Tests/MyCouch.IntegrationTests/TestClientFactory.cs
namespace MyCouch.IntegrationTests { internal static class TestClientFactory { internal static IClient CreateDefault() { return new Client("http://mycouchtester:1q2w3e4r@localhost:5984/" + TestConstants.TestDbName); } } }
using System; namespace MyCouch.IntegrationTests { internal static class TestClientFactory { internal static IClient CreateDefault() { return new Client("http://mycouchtester:" + Uri.EscapeDataString("p@ssword") + "@localhost:5984/" + TestConstants.TestDbName); } } }
Use at least a password that has char that needs to be encoded so that that is tested.
Use at least a password that has char that needs to be encoded so that that is tested.
C#
mit
danielwertheim/mycouch,danielwertheim/mycouch
60a1fbaf175e88090b6d30a7f0a1cac9d31bc0c6
src/CommonAssemblyInfo.cs
src/CommonAssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Yevgeniy Shunevych")] [assembly: AssemblyProduct("Atata Framework")] [assembly: AssemblyCopyright("Copyright © Yevgeniy Shunevych 2017")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: AssemblyVersion("0.14.0")] [assembly: AssemblyFileVersion("0.14.0")]
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Yevgeniy Shunevych")] [assembly: AssemblyProduct("Atata Framework")] [assembly: AssemblyCopyright("Copyright © Yevgeniy Shunevych 2017")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: AssemblyVersion("0.15.0")] [assembly: AssemblyFileVersion("0.15.0")]
Increase project version to 0.15.0
Increase project version to 0.15.0
C#
apache-2.0
atata-framework/atata-sample-app-tests
1e0be9a25eab735883b52d424875bb976bd2ef8d
Sample/SilverScreen/Domain/Cinema.cs
Sample/SilverScreen/Domain/Cinema.cs
using System.Collections.Generic; using Argentum.Core; namespace SilverScreen.Domain { public class Cinema : AggregateBase<CinemaState> { public Cinema(CinemaState state) : base(state) { } private Cinema(string name) { Apply(new CinemaAdded(name)); } public static Cinema Add(string name) { return new Cinema(name); } } public class CinemaState : State { public string Name { get; set; } public List<Screen> Screens { get; set; } public void When(CinemaAdded evt) { Name = evt.Name; } } public class CinemaAdded : IEvent { public string Name { get; private set; } public CinemaAdded(string name) { Name = name; } } }
using System; using System.Collections.Generic; using Argentum.Core; namespace SilverScreen.Domain { public class Cinema : AggregateBase<CinemaState> { public Cinema(CinemaState state) : base(state) { } private Cinema(Guid id, string name) { Apply(new CinemaAdded(id, name)); } public static Cinema Add(string name) { return new Cinema(Guid.NewGuid(), name); } } public class CinemaState : State { public string Name { get; set; } public List<Screen> Screens { get; set; } public void When(CinemaAdded evt) { Id = evt.Id; Name = evt.Name; } } public class CinemaAdded : IEvent { public Guid Id { get; private set; } public string Name { get; private set; } public CinemaAdded(Guid id, string name) { Id = id; Name = name; } } }
Set id when adding new cinema
Set id when adding new cinema
C#
mit
jenspettersson/Argentum
4d52e5a4064356d2d5f5d626017c79e88219f196
SignalR.AspNet/AspNetHost.cs
SignalR.AspNet/AspNetHost.cs
using System; using System.Linq; using System.Threading.Tasks; using System.Web; using SignalR.Abstractions; namespace SignalR.AspNet { public class AspNetHost : HttpTaskAsyncHandler { private readonly PersistentConnection _connection; private static readonly Lazy<bool> _hasAcceptWebSocketRequest = new Lazy<bool>(() => { return typeof(HttpContextBase).GetMethods().Any(m => m.Name.Equals("AcceptWebSocketRequest", StringComparison.OrdinalIgnoreCase)); }); public AspNetHost(PersistentConnection connection) { _connection = connection; } public override Task ProcessRequestAsync(HttpContextBase context) { var request = new AspNetRequest(context.Request); var response = new AspNetResponse(context.Request, context.Response); var hostContext = new HostContext(request, response, context.User); // Determine if the client should bother to try a websocket request hostContext.Items["supportsWebSockets"] = _hasAcceptWebSocketRequest.Value; // Set the debugging flag hostContext.Items["debugMode"] = context.IsDebuggingEnabled; // Stick the context in here so transports or other asp.net specific logic can // grab at it. hostContext.Items["aspnet.context"] = context; return _connection.ProcessRequestAsync(hostContext); } } }
using System; using System.Linq; using System.Threading.Tasks; using System.Web; using SignalR.Abstractions; namespace SignalR.AspNet { public class AspNetHost : HttpTaskAsyncHandler { private readonly PersistentConnection _connection; private static readonly Lazy<bool> _hasAcceptWebSocketRequest = new Lazy<bool>(() => { return typeof(HttpContextBase).GetMethods().Any(m => m.Name.Equals("AcceptWebSocketRequest", StringComparison.OrdinalIgnoreCase)); }); public AspNetHost(PersistentConnection connection) { _connection = connection; } public override Task ProcessRequestAsync(HttpContextBase context) { var request = new AspNetRequest(context.Request); var response = new AspNetResponse(context.Request, context.Response); var hostContext = new HostContext(request, response, context.User); // Determine if the client should bother to try a websocket request hostContext.Items["supportsWebSockets"] = _hasAcceptWebSocketRequest.Value; // Set the debugging flag hostContext.Items["debugMode"] = context.IsDebuggingEnabled; // Stick the context in here so transports or other asp.net specific logic can // grab at it. hostContext.Items["aspnet.HttpContext"] = context; return _connection.ProcessRequestAsync(hostContext); } } }
Change HttpContext variable to aspnet.HttpContext.
Change HttpContext variable to aspnet.HttpContext.
C#
mit
shiftkey/SignalR,shiftkey/SignalR
e193f8214df514f770d3bcad9ef41ce053255ed8
osu.Game/Online/RealtimeMultiplayer/ISpectatorServer.cs
osu.Game/Online/RealtimeMultiplayer/ISpectatorServer.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.Threading.Tasks; namespace osu.Game.Online.RealtimeMultiplayer { /// <summary> /// An interface defining the spectator server instance. /// </summary> public interface IMultiplayerServer { /// <summary> /// Request to join a multiplayer room. /// </summary> /// <param name="roomId">The databased room ID.</param> /// <returns>Whether the room could be joined.</returns> Task<bool> JoinRoom(long roomId); /// <summary> /// Request to leave the currently joined room. /// </summary> /// <param name="roomId">The databased room ID.</param> Task LeaveRoom(long roomId); } }
// 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.Threading.Tasks; namespace osu.Game.Online.RealtimeMultiplayer { /// <summary> /// An interface defining the spectator server instance. /// </summary> public interface IMultiplayerServer { /// <summary> /// Request to join a multiplayer room. /// </summary> /// <param name="roomId">The databased room ID.</param> /// <returns>Whether the room could be joined.</returns> Task<bool> JoinRoom(long roomId); /// <summary> /// Request to leave the currently joined room. /// </summary> Task LeaveRoom(); } }
Remove unnecessary room id from leave room request
Remove unnecessary room id from leave room request
C#
mit
smoogipooo/osu,smoogipoo/osu,peppy/osu,smoogipoo/osu,UselessToucan/osu,NeoAdonis/osu,NeoAdonis/osu,peppy/osu-new,ppy/osu,UselessToucan/osu,ppy/osu,ppy/osu,NeoAdonis/osu,peppy/osu,smoogipoo/osu,UselessToucan/osu,peppy/osu
02188fe727e632855e1804960c65995076e01366
lib/build.cake
lib/build.cake
############################################################################### # Copyright Lewis Baker # Licenced under MIT license. See LICENSE.txt for details. ############################################################################### import cake.path from cake.tools import compiler, script, env, project includes = cake.path.join(env.expand('${CPPCORO}'), 'include', 'cppcoro', [ 'broken_promise.hpp', 'task.hpp', 'single_consumer_event.hpp', ]) sources = script.cwd([ 'async_mutex.cpp', ]) extras = script.cwd([ 'build.cake', 'use.cake', ]) buildDir = env.expand('${CPPCORO_BUILD}') compiler.addIncludePath(env.expand('${CPPCORO}/include')) objects = compiler.objects( targetDir=env.expand('${CPPCORO_BUILD}/obj'), sources=sources, ) lib = compiler.library( target=env.expand('${CPPCORO_LIB}/cppcoro'), sources=objects, ) vcproj = project.project( target=env.expand('${CPPCORO_PROJECT}/cppcoro'), items={ 'Include': includes, 'Source': sources, '': extras }, output=lib, ) script.setResult( project=vcproj, library=lib, )
############################################################################### # Copyright Lewis Baker # Licenced under MIT license. See LICENSE.txt for details. ############################################################################### import cake.path from cake.tools import compiler, script, env, project includes = cake.path.join(env.expand('${CPPCORO}'), 'include', 'cppcoro', [ 'async_mutex.hpp', 'broken_promise.hpp', 'lazy_task.hpp', 'single_consumer_event.hpp', 'task.hpp', ]) sources = script.cwd([ 'async_mutex.cpp', ]) extras = script.cwd([ 'build.cake', 'use.cake', ]) buildDir = env.expand('${CPPCORO_BUILD}') compiler.addIncludePath(env.expand('${CPPCORO}/include')) objects = compiler.objects( targetDir=env.expand('${CPPCORO_BUILD}/obj'), sources=sources, ) lib = compiler.library( target=env.expand('${CPPCORO_LIB}/cppcoro'), sources=objects, ) vcproj = project.project( target=env.expand('${CPPCORO_PROJECT}/cppcoro'), items={ 'Include': includes, 'Source': sources, '': extras }, output=lib, ) script.setResult( project=vcproj, library=lib, )
Add some missing headers to generated .vcproj file.
Add some missing headers to generated .vcproj file.
C#
mit
lewissbaker/cppcoro,lewissbaker/cppcoro,lewissbaker/cppcoro,lewissbaker/cppcoro
ad5bd1f0c00ae10c0c857759e38b1f588d2f4b45
osu.Game/Overlays/BeatmapListing/SearchLanguage.cs
osu.Game/Overlays/BeatmapListing/SearchLanguage.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.Game.Utils; namespace osu.Game.Overlays.BeatmapListing { [HasOrderedElements] public enum SearchLanguage { [Order(0)] Any, [Order(13)] Other, [Order(1)] English, [Order(6)] Japanese, [Order(2)] Chinese, [Order(12)] Instrumental, [Order(7)] Korean, [Order(3)] French, [Order(4)] German, [Order(9)] Swedish, [Order(8)] Spanish, [Order(5)] Italian, [Order(10)] Russian, [Order(11)] Polish, [Order(14)] Unspecified } }
// 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.Game.Utils; namespace osu.Game.Overlays.BeatmapListing { [HasOrderedElements] public enum SearchLanguage { [Order(0)] Any, [Order(14)] Unspecified, [Order(1)] English, [Order(6)] Japanese, [Order(2)] Chinese, [Order(12)] Instrumental, [Order(7)] Korean, [Order(3)] French, [Order(4)] German, [Order(9)] Swedish, [Order(8)] Spanish, [Order(5)] Italian, [Order(10)] Russian, [Order(11)] Polish, [Order(13)] Other } }
Update in line with other/unspecified switch
Update in line with other/unspecified switch See https://github.com/ppy/osu-web/commit/289f0f0a209f1f840270db07794a7bfd52439db1.
C#
mit
peppy/osu,UselessToucan/osu,UselessToucan/osu,smoogipoo/osu,peppy/osu-new,smoogipoo/osu,ppy/osu,NeoAdonis/osu,UselessToucan/osu,NeoAdonis/osu,smoogipooo/osu,NeoAdonis/osu,peppy/osu,ppy/osu,ppy/osu,peppy/osu,smoogipoo/osu
3b13ad480af5afa7f0fe15c300a5e02bcf0fb4d7
osu.Game.Rulesets.Osu/Edit/DrawableOsuEditRuleset.cs
osu.Game.Rulesets.Osu/Edit/DrawableOsuEditRuleset.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.Game.Beatmaps; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu.UI; using osu.Game.Rulesets.UI; using osuTK; namespace osu.Game.Rulesets.Osu.Edit { public class DrawableOsuEditRuleset : DrawableOsuRuleset { public DrawableOsuEditRuleset(Ruleset ruleset, IWorkingBeatmap beatmap, IReadOnlyList<Mod> mods) : base(ruleset, beatmap, mods) { } protected override Playfield CreatePlayfield() => new OsuPlayfieldNoCursor(); public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new OsuPlayfieldAdjustmentContainer { Size = Vector2.One }; private class OsuPlayfieldNoCursor : OsuPlayfield { protected override GameplayCursorContainer CreateCursor() => null; } } }
// 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 System.Linq; using osu.Framework.Graphics; using osu.Game.Beatmaps; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.UI; using osu.Game.Rulesets.UI; using osuTK; namespace osu.Game.Rulesets.Osu.Edit { public class DrawableOsuEditRuleset : DrawableOsuRuleset { public DrawableOsuEditRuleset(Ruleset ruleset, IWorkingBeatmap beatmap, IReadOnlyList<Mod> mods) : base(ruleset, beatmap, mods) { } public override DrawableHitObject<OsuHitObject> CreateDrawableRepresentation(OsuHitObject h) => base.CreateDrawableRepresentation(h)?.With(d => d.ApplyCustomUpdateState += updateState); private void updateState(DrawableHitObject hitObject, ArmedState state) { switch (state) { case ArmedState.Miss: // Get the existing fade out transform var existing = hitObject.Transforms.LastOrDefault(t => t.TargetMember == nameof(Alpha)); if (existing == null) return; using (hitObject.BeginAbsoluteSequence(existing.StartTime)) hitObject.FadeOut(500).Expire(); break; } } protected override Playfield CreatePlayfield() => new OsuPlayfieldNoCursor(); public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new OsuPlayfieldAdjustmentContainer { Size = Vector2.One }; private class OsuPlayfieldNoCursor : OsuPlayfield { protected override GameplayCursorContainer CreateCursor() => null; } } }
Increase fade-out time of hitobjects in the editor
Increase fade-out time of hitobjects in the editor
C#
mit
EVAST9919/osu,peppy/osu,2yangk23/osu,NeoAdonis/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu,UselessToucan/osu,smoogipoo/osu,johnneijzen/osu,ppy/osu,UselessToucan/osu,ppy/osu,peppy/osu,smoogipooo/osu,NeoAdonis/osu,smoogipoo/osu,johnneijzen/osu,ppy/osu,UselessToucan/osu,EVAST9919/osu,2yangk23/osu,peppy/osu-new
7edf87619cd9342dcce2ee3d6ee34bb858c58018
ecologylabSemantics/ecologylab/semantics/metadata/scalar/MetadataScalars.cs
ecologylabSemantics/ecologylab/semantics/metadata/scalar/MetadataScalars.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ecologylab.semantics.metadata.scalar { abstract public class MetadataScalarBase<T> { public T value; public static String VALUE_FIELD_NAME = "value"; public MetadataScalarBase() { } public MetadataScalarBase(object value) { this.value = (T) value; } public object Value { get { return value; } set { this.value = (T)value; } } public override String ToString() { return value == null ? "null" : value.ToString(); } } public class MetadataString : MetadataScalarBase<String> { public MetadataString(){} //The termvector stuff goes here ! /// <summary> /// /// </summary> /// <param name="value"></param> public MetadataString(object value):base(value) {} } public class MetadataInteger : MetadataScalarBase<int> { public MetadataInteger(){} public MetadataInteger(object value):base(value) {} } public class MetadataParsedURL : MetadataScalarBase<Uri> { public MetadataParsedURL(){} public MetadataParsedURL(object value):base(value) {} } public class MetadataDate : MetadataScalarBase<DateTime> { public MetadataDate(){} public MetadataDate(object value):base(value) {} } public class MetadataStringBuilder : MetadataScalarBase<StringBuilder> { public MetadataStringBuilder(){} public MetadataStringBuilder(object value):base(value) {} } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ecologylab.semantics.metadata.scalar { abstract public class MetadataScalarBase<T> { public T value; public static String VALUE_FIELD_NAME = "value"; public MetadataScalarBase() { } public MetadataScalarBase(object value) { this.value = (T) value; } public T Value { get { return value; } set { this.value = (T)value; } } public override String ToString() { return value == null ? "null" : value.ToString(); } } public class MetadataString : MetadataScalarBase<String> { public MetadataString(){} //The termvector stuff goes here ! /// <summary> /// /// </summary> /// <param name="value"></param> public MetadataString(object value):base(value) {} } public class MetadataInteger : MetadataScalarBase<int> { public MetadataInteger(){} public MetadataInteger(object value):base(value) {} } public class MetadataParsedURL : MetadataScalarBase<Uri> { public MetadataParsedURL(){} public MetadataParsedURL(object value):base(value) {} } public class MetadataDate : MetadataScalarBase<DateTime> { public MetadataDate(){} public MetadataDate(object value):base(value) {} } public class MetadataStringBuilder : MetadataScalarBase<StringBuilder> { public MetadataStringBuilder(){} public MetadataStringBuilder(object value):base(value) {} } }
Return type T for metadata scalars.
Return type T for metadata scalars.
C#
apache-2.0
ecologylab/BigSemanticsCSharp
1772a2626814684b8db5e1adf585a8625a615067
SocketService/SocketServiceInstaller.cs
SocketService/SocketServiceInstaller.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Configuration.Install; using System.ServiceProcess; using System.Configuration; namespace SuperSocket.SocketService { [RunInstaller(true)] public partial class SocketServiceInstaller : Installer { private ServiceInstaller serviceInstaller; private ServiceProcessInstaller processInstaller; public SocketServiceInstaller() { InitializeComponent(); processInstaller = new ServiceProcessInstaller(); serviceInstaller = new ServiceInstaller(); processInstaller.Account = ServiceAccount.LocalSystem; serviceInstaller.StartType = ServiceStartMode.Manual; serviceInstaller.ServiceName = ConfigurationManager.AppSettings["ServiceName"]; Installers.Add(serviceInstaller); Installers.Add(processInstaller); } } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Configuration.Install; using System.ServiceProcess; using System.Configuration; namespace SuperSocket.SocketService { [RunInstaller(true)] public partial class SocketServiceInstaller : Installer { private ServiceInstaller serviceInstaller; private ServiceProcessInstaller processInstaller; public SocketServiceInstaller() { InitializeComponent(); processInstaller = new ServiceProcessInstaller(); serviceInstaller = new ServiceInstaller(); processInstaller.Account = ServiceAccount.LocalSystem; serviceInstaller.StartType = ServiceStartMode.Automatic; serviceInstaller.ServiceName = ConfigurationManager.AppSettings["ServiceName"]; Installers.Add(serviceInstaller); Installers.Add(processInstaller); } } }
Change service's start mode to auto
Change service's start mode to auto git-svn-id: 6d1cac2d86fac78d43d5e0dd3566a1010e844f91@53932 81fbe566-5dc4-48c1-bdea-7421811ca204
C#
apache-2.0
mdavid/SuperSocket,mdavid/SuperSocket,mdavid/SuperSocket
097bd37e37c38095113bd706717a9601afc1f3c0
osu.Game/Overlays/Chat/Tabs/ChannelSelectorTabItem.cs
osu.Game/Overlays/Chat/Tabs/ChannelSelectorTabItem.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Game.Graphics; using osu.Game.Online.Chat; namespace osu.Game.Overlays.Chat.Tabs { public class ChannelSelectorTabItem : ChannelTabItem { public override bool IsRemovable => false; public override bool IsSwitchable => false; protected override bool IsBoldWhenActive => false; public ChannelSelectorTabItem() : base(new ChannelSelectorTabChannel()) { Depth = float.MaxValue; Width = 45; Icon.Alpha = 0; Text.Font = Text.Font.With(size: 45); Text.Truncate = false; } [BackgroundDependencyLoader] private void load(OsuColour colour) { BackgroundInactive = colour.Gray2; BackgroundActive = colour.Gray3; } public class ChannelSelectorTabChannel : Channel { public ChannelSelectorTabChannel() { Name = "+"; } } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Game.Graphics; using osu.Game.Online.Chat; namespace osu.Game.Overlays.Chat.Tabs { public class ChannelSelectorTabItem : ChannelTabItem { public override bool IsRemovable => false; public override bool IsSwitchable => false; protected override bool IsBoldWhenActive => false; public ChannelSelectorTabItem() : base(new ChannelSelectorTabChannel()) { Depth = float.MaxValue; Width = 45; Icon.Alpha = 0; Text.Font = Text.Font.With(size: 45); Text.Truncate = false; } [BackgroundDependencyLoader] private void load(OsuColour colour) { BackgroundInactive = colour.Gray2; BackgroundActive = colour.Gray3; } public class ChannelSelectorTabChannel : Channel { public ChannelSelectorTabChannel() { Name = "+"; Type = ChannelType.Temporary; } } } }
Fix SelectorTab crashing tests after a reload
Fix SelectorTab crashing tests after a reload For some reason, the default channel type (Public) caused the channel manager to attempt to connect to an API, which was null at that time, after hot reloading the test environment (via dynamic compilation). Changing the channel type seems to fix that.
C#
mit
UselessToucan/osu,ppy/osu,NeoAdonis/osu,EVAST9919/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu,EVAST9919/osu,UselessToucan/osu,peppy/osu-new,smoogipooo/osu,NeoAdonis/osu,peppy/osu,peppy/osu,smoogipoo/osu,UselessToucan/osu,smoogipoo/osu,ppy/osu,ppy/osu
398624659e4c3d64cd683f6ec1dd10c2896edcf0
src/base/common/providers/data/SqlConnectionProviderFactory.cs
src/base/common/providers/data/SqlConnectionProviderFactory.cs
using System; using System.Collections.Generic; using System.Data.SqlClient; using Nohros.Configuration; namespace Nohros.Data.Providers { public partial class SqlConnectionProvider : IConnectionProviderFactory { #region .ctor /// <summary> /// Constructor implied by the interface /// <see cref="IConnectionProviderFactory"/>. /// </summary> SqlConnectionProvider() { } #endregion #region IConnectionProviderFactory Members /// <inheritdoc/> IConnectionProvider IConnectionProviderFactory.CreateProvider( IDictionary<string, string> options) { string connection_string; SqlConnectionStringBuilder builder; if (options.TryGetValue(kConnectionStringOption, out connection_string)) { builder = new SqlConnectionStringBuilder(connection_string); } else { string[] data = ProviderOptions.ThrowIfNotExists(options, kServerOption, kLoginOption, kPasswordOption); const int kServer = 0; const int kLogin = 1; const int kPassword = 2; builder = new SqlConnectionStringBuilder { DataSource = data[kServer], UserID = data[kLogin], Password = data[kPassword] }; } return new SqlConnectionProvider(builder.ConnectionString); } #endregion } }
using System; using System.Collections.Generic; using System.Data.SqlClient; using Nohros.Configuration; namespace Nohros.Data.Providers { public partial class SqlConnectionProvider : IConnectionProviderFactory { #region .ctor /// <summary> /// Constructor implied by the interface /// <see cref="IConnectionProviderFactory"/>. /// </summary> SqlConnectionProvider() { } #endregion #region IConnectionProviderFactory Members /// <inheritdoc/> IConnectionProvider IConnectionProviderFactory.CreateProvider( IDictionary<string, string> options) { string connection_string; SqlConnectionStringBuilder builder; if (options.TryGetValue(kConnectionStringOption, out connection_string)) { builder = new SqlConnectionStringBuilder(connection_string); } else { string[] data = ProviderOptions.ThrowIfNotExists(options, kServerOption, kLoginOption, kPasswordOption); const int kServer = 0; const int kLogin = 1; const int kPassword = 2; builder = new SqlConnectionStringBuilder { DataSource = data[kServer], UserID = data[kLogin], Password = data[kPassword] }; } return new SqlConnectionProvider(builder.ConnectionString); } #endregion } }
Fix a bug that causes the GetProviderNode to return null references.
Fix a bug that causes the GetProviderNode to return null references.
C#
mit
nohros/must,nohros/must,nohros/must
3f1aa0763c02dad012b400330333d8df824aa351
src/NHibernate.Test/NHSpecificTest/NH3408/Fixture.cs
src/NHibernate.Test/NHSpecificTest/NH3408/Fixture.cs
using System.Linq; using NHibernate.Linq; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest.NH3408 { public class Fixture : BugTestCase { [Test] public void ProjectAnonymousTypeWithArrayProperty() { using (var session = OpenSession()) using (session.BeginTransaction()) { var query = from c in session.Query<Country>() select new { c.Picture, c.NationalHolidays }; Assert.DoesNotThrow(() => { query.ToList(); }); } } } }
using System.Collections.Generic; using System.Linq; using NHibernate.Linq; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest.NH3408 { public class Fixture : BugTestCase { [Test] public void ProjectAnonymousTypeWithArrayProperty() { using (var session = OpenSession()) using (session.BeginTransaction()) { var query = from c in session.Query<Country>() select new { c.Picture, c.NationalHolidays }; Assert.DoesNotThrow(() => { query.ToList(); }); } } [Test] public void ProjectAnonymousTypeWithArrayPropertyWhenByteArrayContains() { using (var session = OpenSession()) using (session.BeginTransaction()) { var pictures = new List<byte[]>(); var query = from c in session.Query<Country>() where pictures.Contains(c.Picture) select new { c.Picture, c.NationalHolidays }; Assert.DoesNotThrow(() => { query.ToList(); }); } } [Test] public void SelectBytePropertyWithArrayPropertyWhenByteArrayContains() { using (var session = OpenSession()) using (session.BeginTransaction()) { var pictures = new List<byte[]>(); var query = from c in session.Query<Country>() where pictures.Contains(c.Picture) select c.Picture; Assert.DoesNotThrow(() => { query.ToList(); }); } } } }
Add more tests for NH-3408
Add more tests for NH-3408
C#
lgpl-2.1
nhibernate/nhibernate-core,ManufacturingIntelligence/nhibernate-core,nkreipke/nhibernate-core,fredericDelaporte/nhibernate-core,lnu/nhibernate-core,hazzik/nhibernate-core,nhibernate/nhibernate-core,RogerKratz/nhibernate-core,alobakov/nhibernate-core,livioc/nhibernate-core,ManufacturingIntelligence/nhibernate-core,fredericDelaporte/nhibernate-core,livioc/nhibernate-core,ManufacturingIntelligence/nhibernate-core,RogerKratz/nhibernate-core,gliljas/nhibernate-core,ngbrown/nhibernate-core,alobakov/nhibernate-core,hazzik/nhibernate-core,fredericDelaporte/nhibernate-core,nkreipke/nhibernate-core,lnu/nhibernate-core,gliljas/nhibernate-core,RogerKratz/nhibernate-core,nkreipke/nhibernate-core,livioc/nhibernate-core,fredericDelaporte/nhibernate-core,gliljas/nhibernate-core,alobakov/nhibernate-core,gliljas/nhibernate-core,nhibernate/nhibernate-core,hazzik/nhibernate-core,ngbrown/nhibernate-core,nhibernate/nhibernate-core,RogerKratz/nhibernate-core,lnu/nhibernate-core,hazzik/nhibernate-core,ngbrown/nhibernate-core
d713d4b97fdd94dbc158c0097ab4027b5ba1a71f
src/net45/WampSharp/WAMP2/V2/Core/WampObjectFormatter.cs
src/net45/WampSharp/WAMP2/V2/Core/WampObjectFormatter.cs
using System; using System.Linq; using System.Reflection; using WampSharp.Core.Serialization; using WampSharp.Core.Utilities; namespace WampSharp.V2.Core { public class WampObjectFormatter : IWampFormatter<object> { public static readonly IWampFormatter<object> Value = new WampObjectFormatter(); private WampObjectFormatter() { } public bool CanConvert(object argument, Type type) { return type.IsInstanceOfType(argument); } public TTarget Deserialize<TTarget>(object message) { return (TTarget) message; } public object Deserialize(Type type, object message) { MethodInfo genericMethod = Method.Get((WampObjectFormatter x) => x.Deserialize<object>(default(object))) .GetGenericMethodDefinition(); // This actually only throws an exception if types don't match. object converted = genericMethod.MakeGenericMethod(type) .Invoke(this, new object[] {message}); return converted; } public object Serialize(object value) { return value; } } }
using System; using System.Linq; using System.Reflection; using WampSharp.Core.Serialization; using WampSharp.Core.Utilities; namespace WampSharp.V2.Core { public class WampObjectFormatter : IWampFormatter<object> { public static readonly IWampFormatter<object> Value = new WampObjectFormatter(); private readonly MethodInfo mSerializeMethod = Method.Get((WampObjectFormatter x) => x.Deserialize<object>(default(object))) .GetGenericMethodDefinition(); private WampObjectFormatter() { } public bool CanConvert(object argument, Type type) { return type.IsInstanceOfType(argument); } public TTarget Deserialize<TTarget>(object message) { return (TTarget) message; } public object Deserialize(Type type, object message) { if (type.IsInstanceOfType(message)) { return message; } else { // This throws an exception if types don't match. object converted = mSerializeMethod.MakeGenericMethod(type) .Invoke(this, new object[] {message}); return converted; } } public object Serialize(object value) { return value; } } }
Call the reflection method only if types don't match
Call the reflection method only if types don't match
C#
bsd-2-clause
jmptrader/WampSharp,jmptrader/WampSharp,jmptrader/WampSharp
68e370ce7cd72c51a7eda6f9863ed37b0f86b3d5
osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinnerTick.cs
osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinnerTick.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.Bindables; using osu.Game.Rulesets.Osu.Judgements; using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu.Objects.Drawables { public class DrawableSpinnerTick : DrawableOsuHitObject { private readonly BindableDouble bonusSampleVolume = new BindableDouble(); private bool hasBonusPoints; /// <summary> /// Whether this judgement has a bonus of 1,000 points additional to the numeric result. /// Should be set when a spin occured after the spinner has completed. /// </summary> public bool HasBonusPoints { get => hasBonusPoints; internal set { hasBonusPoints = value; bonusSampleVolume.Value = value ? 1 : 0; ((OsuSpinnerTickJudgement)Result.Judgement).HasBonusPoints = value; } } public override bool DisplayResult => false; public DrawableSpinnerTick(SpinnerTick spinnerTick) : base(spinnerTick) { } protected override void LoadComplete() { base.LoadComplete(); Samples.AddAdjustment(AdjustableProperty.Volume, bonusSampleVolume); } public void TriggerResult(HitResult result) => ApplyResult(r => r.Type = result); } }
// 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.Bindables; using osu.Game.Rulesets.Osu.Judgements; using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu.Objects.Drawables { public class DrawableSpinnerTick : DrawableOsuHitObject { private readonly BindableDouble bonusSampleVolume = new BindableDouble(); private bool hasBonusPoints; /// <summary> /// Whether this judgement has a bonus of 1,000 points additional to the numeric result. /// Should be set when a spin occured after the spinner has completed. /// </summary> public bool HasBonusPoints { get => hasBonusPoints; internal set { hasBonusPoints = value; bonusSampleVolume.Value = value ? 1 : 0; ((OsuSpinnerTickJudgement)Result.Judgement).HasBonusPoints = value; } } public override bool DisplayResult => false; public DrawableSpinnerTick(SpinnerTick spinnerTick) : base(spinnerTick) { } protected override void LoadComplete() { base.LoadComplete(); Samples.AddAdjustment(AdjustableProperty.Volume, bonusSampleVolume); } public void TriggerResult(HitResult result) { HitObject.StartTime = Time.Current; ApplyResult(r => r.Type = result); } } }
Set spinner tick start time to allow result reverting
Set spinner tick start time to allow result reverting
C#
mit
smoogipoo/osu,UselessToucan/osu,smoogipoo/osu,UselessToucan/osu,NeoAdonis/osu,UselessToucan/osu,NeoAdonis/osu,peppy/osu,peppy/osu,peppy/osu-new,ppy/osu,smoogipooo/osu,ppy/osu,smoogipoo/osu,peppy/osu,ppy/osu,NeoAdonis/osu
e068ae49d0c6b46e9f40e5ef32a427f04cac9e9d
tests/Sakuno.Base.Tests/ProjectionCollectionTests.cs
tests/Sakuno.Base.Tests/ProjectionCollectionTests.cs
using Sakuno.Collections; using System.Collections.ObjectModel; using Xunit; namespace Sakuno.Base.Tests { public static class ProjectionCollectionTests { [Fact] public static void SimpleProjection() { var source = new ObservableCollection<int>(); var projection = new ProjectionCollection<int, int>(source, r => r * 2); source.Add(1); source.Add(2); source.Add(3); source.Add(4); source.Add(5); source.Remove(3); source.Insert(1, 6); source.Insert(2, 10); source.Remove(5); source.Remove(2); Assert.Equal(projection.Count, source.Count); using (var projectionEnumerator = projection.GetEnumerator()) using (var sourceEnumerator = source.GetEnumerator()) { while (projectionEnumerator.MoveNext() && sourceEnumerator.MoveNext()) Assert.Equal(sourceEnumerator.Current * 2, projectionEnumerator.Current); } source.Clear(); Assert.Empty(projection); projection.Dispose(); } } }
using Sakuno.Collections; using System.Collections.ObjectModel; using Xunit; namespace Sakuno.Base.Tests { public static class ProjectionCollectionTests { [Fact] public static void SimpleProjection() { var source = new ObservableCollection<int>(); var projection = new ProjectionCollection<int, int>(source, r => r * 2); source.Add(1); source.Add(2); source.Add(3); source.Add(4); source.Add(5); source.Remove(3); source.Insert(1, 6); source.Insert(2, 10); source.Remove(5); source.Remove(2); Assert.Equal(projection.Count, source.Count); using (var projectionEnumerator = projection.GetEnumerator()) using (var sourceEnumerator = source.GetEnumerator()) { while (projectionEnumerator.MoveNext() && sourceEnumerator.MoveNext()) Assert.Equal(sourceEnumerator.Current * 2, projectionEnumerator.Current); Assert.False(projectionEnumerator.MoveNext()); Assert.False(sourceEnumerator.MoveNext()); } source.Clear(); Assert.Empty(projection); projection.Dispose(); } } }
Make ProjectionCollection unit test more strict
Make ProjectionCollection unit test more strict
C#
mit
KodamaSakuno/Sakuno.Base
12ea8369ee504caddcaf38488cae09bfedb091b6
osu.Game/Beatmaps/Drawables/CalculatingDifficultyIcon.cs
osu.Game/Beatmaps/Drawables/CalculatingDifficultyIcon.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; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osuTK; namespace osu.Game.Beatmaps.Drawables { /// <summary> /// A difficulty icon which automatically calculates difficulty in the background. /// </summary> public class CalculatingDifficultyIcon : CompositeDrawable { /// <summary> /// Size of this difficulty icon. /// </summary> public new Vector2 Size { get => difficultyIcon.Size; set => difficultyIcon.Size = value; } public bool ShowTooltip { get => difficultyIcon.ShowTooltip; set => difficultyIcon.ShowTooltip = value; } private readonly IBeatmapInfo beatmapInfo; private readonly DifficultyIcon difficultyIcon; /// <summary> /// Creates a new <see cref="CalculatingDifficultyIcon"/> that follows the currently-selected ruleset and mods. /// </summary> /// <param name="beatmapInfo">The beatmap to show the difficulty of.</param> public CalculatingDifficultyIcon(IBeatmapInfo beatmapInfo) { this.beatmapInfo = beatmapInfo ?? throw new ArgumentNullException(nameof(beatmapInfo)); AutoSizeAxes = Axes.Both; InternalChildren = new Drawable[] { difficultyIcon = new DifficultyIcon(beatmapInfo), new DelayedLoadUnloadWrapper(createDifficultyRetriever, 0) }; } private Drawable createDifficultyRetriever() => new DifficultyRetriever(beatmapInfo) { StarDifficulty = { BindTarget = difficultyIcon.Current } }; } }
// 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.Framework.Graphics.Containers; using osuTK; namespace osu.Game.Beatmaps.Drawables { /// <summary> /// A difficulty icon which automatically calculates difficulty in the background. /// </summary> public class CalculatingDifficultyIcon : CompositeDrawable { /// <summary> /// Size of this difficulty icon. /// </summary> public new Vector2 Size { get => difficultyIcon.Size; set => difficultyIcon.Size = value; } public bool ShowTooltip { get => difficultyIcon.ShowTooltip; set => difficultyIcon.ShowTooltip = value; } private readonly DifficultyIcon difficultyIcon; /// <summary> /// Creates a new <see cref="CalculatingDifficultyIcon"/> that follows the currently-selected ruleset and mods. /// </summary> /// <param name="beatmapInfo">The beatmap to show the difficulty of.</param> public CalculatingDifficultyIcon(IBeatmapInfo beatmapInfo) { AutoSizeAxes = Axes.Both; InternalChildren = new Drawable[] { difficultyIcon = new DifficultyIcon(beatmapInfo), new DelayedLoadUnloadWrapper(() => new DifficultyRetriever(beatmapInfo) { StarDifficulty = { BindTarget = difficultyIcon.Current } }, 0) { RelativeSizeAxes = Axes.Both, } }; } } }
Update retriever to be relatively sized
Update retriever to be relatively sized
C#
mit
ppy/osu,peppy/osu,ppy/osu,peppy/osu,ppy/osu,peppy/osu
6e1ab275ca398fe2e62235a9ded56417d4e573ec
XamarinFormsExtendedSplashPage/XamarinFormsExtendedSplashPage/RootPage.xaml.cs
XamarinFormsExtendedSplashPage/XamarinFormsExtendedSplashPage/RootPage.xaml.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Forms; namespace XamarinFormsExtendedSplashPage { public partial class RootPage : ContentPage { public RootPage() { InitializeComponent(); } protected override void OnAppearing() { base.OnAppearing(); Navigation.RemovePage(Navigation.NavigationStack[0]); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Forms; namespace XamarinFormsExtendedSplashPage { public partial class RootPage : ContentPage { public RootPage() { InitializeComponent(); } protected override void OnAppearing() { base.OnAppearing(); var rootPage = Navigation.NavigationStack[0]; if (typeof (RootPage) == rootPage.GetType()) return; Navigation.RemovePage(rootPage); } } }
Fix bug when root page would be shown a second time.
Fix bug when root page would be shown a second time.
C#
apache-2.0
mallibone/XamarinFormsExtendedSplashPage
8ac1d56861a5802ba9755d7fde303e8a7aece1bf
Battery-Commander.Web/Views/Shared/DisplayTemplates/Unit.cshtml
Battery-Commander.Web/Views/Shared/DisplayTemplates/Unit.cshtml
@model Unit <div>@Html.ActionLink(Model.Name, "Index", "Soldiers", new { unit = Model.Id })</div>
@model Unit @if (Model != null) { <div>@Html.ActionLink(Model.Name, "Index", "Soldiers", new { unit = Model.Id })</div> }
Make sure unit isn't null
Make sure unit isn't null
C#
mit
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
bd60b1e750065aec021d91f5e3597b589959865f
Properties/VersionAssemblyInfo.cs
Properties/VersionAssemblyInfo.cs
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.18033 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyVersion("3.0.0.0")] [assembly: AssemblyFileVersion("3.0.0.0")] [assembly: AssemblyConfiguration("Release built on 2013-02-22 14:39")] [assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.18033 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyVersion("3.0.0.0")] [assembly: AssemblyFileVersion("3.0.0.0")] [assembly: AssemblyConfiguration("Release built on 2013-02-28 02:03")] [assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]
Build script now creates individual zip file packages to align with the NuGet packages and semantic versioning.
Build script now creates individual zip file packages to align with the NuGet packages and semantic versioning.
C#
mit
autofac/Autofac.Extras.NHibernate
515e4ca1651e520a5b5cdf75481e2bfadf25c7b8
src/VisualStudio/PackageSource/AggregatePackageSource.cs
src/VisualStudio/PackageSource/AggregatePackageSource.cs
using System.Collections.Generic; using System.Linq; namespace NuGet.VisualStudio { public static class AggregatePackageSource { public static readonly PackageSource Instance = new PackageSource("(Aggregate source)", Resources.VsResources.AggregateSourceName); public static bool IsAggregate(this PackageSource source) { return source == Instance; } public static IEnumerable<PackageSource> GetEnabledPackageSourcesWithAggregate(this IPackageSourceProvider provider) { return new[] { Instance }.Concat(provider.GetEnabledPackageSources()); } public static IEnumerable<PackageSource> GetEnabledPackageSourcesWithAggregateSmart(this IPackageSourceProvider provider) { var packageSources = provider.GetEnabledPackageSources().ToArray(); // If there's less than 2 package sources, don't add the Aggregate source because it will be exactly the same as the main source. if (packageSources.Length <= 1) { return packageSources; } return new[] { Instance }.Concat(packageSources); } } }
using System.Collections.Generic; using System.Linq; namespace NuGet.VisualStudio { public static class AggregatePackageSource { public static readonly PackageSource Instance = new PackageSource("(Aggregate source)", Resources.VsResources.AggregateSourceName); public static bool IsAggregate(this PackageSource source) { return source == Instance; } // IMPORTANT: do NOT remove this method. It is used by functional tests. public static IEnumerable<PackageSource> GetEnabledPackageSourcesWithAggregate() { return GetEnabledPackageSourcesWithAggregate(ServiceLocator.GetInstance<IVsPackageSourceProvider>()); } public static IEnumerable<PackageSource> GetEnabledPackageSourcesWithAggregate(this IPackageSourceProvider provider) { return new[] { Instance }.Concat(provider.GetEnabledPackageSources()); } public static IEnumerable<PackageSource> GetEnabledPackageSourcesWithAggregateSmart(this IPackageSourceProvider provider) { var packageSources = provider.GetEnabledPackageSources().ToArray(); // If there's less than 2 package sources, don't add the Aggregate source because it will be exactly the same as the main source. if (packageSources.Length <= 1) { return packageSources; } return new[] { Instance }.Concat(packageSources); } } }
Add back a method that was removed bug is required by functional tests.
Add back a method that was removed bug is required by functional tests.
C#
apache-2.0
chocolatey/nuget-chocolatey,mono/nuget,GearedToWar/NuGet2,antiufo/NuGet2,GearedToWar/NuGet2,jmezach/NuGet2,rikoe/nuget,pratikkagda/nuget,dolkensp/node.net,antiufo/NuGet2,mrward/nuget,jholovacs/NuGet,jmezach/NuGet2,jmezach/NuGet2,ctaggart/nuget,mono/nuget,alluran/node.net,antiufo/NuGet2,xoofx/NuGet,mrward/nuget,RichiCoder1/nuget-chocolatey,indsoft/NuGet2,jmezach/NuGet2,mrward/NuGet.V2,ctaggart/nuget,antiufo/NuGet2,RichiCoder1/nuget-chocolatey,oliver-feng/nuget,mrward/NuGet.V2,indsoft/NuGet2,xoofx/NuGet,RichiCoder1/nuget-chocolatey,GearedToWar/NuGet2,OneGet/nuget,mrward/NuGet.V2,indsoft/NuGet2,alluran/node.net,RichiCoder1/nuget-chocolatey,dolkensp/node.net,xoofx/NuGet,RichiCoder1/nuget-chocolatey,pratikkagda/nuget,akrisiun/NuGet,xoofx/NuGet,alluran/node.net,jholovacs/NuGet,akrisiun/NuGet,OneGet/nuget,GearedToWar/NuGet2,mrward/nuget,OneGet/nuget,ctaggart/nuget,mrward/NuGet.V2,ctaggart/nuget,jholovacs/NuGet,rikoe/nuget,mrward/nuget,antiufo/NuGet2,OneGet/nuget,chocolatey/nuget-chocolatey,GearedToWar/NuGet2,jholovacs/NuGet,mono/nuget,alluran/node.net,pratikkagda/nuget,jholovacs/NuGet,mrward/NuGet.V2,zskullz/nuget,dolkensp/node.net,chocolatey/nuget-chocolatey,oliver-feng/nuget,antiufo/NuGet2,zskullz/nuget,pratikkagda/nuget,dolkensp/node.net,mrward/nuget,oliver-feng/nuget,pratikkagda/nuget,indsoft/NuGet2,chocolatey/nuget-chocolatey,zskullz/nuget,mono/nuget,indsoft/NuGet2,mrward/NuGet.V2,chocolatey/nuget-chocolatey,indsoft/NuGet2,xoofx/NuGet,xoofx/NuGet,chocolatey/nuget-chocolatey,oliver-feng/nuget,mrward/nuget,zskullz/nuget,jmezach/NuGet2,rikoe/nuget,oliver-feng/nuget,jmezach/NuGet2,pratikkagda/nuget,rikoe/nuget,oliver-feng/nuget,GearedToWar/NuGet2,RichiCoder1/nuget-chocolatey,jholovacs/NuGet
afbd7e229b13ce14eac5c8cf5b48593603662710
SadConsole/UI/Themes/DrawingAreaTheme.cs
SadConsole/UI/Themes/DrawingAreaTheme.cs
using System; using System.Runtime.Serialization; using SadConsole.UI.Controls; using SadRogue.Primitives; namespace SadConsole.UI.Themes { /// <summary> /// A basic theme for a drawing surface that simply fills the surface based on the state. /// </summary> [DataContract] public class DrawingAreaTheme : ThemeBase { /// <summary> /// When true, only uses <see cref="ThemeStates.Normal"/> for drawing. /// </summary> [DataMember] public bool UseNormalStateOnly { get; set; } = true; /// <summary> /// The current appearance based on the control state. /// </summary> public ColoredGlyph Appearance { get; protected set; } /// <inheritdoc /> public override void UpdateAndDraw(ControlBase control, TimeSpan time) { if (!(control is DrawingArea drawingSurface)) return; RefreshTheme(control.FindThemeColors(), control); if (!UseNormalStateOnly) Appearance = ControlThemeState.GetStateAppearance(control.State); else Appearance = ControlThemeState.Normal; drawingSurface?.OnDraw(drawingSurface, time); control.IsDirty = false; } /// <inheritdoc /> public override ThemeBase Clone() => new DrawingAreaTheme() { ControlThemeState = ControlThemeState.Clone(), UseNormalStateOnly = UseNormalStateOnly }; } }
using System; using System.Runtime.Serialization; using SadConsole.UI.Controls; using SadRogue.Primitives; namespace SadConsole.UI.Themes { /// <summary> /// A basic theme for a drawing surface that simply fills the surface based on the state. /// </summary> [DataContract] public class DrawingAreaTheme : ThemeBase { /// <summary> /// When true, only uses <see cref="ThemeStates.Normal"/> for drawing. /// </summary> [DataMember] public bool UseNormalStateOnly { get; set; } = true; /// <summary> /// The current appearance based on the control state. /// </summary> public ColoredGlyph Appearance { get; protected set; } /// <inheritdoc /> public override void UpdateAndDraw(ControlBase control, TimeSpan time) { if (!(control is DrawingArea drawingSurface)) return; RefreshTheme(control.FindThemeColors(), control); if (!UseNormalStateOnly) Appearance = ControlThemeState.GetStateAppearance(control.State); else Appearance = ControlThemeState.Normal; drawingSurface.OnDraw?.Invoke(drawingSurface, time); control.IsDirty = false; } /// <inheritdoc /> public override ThemeBase Clone() => new DrawingAreaTheme() { ControlThemeState = ControlThemeState.Clone(), UseNormalStateOnly = UseNormalStateOnly }; } }
Fix bug in DrawArea control
Fix bug in DrawArea control
C#
mit
Thraka/SadConsole
014eeaaaa25629aae1589f5c346bcda4dccc2375
tests/fixtures/TagLib.Tests.Images/JpegNoMetadataTest.cs
tests/fixtures/TagLib.Tests.Images/JpegNoMetadataTest.cs
using System; using NUnit.Framework; using TagLib.IFD; using TagLib.IFD.Entries; using TagLib.IFD.Tags; using TagLib.Xmp; using TagLib.Tests.Images.Validators; namespace TagLib.Tests.Images { [TestFixture] public class JpegNoMetadataTest { [Test] public void Test () { ImageTest.Run ("sample_no_metadata.jpg", new JpegNoMetadataTestInvariantValidator (), NoModificationValidator.Instance, new NoModificationValidator (), new CommentModificationValidator (), new TagCommentModificationValidator (TagTypes.TiffIFD, false), new TagCommentModificationValidator (TagTypes.XMP, false), new TagKeywordsModificationValidator (TagTypes.XMP, false) ); } } public class JpegNoMetadataTestInvariantValidator : IMetadataInvariantValidator { public void ValidateMetadataInvariants (Image.File file) { Assert.IsNotNull (file); } } }
using System; using NUnit.Framework; using TagLib.IFD; using TagLib.IFD.Entries; using TagLib.IFD.Tags; using TagLib.Xmp; using TagLib.Tests.Images.Validators; namespace TagLib.Tests.Images { [TestFixture] public class JpegNoMetadataTest { [Test] public void Test () { ImageTest.Run ("sample_no_metadata.jpg", new JpegNoMetadataTestInvariantValidator (), NoModificationValidator.Instance, new NoModificationValidator (), new TagCommentModificationValidator (TagTypes.TiffIFD, false), new TagCommentModificationValidator (TagTypes.XMP, false), new TagKeywordsModificationValidator (TagTypes.XMP, false) ); } } public class JpegNoMetadataTestInvariantValidator : IMetadataInvariantValidator { public void ValidateMetadataInvariants (Image.File file) { Assert.IsNotNull (file); } } }
Remove CommentTest for jpeg test without metadata
Remove CommentTest for jpeg test without metadata It does not make sense to have that test here, because a comment cannot be added, when no tag is present. And it is against the current taglib policy to add tags without a request from the user. https://bugzilla.gnome.org/show_bug.cgi?id=619920
C#
lgpl-2.1
Clancey/taglib-sharp,mono/taglib-sharp,CamargoR/taglib-sharp,CamargoR/taglib-sharp,Clancey/taglib-sharp,Clancey/taglib-sharp,hwahrmann/taglib-sharp,archrival/taglib-sharp,punker76/taglib-sharp,hwahrmann/taglib-sharp,punker76/taglib-sharp,archrival/taglib-sharp
16bbc7887d2a5cb6c62b734dd98eeb910b4c3ad9
net/Azure.Storage.Blobs.PerfStress/Core/SizeOptions.cs
net/Azure.Storage.Blobs.PerfStress/Core/SizeOptions.cs
using Azure.Test.PerfStress; using CommandLine; namespace Azure.Storage.Blobs.PerfStress.Core { public class SizeOptions : PerfStressOptions { [Option('s', "size", Default = 10 * 1024, HelpText = "Size of message (in bytes)")] public int Size { get; set; } } }
using Azure.Test.PerfStress; using CommandLine; namespace Azure.Storage.Blobs.PerfStress.Core { public class SizeOptions : PerfStressOptions { [Option('s', "size", Default = 10 * 1024, HelpText = "Size of message (in bytes)")] public long Size { get; set; } } }
Convert size parameter from int to long
Convert size parameter from int to long
C#
mit
Azure/azure-sdk-for-java,selvasingh/azure-sdk-for-java,selvasingh/azure-sdk-for-java,Azure/azure-sdk-for-java,Azure/azure-sdk-for-java,Azure/azure-sdk-for-java,Azure/azure-sdk-for-java,selvasingh/azure-sdk-for-java
e4df1c0d9a261fbe22dc64f23d09ceff15d8c73b
Tests/Agiil.Web.TestBuild/Bootstrap/DataPackagesModule.cs
Tests/Agiil.Web.TestBuild/Bootstrap/DataPackagesModule.cs
using System; using System.Collections.Generic; using System.Reflection; using System.Linq; using Agiil.Web.Services.DataPackages; using Autofac; using Agiil.Web.Services; namespace Agiil.Web.Bootstrap { public class DataPackagesModule : Autofac.Module { static readonly Type NamespaceMarker = typeof(IDataPackagesNamespaceMarker), DataPackageInterface = typeof(IDataPackage); string DataPackagesNamespace => NamespaceMarker.Namespace; protected override void Load(ContainerBuilder builder) { var packageTypes = GetDataPackageTypes(); foreach(var packageType in packageTypes) { builder .RegisterType(packageType) .WithMetadata<DataPackageMetadata>(config => { config.For(x => x.PackageTypeName, packageType.Name); }); } } IEnumerable<Type> GetDataPackageTypes() { return (from type in Assembly.GetExecutingAssembly().GetExportedTypes() where type.IsClass && !type.IsAbstract && DataPackageInterface.IsAssignableFrom(type) && type.Namespace == DataPackagesNamespace select type) .ToArray(); } } }
using System; using System.Collections.Generic; using System.Reflection; using System.Linq; using Agiil.Web.Services.DataPackages; using Autofac; using Agiil.Web.Services; namespace Agiil.Web.Bootstrap { public class DataPackagesModule : Autofac.Module { static readonly Type NamespaceMarker = typeof(IDataPackagesNamespaceMarker), DataPackageInterface = typeof(IDataPackage); string DataPackagesNamespace => NamespaceMarker.Namespace; protected override void Load(ContainerBuilder builder) { var packageTypes = GetDataPackageTypes(); foreach(var packageType in packageTypes) { builder .RegisterType(packageType) .As<IDataPackage>() .WithMetadata<DataPackageMetadata>(config => { config.For(x => x.PackageTypeName, packageType.Name); }); } } IEnumerable<Type> GetDataPackageTypes() { return (from type in Assembly.GetExecutingAssembly().GetExportedTypes() where type.IsClass && !type.IsAbstract && DataPackageInterface.IsAssignableFrom(type) && type.Namespace == DataPackagesNamespace select type) .ToArray(); } } }
Fix registration of Data Packages
Fix registration of Data Packages
C#
mit
csf-dev/agiil,csf-dev/agiil,csf-dev/agiil,csf-dev/agiil
cfd1646de4672ee1d2005faa4c54ec80936ad87d
Bonobo.Git.Server/Configuration/AuthenticationSettings.cs
Bonobo.Git.Server/Configuration/AuthenticationSettings.cs
using System; using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Web; namespace Bonobo.Git.Server.Configuration { public class AuthenticationSettings { public static string MembershipService { get; private set; } public static string RoleProvider { get; private set; } static AuthenticationSettings() { MembershipService = ConfigurationManager.AppSettings["MembershipService"]; RoleProvider = ConfigurationManager.AppSettings["RoleProvider"]; } } }
using System; using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Web; namespace Bonobo.Git.Server.Configuration { public class AuthenticationSettings { public static string MembershipService { get; private set; } static AuthenticationSettings() { MembershipService = ConfigurationManager.AppSettings["MembershipService"]; } } }
Remove unused RoleProvider setting from authentication configuration
Remove unused RoleProvider setting from authentication configuration
C#
mit
Acute-sales-ltd/Bonobo-Git-Server,larshg/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,crowar/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,PGM-NipponSysits/IIS.Git-Connector,Acute-sales-ltd/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,padremortius/Bonobo-Git-Server,willdean/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,lkho/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,crowar/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,willdean/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,gencer/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,crowar/Bonobo-Git-Server,larshg/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,igoryok-zp/Bonobo-Git-Server,gencer/Bonobo-Git-Server,lkho/Bonobo-Git-Server,willdean/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,Ollienator/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,willdean/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,Ollienator/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,larshg/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,NipponSysits/IIS.Git-Connector,Ollienator/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,crowar/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,Webmine/Bonobo-Git-Server,Acute-sales-ltd/Bonobo-Git-Server,crowar/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,larshg/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,RedX2501/Bonobo-Git-Server,lkho/Bonobo-Git-Server,PGM-NipponSysits/IIS.Git-Connector,NipponSysits/IIS.Git-Connector,padremortius/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,kfarnung/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,igoryok-zp/Bonobo-Git-Server,gencer/Bonobo-Git-Server,gencer/Bonobo-Git-Server,anyeloamt1/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server,lkho/Bonobo-Git-Server,forgetz/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,willdean/Bonobo-Git-Server,padremortius/Bonobo-Git-Server,Webmine/Bonobo-Git-Server,crowar/Bonobo-Git-Server,braegelno5/Bonobo-Git-Server
5b3b6a3c3e0a3c12c8c8366108848d101764d36d
RemoteProcessTool/RemoteProcessService/Command/LIST.cs
RemoteProcessTool/RemoteProcessService/Command/LIST.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using SuperSocket.SocketServiceCore.Command; using System.Diagnostics; namespace RemoteProcessService.Command { public class LIST : ICommand<RemotePrcessSession> { #region ICommand<RemotePrcessSession> Members public void Execute(RemotePrcessSession session, CommandInfo commandData) { Process[] processes; string firstParam = commandData.GetFirstParam(); if (string.IsNullOrEmpty(firstParam) || firstParam == "*") processes = Process.GetProcesses(); else processes = Process.GetProcesses().Where(p => p.ProcessName.IndexOf(firstParam, StringComparison.OrdinalIgnoreCase) >= 0).ToArray(); StringBuilder sb = new StringBuilder(); foreach (var p in processes) { sb.AppendLine(string.Format("{0}\t{1}\t{2}", p.ProcessName, p.Id, p.TotalProcessorTime)); } sb.AppendLine(); session.SendResponse(sb.ToString()); } #endregion } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using SuperSocket.SocketServiceCore.Command; using System.Diagnostics; namespace RemoteProcessService.Command { public class LIST : ICommand<RemotePrcessSession> { #region ICommand<RemotePrcessSession> Members public void Execute(RemotePrcessSession session, CommandInfo commandData) { Process[] processes; string firstParam = commandData.GetFirstParam(); if (string.IsNullOrEmpty(firstParam) || firstParam == "*") processes = Process.GetProcesses(); else processes = Process.GetProcesses().Where(p => p.ProcessName.IndexOf(firstParam, StringComparison.OrdinalIgnoreCase) >= 0).ToArray(); StringBuilder sb = new StringBuilder(); foreach (var p in processes) { sb.AppendLine(string.Format("{0}\t{1}", p.ProcessName, p.Id)); } sb.AppendLine(); session.SendResponse(sb.ToString()); } #endregion } }
Fix access denied issue when access process information in RemoteProcessService
Fix access denied issue when access process information in RemoteProcessService git-svn-id: 6d1cac2d86fac78d43d5e0dd3566a1010e844f91@53862 81fbe566-5dc4-48c1-bdea-7421811ca204
C#
apache-2.0
mdavid/SuperSocket,mdavid/SuperSocket,mdavid/SuperSocket
d71c4318c1b7e874df27edab7f5ad4f2e4edf2fb
GeneratorAPI/IGenerator.cs
GeneratorAPI/IGenerator.cs
namespace GeneratorAPI { /// <summary> /// Represents a generic generator which can generate any ammount of elements. /// </summary> /// <typeparam name="T"></typeparam> public interface IGenerator<out T> : IGenerator { /// <summary> /// Generate next element. /// </summary> T Generate(); } public interface IGenerator { object Generate(); } }
namespace GeneratorAPI { /// <summary> /// Represents a generic generator which can generate any ammount of elements. /// </summary> /// <typeparam name="T"></typeparam> public interface IGenerator<out T> : IGenerator { /// <summary> /// Generate next element. /// </summary> new T Generate(); } public interface IGenerator { object Generate(); } }
Add new keyword for hiding the none generic generate
Add new keyword for hiding the none generic generate Former-commit-id: 5280876761e8347c145624427d7ba1840d6aa013
C#
mit
inputfalken/Sharpy
b27add915b1f113ee416f6f529908f169920b525
Samples/GPSTracker/GPSTracker.Web/Controllers/HomeController.cs
Samples/GPSTracker/GPSTracker.Web/Controllers/HomeController.cs
using System; using System.Threading.Tasks; using System.Web.Mvc; using GPSTracker.Common; using GPSTracker.GrainInterface; namespace GPSTracker.Web.Controllers { public class HomeController : Controller { public ActionResult Index() { return View(); } public async Task<ActionResult> Test() { var rand = new Random(); var grain = DeviceGrainFactory.GetGrain(1); await grain.ProcessMessage(new DeviceMessage(rand.Next(-90, 90), rand.Next(-180, 180), 1, 1, DateTime.UtcNow)); return Content("Sent"); } } }
using System; using System.Threading.Tasks; using System.Web.Mvc; using GPSTracker.Common; using GPSTracker.GrainInterface; using Orleans; namespace GPSTracker.Web.Controllers { public class HomeController : Controller { public ActionResult Index() { return View(); } public async Task<ActionResult> Test() { var rand = new Random(); IDeviceGrain grain = GrainClient.GrainFactory.GetGrain<IDeviceGrain>(1); await grain.ProcessMessage(new DeviceMessage(rand.Next(-90, 90), rand.Next(-180, 180), 1, 1, DateTime.UtcNow)); return Content("Sent"); } } }
Fix code using old style code-gen factory classes - use GrainClient.GrainFactory
Fix code using old style code-gen factory classes - use GrainClient.GrainFactory
C#
mit
amccool/orleans,rrector/orleans,Liversage/orleans,SoftWar1923/orleans,benjaminpetit/orleans,jokin/orleans,dotnet/orleans,gabikliot/orleans,sergeybykov/orleans,xclayl/orleans,tsibelman/orleans,hoopsomuah/orleans,MikeHardman/orleans,kowalot/orleans,gigya/orleans,bstauff/orleans,rrector/orleans,tsibelman/orleans,LoveElectronics/orleans,MikeHardman/orleans,kylemc/orleans,veikkoeeva/orleans,kylemc/orleans,Joshua-Ferguson/orleans,ticup/orleans,ashkan-saeedi-mazdeh/orleans,yevhen/orleans,bstauff/orleans,centur/orleans,jkonecki/orleans,yevhen/orleans,centur/orleans,amccool/orleans,ElanHasson/orleans,sergeybykov/orleans,jason-bragg/orleans,jokin/orleans,dotnet/orleans,ReubenBond/orleans,ibondy/orleans,SoftWar1923/orleans,jdom/orleans,Liversage/orleans,shlomiw/orleans,brhinescot/orleans,kowalot/orleans,ashkan-saeedi-mazdeh/orleans,ElanHasson/orleans,Carlm-MS/orleans,jthelin/orleans,LoveElectronics/orleans,jokin/orleans,pherbel/orleans,Joshua-Ferguson/orleans,dVakulen/orleans,Carlm-MS/orleans,Liversage/orleans,ashkan-saeedi-mazdeh/orleans,brhinescot/orleans,xclayl/orleans,pherbel/orleans,dVakulen/orleans,brhinescot/orleans,amccool/orleans,sebastianburckhardt/orleans,jdom/orleans,ticup/orleans,shayhatsor/orleans,galvesribeiro/orleans,shayhatsor/orleans,hoopsomuah/orleans,jkonecki/orleans,shlomiw/orleans,galvesribeiro/orleans,waynemunro/orleans,gabikliot/orleans,ibondy/orleans,waynemunro/orleans,dVakulen/orleans,gigya/orleans,sebastianburckhardt/orleans
66e08bd7cfd48d11fee5d7fe0056f301cf32331e
Properties/AssemblyInfo.cs
Properties/AssemblyInfo.cs
using System.Reflection; [assembly: AssemblyTitle("Autofac.Extras.Tests.DomainServices")] [assembly: AssemblyDescription("")]
using System.Reflection; [assembly: AssemblyTitle("Autofac.Extras.Tests.DomainServices")]
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major.
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major.
C#
mit
autofac/Autofac.Extras.DomainServices
5cf370cde220c29d5b73ada8154eecb4f94bc261
unity-sample-environment/Assets/Scripts/AgentBehaviour.cs
unity-sample-environment/Assets/Scripts/AgentBehaviour.cs
using UnityEngine; using MsgPack; [RequireComponent(typeof (AgentController))] [RequireComponent(typeof (AgentSensor))] public class AgentBehaviour : MonoBehaviour { private LISClient client = new LISClient("myagent"); private AgentController controller; private AgentSensor sensor; private MsgPack.CompiledPacker packer = new MsgPack.CompiledPacker(); bool created = false; public float Reward = 0.0F; void OnCollisionEnter(Collision col) { if(col.gameObject.tag == "Reward") { NotificationCenter.DefaultCenter.PostNotification(this, "OnRewardCollision"); } } byte[] GenerateMessage() { Message msg = new Message(); msg.reward = PlayerPrefs.GetFloat("Reward"); msg.image = sensor.GetRgbImages(); msg.depth = sensor.GetDepthImages(); return packer.Pack(msg); } void Start () { controller = GetComponent<AgentController>(); sensor = GetComponent<AgentSensor>(); } void Update () { if(!created) { client.Create(GenerateMessage()); created = true; } else { if(!client.Calling) { client.Step(GenerateMessage()); } if(client.HasAction) { string action = client.GetAction(); controller.PerformAction(action); } } } }
using UnityEngine; using MsgPack; [RequireComponent(typeof (AgentController))] [RequireComponent(typeof (AgentSensor))] public class AgentBehaviour : MonoBehaviour { private LISClient client = new LISClient("myagent"); private AgentController controller; private AgentSensor sensor; private MsgPack.CompiledPacker packer = new MsgPack.CompiledPacker(); bool created = false; public float Reward = 0.0F; void OnCollisionEnter(Collision col) { if(col.gameObject.tag == "Reward") { NotificationCenter.DefaultCenter.PostNotification(this, "OnRewardCollision"); } } byte[] GenerateMessage() { Message msg = new Message(); msg.reward = PlayerPrefs.GetFloat("Reward"); msg.image = sensor.GetRgbImages(); msg.depth = sensor.GetDepthImages(); return packer.Pack(msg); } void Start () { controller = GetComponent<AgentController>(); sensor = GetComponent<AgentSensor>(); } void Update () { if(!created) { if(!client.Calling) { client.Create(GenerateMessage()); created = true; } } else { if(!client.Calling) { client.Step(GenerateMessage()); } if(client.HasAction) { string action = client.GetAction(); controller.PerformAction(action); } } } }
Fix behaviour from calling create multiple times
Fix behaviour from calling create multiple times
C#
apache-2.0
pekin0609/-,wbap/hackathon-2017-sample,wbap/hackathon-2017-sample,pekin0609/-,wbap/hackathon-2017-sample,wbap/hackathon-2017-sample,pekin0609/-,pekin0609/-
5704e9ee6553de4324dffa802cdf7bbada5108ec
osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs
osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Catch.Judgements; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Catch.Scoring { internal class CatchScoreProcessor : ScoreProcessor<CatchBaseHit, CatchJudgement> { public CatchScoreProcessor() { } public CatchScoreProcessor(HitRenderer<CatchBaseHit, CatchJudgement> hitRenderer) : base(hitRenderer) { } protected override void OnNewJudgement(CatchJudgement judgement) { } } }
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Catch.Judgements; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Catch.Scoring { internal class CatchScoreProcessor : ScoreProcessor<CatchBaseHit, CatchJudgement> { public CatchScoreProcessor() { } public CatchScoreProcessor(HitRenderer<CatchBaseHit, CatchJudgement> hitRenderer) : base(hitRenderer) { } protected override void Reset() { base.Reset(); Health.Value = 1; Accuracy.Value = 1; } protected override void OnNewJudgement(CatchJudgement judgement) { } } }
Fix failing at beginning of map
Fix failing at beginning of map
C#
mit
naoey/osu,naoey/osu,DrabWeb/osu,ppy/osu,peppy/osu,peppy/osu,johnneijzen/osu,2yangk23/osu,UselessToucan/osu,UselessToucan/osu,naoey/osu,Nabile-Rahmani/osu,NeoAdonis/osu,smoogipooo/osu,smoogipoo/osu,EVAST9919/osu,smoogipoo/osu,ZLima12/osu,ppy/osu,DrabWeb/osu,2yangk23/osu,ZLima12/osu,johnneijzen/osu,EVAST9919/osu,peppy/osu-new,UselessToucan/osu,NeoAdonis/osu,NeoAdonis/osu,DrabWeb/osu,peppy/osu,smoogipoo/osu,Drezi126/osu,Frontear/osuKyzer,ppy/osu,Damnae/osu
a0f02a0346f53a50f65b7b36959ce8da64a1509a
src/Common/src/Interop/Windows/mincore/Interop.Normalization.cs
src/Common/src/Interop/Windows/mincore/Interop.Normalization.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; using System.Runtime.InteropServices; internal partial class Interop { // These are error codes we get back from the Normalization DLL internal const int ERROR_SUCCESS = 0; internal const int ERROR_NOT_ENOUGH_MEMORY = 8; internal const int ERROR_INVALID_PARAMETER = 87; internal const int ERROR_INSUFFICIENT_BUFFER = 122; internal const int ERROR_INVALID_NAME = 123; internal const int ERROR_NO_UNICODE_TRANSLATION = 1113; // The VM can override the last error code with this value in debug builds // so this value for us is equivalent to ERROR_SUCCESS internal const int LAST_ERROR_TRASH_VALUE = 42424; internal partial class mincore { // // Normalization APIs // [DllImport("api-ms-win-core-normalization-l1-1-0.dll", CharSet = CharSet.Unicode, SetLastError = true)] internal static extern bool IsNormalizedString(int normForm, string source, int length); [DllImport("api-ms-win-core-normalization-l1-1-0.dll", CharSet = CharSet.Unicode, SetLastError = true)] internal static extern int NormalizeString( int normForm, string source, int sourceLength, [System.Runtime.InteropServices.OutAttribute()] char[] destenation, int destenationLength); } }
// 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; using System.Runtime.InteropServices; internal partial class Interop { // These are error codes we get back from the Normalization DLL internal const int ERROR_SUCCESS = 0; internal const int ERROR_NOT_ENOUGH_MEMORY = 8; internal const int ERROR_INVALID_PARAMETER = 87; internal const int ERROR_INSUFFICIENT_BUFFER = 122; internal const int ERROR_INVALID_NAME = 123; internal const int ERROR_NO_UNICODE_TRANSLATION = 1113; // The VM can override the last error code with this value in debug builds // so this value for us is equivalent to ERROR_SUCCESS internal const int LAST_ERROR_TRASH_VALUE = 42424; internal partial class mincore { // // Normalization APIs // [DllImport("api-ms-win-core-normalization-l1-1-0.dll", CharSet = CharSet.Unicode, SetLastError = true)] internal static extern bool IsNormalizedString(int normForm, string source, int length); [DllImport("api-ms-win-core-normalization-l1-1-0.dll", CharSet = CharSet.Unicode, SetLastError = true)] internal static extern int NormalizeString( int normForm, string source, int sourceLength, [System.Runtime.InteropServices.OutAttribute()] char[] destination, int destinationLength); } }
Fix typos in NormalizeString P/Invoke signature
Fix typos in NormalizeString P/Invoke signature
C#
mit
elijah6/corefx,gkhanna79/corefx,mmitche/corefx,shmao/corefx,alphonsekurian/corefx,stephenmichaelf/corefx,dhoehna/corefx,zhenlan/corefx,Petermarcu/corefx,weltkante/corefx,MaggieTsang/corefx,ravimeda/corefx,DnlHarvey/corefx,rahku/corefx,ptoonen/corefx,cydhaselton/corefx,alphonsekurian/corefx,Petermarcu/corefx,yizhang82/corefx,richlander/corefx,wtgodbe/corefx,alphonsekurian/corefx,rjxby/corefx,nchikanov/corefx,manu-silicon/corefx,richlander/corefx,cydhaselton/corefx,richlander/corefx,krk/corefx,parjong/corefx,DnlHarvey/corefx,dotnet-bot/corefx,billwert/corefx,dotnet-bot/corefx,fgreinacher/corefx,seanshpark/corefx,nbarbettini/corefx,shmao/corefx,alexperovich/corefx,krytarowski/corefx,Ermiar/corefx,ericstj/corefx,mazong1123/corefx,parjong/corefx,shimingsg/corefx,marksmeltzer/corefx,dotnet-bot/corefx,Ermiar/corefx,Petermarcu/corefx,cydhaselton/corefx,elijah6/corefx,krytarowski/corefx,stephenmichaelf/corefx,YoupHulsebos/corefx,BrennanConroy/corefx,dotnet-bot/corefx,seanshpark/corefx,mazong1123/corefx,krk/corefx,shimingsg/corefx,cydhaselton/corefx,nbarbettini/corefx,Jiayili1/corefx,marksmeltzer/corefx,tijoytom/corefx,manu-silicon/corefx,Ermiar/corefx,Jiayili1/corefx,ericstj/corefx,stephenmichaelf/corefx,Jiayili1/corefx,gkhanna79/corefx,twsouthwick/corefx,shimingsg/corefx,dotnet-bot/corefx,yizhang82/corefx,Jiayili1/corefx,yizhang82/corefx,JosephTremoulet/corefx,axelheer/corefx,jlin177/corefx,nbarbettini/corefx,the-dwyer/corefx,axelheer/corefx,seanshpark/corefx,marksmeltzer/corefx,stone-li/corefx,jlin177/corefx,alexperovich/corefx,tijoytom/corefx,Petermarcu/corefx,shimingsg/corefx,stephenmichaelf/corefx,jlin177/corefx,the-dwyer/corefx,iamjasonp/corefx,manu-silicon/corefx,Ermiar/corefx,seanshpark/corefx,manu-silicon/corefx,jhendrixMSFT/corefx,ptoonen/corefx,mazong1123/corefx,YoupHulsebos/corefx,mazong1123/corefx,lggomez/corefx,stephenmichaelf/corefx,ravimeda/corefx,nchikanov/corefx,marksmeltzer/corefx,YoupHulsebos/corefx,wtgodbe/corefx,alphonsekurian/corefx,MaggieTsang/corefx,mazong1123/corefx,jhendrixMSFT/corefx,shmao/corefx,MaggieTsang/corefx,zhenlan/corefx,krk/corefx,lggomez/corefx,krytarowski/corefx,shimingsg/corefx,ViktorHofer/corefx,twsouthwick/corefx,ravimeda/corefx,nbarbettini/corefx,zhenlan/corefx,YoupHulsebos/corefx,lggomez/corefx,wtgodbe/corefx,parjong/corefx,krytarowski/corefx,rubo/corefx,ptoonen/corefx,stone-li/corefx,ptoonen/corefx,alexperovich/corefx,jhendrixMSFT/corefx,zhenlan/corefx,ericstj/corefx,weltkante/corefx,richlander/corefx,dhoehna/corefx,DnlHarvey/corefx,lggomez/corefx,billwert/corefx,tijoytom/corefx,cydhaselton/corefx,twsouthwick/corefx,krytarowski/corefx,billwert/corefx,axelheer/corefx,JosephTremoulet/corefx,DnlHarvey/corefx,wtgodbe/corefx,iamjasonp/corefx,twsouthwick/corefx,ptoonen/corefx,weltkante/corefx,ViktorHofer/corefx,dhoehna/corefx,yizhang82/corefx,weltkante/corefx,DnlHarvey/corefx,ravimeda/corefx,dotnet-bot/corefx,lggomez/corefx,nbarbettini/corefx,billwert/corefx,krk/corefx,jlin177/corefx,iamjasonp/corefx,marksmeltzer/corefx,cydhaselton/corefx,weltkante/corefx,rjxby/corefx,DnlHarvey/corefx,tijoytom/corefx,ravimeda/corefx,stone-li/corefx,ericstj/corefx,zhenlan/corefx,marksmeltzer/corefx,MaggieTsang/corefx,JosephTremoulet/corefx,elijah6/corefx,zhenlan/corefx,richlander/corefx,dhoehna/corefx,Jiayili1/corefx,tijoytom/corefx,BrennanConroy/corefx,jhendrixMSFT/corefx,fgreinacher/corefx,YoupHulsebos/corefx,nbarbettini/corefx,dhoehna/corefx,mmitche/corefx,iamjasonp/corefx,axelheer/corefx,krk/corefx,nbarbettini/corefx,rahku/corefx,rubo/corefx,JosephTremoulet/corefx,parjong/corefx,wtgodbe/corefx,ravimeda/corefx,krk/corefx,shmao/corefx,wtgodbe/corefx,rahku/corefx,ViktorHofer/corefx,Jiayili1/corefx,ericstj/corefx,weltkante/corefx,alexperovich/corefx,Petermarcu/corefx,stephenmichaelf/corefx,mazong1123/corefx,iamjasonp/corefx,cydhaselton/corefx,YoupHulsebos/corefx,stephenmichaelf/corefx,shimingsg/corefx,nchikanov/corefx,Jiayili1/corefx,Ermiar/corefx,fgreinacher/corefx,elijah6/corefx,mmitche/corefx,stone-li/corefx,mmitche/corefx,richlander/corefx,manu-silicon/corefx,JosephTremoulet/corefx,marksmeltzer/corefx,tijoytom/corefx,rjxby/corefx,elijah6/corefx,rubo/corefx,iamjasonp/corefx,nchikanov/corefx,jlin177/corefx,gkhanna79/corefx,alexperovich/corefx,alexperovich/corefx,gkhanna79/corefx,rahku/corefx,parjong/corefx,jhendrixMSFT/corefx,iamjasonp/corefx,billwert/corefx,Ermiar/corefx,ViktorHofer/corefx,YoupHulsebos/corefx,rjxby/corefx,rubo/corefx,alphonsekurian/corefx,fgreinacher/corefx,ptoonen/corefx,mazong1123/corefx,manu-silicon/corefx,yizhang82/corefx,ViktorHofer/corefx,rahku/corefx,mmitche/corefx,lggomez/corefx,nchikanov/corefx,twsouthwick/corefx,ptoonen/corefx,dhoehna/corefx,shmao/corefx,shmao/corefx,ericstj/corefx,alphonsekurian/corefx,mmitche/corefx,billwert/corefx,krytarowski/corefx,rahku/corefx,wtgodbe/corefx,parjong/corefx,MaggieTsang/corefx,parjong/corefx,stone-li/corefx,alphonsekurian/corefx,jlin177/corefx,yizhang82/corefx,the-dwyer/corefx,rahku/corefx,nchikanov/corefx,seanshpark/corefx,jhendrixMSFT/corefx,BrennanConroy/corefx,gkhanna79/corefx,rubo/corefx,seanshpark/corefx,jlin177/corefx,the-dwyer/corefx,Petermarcu/corefx,alexperovich/corefx,lggomez/corefx,zhenlan/corefx,tijoytom/corefx,rjxby/corefx,shimingsg/corefx,ViktorHofer/corefx,krk/corefx,axelheer/corefx,twsouthwick/corefx,billwert/corefx,ravimeda/corefx,DnlHarvey/corefx,axelheer/corefx,ericstj/corefx,seanshpark/corefx,mmitche/corefx,MaggieTsang/corefx,richlander/corefx,the-dwyer/corefx,yizhang82/corefx,weltkante/corefx,the-dwyer/corefx,krytarowski/corefx,manu-silicon/corefx,dhoehna/corefx,nchikanov/corefx,MaggieTsang/corefx,Ermiar/corefx,elijah6/corefx,gkhanna79/corefx,rjxby/corefx,stone-li/corefx,JosephTremoulet/corefx,JosephTremoulet/corefx,twsouthwick/corefx,the-dwyer/corefx,dotnet-bot/corefx,rjxby/corefx,elijah6/corefx,jhendrixMSFT/corefx,Petermarcu/corefx,ViktorHofer/corefx,shmao/corefx,gkhanna79/corefx,stone-li/corefx
dcc4a75094353c3f002e61f6fe20a4e04e32b469
src/Arkivverket.Arkade.CLI/Options/GenerateOptions.cs
src/Arkivverket.Arkade.CLI/Options/GenerateOptions.cs
using System.Collections.Generic; using CommandLine; using CommandLine.Text; namespace Arkivverket.Arkade.CLI.Options { [Verb("generate", HelpText = "Generate a specified file. Run this command followed by '--help' for more detailed info.")] public class GenerateOptions : OutputOptions { [Option('m', "metadata-example", Group = "file-type", HelpText = "Generate json file with example metadata.")] public bool GenerateMetadataExampleFile { get; set; } [Option('s', "noark5-test-selection", Group = "file-type", HelpText = "Generate text file with list of noark5 tests.")] public bool GenerateNoark5TestSelectionFile { get; set; } [Usage(ApplicationAlias = "arkade")] public static IEnumerable<Example> Examples { get { yield return new Example("Generate json file with metadata example", new GenerateOptions { OutputDirectory = "outputDirectory", GenerateMetadataExampleFile = true }); yield return new Example("Generate text file with list of noark5-test", new GenerateOptions { OutputDirectory = "outputDirectory", GenerateNoark5TestSelectionFile = true }); yield return new Example("Generate both files", new GenerateOptions { OutputDirectory = "outputDirectory", GenerateMetadataExampleFile = true, GenerateNoark5TestSelectionFile = true }); } } } }
using System.Collections.Generic; using CommandLine; using CommandLine.Text; namespace Arkivverket.Arkade.CLI.Options { [Verb("generate", HelpText = "Generate a specified file. Run this command followed by '--help' for more detailed info.")] public class GenerateOptions : OutputOptions { [Option('m', "metadata-example", Group = "file-type", HelpText = "Generate a metadata example file.")] public bool GenerateMetadataExampleFile { get; set; } [Option('s', "noark5-test-selection", Group = "file-type", HelpText = "Generate a Noark 5 test selection file.")] public bool GenerateNoark5TestSelectionFile { get; set; } [Usage(ApplicationAlias = "arkade")] public static IEnumerable<Example> Examples { get { yield return new Example("Generate a metadata example file", new GenerateOptions { OutputDirectory = "outputDirectory", GenerateMetadataExampleFile = true }); yield return new Example("Generate a Noark 5 test selection file", new GenerateOptions { OutputDirectory = "outputDirectory", GenerateNoark5TestSelectionFile = true }); yield return new Example("Generate a metadata example file and a Noark 5 test selection file", new GenerateOptions { OutputDirectory = "outputDirectory", GenerateMetadataExampleFile = true, GenerateNoark5TestSelectionFile = true }); } } } }
Improve help texts for CLI file generation
Improve help texts for CLI file generation
C#
agpl-3.0
arkivverket/arkade5,arkivverket/arkade5,arkivverket/arkade5
05d9247eaca33dad7c19aa187411545243387965
src/Prism.Plugin.Popups.Shared/AssemblyInfo-Shared.cs
src/Prism.Plugin.Popups.Shared/AssemblyInfo-Shared.cs
using System.Reflection; using System.Resources; [assembly: AssemblyCompany( "AvantiPoint, LLC" )] [assembly: AssemblyCopyright( "Copyright © Dan Siegel 2016" )] [assembly: NeutralResourcesLanguage( "en" )] [assembly: AssemblyVersion( "1.1.0.0" )] [assembly: AssemblyFileVersion( "1.1.0.0" )] [assembly: AssemblyInformationalVersion( "1.1.0-pre1" )]
using System.Reflection; using System.Resources; [assembly: AssemblyCompany( "AvantiPoint, LLC" )] [assembly: AssemblyCopyright( "Copyright © Dan Siegel 2016" )] [assembly: NeutralResourcesLanguage( "en" )] [assembly: AssemblyVersion( "1.1.0.0" )] [assembly: AssemblyFileVersion( "1.1.0.0" )] [assembly: AssemblyInformationalVersion( "1.1.0-pre2" )]
Update Informational Version to 1.1.0-pre2
Update Informational Version to 1.1.0-pre2
C#
mit
dansiegel/Prism.Plugin.Popups,dansiegel/Prism.Plugin.Popups
e25503fee385a502dd4b4b28563fdecf1507d969
food_tracker/FoodBoxItem.cs
food_tracker/FoodBoxItem.cs
using System.Windows.Controls; using System.Windows.Forms; namespace food_tracker { public class FoodBoxItem : ListBoxItem { public int calories { get; set; } public int fats { get; set; } public int saturatedFat { get; set; } public int carbohydrates { get; set; } public int sugar { get; set; } public int protein { get; set; } public int salt { get; set; } public string name { get; set; } public FoodBoxItem() : base() { } public FoodBoxItem(int cals, int fats, int satFat, int carbs, int sugars, int protein, int salt, string name) { this.name = name; this.calories = cals; this.fats = fats; this.salt = salt; this.saturatedFat = satFat; this.carbohydrates = carbs; this.sugar = sugars; this.protein = protein; } public override string ToString() { return name; } } }
using System.Windows.Controls; using System.Windows.Forms; namespace food_tracker { public class FoodBoxItem : ListBoxItem { public int calories { get; set; } public int fats { get; set; } public int saturatedFat { get; set; } public int carbohydrates { get; set; } public int sugar { get; set; } public int protein { get; set; } public int salt { get; set; } public int fibre { get; set; } public string name { get; set; } public FoodBoxItem() : base() { } public FoodBoxItem(int cals, int fats, int satFat, int carbs, int sugars, int protein, int salt, int fibre, string name) { this.name = name; this.calories = cals; this.fats = fats; this.salt = salt; this.saturatedFat = satFat; this.carbohydrates = carbs; this.sugar = sugars; this.protein = protein; this.fibre = fibre; } public override string ToString() { return name; } } }
Update food box item with fibre
Update food box item with fibre
C#
mit
lukecahill/NutritionTracker
d8022904aaaa686d25c44a4d33b8848ca7476871
Ductus.FluentDocker/Model/Containers/ContainerState.cs
Ductus.FluentDocker/Model/Containers/ContainerState.cs
using System; // ReSharper disable InconsistentNaming namespace Ductus.FluentDocker.Model.Containers { public sealed class ContainerState { public string Status { get; set; } public bool Running { get; set; } public bool Paused { get; set; } public bool Restarting { get; set; } public bool OOMKilled { get; set; } public bool Dead { get; set; } public int Pid { get; set; } public int ExitCode { get; set; } public string Error { get; set; } public DateTime StartedAt { get; set; } public DateTime FinishedAt { get; set; } public Health Health { get; set; } } }
using System; // ReSharper disable InconsistentNaming namespace Ductus.FluentDocker.Model.Containers { public sealed class ContainerState { public string Status { get; set; } public bool Running { get; set; } public bool Paused { get; set; } public bool Restarting { get; set; } public bool OOMKilled { get; set; } public bool Dead { get; set; } public int Pid { get; set; } public long ExitCode { get; set; } public string Error { get; set; } public DateTime StartedAt { get; set; } public DateTime FinishedAt { get; set; } public Health Health { get; set; } } }
Update ExitCode to long. This is because Windows Containers sometimes exit with 3221225725
Update ExitCode to long. This is because Windows Containers sometimes exit with 3221225725
C#
apache-2.0
mariotoffia/FluentDocker,mariotoffia/FluentDocker,mariotoffia/FluentDocker,mariotoffia/FluentDocker
ab3010f0b692eb51309bc17a08938103341893bb
WalletWasabi.Gui/ViewModels/WasabiWalletDocumentTabViewModel.cs
WalletWasabi.Gui/ViewModels/WasabiWalletDocumentTabViewModel.cs
using System; using System.Collections.Generic; using System.Text; using WalletWasabi.Gui.Controls.WalletExplorer; using WalletWasabi.Wallets; namespace WalletWasabi.Gui.ViewModels { public abstract class WasabiWalletDocumentTabViewModel : WasabiDocumentTabViewModel { protected WasabiWalletDocumentTabViewModel(string title, WalletViewModelBase walletViewModel) : base(title) { WalletViewModel = walletViewModel; } public WalletViewModelBase WalletViewModel { get; } public Wallet Wallet => WalletViewModel.Wallet; } }
using ReactiveUI; using Splat; using System; using System.Reactive.Linq; using WalletWasabi.Gui.Controls.WalletExplorer; using WalletWasabi.Wallets; namespace WalletWasabi.Gui.ViewModels { public abstract class WasabiWalletDocumentTabViewModel : WasabiDocumentTabViewModel { protected WasabiWalletDocumentTabViewModel(string title, WalletViewModelBase walletViewModel) : base(title) { WalletViewModel = walletViewModel; } public void ExpandWallet () { WalletViewModel.IsExpanded = true; } private WalletViewModelBase WalletViewModel { get; } protected Wallet Wallet => WalletViewModel.Wallet; } }
Make WalletViewModel private and WalletViewModelBase protected.
Make WalletViewModel private and WalletViewModelBase protected.
C#
mit
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
b0edd1cd690eee9483d82664b8091a3a85c303aa
Microsoft.TeamFoundation.Authentication/ITokenStore.cs
Microsoft.TeamFoundation.Authentication/ITokenStore.cs
using System; namespace Microsoft.TeamFoundation.Authentication { public interface ITokenStore { /// <summary> /// Deletes a <see cref="Token"/> from the underlying storage. /// </summary> /// <param name="targetUri">The key identifying which token is being deleted.</param> void DeleteToken(Uri targetUri); /// <summary> /// Reads a <see cref="Token"/> from the underlying storage. /// </summary> /// <param name="targetUri">The key identifying which token to read.</param> /// <param name="token">A <see cref="Token"/> if successful; otherwise false.</param> /// <returns>True if successful; otherwise false.</returns> bool ReadToken(Uri targetUri, out Token token); /// <summary> /// Writes a <see cref="Token"/> to the underlying storage. /// </summary> /// <param name="targetUri"> /// Unique identifier for the token, used when reading back from storage. /// </param> /// <param name="token">The <see cref="Token"/> to writen.</param> void WriteToken(Uri targetUri, Token token); } }
using System; namespace Microsoft.TeamFoundation.Authentication { public interface ITokenStore { /// <summary> /// Deletes a <see cref="Token"/> from the underlying storage. /// </summary> /// <param name="targetUri">The key identifying which token is being deleted.</param> void DeleteToken(Uri targetUri); /// <summary> /// Reads a <see cref="Token"/> from the underlying storage. /// </summary> /// <param name="targetUri">The key identifying which token to read.</param> /// <param name="token">A <see cref="Token"/> if successful; otherwise <see langword="null"/>.</param> /// <returns><see langword="true"/> if successful; otherwise <see langword="false"/>.</returns> bool ReadToken(Uri targetUri, out Token token); /// <summary> /// Writes a <see cref="Token"/> to the underlying storage. /// </summary> /// <param name="targetUri"> /// Unique identifier for the token, used when reading back from storage. /// </param> /// <param name="token">The <see cref="Token"/> to be written.</param> void WriteToken(Uri targetUri, Token token); } }
Fix typo and use <see langword=""/>.
Fix typo and use <see langword=""/>.
C#
mit
Alan-Lun/git-p3
e7cb93519a9f344a802eb66827052c5ae0421791
TimeLog.Api.Documentation/Views/Reporting/Index.cshtml
TimeLog.Api.Documentation/Views/Reporting/Index.cshtml
 @{ ViewBag.Title = "Reporting API - Introduction"; } <article class="article"> <h1>Introduction to the Reporting API</h1> <p> The Reporting API is based on standard web technologies, web services and XML. Use the Reporting API to extract from TimeLog into intranets, extranets, business reporting tools, applications etc. </p> <p> The idea behind the Reporting API is to give access to as much of the TimeLog Project data models as possible in a easy to use XML format. The origin of the API goes way back in the history of TimeLog, so we will extend on it on a per-request basis for new fields and data types. Please get in touch, if you think we lack some information in the various methods. </p> <p> Be aware that no security policies on user access will be applied to any of the methods in the Reporting API. The Reporting API is for flat data extractions. Take care to apply your own policies if you are exposing the data in a data warehouse or other business intelligence tools. </p> </article>
 @{ ViewBag.Title = "Reporting API - Introduction"; } <article class="article"> <h1>Introduction to the Reporting API</h1> <p> The Reporting API is based on standard web technologies, web services and XML. Use the Reporting API to extract from TimeLog into intranets, extranets, business reporting tools, applications etc. </p> <p> The idea behind the Reporting API is to give access to as much of the TimeLog Project data models as possible in a easy to use XML format. The origin of the API goes way back in the history of TimeLog, so we will extend on it on a per-request basis for new fields and data types. Please get in touch, if you think we lack some information in the various methods. </p> <p> Be aware that no security policies on user access will be applied to any of the methods in the Reporting API. The Reporting API is for flat data extractions. Take care to apply your own policies if you are exposing the data in a data warehouse or other business intelligence tools. </p> <h2 id="status-codes">Status codes</h2> <p> The reporting will (starting from end May 2021) return specific HTTP status codes related to the result. The result body will remain unchanged and will in many cases provide additional information. Possible status responses: </p> <ul class="arrows"> <li>200 OK - request successful</li> <li>204 No Content - the result of the request is empty</li> <li>400 Bad Request - covers both issues with input parameters, but possibly also internal errors</li> <li>401 Unauthorized - the Site ID, API ID and API password combination is invalid</li> </ul> </article>
Add information about http status codes in the reporting API
Add information about http status codes in the reporting API
C#
mit
TimeLog/TimeLogApiSdk,TimeLog/TimeLogApiSdk,TimeLog/TimeLogApiSdk
57b3c07aa4395260417e64781f2dc2137d932888
LtiLibrary.NetCore/Profiles/ToolConsumerProfileResponse.cs
LtiLibrary.NetCore/Profiles/ToolConsumerProfileResponse.cs
using System.Net; namespace LtiLibrary.NetCore.Profiles { public class ToolConsumerProfileResponse { public HttpStatusCode StatusCode { get; set; } public ToolConsumerProfile ToolConsumerProfile { get; set; } } }
using System.Net; namespace LtiLibrary.NetCore.Profiles { public class ToolConsumerProfileResponse { public string ContentType { get; set; } public HttpStatusCode StatusCode { get; set; } public ToolConsumerProfile ToolConsumerProfile { get; set; } } }
Add ContentType of the response.
Add ContentType of the response.
C#
apache-2.0
andyfmiller/LtiLibrary
f5eaedcc0fc9d51f0eb021ba652923d47a35fdf6
VSYard/VSYard/BraceMatching/BraceMatchingTaggerProvider.cs
VSYard/VSYard/BraceMatching/BraceMatchingTaggerProvider.cs
namespace VSYard.BraceMatching { using System; using System.Collections.Generic; using System.ComponentModel.Composition; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Classification; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Text.Tagging; using Microsoft.VisualStudio.Utilities; using System.Linq; using System.Windows.Media; [Export(typeof(EditorFormatDefinition))] [Name("green")] [UserVisible(true)] internal class HighlightFormatDefinition1 : MarkerFormatDefinition { public HighlightFormatDefinition1() { this.BackgroundColor = Colors.Aquamarine; this.ForegroundColor = Colors.Teal; this.DisplayName = "green element!"; this.ZOrder = 5; } } [Export(typeof(IViewTaggerProvider))] [ContentType("yardtype")] [TagType(typeof(TextMarkerTag))] internal class BraceMatchingTaggerProvider : IViewTaggerProvider { public ITagger<T> CreateTagger<T>(ITextView textView, ITextBuffer buffer) where T : ITag { if (textView == null) return null; //provide highlighting only on the top-level buffer if (textView.TextBuffer != buffer) return null; return new VSYardNS.BraceMatchingTagger(textView, buffer) as ITagger<T>; } } }
namespace VSYard.BraceMatching { using System; using System.Collections.Generic; using System.ComponentModel.Composition; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Classification; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Text.Tagging; using Microsoft.VisualStudio.Utilities; using System.Linq; using System.Windows.Media; using EnvDTE; using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Interop; [Export(typeof(EditorFormatDefinition))] [Name("green")] [UserVisible(true)] internal class HighlightFormatDefinition1 : MarkerFormatDefinition { public HighlightFormatDefinition1() { this.BackgroundColor = Colors.Aquamarine; this.ForegroundColor = Colors.Teal; this.DisplayName = "green element!"; this.ZOrder = 5; } } [Export(typeof(IViewTaggerProvider))] [ContentType("yardtype")] [TagType(typeof(TextMarkerTag))] internal class BraceMatchingTaggerProvider : IViewTaggerProvider { public ITagger<T> CreateTagger<T>(ITextView textView, ITextBuffer buffer) where T : ITag { //It is exampe of getting root *.yrd file of active project. //Should be removed var t = MyCompany.VSYard.Helpers.SolutionNavigatorHelper.GetRootYrd (MyCompany.VSYard.Helpers.SolutionNavigatorHelper.GetActiveProject()); if (textView == null) return null; //provide highlighting only on the top-level buffer if (textView.TextBuffer != buffer) return null; return new VSYardNS.BraceMatchingTagger(textView, buffer) as ITagger<T>; } } }
Add example of getting root YRD file.
Add example of getting root YRD file.
C#
apache-2.0
Albiglittle/YaccConstructor,sanyaade-g2g-repos/YaccConstructor,Albiglittle/YaccConstructor,sanyaade-g2g-repos/YaccConstructor,melentyev/YaccConstructor,RomanBelkov/YaccConstructor,fedorovr/YaccConstructor,YaccConstructor/YaccConstructor,sanyaade-g2g-repos/YaccConstructor,melentyev/YaccConstructor,fedorovr/YaccConstructor,nbIxMaN/YaccConstructor,VereshchaginaE/YaccConstructor,VereshchaginaE/YaccConstructor,YaccConstructor/YaccConstructor,fedorovr/YaccConstructor,nbIxMaN/YaccConstructor,melentyev/YaccConstructor,RomanBelkov/YaccConstructor,VereshchaginaE/YaccConstructor,YaccConstructor/YaccConstructor,nbIxMaN/YaccConstructor,Albiglittle/YaccConstructor,RomanBelkov/YaccConstructor
198fe94a9f999b4c97e1f9d2d2920eea374d0ada
src/Cake.Yarn/IYarnRunnerCommands.cs
src/Cake.Yarn/IYarnRunnerCommands.cs
using System; namespace Cake.Yarn { /// <summary> /// Yarn Runner command interface /// </summary> public interface IYarnRunnerCommands { /// <summary> /// execute 'yarn install' with options /// </summary> /// <param name="configure">options when running 'yarn install'</param> IYarnRunnerCommands Install(Action<YarnInstallSettings> configure = null); /// <summary> /// execute 'yarn add' with options /// </summary> /// <param name="configure">options when running 'yarn add'</param> IYarnRunnerCommands Add(Action<YarnAddSettings> configure = null); /// <summary> /// execute 'yarn run' with arguments /// </summary> /// <param name="scriptName">name of the </param> /// <param name="configure">options when running 'yarn run'</param> IYarnRunnerCommands RunScript(string scriptName, Action<YarnRunSettings> configure = null); /// <summary> /// execute 'yarn pack' with options /// </summary> /// <param name="packSettings">options when running 'yarn pack'</param> IYarnRunnerCommands Pack(Action<YarnPackSettings> packSettings = null); } }
using System; namespace Cake.Yarn { /// <summary> /// Yarn Runner command interface /// </summary> public interface IYarnRunnerCommands { /// <summary> /// execute 'yarn install' with options /// </summary> /// <param name="configure">options when running 'yarn install'</param> IYarnRunnerCommands Install(Action<YarnInstallSettings> configure = null); /// <summary> /// execute 'yarn add' with options /// </summary> /// <param name="configure">options when running 'yarn add'</param> IYarnRunnerCommands Add(Action<YarnAddSettings> configure = null); /// <summary> /// execute 'yarn run' with arguments /// </summary> /// <param name="scriptName">name of the </param> /// <param name="configure">options when running 'yarn run'</param> IYarnRunnerCommands RunScript(string scriptName, Action<YarnRunSettings> configure = null); /// <summary> /// execute 'yarn pack' with options /// </summary> /// <param name="packSettings">options when running 'yarn pack'</param> IYarnRunnerCommands Pack(Action<YarnPackSettings> packSettings = null); /// <summary> /// execute 'yarn version' with options /// </summary> /// <param name="versionSettings">options when running 'yarn version'</param> IYarnRunnerCommands Version(Action<YarnVersionSettings> versionSettings = null); } }
Add fix for missing method on interface
Add fix for missing method on interface
C#
mit
MilovanovM/cake-yarn,MilovanovM/cake-yarn
ba8894b725f347078cd550f430dbd593a9a64534
Ylp.GitDb.Core/ILogger.cs
Ylp.GitDb.Core/ILogger.cs
using System; using System.IO; using System.Threading.Tasks; namespace Ylp.GitDb.Core { public interface ILogger { Task Log(string message); } public class Logger : ILogger { public readonly string FileName; public Logger(string fileName) { FileName = fileName; } public Task Log(string message) { File.AppendAllText(FileName, $"{DateTime.Now.ToString("HH:mm:ss")}: {message}\n"); return Task.CompletedTask; } } }
using System; using System.Diagnostics; using System.IO; using System.Threading.Tasks; namespace Ylp.GitDb.Core { public interface ILogger { Task Log(string message); } public class Logger : ILogger { public readonly string FileName; static readonly object LockObj = new object(); public Logger(string fileName) { FileName = fileName; } public Task Log(string message) { lock(LockObj) File.AppendAllText(FileName, $"{DateTime.Now.ToString("HH:mm:ss")}: {message}\n"); return Task.CompletedTask; } } }
Make sure logging doesn't cause cross-thread access to the log-file
Bugfix: Make sure logging doesn't cause cross-thread access to the log-file
C#
mit
YellowLineParking/Ylp.GitDb