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
|
|---|---|---|---|---|---|---|---|---|---|
a5c29c69cf2eb2bcceb6adf1fe0fe3ad58772525
|
Tests/TextureTests.cs
|
Tests/TextureTests.cs
|
using System;
using System.Drawing.Imaging;
using System.IO;
using NUnit.Framework;
using ValveResourceFormat;
using ValveResourceFormat.ResourceTypes;
namespace Tests
{
public class TextureTests
{
[Test]
public void Test()
{
var path = Path.Combine(TestContext.CurrentContext.TestDirectory, "Files", "Textures");
var files = Directory.GetFiles(path, "*.vtex_c");
foreach (var file in files)
{
var resource = new Resource();
resource.Read(file);
var bitmap = ((Texture)resource.Blocks[BlockType.DATA]).GenerateBitmap();
using (var ms = new MemoryStream())
{
bitmap.Save(ms, ImageFormat.Png);
using (var expected = new FileStream(Path.ChangeExtension(file, "png"), FileMode.Open, FileAccess.Read))
{
FileAssert.AreEqual(expected, ms);
}
}
}
}
}
}
|
using System;
using System.Drawing.Imaging;
using System.IO;
using NUnit.Framework;
using ValveResourceFormat;
using ValveResourceFormat.ResourceTypes;
namespace Tests
{
public class TextureTests
{
[Test]
[Ignore("Need a better way of testing images rather than comparing the files directly")]
public void Test()
{
var path = Path.Combine(TestContext.CurrentContext.TestDirectory, "Files", "Textures");
var files = Directory.GetFiles(path, "*.vtex_c");
foreach (var file in files)
{
var resource = new Resource();
resource.Read(file);
var bitmap = ((Texture)resource.Blocks[BlockType.DATA]).GenerateBitmap();
using (var ms = new MemoryStream())
{
bitmap.Save(ms, ImageFormat.Png);
using (var expected = new FileStream(Path.ChangeExtension(file, "png"), FileMode.Open, FileAccess.Read))
{
FileAssert.AreEqual(expected, ms);
}
}
}
}
}
}
|
Disable text tests for now
|
Disable text tests for now
|
C#
|
mit
|
SteamDatabase/ValveResourceFormat
|
ae7f4f9a1a47dbb08e51a99fc6edbc0598334ba1
|
src/Swashbuckle.AspNetCore.SwaggerUI/Application/SwaggerUIBuilderExtensions.cs
|
src/Swashbuckle.AspNetCore.SwaggerUI/Application/SwaggerUIBuilderExtensions.cs
|
using System;
using Microsoft.AspNetCore.StaticFiles;
using Swashbuckle.AspNetCore.SwaggerUI;
namespace Microsoft.AspNetCore.Builder
{
public static class SwaggerUIBuilderExtensions
{
public static IApplicationBuilder UseSwaggerUI(
this IApplicationBuilder app,
Action<SwaggerUIOptions> setupAction)
{
var options = new SwaggerUIOptions();
setupAction?.Invoke(options);
// Serve swagger-ui assets with the FileServer middleware, using a custom FileProvider
// to inject parameters into "index.html"
var fileServerOptions = new FileServerOptions
{
RequestPath = $"/{options.RoutePrefix}",
FileProvider = new SwaggerUIFileProvider(options.IndexSettings.ToTemplateParameters()),
EnableDefaultFiles = true, // serve index.html at /{options.RoutePrefix}/
};
fileServerOptions.StaticFileOptions.ContentTypeProvider = new FileExtensionContentTypeProvider();
app.UseFileServer(fileServerOptions);
return app;
}
}
}
|
using System;
using Microsoft.AspNetCore.StaticFiles;
using Swashbuckle.AspNetCore.SwaggerUI;
namespace Microsoft.AspNetCore.Builder
{
public static class SwaggerUIBuilderExtensions
{
public static IApplicationBuilder UseSwaggerUI(
this IApplicationBuilder app,
Action<SwaggerUIOptions> setupAction)
{
var options = new SwaggerUIOptions();
setupAction?.Invoke(options);
// Serve swagger-ui assets with the FileServer middleware, using a custom FileProvider
// to inject parameters into "index.html"
var fileServerOptions = new FileServerOptions
{
RequestPath = string.IsNullOrWhiteSpace(options.RoutePrefix) ? string.Empty : $"/{options.RoutePrefix}",
FileProvider = new SwaggerUIFileProvider(options.IndexSettings.ToTemplateParameters()),
EnableDefaultFiles = true, // serve index.html at /{options.RoutePrefix}/
};
fileServerOptions.StaticFileOptions.ContentTypeProvider = new FileExtensionContentTypeProvider();
app.UseFileServer(fileServerOptions);
return app;
}
}
}
|
Support to map swagger UI to application root url
|
Support to map swagger UI to application root url
UseSwaggerUI will check for special case empty RoutePrefix and allow mapping swagger UI to application root url.
|
C#
|
mit
|
domaindrivendev/Swashbuckle.AspNetCore,domaindrivendev/Ahoy,domaindrivendev/Swashbuckle.AspNetCore,domaindrivendev/Ahoy,domaindrivendev/Swashbuckle.AspNetCore,domaindrivendev/Ahoy
|
09f9c480e4073cbbd1e7e5759a28c512e0ad1485
|
src/PowerShellEditorServices.Protocol/LanguageServer/Hover.cs
|
src/PowerShellEditorServices.Protocol/LanguageServer/Hover.cs
|
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{
public class MarkedString
{
public string Language { get; set; }
public string Value { get; set; }
}
public class Hover
{
public MarkedString[] Contents { get; set; }
public Range? Range { get; set; }
}
public class HoverRequest
{
public static readonly
RequestType<TextDocumentPositionParams, Hover, object, object> Type =
RequestType<TextDocumentPositionParams, Hover, object, object>.Create("textDocument/hover");
}
}
|
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{
public class MarkedString
{
public string Language { get; set; }
public string Value { get; set; }
}
public class Hover
{
public MarkedString[] Contents { get; set; }
public Range? Range { get; set; }
}
public class HoverRequest
{
public static readonly
RequestType<TextDocumentPositionParams, Hover, object, TextDocumentRegistrationOptions> Type =
RequestType<TextDocumentPositionParams, Hover, object, TextDocumentRegistrationOptions>.Create("textDocument/hover");
}
}
|
Add registration options for hover request
|
Add registration options for hover request
|
C#
|
mit
|
PowerShell/PowerShellEditorServices
|
4b20df12cd15c09ad002aa85dec6a4af83bbaa99
|
build.cake
|
build.cake
|
//#tool nuget:?package=NUnit.ConsoleRunner&version=3.4.0
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
// Define directories.
var buildDir = Directory("./src/Example/bin") + Directory(configuration);
Task("Clean")
.Does(() =>
{
CleanDirectory(buildDir);
});
Task("Restore-NuGet-Packages")
.IsDependentOn("Clean")
.Does(() =>
{
NuGetRestore("./Live.Forms.iOS.sln");
});
Task("Build")
.IsDependentOn("Restore-NuGet-Packages")
.Does(() =>
{
if(IsRunningOnWindows())
{
// Use MSBuild
MSBuild("./Live.Forms.iOS.sln", settings =>
settings.SetConfiguration(configuration));
}
else
{
// Use XBuild
XBuild("./Live.Forms.iOS.sln", settings =>
settings.SetConfiguration(configuration));
}
});
Task("Default")
.IsDependentOn("Build");
RunTarget(target);
|
//#tool nuget:?package=NUnit.ConsoleRunner&version=3.4.0
string target = Argument("target", "Default");
string configuration = Argument("configuration", "Release");
// Define directories.
var dirs = new[]
{
Directory("./Live.Forms/bin") + Directory(configuration),
Directory("./Live.Forms.iOS/bin") + Directory(configuration),
};
string sln = "./Live.Forms.iOS.sln";
Task("Clean")
.Does(() =>
{
foreach (var dir in dirs)
CleanDirectory(dir);
});
Task("Restore-NuGet-Packages")
.IsDependentOn("Clean")
.Does(() =>
{
NuGetRestore(sln);
});
Task("Build")
.IsDependentOn("Restore-NuGet-Packages")
.Does(() =>
{
if(IsRunningOnWindows())
{
// Use MSBuild
MSBuild(sln, settings =>
settings
.WithProperty("Platform", new[] { "iPhoneSimulator" })
.SetConfiguration(configuration));
}
else
{
// Use XBuild
XBuild(sln, settings =>
settings
.WithProperty("Platform", new[] { "iPhoneSimulator" })
.SetConfiguration(configuration));
}
});
Task("Default")
.IsDependentOn("Build");
RunTarget(target);
|
Build Script - cleanup and filling out vars
|
Build Script - cleanup and filling out vars
|
C#
|
mit
|
jonathanpeppers/Live.Forms.iOS,jonathanpeppers/Live.Forms.iOS
|
cb7252a97e46a6e21ead7ce5ff4b5d40db8d70d5
|
Kandanda/Kandanda.Dal/KandandaDbContext.cs
|
Kandanda/Kandanda.Dal/KandandaDbContext.cs
|
using System.Data.Entity;
using Kandanda.Dal.DataTransferObjects;
namespace Kandanda.Dal
{
public class KandandaDbContext : DbContext
{
public KandandaDbContext()
{
Database.SetInitializer(new SampleDataDbInitializer());
}
public DbSet<Tournament> Tournaments { get; set; }
public DbSet<Participant> Participants { get; set; }
public DbSet<Match> Matches { get; set; }
public DbSet<Place> Places { get; set; }
public DbSet<Phase> Phases { get; set; }
public DbSet<TournamentParticipant> TournamentParticipants { get; set; }
}
}
|
using System.Data.Entity;
using Kandanda.Dal.DataTransferObjects;
namespace Kandanda.Dal
{
public class KandandaDbContext : DbContext
{
public KandandaDbContext()
{
// TODO fix SetInitializer for tests
Database.SetInitializer(new DropCreateDatabaseAlways<KandandaDbContext>());
}
public DbSet<Tournament> Tournaments { get; set; }
public DbSet<Participant> Participants { get; set; }
public DbSet<Match> Matches { get; set; }
public DbSet<Place> Places { get; set; }
public DbSet<Phase> Phases { get; set; }
public DbSet<TournamentParticipant> TournamentParticipants { get; set; }
}
}
|
Fix tests, but not seeding Database anymore
|
Fix tests, but not seeding Database anymore
|
C#
|
mit
|
kandanda/Client,kandanda/Client
|
99e63ec2fa2c385de65b5569d82cda40e3ff2196
|
source/nuPickers/Shared/DotNetDataSource/DotNetDataSource.cs
|
source/nuPickers/Shared/DotNetDataSource/DotNetDataSource.cs
|
namespace nuPickers.Shared.DotNetDataSource
{
using nuPickers.Shared.Editor;
using System;
using System.Reflection;
using System.Collections.Generic;
using System.Linq;
public class DotNetDataSource
{
public string AssemblyName { get; set; }
public string ClassName { get; set; }
public IEnumerable<DotNetDataSourceProperty> Properties { get; set; }
public IEnumerable<EditorDataItem> GetEditorDataItems()
{
List<EditorDataItem> editorDataItems = new List<EditorDataItem>();
object dotNetDataSource = Activator.CreateInstance(this.AssemblyName, this.ClassName).Unwrap();
foreach (PropertyInfo propertyInfo in dotNetDataSource.GetType().GetProperties().Where(x => this.Properties.Select(y => y.Name).Contains(x.Name)))
{
if (propertyInfo.PropertyType == typeof(string))
{
propertyInfo.SetValue(dotNetDataSource, this.Properties.Where(x => x.Name == propertyInfo.Name).Single().Value);
}
else
{
// TODO: log unexpected property type
}
}
return ((IDotNetDataSource)dotNetDataSource)
.GetEditorDataItems()
.Select(x => new EditorDataItem() { Key = x.Key, Label = x.Value });
}
}
}
|
namespace nuPickers.Shared.DotNetDataSource
{
using nuPickers.Shared.Editor;
using System;
using System.Reflection;
using System.Collections.Generic;
using System.Linq;
public class DotNetDataSource
{
public string AssemblyName { get; set; }
public string ClassName { get; set; }
public IEnumerable<DotNetDataSourceProperty> Properties { get; set; }
public IEnumerable<EditorDataItem> GetEditorDataItems()
{
List<EditorDataItem> editorDataItems = new List<EditorDataItem>();
object dotNetDataSource = Helper.GetAssembly(this.AssemblyName).CreateInstance(this.ClassName);
foreach (PropertyInfo propertyInfo in dotNetDataSource.GetType().GetProperties().Where(x => this.Properties.Select(y => y.Name).Contains(x.Name)))
{
if (propertyInfo.PropertyType == typeof(string))
{
propertyInfo.SetValue(dotNetDataSource, this.Properties.Where(x => x.Name == propertyInfo.Name).Single().Value);
}
else
{
// TODO: log unexpected property type
}
}
return ((IDotNetDataSource)dotNetDataSource)
.GetEditorDataItems()
.Select(x => new EditorDataItem() { Key = x.Key, Label = x.Value });
}
}
}
|
Use Helper to create instance from assembly
|
Use Helper to create instance from assembly
Activator takes a full path to the assembly and we only have the
assembly file name.
|
C#
|
mit
|
iahdevelop/nuPickers,JimBobSquarePants/nuPickers,LottePitcher/nuPickers,uComponents/nuPickers,abjerner/nuPickers,JimBobSquarePants/nuPickers,pgregorynz/nuPickers,iahdevelop/nuPickers,abjerner/nuPickers,pgregorynz/nuPickers,uComponents/nuPickers,pgregorynz/nuPickers,JimBobSquarePants/nuPickers,iahdevelop/nuPickers,abjerner/nuPickers,LottePitcher/nuPickers,uComponents/nuPickers,LottePitcher/nuPickers,pgregorynz/nuPickers
|
e583bf86a1c5afd34f9de2e41106259f79cdd063
|
src/Certify.Core.Models/Models/Shared/RenewalStatusReport.cs
|
src/Certify.Core.Models/Models/Shared/RenewalStatusReport.cs
|
namespace Certify.Models.Shared
{
public class RenewalStatusReport
{
public string InstanceId { get; set; }
public string MachineName { get; set; }
public ManagedSite ManagedSite { get; set; }
public string PrimaryContactEmail { get; set; }
public string AppVersion { get; set; }
}
}
|
using System;
namespace Certify.Models.Shared
{
public class RenewalStatusReport
{
public string InstanceId { get; set; }
public string MachineName { get; set; }
public ManagedSite ManagedSite { get; set; }
public string PrimaryContactEmail { get; set; }
public string AppVersion { get; set; }
public DateTime? DateReported { get; set; }
}
}
|
Add date to status report
|
Add date to status report
|
C#
|
mit
|
ndouthit/Certify,webprofusion/Certify,Prerequisite/Certify
|
f9f5f94206f41acfd26c499ad3518b3f9da64e2e
|
src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.Types/Responses/GetDraftApprenticeshipResponse.cs
|
src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.Types/Responses/GetDraftApprenticeshipResponse.cs
|
using System;
using SFA.DAS.CommitmentsV2.Types;
namespace SFA.DAS.CommitmentsV2.Api.Types.Responses
{
public sealed class GetDraftApprenticeshipResponse
{
public long Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Email { get; set; }
public string Uln { get; set; }
public string CourseCode { get; set; }
public DeliveryModel DeliveryModel { get; set; }
public string TrainingCourseName { get; set; }
public string TrainingCourseVersion { get; set; }
public string TrainingCourseOption { get; set; }
public bool TrainingCourseVersionConfirmed { get; set; }
public string StandardUId { get; set; }
public int? Cost { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
public DateTime? DateOfBirth { get; set; }
public string Reference { get; set; }
public Guid? ReservationId { get; set; }
public bool IsContinuation { get; set; }
public DateTime? OriginalStartDate { get; set; }
public bool HasStandardOptions { get; set; }
public int? EmploymentPrice { get; set; }
public DateTime? EmploymentEndDate { get; set; }
}
}
|
using System;
using SFA.DAS.CommitmentsV2.Types;
namespace SFA.DAS.CommitmentsV2.Api.Types.Responses
{
public sealed class GetDraftApprenticeshipResponse
{
public long Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Email { get; set; }
public string Uln { get; set; }
public string CourseCode { get; set; }
public DeliveryModel DeliveryModel { get; set; }
public string TrainingCourseName { get; set; }
public string TrainingCourseVersion { get; set; }
public string TrainingCourseOption { get; set; }
public bool TrainingCourseVersionConfirmed { get; set; }
public string StandardUId { get; set; }
public int? Cost { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
public DateTime? DateOfBirth { get; set; }
public string Reference { get; set; }
public Guid? ReservationId { get; set; }
public bool IsContinuation { get; set; }
public DateTime? OriginalStartDate { get; set; }
public bool HasStandardOptions { get; set; }
public int? EmploymentPrice { get; set; }
public DateTime? EmploymentEndDate { get; set; }
public bool? HasPriorLearning { get; set; }
}
}
|
Add `HasPriorLearning` to draft response
|
Add `HasPriorLearning` to draft response
|
C#
|
mit
|
SkillsFundingAgency/das-commitments,SkillsFundingAgency/das-commitments,SkillsFundingAgency/das-commitments
|
422fbf36a7495d5cbfbd30d01eec1377c3d6c291
|
Discovery/src/AspDotNet4/Fortune-Teller-Service4/Global.asax.cs
|
Discovery/src/AspDotNet4/Fortune-Teller-Service4/Global.asax.cs
|
using Autofac;
using Autofac.Integration.WebApi;
using FortuneTellerService4.Models;
using Pivotal.Discovery.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Http;
using System.Web.Routing;
namespace FortuneTellerService4
{
public class WebApiApplication : System.Web.HttpApplication
{
private IDiscoveryClient _client;
protected void Application_Start()
{
GlobalConfiguration.Configure(WebApiConfig.Register);
var config = GlobalConfiguration.Configuration;
// Build application configuration
ServerConfig.RegisterConfig("development");
// Create IOC container builder
var builder = new ContainerBuilder();
// Register your Web API controllers.
builder.RegisterApiControllers(Assembly.GetExecutingAssembly());
// Register IDiscoveryClient, etc.
builder.RegisterDiscoveryClient(ServerConfig.Configuration);
// Initialize and Register FortuneContext
builder.RegisterInstance(SampleData.InitializeFortunes()).SingleInstance();
// Register FortuneRepository
builder.RegisterType<FortuneRepository>().As<IFortuneRepository>().SingleInstance();
var container = builder.Build();
config.DependencyResolver = new AutofacWebApiDependencyResolver(container);
// Start the Discovery client background thread
_client = container.Resolve<IDiscoveryClient>();
}
}
}
|
using Autofac;
using Autofac.Integration.WebApi;
using FortuneTellerService4.Models;
using Pivotal.Discovery.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Http;
using System.Web.Routing;
namespace FortuneTellerService4
{
public class WebApiApplication : System.Web.HttpApplication
{
private IDiscoveryClient _client;
protected void Application_Start()
{
GlobalConfiguration.Configure(WebApiConfig.Register);
var config = GlobalConfiguration.Configuration;
// Build application configuration
ServerConfig.RegisterConfig("development");
// Create IOC container builder
var builder = new ContainerBuilder();
// Register your Web API controllers.
builder.RegisterApiControllers(Assembly.GetExecutingAssembly());
// Register IDiscoveryClient, etc.
builder.RegisterDiscoveryClient(ServerConfig.Configuration);
// Initialize and Register FortuneContext
builder.RegisterInstance(SampleData.InitializeFortunes()).SingleInstance();
// Register FortuneRepository
builder.RegisterType<FortuneRepository>().As<IFortuneRepository>().SingleInstance();
var container = builder.Build();
config.DependencyResolver = new AutofacWebApiDependencyResolver(container);
// Start the Discovery client background thread
_client = container.Resolve<IDiscoveryClient>();
}
protected void Application_End()
{
// Unregister current app with Service Discovery server
_client.ShutdownAsync();
}
}
}
|
Fix FortuneTeller for .NET4 not unregistering from eureka on app shutdown
|
Fix FortuneTeller for .NET4 not unregistering from eureka on app shutdown
|
C#
|
apache-2.0
|
SteelToeOSS/Samples,SteelToeOSS/Samples,SteelToeOSS/Samples,SteelToeOSS/Samples
|
3372cec70513765fe9065db13c3afb25f9c147a7
|
src/Stunts/Stunts.Tests/StuntNamingTests.cs
|
src/Stunts/Stunts.Tests/StuntNamingTests.cs
|
using System;
using Xunit;
namespace Stunts.Tests
{
public class StuntNamingTests
{
[Theory]
[InlineData("StuntFactoryIDisposableIServiceProvider" + StuntNaming.DefaultSuffix, typeof(StuntFactory), typeof(IServiceProvider), typeof(IDisposable))]
public void GetNameOrdersTypes(string expectedName, Type baseType, params Type[] implementedInterfaces)
=> Assert.Equal(expectedName, StuntNaming.GetName(baseType, implementedInterfaces));
[Theory]
[InlineData(StuntNaming.DefaultNamespace + ".StuntFactoryIDisposableIServiceProvider" + StuntNaming.DefaultSuffix, typeof(StuntFactory), typeof(IServiceProvider), typeof(IDisposable))]
public void GetFullNameOrdersTypes(string expectedName, Type baseType, params Type[] implementedInterfaces)
=> Assert.Equal(expectedName, StuntNaming.GetFullName(baseType, implementedInterfaces));
}
}
|
using System;
using System.Collections.Generic;
using Xunit;
namespace Stunts.Tests
{
public class StuntNamingTests
{
[Theory]
[InlineData("StuntFactoryIDisposableIServiceProvider" + StuntNaming.DefaultSuffix, typeof(StuntFactory), typeof(IServiceProvider), typeof(IDisposable))]
[InlineData("IEnumerableOfIDisposableIServiceProvider" + StuntNaming.DefaultSuffix, typeof(IEnumerable<IDisposable>), typeof(IServiceProvider))]
public void GetNameOrdersTypes(string expectedName, Type baseType, params Type[] implementedInterfaces)
=> Assert.Equal(expectedName, StuntNaming.GetName(baseType, implementedInterfaces));
[Theory]
[InlineData(StuntNaming.DefaultNamespace + ".StuntFactoryIDisposableIServiceProvider" + StuntNaming.DefaultSuffix, typeof(StuntFactory), typeof(IServiceProvider), typeof(IDisposable))]
[InlineData(StuntNaming.DefaultNamespace + ".IEnumerableOfIDisposableIServiceProvider" + StuntNaming.DefaultSuffix, typeof(IEnumerable<IDisposable>), typeof(IServiceProvider))]
public void GetFullNameOrdersTypes(string expectedName, Type baseType, params Type[] implementedInterfaces)
=> Assert.Equal(expectedName, StuntNaming.GetFullName(baseType, implementedInterfaces));
}
}
|
Add extra test for generic type for naming
|
Add extra test for generic type for naming
|
C#
|
apache-2.0
|
Moq/moq
|
38a7b285ff324d959d26a0a2d391feb6029123e1
|
Cogito.Core.Tests/Net/Http/HttpMessageEventSourceTests.cs
|
Cogito.Core.Tests/Net/Http/HttpMessageEventSourceTests.cs
|
using System;
using System.Diagnostics.Eventing.Reader;
using System.Net;
using System.Net.Http;
using Cogito.Net.Http;
using Microsoft.Diagnostics.Tracing;
using Microsoft.Diagnostics.Tracing.Session;
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Utility;
using Microsoft.Samples.Eventing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Cogito.Tests.Net.Http
{
[TestClass]
public class HttpMessageEventSourceTests
{
[TestMethod]
public void Test_EventSource()
{
EventSourceAnalyzer.InspectAll(HttpMessageEventSource.Current);
}
[TestMethod]
public void Test_Request()
{
using (var session = new TraceEventSession("MyRealTimeSession"))
{
session.Source.Dynamic.All += data => Console.WriteLine("GOT Event " + data);
session.EnableProvider(TraceEventProviders.GetEventSourceGuidFromName("Cogito-Net-Http-Messages"));
HttpMessageEventSource.Current.Request(new HttpRequestMessage(HttpMethod.Get, new Uri("http://www.tempuri.com"))
{
});
session.Source.Process();
}
}
[TestMethod]
public void Test_Response()
{
HttpMessageEventSource.Current.Response(new HttpResponseMessage(HttpStatusCode.OK));
}
}
}
|
using System;
using System.Diagnostics.Eventing.Reader;
using System.Net;
using System.Net.Http;
using Cogito.Net.Http;
using Microsoft.Diagnostics.Tracing;
using Microsoft.Diagnostics.Tracing.Session;
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Utility;
using Microsoft.Samples.Eventing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Cogito.Tests.Net.Http
{
[TestClass]
public class HttpMessageEventSourceTests
{
[TestMethod]
public void Test_EventSource()
{
EventSourceAnalyzer.InspectAll(HttpMessageEventSource.Current);
}
//[TestMethod]
//public void Test_Request()
//{
// using (var session = new TraceEventSession("MyRealTimeSession"))
// {
// session.Source.Dynamic.All += data => Console.WriteLine("GOT Event " + data);
// session.EnableProvider(TraceEventProviders.GetEventSourceGuidFromName("Cogito-Net-Http-Messages"));
// HttpMessageEventSource.Current.Request(new HttpRequestMessage(HttpMethod.Get, new Uri("http://www.tempuri.com"))
// {
// });
// session.Source.Process();
// }
//}
//[TestMethod]
//public void Test_Response()
//{
// HttpMessageEventSource.Current.Response(new HttpResponseMessage(HttpStatusCode.OK));
//}
}
}
|
Disable broken test session thing.
|
Disable broken test session thing.
|
C#
|
mit
|
wasabii/Cogito,wasabii/Cogito
|
f4f3588047606c5210beec97b06436d3c7e765ac
|
Puppy/MenuService/MenuItem.cs
|
Puppy/MenuService/MenuItem.cs
|
#region Using
using System.Collections.Generic;
using System.Windows.Input;
using PuppyFramework.Services;
#endregion
namespace PuppyFramework.MenuService
{
public class MenuItem : MenuItemBase
{
#region Fields
private ObservableSortedList<MenuItemBase> _children;
private string _title;
#endregion
#region Properties
public object CommandParamter { get; set; }
public CommandBinding CommandBinding { get; set; }
public ObservableSortedList<MenuItemBase> Children
{
get { return _children; }
private set { SetProperty(ref _children, value); }
}
public string Title
{
get { return _title; }
protected set { SetProperty(ref _title, value); }
}
#endregion
#region Constructors
public MenuItem(string title, double weight)
: base(weight)
{
Title = title;
Children = new ObservableSortedList<MenuItemBase>();
HiddenFlag = false;
}
#endregion
#region Methods
public void AddChild(MenuItemBase child, IComparer<MenuItemBase> menuItemComparer = null)
{
Children.Add(child);
if (menuItemComparer != null)
{
Children.Sort(menuItemComparer);
}
}
public bool RemoveChild(MenuItemBase child)
{
return Children.Remove(child);
}
#endregion
}
}
|
#region Using
using System.Collections.Generic;
using System.Windows.Input;
using PuppyFramework.Services;
#endregion
namespace PuppyFramework.MenuService
{
public class MenuItem : MenuItemBase
{
#region Fields
private ObservableSortedList<MenuItemBase> _children;
private string _title;
#endregion
#region Properties
public object CommandParameter { get; set; }
public CommandBinding CommandBinding { get; set; }
public ObservableSortedList<MenuItemBase> Children
{
get { return _children; }
private set { SetProperty(ref _children, value); }
}
public string Title
{
get { return _title; }
protected set { SetProperty(ref _title, value); }
}
#endregion
#region Constructors
public MenuItem(string title, double weight)
: base(weight)
{
Title = title;
Children = new ObservableSortedList<MenuItemBase>();
HiddenFlag = false;
}
#endregion
#region Methods
public void AddChild(MenuItemBase child, IComparer<MenuItemBase> menuItemComparer = null)
{
Children.Add(child);
if (menuItemComparer != null)
{
Children.Sort(menuItemComparer);
}
}
public bool RemoveChild(MenuItemBase child)
{
return Children.Remove(child);
}
#endregion
}
}
|
Fix bug - command parameter is always null.
|
Fix bug - command parameter is always null.
|
C#
|
mit
|
ashokgelal/Puppy
|
567a7b6d48c3c0ebead0a6635c6b36da50ba34c9
|
src/Senders/FluentEmail.Smtp/FluentEmailSmtpBuilderExtensions.cs
|
src/Senders/FluentEmail.Smtp/FluentEmailSmtpBuilderExtensions.cs
|
using FluentEmail.Core.Interfaces;
using FluentEmail.Smtp;
using Microsoft.Extensions.DependencyInjection.Extensions;
using System;
using System.Net;
using System.Net.Mail;
namespace Microsoft.Extensions.DependencyInjection
{
public static class FluentEmailSmtpBuilderExtensions
{
public static FluentEmailServicesBuilder AddSmtpSender(this FluentEmailServicesBuilder builder, SmtpClient smtpClient)
{
builder.Services.TryAdd(ServiceDescriptor.Scoped<ISender>(x => new SmtpSender(smtpClient)));
return builder;
}
public static FluentEmailServicesBuilder AddSmtpSender(this FluentEmailServicesBuilder builder, string host, int port) => AddSmtpSender(builder, new SmtpClient(host, port));
public static FluentEmailServicesBuilder AddSmtpSender(this FluentEmailServicesBuilder builder, string host, int port, string username, string password) => AddSmtpSender(builder,
new SmtpClient(host, port) { EnableSsl = true, Credentials = new NetworkCredential (username, password) });
public static FluentEmailServicesBuilder AddSmtpSender(this FluentEmailServicesBuilder builder, Func<SmtpClient> clientFactory)
{
builder.Services.TryAdd(ServiceDescriptor.Scoped<ISender>(x => new SmtpSender(clientFactory)));
return builder;
}
}
}
|
using FluentEmail.Core.Interfaces;
using FluentEmail.Smtp;
using Microsoft.Extensions.DependencyInjection.Extensions;
using System;
using System.Net;
using System.Net.Mail;
namespace Microsoft.Extensions.DependencyInjection
{
public static class FluentEmailSmtpBuilderExtensions
{
public static FluentEmailServicesBuilder AddSmtpSender(this FluentEmailServicesBuilder builder, SmtpClient smtpClient)
{
builder.Services.TryAdd(ServiceDescriptor.Singleton<ISender>(x => new SmtpSender(smtpClient)));
return builder;
}
public static FluentEmailServicesBuilder AddSmtpSender(this FluentEmailServicesBuilder builder, string host, int port) => AddSmtpSender(builder, () => new SmtpClient(host, port));
public static FluentEmailServicesBuilder AddSmtpSender(this FluentEmailServicesBuilder builder, string host, int port, string username, string password) => AddSmtpSender(builder,
() => new SmtpClient(host, port) { EnableSsl = true, Credentials = new NetworkCredential (username, password) });
public static FluentEmailServicesBuilder AddSmtpSender(this FluentEmailServicesBuilder builder, Func<SmtpClient> clientFactory)
{
builder.Services.TryAdd(ServiceDescriptor.Scoped<ISender>(x => new SmtpSender(clientFactory)));
return builder;
}
}
}
|
Fix AddSmtpSender extension methods to property add service
|
Fix AddSmtpSender extension methods to property add service
Resolves "An asynchronous call is already in progress." error message due to SmtpClient being instantiated during startup and reused, irrespective of it being defined as a Scoped service.
|
C#
|
mit
|
lukencode/FluentEmail,lukencode/FluentEmail
|
2fb3c3bcf6182a0de653d7747862ea7dd467f5fd
|
source/NetFramework/Server/MirrorSharp/SetOptionsFromClient.cs
|
source/NetFramework/Server/MirrorSharp/SetOptionsFromClient.cs
|
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using MirrorSharp.Advanced;
using SharpLab.Server.Common;
namespace SharpLab.Server.MirrorSharp {
[UsedImplicitly(ImplicitUseKindFlags.InstantiatedNoFixedConstructorSignature)]
public class SetOptionsFromClient : ISetOptionsFromClientExtension {
private const string Optimize = "x-optimize";
private const string Target = "x-target";
private readonly IDictionary<string, ILanguageAdapter> _languages;
public SetOptionsFromClient(IReadOnlyList<ILanguageAdapter> languages) {
_languages = languages.ToDictionary(l => l.LanguageName);
}
public bool TrySetOption(IWorkSession session, string name, string value) {
switch (name) {
case Optimize:
_languages[session.LanguageName].SetOptimize(session, value);
return true;
case Target:
session.SetTargetName(value);
_languages[session.LanguageName].SetOptionsForTarget(session, value);
return true;
default:
return false;
}
}
}
}
|
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using MirrorSharp.Advanced;
using SharpLab.Server.Common;
namespace SharpLab.Server.MirrorSharp {
[UsedImplicitly(ImplicitUseKindFlags.InstantiatedNoFixedConstructorSignature)]
public class SetOptionsFromClient : ISetOptionsFromClientExtension {
private const string Optimize = "x-optimize";
private const string Target = "x-target";
private const string ContainerExperimentSeed = "x-container-experiment-seed";
private readonly IDictionary<string, ILanguageAdapter> _languages;
public SetOptionsFromClient(IReadOnlyList<ILanguageAdapter> languages) {
_languages = languages.ToDictionary(l => l.LanguageName);
}
public bool TrySetOption(IWorkSession session, string name, string value) {
switch (name) {
case Optimize:
_languages[session.LanguageName].SetOptimize(session, value);
return true;
case Target:
session.SetTargetName(value);
_languages[session.LanguageName].SetOptionsForTarget(session, value);
return true;
case ContainerExperimentSeed:
// not supported in .NET Framework
return true;
default:
return false;
}
}
}
}
|
Fix x-container-experiment-seed failure in .NET Framework branches
|
[gh-620] Fix x-container-experiment-seed failure in .NET Framework branches
|
C#
|
bsd-2-clause
|
ashmind/SharpLab,ashmind/SharpLab,ashmind/SharpLab,ashmind/SharpLab,ashmind/SharpLab,ashmind/SharpLab
|
1437540efbbc8dac9b14223e1f1bd8e7332a54f7
|
source/CroquetAustralia.Website/Layouts/Shared/Sidebar.cshtml
|
source/CroquetAustralia.Website/Layouts/Shared/Sidebar.cshtml
|
<div class="sticky-notes">
<div class="sticky-note">
<i class="pin"></i>
<div class="content green">
<h1>
GC Handicapping System
</h1>
<p>
New <a href="/disciplines/golf-croquet/resources">GC Handicapping System</a> comes into effect 3 April, 2017
</p>
</div>
</div>
<div class="sticky-note">
<i class="pin"></i>
<div class="content green">
<h1>
Positions Vacant
</h1>
<p>
ACA would like your help! <a href="/position-vacant">Positions Vacant</a>
</p>
</div>
</div>
</div>
|
<div class="sticky-notes">
<div class="sticky-note">
<i class="pin"></i>
<div class="content green">
<h1>
GC Handicapping System
</h1>
<p>
New <a href="/disciplines/golf-croquet/resources">GC Handicapping System</a> comes into effect 3 April, 2017
</p>
</div>
</div>
</div>
|
Remove 'Positions Vacant' sticky note
|
Remove 'Positions Vacant' sticky note
|
C#
|
mit
|
croquet-australia/croquet-australia.com.au,croquet-australia/website-application,croquet-australia/croquet-australia.com.au,croquet-australia/croquet-australia.com.au,croquet-australia/croquet-australia-website,croquet-australia/website-application,croquet-australia/croquet-australia-website,croquet-australia/croquet-australia-website,croquet-australia/website-application,croquet-australia/croquet-australia-website,croquet-australia/croquet-australia.com.au,croquet-australia/website-application
|
86f9e8533d364b1042711c9c91f73bfa7b8566b8
|
src/git-istage/ConsoleCommand.cs
|
src/git-istage/ConsoleCommand.cs
|
using System;
namespace GitIStage
{
internal sealed class ConsoleCommand
{
private readonly Action _handler;
private readonly ConsoleKey _key;
public readonly string Description;
private readonly ConsoleModifiers _modifiers;
public ConsoleCommand(Action handler, ConsoleKey key, string description)
{
_handler = handler;
_key = key;
Description = description;
_modifiers = 0;
}
public ConsoleCommand(Action handler, ConsoleKey key, ConsoleModifiers modifiers, string description)
{
_handler = handler;
_key = key;
_modifiers = modifiers;
Description = description;
}
public void Execute()
{
_handler();
}
public bool MatchesKey(ConsoleKeyInfo keyInfo)
{
return _key == keyInfo.Key && _modifiers == keyInfo.Modifiers;
}
public string GetCommandShortcut()
{
string key = _key.ToString().Replace("Arrow", "");
if (_modifiers != 0)
{
return $"{_modifiers.ToString().Replace("Control", "Ctrl")} + {key.ToString()}";
}
else
return key.ToString();
}
}
}
|
using System;
namespace GitIStage
{
internal sealed class ConsoleCommand
{
private readonly Action _handler;
private readonly ConsoleKey _key;
public readonly string Description;
private readonly ConsoleModifiers _modifiers;
public ConsoleCommand(Action handler, ConsoleKey key, string description)
{
_handler = handler;
_key = key;
Description = description;
_modifiers = 0;
}
public ConsoleCommand(Action handler, ConsoleKey key, ConsoleModifiers modifiers, string description)
{
_handler = handler;
_key = key;
_modifiers = modifiers;
Description = description;
}
public void Execute()
{
_handler();
}
public bool MatchesKey(ConsoleKeyInfo keyInfo)
{
return _key == keyInfo.Key && _modifiers == keyInfo.Modifiers;
}
public string GetCommandShortcut()
{
string key = _key.ToString().Replace("Arrow", "");
if (key.StartsWith("D") && key.Length == 2)
key = key.Replace("D", "");
if (_modifiers != 0)
return $"{_modifiers.ToString().Replace("Control", "Ctrl")} + {key.ToString()}";
else
return key.ToString();
}
}
}
|
Fix showing digits - show '1' instead of 'D1'
|
Fix showing digits - show '1' instead of 'D1'
|
C#
|
mit
|
terrajobst/git-istage,terrajobst/git-istage
|
bdae9bcb0b085d30cd318d9723d429e11cf42434
|
wrappers/dotnet/indy-sdk-dotnet-test/PoolTests/CreatePoolTest.cs
|
wrappers/dotnet/indy-sdk-dotnet-test/PoolTests/CreatePoolTest.cs
|
using Hyperledger.Indy.PoolApi;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.IO;
using System.Threading.Tasks;
namespace Hyperledger.Indy.Test.PoolTests
{
[TestClass]
public class CreatePoolTest : IndyIntegrationTestBase
{
[TestMethod]
public async Task TestCreatePoolWorksForNullConfig()
{
var file = File.Create("testCreatePoolWorks.txn");
PoolUtils.WriteTransactions(file, 1);
await Pool.CreatePoolLedgerConfigAsync("testCreatePoolWorks", null);
}
[TestMethod]
public async Task TestCreatePoolWorksForConfigJSON()
{
var genesisTxnFile = PoolUtils.CreateGenesisTxnFile("genesis.txn");
var path = Path.GetFullPath(genesisTxnFile.Name).Replace('\\', '/');
var configJson = string.Format("{{\"genesis_txn\":\"{0}\"}}", path);
await Pool.CreatePoolLedgerConfigAsync("testCreatePoolWorks", configJson);
}
[TestMethod]
public async Task TestCreatePoolWorksForTwice()
{
var genesisTxnFile = PoolUtils.CreateGenesisTxnFile("genesis.txn");
var path = Path.GetFullPath(genesisTxnFile.Name).Replace('\\', '/');
var configJson = string.Format("{{\"genesis_txn\":\"{0}\"}}", path);
await Pool.CreatePoolLedgerConfigAsync("pool1", configJson);
var ex = await Assert.ThrowsExceptionAsync<PoolLedgerConfigExistsException>(() =>
Pool.CreatePoolLedgerConfigAsync("pool1", configJson)
);;
}
}
}
|
using Hyperledger.Indy.PoolApi;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.IO;
using System.Threading.Tasks;
namespace Hyperledger.Indy.Test.PoolTests
{
[TestClass]
public class CreatePoolTest : IndyIntegrationTestBase
{
[TestMethod]
public async Task TestCreatePoolWorksForNullConfig()
{
string poolConfigName = "testCreatePoolWorks";
var file = File.Create(string.Format("{0}.txn", poolConfigName));
PoolUtils.WriteTransactions(file, 1);
await Pool.CreatePoolLedgerConfigAsync(poolConfigName, null);
}
[TestMethod]
public async Task TestCreatePoolWorksForConfigJSON()
{
var genesisTxnFile = PoolUtils.CreateGenesisTxnFile("genesis.txn");
var path = Path.GetFullPath(genesisTxnFile.Name).Replace('\\', '/');
var configJson = string.Format("{{\"genesis_txn\":\"{0}\"}}", path);
await Pool.CreatePoolLedgerConfigAsync("testCreatePoolWorks", configJson);
}
[TestMethod]
public async Task TestCreatePoolWorksForTwice()
{
var genesisTxnFile = PoolUtils.CreateGenesisTxnFile("genesis.txn");
var path = Path.GetFullPath(genesisTxnFile.Name).Replace('\\', '/');
var configJson = string.Format("{{\"genesis_txn\":\"{0}\"}}", path);
await Pool.CreatePoolLedgerConfigAsync("pool1", configJson);
var ex = await Assert.ThrowsExceptionAsync<PoolLedgerConfigExistsException>(() =>
Pool.CreatePoolLedgerConfigAsync("pool1", configJson)
);;
}
}
}
|
Create Pool Tests work. removed obsolete tests
|
Create Pool Tests work. removed obsolete tests
Signed-off-by: matt raffel <a1c361500f8f28827fe56351c610aa9d1ba26ce8@evernym.com>
|
C#
|
apache-2.0
|
srottem/indy-sdk,srottem/indy-sdk,Artemkaaas/indy-sdk,Artemkaaas/indy-sdk,Artemkaaas/indy-sdk,srottem/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,anastasia-tarasova/indy-sdk,srottem/indy-sdk,anastasia-tarasova/indy-sdk,srottem/indy-sdk,anastasia-tarasova/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,srottem/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,srottem/indy-sdk,anastasia-tarasova/indy-sdk,srottem/indy-sdk,srottem/indy-sdk,srottem/indy-sdk,anastasia-tarasova/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,srottem/indy-sdk,anastasia-tarasova/indy-sdk,anastasia-tarasova/indy-sdk,srottem/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,anastasia-tarasova/indy-sdk,Artemkaaas/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,anastasia-tarasova/indy-sdk,anastasia-tarasova/indy-sdk,peacekeeper/indy-sdk,anastasia-tarasova/indy-sdk,peacekeeper/indy-sdk,anastasia-tarasova/indy-sdk,anastasia-tarasova/indy-sdk,srottem/indy-sdk
|
4332d05963b4fc7fcf06a683ff6a9c5178a4e8c7
|
src/Auth0.Core/ApiError.cs
|
src/Auth0.Core/ApiError.cs
|
using Auth0.Core.Serialization;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace Auth0.Core
{
/// <summary>
/// Error information captured from a failed API request.
/// </summary>
[JsonConverter(typeof(ApiErrorConverter))]
public class ApiError
{
/// <summary>
/// Description of the failing HTTP Status Code.
/// </summary>
[JsonProperty("error")]
public string Error { get; set; }
/// <summary>
/// Error code returned by the API.
/// </summary>
[JsonProperty("errorCode")]
public string ErrorCode { get; set; }
/// <summary>
/// Description of the error.
/// </summary>
[JsonProperty("message")]
public string Message { get; set; }
/// <summary>
/// Parse a <see cref="HttpResponseMessage"/> into an <see cref="ApiError"/> asynchronously.
/// </summary>
/// <param name="response"><see cref="HttpResponseMessage"/> to parse.</param>
/// <returns><see cref="Task"/> representing the operation and associated <see cref="ApiError"/> on
/// successful completion.</returns>
public static async Task<ApiError> Parse(HttpResponseMessage response)
{
if (response == null || response.Content == null)
return null;
var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
if (String.IsNullOrEmpty(content))
return null;
try
{
return JsonConvert.DeserializeObject<ApiError>(content);
}
catch (JsonSerializationException)
{
return new ApiError
{
Error = content,
Message = content
};
}
}
}
}
|
using Auth0.Core.Serialization;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace Auth0.Core
{
/// <summary>
/// Error information captured from a failed API request.
/// </summary>
[JsonConverter(typeof(ApiErrorConverter))]
public class ApiError
{
/// <summary>
/// Description of the failing HTTP Status Code.
/// </summary>
[JsonProperty("error")]
public string Error { get; set; }
/// <summary>
/// Error code returned by the API.
/// </summary>
[JsonProperty("errorCode")]
public string ErrorCode { get; set; }
/// <summary>
/// Description of the error.
/// </summary>
[JsonProperty("message")]
public string Message { get; set; }
/// <summary>
/// Parse a <see cref="HttpResponseMessage"/> into an <see cref="ApiError"/> asynchronously.
/// </summary>
/// <param name="response"><see cref="HttpResponseMessage"/> to parse.</param>
/// <returns><see cref="Task"/> representing the operation and associated <see cref="ApiError"/> on
/// successful completion.</returns>
public static async Task<ApiError> Parse(HttpResponseMessage response)
{
if (response == null || response.Content == null)
return null;
var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
if (String.IsNullOrEmpty(content))
return null;
try
{
return JsonConvert.DeserializeObject<ApiError>(content);
}
catch (JsonException)
{
return new ApiError
{
Error = content,
Message = content
};
}
}
}
}
|
Handle other kinds of deserialization exceptions
|
Handle other kinds of deserialization exceptions
|
C#
|
mit
|
auth0/auth0.net,auth0/auth0.net
|
a9ab9f614751fd822e0c32814802117d400fe905
|
src/FluentMigrator.Runner/Generators/MySql/MySqlQuoter.cs
|
src/FluentMigrator.Runner/Generators/MySql/MySqlQuoter.cs
|
using FluentMigrator.Runner.Generators.Generic;
namespace FluentMigrator.Runner.Generators.MySql
{
public class MySqlQuoter : GenericQuoter
{
public override string OpenQuote { get { return "`"; } }
public override string CloseQuote { get { return "`"; } }
public override string QuoteValue(object value)
{
return base.QuoteValue(value).Replace(@"\", @"\\");
}
public override string FromTimeSpan(System.TimeSpan value)
{
return System.String.Format("{0}{1}:{2}:{3}.{4}{0}"
, ValueQuote
, value.Hours + (value.Days * 24)
, value.Minutes
, value.Seconds
, value.Milliseconds);
}
}
}
|
using FluentMigrator.Runner.Generators.Generic;
namespace FluentMigrator.Runner.Generators.MySql
{
public class MySqlQuoter : GenericQuoter
{
public override string OpenQuote { get { return "`"; } }
public override string CloseQuote { get { return "`"; } }
public override string QuoteValue(object value)
{
return base.QuoteValue(value).Replace(@"\", @"\\");
}
public override string FromTimeSpan(System.TimeSpan value)
{
return System.String.Format("{0}{1:00}:{2:00}:{3:00}{0}"
, ValueQuote
, value.Hours + (value.Days * 24)
, value.Minutes
, value.Seconds);
}
}
}
|
Fix MySql do not support Milliseconds
|
Fix MySql do not support Milliseconds
|
C#
|
apache-2.0
|
spaccabit/fluentmigrator,spaccabit/fluentmigrator
|
f73933d619581666ca7309f285e0efcb6c98d637
|
Src/Codge.Generator/Presentations/Xsd/XmlSchemaExtensions.cs
|
Src/Codge.Generator/Presentations/Xsd/XmlSchemaExtensions.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Schema;
namespace Codge.Generator.Presentations.Xsd
{
public static class XmlSchemaExtensions
{
public static bool IsEmptyType(this XmlSchemaComplexType type)
{
return type.ContentModel == null && type.Attributes.Count == 0 && type.ContentType.ToString() == "Empty";
}
public static IEnumerable<XmlSchemaEnumerationFacet> GetEnumerationFacets(this XmlSchemaSimpleType simpleType)
{
if (simpleType.Content != null)
{
var restriction = simpleType.Content as XmlSchemaSimpleTypeRestriction;
if (restriction != null && restriction.Facets != null && restriction.Facets.Count > 0)
{
foreach (var facet in restriction.Facets)
{
var item = facet as XmlSchemaEnumerationFacet;
if (item == null)
yield break;
yield return item;
}
}
}
yield break;
}
public static bool IsEnumeration(this XmlSchemaSimpleType simpleType)
{
return GetEnumerationFacets(simpleType).Any();
}
}
}
|
using System.Collections.Generic;
using System.Linq;
using System.Xml.Schema;
namespace Codge.Generator.Presentations.Xsd
{
public static class XmlSchemaExtensions
{
public static bool IsEmptyType(this XmlSchemaComplexType type)
{
return type.ContentModel == null && type.Attributes.Count == 0 && type.ContentType.ToString() == "Empty";
}
public static IEnumerable<XmlSchemaEnumerationFacet> GetEnumerationFacets(this XmlSchemaSimpleType simpleType)
{
if (simpleType.Content != null)
{
var restriction = simpleType.Content as XmlSchemaSimpleTypeRestriction;
if (restriction != null && restriction.Facets != null && restriction.Facets.Count > 0)
{
foreach (var facet in restriction.Facets)
{
var item = facet as XmlSchemaEnumerationFacet;
if (item != null)
yield return item;
}
}
}
yield break;
}
public static bool IsEnumeration(this XmlSchemaSimpleType simpleType)
{
return GetEnumerationFacets(simpleType).Any();
}
}
}
|
Fix for treating enum types as primitives due non-enumeration facets
|
Fix for treating enum types as primitives due non-enumeration facets
|
C#
|
apache-2.0
|
avao/Codge
|
ef7a53f792619be004da2498bc013c7d59f205d3
|
src/Pablo.Gallery/Views/Account/_ExternalLoginsListPartial.cshtml
|
src/Pablo.Gallery/Views/Account/_ExternalLoginsListPartial.cshtml
|
@model ICollection<AuthenticationClientData>
@if (Model.Count > 0)
{
using (Html.BeginForm("ExternalLogin", "Account", new { ReturnUrl = ViewBag.ReturnUrl }))
{
@Html.AntiForgeryToken()
<h4>Use another service to log in.</h4>
<hr />
<div id="socialLoginList">
@foreach (AuthenticationClientData p in Model)
{
<button type="submit" class="btn" id="@p.AuthenticationClient.ProviderName" name="provider" value="@p.AuthenticationClient.ProviderName" title="Log in using your @p.DisplayName account">@p.DisplayName</button>
}
</div>
}
}
|
@model ICollection<Microsoft.Web.WebPages.OAuth.AuthenticationClientData>
@if (Model.Count > 0)
{
using (Html.BeginForm("ExternalLogin", "Account", new { ReturnUrl = ViewBag.ReturnUrl }))
{
@Html.AntiForgeryToken()
<h4>Use another service to log in.</h4>
<hr />
<div id="socialLoginList">
@foreach (var p in Model)
{
<button type="submit" class="btn" id="@p.AuthenticationClient.ProviderName" name="provider" value="@p.AuthenticationClient.ProviderName" title="Log in using your @p.DisplayName account">@p.DisplayName</button>
}
</div>
}
}
|
Fix external logins partial for running in mono 3.2.x
|
Fix external logins partial for running in mono 3.2.x
|
C#
|
mit
|
cwensley/Pablo.Gallery,sixteencolors/Pablo.Gallery,sixteencolors/Pablo.Gallery,sixteencolors/Pablo.Gallery,sixteencolors/Pablo.Gallery,cwensley/Pablo.Gallery,cwensley/Pablo.Gallery
|
3af1e6500d660bd36c0d6e7793b90a7dda360c0a
|
Source/Eto.Platform.Mac/Forms/FormHandler.cs
|
Source/Eto.Platform.Mac/Forms/FormHandler.cs
|
using System;
using Eto.Drawing;
using Eto.Forms;
using MonoMac.AppKit;
using SD = System.Drawing;
namespace Eto.Platform.Mac.Forms
{
public class FormHandler : MacWindow<MyWindow, Form>, IDisposable, IForm
{
protected override bool DisposeControl { get { return false; } }
public FormHandler()
{
Control = new MyWindow(new SD.Rectangle(0,0,200,200),
NSWindowStyle.Resizable | NSWindowStyle.Closable | NSWindowStyle.Miniaturizable | NSWindowStyle.Titled,
NSBackingStore.Buffered, false);
ConfigureWindow ();
}
public void Show ()
{
if (!Control.IsVisible)
Widget.OnShown (EventArgs.Empty);
if (this.WindowState == WindowState.Minimized)
Control.MakeKeyWindow ();
else
Control.MakeKeyAndOrderFront (ApplicationHandler.Instance.AppDelegate);
}
}
}
|
using System;
using Eto.Forms;
using MonoMac.AppKit;
using SD = System.Drawing;
namespace Eto.Platform.Mac.Forms
{
public class FormHandler : MacWindow<MyWindow, Form>, IForm
{
protected override bool DisposeControl { get { return false; } }
public FormHandler()
{
Control = new MyWindow(new SD.Rectangle(0, 0, 200, 200),
NSWindowStyle.Resizable | NSWindowStyle.Closable | NSWindowStyle.Miniaturizable | NSWindowStyle.Titled,
NSBackingStore.Buffered, false);
ConfigureWindow();
}
public void Show()
{
if (WindowState == WindowState.Minimized)
Control.MakeKeyWindow();
else
Control.MakeKeyAndOrderFront(ApplicationHandler.Instance.AppDelegate);
if (!Control.IsVisible)
Widget.OnShown(EventArgs.Empty);
}
}
}
|
Call Form.OnShown after window is shown (to be consistent with dialog)
|
Mac: Call Form.OnShown after window is shown (to be consistent with dialog)
|
C#
|
bsd-3-clause
|
l8s/Eto,PowerOfCode/Eto,PowerOfCode/Eto,bbqchickenrobot/Eto-1,l8s/Eto,bbqchickenrobot/Eto-1,PowerOfCode/Eto,bbqchickenrobot/Eto-1,l8s/Eto
|
987aa5a21c043360d71f0155b52d70e77ddd3a5e
|
osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModAimAssist.cs
|
osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModAimAssist.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.Game.Rulesets.Osu.Mods;
namespace osu.Game.Rulesets.Osu.Tests.Mods
{
public class TestSceneOsuModAimAssist : OsuModTestScene
{
[Test]
public void TestAimAssist()
{
var mod = new OsuModAimAssist();
CreateModTest(new ModTestData
{
Autoplay = false,
Mod = mod,
});
}
}
}
|
// 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.Game.Rulesets.Osu.Mods;
namespace osu.Game.Rulesets.Osu.Tests.Mods
{
public class TestSceneOsuModAimAssist : OsuModTestScene
{
[TestCase(0.1f)]
[TestCase(0.5f)]
[TestCase(1)]
public void TestAimAssist(float strength)
{
CreateModTest(new ModTestData
{
Mod = new OsuModAimAssist
{
AssistStrength = { Value = strength },
},
PassCondition = () => true,
Autoplay = false,
});
}
}
}
|
Add testing of different strengths
|
Add testing of different strengths
|
C#
|
mit
|
peppy/osu,ppy/osu,peppy/osu,ppy/osu,ppy/osu,peppy/osu,NeoAdonis/osu,NeoAdonis/osu,NeoAdonis/osu
|
cc3923be778ba8f2278111338f008dc1579dd189
|
UniversalSoundBoard/Common/GeneralMethods.cs
|
UniversalSoundBoard/Common/GeneralMethods.cs
|
using davClassLibrary.Common;
using davClassLibrary.DataAccess;
using UniversalSoundBoard.DataAccess;
using Windows.Networking.Connectivity;
namespace UniversalSoundboard.Common
{
public class GeneralMethods : IGeneralMethods
{
public bool IsNetworkAvailable()
{
var connection = NetworkInformation.GetInternetConnectionProfile();
var networkCostType = connection.GetConnectionCost().NetworkCostType;
return !(networkCostType != NetworkCostType.Unrestricted && networkCostType != NetworkCostType.Unknown);
}
public DavEnvironment GetEnvironment()
{
return FileManager.Environment;
}
}
}
|
using davClassLibrary.Common;
using davClassLibrary.DataAccess;
using UniversalSoundBoard.DataAccess;
using Windows.Networking.Connectivity;
namespace UniversalSoundboard.Common
{
public class GeneralMethods : IGeneralMethods
{
public bool IsNetworkAvailable()
{
var connection = NetworkInformation.GetInternetConnectionProfile();
if (connection == null) return false;
var networkCostType = connection.GetConnectionCost().NetworkCostType;
return !(networkCostType != NetworkCostType.Unrestricted && networkCostType != NetworkCostType.Unknown);
}
public DavEnvironment GetEnvironment()
{
return FileManager.Environment;
}
}
}
|
Check for null in IsNetworkAvailable implementation
|
Check for null in IsNetworkAvailable implementation
|
C#
|
mit
|
Dav2070/UniversalSoundBoard
|
ac3ff4471fb020a730c0a538c66f2b8352915ea8
|
src/JoinRpg.Blazor.Client/ApiClients/HttpClientRegistration.cs
|
src/JoinRpg.Blazor.Client/ApiClients/HttpClientRegistration.cs
|
using JoinRpg.Web.CheckIn;
using JoinRpg.Web.ProjectCommon;
using JoinRpg.Web.ProjectMasterTools.ResponsibleMaster;
using JoinRpg.Web.ProjectMasterTools.Subscribe;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
namespace JoinRpg.Blazor.Client.ApiClients;
public static class HttpClientRegistration
{
private static WebAssemblyHostBuilder AddHttpClient<TClient, TImplementation>(
this WebAssemblyHostBuilder builder)
where TClient : class
where TImplementation : class, TClient
{
_ = builder.Services.AddHttpClient<TClient, TImplementation>(
client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress));
return builder;
}
public static WebAssemblyHostBuilder AddHttpClients(this WebAssemblyHostBuilder builder)
{
return builder
.AddHttpClient<IGameSubscribeClient, GameSubscribeClient>()
.AddHttpClient<ICharacterGroupsClient, CharacterGroupsClient>()
.AddHttpClient<ICheckInClient, CheckInClient>()
.AddHttpClient<IResponsibleMasterRuleClient, ApiClients.ResponsibleMasterRuleClient>();
}
}
|
using JoinRpg.Web.CheckIn;
using JoinRpg.Web.ProjectCommon;
using JoinRpg.Web.ProjectMasterTools.ResponsibleMaster;
using JoinRpg.Web.ProjectMasterTools.Subscribe;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
namespace JoinRpg.Blazor.Client.ApiClients;
public static class HttpClientRegistration
{
private static WebAssemblyHostBuilder AddHttpClient<TClient, TImplementation>(
this WebAssemblyHostBuilder builder)
where TClient : class
where TImplementation : class, TClient
{
_ = builder.Services.AddHttpClient<TClient, TImplementation>(
client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress));
return builder;
}
public static WebAssemblyHostBuilder AddHttpClients(this WebAssemblyHostBuilder builder)
{
return builder
.AddHttpClient<IGameSubscribeClient, GameSubscribeClient>()
.AddHttpClient<ICharacterGroupsClient, CharacterGroupsClient>()
.AddHttpClient<ICheckInClient, CheckInClient>()
.AddHttpClient<IResponsibleMasterRuleClient, ResponsibleMasterRuleClient>();
}
}
|
Fix namespace in httpclient registration
|
Fix namespace in httpclient registration
|
C#
|
mit
|
leotsarev/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net,leotsarev/joinrpg-net,leotsarev/joinrpg-net,joinrpg/joinrpg-net,joinrpg/joinrpg-net,joinrpg/joinrpg-net
|
7da56ec7fd27ebddc7253b6151b50f93ad289dd4
|
osu.Game/Screens/Play/ScreenSuspensionHandler.cs
|
osu.Game/Screens/Play/ScreenSuspensionHandler.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Platform;
namespace osu.Game.Screens.Play
{
internal class ScreenSuspensionHandler : Component
{
private readonly GameplayClockContainer gameplayClockContainer;
private Bindable<bool> isPaused;
[Resolved]
private GameHost host { get; set; }
public ScreenSuspensionHandler(GameplayClockContainer gameplayClockContainer)
{
this.gameplayClockContainer = gameplayClockContainer;
}
protected override void LoadComplete()
{
base.LoadComplete();
isPaused = gameplayClockContainer.IsPaused.GetBoundCopy();
isPaused.BindValueChanged(paused => host.AllowScreenSuspension.Value = paused.NewValue, true);
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
isPaused?.UnbindAll();
if (host != null)
host.AllowScreenSuspension.Value = 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.
using System;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Platform;
namespace osu.Game.Screens.Play
{
/// <summary>
/// Ensures screen is not suspended / dimmed while gameplay is active.
/// </summary>
public class ScreenSuspensionHandler : Component
{
private readonly GameplayClockContainer gameplayClockContainer;
private Bindable<bool> isPaused;
[Resolved]
private GameHost host { get; set; }
public ScreenSuspensionHandler([NotNull] GameplayClockContainer gameplayClockContainer)
{
this.gameplayClockContainer = gameplayClockContainer ?? throw new ArgumentNullException(nameof(gameplayClockContainer));
}
protected override void LoadComplete()
{
base.LoadComplete();
isPaused = gameplayClockContainer.IsPaused.GetBoundCopy();
isPaused.BindValueChanged(paused => host.AllowScreenSuspension.Value = paused.NewValue, true);
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
isPaused?.UnbindAll();
if (host != null)
host.AllowScreenSuspension.Value = true;
}
}
}
|
Add null check and xmldoc
|
Add null check and xmldoc
|
C#
|
mit
|
smoogipoo/osu,ppy/osu,NeoAdonis/osu,smoogipoo/osu,peppy/osu,ppy/osu,UselessToucan/osu,smoogipooo/osu,ppy/osu,smoogipoo/osu,UselessToucan/osu,NeoAdonis/osu,peppy/osu,peppy/osu-new,peppy/osu,UselessToucan/osu,NeoAdonis/osu
|
67bb3bcf61314b8469e992bff30db93b231c3bb5
|
Bumblebee/Extensions/Debugging.cs
|
Bumblebee/Extensions/Debugging.cs
|
using System;
using System.Threading;
namespace Bumblebee.Extensions
{
public static class Debugging
{
public static T DebugPrint<T>(this T obj)
{
Console.WriteLine(obj.ToString());
return obj;
}
public static T DebugPrint<T>(this T obj, string message)
{
Console.WriteLine(message);
return obj;
}
public static T DebugPrint<T>(this T obj, Func<T, object> func)
{
Console.WriteLine(func.Invoke(obj));
return obj;
}
public static T Pause<T>(this T block, int seconds)
{
if (seconds > 0) Thread.Sleep(1000 * seconds);
return block;
}
}
}
|
using System;
using System.Threading;
namespace Bumblebee.Extensions
{
public static class Debugging
{
public static T DebugPrint<T>(this T obj)
{
Console.WriteLine(obj.ToString());
return obj;
}
public static T DebugPrint<T>(this T obj, string message)
{
Console.WriteLine(message);
return obj;
}
public static T DebugPrint<T>(this T obj, Func<T, object> func)
{
Console.WriteLine(func.Invoke(obj));
return obj;
}
public static T PlaySound<T>(this T obj, int pause = 0)
{
System.Media.SystemSounds.Exclamation.Play();
return obj.Pause(pause);
}
public static T Pause<T>(this T block, int seconds)
{
if (seconds > 0) Thread.Sleep(1000 * seconds);
return block;
}
}
}
|
Add PlaySound as a debugging 'tool'
|
Add PlaySound as a debugging 'tool'
|
C#
|
mit
|
Bumblebee/Bumblebee,kool79/Bumblebee,toddmeinershagen/Bumblebee,chrisblock/Bumblebee,Bumblebee/Bumblebee,toddmeinershagen/Bumblebee,kool79/Bumblebee,chrisblock/Bumblebee,qchicoq/Bumblebee,qchicoq/Bumblebee
|
535ad09a57cc22f473d7f75df292dd8a96082304
|
Criteo.Profiling.Tracing/TraceContext.cs
|
Criteo.Profiling.Tracing/TraceContext.cs
|
using System.Runtime.Remoting.Messaging;
namespace Criteo.Profiling.Tracing
{
internal static class TraceContext
{
private const string TraceCallContextKey = "crto_trace";
public static Trace Get()
{
return CallContext.LogicalGetData(TraceCallContextKey) as Trace;
}
public static void Set(Trace trace)
{
CallContext.LogicalSetData(TraceCallContextKey, trace);
}
public static void Clear()
{
CallContext.FreeNamedDataSlot(TraceCallContextKey);
}
}
}
|
using System;
using System.Runtime.Remoting.Messaging;
namespace Criteo.Profiling.Tracing
{
internal static class TraceContext
{
private const string TraceCallContextKey = "crto_trace";
private static readonly bool IsRunningOnMono = (Type.GetType("Mono.Runtime") != null);
public static Trace Get()
{
if (IsRunningOnMono) return null;
return CallContext.LogicalGetData(TraceCallContextKey) as Trace;
}
public static void Set(Trace trace)
{
if (IsRunningOnMono) return;
CallContext.LogicalSetData(TraceCallContextKey, trace);
}
public static void Clear()
{
if (IsRunningOnMono) return;
CallContext.FreeNamedDataSlot(TraceCallContextKey);
}
}
}
|
Add check for Mono for LogicalCallContext
|
Add check for Mono for LogicalCallContext
Some projects are running an outdated Mono version which does not implement LogicalCallContext.
Change-Id: I07d90a8cd3c909c17bbd9e856816ce625379512f
|
C#
|
apache-2.0
|
criteo/zipkin4net,criteo/zipkin4net
|
67fc879a972441132893f743a825c7a5f0e99306
|
test/GitHub.Exports.UnitTests/ApiExceptionExtensionsTests.cs
|
test/GitHub.Exports.UnitTests/ApiExceptionExtensionsTests.cs
|
using System.Collections.Generic;
using System.Collections.Immutable;
using Octokit;
using NSubstitute;
using NUnit.Framework;
using GitHub.Extensions;
public class ApiExceptionExtensionsTests
{
public class TheIsGitHubApiExceptionMethod
{
[TestCase("Not-GitHub-Request-Id", false)]
[TestCase("X-GitHub-Request-Id", true)]
[TestCase("x-github-request-id", true)]
public void NoGitHubRequestId(string key, bool expect)
{
var ex = CreateApiException(new Dictionary<string, string> { { key, "ANYTHING" } });
var result = ApiExceptionExtensions.IsGitHubApiException(ex);
Assert.That(result, Is.EqualTo(expect));
}
static ApiException CreateApiException(Dictionary<string, string> headers)
{
var response = Substitute.For<IResponse>();
response.Headers.Returns(headers.ToImmutableDictionary());
var ex = new ApiException(response);
return ex;
}
}
}
|
using System.Collections.Generic;
using System.Collections.Immutable;
using Octokit;
using NSubstitute;
using NUnit.Framework;
using GitHub.Extensions;
public class ApiExceptionExtensionsTests
{
public class TheIsGitHubApiExceptionMethod
{
[TestCase("Not-GitHub-Request-Id", false)]
[TestCase("X-GitHub-Request-Id", true)]
[TestCase("x-github-request-id", true)]
public void NoGitHubRequestId(string key, bool expect)
{
var ex = CreateApiException(new Dictionary<string, string> { { key, "ANYTHING" } });
var result = ApiExceptionExtensions.IsGitHubApiException(ex);
Assert.That(result, Is.EqualTo(expect));
}
[Test]
public void NoResponse()
{
var ex = new ApiException();
var result = ApiExceptionExtensions.IsGitHubApiException(ex);
Assert.That(result, Is.EqualTo(false));
}
static ApiException CreateApiException(Dictionary<string, string> headers)
{
var response = Substitute.For<IResponse>();
response.Headers.Returns(headers.ToImmutableDictionary());
var ex = new ApiException(response);
return ex;
}
}
}
|
Add test when IResponse not set
|
Add test when IResponse not set
|
C#
|
mit
|
github/VisualStudio,github/VisualStudio,github/VisualStudio
|
feb39920c5d9e3d5353ab71eb5be230767af1273
|
osu.Android/OsuGameActivity.cs
|
osu.Android/OsuGameActivity.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 Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Views;
using osu.Framework.Android;
namespace osu.Android
{
[Activity(Theme = "@android:style/Theme.NoTitleBar", MainLauncher = true, ScreenOrientation = ScreenOrientation.FullSensor, SupportsPictureInPicture = false, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize, HardwareAccelerated = false)]
public class OsuGameActivity : AndroidGameActivity
{
protected override Framework.Game CreateGame() => new OsuGameAndroid();
protected override void OnCreate(Bundle savedInstanceState)
{
// The default current directory on android is '/'.
// On some devices '/' maps to the app data directory. On others it maps to the root of the internal storage.
// In order to have a consistent current directory on all devices the full path of the app data directory is set as the current directory.
System.Environment.CurrentDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
base.OnCreate(savedInstanceState);
Window.AddFlags(WindowManagerFlags.Fullscreen);
Window.AddFlags(WindowManagerFlags.KeepScreenOn);
}
}
}
|
// 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 Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Views;
using osu.Framework.Android;
namespace osu.Android
{
[Activity(Theme = "@android:style/Theme.NoTitleBar", MainLauncher = true, ScreenOrientation = ScreenOrientation.FullUser, SupportsPictureInPicture = false, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize, HardwareAccelerated = false)]
public class OsuGameActivity : AndroidGameActivity
{
protected override Framework.Game CreateGame() => new OsuGameAndroid();
protected override void OnCreate(Bundle savedInstanceState)
{
// The default current directory on android is '/'.
// On some devices '/' maps to the app data directory. On others it maps to the root of the internal storage.
// In order to have a consistent current directory on all devices the full path of the app data directory is set as the current directory.
System.Environment.CurrentDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
base.OnCreate(savedInstanceState);
Window.AddFlags(WindowManagerFlags.Fullscreen);
Window.AddFlags(WindowManagerFlags.KeepScreenOn);
}
}
}
|
Allow rotation lock on Android to function properly
|
Allow rotation lock on Android to function properly
According to Google's documentation, fullSensor will ignore rotation
locking preferences, while fullUser will obey them.
Signed-off-by: tytydraco <1a6917f7786c6ba900af5d5dbd13cb4a5214f8a7@gmail.com>
|
C#
|
mit
|
NeoAdonis/osu,ppy/osu,peppy/osu,peppy/osu,ppy/osu,UselessToucan/osu,ppy/osu,smoogipooo/osu,peppy/osu,smoogipoo/osu,UselessToucan/osu,smoogipoo/osu,NeoAdonis/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu-new,UselessToucan/osu
|
cc46d0ca12547591d09c1a96cc24718ae78d0f50
|
AddinBrowser/AddinBrowserWidget.cs
|
AddinBrowser/AddinBrowserWidget.cs
|
using Gtk;
using Mono.Addins;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Components;
namespace MonoDevelop.AddinMaker.AddinBrowser
{
class AddinBrowserWidget : VBox
{
ExtensibleTreeView treeView;
public AddinBrowserWidget (AddinRegistry registry)
{
Registry = registry;
Build ();
foreach (var addin in registry.GetAddins ()) {
treeView.AddChild (addin);
}
}
void Build ()
{
//TODO: make extensible?
treeView = new ExtensibleTreeView (
new NodeBuilder[] {
new AddinNodeBuilder (),
new ExtensionFolderNodeBuilder (),
new ExtensionNodeBuilder (),
new ExtensionPointNodeBuilder (),
new ExtensionPointFolderNodeBuilder (),
new DependencyFolderNodeBuilder (),
new DependencyNodeBuilder (),
},
new TreePadOption[0]
);
treeView.Tree.Selection.Mode = SelectionMode.Single;
PackStart (treeView, true, true, 0);
ShowAll ();
}
public void SetToolbar (DocumentToolbar toolbar)
{
}
public AddinRegistry Registry {
get; private set;
}
}
}
|
using Gtk;
using Mono.Addins;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Components;
namespace MonoDevelop.AddinMaker.AddinBrowser
{
class AddinBrowserWidget : HPaned
{
ExtensibleTreeView treeView;
public AddinBrowserWidget (AddinRegistry registry)
{
Registry = registry;
Build ();
foreach (var addin in registry.GetAddins ()) {
treeView.AddChild (addin);
}
}
void Build ()
{
//TODO: make extensible?
treeView = new ExtensibleTreeView (
new NodeBuilder[] {
new AddinNodeBuilder (),
new ExtensionFolderNodeBuilder (),
new ExtensionNodeBuilder (),
new ExtensionPointNodeBuilder (),
new ExtensionPointFolderNodeBuilder (),
new DependencyFolderNodeBuilder (),
new DependencyNodeBuilder (),
},
new TreePadOption[0]
);
treeView.Tree.Selection.Mode = SelectionMode.Single;
treeView.WidthRequest = 300;
Pack1 (treeView, false, false);
SetDetail (null);
ShowAll ();
}
void SetDetail (Widget detail)
{
var child2 = Child2;
if (child2 != null) {
Remove (child2);
}
detail = detail ?? new Label ();
detail.WidthRequest = 300;
detail.Show ();
Pack2 (detail, true, false);
}
public void SetToolbar (DocumentToolbar toolbar)
{
}
public AddinRegistry Registry {
get; private set;
}
}
}
|
Add detail panel, currently empty
|
[Browser] Add detail panel, currently empty
|
C#
|
mit
|
mhutch/MonoDevelop.AddinMaker,mhutch/MonoDevelop.AddinMaker
|
8c33934a2988be5344c47a0b737d9dca595bf9f2
|
Models/DetailProvider.cs
|
Models/DetailProvider.cs
|
using System;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using TirkxDownloader.Framework;
namespace TirkxDownloader.Models
{
public class DetailProvider
{
public async Task GetFileDetail(DownloadInfo detail, CancellationToken ct)
{
try
{
var request = (HttpWebRequest)HttpWebRequest.Create(detail.DownloadLink);
request.Method = "HEAD";
var response = await request.GetResponseAsync(ct);
detail.FileSize = response.ContentLength;
}
catch (OperationCanceledException) { }
}
public bool FillCredential(string doamin)
{
throw new NotImplementedException();
}
}
}
|
using System;
using System.IO;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using TirkxDownloader.Framework;
using TirkxDownloader.Models;
namespace TirkxDownloader.Models
{
public class DetailProvider
{
private AuthorizationManager _authenticationManager;
public DetailProvider(AuthorizationManager authenticationManager)
{
_authenticationManager = authenticationManager;
}
public async Task GetFileDetail(DownloadInfo detail, CancellationToken ct)
{
try
{
var request = (HttpWebRequest)HttpWebRequest.Create(detail.DownloadLink);
request.Method = "HEAD";
var response = await request.GetResponseAsync(ct);
detail.FileSize = response.ContentLength;
response.Close();
}
catch (OperationCanceledException) { }
}
public async Task FillCredential(HttpWebRequest request)
{
string targetDomain = "";
string domain = request.Host;
AuthorizationInfo authorizationInfo = _authenticationManager.GetCredential(domain);
using (StreamReader str = new StreamReader("Target domain.dat", Encoding.UTF8))
{
string storedDomian;
while ((storedDomian = await str.ReadLineAsync()) != null)
{
if (storedDomian.Like(domain))
{
targetDomain = storedDomian;
// if it isn't wildcards, it done
if (!storedDomian.Contains("*"))
{
break;
}
}
}
}
AuthorizationInfo credential = _authenticationManager.GetCredential(targetDomain);
if (credential != null)
{
var netCredential = new NetworkCredential(credential.Username, credential.Password, domain);
request.Credentials = netCredential;
}
else
{
// if no credential was found, try to use default credential
request.UseDefaultCredentials = true;
}
}
}
}
|
Fix download didn't start by close response in getFileDetail, implement FillCredential method
|
Fix download didn't start by close response in getFileDetail, implement FillCredential method
|
C#
|
mit
|
witoong623/TirkxDownloader,witoong623/TirkxDownloader
|
a730349629c5b3f39a0107980a39bbb5161125cf
|
osu.Game.Rulesets.Catch.Tests/TestSceneCatchPlayerLegacySkin.cs
|
osu.Game.Rulesets.Catch.Tests/TestSceneCatchPlayerLegacySkin.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.Linq;
using NUnit.Framework;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics.Containers;
using osu.Framework.Screens;
using osu.Framework.Testing;
using osu.Game.Screens.Play.HUD;
using osu.Game.Skinning;
using osu.Game.Tests.Visual;
using osuTK;
namespace osu.Game.Rulesets.Catch.Tests
{
[TestFixture]
public class TestSceneCatchPlayerLegacySkin : LegacySkinPlayerTestScene
{
protected override Ruleset CreatePlayerRuleset() => new CatchRuleset();
[Test]
[Ignore("HUD components broken, remove when fixed.")]
public void TestLegacyHUDComboCounterHidden([Values] bool withModifiedSkin)
{
if (withModifiedSkin)
{
AddStep("change component scale", () => Player.ChildrenOfType<LegacyScoreCounter>().First().Scale = new Vector2(2f));
AddStep("update target", () => Player.ChildrenOfType<SkinnableTargetContainer>().ForEach(LegacySkin.UpdateDrawableTarget));
AddStep("exit player", () => Player.Exit());
CreateTest(null);
}
AddAssert("legacy HUD combo counter hidden", () =>
{
return Player.ChildrenOfType<LegacyComboCounter>().All(c => !c.ChildrenOfType<Container>().Single().IsPresent);
});
}
}
}
|
// 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.Linq;
using NUnit.Framework;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics.Containers;
using osu.Framework.Screens;
using osu.Framework.Testing;
using osu.Game.Screens.Play.HUD;
using osu.Game.Skinning;
using osu.Game.Tests.Visual;
using osuTK;
namespace osu.Game.Rulesets.Catch.Tests
{
[TestFixture]
public class TestSceneCatchPlayerLegacySkin : LegacySkinPlayerTestScene
{
protected override Ruleset CreatePlayerRuleset() => new CatchRuleset();
[Test]
public void TestLegacyHUDComboCounterHidden([Values] bool withModifiedSkin)
{
if (withModifiedSkin)
{
AddStep("change component scale", () => Player.ChildrenOfType<LegacyScoreCounter>().First().Scale = new Vector2(2f));
AddStep("update target", () => Player.ChildrenOfType<SkinnableTargetContainer>().ForEach(LegacySkin.UpdateDrawableTarget));
AddStep("exit player", () => Player.Exit());
CreateTest(null);
}
AddAssert("legacy HUD combo counter hidden", () =>
{
return Player.ChildrenOfType<LegacyComboCounter>().All(c => !c.ChildrenOfType<Container>().Single().IsPresent);
});
}
}
}
|
Remove the ignore attribute once again
|
Remove the ignore attribute once again
|
C#
|
mit
|
ppy/osu,smoogipooo/osu,smoogipoo/osu,peppy/osu,NeoAdonis/osu,UselessToucan/osu,peppy/osu-new,peppy/osu,NeoAdonis/osu,ppy/osu,peppy/osu,UselessToucan/osu,smoogipoo/osu,NeoAdonis/osu,smoogipoo/osu,ppy/osu,UselessToucan/osu
|
116421a35d8abcd3905514284e66ff0c79353b38
|
Holoholona/Views/Home/Index.cshtml
|
Holoholona/Views/Home/Index.cshtml
|
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script>
var data = (function ($) {
var getData = (function() {
$.ajax({
method: "GET",
url: "GetMammals",
dataType: "json",
success: function (response) {
print(response);
},
failure: function (response) {
alert(response.d);
}
});
});
function print(data) {
document.write(
data.Dog.Name + ": " + data.Dog.Type + " / " +
data.Cat.Name + ": " + data.Cat.Type
);
}
return {
getData: getData
}
})(jQuery);
</script>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
</head>
<body>
<div>
<script>
data.getData();
</script>
</div>
</body>
</html>
|
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script>
var data = (function ($) {
var getData = (function() {
$.ajax({
method: "GET",
url: "@Url.Action("GetMammals", "Home")",
dataType: "json",
success: function (response) {
print(response);
},
failure: function (response) {
alert(response.d);
}
});
});
function print(data) {
document.write(
data.Dog.Name + ": " + data.Dog.Type + " / " +
data.Cat.Name + ": " + data.Cat.Type
);
}
return {
getData: getData
}
})(jQuery);
</script>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
</head>
<body>
<div>
<script>
data.getData();
</script>
</div>
</body>
</html>
|
Fix 404 error when calling GetMammals, incorrect route
|
Fix 404 error when calling GetMammals, incorrect route
|
C#
|
mit
|
MortenLiebmann/holoholona,MortenLiebmann/holoholona
|
643ed549d6084905780e67eeccfa441bafa86ed7
|
src/License.Manager.Core/Model/Customer.cs
|
src/License.Manager.Core/Model/Customer.cs
|
using ServiceStack.ServiceHost;
namespace License.Manager.Core.Model
{
[Route("/customers", "POST")]
[Route("/customers/{Id}", "PUT, DELETE")]
[Route("/customers/{Id}", "GET, OPTIONS")]
public class Customer : EntityBase
{
public string Name { get; set; }
public string Company { get; set; }
public string Email { get; set; }
}
}
|
using ServiceStack.ServiceHost;
namespace License.Manager.Core.Model
{
[Route("/customers", "POST")]
[Route("/customers/{Id}", "PUT, DELETE")]
[Route("/customers/{Id}", "GET, OPTIONS")]
public class Customer : EntityBase, IReturn<Customer>
{
public string Name { get; set; }
public string Company { get; set; }
public string Email { get; set; }
}
}
|
Add response DTO marker interface for service documentation
|
Add response DTO marker interface for service documentation
|
C#
|
mit
|
dnauck/License.Manager,dnauck/License.Manager
|
24e163a72dd4aa7059371e716698d1d6d672b3b4
|
ReoGrid/Print/WPFPrinter.cs
|
ReoGrid/Print/WPFPrinter.cs
|
/*****************************************************************************
*
* ReoGrid - .NET Spreadsheet Control
*
* https://reogrid.net/
*
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
* KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
* PURPOSE.
*
* Author: Jing Lu <jingwood at unvell.com>
*
* Copyright (c) 2012-2021 Jing Lu <jingwood at unvell.com>
* Copyright (c) 2012-2016 unvell.com, all rights reserved.
*
****************************************************************************/
#if PRINT
#if WPF
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Xps;
using System.Windows.Xps.Packaging;
using unvell.ReoGrid.Print;
namespace unvell.ReoGrid.Print
{
partial class PrintSession
{
internal void Init() { }
public void Dispose() { }
/// <summary>
/// Start output document to printer.
/// </summary>
public void Print()
{
throw new NotImplementedException("WPF Print is not implemented yet. Try use Windows Form version to print document as XPS file.");
}
}
}
namespace unvell.ReoGrid
{
partial class Worksheet
{
}
}
#endif // WPF
#endif // PRINT
|
/*****************************************************************************
*
* ReoGrid - .NET Spreadsheet Control
*
* https://reogrid.net/
*
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
* KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
* PURPOSE.
*
* Author: Jing Lu <jingwood at unvell.com>
*
* Copyright (c) 2012-2021 Jing Lu <jingwood at unvell.com>
* Copyright (c) 2012-2016 unvell.com, all rights reserved.
*
****************************************************************************/
#if PRINT
#if WPF
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using unvell.ReoGrid.Print;
namespace unvell.ReoGrid.Print
{
partial class PrintSession
{
internal void Init() { }
public void Dispose() { }
/// <summary>
/// Start output document to printer.
/// </summary>
public void Print()
{
throw new NotImplementedException("WPF Print is not implemented yet. Try use Windows Form version to print document as XPS file.");
}
}
}
namespace unvell.ReoGrid
{
partial class Worksheet
{
}
}
#endif // WPF
#endif // PRINT
|
Fix compiling error on .net451
|
Fix compiling error on .net451
|
C#
|
mit
|
unvell/ReoGrid,unvell/ReoGrid
|
49077b0f69c4aa1651d65db6537385f5f1587fc5
|
Source/Lib/TraktApiSharp/Objects/Get/Shows/TraktShowAirs.cs
|
Source/Lib/TraktApiSharp/Objects/Get/Shows/TraktShowAirs.cs
|
namespace TraktApiSharp.Objects.Get.Shows
{
using Newtonsoft.Json;
/// <summary>
/// The air time of a Trakt show.
/// </summary>
public class TraktShowAirs
{
/// <summary>
/// The day of week on which the show airs.
/// </summary>
[JsonProperty(PropertyName = "day")]
public string Day { get; set; }
/// <summary>
/// The time of day at which the show airs.
/// </summary>
[JsonProperty(PropertyName = "time")]
public string Time { get; set; }
/// <summary>
/// The time zone id (Olson) for the location in which the show airs.
/// </summary>
[JsonProperty(PropertyName = "timezone")]
public string TimeZoneId { get; set; }
}
}
|
namespace TraktApiSharp.Objects.Get.Shows
{
using Newtonsoft.Json;
/// <summary>The air time of a Trakt show.</summary>
public class TraktShowAirs
{
/// <summary>Gets or sets the day of week on which the show airs.</summary>
[JsonProperty(PropertyName = "day")]
public string Day { get; set; }
/// <summary>Gets or sets the time of day at which the show airs.</summary>
[JsonProperty(PropertyName = "time")]
public string Time { get; set; }
/// <summary>Gets or sets the time zone id (Olson) for the location in which the show airs.</summary>
[JsonProperty(PropertyName = "timezone")]
public string TimeZoneId { get; set; }
}
}
|
Add documentation for show airs.
|
Add documentation for show airs.
|
C#
|
mit
|
henrikfroehling/TraktApiSharp
|
9cea63f3679d79afe5c85f54c47e212c9e2ca243
|
LanguageExt.Tests/DelayTests.cs
|
LanguageExt.Tests/DelayTests.cs
|
using LanguageExt;
using static LanguageExt.Prelude;
using System;
using System.Reactive.Linq;
using System.Threading;
using Xunit;
namespace LanguageExtTests
{
public class DelayTests
{
[Fact]
public void DelayTest1()
{
var span = TimeSpan.FromMilliseconds(500);
var till = DateTime.Now.Add(span);
var v = 0;
delay(() => 1, span).Subscribe(x => v = x);
while( DateTime.Now < till.AddMilliseconds(20) )
{
Assert.True(v == 0);
Thread.Sleep(1);
}
while (DateTime.Now < till.AddMilliseconds(100))
{
Thread.Sleep(1);
}
Assert.True(v == 1);
}
}
}
|
using LanguageExt;
using static LanguageExt.Prelude;
using System;
using System.Reactive.Linq;
using System.Threading;
using Xunit;
namespace LanguageExtTests
{
public class DelayTests
{
#if !CI
[Fact]
public void DelayTest1()
{
var span = TimeSpan.FromMilliseconds(500);
var till = DateTime.Now.Add(span);
var v = 0;
delay(() => 1, span).Subscribe(x => v = x);
while( DateTime.Now < till )
{
Assert.True(v == 0);
Thread.Sleep(1);
}
while (DateTime.Now < till.AddMilliseconds(100))
{
Thread.Sleep(1);
}
Assert.True(v == 1);
}
#endif
}
}
|
Remove delay test for CI for now
|
Remove delay test for CI for now
|
C#
|
mit
|
louthy/language-ext,StefanBertels/language-ext,StanJav/language-ext
|
43219182bbc403cc5a51dd9236eeb982db867663
|
Presentation.Web/Global.asax.cs
|
Presentation.Web/Global.asax.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace OS2Indberetning
{
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
//// Turns off self reference looping when serializing models in API controlllers
//GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
//// Set JSON serialization in WEB API to use camelCase (javascript) instead of PascalCase (C#)
//GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
}
}
}
|
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using System.Web.Http.ExceptionHandling;
using System.Web.Http.Controllers;
using System.Net.Http.Headers;
using System.Diagnostics;
using ActionFilterAttribute = System.Web.Http.Filters.ActionFilterAttribute;
namespace OS2Indberetning
{
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
#if DEBUG
GlobalConfiguration.Configuration.Services.Add(typeof(IExceptionLogger), new DebugExceptionLogger());
GlobalConfiguration.Configuration.Filters.Add(new AddAcceptCharsetHeaderActionFilter());
#endif
//// Turns off self reference looping when serializing models in API controlllers
//GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
//// Set JSON serialization in WEB API to use camelCase (javascript) instead of PascalCase (C#)
//GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
}
}
#if DEBUG
public class AddAcceptCharsetHeaderActionFilter : ActionFilterAttribute
{
public override void OnActionExecuting(HttpActionContext actionContext)
{
// Inject "Accept-Charset" header into the client request,
// since apparently this is required when running on Mono
// See: https://github.com/OData/odata.net/issues/165
actionContext.Request.Headers.AcceptCharset.Add(new StringWithQualityHeaderValue("UTF-8"));
base.OnActionExecuting(actionContext);
}
}
public class DebugExceptionLogger : ExceptionLogger
{
public override void Log(ExceptionLoggerContext context)
{
Debug.WriteLine(context.Exception);
}
}
#endif
}
|
Add debug logging and injection of "Accept-Charset" header that is required when running on Mono
|
Add debug logging and injection of "Accept-Charset" header that is required when running on Mono
|
C#
|
mpl-2.0
|
os2indberetning/os2indberetning,os2indberetning/os2indberetning,os2indberetning/os2indberetning,os2indberetning/os2indberetning
|
0f11cfe97478a6d85e806def528efd4f982dab42
|
osu.Framework/Threading/GameThreadSynchronizationContext.cs
|
osu.Framework/Threading/GameThreadSynchronizationContext.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.Diagnostics;
using System.Threading;
#nullable enable
namespace osu.Framework.Threading
{
/// <summary>
/// A synchronisation context which posts all continuations to a scheduler instance.
/// </summary>
internal class GameThreadSynchronizationContext : SynchronizationContext
{
private readonly Scheduler scheduler;
public int TotalTasksRun => scheduler.TotalTasksRun;
public GameThreadSynchronizationContext(GameThread gameThread)
{
scheduler = new GameThreadScheduler(gameThread);
}
public override void Send(SendOrPostCallback d, object? state)
{
var del = scheduler.Add(() => d(state));
Debug.Assert(del != null);
while (del.State == ScheduledDelegate.RunState.Waiting)
{
if (scheduler.IsMainThread)
scheduler.Update();
else
Thread.Sleep(1);
}
}
public override void Post(SendOrPostCallback d, object? state) => scheduler.Add(() => d(state));
public void RunWork() => scheduler.Update();
}
}
|
// 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.Diagnostics;
using System.Threading;
#nullable enable
namespace osu.Framework.Threading
{
/// <summary>
/// A synchronisation context which posts all continuations to an isolated scheduler instance.
/// </summary>
/// <remarks>
/// This implementation roughly follows the expectations set out for winforms/WPF as per
/// https://docs.microsoft.com/en-us/archive/msdn-magazine/2011/february/msdn-magazine-parallel-computing-it-s-all-about-the-synchronizationcontext.
/// - Calls to <see cref="Post"/> are guaranteed to run asynchronously.
/// - Calls to <see cref="Send"/> will run inline when they can.
/// - Order of execution is guaranteed (in our case, it is guaranteed over <see cref="Send"/> and <see cref="Post"/> calls alike).
/// - To enforce the above, calling <see cref="Send"/> will flush any pending work until the newly queued item has been completed.
/// </remarks>
internal class GameThreadSynchronizationContext : SynchronizationContext
{
private readonly Scheduler scheduler;
public int TotalTasksRun => scheduler.TotalTasksRun;
public GameThreadSynchronizationContext(GameThread gameThread)
{
scheduler = new GameThreadScheduler(gameThread);
}
public override void Send(SendOrPostCallback callback, object? state)
{
var scheduledDelegate = scheduler.Add(() => callback(state));
Debug.Assert(scheduledDelegate != null);
while (scheduledDelegate.State == ScheduledDelegate.RunState.Waiting)
{
if (scheduler.IsMainThread)
scheduler.Update();
else
Thread.Sleep(1);
}
}
public override void Post(SendOrPostCallback callback, object? state) => scheduler.Add(() => callback(state));
public void RunWork() => scheduler.Update();
}
}
|
Add xmldoc describing `SynchronizationContext` behaviour
|
Add xmldoc describing `SynchronizationContext` behaviour
|
C#
|
mit
|
peppy/osu-framework,smoogipooo/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,peppy/osu-framework,ppy/osu-framework,ppy/osu-framework,peppy/osu-framework
|
029da35be96d8235428dc5d585534e002a8f49d7
|
MultiMiner.Xgminer.Api/DeviceInformation.cs
|
MultiMiner.Xgminer.Api/DeviceInformation.cs
|
using System;
namespace MultiMiner.Xgminer.Api
{
public class DeviceInformation
{
public DeviceInformation()
{
Status = String.Empty;
}
public string Kind { get; set; }
public string Name { get; set; }
public int Index { get; set; }
public bool Enabled { get; set; }
public string Status { get; set; }
public double Temperature { get; set; }
public int FanSpeed { get; set; }
public int FanPercent { get; set; }
public int GpuClock { get; set; }
public int MemoryClock { get; set; }
public double GpuVoltage { get; set; }
public int GpuActivity { get; set; }
public int PowerTune { get; set; }
public double AverageHashrate { get; set; }
public double CurrentHashrate { get; set; }
public int AcceptedShares { get; set; }
public int RejectedShares { get; set; }
public int HardwareErrors { get; set; }
public double Utility { get; set; }
public string Intensity { get; set; } //string, might be D
public int PoolIndex { get; set; }
}
}
|
using System;
namespace MultiMiner.Xgminer.Api
{
public class DeviceInformation
{
public DeviceInformation()
{
Status = String.Empty;
Name = String.Empty; //cgminer may / does not return this
}
public string Kind { get; set; }
public string Name { get; set; }
public int Index { get; set; }
public bool Enabled { get; set; }
public string Status { get; set; }
public double Temperature { get; set; }
public int FanSpeed { get; set; }
public int FanPercent { get; set; }
public int GpuClock { get; set; }
public int MemoryClock { get; set; }
public double GpuVoltage { get; set; }
public int GpuActivity { get; set; }
public int PowerTune { get; set; }
public double AverageHashrate { get; set; }
public double CurrentHashrate { get; set; }
public int AcceptedShares { get; set; }
public int RejectedShares { get; set; }
public int HardwareErrors { get; set; }
public double Utility { get; set; }
public string Intensity { get; set; } //string, might be D
public int PoolIndex { get; set; }
}
}
|
Fix a null reference error using cgminer as a backend
|
Fix a null reference error using cgminer as a backend
|
C#
|
mit
|
nwoolls/MultiMiner,IWBWbiz/MultiMiner,nwoolls/MultiMiner,IWBWbiz/MultiMiner
|
e3f67bb111986d57b496274f024af75b09065ea3
|
Saule/Serialization/ResourceDeserializer.cs
|
Saule/Serialization/ResourceDeserializer.cs
|
using System;
using Newtonsoft.Json.Linq;
namespace Saule.Serialization
{
internal class ResourceDeserializer
{
private readonly JToken _object;
private readonly Type _target;
public ResourceDeserializer(JToken @object, Type target)
{
_object = @object;
_target = target;
}
public object Deserialize()
{
return ToFlatStructure(_object).ToObject(_target);
}
private JToken ToFlatStructure(JToken json)
{
var array = json["data"] as JArray;
if (array == null)
{
var obj = json["data"] as JObject;
if (obj == null) {
return null;
}
return SingleToFlatStructure(json["data"] as JObject);
}
var result = new JArray();
foreach (var child in array)
{
result.Add(SingleToFlatStructure(child as JObject));
}
return result;
}
private JToken SingleToFlatStructure(JObject child)
{
var result = new JObject();
if (child["id"] != null)
{
result["id"] = child["id"];
}
foreach (var attr in child["attributes"] ?? new JArray())
{
var prop = attr as JProperty;
result.Add(prop?.Name.ToPascalCase(), prop?.Value);
}
foreach (var rel in child["relationships"] ?? new JArray())
{
var prop = rel as JProperty;
result.Add(prop?.Name.ToPascalCase(), ToFlatStructure(prop?.Value));
}
return result;
}
}
}
|
using System;
using Newtonsoft.Json.Linq;
namespace Saule.Serialization
{
internal class ResourceDeserializer
{
private readonly JToken _object;
private readonly Type _target;
public ResourceDeserializer(JToken @object, Type target)
{
_object = @object;
_target = target;
}
public object Deserialize()
{
return ToFlatStructure(_object).ToObject(_target);
}
private JToken ToFlatStructure(JToken json)
{
var array = json["data"] as JArray;
if (array == null)
{
var obj = json["data"] as JObject;
if (obj == null)
{
return null;
}
return SingleToFlatStructure(json["data"] as JObject);
}
var result = new JArray();
foreach (var child in array)
{
result.Add(SingleToFlatStructure(child as JObject));
}
return result;
}
private JToken SingleToFlatStructure(JObject child)
{
var result = new JObject();
if (child["id"] != null)
{
result["id"] = child["id"];
}
foreach (var attr in child["attributes"] ?? new JArray())
{
var prop = attr as JProperty;
result.Add(prop?.Name.ToPascalCase(), prop?.Value);
}
foreach (var rel in child["relationships"] ?? new JArray())
{
var prop = rel as JProperty;
result.Add(prop?.Name.ToPascalCase(), ToFlatStructure(prop?.Value));
}
return result;
}
}
}
|
Fix failing style check... second attempt
|
Fix failing style check... second attempt
|
C#
|
mit
|
goo32/saule
|
22b7a09733c01633bf6bb4178b959d670b018476
|
Assets/UnityTouchRecorder/Scripts/TouchRecorderController.cs
|
Assets/UnityTouchRecorder/Scripts/TouchRecorderController.cs
|
using UnityEngine;
namespace UnityTouchRecorder
{
public class TouchRecorderController : MonoBehaviour
{
UnityTouchRecorderPlugin plugin = new UnityTouchRecorderPlugin();
[SerializeField]
TouchRecorderView view;
void Awake()
{
Object.DontDestroyOnLoad(gameObject);
view.OpenMenuButton.onClick.AddListener(() =>
{
view.SetMenuActive(!view.IsMenuActive);
});
view.StartRecordingButton.onClick.AddListener(() =>
{
view.SetMenuActive(false);
view.OpenMenuButton.gameObject.SetActive(false);
view.StopButton.gameObject.SetActive(true);
plugin.StartRecording();
});
view.PlayButton.onClick.AddListener(() =>
{
view.SetMenuActive(false);
view.OpenMenuButton.gameObject.SetActive(false);
view.StopButton.gameObject.SetActive(true);
plugin.Play(view.Repeat, view.Interval);
});
view.StopButton.onClick.AddListener(() =>
{
view.OpenMenuButton.gameObject.SetActive(true);
view.StopButton.gameObject.SetActive(false);
plugin.StopRecording();
plugin.Stop();
});
}
}
}
|
using UnityEngine;
namespace UnityTouchRecorder
{
public class TouchRecorderController : MonoBehaviour
{
UnityTouchRecorderPlugin plugin = new UnityTouchRecorderPlugin();
[SerializeField]
TouchRecorderView view;
void Awake()
{
Object.DontDestroyOnLoad(gameObject);
view.OpenMenuButton.onClick.AddListener(() =>
{
view.SetMenuActive(!view.IsMenuActive);
});
view.StartRecordingButton.onClick.AddListener(() =>
{
view.SetMenuActive(false);
view.OpenMenuButton.gameObject.SetActive(false);
view.StopButton.gameObject.SetActive(true);
plugin.Clear();
plugin.StartRecording();
});
view.PlayButton.onClick.AddListener(() =>
{
view.SetMenuActive(false);
view.OpenMenuButton.gameObject.SetActive(false);
view.StopButton.gameObject.SetActive(true);
plugin.Play(view.Repeat, view.Interval);
});
view.StopButton.onClick.AddListener(() =>
{
view.OpenMenuButton.gameObject.SetActive(true);
view.StopButton.gameObject.SetActive(false);
plugin.StopRecording();
plugin.Stop();
});
}
}
}
|
Clear record before start new recording
|
Clear record before start new recording
|
C#
|
mit
|
thedoritos/unity-touch-recorder
|
142f9b83ddcb9818455f666c680c27f8fa097ad9
|
Assets/UniEditorScreenshot/Editor/CaptureWindow.cs
|
Assets/UniEditorScreenshot/Editor/CaptureWindow.cs
|
using UnityEngine;
using UnityEditor;
using System;
using System.IO;
using System.Collections;
public class CaptureWindow : EditorWindow{
private string saveFileName = string.Empty;
private string saveDirPath = string.Empty;
[MenuItem("Window/Capture Editor")]
private static void Capture() {
EditorWindow.GetWindow (typeof(CaptureWindow)).Show ();
}
void OnGUI() {
EditorGUILayout.LabelField ("OUTPUT FOLDER PATH:");
EditorGUILayout.LabelField (saveDirPath + "/");
if (string.IsNullOrEmpty (saveDirPath)) {
saveDirPath = Application.dataPath;
}
if (GUILayout.Button("Select output directory")) {
string path = EditorUtility.OpenFolderPanel("select directory", saveDirPath, Application.dataPath);
if (!string.IsNullOrEmpty(path)) {
saveDirPath = path;
}
}
if (GUILayout.Button("Open output directory")) {
System.Diagnostics.Process.Start (saveDirPath);
}
// insert blank line
GUILayout.Label ("");
if (GUILayout.Button("Take screenshot")) {
var outputPath = saveDirPath + "/" + DateTime.Now.ToString ("yyyyMMddHHmmss") + ".png";
ScreenCapture.CaptureScreenshot (outputPath);
Debug.Log ("Export scrennshot at " + outputPath);
}
}
}
|
using UnityEngine;
using UnityEditor;
using System;
public class CaptureWindow : EditorWindow
{
private string saveFileName = string.Empty;
private string saveDirPath = string.Empty;
[MenuItem("Window/Screenshot Capture")]
private static void Capture()
{
EditorWindow.GetWindow(typeof(CaptureWindow)).Show();
}
private void OnGUI()
{
EditorGUILayout.LabelField("Output Folder Path : ");
EditorGUILayout.LabelField(saveDirPath + "/");
if (string.IsNullOrEmpty(saveDirPath))
{
saveDirPath = Application.dataPath + "/..";
}
if (GUILayout.Button("Select output directory"))
{
string path = EditorUtility.OpenFolderPanel("select directory", saveDirPath, Application.dataPath);
if (!string.IsNullOrEmpty(path))
{
saveDirPath = path;
}
}
if (GUILayout.Button("Open output directory"))
{
System.Diagnostics.Process.Start(saveDirPath);
}
// insert blank line
GUILayout.Label("");
if (GUILayout.Button("Take screenshot"))
{
var resolution = GetMainGameViewSize();
int x = (int)resolution.x;
int y = (int)resolution.y;
var outputPath = saveDirPath + "/" + DateTime.Now.ToString($"{x}x{y}_yyyy_MM_dd_HH_mm_ss") + ".png";
ScreenCapture.CaptureScreenshot(outputPath);
Debug.Log("Export scrennshot at " + outputPath);
}
}
public static Vector2 GetMainGameViewSize()
{
System.Type T = System.Type.GetType("UnityEditor.GameView,UnityEditor");
System.Reflection.MethodInfo GetSizeOfMainGameView = T.GetMethod("GetSizeOfMainGameView", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
System.Object Res = GetSizeOfMainGameView.Invoke(null, null);
return (Vector2)Res;
}
}
|
Change output path, change screentshot image file name.
|
Change output path, change screentshot image file name.
|
C#
|
mit
|
sanukin39/UniEditorScreenshot
|
46c0a998996fae9920c85352d869ed2a19bf2405
|
CefSharp/IKeyboardHandler.cs
|
CefSharp/IKeyboardHandler.cs
|
// Copyright © 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
namespace CefSharp
{
public interface IKeyboardHandler
{
bool OnKeyEvent(IWebBrowser browser, KeyType type, int code, CefEventFlags modifiers, bool isSystemKey);
bool OnPreKeyEvent(IWebBrowser browser, KeyType type, int windowsKeyCode, int nativeKeyCode, CefEventFlags modifiers, bool isSystemKey, bool isKeyboardShortcut);
}
}
|
// Copyright © 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
namespace CefSharp
{
public interface IKeyboardHandler
{
bool OnKeyEvent(IWebBrowser browser, KeyType type, int code, CefEventFlags modifiers, bool isSystemKey);
bool OnPreKeyEvent(IWebBrowser browser, KeyType type, int windowsKeyCode, int nativeKeyCode, CefEventFlags modifiers, bool isSystemKey, ref bool isKeyboardShortcut);
}
}
|
Make OnPreKeyEvent isKeyboardShortcut a ref param
|
Make OnPreKeyEvent isKeyboardShortcut a ref param
|
C#
|
bsd-3-clause
|
Livit/CefSharp,AJDev77/CefSharp,battewr/CefSharp,rlmcneary2/CefSharp,illfang/CefSharp,gregmartinhtc/CefSharp,Livit/CefSharp,zhangjingpu/CefSharp,VioletLife/CefSharp,dga711/CefSharp,Haraguroicha/CefSharp,Livit/CefSharp,NumbersInternational/CefSharp,VioletLife/CefSharp,zhangjingpu/CefSharp,yoder/CefSharp,ruisebastiao/CefSharp,haozhouxu/CefSharp,zhangjingpu/CefSharp,ITGlobal/CefSharp,joshvera/CefSharp,Haraguroicha/CefSharp,battewr/CefSharp,AJDev77/CefSharp,windygu/CefSharp,Haraguroicha/CefSharp,Haraguroicha/CefSharp,NumbersInternational/CefSharp,VioletLife/CefSharp,wangzheng888520/CefSharp,yoder/CefSharp,dga711/CefSharp,haozhouxu/CefSharp,wangzheng888520/CefSharp,windygu/CefSharp,ruisebastiao/CefSharp,AJDev77/CefSharp,zhangjingpu/CefSharp,ITGlobal/CefSharp,NumbersInternational/CefSharp,dga711/CefSharp,NumbersInternational/CefSharp,Haraguroicha/CefSharp,joshvera/CefSharp,yoder/CefSharp,haozhouxu/CefSharp,illfang/CefSharp,gregmartinhtc/CefSharp,rlmcneary2/CefSharp,windygu/CefSharp,jamespearce2006/CefSharp,twxstar/CefSharp,rlmcneary2/CefSharp,ruisebastiao/CefSharp,windygu/CefSharp,twxstar/CefSharp,battewr/CefSharp,twxstar/CefSharp,AJDev77/CefSharp,ITGlobal/CefSharp,wangzheng888520/CefSharp,jamespearce2006/CefSharp,ITGlobal/CefSharp,jamespearce2006/CefSharp,haozhouxu/CefSharp,ruisebastiao/CefSharp,twxstar/CefSharp,battewr/CefSharp,gregmartinhtc/CefSharp,Livit/CefSharp,yoder/CefSharp,illfang/CefSharp,illfang/CefSharp,joshvera/CefSharp,dga711/CefSharp,gregmartinhtc/CefSharp,VioletLife/CefSharp,jamespearce2006/CefSharp,rlmcneary2/CefSharp,joshvera/CefSharp,wangzheng888520/CefSharp,jamespearce2006/CefSharp
|
316159ed18bc94d2450d51f85aa232e3e19c44e5
|
LanguagePatches/Translation.cs
|
LanguagePatches/Translation.cs
|
/**
* Language Patches Framework
* Translates the game into different Languages
* Copyright (c) 2016 Thomas P.
* Licensed under the terms of the MIT License
*/
using System;
namespace LanguagePatches
{
/// <summary>
/// A class that represents a text translation
/// </summary>
public class Translation
{
/// <summary>
/// The original message, uses Regex syntax
/// </summary>
public String text { get; set; }
/// <summary>
/// The replacement message, uses String.Format syntax
/// </summary>
public String translation { get; set; }
/// <summary>
/// Creates a new Translation component from a config node
/// </summary>
/// <param name="node">The config node where the </param>
public Translation(ConfigNode node)
{
// Check for original text
if (!node.HasValue("text"))
throw new Exception("The config node is missing the text value!");
// Check for translation
if (!node.HasValue("translation"))
throw new Exception("The config node is missing the translation value!");
// Assign the new texts
text = node.GetValue("text");
translation = node.GetValue("translation");
}
}
}
|
/**
* Language Patches Framework
* Translates the game into different Languages
* Copyright (c) 2016 Thomas P.
* Licensed under the terms of the MIT License
*/
using System;
using System.Text.RegularExpressions;
namespace LanguagePatches
{
/// <summary>
/// A class that represents a text translation
/// </summary>
public class Translation
{
/// <summary>
/// The original message, uses Regex syntax
/// </summary>
public String text { get; set; }
/// <summary>
/// The replacement message, uses String.Format syntax
/// </summary>
public String translation { get; set; }
/// <summary>
/// Creates a new Translation component from a config node
/// </summary>
/// <param name="node">The config node where the </param>
public Translation(ConfigNode node)
{
// Check for original text
if (!node.HasValue("text"))
throw new Exception("The config node is missing the text value!");
// Check for translation
if (!node.HasValue("translation"))
throw new Exception("The config node is missing the translation value!");
// Assign the new texts
text = node.GetValue("text");
translation = node.GetValue("translation");
// Replace variable placeholders
translation = Regex.Replace(translation, @"@(\d*)", "{$1}");
}
}
}
|
Use placeholder expressions, {nr} doesn't work because of ConfigNode beign weird
|
Use placeholder expressions, {nr} doesn't work because of ConfigNode beign weird
|
C#
|
mit
|
LanguagePatches/LanguagePatches-Framework
|
cf21f1d8080a418e128232926fff21a8866367f1
|
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>
/// <param name="singleMultipleAnswerQuestionOption"></param>
public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption)
{
_dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion);
_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 questions = _dbContext.SingleMultipleAnswerQuestion.ToList();
return questions;
}
/// <summary>
/// Add single multiple answer question into SingleMultipleAnswerQuestion model
/// </summary>
/// <param name="singleMultipleAnswerQuestion"></param>
/// <param name="singleMultipleAnswerQuestionOption"></param>
public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption)
{
_dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion);
_dbContext.SingleMultipleAnswerQuestionOption.Add(singleMultipleAnswerQuestionOption);
_dbContext.SaveChanges();
}
}
}
|
Update server side API for single multiple answer question
|
Update server side API for single multiple answer question
|
C#
|
mit
|
Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist
|
d61d8bfa40cc0a823795844d78adec2e260326e3
|
src/Bakery/Configuration/Properties/PropertyNotFoundException.cs
|
src/Bakery/Configuration/Properties/PropertyNotFoundException.cs
|
namespace Bakery.Configuration.Properties
{
using System;
public class PropertyNotFoundException
: Exception
{
private readonly String propertyName;
public PropertyNotFoundException(String propertyName)
{
this.propertyName = propertyName;
}
public override String Message
{
get
{
return $"Property \"${propertyName}\" not found.";
}
}
}
}
|
namespace Bakery.Configuration.Properties
{
using System;
public class PropertyNotFoundException
: Exception
{
private readonly String propertyName;
public PropertyNotFoundException(String propertyName)
{
this.propertyName = propertyName;
}
public override String Message
{
get
{
return $"Property \"{propertyName}\" not found.";
}
}
}
}
|
Remove erroneous "$" symbol from "bling string."
|
Remove erroneous "$" symbol from "bling string."
|
C#
|
mit
|
brendanjbaker/Bakery
|
7fa0e75288a7124a55728feecb140ef02140b133
|
DesktopWidgets/Widgets/Search/Settings.cs
|
DesktopWidgets/Widgets/Search/Settings.cs
|
using System.ComponentModel;
using System.Windows;
using DesktopWidgets.WidgetBase.Settings;
namespace DesktopWidgets.Widgets.Search
{
public class Settings : WidgetSettingsBase
{
public Settings()
{
Style.Width = 150;
Style.FramePadding = new Thickness(0);
}
[Category("General")]
[DisplayName("URL Prefix")]
public string BaseUrl { get; set; } = "http://";
[Category("General")]
[DisplayName("URL Suffix")]
public string URLSuffix { get; set; }
}
}
|
using System.ComponentModel;
using System.Windows;
using DesktopWidgets.WidgetBase.Settings;
namespace DesktopWidgets.Widgets.Search
{
public class Settings : WidgetSettingsBase
{
public Settings()
{
Style.Width = 150;
Style.FramePadding = new Thickness(0);
}
[Category("General")]
[DisplayName("URL Prefix")]
public string BaseUrl { get; set; } = "https://www.google.com/search?q=";
[Category("General")]
[DisplayName("URL Suffix")]
public string URLSuffix { get; set; }
}
}
|
Change default Search URL Prefix
|
Change default Search URL Prefix
|
C#
|
apache-2.0
|
danielchalmers/DesktopWidgets
|
f9f53041b9da87946b63230b362691ff30b2bc36
|
src/Exceptionless.Core/Extensions/UriExtensions.cs
|
src/Exceptionless.Core/Extensions/UriExtensions.cs
|
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
namespace Exceptionless.Core.Extensions {
public static class UriExtensions {
public static string ToQueryString(this NameValueCollection collection) {
return collection.AsKeyValuePairs().ToQueryString();
}
public static string ToQueryString(this IEnumerable<KeyValuePair<string, string>> collection) {
return collection.ToConcatenatedString(pair => pair.Key == null ? pair.Value : $"{pair.Key}={pair.Value}", "&");
}
/// <summary>
/// Converts the legacy NameValueCollection into a strongly-typed KeyValuePair sequence.
/// </summary>
private static IEnumerable<KeyValuePair<string, string>> AsKeyValuePairs(this NameValueCollection collection) {
return collection.AllKeys.Select(key => new KeyValuePair<string, string>(key, collection.Get(key)));
}
public static string GetBaseUrl(this Uri uri) {
return uri.Scheme + "://" + uri.Authority + uri.AbsolutePath;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
namespace Exceptionless.Core.Extensions {
public static class UriExtensions {
public static string ToQueryString(this NameValueCollection collection) {
return collection.AsKeyValuePairs().ToQueryString();
}
public static string ToQueryString(this IEnumerable<KeyValuePair<string, string>> collection) {
return collection.ToConcatenatedString(pair => pair.Key == null ? pair.Value : $"{pair.Key}={System.Web.HttpUtility.UrlEncode(pair.Value)}", "&");
}
/// <summary>
/// Converts the legacy NameValueCollection into a strongly-typed KeyValuePair sequence.
/// </summary>
private static IEnumerable<KeyValuePair<string, string>> AsKeyValuePairs(this NameValueCollection collection) {
return collection.AllKeys.Select(key => new KeyValuePair<string, string>(key, collection.Get(key)));
}
public static string GetBaseUrl(this Uri uri) {
return uri.Scheme + "://" + uri.Authority + uri.AbsolutePath;
}
}
}
|
Fix encoding issue while the query string parameters contains Chinese characters
|
Fix encoding issue while the query string parameters contains Chinese characters
|
C#
|
apache-2.0
|
exceptionless/Exceptionless,exceptionless/Exceptionless,exceptionless/Exceptionless,exceptionless/Exceptionless
|
12131d92390a208b7f6189269a21f17774c97d17
|
src/IdentityServer4/Test/TestUserProfileService.cs
|
src/IdentityServer4/Test/TestUserProfileService.cs
|
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
using IdentityServer4.Extensions;
using IdentityServer4.Models;
using IdentityServer4.Services;
using Microsoft.Extensions.Logging;
using System.Linq;
using System.Threading.Tasks;
namespace IdentityServer4.Test
{
public class TestUserProfileService : IProfileService
{
private readonly ILogger<TestUserProfileService> _logger;
private readonly TestUserStore _users;
public TestUserProfileService(TestUserStore users, ILogger<TestUserProfileService> logger)
{
_users = users;
_logger = logger;
}
public Task GetProfileDataAsync(ProfileDataRequestContext context)
{
_logger.LogDebug("Get profile called for subject {subject} from client {client} with claim types{claimTypes} via {caller}",
context.Subject.GetSubjectId(),
context.Client.ClientName ?? context.Client.ClientId,
context.RequestedClaimTypes,
context.Caller);
if (context.RequestedClaimTypes.Any())
{
var user = _users.FindBySubjectId(context.Subject.GetSubjectId());
context.AddFilteredClaims(user.Claims);
}
return Task.FromResult(0);
}
public Task IsActiveAsync(IsActiveContext context)
{
context.IsActive = true;
return Task.FromResult(0);
}
}
}
|
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
using IdentityServer4.Extensions;
using IdentityServer4.Models;
using IdentityServer4.Services;
using Microsoft.Extensions.Logging;
using System.Linq;
using System.Threading.Tasks;
namespace IdentityServer4.Test
{
public class TestUserProfileService : IProfileService
{
protected readonly ILogger Logger;
protected readonly TestUserStore Users;
public TestUserProfileService(TestUserStore users, ILogger<TestUserProfileService> logger)
{
Users = users;
Logger = logger;
}
public virtual Task GetProfileDataAsync(ProfileDataRequestContext context)
{
Logger.LogDebug("Get profile called for subject {subject} from client {client} with claim types {claimTypes} via {caller}",
context.Subject.GetSubjectId(),
context.Client.ClientName ?? context.Client.ClientId,
context.RequestedClaimTypes,
context.Caller);
if (context.RequestedClaimTypes.Any())
{
var user = Users.FindBySubjectId(context.Subject.GetSubjectId());
context.AddFilteredClaims(user.Claims);
}
return Task.FromResult(0);
}
public virtual Task IsActiveAsync(IsActiveContext context)
{
context.IsActive = true;
return Task.FromResult(0);
}
}
}
|
Make TestUserProfile service more derivation friendly
|
Make TestUserProfile service more derivation friendly
|
C#
|
apache-2.0
|
jbijlsma/IdentityServer4,IdentityServer/IdentityServer4,jbijlsma/IdentityServer4,MienDev/IdentityServer4,IdentityServer/IdentityServer4,IdentityServer/IdentityServer4,jbijlsma/IdentityServer4,chrisowhite/IdentityServer4,chrisowhite/IdentityServer4,IdentityServer/IdentityServer4,MienDev/IdentityServer4,jbijlsma/IdentityServer4,chrisowhite/IdentityServer4,MienDev/IdentityServer4,MienDev/IdentityServer4
|
1a26658ba4d3ab18ce3661bb4f1ec4b8405d825d
|
osu.Game.Rulesets.Mania/Edit/Setup/ManiaSetupSection.cs
|
osu.Game.Rulesets.Mania/Edit/Setup/ManiaSetupSection.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.Screens.Edit.Setup;
namespace osu.Game.Rulesets.Mania.Edit.Setup
{
public class ManiaSetupSection : RulesetSetupSection
{
private LabelledSwitchButton specialStyle;
public ManiaSetupSection()
: base(new ManiaRuleset().RulesetInfo)
{
}
[BackgroundDependencyLoader]
private void load()
{
Children = new Drawable[]
{
specialStyle = new LabelledSwitchButton
{
Label = "Use special (N+1) style",
Current = { Value = Beatmap.BeatmapInfo.SpecialStyle }
}
};
}
protected override void LoadComplete()
{
base.LoadComplete();
specialStyle.Current.BindValueChanged(_ => updateBeatmap());
}
private void updateBeatmap()
{
Beatmap.BeatmapInfo.SpecialStyle = specialStyle.Current.Value;
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.Screens.Edit.Setup;
namespace osu.Game.Rulesets.Mania.Edit.Setup
{
public class ManiaSetupSection : RulesetSetupSection
{
private LabelledSwitchButton specialStyle;
public ManiaSetupSection()
: base(new ManiaRuleset().RulesetInfo)
{
}
[BackgroundDependencyLoader]
private void load()
{
Children = new Drawable[]
{
specialStyle = new LabelledSwitchButton
{
Label = "Use special (N+1) style",
Description = "Changes one column to act as a classic \"scratch\" or \"special\" column, which can be moved around by the user's skin (to the left/right/centre). Generally used in 5k (4+1) or 8key (7+1) configurations.",
Current = { Value = Beatmap.BeatmapInfo.SpecialStyle }
}
};
}
protected override void LoadComplete()
{
base.LoadComplete();
specialStyle.Current.BindValueChanged(_ => updateBeatmap());
}
private void updateBeatmap()
{
Beatmap.BeatmapInfo.SpecialStyle = specialStyle.Current.Value;
}
}
}
|
Add description for mania special style
|
Add description for mania special style
|
C#
|
mit
|
NeoAdonis/osu,smoogipoo/osu,peppy/osu-new,smoogipoo/osu,peppy/osu,peppy/osu,ppy/osu,peppy/osu,smoogipooo/osu,smoogipoo/osu,NeoAdonis/osu,NeoAdonis/osu,ppy/osu,ppy/osu
|
2203465c2f43187d1be43a1c61d554ea67f94ede
|
src/dotless.Core/Plugins/ColorSpinPlugin.cs
|
src/dotless.Core/Plugins/ColorSpinPlugin.cs
|
namespace dotless.Core.Plugins
{
using System;
using Parser.Infrastructure.Nodes;
using Parser.Tree;
using Utils;
using System.ComponentModel;
[Description("Automatically spins all colors in a less file"), DisplayName("ColorSpin")]
public class ColorSpinPlugin : VisitorPlugin
{
public double Spin { get; set; }
public ColorSpinPlugin(double spin)
{
Spin = spin;
}
public override VisitorPluginType AppliesTo
{
get { return VisitorPluginType.AfterEvaluation; }
}
public override Node Execute(Node node, out bool visitDeeper)
{
visitDeeper = true;
if(node is Color)
{
var color = node as Color;
var hslColor = HslColor.FromRgbColor(color);
hslColor.Hue += Spin/360.0d;
var newColor = hslColor.ToRgbColor();
//node = new Color(newColor.R, newColor.G, newColor.B);
color.R = newColor.R;
color.G = newColor.G;
color.B = newColor.B;
}
return node;
}
}
}
|
namespace dotless.Core.Plugins
{
using Parser.Infrastructure.Nodes;
using Parser.Tree;
using Utils;
using System.ComponentModel;
[Description("Automatically spins all colors in a less file"), DisplayName("ColorSpin")]
public class ColorSpinPlugin : VisitorPlugin
{
public double Spin { get; set; }
public ColorSpinPlugin(double spin)
{
Spin = spin;
}
public override VisitorPluginType AppliesTo
{
get { return VisitorPluginType.AfterEvaluation; }
}
public override Node Execute(Node node, out bool visitDeeper)
{
visitDeeper = true;
var color = node as Color;
if (color == null) return node;
var hslColor = HslColor.FromRgbColor(color);
hslColor.Hue += Spin/360.0d;
var newColor = hslColor.ToRgbColor();
return newColor.ReducedFrom<Color>(color);
}
}
}
|
Refactor away property setter usages to allow Color to be immutable.
|
Refactor away property setter usages to allow Color to be immutable.
|
C#
|
apache-2.0
|
dotless/dotless,rytmis/dotless,rytmis/dotless,rytmis/dotless,rytmis/dotless,rytmis/dotless,rytmis/dotless,rytmis/dotless,dotless/dotless
|
85a4b2188881aaea531757bbb19f2684aa7bff40
|
src/SIM.Tool.Windows/MainWindowComponents/CreateSupportPatchButton.cs
|
src/SIM.Tool.Windows/MainWindowComponents/CreateSupportPatchButton.cs
|
namespace SIM.Tool.Windows.MainWindowComponents
{
using System.IO;
using System.Windows;
using Sitecore.Diagnostics.Base;
using Sitecore.Diagnostics.Base.Annotations;
using SIM.Core;
using SIM.Instances;
using SIM.Tool.Base;
using SIM.Tool.Base.Plugins;
[UsedImplicitly]
public class CreateSupportPatchButton : IMainWindowButton
{
#region Public methods
public bool IsEnabled(Window mainWindow, Instance instance)
{
return true;
}
public void OnClick(Window mainWindow, Instance instance)
{
if (instance == null)
{
WindowHelper.ShowMessage("Choose an instance first");
return;
}
var product = instance.Product;
Assert.IsNotNull(product, $"The {instance.ProductFullName} distributive is not available in local repository. You need to get it first.");
var version = product.Version + "." + product.Update;
CoreApp.RunApp("iexplore", $"http://dl.sitecore.net/updater/pc/CreatePatch.application?p1={version}&p2={instance.Name}&p3={instance.WebRootPath}");
NuGetHelper.UpdateSettings();
NuGetHelper.GeneratePackages(new FileInfo(product.PackagePath));
foreach (var module in instance.Modules)
{
NuGetHelper.GeneratePackages(new FileInfo(module.PackagePath));
}
}
#endregion
}
}
|
namespace SIM.Tool.Windows.MainWindowComponents
{
using System;
using System.IO;
using System.Windows;
using Sitecore.Diagnostics.Base;
using Sitecore.Diagnostics.Base.Annotations;
using SIM.Core;
using SIM.Instances;
using SIM.Tool.Base;
using SIM.Tool.Base.Plugins;
[UsedImplicitly]
public class CreateSupportPatchButton : IMainWindowButton
{
#region Public methods
public bool IsEnabled(Window mainWindow, Instance instance)
{
return true;
}
public void OnClick(Window mainWindow, Instance instance)
{
if (instance == null)
{
WindowHelper.ShowMessage("Choose an instance first");
return;
}
var product = instance.Product;
Assert.IsNotNull(product, $"The {instance.ProductFullName} distributive is not available in local repository. You need to get it first.");
var version = product.Version + "." + product.Update;
var args = new[]
{
version,
instance.Name,
instance.WebRootPath
};
var dir = Environment.ExpandEnvironmentVariables("%APPDATA%\\Sitecore\\CreatePatch");
if (!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
}
File.WriteAllLines(Path.Combine(dir, "args.txt"), args);
CoreApp.RunApp("iexplore", $"http://dl.sitecore.net/updater/pc/CreatePatch.application");
NuGetHelper.UpdateSettings();
NuGetHelper.GeneratePackages(new FileInfo(product.PackagePath));
foreach (var module in instance.Modules)
{
NuGetHelper.GeneratePackages(new FileInfo(module.PackagePath));
}
}
#endregion
}
}
|
Add support of Patch Creator 1.0.0.9
|
Add support of Patch Creator 1.0.0.9
|
C#
|
mit
|
dsolovay/Sitecore-Instance-Manager,Sitecore/Sitecore-Instance-Manager,sergeyshushlyapin/Sitecore-Instance-Manager,Brad-Christie/Sitecore-Instance-Manager
|
17ad6648d1e837a7a85f57792a9185377b37bd52
|
osu.Game.Tests/Visual/SongSelect/TestSceneDifficultyRangeFilterControl.cs
|
osu.Game.Tests/Visual/SongSelect/TestSceneDifficultyRangeFilterControl.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 NUnit.Framework;
using osu.Framework.Graphics;
using osu.Game.Screens.Select;
using osuTK;
namespace osu.Game.Tests.Visual.SongSelect
{
public class TestSceneDifficultyRangeFilterControl : OsuTestScene
{
[Test]
public void TestBasic()
{
Child = new DifficultyRangeFilterControl
{
Width = 200,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Scale = new Vector2(3),
};
}
}
}
|
// 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 NUnit.Framework;
using osu.Framework.Graphics;
using osu.Game.Screens.Select;
using osuTK;
namespace osu.Game.Tests.Visual.SongSelect
{
public class TestSceneDifficultyRangeFilterControl : OsuTestScene
{
[Test]
public void TestBasic()
{
AddStep("create control", () =>
{
Child = new DifficultyRangeFilterControl
{
Width = 200,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Scale = new Vector2(3),
};
});
}
}
}
|
Fix new test failing on headless runs
|
Fix new test failing on headless runs
|
C#
|
mit
|
ppy/osu,peppy/osu,ppy/osu,peppy/osu,peppy/osu,ppy/osu
|
1a6d39cb5fbe115c20a1e267c6a210446830d422
|
src/MonoDevelop.Dnx/MonoDevelop.Dnx/DnxProjectConfiguration.cs
|
src/MonoDevelop.Dnx/MonoDevelop.Dnx/DnxProjectConfiguration.cs
|
//
// DnxProjectConfiguration.cs
//
// Author:
// Matt Ward <ward.matt@gmail.com>
//
// Copyright (c) 2015 Matthew Ward
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using MonoDevelop.Projects;
namespace MonoDevelop.Dnx
{
public class DnxProjectConfiguration : DotNetProjectConfiguration
{
public DnxProjectConfiguration (string name)
: base (name)
{
}
public DnxProjectConfiguration ()
{
}
}
}
|
//
// DnxProjectConfiguration.cs
//
// Author:
// Matt Ward <ward.matt@gmail.com>
//
// Copyright (c) 2015 Matthew Ward
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using MonoDevelop.Projects;
namespace MonoDevelop.Dnx
{
public class DnxProjectConfiguration : DotNetProjectConfiguration
{
public DnxProjectConfiguration (string name)
: base (name)
{
ExternalConsole = true;
}
public DnxProjectConfiguration ()
{
ExternalConsole = true;
}
}
}
|
Use external console when running DNX apps.
|
Use external console when running DNX apps.
This allows DNX web projects to remain running. If an external console
is not used then the dnx.exe process is terminated for some reason.
|
C#
|
mit
|
mrward/monodevelop-dnx-addin
|
4882137ffb2127fd9dd6c5dbb7af18e9e44c4b30
|
Battery-Commander.Web/Views/APFT/List.cshtml
|
Battery-Commander.Web/Views/APFT/List.cshtml
|
@model IEnumerable<APFT>
<div class="page-header">
<h1>APFT @Html.ActionLink("Add New", "New", "APFT", null, new { @class = "btn btn-default" })</h1>
</div>
<table class="table table-striped" id="dt">
<thead>
<tr>
<th>Soldier</th>
<th>Date</th>
<th>Score</th>
<th>Result</th>
<th>Details</th>
</tr>
</thead>
<tbody>
@foreach (var model in Model)
{
<tr>
<td>@Html.DisplayFor(_ => model.Soldier)</td>
<td>
<a href="@Url.Action("Index", new { date = model.Date })">
@Html.DisplayFor(_ => model.Date)
</a>
</td>
<td>@Html.DisplayFor(_ => model.TotalScore)</td>
<td>
@if (model.IsPassing)
{
<span class="label label-success">Passing</span>
}
else
{
<span class="label label-danger">Failure</span>
}
</td>
<td>@Html.ActionLink("Details", "Details", new { model.Id })</td>
</tr>
}
</tbody>
</table>
|
@model IEnumerable<APFT>
<div class="page-header">
<h1>APFT @Html.ActionLink("Add New", "New", "APFT", null, new { @class = "btn btn-default" })</h1>
</div>
<table class="table table-striped" id="dt">
<thead>
<tr>
<th>Soldier</th>
<th>Date</th>
<th>Score</th>
<th>Result</th>
<th>Details</th>
</tr>
</thead>
<tbody>
@foreach (var model in Model)
{
<tr>
<td>@Html.DisplayFor(_ => model.Soldier)</td>
<td>
<a href="@Url.Action("Index", new { date = model.Date })">
@Html.DisplayFor(_ => model.Date)
</a>
</td>
<td>
@Html.DisplayFor(_ => model.TotalScore)
@if(model.IsAlternateAerobicEvent)
{
<span class="label">Alt. Aerobic</span>
}
</td>
<td>
@if (model.IsPassing)
{
<span class="label label-success">Passing</span>
}
else
{
<span class="label label-danger">Failure</span>
}
</td>
<td>@Html.ActionLink("Details", "Details", new { model.Id })</td>
</tr>
}
</tbody>
</table>
|
Add indicator to APFT list
|
Add indicator to APFT list
|
C#
|
mit
|
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
|
2002a2c06f9595a06cb9fec14cc20fb346bdb19d
|
BudgetAnalyser.UnitTest/MetaTest.cs
|
BudgetAnalyser.UnitTest/MetaTest.cs
|
using System;
using System.Linq;
using System.Reflection;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace BudgetAnalyser.UnitTest
{
[TestClass]
public class MetaTest
{
private const int ExpectedMinimumTests = 836;
[TestMethod]
public void ListAllTests()
{
Assembly assembly = GetType().Assembly;
var count = 0;
foreach (Type type in assembly.ExportedTypes)
{
var testClassAttrib = type.GetCustomAttribute<TestClassAttribute>();
if (testClassAttrib != null)
{
foreach (MethodInfo method in type.GetMethods())
{
if (method.GetCustomAttribute<TestMethodAttribute>() != null)
{
Console.WriteLine("{0} {1} - {2}", ++count, type.FullName, method.Name);
}
}
}
}
}
[TestMethod]
public void NoDecreaseInTests()
{
int count = CountTests();
Console.WriteLine(count);
Assert.IsTrue(count >= ExpectedMinimumTests);
}
[TestMethod]
public void UpdateNoDecreaseInTests()
{
int count = CountTests();
Assert.IsFalse(count > ExpectedMinimumTests + 10, "Update the minimum expected number of tests to " + count);
}
private int CountTests()
{
Assembly assembly = GetType().Assembly;
int count = (from type in assembly.ExportedTypes
let testClassAttrib = type.GetCustomAttribute<TestClassAttribute>()
where testClassAttrib != null
select type.GetMethods().Count(method => method.GetCustomAttribute<TestMethodAttribute>() != null)).Sum();
return count;
}
}
}
|
using System;
using System.Linq;
using System.Reflection;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace BudgetAnalyser.UnitTest
{
[TestClass]
public class MetaTest
{
private const int ExpectedMinimumTests = 868;
[TestMethod]
public void ListAllTests()
{
Assembly assembly = GetType().Assembly;
var count = 0;
foreach (Type type in assembly.ExportedTypes)
{
var testClassAttrib = type.GetCustomAttribute<TestClassAttribute>();
if (testClassAttrib != null)
{
foreach (MethodInfo method in type.GetMethods())
{
if (method.GetCustomAttribute<TestMethodAttribute>() != null)
{
Console.WriteLine("{0} {1} - {2}", ++count, type.FullName, method.Name);
}
}
}
}
}
[TestMethod]
public void NoDecreaseInTests()
{
int count = CountTests();
Console.WriteLine(count);
Assert.IsTrue(count >= ExpectedMinimumTests);
}
[TestMethod]
public void UpdateNoDecreaseInTests()
{
int count = CountTests();
Assert.IsFalse(count > ExpectedMinimumTests + 10, "Update the minimum expected number of tests to " + count);
}
private int CountTests()
{
Assembly assembly = GetType().Assembly;
int count = (from type in assembly.ExportedTypes
let testClassAttrib = type.GetCustomAttribute<TestClassAttribute>()
where testClassAttrib != null
select type.GetMethods().Count(method => method.GetCustomAttribute<TestMethodAttribute>() != null)).Sum();
return count;
}
}
}
|
Increase number of tests total
|
Increase number of tests total
|
C#
|
mit
|
Benrnz/BudgetAnalyser
|
a857fc8918a2364d2617fe955685e71259e5c809
|
Agiil.Bootstrap/Data/DataModule.cs
|
Agiil.Bootstrap/Data/DataModule.cs
|
using System;
using Agiil.Data;
using Agiil.Domain.Data;
using Autofac;
using CSF.Data;
using CSF.Data.Entities;
using CSF.Data.NHibernate;
namespace Agiil.Bootstrap.Data
{
public class DataModule : Module
{
protected override void Load(ContainerBuilder builder)
{
builder
.RegisterType<NHibernateQuery>()
.As<IQuery>();
builder
.RegisterType<NHibernatePersister>()
.As<IPersister>();
builder
.RegisterType<DatabaseCreator>()
.As<IDatabaseCreator>();
builder
.RegisterType<DevelopmentInitialDataCreator>()
.As<IInitialDataCreator>();
builder
.RegisterGeneric(typeof(GenericRepository<>))
.As(typeof(IRepository<>));
builder
.RegisterType<TransactionCreator>()
.As<ITransactionCreator>();
builder
.RegisterType<HardcodedDatabaseConfiguration>()
.As<IDatabaseConfiguration>();
}
}
}
|
using System;
using Agiil.Data;
using Agiil.Domain.Data;
using Autofac;
using CSF.Data;
using CSF.Data.Entities;
using CSF.Data.NHibernate;
namespace Agiil.Bootstrap.Data
{
public class DataModule : Module
{
protected override void Load(ContainerBuilder builder)
{
builder
.RegisterType<NHibernateQuery>()
.As<IQuery>();
builder
.RegisterType<NHibernatePersister>()
.As<IPersister>();
builder
.RegisterType<DatabaseCreator>()
.As<IDatabaseCreator>();
builder
.RegisterType<DevelopmentInitialDataCreator>()
.As<IInitialDataCreator>();
builder
.RegisterGeneric(typeof(GenericRepository<>))
.As(typeof(IRepository<>));
builder
.RegisterType<Repository>()
.As<IRepository>();
builder
.RegisterType<TransactionCreator>()
.As<ITransactionCreator>();
builder
.RegisterType<HardcodedDatabaseConfiguration>()
.As<IDatabaseConfiguration>();
}
}
}
|
Add repository to bootstrap registrations
|
Add repository to bootstrap registrations
|
C#
|
mit
|
csf-dev/agiil,csf-dev/agiil,csf-dev/agiil,csf-dev/agiil
|
1f20236db91b780c299d8c6fd0293e15afc1f0ab
|
Bindings/UWP/UwpUrhoInitializer.cs
|
Bindings/UWP/UwpUrhoInitializer.cs
|
using System;
using System.IO;
using System.Runtime.InteropServices;
using Windows.Storage;
namespace Urho.UWP
{
public static class UwpUrhoInitializer
{
internal static void OnInited()
{
var folder = ApplicationData.Current.LocalFolder.Path;
}
}
}
|
using System;
using System.IO;
using System.Runtime.InteropServices;
using Windows.Storage;
namespace Urho.UWP
{
public static class UwpUrhoInitializer
{
internal static void OnInited()
{
var folder = ApplicationData.Current.LocalFolder.Path;
if (IntPtr.Size == 8)
{
throw new NotSupportedException("x86_64 is not supported yet. Please use x86.");
}
}
}
}
|
Add warning for UWP that it works only in x86 yet
|
Add warning for UWP that it works only in x86 yet
|
C#
|
mit
|
florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho
|
65467a4446e882613f62f05c17df0096d4e81f0f
|
SH.Site/Views/Partials/_Menu.cshtml
|
SH.Site/Views/Partials/_Menu.cshtml
|
@inherits UmbracoViewPage<MenuViewModel>
<a href="#menu" id="menu-link">
<i class="fa fa-bars" aria-hidden="true"></i>
<i class="fa fa-times" aria-hidden="true"></i>
</a>
<div id="menu">
<div class="pure-menu">
<span class="pure-menu-heading">@Model.SiteName</span>
<ul class="pure-menu-list">
@foreach (var item in Model.MenuItems)
{
var selected = Model.Content.Path.Split(',').Select(int.Parse).Contains(item.Id);
<li class="pure-menu-item @(selected ? "pure-menu-selected": "")">
<a href="@item.Url" class="pure-menu-link">
@item.Name
</a>
</li>
}
</ul>
</div>
</div>
|
@model MenuViewModel
<a href="#menu" id="menu-link">
<i class="fa fa-bars" aria-hidden="true"></i>
<i class="fa fa-times" aria-hidden="true"></i>
</a>
<div id="menu">
<div class="pure-menu">
<span class="pure-menu-heading">@Model.SiteName</span>
<ul class="pure-menu-list">
@foreach (var item in Model.MenuItems)
{
var selected = Model.Content.Path.Split(',').Select(int.Parse).Contains(item.Id);
<li class="pure-menu-item @(selected ? "pure-menu-selected": "")">
<a href="@item.Url" class="pure-menu-link">
@item.Name
</a>
</li>
}
</ul>
</div>
</div>
|
Change menu partial view type
|
Change menu partial view type
|
C#
|
mit
|
stvnhrlnd/SH,stvnhrlnd/SH,stvnhrlnd/SH
|
5083173b24b661579f359b2d5340263f4ad5587c
|
Assets/AdjustOaid/Android/AdjustOaidAndroid.cs
|
Assets/AdjustOaid/Android/AdjustOaidAndroid.cs
|
using System;
using System.Runtime.InteropServices;
using UnityEngine;
namespace com.adjust.sdk.oaid
{
#if UNITY_ANDROID
public class AdjustOaidAndroid
{
private static AndroidJavaClass ajcAdjustOaid = new AndroidJavaClass("com.adjust.sdk.oaid.AdjustOaid");
public static void ReadOaid()
{
if (ajcAdjustOaid == null)
{
ajcAdjustOaid = new AndroidJavaClass("com.adjust.sdk.oaid.AdjustOaid");
}
ajcAdjustOaid.CallStatic("readOaid");
}
public static void DoNotReadOaid()
{
if (ajcAdjustOaid == null)
{
ajcAdjustOaid = new AndroidJavaClass("com.adjust.sdk.oaid.AdjustOaid");
}
ajcAdjustOaid.CallStatic("doNotReadOaid");
}
}
#endif
}
|
using System;
using System.Runtime.InteropServices;
using UnityEngine;
namespace com.adjust.sdk.oaid
{
#if UNITY_ANDROID
public class AdjustOaidAndroid
{
private static AndroidJavaClass ajcAdjustOaid = new AndroidJavaClass("com.adjust.sdk.oaid.AdjustOaid");
private static AndroidJavaObject ajoCurrentActivity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity");
public static void ReadOaid()
{
if (ajcAdjustOaid == null)
{
ajcAdjustOaid = new AndroidJavaClass("com.adjust.sdk.oaid.AdjustOaid");
}
ajcAdjustOaid.CallStatic("readOaid", ajoCurrentActivity);
}
public static void DoNotReadOaid()
{
if (ajcAdjustOaid == null)
{
ajcAdjustOaid = new AndroidJavaClass("com.adjust.sdk.oaid.AdjustOaid");
}
ajcAdjustOaid.CallStatic("doNotReadOaid");
}
}
#endif
}
|
Use new OAID reading method
|
Use new OAID reading method
|
C#
|
mit
|
adjust/unity_sdk,adjust/unity_sdk,adjust/unity_sdk
|
ba7f80fff33d42bba6b3f7089bd19a2d6bea4974
|
src/runtime/assemblyinfo.cs
|
src/runtime/assemblyinfo.cs
|
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
[assembly: AssemblyProduct("Python for .NET")]
[assembly: AssemblyVersion("4.0.0.1")]
[assembly: AssemblyDefaultAlias("Python.Runtime.dll")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]
[assembly: AssemblyCopyright("MIT License")]
[assembly: AssemblyFileVersion("2.0.0.2")]
[assembly: NeutralResourcesLanguage("en")]
#if PYTHON27
[assembly: AssemblyTitle("Python.Runtime for Python 2.7")]
[assembly: AssemblyDescription("Python Runtime for Python 2.7")]
#elif PYTHON33
[assembly: AssemblyTitle("Python.Runtime for Python 3.3")]
[assembly: AssemblyDescription("Python Runtime for Python 3.3")]
#elif PYTHON34
[assembly: AssemblyTitle("Python.Runtime for Python 3.4")]
[assembly: AssemblyDescription("Python Runtime for Python 3.4")]
#elif PYTHON35
[assembly: AssemblyTitle("Python.Runtime for Python 3.5")]
[assembly: AssemblyDescription("Python Runtime for Python 3.5")]
#elif PYTHON36
[assembly: AssemblyTitle("Python.Runtime for Python 3.6")]
[assembly: AssemblyDescription("Python Runtime for Python 3.6")]
#elif PYTHON37
[assembly: AssemblyTitle("Python.Runtime for Python 3.7")]
[assembly: AssemblyDescription("Python Runtime for Python 3.7")]
#endif
|
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
[assembly: AssemblyProduct("Python for .NET")]
[assembly: AssemblyVersion("4.0.0.1")]
[assembly: AssemblyDefaultAlias("Python.Runtime.dll")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]
[assembly: AssemblyCopyright("MIT License")]
[assembly: AssemblyFileVersion("2.0.0.2")]
[assembly: NeutralResourcesLanguage("en")]
[assembly: InternalsVisibleTo("Python.EmbeddingTest")]
|
Make internals (in particular Runtime.*) visible to the tests.
|
Make internals (in particular Runtime.*) visible to the tests.
|
C#
|
mit
|
pythonnet/pythonnet,Konstantin-Posudevskiy/pythonnet,yagweb/pythonnet,AlexCatarino/pythonnet,denfromufa/pythonnet,vmuriart/pythonnet,yagweb/pythonnet,denfromufa/pythonnet,denfromufa/pythonnet,dmitriyse/pythonnet,vmuriart/pythonnet,pythonnet/pythonnet,Konstantin-Posudevskiy/pythonnet,AlexCatarino/pythonnet,QuantConnect/pythonnet,dmitriyse/pythonnet,dmitriyse/pythonnet,QuantConnect/pythonnet,AlexCatarino/pythonnet,vmuriart/pythonnet,Konstantin-Posudevskiy/pythonnet,yagweb/pythonnet,yagweb/pythonnet,AlexCatarino/pythonnet,QuantConnect/pythonnet,pythonnet/pythonnet
|
b0c2f6a6554e135ed914ef12111b094bd2650458
|
src/Common/src/CoreLib/System/Runtime/CompilerServices/DiscardableAttribute.cs
|
src/Common/src/CoreLib/System/Runtime/CompilerServices/DiscardableAttribute.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.
namespace System.Runtime.CompilerServices
{
// Custom attribute to indicating a TypeDef is a discardable attribute.
public class DiscardableAttribute : Attribute
{
public DiscardableAttribute() { }
}
}
|
// 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.
namespace System.Runtime.CompilerServices
{
// Custom attribute to indicating a TypeDef is a discardable attribute.
[AttributeUsage(AttributeTargets.All)]
public class DiscardableAttribute : Attribute
{
public DiscardableAttribute() { }
}
}
|
Fix FxCop warning CA1018 (attributes should have AttributeUsage)
|
Fix FxCop warning CA1018 (attributes should have AttributeUsage)
Signed-off-by: dotnet-bot <03c4cb6107ae99956a7681f2c97ff7104809a2bd@microsoft.com>
|
C#
|
mit
|
shimingsg/corefx,ericstj/corefx,ViktorHofer/corefx,ericstj/corefx,wtgodbe/corefx,wtgodbe/corefx,wtgodbe/corefx,shimingsg/corefx,ViktorHofer/corefx,ericstj/corefx,ViktorHofer/corefx,shimingsg/corefx,wtgodbe/corefx,wtgodbe/corefx,ViktorHofer/corefx,shimingsg/corefx,ViktorHofer/corefx,shimingsg/corefx,ericstj/corefx,ericstj/corefx,ericstj/corefx,ViktorHofer/corefx,shimingsg/corefx,wtgodbe/corefx,wtgodbe/corefx,ViktorHofer/corefx,shimingsg/corefx,ericstj/corefx
|
fd291296110ecfc6a0539069271abc40c07fd2b9
|
src/Parsley/ParserExtensions.cs
|
src/Parsley/ParserExtensions.cs
|
using System.Diagnostics.CodeAnalysis;
namespace Parsley;
public static class ParserExtensions
{
public static bool TryParse<TItem, TValue>(
this Parser<TItem, TValue> parse,
ReadOnlySpan<TItem> input,
[NotNullWhen(true)] out TValue? value,
[NotNullWhen(false)] out ParseError? error)
{
var parseToEnd =
from result in parse
from end in Grammar.EndOfInput<TItem>()
select result;
return TryPartialParse(parseToEnd, input, out int index, out value, out error);
}
public static bool TryPartialParse<TItem, TValue>(
this Parser<TItem, TValue> parse,
ReadOnlySpan<TItem> input,
out int index,
[NotNullWhen(true)] out TValue? value,
[NotNullWhen(false)] out ParseError? error)
{
index = 0;
value = parse(input, ref index, out var succeeded, out var expectation);
if (succeeded)
{
error = null;
#pragma warning disable CS8762 // Parameter must have a non-null value when exiting in some condition.
return true;
#pragma warning restore CS8762 // Parameter must have a non-null value when exiting in some condition.
}
error = new ParseError(index, expectation!);
return false;
}
}
|
using System.Diagnostics.CodeAnalysis;
namespace Parsley;
public static class ParserExtensions
{
public static bool TryParse<TItem, TValue>(
this Parser<TItem, TValue> parse,
ReadOnlySpan<TItem> input,
[NotNullWhen(true)] out TValue? value,
[NotNullWhen(false)] out ParseError? error)
{
var parseToEnd =
Grammar.Map(parse, Grammar.EndOfInput<TItem>(), (result, _) => result);
return TryPartialParse(parseToEnd, input, out int index, out value, out error);
}
public static bool TryPartialParse<TItem, TValue>(
this Parser<TItem, TValue> parse,
ReadOnlySpan<TItem> input,
out int index,
[NotNullWhen(true)] out TValue? value,
[NotNullWhen(false)] out ParseError? error)
{
index = 0;
value = parse(input, ref index, out var succeeded, out var expectation);
if (succeeded)
{
error = null;
#pragma warning disable CS8762 // Parameter must have a non-null value when exiting in some condition.
return true;
#pragma warning restore CS8762 // Parameter must have a non-null value when exiting in some condition.
}
error = new ParseError(index, expectation!);
return false;
}
}
|
Rephrase parsing to the end of input in terms of Map.
|
Rephrase parsing to the end of input in terms of Map.
|
C#
|
mit
|
plioi/parsley
|
41a77e3b3a46fcf75f82082990f9619cc9008a32
|
Opserver/Views/Dashboard/CurrentStatusTypes.cs
|
Opserver/Views/Dashboard/CurrentStatusTypes.cs
|
using System.ComponentModel;
namespace StackExchange.Opserver.Views.Dashboard
{
public enum CurrentStatusTypes
{
[Description("None")]
None = 0,
Stats = 1,
Interfaces = 2,
[Description("VM Info")]
VMHost = 3,
[Description("Elastic")]
Elastic = 4,
HAProxy = 5,
[Description("SQL Instance")]
SQLInstance = 6,
[Description("Active SQL")]
SQLActive = 7,
[Description("Top SQL")]
SQLTop = 8,
[Description("Redis Info")]
Redis = 9
}
}
|
using System.ComponentModel;
namespace StackExchange.Opserver.Views.Dashboard
{
public enum CurrentStatusTypes
{
[Description("None")]
None = 0,
[Description("Stats")]
Stats = 1,
[Description("Interfaces")]
Interfaces = 2,
[Description("VM Info")]
VMHost = 3,
[Description("Elastic")]
Elastic = 4,
[Description("HAProxy")]
HAProxy = 5,
[Description("SQL Instance")]
SQLInstance = 6,
[Description("Active SQL")]
SQLActive = 7,
[Description("Top SQL")]
SQLTop = 8,
[Description("Redis Info")]
Redis = 9
}
}
|
Fix tab names on node views
|
Fix tab names on node views
New .GetDescription() in UnchainedMelody doesn't default to .ToString(),
attribute needs to be present.
|
C#
|
mit
|
jeddytier4/Opserver,manesiotise/Opserver,mqbk/Opserver,opserver/Opserver,mqbk/Opserver,jeddytier4/Opserver,manesiotise/Opserver,rducom/Opserver,GABeech/Opserver,GABeech/Opserver,manesiotise/Opserver,opserver/Opserver,rducom/Opserver,opserver/Opserver
|
b534c845698fb2c18d7103df485e061f50c7886d
|
Purchasing.Mvc/Views/Order/_ReviewNotes.cshtml
|
Purchasing.Mvc/Views/Order/_ReviewNotes.cshtml
|
@model ReviewOrderViewModel
<section id="notes" class="ui-corner-all display-form">
<header class="ui-corner-top ui-widget-header">
<div class="col1 showInNav">Order Notes</div>
<div class="col2">
<a href="#" class="button" id="add-note">Add Note</a>
</div>
</header>
<div class="section-contents">
@if (!Model.Comments.Any())
{
<span class="notes-not-found">There Are No Notes Attached To This Order</span>
}
<table class="noicon">
<tbody>
@foreach (var notes in Model.Comments.OrderBy(o => o.DateCreated))
{
<tr>
<td>@notes.DateCreated.ToString("d")</td>
<td>@notes.Text</td>
<td>@notes.User.FullName</td>
</tr>
}
</tbody>
</table>
</div>
@*<footer class="ui-corner-bottom"></footer>*@
</section>
<div id="notes-dialog" title="Add Order Notes" style="display:none;">
<textarea id="notes-box" style="width: 370px; height: 110px;"></textarea>
</div>
<script id="comment-template" type="text/x-jquery-tmpl">
<tr>
<td>${datetime}</td>
<td>${txt}</td>
<td>${user}</td>
</tr>
</script>
|
@model ReviewOrderViewModel
<section id="notes" class="ui-corner-all display-form">
<header class="ui-corner-top ui-widget-header">
<div class="col1 showInNav">Order Notes</div>
<div class="col2">
<a href="#" class="button" id="add-note">Add Note</a>
</div>
</header>
<div class="section-contents">
@if (!Model.Comments.Any())
{
<span class="notes-not-found">There Are No Notes Attached To This Order</span>
}
<table class="noicon">
<tbody>
@foreach (var notes in Model.Comments.OrderBy(o => o.DateCreated))
{
<tr>
<td title="@notes.DateCreated.ToString("T")">@notes.DateCreated.ToString("d")</td>
<td>@notes.Text</td>
<td>@notes.User.FullName</td>
</tr>
}
</tbody>
</table>
</div>
@*<footer class="ui-corner-bottom"></footer>*@
</section>
<div id="notes-dialog" title="Add Order Notes" style="display:none;">
<textarea id="notes-box" style="width: 370px; height: 110px;"></textarea>
</div>
<script id="comment-template" type="text/x-jquery-tmpl">
<tr>
<td>${datetime}</td>
<td>${txt}</td>
<td>${user}</td>
</tr>
</script>
|
Add the time as a title to the order notes date.
|
Add the time as a title to the order notes date.
Only appears on them where we do a page refresh.
|
C#
|
mit
|
ucdavis/Purchasing,ucdavis/Purchasing,ucdavis/Purchasing
|
1305ae754ab061b98befb0fadb8460c8604b8fb6
|
osu.Framework.Tests/AutomatedVisualTestGame.cs
|
osu.Framework.Tests/AutomatedVisualTestGame.cs
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using osu.Framework.Testing;
namespace osu.Framework.Tests
{
public class AutomatedVisualTestGame : Game
{
public AutomatedVisualTestGame()
{
Add(new TestBrowserTestRunner(new TestBrowser()));
}
}
}
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.IO.Stores;
using osu.Framework.Testing;
namespace osu.Framework.Tests
{
public class AutomatedVisualTestGame : Game
{
[BackgroundDependencyLoader]
private void load()
{
Resources.AddStore(new NamespacedResourceStore<byte[]>(new DllResourceStore(@"osu.Framework.Tests.exe"), "Resources"));
}
public AutomatedVisualTestGame()
{
Add(new TestBrowserTestRunner(new TestBrowser()));
}
}
}
|
Add resources to the automated tests too
|
Add resources to the automated tests too
|
C#
|
mit
|
ZLima12/osu-framework,ppy/osu-framework,Nabile-Rahmani/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,Nabile-Rahmani/osu-framework,DrabWeb/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,smoogipooo/osu-framework,DrabWeb/osu-framework,default0/osu-framework,peppy/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,default0/osu-framework,peppy/osu-framework,DrabWeb/osu-framework,peppy/osu-framework,Tom94/osu-framework,Tom94/osu-framework,EVAST9919/osu-framework
|
934d3acf850e1b9e64fb6e3969632605c19122d8
|
source/XeroApi/Properties/AssemblyInfo.cs
|
source/XeroApi/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("XeroApi")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Xero")]
[assembly: AssemblyProduct("XeroApi")]
[assembly: AssemblyCopyright("Copyright © Xero 2011")]
[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("e18a84e7-ba04-4368-b4c9-0ea0cc78ddef")]
// 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.5")]
[assembly: AssemblyFileVersion("1.0.0.6")]
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("XeroApi")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Xero")]
[assembly: AssemblyProduct("XeroApi")]
[assembly: AssemblyCopyright("Copyright © Xero 2011")]
[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("e18a84e7-ba04-4368-b4c9-0ea0cc78ddef")]
// 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.7")]
[assembly: AssemblyFileVersion("1.0.0.7")]
|
Increment version number to sync up with NuGet
|
Increment version number to sync up with NuGet
|
C#
|
mit
|
jcvandan/XeroAPI.Net,TDaphneB/XeroAPI.Net,MatthewSteeples/XeroAPI.Net,XeroAPI/XeroAPI.Net
|
02cf55bc730a13da6176a696a62216e1b4905a49
|
src/Humanizer.Tests/NumberToWordsTests.cs
|
src/Humanizer.Tests/NumberToWordsTests.cs
|
using Xunit;
namespace Humanizer.Tests
{
public class NumberToWordsTests
{
[Fact]
public void ToWords()
{
Assert.Equal("one", 1.ToWords());
Assert.Equal("ten", 10.ToWords());
Assert.Equal("eleven", 11.ToWords());
Assert.Equal("one hundred and twenty-two", 122.ToWords());
Assert.Equal("three thousand five hundred and one", 3501.ToWords());
}
[Fact]
public void RoundNumbersHaveNoSpaceAtTheEnd()
{
Assert.Equal("one hundred", 100.ToWords());
Assert.Equal("one thousand", 1000.ToWords());
Assert.Equal("one hundred thousand", 100000.ToWords());
Assert.Equal("one million", 1000000.ToWords());
}
}
}
|
using Xunit;
using Xunit.Extensions;
namespace Humanizer.Tests
{
public class NumberToWordsTests
{
[InlineData(1, "one")]
[InlineData(10, "ten")]
[InlineData(11, "eleven")]
[InlineData(122, "one hundred and twenty-two")]
[InlineData(3501, "three thousand five hundred and one")]
[InlineData(100, "one hundred")]
[InlineData(1000, "one thousand")]
[InlineData(100000, "one hundred thousand")]
[InlineData(1000000, "one million")]
[Theory]
public void Test(int number, string expected)
{
Assert.Equal(expected, number.ToWords());
}
}
}
|
Convert ToWords' tests to theory
|
Convert ToWords' tests to theory
|
C#
|
mit
|
micdenny/Humanizer,aloisdg/Humanizer,Flatlineato/Humanizer,micdenny/Humanizer,preetksingh80/Humanizer,llehouerou/Humanizer,henriksen/Humanizer,gyurisc/Humanizer,mexx/Humanizer,CodeFromJordan/Humanizer,kikoanis/Humanizer,gyurisc/Humanizer,schalpat/Humanizer,llehouerou/Humanizer,kikoanis/Humanizer,ErikSchierboom/Humanizer,hazzik/Humanizer,preetksingh80/Humanizer,jaxx-rep/Humanizer,mrchief/Humanizer,CodeFromJordan/Humanizer,mrchief/Humanizer,thunsaker/Humanizer,CodeFromJordan/Humanizer,Flatlineato/Humanizer,mrchief/Humanizer,MehdiK/Humanizer,GeorgeHahn/Humanizer,HalidCisse/Humanizer,HalidCisse/Humanizer,GeorgeHahn/Humanizer,thunsaker/Humanizer,nigel-sampson/Humanizer,schalpat/Humanizer,henriksen/Humanizer,HalidCisse/Humanizer,ErikSchierboom/Humanizer,nigel-sampson/Humanizer,llehouerou/Humanizer,mexx/Humanizer,preetksingh80/Humanizer,thunsaker/Humanizer
|
394a09311e2456c2a98aa310455c2f3ce8f07417
|
CSharp/SchemaVersion/Program.cs
|
CSharp/SchemaVersion/Program.cs
|
using System;
using Business.Core.Profile;
namespace Version
{
class MainClass
{
public static void Main(string[] args) {
Console.WriteLine("Hello World!");
var profile = new Profile();
var sqlitedatabase = new Business.Core.SQLite.Database(profile);
Console.WriteLine($"SQLite\t\t{sqlitedatabase.SchemaVersion()}");
sqlitedatabase.Connection.Close();
var pgsqldatabase = new Business.Core.PostgreSQL.Database(profile);
Console.WriteLine($"PostgreSQL\t{pgsqldatabase.SchemaVersion()}");
pgsqldatabase.Connection.Close();
var nuodbdatabase = new Business.Core.NuoDB.Database(profile);
Console.WriteLine($"NuoDB\t\t{nuodbdatabase.SchemaVersion()}");
nuodbdatabase.Connection.Close();
}
}
}
|
using System;
using Business.Core;
using Business.Core.Profile;
namespace Version
{
class MainClass
{
public static void Main(string[] args) {
Console.WriteLine("Hello World!");
var profile = new Profile();
IDatabase database;
database = new Business.Core.SQLite.Database(profile);
Console.WriteLine($"SQLite\t\t{database.SchemaVersion()}");
database.Connection.Close();
database = new Business.Core.PostgreSQL.Database(profile);
Console.WriteLine($"PostgreSQL\t{database.SchemaVersion()}");
database.Connection.Close();
database = new Business.Core.NuoDB.Database(profile);
Console.WriteLine($"NuoDB\t\t{database.SchemaVersion()}");
database.Connection.Close();
}
}
}
|
Use the same type variable for all three database servers
|
Use the same type variable for all three database servers
|
C#
|
mit
|
jazd/Business,jazd/Business,jazd/Business
|
15c4a4b1407a6d96540c22ec72a3034552eb57c3
|
OData/src/CommonAssemblyInfo.cs
|
OData/src/CommonAssemblyInfo.cs
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
#if !BUILD_GENERATED_VERSION
[assembly: AssemblyCompany("Microsoft Corporation.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
#endif
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
#if !NOT_CLS_COMPLIANT
[assembly: CLSCompliant(true)]
#endif
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyMetadata("Serviceable", "True")]
// ===========================================================================
// DO NOT EDIT OR REMOVE ANYTHING BELOW THIS COMMENT.
// Version numbers are automatically generated based on regular expressions.
// ===========================================================================
#if ASPNETODATA
#if !BUILD_GENERATED_VERSION
[assembly: AssemblyVersion("5.4.0.0")] // ASPNETODATA
[assembly: AssemblyFileVersion("5.4.0.0")] // ASPNETODATA
#endif
[assembly: AssemblyProduct("Microsoft OData Web API")]
#endif
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
#if !BUILD_GENERATED_VERSION
[assembly: AssemblyCompany("Microsoft Corporation.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
#endif
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
#if !NOT_CLS_COMPLIANT
[assembly: CLSCompliant(true)]
#endif
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyMetadata("Serviceable", "True")]
// ===========================================================================
// DO NOT EDIT OR REMOVE ANYTHING BELOW THIS COMMENT.
// Version numbers are automatically generated based on regular expressions.
// ===========================================================================
#if ASPNETODATA
#if !BUILD_GENERATED_VERSION
[assembly: AssemblyVersion("5.5.0.0")] // ASPNETODATA
[assembly: AssemblyFileVersion("5.5.0.0")] // ASPNETODATA
#endif
[assembly: AssemblyProduct("Microsoft OData Web API")]
#endif
|
Update OData WebAPI to 5.5.0.0
|
Update OData WebAPI to 5.5.0.0
|
C#
|
mit
|
lungisam/WebApi,scz2011/WebApi,yonglehou/WebApi,abkmr/WebApi,LianwMS/WebApi,chimpinano/WebApi,chimpinano/WebApi,lewischeng-ms/WebApi,congysu/WebApi,abkmr/WebApi,yonglehou/WebApi,LianwMS/WebApi,lungisam/WebApi,congysu/WebApi,lewischeng-ms/WebApi,scz2011/WebApi
|
a697dacbf657f6de0928e9582414872ee8580528
|
Xwt.XamMac/Xwt.Mac/EmbedNativeWidgetBackend.cs
|
Xwt.XamMac/Xwt.Mac/EmbedNativeWidgetBackend.cs
|
using System;
using Xwt.Backends;
using Xwt.Drawing;
#if MONOMAC
using nint = System.Int32;
using nfloat = System.Single;
using MonoMac.Foundation;
using MonoMac.AppKit;
using MonoMac.ObjCRuntime;
#else
using Foundation;
using AppKit;
using ObjCRuntime;
#endif
namespace Xwt.Mac
{
public class EmbedNativeWidgetBackend : ViewBackend, IEmbeddedWidgetBackend
{
NSView innerView;
public EmbedNativeWidgetBackend ()
{
}
public override void Initialize ()
{
ViewObject = new WidgetView (EventSink, ApplicationContext);
if (innerView != null) {
var aView = innerView;
innerView = null;
SetNativeView (aView);
}
}
public void SetContent (object nativeWidget)
{
if (nativeWidget is NSView) {
if (ViewObject == null)
innerView = (NSView)nativeWidget;
else
SetNativeView ((NSView)nativeWidget);
}
}
void SetNativeView (NSView aView)
{
if (innerView != null)
innerView.RemoveFromSuperview ();
innerView = aView;
innerView.Frame = Widget.Bounds;
Widget.AddSubview (innerView);
}
}
}
|
using System;
using Xwt.Backends;
using Xwt.Drawing;
#if MONOMAC
using nint = System.Int32;
using nfloat = System.Single;
using MonoMac.Foundation;
using MonoMac.AppKit;
using MonoMac.ObjCRuntime;
#else
using Foundation;
using AppKit;
using ObjCRuntime;
#endif
namespace Xwt.Mac
{
public class EmbedNativeWidgetBackend : ViewBackend, IEmbeddedWidgetBackend
{
NSView innerView;
public EmbedNativeWidgetBackend ()
{
}
public override void Initialize ()
{
ViewObject = new WidgetView (EventSink, ApplicationContext);
if (innerView != null) {
var aView = innerView;
innerView = null;
SetNativeView (aView);
}
}
public void SetContent (object nativeWidget)
{
if (nativeWidget is NSView) {
if (ViewObject == null)
innerView = (NSView)nativeWidget;
else
SetNativeView ((NSView)nativeWidget);
}
}
void SetNativeView (NSView aView)
{
if (innerView != null)
innerView.RemoveFromSuperview ();
innerView = aView;
innerView.Frame = Widget.Bounds;
innerView.AutoresizingMask = NSViewResizingMask.WidthSizable | NSViewResizingMask.HeightSizable;
innerView.TranslatesAutoresizingMaskIntoConstraints = true;
Widget.AutoresizesSubviews = true;
Widget.AddSubview (innerView);
}
}
}
|
Fix sizing of embedded (wrapped) native NSViews
|
[Mac] Fix sizing of embedded (wrapped) native NSViews
The EmbeddedNativeWidget creates its own parent NSView and we need
to configure it to correctly size the child (the actual embedded view)
|
C#
|
mit
|
hamekoz/xwt,TheBrainTech/xwt,akrisiun/xwt,mminns/xwt,hwthomas/xwt,residuum/xwt,cra0zy/xwt,antmicro/xwt,lytico/xwt,iainx/xwt,mminns/xwt,mono/xwt,steffenWi/xwt
|
2ffe12eac82bbe5c9a7ef4240f0d3c750702ad42
|
src/backend/SO115App.FakePersistenceJSon/Utility/GeneraCodiceRichiesta.cs
|
src/backend/SO115App.FakePersistenceJSon/Utility/GeneraCodiceRichiesta.cs
|
using SO115App.API.Models.Servizi.Infrastruttura.GestioneSoccorso;
using SO115App.FakePersistenceJSon.GestioneIntervento;
using SO115App.Models.Servizi.Infrastruttura.GestioneSoccorso.GenerazioneCodiciRichiesta;
using System;
namespace SO115App.FakePersistence.JSon.Utility
{
public class GeneraCodiceRichiesta : IGeneraCodiceRichiesta
{
public string Genera(string codiceProvincia, int anno)
{
int ultimeDueCifreAnno = anno % 100;
string nuovoNumero = GetMaxCodice.GetMax().ToString();
return string.Format("{0}-{1}-{2:D5}", codiceProvincia, ultimeDueCifreAnno, nuovoNumero);
}
public string GeneraCodiceChiamata(string codiceProvincia, int anno)
{
int ultimeDueCifreAnno = anno % 100;
int giorno = DateTime.UtcNow.Day;
int mese = DateTime.UtcNow.Month;
int nuovoNumero = GetMaxCodice.GetMaxCodiceChiamata();
string returnString = string.Format("{0}-{1}-{2}-{3}_{4:D5}", codiceProvincia, giorno, mese, ultimeDueCifreAnno, nuovoNumero);
return returnString;
}
}
}
|
using SO115App.API.Models.Servizi.Infrastruttura.GestioneSoccorso;
using SO115App.FakePersistenceJSon.GestioneIntervento;
using SO115App.Models.Servizi.Infrastruttura.GestioneSoccorso.GenerazioneCodiciRichiesta;
using System;
namespace SO115App.FakePersistence.JSon.Utility
{
public class GeneraCodiceRichiesta : IGeneraCodiceRichiesta
{
public string Genera(string codiceProvincia, int anno)
{
int ultimeDueCifreAnno = anno % 100;
string nuovoNumero = GetMaxCodice.GetMax().ToString();
return string.Format("{0}{1}{2:D5}", codiceProvincia.Split('.')[0], ultimeDueCifreAnno, nuovoNumero);
}
public string GeneraCodiceChiamata(string codiceProvincia, int anno)
{
int ultimeDueCifreAnno = anno % 100;
int giorno = DateTime.UtcNow.Day;
int mese = DateTime.UtcNow.Month;
int nuovoNumero = GetMaxCodice.GetMaxCodiceChiamata();
string returnString = string.Format("{0}{1}{2}{3}{4:D5}", codiceProvincia.Split('.')[0], giorno, mese, ultimeDueCifreAnno, nuovoNumero);
return returnString;
}
}
}
|
Fix - Modificata la generazione del Codice Richiesta e del Codice Chiamata come richiesto nella riunone dell'11-07-2019
|
Fix - Modificata la generazione del Codice Richiesta e del Codice Chiamata come richiesto nella riunone dell'11-07-2019
|
C#
|
agpl-3.0
|
vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf
|
692ec2847be6589ff9555d315dd39dd6f7d6ab1f
|
src/JsonConfig/JsonConfigManager.cs
|
src/JsonConfig/JsonConfigManager.cs
|
using System.Web.Script.Serialization;
namespace JsonConfig
{
public static class JsonConfigManager
{
#region Fields
private static readonly IConfigFileLoader ConfigFileLoader = new ConfigFileLoader();
private static dynamic _defaultConfig;
#endregion
#region Public Members
public static dynamic DefaultConfig
{
get
{
if (_defaultConfig == null)
{
_defaultConfig = GetConfig(ConfigFileLoader.LoadDefaultConfigFile());
}
return _defaultConfig;
}
}
public static dynamic GetConfig(string json)
{
var serializer = new JavaScriptSerializer();
serializer.RegisterConverters(new[] { new DynamicJsonConverter() });
return serializer.Deserialize(json, typeof(object));
}
public static dynamic LoadConfig(string filePath)
{
return GetConfig(ConfigFileLoader.LoadConfigFile(filePath));
}
#endregion
}
}
|
using System.Web.Script.Serialization;
namespace JsonConfig
{
public static class JsonConfigManager
{
#region Fields
private static readonly IConfigFileLoader ConfigFileLoader = new ConfigFileLoader();
private static dynamic _defaultConfig;
#endregion
#region Public Members
/// <summary>
/// Gets the default config dynamic object, which should be a file named app.json.config located at the root of your project
/// </summary>
public static dynamic DefaultConfig
{
get
{
if (_defaultConfig == null)
{
_defaultConfig = GetConfig(ConfigFileLoader.LoadDefaultConfigFile());
}
return _defaultConfig;
}
}
/// <summary>
/// Get a config dynamic object from the json
/// </summary>
/// <param name="json">Json string</param>
/// <returns>The dynamic config object</returns>
public static dynamic GetConfig(string json)
{
var serializer = new JavaScriptSerializer();
serializer.RegisterConverters(new[] { new DynamicJsonConverter() });
return serializer.Deserialize(json, typeof(object));
}
/// <summary>
/// Load a config from a specified file
/// </summary>
/// <param name="filePath">Config file path</param>
/// <returns>The dynamic config object</returns>
public static dynamic LoadConfig(string filePath)
{
return GetConfig(ConfigFileLoader.LoadConfigFile(filePath));
}
#endregion
}
}
|
Add comments to public methods
|
Add comments to public methods
|
C#
|
mit
|
andreazevedo/JsonConfig
|
1c651dbb32b1a3254f23ad114fbb319df2e74037
|
Views/ShoppingCartWidget.cshtml
|
Views/ShoppingCartWidget.cshtml
|
@{
if (Layout.IsCartPage != true) {
Script.Require("jQuery");
Script.Include("shoppingcart.js", "shoppingcart.min.js");
<div class="shopping-cart-container minicart"
data-load="@Url.Action("NakedCart", "ShoppingCart", new {area="Nwazet.Commerce"})"
data-update="@Url.Action("AjaxUpdate", "ShoppingCart", new {area="Nwazet.Commerce"})"
data-token="@Html.AntiForgeryTokenValueOrchard()"></div>
}
}
|
@{
if (Layout.IsCartPage != true) {
Script.Require("jQuery");
Script.Include("shoppingcart.js", "shoppingcart.min.js");
<div class="shopping-cart-container minicart"
data-load="@Url.Action("NakedCart", "ShoppingCart", new {area="Nwazet.Commerce"})"
data-update="@Url.Action("AjaxUpdate", "ShoppingCart", new {area="Nwazet.Commerce"})"
data-token="@Html.AntiForgeryTokenValueOrchard()"></div>
<script type="text/javascript">
var Nwazet = window.Nwazet || {};
Nwazet.WaitWhileWeRestoreYourCart = "@T("Please wait while we restore your shopping cart...")";
Nwazet.FailedToLoadCart = "@T("Failed to load the cart")";
</script>
}
}
|
Fix to ajax restoration of the cart.
|
Fix to ajax restoration of the cart.
|
C#
|
bsd-3-clause
|
bleroy/Nwazet.Commerce,bleroy/Nwazet.Commerce
|
f785dbf2b5649adcbc0431b2d9b04f31a8958a05
|
src/SFA.DAS.EmployerFinance.Jobs/ScheduledJobs/ImportLevyDeclarationsJob.cs
|
src/SFA.DAS.EmployerFinance.Jobs/ScheduledJobs/ImportLevyDeclarationsJob.cs
|
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using NServiceBus;
using SFA.DAS.EmployerFinance.Messages.Commands;
namespace SFA.DAS.EmployerFinance.Jobs.ScheduledJobs
{
public class ImportLevyDeclarationsJob
{
private readonly IMessageSession _messageSession;
public ImportLevyDeclarationsJob(IMessageSession messageSession)
{
_messageSession = messageSession;
}
public Task Run([TimerTrigger("0 0 15 20 * *")] TimerInfo timer, ILogger logger)
{
return _messageSession.Send(new ImportLevyDeclarationsCommand());
}
}
}
|
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using NServiceBus;
using SFA.DAS.EmployerFinance.Messages.Commands;
namespace SFA.DAS.EmployerFinance.Jobs.ScheduledJobs
{
public class ImportLevyDeclarationsJob
{
private readonly IMessageSession _messageSession;
public ImportLevyDeclarationsJob(IMessageSession messageSession)
{
_messageSession = messageSession;
}
public Task Run([TimerTrigger("0 0 10 24 * *")] TimerInfo timer, ILogger logger)
{
return _messageSession.Send(new ImportLevyDeclarationsCommand());
}
}
}
|
Change levy run date to 24th
|
Change levy run date to 24th
|
C#
|
mit
|
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
|
a8636cf55c877fcc7da478d1164b635309fa093f
|
tests/LondonTravel.Site.Tests/Integration/IServiceCollectionExtensions.cs
|
tests/LondonTravel.Site.Tests/Integration/IServiceCollectionExtensions.cs
|
// Copyright (c) Martin Costello, 2017. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
namespace MartinCostello.LondonTravel.Site.Integration
{
using Microsoft.ApplicationInsights.DependencyCollector;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.Extensions.DependencyInjection;
internal static class IServiceCollectionExtensions
{
internal static void DisableApplicationInsights(this IServiceCollection services)
{
// Disable dependency tracking to work around https://github.com/Microsoft/ApplicationInsights-dotnet-server/pull/1006
services.Configure<TelemetryConfiguration>((p) => p.DisableTelemetry = true);
services.ConfigureTelemetryModule<DependencyTrackingTelemetryModule>(
(module, _) =>
{
module.DisableDiagnosticSourceInstrumentation = true;
module.DisableRuntimeInstrumentation = true;
module.SetComponentCorrelationHttpHeaders = false;
module.IncludeDiagnosticSourceActivities.Clear();
});
}
}
}
|
// Copyright (c) Martin Costello, 2017. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
namespace MartinCostello.LondonTravel.Site.Integration
{
using Microsoft.ApplicationInsights.DependencyCollector;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
internal static class IServiceCollectionExtensions
{
internal static void DisableApplicationInsights(this IServiceCollection services)
{
// Disable dependency tracking to work around https://github.com/Microsoft/ApplicationInsights-dotnet-server/pull/1006
services.Configure<TelemetryConfiguration>((p) => p.DisableTelemetry = true);
services.ConfigureTelemetryModule<DependencyTrackingTelemetryModule>(
(module, _) =>
{
module.DisableDiagnosticSourceInstrumentation = true;
module.DisableRuntimeInstrumentation = true;
module.SetComponentCorrelationHttpHeaders = false;
module.IncludeDiagnosticSourceActivities.Clear();
});
services.RemoveAll<ITelemetryInitializer>();
services.RemoveAll<ITelemetryModule>();
}
}
}
|
Remove Application Insights modules and initializers
|
Remove Application Insights modules and initializers
Remove all of the Application Insights ITelemetryInitializer and ITelemetryModule implementations.
|
C#
|
apache-2.0
|
martincostello/alexa-london-travel-site,martincostello/alexa-london-travel-site,martincostello/alexa-london-travel-site,martincostello/alexa-london-travel-site
|
961a351592b37164b21305d1a94cc344f7cccc63
|
qt/src/QSize.cs
|
qt/src/QSize.cs
|
// -------------------------------------------------------------------------
// Managed wrapper for QSize
// Generated from qt-gui.xml on 07/24/2011 11:57:03
//
// This file was auto generated. Do not edit.
// -------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
using Mono.Cxxi;
namespace Qt.Gui {
[StructLayout (LayoutKind.Sequential)]
public struct QSize {
public int wd;
public int ht;
public QSize (int w, int h)
{
wd = w;
ht = h;
}
}
}
|
using System;
using System.Runtime.InteropServices;
using Mono.Cxxi;
namespace Qt.Gui {
[StructLayout (LayoutKind.Sequential)]
public struct QSize {
public int wd;
public int ht;
public QSize (int w, int h)
{
wd = w;
ht = h;
}
}
}
|
Remove auto-generated warning from handwritten file
|
Remove auto-generated warning from handwritten file
|
C#
|
mit
|
u255436/CppSharp,mohtamohit/CppSharp,zillemarco/CppSharp,txdv/CppSharp,ktopouzi/CppSharp,SonyaSa/CppSharp,Samana/CppSharp,u255436/CppSharp,ktopouzi/CppSharp,ddobrev/CppSharp,inordertotest/CppSharp,pacificIT/cxxi,ktopouzi/CppSharp,txdv/CppSharp,zillemarco/CppSharp,nalkaro/CppSharp,mohtamohit/CppSharp,xistoso/CppSharp,mono/cxxi,mydogisbox/CppSharp,SonyaSa/CppSharp,pacificIT/cxxi,mohtamohit/CppSharp,Samana/CppSharp,ktopouzi/CppSharp,u255436/CppSharp,corngood/cxxi,nalkaro/CppSharp,imazen/CppSharp,xistoso/CppSharp,mono/CppSharp,inordertotest/CppSharp,txdv/CppSharp,Samana/CppSharp,txdv/CppSharp,mono/CppSharp,mono/cxxi,genuinelucifer/CppSharp,SonyaSa/CppSharp,corngood/cxxi,zillemarco/CppSharp,imazen/CppSharp,imazen/CppSharp,KonajuGames/CppSharp,imazen/CppSharp,xistoso/CppSharp,genuinelucifer/CppSharp,xistoso/CppSharp,ddobrev/CppSharp,SonyaSa/CppSharp,Samana/CppSharp,mono/cxxi,inordertotest/CppSharp,ddobrev/CppSharp,SonyaSa/CppSharp,KonajuGames/CppSharp,KonajuGames/CppSharp,nalkaro/CppSharp,KonajuGames/CppSharp,txdv/CppSharp,Samana/CppSharp,mydogisbox/CppSharp,genuinelucifer/CppSharp,mohtamohit/CppSharp,mono/cxxi,imazen/CppSharp,xistoso/CppSharp,mono/CppSharp,mydogisbox/CppSharp,u255436/CppSharp,mono/CppSharp,inordertotest/CppSharp,u255436/CppSharp,zillemarco/CppSharp,mydogisbox/CppSharp,genuinelucifer/CppSharp,pacificIT/cxxi,zillemarco/CppSharp,mohtamohit/CppSharp,mydogisbox/CppSharp,mono/CppSharp,ktopouzi/CppSharp,mono/CppSharp,corngood/cxxi,inordertotest/CppSharp,nalkaro/CppSharp,genuinelucifer/CppSharp,KonajuGames/CppSharp,ddobrev/CppSharp,nalkaro/CppSharp,ddobrev/CppSharp
|
d8e2d84609e1d121bbf6ed94ca3813972893401d
|
ConsoleApps/FunWithSpikes/FunWithNinject/OpenGenerics/OpenGenericsTests.cs
|
ConsoleApps/FunWithSpikes/FunWithNinject/OpenGenerics/OpenGenericsTests.cs
|
using Ninject;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FunWithNinject.OpenGenerics
{
[TestFixture]
public class OpenGenericsTests
{
public interface ILogger<T>
{
Type GenericParam { get; }
}
public class Logger<T> : ILogger<T>
{
public Type GenericParam { get { return typeof(T); } }
}
public class DependsOnLogger
{
public DependsOnLogger(ILogger<int> intLogger)
{
GenericParam = intLogger.GenericParam;
}
public Type GenericParam { get; set; }
}
[Test]
public void OpenGenericBinding()
{
using (var k = new StandardKernel())
{
// Assemble
k.Bind(typeof(ILogger<>)).To(typeof(Logger<>));
// Act
var dependsOn = k.Get<DependsOnLogger>();
// Assert
Assert.AreEqual(typeof(int), dependsOn.GenericParam);
}
}
}
}
|
using Ninject;
using NUnit.Framework;
using System;
namespace FunWithNinject.OpenGenerics
{
[TestFixture]
public class OpenGenericsTests
{
[Test]
public void OpenGenericBinding()
{
using (var k = new StandardKernel())
{
// Assemble
k.Bind(typeof(IAutoCache<>)).To(typeof(AutoCache<>));
// Act
var dependsOn = k.Get<DependsOnLogger>();
// Assert
Assert.AreEqual(typeof(int), dependsOn.CacheType);
}
}
#region Types
public interface IAutoCache<T>
{
Type CacheType { get; }
}
public class AutoCache<T> : IAutoCache<T>
{
public Type CacheType { get { return typeof(T); } }
}
public class DependsOnLogger
{
public DependsOnLogger(IAutoCache<int> intCacher)
{
CacheType = intCacher.CacheType;
}
public Type CacheType { get; set; }
}
#endregion
}
}
|
Change the names to be in line with the problem at hand.
|
Change the names to be in line with the problem at hand.
|
C#
|
mit
|
jquintus/spikes,jquintus/spikes,jquintus/spikes,jquintus/spikes
|
c042c8b5fcdf03ff23737229e59b1c50c82f6b7c
|
Sogeti.Capstone.Web/Sogeti.Capstone.CQS.Integration.Tests/EventCommands.cs
|
Sogeti.Capstone.Web/Sogeti.Capstone.CQS.Integration.Tests/EventCommands.cs
|
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Sogeti.Capstone.CQS.Integration.Tests
{
[TestClass]
public class EventCommands
{
[TestMethod]
public void CreateEventCommand()
{
}
}
}
|
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Sogeti.Capstone.CQS.Integration.Tests
{
[TestClass]
public class EventCommands
{
[TestMethod]
public void CreateEventCommand()
{
}
}
}
|
Set up references for event command unit tests
|
Set up references for event command unit tests
|
C#
|
mit
|
DavidMGardner/sogeti.capstone,DavidMGardner/sogeti.capstone,DavidMGardner/sogeti.capstone
|
32a601a3ac1f99302c0f77a51058cf5b43d62524
|
SimpleWAWS/Authentication/GoogleAuthProvider.cs
|
SimpleWAWS/Authentication/GoogleAuthProvider.cs
|
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
namespace SimpleWAWS.Authentication
{
public class GoogleAuthProvider : BaseOpenIdConnectAuthProvider
{
public override string GetLoginUrl(HttpContextBase context)
{
var culture = CultureInfo.CurrentCulture.Name.ToLowerInvariant();
var builder = new StringBuilder();
builder.Append("https://accounts.google.com/o/oauth2/auth");
builder.Append("?response_type=id_token");
builder.AppendFormat("&redirect_uri={0}", WebUtility.UrlEncode(string.Format(CultureInfo.InvariantCulture, "https://{0}/Login", context.Request.Headers["HOST"])));
builder.AppendFormat("&client_id={0}", AuthSettings.GoogleAppId);
builder.AppendFormat("&scope={0}", "email");
builder.AppendFormat("&state={0}", WebUtility.UrlEncode(context.IsAjaxRequest() ? string.Format(CultureInfo.InvariantCulture, "/{0}{1}", culture, context.Request.Url.Query) : context.Request.Url.PathAndQuery));
return builder.ToString();
}
protected override string GetValidAudiance()
{
return AuthSettings.GoogleAppId;
}
public override string GetIssuerName(string altSecId)
{
return "Google";
}
}
}
|
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
namespace SimpleWAWS.Authentication
{
public class GoogleAuthProvider : BaseOpenIdConnectAuthProvider
{
public override string GetLoginUrl(HttpContextBase context)
{
var culture = CultureInfo.CurrentCulture.Name.ToLowerInvariant();
var builder = new StringBuilder();
builder.Append("https://accounts.google.com/o/oauth2/auth");
builder.Append("?response_type=id_token");
builder.AppendFormat("&redirect_uri={0}", WebUtility.UrlEncode(string.Format(CultureInfo.InvariantCulture, "https://{0}/Login", context.Request.Headers["HOST"])));
builder.AppendFormat("&client_id={0}", AuthSettings.GoogleAppId);
builder.AppendFormat("&scope={0}", "email");
builder.AppendFormat("&state={0}", WebUtility.UrlEncode(context.IsAjaxRequest()|| context.IsFunctionsPortalRequest() ? string.Format(CultureInfo.InvariantCulture, "/{0}{1}", culture, context.Request.Url.Query) : context.Request.Url.PathAndQuery));
return builder.ToString();
}
protected override string GetValidAudiance()
{
return AuthSettings.GoogleAppId;
}
public override string GetIssuerName(string altSecId)
{
return "Google";
}
}
}
|
Update state to be used after redirect
|
Update state to be used after redirect
|
C#
|
apache-2.0
|
projectkudu/SimpleWAWS,projectkudu/TryAppService,projectkudu/SimpleWAWS,projectkudu/TryAppService,projectkudu/TryAppService,projectkudu/SimpleWAWS,fashaikh/SimpleWAWS,fashaikh/SimpleWAWS,projectkudu/TryAppService,fashaikh/SimpleWAWS,projectkudu/SimpleWAWS,davidebbo/SimpleWAWS,fashaikh/SimpleWAWS,davidebbo/SimpleWAWS,davidebbo/SimpleWAWS,davidebbo/SimpleWAWS
|
012596e5ca88b2f46a3e485f50b9c614ab3b4e20
|
src/Nether.Web/Features/Leaderboard/LeaderboardGetResponseModel.cs
|
src/Nether.Web/Features/Leaderboard/LeaderboardGetResponseModel.cs
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Collections.Generic;
using Nether.Data.Leaderboard;
namespace Nether.Web.Features.Leaderboard
{
public class LeaderboardGetResponseModel
{
public List<LeaderboardEntry> Entries { get; set; }
public class LeaderboardEntry
{
public static implicit operator LeaderboardEntry(GameScore score)
{
return new LeaderboardEntry { Gamertag = score.Gamertag, Score = score.Score };
}
/// <summary>
/// Gamertag
/// </summary>
public string Gamertag { get; set; }
/// <summary>
/// Scores
/// </summary>
public int Score { get; set; }
}
}
}
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Collections.Generic;
using Nether.Data.Leaderboard;
namespace Nether.Web.Features.Leaderboard
{
public class LeaderboardGetResponseModel
{
public List<LeaderboardEntry> Entries { get; set; }
public class LeaderboardEntry
{
public static implicit operator LeaderboardEntry(GameScore score)
{
return new LeaderboardEntry
{
Gamertag = score.Gamertag,
Score = score.Score,
Rank = score.Rank
};
}
/// <summary>
/// Gamertag
/// </summary>
public string Gamertag { get; set; }
/// <summary>
/// Scores
/// </summary>
public int Score { get; set; }
public long Rank { get; set; }
}
}
}
|
Add Rank to returned scores
|
Add Rank to returned scores
|
C#
|
mit
|
brentstineman/nether,brentstineman/nether,brentstineman/nether,krist00fer/nether,navalev/nether,vflorusso/nether,brentstineman/nether,stuartleeks/nether,brentstineman/nether,MicrosoftDX/nether,vflorusso/nether,navalev/nether,stuartleeks/nether,stuartleeks/nether,vflorusso/nether,navalev/nether,ankodu/nether,stuartleeks/nether,stuartleeks/nether,ankodu/nether,navalev/nether,ankodu/nether,vflorusso/nether,ankodu/nether,vflorusso/nether,oliviak/nether
|
173fd82255624147fdbcdadbe495da359d95f7a3
|
Alexa.NET.Management/Api/CustomApiEndpoint.cs
|
Alexa.NET.Management/Api/CustomApiEndpoint.cs
|
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;
namespace Alexa.NET.Management.Api
{
public class CustomApiEndpoint
{
[JsonProperty("uri")]
public string Uri { get; set; }
[JsonProperty("sslCertificateType")]
public SslCertificateType SslCertificateType { get; set; }
}
}
|
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Text;
namespace Alexa.NET.Management.Api
{
public class CustomApiEndpoint
{
[JsonProperty("uri")]
public string Uri { get; set; }
[JsonProperty("sslCertificateType"), JsonConverter(typeof(StringEnumConverter))]
public SslCertificateType SslCertificateType { get; set; }
}
}
|
Add correct JSON serialization for enum type
|
Add correct JSON serialization for enum type
|
C#
|
mit
|
stoiveyp/Alexa.NET.Management
|
8e8fcdac7d6a9eff62e3f87d285a99c6c93731f4
|
test/Stripe.Tests/Constants.cs
|
test/Stripe.Tests/Constants.cs
|
using System;
using System.Linq;
namespace Stripe.Tests
{
static class Constants
{
public const string ApiKey = @"8GSx9IL9MA0iJ3zcitnGCHonrXWiuhMf";
}
}
|
using System;
using System.Linq;
namespace Stripe.Tests
{
static class Constants
{
public const string ApiKey = @"sk_test_BQokikJOvBiI2HlWgH4olfQ2";
}
}
|
Update Stripe test API key from their docs
|
Update Stripe test API key from their docs
|
C#
|
mit
|
nberardi/stripe-dotnet
|
149dfcc9bc222e77ba3fc65c73fbf15d2e63618f
|
Samples/Senparc.Weixin.MP.Sample.vs2017/Senparc.Weixin.MP.CoreSample/Program.cs
|
Samples/Senparc.Weixin.MP.Sample.vs2017/Senparc.Weixin.MP.CoreSample/Program.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace Senparc.Weixin.MP.CoreSample
{
public class Program
{
public static void Main(string[] args)
{
BuildWebHost(args).Run();
}
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.Build();
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace Senparc.Weixin.MP.CoreSample
{
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>();
}
}
|
Migrate from ASP.NET Core 2.0 to 2.1
|
Migrate from ASP.NET Core 2.0 to 2.1
Changes to take advantage of the new code-based idioms that are recommended in ASP.NET Core 2.1
|
C#
|
apache-2.0
|
JeffreySu/WeiXinMPSDK,jiehanlin/WeiXinMPSDK,mc7246/WeiXinMPSDK,JeffreySu/WeiXinMPSDK,jiehanlin/WeiXinMPSDK,lishewen/WeiXinMPSDK,lishewen/WeiXinMPSDK,jiehanlin/WeiXinMPSDK,JeffreySu/WeiXinMPSDK,mc7246/WeiXinMPSDK,mc7246/WeiXinMPSDK,lishewen/WeiXinMPSDK
|
ed73c0d67c087c037d4c44d7731981694b283365
|
Basics.Structures/Graphs/Edge.cs
|
Basics.Structures/Graphs/Edge.cs
|
using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace Basics.Structures.Graphs
{
[DebuggerDisplay("{Source}->{Target}")]
public class Edge<T> : IEquatable<Edge<T>> where T : IEquatable<T>
{
private readonly Lazy<int> _hashCode;
public Edge(T source, T target)
{
Source = source;
Target = target;
_hashCode = new Lazy<int>(() =>
{
var sourceHashCode = Source.GetHashCode();
return ((sourceHashCode << 5) + sourceHashCode) ^ Target.GetHashCode();
});
}
public T Source { get; private set; }
public T Target { get; private set; }
public bool IsSelfLooped
{
get { return Source.Equals(Target); }
}
public static bool operator ==(Edge<T> a, Edge<T> b)
{
return a.Equals(b);
}
public static bool operator !=(Edge<T> a, Edge<T> b)
{
return !a.Equals(b);
}
public bool Equals(Edge<T> other)
{
return
!Object.ReferenceEquals(other, null)
&& this.Source.Equals(other.Source)
&& this.Target.Equals(other.Target);
}
public override bool Equals(object obj)
{
return Equals(obj as Edge<T>);
}
public override int GetHashCode()
{
return _hashCode.Value;
}
public override string ToString()
{
return Source + "->" + Target;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace Basics.Structures.Graphs
{
[DebuggerDisplay("{Source}->{Target}")]
public class Edge<T> : IEquatable<Edge<T>> where T : IEquatable<T>
{
public Edge(T source, T target)
{
Source = source;
Target = target;
}
public T Source { get; private set; }
public T Target { get; private set; }
public bool IsSelfLooped
{
get { return Source.Equals(Target); }
}
public static bool operator ==(Edge<T> a, Edge<T> b)
{
return a.Equals(b);
}
public static bool operator !=(Edge<T> a, Edge<T> b)
{
return !a.Equals(b);
}
public bool Equals(Edge<T> other)
{
return
!Object.ReferenceEquals(other, null)
&& this.Source.Equals(other.Source)
&& this.Target.Equals(other.Target);
}
public override bool Equals(object obj)
{
return Equals(obj as Edge<T>);
}
public override int GetHashCode()
{
var sourceHashCode = Source.GetHashCode();
return ((sourceHashCode << 5) + sourceHashCode) ^ Target.GetHashCode();
}
public override string ToString()
{
return Source + "->" + Target;
}
}
}
|
Remove laziness from edges' GetHashCode method
|
Remove laziness from edges' GetHashCode method
Works faster on large graphs and memory footprint is lower.
|
C#
|
mit
|
MSayfullin/Basics
|
71100ca062cac128390ffa1eb35952477a59e8f0
|
BlogTemplate/Models/BlogDataStore.cs
|
BlogTemplate/Models/BlogDataStore.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Linq;
namespace BlogTemplate.Models
{
public class BlogDataStore
{
const string StorageFolder = "BlogFiles";
public void SavePost(Post post)
{
Directory.CreateDirectory(StorageFolder);
string outputFilePath = $"{StorageFolder}\\{post.Slug}.xml";
XmlDocument doc = new XmlDocument();
XmlElement rootNode = doc.CreateElement("Post");
doc.AppendChild(rootNode);
rootNode.AppendChild(doc.CreateElement("Slug")).InnerText = post.Slug;
rootNode.AppendChild(doc.CreateElement("Title")).InnerText = post.Title;
rootNode.AppendChild(doc.CreateElement("Body")).InnerText = post.Body;
doc.Save(outputFilePath);
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Linq;
namespace BlogTemplate.Models
{
public class BlogDataStore
{
const string StorageFolder = "BlogFiles";
public void SavePost(Post post)
{
Directory.CreateDirectory(StorageFolder);
string outputFilePath = $"{StorageFolder}\\{post.Slug}.xml";
XmlDocument doc = new XmlDocument();
XmlElement rootNode = doc.CreateElement("Post");
doc.AppendChild(rootNode);
rootNode.AppendChild(doc.CreateElement("Slug")).InnerText = post.Slug;
rootNode.AppendChild(doc.CreateElement("Title")).InnerText = post.Title;
rootNode.AppendChild(doc.CreateElement("Body")).InnerText = post.Body;
doc.Save(outputFilePath);
}
public Post GetPost(string slug)
{
string expectedFilePath = $"{StorageFolder}\\{slug}.xml";
if(File.Exists(expectedFilePath))
{
string fileContent = File.ReadAllText(expectedFilePath);
XmlDocument doc = new XmlDocument();
doc.LoadXml(fileContent);
Post post = new Post();
post.Slug = doc.GetElementsByTagName("Slug").Item(0).InnerText;
post.Title = doc.GetElementsByTagName("Title").Item(0).InnerText;
post.Body = doc.GetElementsByTagName("Body").Item(0).InnerText;
return post;
}
return null;
}
}
}
|
Add simple method to read back in a Post from disk
|
Add simple method to read back in a Post from disk
|
C#
|
mit
|
VenusInterns/BlogTemplate,VenusInterns/BlogTemplate,VenusInterns/BlogTemplate
|
e9645edc9e9df90b74bf4e7e8ebea4bb0f505133
|
src/Containers/MassTransit.AspNetCoreIntegration/HostedServiceConfigurationExtensions.cs
|
src/Containers/MassTransit.AspNetCoreIntegration/HostedServiceConfigurationExtensions.cs
|
namespace MassTransit
{
using AspNetCoreIntegration;
using AspNetCoreIntegration.HealthChecks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Monitoring.Health;
/// <summary>
/// These are the updated extensions compatible with the container registration code. They should be used, for real.
/// </summary>
public static class HostedServiceConfigurationExtensions
{
/// <summary>
/// Adds the MassTransit <see cref="IHostedService" />, which includes a bus and endpoint health check.
/// Use it together with UseHealthCheck to get more detailed diagnostics.
/// </summary>
/// <param name="services"></param>
public static IServiceCollection AddMassTransitHostedService(this IServiceCollection services)
{
AddHealthChecks(services);
return services.AddSingleton<IHostedService, MassTransitHostedService>();
}
public static IServiceCollection AddMassTransitHostedService(this IServiceCollection services, IBusControl bus)
{
AddHealthChecks(services);
return services.AddSingleton<IHostedService>(p => new BusHostedService(bus));
}
static void AddHealthChecks(IServiceCollection services)
{
services.AddOptions();
services.AddHealthChecks();
services.AddSingleton<IConfigureOptions<HealthCheckServiceOptions>>(provider =>
new ConfigureBusHealthCheckServiceOptions(provider.GetServices<IBusHealth>(), new[] {"ready"}));
}
}
}
|
namespace MassTransit
{
using AspNetCoreIntegration;
using AspNetCoreIntegration.HealthChecks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Monitoring.Health;
/// <summary>
/// These are the updated extensions compatible with the container registration code. They should be used, for real.
/// </summary>
public static class HostedServiceConfigurationExtensions
{
/// <summary>
/// Adds the MassTransit <see cref="IHostedService" />, which includes a bus and endpoint health check.
/// Use it together with UseHealthCheck to get more detailed diagnostics.
/// </summary>
/// <param name="services"></param>
public static IServiceCollection AddMassTransitHostedService(this IServiceCollection services)
{
AddHealthChecks(services);
return services.AddSingleton<IHostedService, MassTransitHostedService>();
}
public static IServiceCollection AddMassTransitHostedService(this IServiceCollection services, IBusControl bus)
{
AddHealthChecks(services);
return services.AddSingleton<IHostedService>(p => new BusHostedService(bus));
}
static void AddHealthChecks(IServiceCollection services)
{
services.AddOptions();
services.AddHealthChecks();
services.AddSingleton<IConfigureOptions<HealthCheckServiceOptions>>(provider =>
new ConfigureBusHealthCheckServiceOptions(provider.GetServices<IBusHealth>(), new[] {"ready", "masstransit"}));
}
}
}
|
Add identifying tag to MassTransit health checks.
|
Add identifying tag to MassTransit health checks.
|
C#
|
apache-2.0
|
phatboyg/MassTransit,MassTransit/MassTransit,MassTransit/MassTransit,phatboyg/MassTransit
|
98410dbb6d3276d674bba5e5f77bdffd1e598b40
|
osu.Game/Graphics/Containers/ShakeContainer.cs
|
osu.Game/Graphics/Containers/ShakeContainer.cs
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Graphics.Containers
{
/// <summary>
/// A container that adds the ability to shake its contents.
/// </summary>
public class ShakeContainer : Container
{
/// <summary>
/// Shake the contents of this container.
/// </summary>
public void Shake()
{
const float shake_amount = 8;
const float shake_duration = 30;
this.MoveToX(shake_amount, shake_duration / 2, Easing.OutSine).Then()
.MoveToX(-shake_amount, shake_duration, Easing.InOutSine).Then()
.MoveToX(shake_amount, shake_duration, Easing.InOutSine).Then()
.MoveToX(-shake_amount, shake_duration, Easing.InOutSine).Then()
.MoveToX(shake_amount, shake_duration, Easing.InOutSine).Then()
.MoveToX(0, shake_duration / 2, Easing.InSine);
}
}
}
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Graphics.Containers
{
/// <summary>
/// A container that adds the ability to shake its contents.
/// </summary>
public class ShakeContainer : Container
{
/// <summary>
/// Shake the contents of this container.
/// </summary>
public void Shake()
{
const float shake_amount = 8;
const float shake_duration = 30;
this.MoveToX(shake_amount, shake_duration / 2, Easing.OutSine).Then()
.MoveToX(-shake_amount, shake_duration, Easing.InOutSine).Then()
.MoveToX(shake_amount, shake_duration, Easing.InOutSine).Then()
.MoveToX(-shake_amount, shake_duration, Easing.InOutSine).Then()
.MoveToX(0, shake_duration / 2, Easing.InSine);
}
}
}
|
Reduce shake transform count by one for more aesthetic behaviour
|
Reduce shake transform count by one for more aesthetic behaviour
|
C#
|
mit
|
johnneijzen/osu,ppy/osu,UselessToucan/osu,DrabWeb/osu,smoogipoo/osu,naoey/osu,DrabWeb/osu,ppy/osu,ppy/osu,2yangk23/osu,2yangk23/osu,peppy/osu-new,ZLima12/osu,smoogipoo/osu,ZLima12/osu,naoey/osu,peppy/osu,peppy/osu,EVAST9919/osu,DrabWeb/osu,johnneijzen/osu,NeoAdonis/osu,EVAST9919/osu,NeoAdonis/osu,UselessToucan/osu,NeoAdonis/osu,smoogipooo/osu,UselessToucan/osu,smoogipoo/osu,naoey/osu,peppy/osu
|
318c00b2bef1644f0e4a660b3bce287069ddbe01
|
CefSharp.Wpf/DelegateCommand.cs
|
CefSharp.Wpf/DelegateCommand.cs
|
// Copyright © 2010-2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
using System.Windows;
using System.Windows.Input;
namespace CefSharp.Wpf
{
internal class DelegateCommand : ICommand
{
private readonly Action commandHandler;
private readonly Func<bool> canExecuteHandler;
public event EventHandler CanExecuteChanged;
public DelegateCommand(Action commandHandler, Func<bool> canExecuteHandler = null)
{
this.commandHandler = commandHandler;
this.canExecuteHandler = canExecuteHandler;
}
public void Execute(object parameter)
{
commandHandler();
}
public bool CanExecute(object parameter)
{
return
canExecuteHandler == null ||
canExecuteHandler();
}
public void RaiseCanExecuteChanged()
{
if (!Application.Current.Dispatcher.CheckAccess())
{
Application.Current.Dispatcher.BeginInvoke((Action) RaiseCanExecuteChanged);
return;
}
if (CanExecuteChanged != null)
{
CanExecuteChanged(this, new EventArgs());
}
}
}
}
|
// Copyright © 2010-2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
using System.Windows.Input;
namespace CefSharp.Wpf
{
internal class DelegateCommand : ICommand
{
private readonly Action commandHandler;
private readonly Func<bool> canExecuteHandler;
public event EventHandler CanExecuteChanged;
public DelegateCommand(Action commandHandler, Func<bool> canExecuteHandler = null)
{
this.commandHandler = commandHandler;
this.canExecuteHandler = canExecuteHandler;
}
public void Execute(object parameter)
{
commandHandler();
}
public bool CanExecute(object parameter)
{
return
canExecuteHandler == null ||
canExecuteHandler();
}
public void RaiseCanExecuteChanged()
{
if (CanExecuteChanged != null)
{
CanExecuteChanged(this, new EventArgs());
}
}
}
}
|
Remove call to Application.Current.Dispatcher.CheckAccess() - seems there's a null point happening on a rare instance when Application.Current.Dispatcher is null Rely on parent calling code to execute on the correct thread (which it was already executing on the UI Thread)
|
Remove call to Application.Current.Dispatcher.CheckAccess() - seems there's a null point happening on a rare instance when Application.Current.Dispatcher is null
Rely on parent calling code to execute on the correct thread (which it was already executing on the UI Thread)
|
C#
|
bsd-3-clause
|
windygu/CefSharp,rover886/CefSharp,Haraguroicha/CefSharp,yoder/CefSharp,haozhouxu/CefSharp,VioletLife/CefSharp,Octopus-ITSM/CefSharp,Haraguroicha/CefSharp,wangzheng888520/CefSharp,ruisebastiao/CefSharp,Livit/CefSharp,joshvera/CefSharp,rlmcneary2/CefSharp,joshvera/CefSharp,haozhouxu/CefSharp,battewr/CefSharp,zhangjingpu/CefSharp,Octopus-ITSM/CefSharp,joshvera/CefSharp,ITGlobal/CefSharp,jamespearce2006/CefSharp,NumbersInternational/CefSharp,illfang/CefSharp,ruisebastiao/CefSharp,wangzheng888520/CefSharp,zhangjingpu/CefSharp,yoder/CefSharp,twxstar/CefSharp,twxstar/CefSharp,ITGlobal/CefSharp,dga711/CefSharp,yoder/CefSharp,jamespearce2006/CefSharp,VioletLife/CefSharp,AJDev77/CefSharp,Octopus-ITSM/CefSharp,gregmartinhtc/CefSharp,haozhouxu/CefSharp,Haraguroicha/CefSharp,rover886/CefSharp,joshvera/CefSharp,windygu/CefSharp,zhangjingpu/CefSharp,yoder/CefSharp,wangzheng888520/CefSharp,jamespearce2006/CefSharp,rover886/CefSharp,jamespearce2006/CefSharp,Octopus-ITSM/CefSharp,wangzheng888520/CefSharp,battewr/CefSharp,windygu/CefSharp,gregmartinhtc/CefSharp,gregmartinhtc/CefSharp,NumbersInternational/CefSharp,haozhouxu/CefSharp,windygu/CefSharp,dga711/CefSharp,Livit/CefSharp,jamespearce2006/CefSharp,AJDev77/CefSharp,VioletLife/CefSharp,illfang/CefSharp,rover886/CefSharp,NumbersInternational/CefSharp,twxstar/CefSharp,rlmcneary2/CefSharp,Haraguroicha/CefSharp,AJDev77/CefSharp,NumbersInternational/CefSharp,ruisebastiao/CefSharp,battewr/CefSharp,dga711/CefSharp,rover886/CefSharp,ITGlobal/CefSharp,rlmcneary2/CefSharp,ITGlobal/CefSharp,VioletLife/CefSharp,zhangjingpu/CefSharp,illfang/CefSharp,rlmcneary2/CefSharp,gregmartinhtc/CefSharp,Livit/CefSharp,twxstar/CefSharp,Livit/CefSharp,dga711/CefSharp,ruisebastiao/CefSharp,Haraguroicha/CefSharp,battewr/CefSharp,illfang/CefSharp,AJDev77/CefSharp
|
00216c75fde7a7cb7d338c9040dbab98114f92ac
|
Source/Umbraco/Views/Partials/FormEditor/FieldsNoScript/core.utils.validationerror.cshtml
|
Source/Umbraco/Views/Partials/FormEditor/FieldsNoScript/core.utils.validationerror.cshtml
|
@inherits Umbraco.Web.Mvc.UmbracoViewPage<FormEditor.Fields.IFieldWithValidation>
@if (Model.Invalid)
{
<div class="text-danger validation-error">
@Model.ErrorMessage
</div>
}
|
@inherits Umbraco.Web.Mvc.UmbracoViewPage<FormEditor.Fields.IFieldWithValidation>
@* for the NoScript rendering, this is solely rendered server side *@
@if (Model.Invalid)
{
<div class="text-danger validation-error">
@Model.ErrorMessage
</div>
}
|
Comment for validation error rendering
|
Comment for validation error rendering
|
C#
|
mit
|
kjac/FormEditor,kjac/FormEditor,kjac/FormEditor
|
54790a94c442745f32f7b67b93eb3ff99e0f6c8b
|
CefSharp/IDownloadHandler.cs
|
CefSharp/IDownloadHandler.cs
|
// Copyright © 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
namespace CefSharp
{
public interface IDownloadHandler
{
/// <summary>
/// Called before a download begins.
/// </summary>
/// <param name="browser">The browser instance</param>
/// <param name="downloadItem">Represents the file being downloaded.</param>
/// <param name="callback">Callback interface used to asynchronously continue a download.</param>
/// <returns>Return True to continue the download otherwise return False to cancel the download</returns>
void OnBeforeDownload(IBrowser browser, DownloadItem downloadItem, IBeforeDownloadCallback callback);
/// <summary>
/// Called when a download's status or progress information has been updated. This may be called multiple times before and after <see cref="OnBeforeDownload"/>.
/// </summary>
/// <param name="browser">The browser instance</param>
/// <param name="downloadItem">Represents the file being downloaded.</param>
/// <param name="callback">The callback used to Cancel/Pause/Resume the process</param>
/// <returns>Return True to cancel, otherwise False to allow the download to continue.</returns>
void OnDownloadUpdated(IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback);
}
}
|
// Copyright © 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
namespace CefSharp
{
public interface IDownloadHandler
{
/// <summary>
/// Called before a download begins.
/// </summary>
/// <param name="browser">The browser instance</param>
/// <param name="downloadItem">Represents the file being downloaded.</param>
/// <param name="callback">Callback interface used to asynchronously continue a download.</param>
void OnBeforeDownload(IBrowser browser, DownloadItem downloadItem, IBeforeDownloadCallback callback);
/// <summary>
/// Called when a download's status or progress information has been updated. This may be called multiple times before and after <see cref="OnBeforeDownload"/>.
/// </summary>
/// <param name="browser">The browser instance</param>
/// <param name="downloadItem">Represents the file being downloaded.</param>
/// <param name="callback">The callback used to Cancel/Pause/Resume the process</param>
void OnDownloadUpdated(IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback);
}
}
|
Remove return xml comments, not valid anymore
|
Remove return xml comments, not valid anymore
|
C#
|
bsd-3-clause
|
Livit/CefSharp,battewr/CefSharp,haozhouxu/CefSharp,NumbersInternational/CefSharp,Haraguroicha/CefSharp,NumbersInternational/CefSharp,wangzheng888520/CefSharp,jamespearce2006/CefSharp,VioletLife/CefSharp,NumbersInternational/CefSharp,yoder/CefSharp,jamespearce2006/CefSharp,AJDev77/CefSharp,twxstar/CefSharp,windygu/CefSharp,Haraguroicha/CefSharp,gregmartinhtc/CefSharp,wangzheng888520/CefSharp,AJDev77/CefSharp,joshvera/CefSharp,VioletLife/CefSharp,yoder/CefSharp,zhangjingpu/CefSharp,dga711/CefSharp,ITGlobal/CefSharp,joshvera/CefSharp,battewr/CefSharp,VioletLife/CefSharp,rlmcneary2/CefSharp,battewr/CefSharp,ruisebastiao/CefSharp,illfang/CefSharp,illfang/CefSharp,haozhouxu/CefSharp,wangzheng888520/CefSharp,twxstar/CefSharp,dga711/CefSharp,dga711/CefSharp,wangzheng888520/CefSharp,twxstar/CefSharp,jamespearce2006/CefSharp,haozhouxu/CefSharp,rlmcneary2/CefSharp,zhangjingpu/CefSharp,Haraguroicha/CefSharp,yoder/CefSharp,Haraguroicha/CefSharp,jamespearce2006/CefSharp,joshvera/CefSharp,NumbersInternational/CefSharp,AJDev77/CefSharp,ITGlobal/CefSharp,ITGlobal/CefSharp,jamespearce2006/CefSharp,windygu/CefSharp,ruisebastiao/CefSharp,dga711/CefSharp,joshvera/CefSharp,rlmcneary2/CefSharp,Livit/CefSharp,zhangjingpu/CefSharp,rlmcneary2/CefSharp,ruisebastiao/CefSharp,AJDev77/CefSharp,ruisebastiao/CefSharp,gregmartinhtc/CefSharp,zhangjingpu/CefSharp,illfang/CefSharp,gregmartinhtc/CefSharp,Livit/CefSharp,gregmartinhtc/CefSharp,windygu/CefSharp,yoder/CefSharp,haozhouxu/CefSharp,windygu/CefSharp,VioletLife/CefSharp,Haraguroicha/CefSharp,illfang/CefSharp,twxstar/CefSharp,ITGlobal/CefSharp,battewr/CefSharp,Livit/CefSharp
|
d42eb56fee4b3aeff9e336553db1dcf1c70f23f2
|
test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs
|
test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs
|
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace Microsoft.AspNetCore.StaticFiles
{
public static class StaticFilesTestServer
{
public static TestServer Create(Action<IApplicationBuilder> configureApp, Action<IServiceCollection> configureServices = null)
{
Action<IServiceCollection> defaultConfigureServices = services => { };
var configuration = new ConfigurationBuilder()
.AddInMemoryCollection(new []
{
new KeyValuePair<string, string>("webroot", ".")
})
.Build();
var builder = new WebHostBuilder()
.UseConfiguration(configuration)
.Configure(configureApp)
.ConfigureServices(configureServices ?? defaultConfigureServices);
return new TestServer(builder);
}
}
}
|
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.PlatformAbstractions;
namespace Microsoft.AspNetCore.StaticFiles
{
public static class StaticFilesTestServer
{
public static TestServer Create(Action<IApplicationBuilder> configureApp, Action<IServiceCollection> configureServices = null)
{
var contentRootNet451 = PlatformServices.Default.Runtime.OperatingSystemPlatform == Platform.Windows ?
"." : "../../../../test/Microsoft.AspNetCore.StaticFiles.Tests";
Action<IServiceCollection> defaultConfigureServices = services => { };
var configuration = new ConfigurationBuilder()
.AddInMemoryCollection(new []
{
new KeyValuePair<string, string>("webroot", ".")
})
.Build();
var builder = new WebHostBuilder()
#if NET451
.UseContentRoot(contentRootNet451)
#endif
.UseConfiguration(configuration)
.Configure(configureApp)
.ConfigureServices(configureServices ?? defaultConfigureServices);
return new TestServer(builder);
}
}
}
|
Fix content root for non-windows xunit tests with no app domains
|
Fix content root for non-windows xunit tests with no app domains
|
C#
|
apache-2.0
|
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
|
a1cc27d0efccf47fb576b12b427a58d2d8f89a48
|
BrowserLog.NLog.Demo/Program.cs
|
BrowserLog.NLog.Demo/Program.cs
|
using System;
using System.Threading;
using NLog;
using NLogConfig = NLog.Config;
namespace BrowserLog.NLog.Demo
{
class Program
{
static void Main(string[] args)
{
LogManager.Configuration = new NLogConfig.XmlLoggingConfiguration("NLog.config", true);
var logger = LogManager.GetLogger("*", typeof(Program));
logger.Info("Hello!");
Thread.Sleep(1000);
for (int i = 0; i < 100000; i++)
{
logger.Info("Hello this is a log from a server-side process!");
Thread.Sleep(100);
logger.Warn("Hello this is a warning from a server-side process!");
logger.Debug("... and here is another log again ({0})", i);
Thread.Sleep(200);
try
{
ThrowExceptionWithStackTrace(4);
}
catch (Exception ex)
{
logger.Error("An error has occured, really?", ex);
}
Thread.Sleep(1000);
}
}
static void ThrowExceptionWithStackTrace(int depth)
{
if (depth == 0)
{
throw new Exception("A fake exception to show an example");
}
ThrowExceptionWithStackTrace(--depth);
}
}
}
|
using System;
using System.Threading;
using NLog;
using NLogConfig = NLog.Config;
namespace BrowserLog.NLog.Demo
{
class Program
{
static void Main(string[] args)
{
LogManager.Configuration = new NLogConfig.XmlLoggingConfiguration("NLog.config", true);
var logger = LogManager.GetLogger("*", typeof(Program));
logger.Info("Hello!");
Thread.Sleep(1000);
for (int i = 0; i < 100000; i++)
{
logger.Info("Hello this is a log from a server-side process!");
Thread.Sleep(100);
logger.Warn("Hello this is a warning from a server-side process!");
logger.Debug("... and here is another log again ({0})", i);
Thread.Sleep(200);
try
{
ThrowExceptionWithStackTrace(4);
}
catch (Exception ex)
{
logger.Error(ex, "An error has occured, really?");
}
Thread.Sleep(1000);
}
}
static void ThrowExceptionWithStackTrace(int depth)
{
if (depth == 0)
{
throw new Exception("A fake exception to show an example");
}
ThrowExceptionWithStackTrace(--depth);
}
}
}
|
Change obsolete signature for method Error
|
fix: Change obsolete signature for method Error
|
C#
|
apache-2.0
|
alexvictoor/BrowserLog,alexvictoor/BrowserLog,alexvictoor/BrowserLog
|
784024ea7a1909acd5bba6563bedd9029cefc46f
|
food_tracker/DAL/WholeDay.cs
|
food_tracker/DAL/WholeDay.cs
|
using System;
using System.ComponentModel.DataAnnotations;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace food_tracker.DAL {
public class WholeDay {
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public string WholeDayId { get; set; }
public DateTime dateTime { get; set; }
public double dailyTotal { get; set; }
public virtual List<NutritionItem> foodsDuringDay { get; set; }
[Obsolete("Only needed for serialization and materialization", true)]
public WholeDay() { }
public WholeDay(string dayId) {
this.WholeDayId = dayId;
this.dateTime = DateTime.UtcNow;
this.dailyTotal = 0;
}
}
}
|
using System;
using System.ComponentModel.DataAnnotations;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace food_tracker.DAL {
public class WholeDay {
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public string WholeDayId { get; set; }
public DateTime dateTime { get; set; }
public double dailyTotal { get; set; }
public virtual IEnumerable<NutritionItem> foodsDuringDay { get; set; }
[Obsolete("Only needed for serialization and materialization", true)]
public WholeDay() { }
public WholeDay(string dayId) {
this.WholeDayId = dayId;
this.dateTime = DateTime.UtcNow;
this.dailyTotal = 0;
}
}
}
|
Change List data type to IEnumerable
|
Change List data type to IEnumerable
|
C#
|
mit
|
lukecahill/NutritionTracker
|
5e5943cf29b242e3d729f7fe32ddcbeebe99705c
|
Winston/Net/Extensions.cs
|
Winston/Net/Extensions.cs
|
using System;
using System.Collections.Specialized;
using System.Text.RegularExpressions;
namespace Winston.Net
{
static class Extensions
{
public static NameValueCollection ParseQueryString(this Uri uri)
{
var result = new NameValueCollection();
var query = uri.Query;
// remove anything other than query string from url
if (query.Contains("?"))
{
query = query.Substring(query.IndexOf('?') + 1);
}
foreach (string vp in Regex.Split(query, "&"))
{
var singlePair = Regex.Split(vp, "=");
if (singlePair.Length == 2)
{
result.Add(singlePair[0], singlePair[1]);
}
else
{
// only one key with no value specified in query string
result.Add(singlePair[0], string.Empty);
}
}
return result;
}
}
}
|
using System;
using System.Collections.Specialized;
using System.Text.RegularExpressions;
namespace Winston.Net
{
static class Extensions
{
public static NameValueCollection ParseQueryString(this Uri uri)
{
var result = new NameValueCollection();
var query = uri.Query;
// remove anything other than query string from url
if (query.Contains("?"))
{
query = query.Substring(query.IndexOf('?') + 1);
}
foreach (string vp in Regex.Split(query, "&"))
{
var singlePair = Regex.Split(vp, "=");
if (singlePair.Length == 2)
{
result.Add(Uri.UnescapeDataString(singlePair[0]), Uri.UnescapeDataString(singlePair[1]));
}
else
{
// only one key with no value specified in query string
result.Add(Uri.UnescapeDataString(singlePair[0]), string.Empty);
}
}
return result;
}
}
}
|
Add escaping to query string parsing
|
Add escaping to query string parsing
|
C#
|
mit
|
mattolenik/winston,mattolenik/winston,mattolenik/winston
|
a700aa2cd30c2f3c018445a937ba6fbd857fee4e
|
src/Features/CSharp/Portable/MoveToNamespace/CSharpMoveToNamespaceService.cs
|
src/Features/CSharp/Portable/MoveToNamespace/CSharpMoveToNamespaceService.cs
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Composition;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.MoveToNamespace;
namespace Microsoft.CodeAnalysis.CSharp.MoveToNamespace
{
[ExportLanguageService(typeof(AbstractMoveToNamespaceService), LanguageNames.CSharp), Shared]
internal class CSharpMoveToNamespaceService :
AbstractMoveToNamespaceService<CompilationUnitSyntax, NamespaceDeclarationSyntax, TypeDeclarationSyntax>
{
[ImportingConstructor]
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
public CSharpMoveToNamespaceService(
[Import(AllowDefault = true)] IMoveToNamespaceOptionsService moveToNamespaceOptionsService)
: base(moveToNamespaceOptionsService)
{
}
protected override string GetNamespaceName(NamespaceDeclarationSyntax syntax)
=> syntax.Name.ToString();
protected override string GetNamespaceName(TypeDeclarationSyntax syntax)
=> GetNamespaceName(syntax.FirstAncestorOrSelf<NamespaceDeclarationSyntax>());
}
}
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Composition;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.MoveToNamespace;
namespace Microsoft.CodeAnalysis.CSharp.MoveToNamespace
{
[ExportLanguageService(typeof(AbstractMoveToNamespaceService), LanguageNames.CSharp), Shared]
internal class CSharpMoveToNamespaceService :
AbstractMoveToNamespaceService<CompilationUnitSyntax, NamespaceDeclarationSyntax, TypeDeclarationSyntax>
{
[ImportingConstructor]
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
public CSharpMoveToNamespaceService(
[Import(AllowDefault = true)] IMoveToNamespaceOptionsService moveToNamespaceOptionsService)
: base(moveToNamespaceOptionsService)
{
}
protected override string GetNamespaceName(NamespaceDeclarationSyntax syntax)
=> syntax.Name.ToString();
protected override string GetNamespaceName(TypeDeclarationSyntax syntax)
{
var namespaceDecl = syntax.FirstAncestorOrSelf<NamespaceDeclarationSyntax>();
if (namespaceDecl == null)
{
return string.Empty;
}
return GetNamespaceName(namespaceDecl);
}
}
}
|
Handle cases where a namespace declaration isn't found in the ancestors of a type declaration
|
Handle cases where a namespace declaration isn't found in the ancestors of a type declaration
|
C#
|
mit
|
brettfo/roslyn,diryboy/roslyn,davkean/roslyn,tmat/roslyn,shyamnamboodiripad/roslyn,swaroop-sridhar/roslyn,gafter/roslyn,aelij/roslyn,nguerrera/roslyn,mgoertz-msft/roslyn,abock/roslyn,abock/roslyn,AmadeusW/roslyn,KevinRansom/roslyn,heejaechang/roslyn,weltkante/roslyn,dotnet/roslyn,sharwell/roslyn,ErikSchierboom/roslyn,bartdesmet/roslyn,heejaechang/roslyn,bartdesmet/roslyn,shyamnamboodiripad/roslyn,brettfo/roslyn,agocke/roslyn,davkean/roslyn,stephentoub/roslyn,wvdd007/roslyn,tmat/roslyn,gafter/roslyn,mavasani/roslyn,jasonmalinowski/roslyn,CyrusNajmabadi/roslyn,tannergooding/roslyn,reaction1989/roslyn,wvdd007/roslyn,jmarolf/roslyn,nguerrera/roslyn,KirillOsenkov/roslyn,dotnet/roslyn,stephentoub/roslyn,gafter/roslyn,jmarolf/roslyn,weltkante/roslyn,abock/roslyn,reaction1989/roslyn,KevinRansom/roslyn,mgoertz-msft/roslyn,panopticoncentral/roslyn,reaction1989/roslyn,shyamnamboodiripad/roslyn,KirillOsenkov/roslyn,panopticoncentral/roslyn,eriawan/roslyn,physhi/roslyn,agocke/roslyn,eriawan/roslyn,genlu/roslyn,tmat/roslyn,eriawan/roslyn,diryboy/roslyn,AmadeusW/roslyn,ErikSchierboom/roslyn,AlekseyTs/roslyn,swaroop-sridhar/roslyn,jmarolf/roslyn,brettfo/roslyn,sharwell/roslyn,agocke/roslyn,swaroop-sridhar/roslyn,davkean/roslyn,physhi/roslyn,wvdd007/roslyn,AmadeusW/roslyn,genlu/roslyn,diryboy/roslyn,mavasani/roslyn,aelij/roslyn,AlekseyTs/roslyn,ErikSchierboom/roslyn,jasonmalinowski/roslyn,KirillOsenkov/roslyn,AlekseyTs/roslyn,CyrusNajmabadi/roslyn,mgoertz-msft/roslyn,nguerrera/roslyn,jasonmalinowski/roslyn,tannergooding/roslyn,CyrusNajmabadi/roslyn,heejaechang/roslyn,panopticoncentral/roslyn,genlu/roslyn,physhi/roslyn,stephentoub/roslyn,aelij/roslyn,bartdesmet/roslyn,weltkante/roslyn,mavasani/roslyn,dotnet/roslyn,tannergooding/roslyn,sharwell/roslyn,KevinRansom/roslyn
|
af20fa2cef0cd6e91cb12af0b4bd17743a6dc226
|
clipr/Core/ArgumentValidation.cs
|
clipr/Core/ArgumentValidation.cs
|
using System;
using System.Text.RegularExpressions;
namespace clipr.Core
{
internal static class ArgumentValidation
{
public static bool IsAllowedShortName(char c)
{
return Char.IsLetter(c);
}
internal const string IsAllowedShortNameExplanation =
"Short arguments must be letters.";
public static bool IsAllowedLongName(string name)
{
return name != null &&
Regex.IsMatch(name, @"^[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9]$");
}
internal const string IsAllowedLongNameExplanation =
"Long arguments must begin with a letter, contain a letter, " +
"digit, or hyphen, and end with a letter or a digit.";
}
}
|
using System;
using System.Text.RegularExpressions;
namespace clipr.Core
{
internal static class ArgumentValidation
{
public static bool IsAllowedShortName(char c)
{
return Char.IsLetter(c);
}
internal const string IsAllowedShortNameExplanation =
"Short arguments must be letters.";
public static bool IsAllowedLongName(string name)
{
return name != null &&
Regex.IsMatch(name, @"^[a-zA-Z][a-zA-Z0-9\-_]*[a-zA-Z0-9]$");
}
internal const string IsAllowedLongNameExplanation =
"Long arguments must begin with a letter, contain a letter, " +
"digit, underscore, or hyphen, and end with a letter or a digit.";
}
}
|
Enable underscore in middle of long name.
|
Enable underscore in middle of long name.
|
C#
|
mit
|
nemec/clipr
|
2cb217e06c04d63de4bc4151c7631b9abc448062
|
osu.Game/Screens/Edit/EditorSkinProvidingContainer.cs
|
osu.Game/Screens/Edit/EditorSkinProvidingContainer.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.Skinning;
#nullable enable
namespace osu.Game.Screens.Edit
{
/// <summary>
/// A <see cref="SkinProvidingContainer"/> that fires <see cref="ISkinSource.SourceChanged"/> when users have made a change to the beatmap skin
/// of the map being edited.
/// </summary>
public class EditorSkinProvidingContainer : RulesetSkinProvidingContainer
{
private readonly EditorBeatmapSkin? beatmapSkin;
public EditorSkinProvidingContainer(EditorBeatmap editorBeatmap)
: base(editorBeatmap.PlayableBeatmap.BeatmapInfo.Ruleset.CreateInstance(), editorBeatmap.PlayableBeatmap, editorBeatmap.BeatmapSkin)
{
beatmapSkin = editorBeatmap.BeatmapSkin;
}
protected override void LoadComplete()
{
base.LoadComplete();
if (beatmapSkin != null)
beatmapSkin.BeatmapSkinChanged += TriggerSourceChanged;
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
if (beatmapSkin != null)
beatmapSkin.BeatmapSkinChanged -= TriggerSourceChanged;
}
}
}
|
// 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.Skinning;
#nullable enable
namespace osu.Game.Screens.Edit
{
/// <summary>
/// A <see cref="SkinProvidingContainer"/> that fires <see cref="ISkinSource.SourceChanged"/> when users have made a change to the beatmap skin
/// of the map being edited.
/// </summary>
public class EditorSkinProvidingContainer : RulesetSkinProvidingContainer
{
private readonly EditorBeatmapSkin? beatmapSkin;
public EditorSkinProvidingContainer(EditorBeatmap editorBeatmap)
: base(editorBeatmap.PlayableBeatmap.BeatmapInfo.Ruleset.CreateInstance(), editorBeatmap.PlayableBeatmap, editorBeatmap.BeatmapSkin?.Skin)
{
beatmapSkin = editorBeatmap.BeatmapSkin;
}
protected override void LoadComplete()
{
base.LoadComplete();
if (beatmapSkin != null)
beatmapSkin.BeatmapSkinChanged += TriggerSourceChanged;
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
if (beatmapSkin != null)
beatmapSkin.BeatmapSkinChanged -= TriggerSourceChanged;
}
}
}
|
Fix editor legacy beatmap skins not receiving transformer
|
Fix editor legacy beatmap skins not receiving transformer
|
C#
|
mit
|
NeoAdonis/osu,peppy/osu,ppy/osu,ppy/osu,NeoAdonis/osu,ppy/osu,peppy/osu,NeoAdonis/osu,peppy/osu
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.