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
b987a534c8f09d3590ad4020f84f8b0f167ca05f
src/Cimpress.Extensions.Http/HttpResponseMessageExtensions.cs
src/Cimpress.Extensions.Http/HttpResponseMessageExtensions.cs
using System; using System.Net.Http; using System.Threading.Tasks; using Microsoft.Extensions.Logging; namespace Cimpress.Extensions.Http { public static class HttpResponseMessageExtensions { public static async Task LogAndThrowIfNotSuccessStatusCode(this HttpResponseMessage message, ILogger logger) { if (!message.IsSuccessStatusCode) { var formattedMsg = await LogMessage(message, logger); throw new Exception(formattedMsg); } } public static async Task LogIfNotSuccessStatusCode(this HttpResponseMessage message, ILogger logger) { if (!message.IsSuccessStatusCode) { await LogMessage(message, logger); } } public static async Task<string> LogMessage(HttpResponseMessage message, ILogger logger) { var msg = await message.Content.ReadAsStringAsync(); var formattedMsg = $"Error processing request. Status code was {message.StatusCode} when calling '{message.RequestMessage.RequestUri}', message was '{msg}'"; logger.LogError(formattedMsg); return formattedMsg; } } }
using System; using System.Net.Http; using System.Threading.Tasks; using Microsoft.Extensions.Logging; namespace Cimpress.Extensions.Http { public static class HttpResponseMessageExtensions { public static async Task LogAndThrowIfNotSuccessStatusCode(this HttpResponseMessage message, ILogger logger) { if (!message.IsSuccessStatusCode) { var formattedMsg = await LogMessage(message, logger); throw new Exception(formattedMsg); } } public static async Task LogIfNotSuccessStatusCode(this HttpResponseMessage message, ILogger logger) { if (!message.IsSuccessStatusCode) { await LogMessage(message, logger); } } public static async Task ThrowIfNotSuccessStatusCode(this HttpResponseMessage message) { if (!message.IsSuccessStatusCode) { var formattedMsg = await FormatErrorMessage(message); throw new Exception(formattedMsg); } } public static async Task<string> LogMessage(HttpResponseMessage message, ILogger logger) { string formattedMsg = await message.FormatErrorMessage(); logger.LogError(formattedMsg); return formattedMsg; } public static async Task<string> FormatErrorMessage(this HttpResponseMessage message) { var msg = await message.Content.ReadAsStringAsync(); var formattedMsg = $"Error processing request. Status code was {message.StatusCode} when calling '{message.RequestMessage.RequestUri}', message was '{msg}'"; return formattedMsg; } } }
Add option to throw an exception without logging it.
Add option to throw an exception without logging it.
C#
apache-2.0
Cimpress-MCP/dotnet-core-httputils
c05c200a1de7e5319ab04554da9c422d5123c56f
src/System.Data.Common/src/System/Data/Common/DbDataReaderExtension.cs
src/System.Data.Common/src/System/Data/Common/DbDataReaderExtension.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.Data.Common { public static class DbDataReaderExtension { public static System.Collections.ObjectModel.ReadOnlyCollection<DbColumn> GetColumnSchema(this DbDataReader reader) { if (reader is IDbColumnSchemaGenerator) { return ((IDbColumnSchemaGenerator)reader).GetColumnSchema(); } throw new NotImplementedException(); } } }
// 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.Data.Common { public static class DbDataReaderExtension { public static System.Collections.ObjectModel.ReadOnlyCollection<DbColumn> GetColumnSchema(this DbDataReader reader) { if (reader.CanProvideSchema()) { return ((IDbColumnSchemaGenerator)reader).GetColumnSchema(); } throw new NotImplementedException(); } public static bool CanProvideSchema(this DbDataReader reader) { return reader is IDbColumnSchemaGenerator; } } }
Add the query for capability
Add the query for capability
C#
mit
iamjasonp/corefx,wtgodbe/corefx,krk/corefx,JosephTremoulet/corefx,gkhanna79/corefx,SGuyGe/corefx,the-dwyer/corefx,jlin177/corefx,nbarbettini/corefx,alphonsekurian/corefx,shahid-pk/corefx,krk/corefx,Petermarcu/corefx,BrennanConroy/corefx,axelheer/corefx,yizhang82/corefx,twsouthwick/corefx,pallavit/corefx,yizhang82/corefx,alphonsekurian/corefx,ericstj/corefx,mazong1123/corefx,mazong1123/corefx,elijah6/corefx,Jiayili1/corefx,shmao/corefx,marksmeltzer/corefx,ptoonen/corefx,shahid-pk/corefx,shmao/corefx,rjxby/corefx,YoupHulsebos/corefx,JosephTremoulet/corefx,axelheer/corefx,adamralph/corefx,lggomez/corefx,axelheer/corefx,ericstj/corefx,fgreinacher/corefx,pallavit/corefx,yizhang82/corefx,MaggieTsang/corefx,Jiayili1/corefx,elijah6/corefx,dhoehna/corefx,seanshpark/corefx,Jiayili1/corefx,ravimeda/corefx,billwert/corefx,mazong1123/corefx,ellismg/corefx,mmitche/corefx,the-dwyer/corefx,Jiayili1/corefx,twsouthwick/corefx,Chrisboh/corefx,wtgodbe/corefx,jcme/corefx,dotnet-bot/corefx,adamralph/corefx,jlin177/corefx,tijoytom/corefx,gkhanna79/corefx,mazong1123/corefx,Ermiar/corefx,ellismg/corefx,krk/corefx,janhenke/corefx,shmao/corefx,yizhang82/corefx,dhoehna/corefx,Ermiar/corefx,tstringer/corefx,mazong1123/corefx,Priya91/corefx-1,elijah6/corefx,rahku/corefx,iamjasonp/corefx,manu-silicon/corefx,zhenlan/corefx,rjxby/corefx,manu-silicon/corefx,adamralph/corefx,richlander/corefx,shimingsg/corefx,tijoytom/corefx,dsplaisted/corefx,benpye/corefx,shimingsg/corefx,rubo/corefx,krytarowski/corefx,gkhanna79/corefx,tstringer/corefx,tijoytom/corefx,jhendrixMSFT/corefx,Ermiar/corefx,DnlHarvey/corefx,Chrisboh/corefx,weltkante/corefx,ericstj/corefx,stephenmichaelf/corefx,cydhaselton/corefx,benpye/corefx,jhendrixMSFT/corefx,MaggieTsang/corefx,parjong/corefx,iamjasonp/corefx,gkhanna79/corefx,dsplaisted/corefx,tijoytom/corefx,jlin177/corefx,ellismg/corefx,kkurni/corefx,alexperovich/corefx,ptoonen/corefx,mmitche/corefx,benjamin-bader/corefx,shimingsg/corefx,axelheer/corefx,ViktorHofer/corefx,kkurni/corefx,nbarbettini/corefx,ericstj/corefx,ravimeda/corefx,marksmeltzer/corefx,pallavit/corefx,marksmeltzer/corefx,benjamin-bader/corefx,stone-li/corefx,billwert/corefx,shimingsg/corefx,lggomez/corefx,benjamin-bader/corefx,rubo/corefx,benjamin-bader/corefx,manu-silicon/corefx,stephenmichaelf/corefx,zhenlan/corefx,alexperovich/corefx,ViktorHofer/corefx,gkhanna79/corefx,weltkante/corefx,jhendrixMSFT/corefx,benpye/corefx,jcme/corefx,yizhang82/corefx,ellismg/corefx,weltkante/corefx,Jiayili1/corefx,rjxby/corefx,twsouthwick/corefx,iamjasonp/corefx,tstringer/corefx,fgreinacher/corefx,rahku/corefx,ericstj/corefx,cartermp/corefx,manu-silicon/corefx,jhendrixMSFT/corefx,zhenlan/corefx,billwert/corefx,stone-li/corefx,the-dwyer/corefx,janhenke/corefx,elijah6/corefx,shahid-pk/corefx,alphonsekurian/corefx,tijoytom/corefx,wtgodbe/corefx,zhenlan/corefx,rjxby/corefx,elijah6/corefx,shmao/corefx,ViktorHofer/corefx,nchikanov/corefx,benpye/corefx,krytarowski/corefx,cartermp/corefx,JosephTremoulet/corefx,shimingsg/corefx,ericstj/corefx,stephenmichaelf/corefx,nchikanov/corefx,mokchhya/corefx,YoupHulsebos/corefx,tstringer/corefx,YoupHulsebos/corefx,rahku/corefx,dotnet-bot/corefx,JosephTremoulet/corefx,benjamin-bader/corefx,krk/corefx,billwert/corefx,weltkante/corefx,elijah6/corefx,cartermp/corefx,ViktorHofer/corefx,rjxby/corefx,Jiayili1/corefx,axelheer/corefx,seanshpark/corefx,ravimeda/corefx,marksmeltzer/corefx,ViktorHofer/corefx,wtgodbe/corefx,benjamin-bader/corefx,parjong/corefx,cydhaselton/corefx,janhenke/corefx,ravimeda/corefx,kkurni/corefx,mmitche/corefx,jhendrixMSFT/corefx,lggomez/corefx,krytarowski/corefx,ViktorHofer/corefx,gkhanna79/corefx,alphonsekurian/corefx,SGuyGe/corefx,jhendrixMSFT/corefx,weltkante/corefx,MaggieTsang/corefx,cartermp/corefx,BrennanConroy/corefx,yizhang82/corefx,dhoehna/corefx,marksmeltzer/corefx,Petermarcu/corefx,stone-li/corefx,nbarbettini/corefx,mazong1123/corefx,cydhaselton/corefx,nchikanov/corefx,khdang/corefx,BrennanConroy/corefx,jhendrixMSFT/corefx,Priya91/corefx-1,twsouthwick/corefx,lggomez/corefx,ptoonen/corefx,axelheer/corefx,Chrisboh/corefx,Chrisboh/corefx,jcme/corefx,krytarowski/corefx,mokchhya/corefx,rahku/corefx,kkurni/corefx,richlander/corefx,ellismg/corefx,rahku/corefx,shahid-pk/corefx,dotnet-bot/corefx,Petermarcu/corefx,richlander/corefx,iamjasonp/corefx,YoupHulsebos/corefx,YoupHulsebos/corefx,cartermp/corefx,alexperovich/corefx,DnlHarvey/corefx,mokchhya/corefx,ravimeda/corefx,lggomez/corefx,stephenmichaelf/corefx,janhenke/corefx,tstringer/corefx,DnlHarvey/corefx,rjxby/corefx,Priya91/corefx-1,wtgodbe/corefx,cartermp/corefx,jlin177/corefx,Chrisboh/corefx,parjong/corefx,dhoehna/corefx,the-dwyer/corefx,seanshpark/corefx,zhenlan/corefx,dotnet-bot/corefx,mmitche/corefx,rahku/corefx,twsouthwick/corefx,khdang/corefx,parjong/corefx,mmitche/corefx,kkurni/corefx,alphonsekurian/corefx,ptoonen/corefx,richlander/corefx,DnlHarvey/corefx,stone-li/corefx,JosephTremoulet/corefx,jcme/corefx,nbarbettini/corefx,alexperovich/corefx,alexperovich/corefx,shimingsg/corefx,elijah6/corefx,richlander/corefx,weltkante/corefx,Petermarcu/corefx,mmitche/corefx,manu-silicon/corefx,Petermarcu/corefx,khdang/corefx,alexperovich/corefx,MaggieTsang/corefx,shahid-pk/corefx,krk/corefx,nbarbettini/corefx,shimingsg/corefx,Ermiar/corefx,mokchhya/corefx,stephenmichaelf/corefx,seanshpark/corefx,richlander/corefx,tstringer/corefx,Priya91/corefx-1,alphonsekurian/corefx,alphonsekurian/corefx,janhenke/corefx,Ermiar/corefx,parjong/corefx,billwert/corefx,cydhaselton/corefx,seanshpark/corefx,khdang/corefx,nchikanov/corefx,manu-silicon/corefx,Chrisboh/corefx,Petermarcu/corefx,twsouthwick/corefx,Ermiar/corefx,cydhaselton/corefx,YoupHulsebos/corefx,dotnet-bot/corefx,seanshpark/corefx,mazong1123/corefx,janhenke/corefx,zhenlan/corefx,rubo/corefx,shmao/corefx,lggomez/corefx,mokchhya/corefx,SGuyGe/corefx,fgreinacher/corefx,SGuyGe/corefx,pallavit/corefx,wtgodbe/corefx,fgreinacher/corefx,pallavit/corefx,dsplaisted/corefx,JosephTremoulet/corefx,benpye/corefx,tijoytom/corefx,rahku/corefx,the-dwyer/corefx,krk/corefx,krytarowski/corefx,krytarowski/corefx,krk/corefx,weltkante/corefx,jcme/corefx,nbarbettini/corefx,ericstj/corefx,stephenmichaelf/corefx,dhoehna/corefx,shahid-pk/corefx,ptoonen/corefx,tijoytom/corefx,ViktorHofer/corefx,dotnet-bot/corefx,DnlHarvey/corefx,nbarbettini/corefx,jlin177/corefx,dotnet-bot/corefx,DnlHarvey/corefx,SGuyGe/corefx,kkurni/corefx,alexperovich/corefx,ptoonen/corefx,Priya91/corefx-1,seanshpark/corefx,jlin177/corefx,Jiayili1/corefx,the-dwyer/corefx,khdang/corefx,ravimeda/corefx,wtgodbe/corefx,nchikanov/corefx,nchikanov/corefx,billwert/corefx,cydhaselton/corefx,MaggieTsang/corefx,lggomez/corefx,the-dwyer/corefx,iamjasonp/corefx,marksmeltzer/corefx,stephenmichaelf/corefx,manu-silicon/corefx,ellismg/corefx,dhoehna/corefx,marksmeltzer/corefx,mokchhya/corefx,benpye/corefx,MaggieTsang/corefx,stone-li/corefx,yizhang82/corefx,shmao/corefx,billwert/corefx,ravimeda/corefx,ptoonen/corefx,parjong/corefx,rubo/corefx,krytarowski/corefx,pallavit/corefx,JosephTremoulet/corefx,twsouthwick/corefx,rjxby/corefx,zhenlan/corefx,gkhanna79/corefx,rubo/corefx,jlin177/corefx,cydhaselton/corefx,iamjasonp/corefx,Ermiar/corefx,jcme/corefx,dhoehna/corefx,parjong/corefx,khdang/corefx,MaggieTsang/corefx,YoupHulsebos/corefx,Petermarcu/corefx,SGuyGe/corefx,Priya91/corefx-1,nchikanov/corefx,richlander/corefx,shmao/corefx,mmitche/corefx,DnlHarvey/corefx,stone-li/corefx,stone-li/corefx
3916cf197c2344ecabf202c499c9be07445ecdfb
PluginLoader.Tests/Plugins_Tests.cs
PluginLoader.Tests/Plugins_Tests.cs
using PluginContracts; using System; using System.Collections.Generic; using Xunit; namespace PluginLoader.Tests { public class Plugins_Tests { [Fact] public void PluginsFound() { // Arrange var path = @"..\..\..\..\LAN\bin\Debug\netstandard1.3"; // Act var plugins = Plugins<IPluginV1>.Load(path); // Assert Assert.NotEmpty(plugins); } [Fact] public void PluginsNotFound() { // Arrange var path = @"."; // Act var plugins = Plugins<IPluginV1>.Load(path); // Assert Assert.Empty(plugins); } } }
using PluginContracts; using System; using System.Collections.Generic; using Xunit; namespace PluginLoader.Tests { public class Plugins_Tests { [Fact] public void PluginsFoundFromLibsFolder() { // Arrange var path = @"..\..\..\..\LAN\bin\Debug\netstandard1.3"; // Act var plugins = Plugins<IPluginV1>.Load(path); // Assert Assert.NotEmpty(plugins); } [Fact] public void PluginsNotFoundFromCurrentFolder() { // Arrange var path = @"."; // Act var plugins = Plugins<IPluginV1>.Load(path); // Assert Assert.Empty(plugins); } } }
Change test method names to follow "Feature to be tested" pattern
Change test method names to follow "Feature to be tested" pattern
C#
mit
tparviainen/oscilloscope
1551813f2145a2fc47387c282eca3ec21dec8643
src/Dotnet.Microservice/Health/Checks/PostgresqlHealthCheck.cs
src/Dotnet.Microservice/Health/Checks/PostgresqlHealthCheck.cs
using System; using Npgsql; namespace Dotnet.Microservice.Health.Checks { public class PostgresqlHealthCheck { /// <summary> /// Check that a connection can be established to Postgresql and return the server version /// </summary> /// <param name="connectionString">An Npgsql connection string</param> /// <returns>A <see cref="HealthResponse"/> object that contains the return status of this health check</returns> public static HealthResponse CheckHealth(string connectionString) { try { NpgsqlConnection conn = new NpgsqlConnection(connectionString); conn.Open(); string host = conn.Host; string version = conn.PostgreSqlVersion.ToString(); int port = conn.Port; conn.Close(); conn.Dispose(); return HealthResponse.Healthy(new { host = host, port = port , version = version}); } catch (Exception e) { return HealthResponse.Unhealthy(e); } } } }
using System; using Npgsql; namespace Dotnet.Microservice.Health.Checks { public class PostgresqlHealthCheck { /// <summary> /// Check that a connection can be established to Postgresql and return the server version /// </summary> /// <param name="connectionString">An Npgsql connection string</param> /// <returns>A <see cref="HealthResponse"/> object that contains the return status of this health check</returns> public static HealthResponse CheckHealth(string connectionString) { try { NpgsqlConnection conn = new NpgsqlConnection(connectionString); NpgsqlConnection.ClearPool(conn); conn.Open(); string host = conn.Host; string version = conn.PostgreSqlVersion.ToString(); int port = conn.Port; conn.Close(); conn.Dispose(); return HealthResponse.Healthy(new { host = host, port = port , version = version}); } catch (Exception e) { return HealthResponse.Unhealthy(e); } } } }
Clear connection pool so that an actual connection is created always
Clear connection pool so that an actual connection is created always
C#
isc
lynxx131/dotnet.microservice
297efce497397a3ca069fe7d70ff968f880e6ba8
SocialToolBox.Core.Mocks/Database/Projections/InMemoryStore.cs
SocialToolBox.Core.Mocks/Database/Projections/InMemoryStore.cs
using System.Collections.Generic; using System.Threading.Tasks; using SocialToolBox.Core.Database; using SocialToolBox.Core.Database.Projection; using SocialToolBox.Core.Database.Serialization; namespace SocialToolBox.Core.Mocks.Database.Projections { /// <summary> /// An in-memory implementation of <see cref="IWritableStore{T}"/> /// </summary> public class InMemoryStore<T> : IWritableStore<T> where T : class { public readonly Dictionary<Id, byte[]> Contents = new Dictionary<Id,byte[]>(); public IDatabaseDriver Driver { get; private set; } public readonly UntypedSerializer Serializer; public InMemoryStore(IDatabaseDriver driver) { Driver = driver; Serializer = new UntypedSerializer(driver.TypeDictionary); } // ReSharper disable CSharpWarnings::CS1998 public async Task<T> Get(Id id, IReadCursor cursor) // ReSharper restore CSharpWarnings::CS1998 { byte[] value; if (!Contents.TryGetValue(id, out value)) return null; return Serializer.Unserialize<T>(value); } // ReSharper disable CSharpWarnings::CS1998 public async Task Set(Id id, T item, IProjectCursor cursor) // ReSharper restore CSharpWarnings::CS1998 { Contents.Remove(id); if (item == null) return; Contents.Add(id,Serializer.Serialize(item)); } } }
using System.Collections.Generic; using System.Threading.Tasks; using SocialToolBox.Core.Async; using SocialToolBox.Core.Database; using SocialToolBox.Core.Database.Projection; using SocialToolBox.Core.Database.Serialization; namespace SocialToolBox.Core.Mocks.Database.Projections { /// <summary> /// An in-memory implementation of <see cref="IWritableStore{T}"/> /// </summary> public class InMemoryStore<T> : IWritableStore<T> where T : class { public readonly Dictionary<Id, byte[]> Contents = new Dictionary<Id,byte[]>(); public IDatabaseDriver Driver { get; private set; } public readonly UntypedSerializer Serializer; public InMemoryStore(IDatabaseDriver driver) { Driver = driver; Serializer = new UntypedSerializer(driver.TypeDictionary); } /// <summary> /// A lock for avoiding multi-thread collisions. /// </summary> private readonly AsyncLock _lock = new AsyncLock(); public async Task<T> Get(Id id, IReadCursor cursor) { byte[] value; using (await _lock.Lock()) { if (!Contents.TryGetValue(id, out value)) return null; } return Serializer.Unserialize<T>(value); } public async Task Set(Id id, T item, IProjectCursor cursor) { var bytes = item == null ? null : Serializer.Serialize(item); using (await _lock.Lock()) { Contents.Remove(id); if (item == null) return; Contents.Add(id, bytes); } } } }
Use lock for in-memory store
Use lock for in-memory store
C#
mit
VictorNicollet/SocialToolBox
63ebafe5ea10e1de7ed310ef12309e9598ae8f20
build/scripts/utilities.cake
build/scripts/utilities.cake
#tool "nuget:?package=GitVersion.CommandLine" #addin "Cake.Yaml" public class ContextInfo { public string NugetVersion { get; set; } public string AssemblyVersion { get; set; } public GitVersion Git { get; set; } public string BuildVersion { get { return NugetVersion + "-" + Git.Sha; } } } ContextInfo _versionContext = null; public ContextInfo VersionContext { get { if(_versionContext == null) throw new Exception("The current context has not been read yet. Call ReadContext(FilePath) before accessing the property."); return _versionContext; } } public ContextInfo ReadContext(FilePath filepath) { _versionContext = DeserializeYamlFromFile<ContextInfo>(filepath); _versionContext.Git = GitVersion(); return _versionContext; } public void UpdateAppVeyorBuildVersionNumber() { var increment = 0; while(increment < 10) { try { var version = VersionContext.BuildVersion; if(increment > 0) version += "-" + increment; AppVeyor.UpdateBuildVersion(version); break; } catch { increment++; } } }
#tool "nuget:?package=GitVersion.CommandLine" #addin "Cake.Yaml" public class ContextInfo { public string NugetVersion { get; set; } public string AssemblyVersion { get; set; } public GitVersion Git { get; set; } public string BuildVersion { get { return NugetVersion + "-" + Git.Sha; } } } ContextInfo _versionContext = null; public ContextInfo VersionContext { get { if(_versionContext == null) throw new Exception("The current context has not been read yet. Call ReadContext(FilePath) before accessing the property."); return _versionContext; } } public ContextInfo ReadContext(FilePath filepath) { _versionContext = DeserializeYamlFromFile<ContextInfo>(filepath); try { _versionContext.Git = GitVersion(); } catch { _versionContext.Git = new Cake.Common.Tools.GitVersion.GitVersion(); } return _versionContext; } public void UpdateAppVeyorBuildVersionNumber() { var increment = 0; while(increment < 10) { try { var version = VersionContext.BuildVersion; if(increment > 0) version += "-" + increment; AppVeyor.UpdateBuildVersion(version); break; } catch { increment++; } } }
Allow to run build even if git repo informations are not available
Allow to run build even if git repo informations are not available
C#
mit
Abc-Arbitrage/ZeroLog
27c917f4e073da6e3b1a14640ee86909ff23f886
CertiPay.ACH/Properties/AssemblyInfo.cs
CertiPay.ACH/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("CertiPay.ACH")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CertiPay.ACH")] [assembly: AssemblyCopyright("Copyright © 2015")] [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("9b9b2436-3cbc-4b6a-8c68-fc1565a21dd7")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("CertiPay.ACH")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CertiPay.ACH")] [assembly: AssemblyCopyright("Copyright © 2015")] [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("9b9b2436-3cbc-4b6a-8c68-fc1565a21dd7")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: InternalsVisibleTo("CertiPay.ACH.Tests")]
Make internals visible to the test assembly
Make internals visible to the test assembly
C#
mit
mattgwagner/CertiPay.ACH,CertiPay/CertiPay.ACH
bf298268c9828e0d4300d1fbf7effe398471ca3d
Extensions/LocationServiceExtensions.cs
Extensions/LocationServiceExtensions.cs
#if TFS2015u2 using System; using System.Diagnostics.CodeAnalysis; using Microsoft.TeamFoundation.Framework.Server; using Microsoft.VisualStudio.Services.Location; using Microsoft.VisualStudio.Services.Location.Server; namespace Aggregator.Core.Extensions { public static class LocationServiceExtensions { [SuppressMessage("Maintainability", "S1172:Unused method parameters should be removed", Justification = "Required by original interface", Scope = "member", Target = "~M:Aggregator.Core.Extensions.LocationServiceExtensions.GetSelfReferenceUri(Microsoft.VisualStudio.Services.Location.Server.ILocationService,Microsoft.TeamFoundation.Framework.Server.IVssRequestContext,Microsoft.VisualStudio.Services.Location.AccessMapping)~System.Uri")] public static Uri GetSelfReferenceUri(this ILocationService self, IVssRequestContext context, AccessMapping mapping) { string url = self.GetSelfReferenceUrl(context, self.GetDefaultAccessMapping(context)); return new Uri(url, UriKind.Absolute); } } } #endif
#if TFS2015u2 using System; using System.Diagnostics.CodeAnalysis; using Microsoft.TeamFoundation.Framework.Server; using Microsoft.VisualStudio.Services.Location; using Microsoft.VisualStudio.Services.Location.Server; namespace Aggregator.Core.Extensions { public static class LocationServiceExtensions { public static Uri GetSelfReferenceUri(this ILocationService self, IVssRequestContext context, AccessMapping mapping) { string url = self.GetSelfReferenceUrl(context, mapping); return new Uri(url, UriKind.Absolute); } } } #endif
Use th esupplied access mappign instead of looking it up a second time.
Use th esupplied access mappign instead of looking it up a second time.
C#
apache-2.0
tfsaggregator/tfsaggregator-core
48f280440c696925653ed36a6794e83f404cf637
osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerMatchFooter.cs
osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerMatchFooter.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using NUnit.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Online.Rooms; using osu.Game.Screens.OnlinePlay.Multiplayer.Match; namespace osu.Game.Tests.Visual.Multiplayer { public class TestSceneMultiplayerMatchFooter : MultiplayerTestScene { [SetUp] public new void Setup() => Schedule(() => { SelectedRoom.Value = new Room(); Child = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.X, Height = 50, Child = new MultiplayerMatchFooter() }; }); } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using NUnit.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Screens.OnlinePlay.Multiplayer.Match; namespace osu.Game.Tests.Visual.Multiplayer { public class TestSceneMultiplayerMatchFooter : MultiplayerTestScene { [SetUp] public new void Setup() => Schedule(() => { Child = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.X, Height = 50, Child = new MultiplayerMatchFooter() }; }); } }
Fix incorrect clearing of room
Fix incorrect clearing of room
C#
mit
ppy/osu,smoogipoo/osu,peppy/osu,ppy/osu,NeoAdonis/osu,smoogipoo/osu,NeoAdonis/osu,NeoAdonis/osu,ppy/osu,smoogipooo/osu,peppy/osu,smoogipoo/osu,peppy/osu
9f7c44c64ebfb23acd1bb06aa22c5bc39ad5079a
src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs
src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs
using System.Collections.Generic; using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Core.Models.Editors; using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors { /// <summary> /// Represents a media picker property editor. /// </summary> [DataEditor( Constants.PropertyEditors.Aliases.MediaPicker, EditorType.PropertyValue | EditorType.MacroParameter, "Media Picker", "mediapicker", ValueType = ValueTypes.Text, Group = Constants.PropertyEditors.Groups.Media, Icon = Constants.Icons.MediaImage)] public class MediaPickerPropertyEditor : DataEditor { /// <summary> /// Initializes a new instance of the <see cref="MediaPickerPropertyEditor"/> class. /// </summary> public MediaPickerPropertyEditor(ILogger logger) : base(logger) { } /// <inheritdoc /> protected override IConfigurationEditor CreateConfigurationEditor() => new MediaPickerConfigurationEditor(); protected override IDataValueEditor CreateValueEditor() => new MediaPickerPropertyValueEditor(Attribute); internal class MediaPickerPropertyValueEditor : DataValueEditor, IDataValueReference { public MediaPickerPropertyValueEditor(DataEditorAttribute attribute) : base(attribute) { } public IEnumerable<UmbracoEntityReference> GetReferences(object value) { var asString = value is string str ? str : value?.ToString(); if (string.IsNullOrEmpty(asString)) yield break; if (Udi.TryParse(asString, out var udi)) yield return new UmbracoEntityReference(udi); } } } }
using System.Collections.Generic; using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Core.Models.Editors; using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors { /// <summary> /// Represents a media picker property editor. /// </summary> [DataEditor( Constants.PropertyEditors.Aliases.MediaPicker, EditorType.PropertyValue | EditorType.MacroParameter, "Media Picker", "mediapicker", ValueType = ValueTypes.Text, Group = Constants.PropertyEditors.Groups.Media, Icon = Constants.Icons.MediaImage)] public class MediaPickerPropertyEditor : DataEditor { /// <summary> /// Initializes a new instance of the <see cref="MediaPickerPropertyEditor"/> class. /// </summary> public MediaPickerPropertyEditor(ILogger logger) : base(logger) { } /// <inheritdoc /> protected override IConfigurationEditor CreateConfigurationEditor() => new MediaPickerConfigurationEditor(); protected override IDataValueEditor CreateValueEditor() => new MediaPickerPropertyValueEditor(Attribute); internal class MediaPickerPropertyValueEditor : DataValueEditor, IDataValueReference { public MediaPickerPropertyValueEditor(DataEditorAttribute attribute) : base(attribute) { } public IEnumerable<UmbracoEntityReference> GetReferences(object value) { var asString = value is string str ? str : value?.ToString(); if (string.IsNullOrEmpty(asString)) yield break; foreach (var udiStr in asString.Split(',')) { if (Udi.TryParse(udiStr, out var udi)) yield return new UmbracoEntityReference(udi); } } } } }
Handle for multiple picked media relations
7879: Handle for multiple picked media relations
C#
mit
hfloyd/Umbraco-CMS,madsoulswe/Umbraco-CMS,bjarnef/Umbraco-CMS,marcemarc/Umbraco-CMS,dawoe/Umbraco-CMS,dawoe/Umbraco-CMS,tcmorris/Umbraco-CMS,leekelleher/Umbraco-CMS,leekelleher/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,bjarnef/Umbraco-CMS,abjerner/Umbraco-CMS,mattbrailsford/Umbraco-CMS,abjerner/Umbraco-CMS,tcmorris/Umbraco-CMS,robertjf/Umbraco-CMS,hfloyd/Umbraco-CMS,leekelleher/Umbraco-CMS,arknu/Umbraco-CMS,NikRimington/Umbraco-CMS,arknu/Umbraco-CMS,tcmorris/Umbraco-CMS,madsoulswe/Umbraco-CMS,abryukhov/Umbraco-CMS,tcmorris/Umbraco-CMS,abjerner/Umbraco-CMS,mattbrailsford/Umbraco-CMS,abryukhov/Umbraco-CMS,KevinJump/Umbraco-CMS,tcmorris/Umbraco-CMS,leekelleher/Umbraco-CMS,hfloyd/Umbraco-CMS,robertjf/Umbraco-CMS,dawoe/Umbraco-CMS,KevinJump/Umbraco-CMS,marcemarc/Umbraco-CMS,hfloyd/Umbraco-CMS,arknu/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,marcemarc/Umbraco-CMS,umbraco/Umbraco-CMS,bjarnef/Umbraco-CMS,abryukhov/Umbraco-CMS,mattbrailsford/Umbraco-CMS,umbraco/Umbraco-CMS,umbraco/Umbraco-CMS,leekelleher/Umbraco-CMS,NikRimington/Umbraco-CMS,mattbrailsford/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,marcemarc/Umbraco-CMS,abryukhov/Umbraco-CMS,marcemarc/Umbraco-CMS,arknu/Umbraco-CMS,tcmorris/Umbraco-CMS,madsoulswe/Umbraco-CMS,NikRimington/Umbraco-CMS,robertjf/Umbraco-CMS,abjerner/Umbraco-CMS,bjarnef/Umbraco-CMS,dawoe/Umbraco-CMS,KevinJump/Umbraco-CMS,robertjf/Umbraco-CMS,hfloyd/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,KevinJump/Umbraco-CMS,KevinJump/Umbraco-CMS,robertjf/Umbraco-CMS,dawoe/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,umbraco/Umbraco-CMS
c142036fd0255fa7a43c9722be5b99d1be5bd5ea
src/Phone/ArcGISRuntimeSDKDotNet_PhoneSamples/Samples/Mapping/OverviewMap.xaml.cs
src/Phone/ArcGISRuntimeSDKDotNet_PhoneSamples/Samples/Mapping/OverviewMap.xaml.cs
using Esri.ArcGISRuntime; using Esri.ArcGISRuntime.Controls; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Layers; using System.Linq; using Windows.UI.Xaml.Controls; namespace ArcGISRuntimeSDKDotNet_StoreSamples.Samples { /// <summary> /// /// </summary> /// <category>Mapping</category> public sealed partial class OverviewMap : Page { public OverviewMap() { this.InitializeComponent(); mapView1.Map.InitialViewpoint = new Viewpoint(new Envelope(-5, 20, 50, 65, SpatialReferences.Wgs84)); } private void mapView1_ExtentChanged(object sender, System.EventArgs e) { var graphicslayer = overviewMap.Map.Layers.OfType<GraphicsLayer>().FirstOrDefault(); Graphic g = graphicslayer.Graphics.FirstOrDefault(); if (g == null) //first time { g = new Graphic(); graphicslayer.Graphics.Add(g); } g.Geometry = mapView1.Extent; } } }
using Esri.ArcGISRuntime; using Esri.ArcGISRuntime.Controls; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Layers; using System.Linq; using Windows.UI.Xaml.Controls; namespace ArcGISRuntimeSDKDotNet_StoreSamples.Samples { /// <summary> /// /// </summary> /// <category>Mapping</category> public sealed partial class OverviewMap : Page { public OverviewMap() { this.InitializeComponent(); mapView1.Map.InitialViewpoint = new Viewpoint(new Envelope(-5, 20, 50, 65, SpatialReferences.Wgs84)); } private async void mapView1_ExtentChanged(object sender, System.EventArgs e) { var graphicslayer = overviewMap.Map.Layers.OfType<GraphicsLayer>().FirstOrDefault(); Graphic g = graphicslayer.Graphics.FirstOrDefault(); if (g == null) //first time { g = new Graphic(); graphicslayer.Graphics.Add(g); } g.Geometry = mapView1.Extent; // Adjust overview map scale await overviewMap.SetViewAsync(mapView1.Extent.GetCenter(), mapView1.Scale * 15); } } }
Adjust the MapOverView map scale
Adjust the MapOverView map scale
C#
apache-2.0
Esri/arcgis-runtime-samples-dotnet,Esri/arcgis-runtime-samples-dotnet,Tyshark9/arcgis-runtime-samples-dotnet,AkshayHarshe/arcgis-runtime-samples-dotnet,sharifulgeo/arcgis-runtime-samples-dotnet,Arc3D/arcgis-runtime-samples-dotnet,Esri/arcgis-runtime-samples-dotnet
0319177c5c10b8eff6f71f202005a676731b3c3b
osu.Game/Screens/Edit/Setup/SetupScreen.cs
osu.Game/Screens/Edit/Setup/SetupScreen.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.Containers; namespace osu.Game.Screens.Edit.Setup { public class SetupScreen : EditorRoundedScreen { [Cached] private SectionsContainer<SetupSection> sections = new SectionsContainer<SetupSection>(); [Cached] private SetupScreenHeader header = new SetupScreenHeader(); public SetupScreen() : base(EditorScreenMode.SongSetup) { } [BackgroundDependencyLoader] private void load() { AddRange(new Drawable[] { sections = new SectionsContainer<SetupSection> { FixedHeader = header, RelativeSizeAxes = Axes.Both, Children = new SetupSection[] { new ResourcesSection(), new MetadataSection(), new DifficultySection(), new ColoursSection(), new DesignSection(), } }, }); } } }
// 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.Containers; namespace osu.Game.Screens.Edit.Setup { public class SetupScreen : EditorRoundedScreen { [Cached] private SectionsContainer<SetupSection> sections = new SectionsContainer<SetupSection>(); [Cached] private SetupScreenHeader header = new SetupScreenHeader(); public SetupScreen() : base(EditorScreenMode.SongSetup) { } [BackgroundDependencyLoader] private void load() { AddRange(new Drawable[] { sections = new SetupScreenSectionsContainer { FixedHeader = header, RelativeSizeAxes = Axes.Both, Children = new SetupSection[] { new ResourcesSection(), new MetadataSection(), new DifficultySection(), new ColoursSection(), new DesignSection(), } }, }); } private class SetupScreenSectionsContainer : SectionsContainer<SetupSection> { protected override UserTrackingScrollContainer CreateScrollContainer() { var scrollContainer = base.CreateScrollContainer(); // Workaround for masking issues (see https://github.com/ppy/osu-framework/issues/1675#issuecomment-910023157) // Note that this actually causes the full scroll range to be reduced by 2px at the bottom, but it's not really noticeable. scrollContainer.Margin = new MarginPadding { Top = 2 }; return scrollContainer; } } } }
Fix pixels poking out of the top edge of editor setup screen
Fix pixels poking out of the top edge of editor setup screen
C#
mit
ppy/osu,peppy/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu-new,ppy/osu,NeoAdonis/osu,NeoAdonis/osu,peppy/osu,peppy/osu,smoogipooo/osu,ppy/osu,smoogipoo/osu,smoogipoo/osu
f77f4bd4b2d5e44c28ce27a838d64134783614e8
MitternachtWeb/Program.cs
MitternachtWeb/Program.cs
using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; using Mitternacht; using System.Threading.Tasks; namespace MitternachtWeb { public class Program { public static async Task Main(string[] args) { await new MitternachtBot(0, 0).RunAsync(args); await CreateHostBuilder(args).Build().RunAsync(); } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup<Startup>()); } }
using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; using Mitternacht; using System.Threading.Tasks; namespace MitternachtWeb { public class Program { public static MitternachtBot MitternachtBot; public static async Task Main(string[] args) { MitternachtBot = new MitternachtBot(0, 0); await MitternachtBot.RunAsync(args); await CreateHostBuilder(args).Build().RunAsync(); } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup<Startup>()); } }
Move MitternachtBot instance to a static variable.
Move MitternachtBot instance to a static variable.
C#
mit
Midnight-Myth/Mitternacht-NEW,Midnight-Myth/Mitternacht-NEW,Midnight-Myth/Mitternacht-NEW,Midnight-Myth/Mitternacht-NEW
e39088739044674aa3c03ed1eb2d2baea95e2c79
Assets/Scripts/HarryPotterUnity/Cards/Quidditch/Items/BluebottleBroom.cs
Assets/Scripts/HarryPotterUnity/Cards/Quidditch/Items/BluebottleBroom.cs
using HarryPotterUnity.Cards.BasicBehavior; using JetBrains.Annotations; namespace HarryPotterUnity.Cards.Quidditch.Items { [UsedImplicitly] public class BluebottleBroom : ItemLessonProvider { public override void OnSelectedAction() { var card = Player.Discard.GetHealableCards(1); Player.Discard.RemoveAll(card); Player.Deck.AddAll(card); Player.UseActions(); } } }
using HarryPotterUnity.Cards.BasicBehavior; using JetBrains.Annotations; namespace HarryPotterUnity.Cards.Quidditch.Items { [UsedImplicitly] public class BluebottleBroom : ItemLessonProvider { public override void OnSelectedAction() { var card = Player.Discard.GetHealableCards(1); Player.Discard.RemoveAll(card); Player.Deck.AddAll(card); Player.UseActions(); } public override bool CanPerformInPlayAction() { return Player.CanUseActions(); } } }
Add CanPerformAction condition to bluebottle broom
Add CanPerformAction condition to bluebottle broom
C#
mit
StefanoFiumara/Harry-Potter-Unity
318a43f433f156f0cc1ed3e95b65e2c4066cab5a
tests/Firestorm.Tests.Examples.Football/Tests/FootballTestFixture.cs
tests/Firestorm.Tests.Examples.Football/Tests/FootballTestFixture.cs
using System; using System.IO; using System.Net.Http; using Firestorm.Tests.Examples.Football.Web; using Microsoft.AspNetCore.Hosting; namespace Firestorm.Tests.Examples.Football.Tests { public class FootballTestFixture : IDisposable { private readonly IWebHost _host; public HttpClient HttpClient { get; } public FootballTestFixture() { var url = "http://localhost:1337"; _host = new WebHostBuilder() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) //.UseIISIntegration() .UseStartup<Startup>() .UseUrls(url) .Build(); HttpClient = new HttpClient { BaseAddress = new Uri(url) }; _host.Start(); } public void Dispose() { _host.Dispose(); HttpClient.Dispose(); } } }
using System; using System.IO; using System.Net.Http; using Firestorm.Tests.Examples.Football.Web; using Microsoft.AspNetCore.Hosting; namespace Firestorm.Tests.Examples.Football.Tests { public class FootballTestFixture : IDisposable { private static int _startPort = 3000; private readonly IWebHost _host; public HttpClient HttpClient { get; } public FootballTestFixture() { var url = "http://localhost:" + _startPort++; _host = new WebHostBuilder() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) //.UseIISIntegration() .UseStartup<Startup>() .UseUrls(url) .Build(); HttpClient = new HttpClient { BaseAddress = new Uri(url) }; _host.Start(); } public void Dispose() { _host.Dispose(); HttpClient.Dispose(); } } }
Test fixture uses incrementing ports to avoid conflicts
Test fixture uses incrementing ports to avoid conflicts
C#
mit
connellw/Firestorm
07e975a0ed5d7d8bd3f5cd83d54d1d59a12d7e62
src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonSerializerSettingsProvider.cs
src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonSerializerSettingsProvider.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 Newtonsoft.Json; using Newtonsoft.Json.Serialization; namespace Microsoft.AspNetCore.Mvc.Formatters { /// <summary> /// Helper class which provides <see cref="JsonSerializerSettings"/>. /// </summary> public static class JsonSerializerSettingsProvider { private const int DefaultMaxDepth = 32; /// <summary> /// Creates default <see cref="JsonSerializerSettings"/>. /// </summary> /// <returns>Default <see cref="JsonSerializerSettings"/>.</returns> public static JsonSerializerSettings CreateSerializerSettings() { return new JsonSerializerSettings { ContractResolver = new DefaultContractResolver { NamingStrategy = new CamelCaseNamingStrategy(), }, MissingMemberHandling = MissingMemberHandling.Ignore, // Limit the object graph we'll consume to a fixed depth. This prevents stackoverflow exceptions // from deserialization errors that might occur from deeply nested objects. MaxDepth = DefaultMaxDepth, // Do not change this setting // Setting this to None prevents Json.NET from loading malicious, unsafe, or security-sensitive types TypeNameHandling = TypeNameHandling.None, }; } } }
// 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 Newtonsoft.Json; using Newtonsoft.Json.Serialization; namespace Microsoft.AspNetCore.Mvc.Formatters { /// <summary> /// Helper class which provides <see cref="JsonSerializerSettings"/>. /// </summary> public static class JsonSerializerSettingsProvider { private const int DefaultMaxDepth = 32; // return shared resolver by default for perf so slow reflection logic is cached once // developers can set their own resolver after the settings are returned if desired private static readonly DefaultContractResolver SharedContractResolver = new DefaultContractResolver { NamingStrategy = new CamelCaseNamingStrategy(), }; /// <summary> /// Creates default <see cref="JsonSerializerSettings"/>. /// </summary> /// <returns>Default <see cref="JsonSerializerSettings"/>.</returns> public static JsonSerializerSettings CreateSerializerSettings() { return new JsonSerializerSettings { ContractResolver = SharedContractResolver, MissingMemberHandling = MissingMemberHandling.Ignore, // Limit the object graph we'll consume to a fixed depth. This prevents stackoverflow exceptions // from deserialization errors that might occur from deeply nested objects. MaxDepth = DefaultMaxDepth, // Do not change this setting // Setting this to None prevents Json.NET from loading malicious, unsafe, or security-sensitive types TypeNameHandling = TypeNameHandling.None, }; } } }
Return a shared contract resolver
Return a shared contract resolver Return a shared contract resolver from CreateSerializerSettings for performance
C#
apache-2.0
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
fd0bd93f5897d3e4d2151d0d1657bc4821132e94
src/Nest/CommonAbstractions/Infer/TypeName/TypeNameFormatter.cs
src/Nest/CommonAbstractions/Infer/TypeName/TypeNameFormatter.cs
using Utf8Json; namespace Nest { internal class TypeNameFormatter : IJsonFormatter<TypeName> { public TypeName Deserialize(ref JsonReader reader, IJsonFormatterResolver formatterResolver) { if (reader.GetCurrentJsonToken() == JsonToken.String) { TypeName typeName = reader.ReadString(); return typeName; } return null; } public void Serialize(ref JsonWriter writer, TypeName value, IJsonFormatterResolver formatterResolver) { if (value == null) { writer.WriteNull(); return; } var settings = formatterResolver.GetConnectionSettings(); var typeName = settings.Inferrer.TypeName(value); writer.WriteString(typeName); } } }
using Utf8Json; namespace Nest { internal class TypeNameFormatter : IJsonFormatter<TypeName>, IObjectPropertyNameFormatter<TypeName> { public TypeName Deserialize(ref JsonReader reader, IJsonFormatterResolver formatterResolver) { if (reader.GetCurrentJsonToken() == JsonToken.String) { TypeName typeName = reader.ReadString(); return typeName; } reader.ReadNextBlock(); return null; } public void Serialize(ref JsonWriter writer, TypeName value, IJsonFormatterResolver formatterResolver) { if (value == null) { writer.WriteNull(); return; } var settings = formatterResolver.GetConnectionSettings(); var typeName = settings.Inferrer.TypeName(value); writer.WriteString(typeName); } public void SerializeToPropertyName(ref JsonWriter writer, TypeName value, IJsonFormatterResolver formatterResolver) => Serialize(ref writer, value, formatterResolver); public TypeName DeserializeFromPropertyName(ref JsonReader reader, IJsonFormatterResolver formatterResolver) => Deserialize(ref reader, formatterResolver); } }
Allow TypeName to be used as Dictionary key
Allow TypeName to be used as Dictionary key
C#
apache-2.0
elastic/elasticsearch-net,elastic/elasticsearch-net
39116f9b2f8ed2d3c76a57b8226b264ac556df6e
Tests/IntegrationTests.cs
Tests/IntegrationTests.cs
namespace Tests { using System; using System.IO; using System.Reflection; using System.Xml.Linq; using JetBrains.Annotations; using Tests.Properties; using Xunit; public class IntegrationTests { [NotNull] private readonly Assembly _assembly; public IntegrationTests() { var thisFolder = Path.GetDirectoryName(GetType().Assembly.Location); _assembly = Assembly.LoadFrom(Path.Combine(thisFolder, "AssemblyToProcess.dll")); } [Fact] public void CanCreateClass() { var type = _assembly.GetType("AssemblyToProcess.SimpleClass"); // ReSharper disable once AssignNullToNotNullAttribute Activator.CreateInstance(type); } [Fact] public void ReferenceIsRemoved() { // ReSharper disable once PossibleNullReferenceException Assert.DoesNotContain(_assembly.GetReferencedAssemblies(), x => x.Name == "JetBrains.Annotations"); } [Fact] public void AreExternalAnnotationsCorrect() { var annotations = XDocument.Load(Path.ChangeExtension(_assembly.Location, ".ExternalAnnotations.xml")).ToString(); Assert.Equal(Resources.ExpectedAnnotations, annotations); } [Fact] public void IsDocumentationProperlyDecorated() { var _documentation = XDocument.Load(Path.ChangeExtension(_assembly.Location, ".xml")).ToString(); Assert.Equal(Resources.ExpectedDocumentation, _documentation); } } }
namespace Tests { using System; using System.IO; using System.Reflection; using System.Xml.Linq; using JetBrains.Annotations; using Tests.Properties; using Xunit; public class IntegrationTests { [NotNull] private readonly string _targetFolder = AppDomain.CurrentDomain.BaseDirectory; [NotNull] private readonly Assembly _assembly; public IntegrationTests() { _assembly = Assembly.LoadFrom(Path.Combine(_targetFolder, "AssemblyToProcess.dll")); } [Fact] public void CanCreateClass() { var type = _assembly.GetType("AssemblyToProcess.SimpleClass"); // ReSharper disable once AssignNullToNotNullAttribute Activator.CreateInstance(type); } [Fact] public void ReferenceIsRemoved() { // ReSharper disable once PossibleNullReferenceException Assert.DoesNotContain(_assembly.GetReferencedAssemblies(), x => x.Name == "JetBrains.Annotations"); } [Fact] public void AreExternalAnnotationsCorrect() { var annotations = XDocument.Load(Path.ChangeExtension(_targetFolder, ".ExternalAnnotations.xml")).ToString(); Assert.Equal(Resources.ExpectedAnnotations, annotations); } [Fact] public void IsDocumentationProperlyDecorated() { var _documentation = XDocument.Load(Path.ChangeExtension(_targetFolder, ".xml")).ToString(); Assert.Equal(Resources.ExpectedDocumentation, _documentation); } } }
Fix file location for build server
Fix file location for build server
C#
mit
Fody/JetBrainsAnnotations
2e1b56e1dc17256f81332a39ae79b39b2410e753
Talks.CodeToDiFor.Solution/Talks.C2DF.Web/Controllers/HomeController.cs
Talks.CodeToDiFor.Solution/Talks.C2DF.Web/Controllers/HomeController.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Talks.C2DF.Interfaces; namespace Talks.C2DF.Web.Controllers { public class HomeController: Controller { //ICostCalculator calculator; //public HomeController(ICostCalculator calculator) //{ // this.calculator = calculator; //} ISendingMicroApp sendingApp; public HomeController(ISendingMicroApp sendingApp) { this.sendingApp = sendingApp; } public ActionResult Index() { var result = sendingApp.Send("Hello World!!!DEAL"); return View(); } public ActionResult About() { ViewBag.Message = "Your application description page."; return View(); } public ActionResult Contact() { ViewBag.Message = "Your contact page."; return View(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Talks.C2DF.BetterApp.Lib.Logging; using Talks.C2DF.Interfaces; namespace Talks.C2DF.Web.Controllers { public class HomeController: Controller { ISendingMicroApp sendingApp; IAppLogger _logger; public HomeController(ISendingMicroApp sendingApp, IAppLogger logger) { this.sendingApp = sendingApp; _logger = logger; } public ActionResult Index() { _logger.Debug("Sending Message from MVC App"); var result = sendingApp.Send("Hello World!!!DEAL"); _logger.Debug($"Result: {result.ResultMessage} -- Price: {result.Price} -- Message: {result.Message} "); return View(); } public ActionResult About() { ViewBag.Message = "Your application description page."; return View(); } public ActionResult Contact() { ViewBag.Message = "Your contact page."; return View(); } } }
Update Home Controller to send message - and log it
Update Home Controller to send message - and log it
C#
mit
calebjenkins/Talks.CodeToDiFor,calebjenkins/Talks.CodeToDiFor,calebjenkins/Talks.CodeToDiFor
e274e1046e233979ef68149df4d6498fdadf573a
WalletWasabi.Gui/Controls/WalletExplorer/TransactionInfoTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/TransactionInfoTabViewModel.cs
using WalletWasabi.Gui.Controls.TransactionDetails.ViewModels; using WalletWasabi.Gui.ViewModels; namespace WalletWasabi.Gui.Controls.WalletExplorer { public class TransactionInfoTabViewModel : WasabiDocumentTabViewModel { public TransactionInfoTabViewModel(TransactionDetailsViewModel transaction) : base("") { Transaction = transaction; Title = $"Transaction ({transaction.TransactionId[0..10]}) Details"; } public TransactionDetailsViewModel Transaction { get; } } }
using System; using System.Reactive.Disposables; using System.Reactive.Linq; using ReactiveUI; using Splat; using WalletWasabi.Gui.Controls.TransactionDetails.ViewModels; using WalletWasabi.Gui.ViewModels; namespace WalletWasabi.Gui.Controls.WalletExplorer { public class TransactionInfoTabViewModel : WasabiDocumentTabViewModel { public TransactionInfoTabViewModel(TransactionDetailsViewModel transaction) : base("") { Global = Locator.Current.GetService<Global>(); Transaction = transaction; Title = $"Transaction ({transaction.TransactionId[0..10]}) Details"; } public override void OnOpen(CompositeDisposable disposables) { Global.UiConfig.WhenAnyValue(x => x.LurkingWifeMode) .ObserveOn(RxApp.MainThreadScheduler) .Subscribe(x => Transaction.RaisePropertyChanged(nameof(Transaction.TransactionId))) .DisposeWith(disposables); base.OnOpen(disposables); } protected Global Global { get; } public TransactionDetailsViewModel Transaction { get; } } }
Fix lurking wife mode on transaction id in details
Fix lurking wife mode on transaction id in details
C#
mit
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
c96bc6012d42264b2e82733b945718322bb44400
resharper/resharper-yaml/test/src/UnityTestsSpecificYamlFileExtensionMapping.cs
resharper/resharper-yaml/test/src/UnityTestsSpecificYamlFileExtensionMapping.cs
using System; using System.Collections.Generic; using JetBrains.Application; using JetBrains.DataFlow; using JetBrains.Lifetimes; using JetBrains.ProjectModel; using JetBrains.ReSharper.Plugins.Yaml.ProjectModel; using JetBrains.Util; namespace JetBrains.ReSharper.Plugins.Yaml.Tests { [ShellComponent] public class UnityTestsSpecificYamlFileExtensionMapping : IFileExtensionMapping { private static readonly string[] ourFileExtensions = { #if RIDER // Rider doesn't register .yaml, as the frontend already provides support for it. But we need it for tests... ".yaml", #endif ".meta", ".asset", ".unity" }; public UnityTestsSpecificYamlFileExtensionMapping(Lifetime lifetime) { Changed = new SimpleSignal(lifetime, GetType().Name + "::Changed"); } public IEnumerable<ProjectFileType> GetFileTypes(string extension) { if (ourFileExtensions.Contains(extension, StringComparer.InvariantCultureIgnoreCase)) return new[] {YamlProjectFileType.Instance}; return EmptyList<ProjectFileType>.Enumerable; } public IEnumerable<string> GetExtensions(ProjectFileType projectFileType) { if (Equals(projectFileType, YamlProjectFileType.Instance)) return ourFileExtensions; return EmptyList<string>.Enumerable; } public ISimpleSignal Changed { get; } } }
using System; using System.Collections.Generic; using JetBrains.Application; using JetBrains.Lifetimes; using JetBrains.ProjectModel; using JetBrains.ReSharper.Plugins.Yaml.ProjectModel; using JetBrains.Util; namespace JetBrains.ReSharper.Plugins.Yaml.Tests { [ShellComponent] public class UnityTestsSpecificYamlFileExtensionMapping : FileTypeDefinitionExtensionMapping { private static readonly string[] ourFileExtensions = { #if RIDER // Rider doesn't register .yaml, as the frontend already provides support for it. But we need it for tests... ".yaml", #endif ".meta", ".asset", ".unity" }; public UnityTestsSpecificYamlFileExtensionMapping(Lifetime lifetime, IProjectFileTypes fileTypes) : base(lifetime, fileTypes) { } public override IEnumerable<ProjectFileType> GetFileTypes(string extension) { if (ourFileExtensions.Contains(extension, StringComparer.InvariantCultureIgnoreCase)) return new[] {YamlProjectFileType.Instance}; return EmptyList<ProjectFileType>.Enumerable; } public override IEnumerable<string> GetExtensions(ProjectFileType projectFileType) { if (Equals(projectFileType, YamlProjectFileType.Instance)) return ourFileExtensions; return base.GetExtensions(projectFileType); } } }
Fix breaking change in SDK
Fix breaking change in SDK
C#
apache-2.0
JetBrains/resharper-unity,JetBrains/resharper-unity,JetBrains/resharper-unity
899d5d95efd9b4735506d6cf73d5eff340f9946f
MultiMiner.Xgminer.Api/Parsers/VersionInformationParser.cs
MultiMiner.Xgminer.Api/Parsers/VersionInformationParser.cs
using System; using System.Collections.Generic; using System.Linq; namespace MultiMiner.Xgminer.Api.Parsers { class VersionInformationParser : ResponseTextParser { public static void ParseTextForVersionInformation(string text, MultiMiner.Xgminer.Api.Data.VersionInformation versionInformation) { List<string> responseParts = text.Split('|').ToList(); Dictionary<string, string> keyValuePairs = GetDictionaryFromTextChunk(responseParts[0]); versionInformation.Name = keyValuePairs["Msg"].Replace(" versions", String.Empty); versionInformation.Description = keyValuePairs["Description"]; keyValuePairs = GetDictionaryFromTextChunk(responseParts[1]); versionInformation.MinerVersion = keyValuePairs["CGMiner"]; versionInformation.ApiVersion = keyValuePairs["API"]; } } }
using System; using System.Collections.Generic; using System.Linq; namespace MultiMiner.Xgminer.Api.Parsers { class VersionInformationParser : ResponseTextParser { public static void ParseTextForVersionInformation(string text, MultiMiner.Xgminer.Api.Data.VersionInformation versionInformation) { List<string> responseParts = text.Split('|').ToList(); Dictionary<string, string> keyValuePairs = GetDictionaryFromTextChunk(responseParts[0]); versionInformation.Name = keyValuePairs["Msg"].Replace(" versions", String.Empty); versionInformation.Description = keyValuePairs["Description"]; keyValuePairs = GetDictionaryFromTextChunk(responseParts[1]); string key = "CGMiner"; if (keyValuePairs.ContainsKey(key)) versionInformation.MinerVersion = keyValuePairs[key]; else { // SGMiner 4.0 broke compatibility with the CGMiner RPC API // Version 5.0 fixed the issue - this work-around is for 4.0 // Request :"version" // Response:"STATUS=S,When=1415068731,Code=22,Msg=SGMiner versions,Description=sgminer 4.1.0|VERSION,SGMiner=4.1.0,API=3.1|\u0000" key = "SGMiner"; if (keyValuePairs.ContainsKey(key)) versionInformation.MinerVersion = keyValuePairs[key]; } versionInformation.ApiVersion = keyValuePairs["API"]; } } }
Work around incomatibility in SGMiner 4.0 with the CGMiner RPC API
Work around incomatibility in SGMiner 4.0 with the CGMiner RPC API
C#
mit
IWBWbiz/MultiMiner,nwoolls/MultiMiner,IWBWbiz/MultiMiner,nwoolls/MultiMiner
80995230032f34666df436d788291fa9d59bf2fc
src/Setup/DeviceHive.Setup.Actions/Validation/SqlDatabaseValidator.cs
src/Setup/DeviceHive.Setup.Actions/Validation/SqlDatabaseValidator.cs
using System; using System.Data; using System.Data.SqlClient; using Microsoft.SqlServer.Server; namespace DeviceHive.Setup.Actions { class SqlDatabaseValidator { private SqlConnection _connection; public SqlDatabaseValidator(SqlConnection connection) { if (connection == null) throw new ArgumentNullException("connection"); _connection = connection; } public void Validate(string databaseName) { if (databaseName == null) throw new ArgumentNullException("databaseName"); string sqlCommand = string.Format("SELECT CASE WHEN db_id('{0}') is null THEN 0 ELSE 1 END", databaseName); IDbCommand command = new SqlCommand(sqlCommand, _connection); if (!Convert.ToBoolean(command.ExecuteScalar())) throw new Exception(string.Format("Database '{0}' does not exist. Please enter a correct database name.", databaseName)); } } }
using System; using System.Data; using System.Data.SqlClient; using Microsoft.SqlServer.Server; namespace DeviceHive.Setup.Actions { class SqlDatabaseValidator { private SqlConnection _connection; public SqlDatabaseValidator(SqlConnection connection) { if (connection == null) throw new ArgumentNullException("connection"); _connection = connection; } public void Validate(string databaseName) { if (string.IsNullOrEmpty(databaseName)) throw new ArgumentNullException("databaseName"); string sqlCommand = string.Format("SELECT CASE WHEN db_id('{0}') is null THEN 0 ELSE 1 END", databaseName); IDbCommand command = new SqlCommand(sqlCommand, _connection); if (!Convert.ToBoolean(command.ExecuteScalar())) throw new Exception(string.Format("Database '{0}' does not exist. Please enter a correct database name.", databaseName)); } } }
Check database name input parameter
Check database name input parameter
C#
mit
devicehive/devicehive-.net,devicehive/devicehive-.net,devicehive/devicehive-.net
4e4435223a3c779bfabe3f633d0bc99f0573aa81
tools/docfixer/docfixer.mt.cs
tools/docfixer/docfixer.mt.cs
// // MonoTouch defines for docfixer // using System; using System.IO; using System.Reflection; using MonoTouch.Foundation; public partial class DocGenerator { static Assembly assembly = typeof (MonoTouch.Foundation.NSObject).Assembly; const string BaseNamespace = "MonoTouch"; static string GetMostRecentDocBase () { var versions = new[]{"4_0", "3_2", "3_1"}; string format = "/Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiPhone{0}.iPhoneLibrary.docset/Contents/Resources/Documents/documentation"; foreach (var v in versions) { var d = string.Format (format, v); if (Directory.Exists (d)) { return d; break; } } return null; } public static string GetSelector (object attr) { return ((ExportAttribute) attr).Selector; } }
// // MonoTouch defines for docfixer // using System; using System.IO; using System.Reflection; using MonoTouch.Foundation; public partial class DocGenerator { static Assembly assembly = typeof (MonoTouch.Foundation.NSObject).Assembly; const string BaseNamespace = "MonoTouch"; static string GetMostRecentDocBase () { //var versions = new[]{"4_0", "3_2", "3_1"}; //string format = "/Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiPhone{0}.iPhoneLibrary.docset/Contents/Resources/Documents/documentation"; var versions = new [] { "5_0" }; string format = "/Library/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiOS{0}.iOSLibrary.docset/Contents/Resources/Documents/documentation"; foreach (var v in versions) { var d = string.Format (format, v); if (Directory.Exists (d)) { return d; break; } } return null; } public static string GetSelector (object attr) { return ((ExportAttribute) attr).Selector; } }
Fix docfixed to work with iOS5
Fix docfixed to work with iOS5
C#
apache-2.0
mono/maccore,cwensley/maccore,jorik041/maccore
d905719be4745baa4d434a88ed75a26db0f49aa5
Src/XmlDocInspections.Plugin.Tests/Integrative/AddDocCommentFixTest.cs
Src/XmlDocInspections.Plugin.Tests/Integrative/AddDocCommentFixTest.cs
using JetBrains.ReSharper.FeaturesTestFramework.Intentions; using JetBrains.ReSharper.Intentions.CSharp.QuickFixes; using JetBrains.ReSharper.TestFramework; using NUnit.Framework; namespace XmlDocInspections.Plugin.Tests.Integrative { [TestFixture] [TestNetFramework4] public class AddDocCommentFixTest : CSharpQuickFixTestBase<AddDocCommentFix> { protected override string RelativeTestDataPath => @"QuickFixes\AddDocCommentFix"; [Test] public void TestClass() { DoNamedTest2(); } [Test] public void TestSimpleMethod() { DoNamedTest2(); } [Test] public void TestMethodWithAdditionalElementsForDocTemplate() { DoNamedTest2(); } [Test] public void TestField() { DoNamedTest2(); } [Test] public void TestProperty() { DoNamedTest2(); } } }
using JetBrains.ReSharper.FeaturesTestFramework.Intentions; using JetBrains.ReSharper.Intentions.CSharp.QuickFixes; using JetBrains.ReSharper.TestFramework; using NUnit.Framework; namespace XmlDocInspections.Plugin.Tests.Integrative { [TestFixture] [TestNetFramework4] public class AddDocCommentFixTest : CSharpQuickFixTestBase<AddDocCommentFix> { protected override string RelativeTestDataPath => @"QuickFixes\AddDocCommentFix"; [Test] public void TestClass() => DoNamedTest2(); [Test] public void TestSimpleMethod() => DoNamedTest2(); [Test] public void TestMethodWithAdditionalElementsForDocTemplate() => DoNamedTest2(); [Test] public void TestField() => DoNamedTest2(); [Test] public void TestProperty() => DoNamedTest2(); } }
Refactor to expr. bodied members
Refactor to expr. bodied members
C#
mit
ulrichb/XmlDocInspections,ulrichb/XmlDocInspections,ulrichb/XmlDocInspections
639fc9d10f760508702e21b51628a84b45398e6b
src/SFA.DAS.EmployerApprenticeshipsService.Infrastructure/Data/UserRepository.cs
src/SFA.DAS.EmployerApprenticeshipsService.Infrastructure/Data/UserRepository.cs
using System; using System.Data; using System.Data.Entity; using System.Linq; using System.Threading.Tasks; using Dapper; using SFA.DAS.EAS.Domain.Configuration; using SFA.DAS.EAS.Domain.Data.Repositories; using SFA.DAS.EAS.Domain.Models.UserProfile; using SFA.DAS.Sql.Client; using SFA.DAS.NLog.Logger; namespace SFA.DAS.EAS.Infrastructure.Data { public class UserRepository : BaseRepository, IUserRepository { private readonly Lazy<EmployerAccountsDbContext> _db; public UserRepository(EmployerApprenticeshipsServiceConfiguration configuration, ILog logger, Lazy<EmployerAccountsDbContext> db) : base(configuration.DatabaseConnectionString, logger) { _db = db; } public Task Upsert(User user) { return WithConnection(c => { var parameters = new DynamicParameters(); parameters.Add("@email", user.Email, DbType.String); parameters.Add("@userRef", new Guid(user.UserRef), DbType.Guid); parameters.Add("@firstName", user.FirstName, DbType.String); parameters.Add("@lastName", user.LastName, DbType.String); return c.ExecuteAsync( sql: "[employer_account].[UpsertUser] @userRef, @email, @firstName, @lastName", param: parameters, commandType: CommandType.Text); }); } } }
using System; using System.Data; using System.Data.Entity; using System.Linq; using System.Threading.Tasks; using Dapper; using SFA.DAS.EAS.Domain.Configuration; using SFA.DAS.EAS.Domain.Data.Repositories; using SFA.DAS.EAS.Domain.Models.UserProfile; using SFA.DAS.Sql.Client; using SFA.DAS.NLog.Logger; namespace SFA.DAS.EAS.Infrastructure.Data { public class UserRepository : BaseRepository, IUserRepository { private readonly Lazy<EmployerAccountsDbContext> _db; public UserRepository(EmployerApprenticeshipsServiceConfiguration configuration, ILog logger, Lazy<EmployerAccountsDbContext> db) : base(configuration.DatabaseConnectionString, logger) { _db = db; } public Task Upsert(User user) { return WithConnection(c => { var parameters = new DynamicParameters(); parameters.Add("@email", user.Email, DbType.String); parameters.Add("@userRef", new Guid(user.UserRef), DbType.Guid); parameters.Add("@firstName", user.FirstName, DbType.String); parameters.Add("@lastName", user.LastName, DbType.String); parameters.Add("@correlationId", null, DbType.String); return c.ExecuteAsync( sql: "[employer_account].[UpsertUser] @userRef, @email, @firstName, @lastName, @correlationId", param: parameters, commandType: CommandType.Text); }); } } }
Add correlationId to fix startup of the EAS web application. Copied from specific branch
Add correlationId to fix startup of the EAS web application. Copied from specific branch
C#
mit
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
e4d0e181e33b4928d681c5e19dc43e1bb22c4538
Libraries/src/Amazon.Lambda.AspNetCoreServer/APIGatewayProxyFunctionExtensions.cs
Libraries/src/Amazon.Lambda.AspNetCoreServer/APIGatewayProxyFunctionExtensions.cs
using Amazon.Lambda.Core; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using Amazon.Lambda.APIGatewayEvents; namespace Amazon.Lambda.AspNetCoreServer { /// <summary> /// Helper extensions for APIGatewayProxyFunction /// </summary> public static class APIGatewayProxyFunctionExtensions { /// <summary> /// An overload of FunctionHandlerAsync to allow working with the typed API Gateway event classes. Implemented as an extension /// method to avoid confusion of using it as the function handler for the Lambda function. /// </summary> /// <param name="function"></param> /// <param name="request"></param> /// <param name="lambdaContext"></param> /// <returns></returns> public static async Task<APIGatewayProxyResponse> FunctionHandlerAsync(this APIGatewayProxyFunction function, APIGatewayProxyRequest request, ILambdaContext lambdaContext) { ILambdaSerializer serializer = new Amazon.Lambda.Serialization.Json.JsonSerializer(); var requestStream = new MemoryStream(); serializer.Serialize<APIGatewayProxyRequest>(request, requestStream); requestStream.Position = 0; var responseStream = await function.FunctionHandlerAsync(requestStream, lambdaContext); var response = serializer.Deserialize<APIGatewayProxyResponse>(responseStream); return response; } } }
using Amazon.Lambda.Core; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using Amazon.Lambda.APIGatewayEvents; using Amazon.Lambda.AspNetCoreServer; namespace Amazon.Lambda.TestUtilities { /// <summary> /// Extension methods for APIGatewayProxyFunction to make it easier to write tests /// </summary> public static class APIGatewayProxyFunctionExtensions { /// <summary> /// An overload of FunctionHandlerAsync to allow working with the typed API Gateway event classes. Implemented as an extension /// method to avoid confusion of using it as the function handler for the Lambda function. /// </summary> /// <param name="function"></param> /// <param name="request"></param> /// <param name="lambdaContext"></param> /// <returns></returns> public static async Task<APIGatewayProxyResponse> FunctionHandlerAsync(this APIGatewayProxyFunction function, APIGatewayProxyRequest request, ILambdaContext lambdaContext) { ILambdaSerializer serializer = new Amazon.Lambda.Serialization.Json.JsonSerializer(); var requestStream = new MemoryStream(); serializer.Serialize<APIGatewayProxyRequest>(request, requestStream); requestStream.Position = 0; var responseStream = await function.FunctionHandlerAsync(requestStream, lambdaContext); var response = serializer.Deserialize<APIGatewayProxyResponse>(responseStream); return response; } } }
Change namespace for helper extension method to Amazon.Lambda.TestUtilities to make it more discover able when writing tests.
Change namespace for helper extension method to Amazon.Lambda.TestUtilities to make it more discover able when writing tests.
C#
apache-2.0
thedevopsmachine/aws-lambda-dotnet,thedevopsmachine/aws-lambda-dotnet,thedevopsmachine/aws-lambda-dotnet,thedevopsmachine/aws-lambda-dotnet
1cdb7c5ae619cbc716b11d5fc26f19903c2de734
src/Analyzers/CSharp/Analyzers/NamingStyle/CSharpNamingStyleDiagnosticAnalyzer.cs
src/Analyzers/CSharp/Analyzers/NamingStyle/CSharpNamingStyleDiagnosticAnalyzer.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Immutable; using System.Linq; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Diagnostics.Analyzers.NamingStyles; using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Diagnostics.NamingStyles { [DiagnosticAnalyzer(LanguageNames.CSharp)] internal sealed class CSharpNamingStyleDiagnosticAnalyzer : NamingStyleDiagnosticAnalyzerBase<SyntaxKind> { protected override ImmutableArray<SyntaxKind> SupportedSyntaxKinds { get; } = ImmutableArray.Create( SyntaxKind.VariableDeclarator, SyntaxKind.ForEachStatement, SyntaxKind.CatchDeclaration, SyntaxKind.SingleVariableDesignation, SyntaxKind.LocalFunctionStatement, SyntaxKind.Parameter, SyntaxKind.TypeParameter); // Parameters of positional record declarations should be ignored because they also // considered properties, and that naming style makes more sense protected override bool ShouldIgnore(ISymbol symbol) => (symbol.IsKind(SymbolKind.Parameter) && IsParameterOfRecordDeclaration(symbol.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax())) || !symbol.CanBeReferencedByName; private static bool IsParameterOfRecordDeclaration(SyntaxNode? node) => node is ParameterSyntax { Parent: ParameterListSyntax { Parent: RecordDeclarationSyntax } }; } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Immutable; using System.Linq; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Diagnostics.Analyzers.NamingStyles; using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Diagnostics.NamingStyles { [DiagnosticAnalyzer(LanguageNames.CSharp)] internal sealed class CSharpNamingStyleDiagnosticAnalyzer : NamingStyleDiagnosticAnalyzerBase<SyntaxKind> { protected override ImmutableArray<SyntaxKind> SupportedSyntaxKinds { get; } = ImmutableArray.Create( SyntaxKind.VariableDeclarator, SyntaxKind.ForEachStatement, SyntaxKind.CatchDeclaration, SyntaxKind.SingleVariableDesignation, SyntaxKind.LocalFunctionStatement, SyntaxKind.Parameter, SyntaxKind.TypeParameter); protected override bool ShouldIgnore(ISymbol symbol) { if (symbol.IsKind(SymbolKind.Parameter) && symbol.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax() is ParameterSyntax { Parent: ParameterListSyntax { Parent: RecordDeclarationSyntax } }) { // Parameters of positional record declarations should be ignored because they also // considered properties, and that naming style makes more sense return true; } if (!symbol.CanBeReferencedByName) { // Explicit interface implementation falls into here, as they don't own their names // Two symbols are involved here, and symbol.ExplicitInterfaceImplementations only applies for one return true; } return false; } } }
Expand and add comment for ShouldIgnore.
Expand and add comment for ShouldIgnore.
C#
mit
ErikSchierboom/roslyn,eriawan/roslyn,CyrusNajmabadi/roslyn,tmat/roslyn,bartdesmet/roslyn,AmadeusW/roslyn,AlekseyTs/roslyn,tannergooding/roslyn,shyamnamboodiripad/roslyn,AmadeusW/roslyn,mgoertz-msft/roslyn,bartdesmet/roslyn,CyrusNajmabadi/roslyn,eriawan/roslyn,AlekseyTs/roslyn,mgoertz-msft/roslyn,sharwell/roslyn,jasonmalinowski/roslyn,physhi/roslyn,diryboy/roslyn,physhi/roslyn,ErikSchierboom/roslyn,bartdesmet/roslyn,physhi/roslyn,sharwell/roslyn,wvdd007/roslyn,jasonmalinowski/roslyn,tannergooding/roslyn,KevinRansom/roslyn,weltkante/roslyn,dotnet/roslyn,weltkante/roslyn,diryboy/roslyn,wvdd007/roslyn,weltkante/roslyn,jasonmalinowski/roslyn,mavasani/roslyn,sharwell/roslyn,AlekseyTs/roslyn,shyamnamboodiripad/roslyn,KevinRansom/roslyn,ErikSchierboom/roslyn,dotnet/roslyn,CyrusNajmabadi/roslyn,AmadeusW/roslyn,tannergooding/roslyn,diryboy/roslyn,tmat/roslyn,KevinRansom/roslyn,shyamnamboodiripad/roslyn,eriawan/roslyn,mavasani/roslyn,dotnet/roslyn,mavasani/roslyn,tmat/roslyn,wvdd007/roslyn,mgoertz-msft/roslyn
5e96a647c5281075aa6506e49eab44a0e8bc66ec
06.OthreTypes/06.OtherTypes.Homework/OtherTypes/FractionCalculator/Class/Fraction.cs
06.OthreTypes/06.OtherTypes.Homework/OtherTypes/FractionCalculator/Class/Fraction.cs
using System; namespace FractionCalculator.Class { public struct Fraction { private long numerator; private long denominator; public Fraction(long numerator, long denominator) : this() { this.Numerator = numerator; this.Denominator = denominator; } public long Denominator { get { return this.denominator; } set { if (value <= 0) throw new DivideByZeroException("Denominator cannot be zero or negative"); this.denominator = value; } } public long Numerator { get { return this.numerator; } set { if (value <= 0) throw new ArgumentException("numerator", "Numerator cannot be zero or negative!"); this.numerator = value; } } public override string ToString() { return string.Format(); } } }
using System; namespace FractionCalculator.Class { public struct Fraction { private long numerator; private long denominator; public Fraction(long numerator, long denominator) : this() { this.Numerator = numerator; this.Denominator = denominator; } public long Denominator { get { return this.denominator; } set { if (value <= 0) throw new DivideByZeroException("Denominator cannot be zero or negative"); this.denominator = value; } } public long Numerator { get { return this.numerator; } set { if (value <= 0) throw new ArgumentException("numerator", "Numerator cannot be zero or negative!"); this.numerator = value; } } public static Fraction operator +(Fraction fraction1, Fraction fraction2) { return new Fraction(fraction1.Numerator + fraction2.Numerator, fraction1.Denominator + fraction2.Denominator); } public static Fraction operator -(Fraction fraction1, Fraction fraction2) { return new Fraction(fraction1.Numerator - fraction2.Numerator, fraction1.Denominator - fraction2.Denominator); } //public override string ToString() //{ // return string.Format(); //} } }
Create method for overload operator + and -
Create method for overload operator + and -
C#
cc0-1.0
ivayloivanof/OOP.CSharp,ivayloivanof/OOP.CSharp
f52182b8dfadfe38d29c1d20ec402dcca3e91ceb
src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionNotification.cs
src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionNotification.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. /*============================================================================= ** ** File: ExceptionNotification.cs ** ** ** Purpose: Contains definitions for supporting Exception Notifications. ** ** Created: 10/07/2008 ** ** <owner>gkhanna</owner> ** =============================================================================*/ #if FEATURE_EXCEPTION_NOTIFICATIONS namespace System.Runtime.ExceptionServices { using System; // Definition of the argument-type passed to the FirstChanceException event handler public class FirstChanceExceptionEventArgs : EventArgs { // Constructor public FirstChanceExceptionEventArgs(Exception exception) { m_Exception = exception; } // Returns the exception object pertaining to the first chance exception public Exception Exception { get { return m_Exception; } } // Represents the FirstChance exception instance private Exception m_Exception; } } #endif // FEATURE_EXCEPTION_NOTIFICATIONS
// 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. /*============================================================================= ** ** File: ExceptionNotification.cs ** ** ** Purpose: Contains definitions for supporting Exception Notifications. ** ** Created: 10/07/2008 ** ** <owner>gkhanna</owner> ** =============================================================================*/ #if FEATURE_EXCEPTION_NOTIFICATIONS namespace System.Runtime.ExceptionServices { using System; using System.Runtime.ConstrainedExecution; // Definition of the argument-type passed to the FirstChanceException event handler public class FirstChanceExceptionEventArgs : EventArgs { // Constructor public FirstChanceExceptionEventArgs(Exception exception) { m_Exception = exception; } // Returns the exception object pertaining to the first chance exception public Exception Exception { [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] get { return m_Exception; } } // Represents the FirstChance exception instance private Exception m_Exception; } } #endif // FEATURE_EXCEPTION_NOTIFICATIONS
Remove FirstChanceExceptionEventArgs from BCL folder. The file has been moved into mscorlib folder
Remove FirstChanceExceptionEventArgs from BCL folder. The file has been moved into mscorlib folder [tfs-changeset: 1630635]
C#
mit
cmckinsey/coreclr,neurospeech/coreclr,sagood/coreclr,mmitche/coreclr,ruben-ayrapetyan/coreclr,ragmani/coreclr,dasMulli/coreclr,JonHanna/coreclr,gkhanna79/coreclr,kyulee1/coreclr,krytarowski/coreclr,ruben-ayrapetyan/coreclr,botaberg/coreclr,mskvortsov/coreclr,botaberg/coreclr,JosephTremoulet/coreclr,pgavlin/coreclr,pgavlin/coreclr,krytarowski/coreclr,parjong/coreclr,Dmitry-Me/coreclr,rartemev/coreclr,cshung/coreclr,YongseopKim/coreclr,parjong/coreclr,yeaicc/coreclr,krytarowski/coreclr,mmitche/coreclr,russellhadley/coreclr,AlexGhiondea/coreclr,JosephTremoulet/coreclr,sjsinju/coreclr,mskvortsov/coreclr,krk/coreclr,wateret/coreclr,ramarag/coreclr,sagood/coreclr,alexperovich/coreclr,hseok-oh/coreclr,gkhanna79/coreclr,wateret/coreclr,James-Ko/coreclr,James-Ko/coreclr,botaberg/coreclr,James-Ko/coreclr,Dmitry-Me/coreclr,ragmani/coreclr,sjsinju/coreclr,krk/coreclr,YongseopKim/coreclr,Dmitry-Me/coreclr,AlexGhiondea/coreclr,ragmani/coreclr,yeaicc/coreclr,yizhang82/coreclr,dasMulli/coreclr,ragmani/coreclr,wateret/coreclr,dpodder/coreclr,sjsinju/coreclr,hseok-oh/coreclr,rartemev/coreclr,ruben-ayrapetyan/coreclr,jamesqo/coreclr,parjong/coreclr,poizan42/coreclr,cshung/coreclr,cmckinsey/coreclr,yeaicc/coreclr,mskvortsov/coreclr,YongseopKim/coreclr,rartemev/coreclr,cshung/coreclr,tijoytom/coreclr,cshung/coreclr,kyulee1/coreclr,mskvortsov/coreclr,AlexGhiondea/coreclr,Dmitry-Me/coreclr,wtgodbe/coreclr,cshung/coreclr,yeaicc/coreclr,neurospeech/coreclr,Dmitry-Me/coreclr,gkhanna79/coreclr,yeaicc/coreclr,wateret/coreclr,ragmani/coreclr,dpodder/coreclr,cydhaselton/coreclr,cshung/coreclr,James-Ko/coreclr,qiudesong/coreclr,ramarag/coreclr,wtgodbe/coreclr,kyulee1/coreclr,kyulee1/coreclr,jamesqo/coreclr,ragmani/coreclr,dpodder/coreclr,kyulee1/coreclr,YongseopKim/coreclr,qiudesong/coreclr,dpodder/coreclr,alexperovich/coreclr,yizhang82/coreclr,AlexGhiondea/coreclr,sjsinju/coreclr,krytarowski/coreclr,tijoytom/coreclr,ramarag/coreclr,mskvortsov/coreclr,cydhaselton/coreclr,cmckinsey/coreclr,ramarag/coreclr,JonHanna/coreclr,poizan42/coreclr,krk/coreclr,cydhaselton/coreclr,mskvortsov/coreclr,yeaicc/coreclr,ruben-ayrapetyan/coreclr,qiudesong/coreclr,pgavlin/coreclr,alexperovich/coreclr,krk/coreclr,cmckinsey/coreclr,russellhadley/coreclr,wtgodbe/coreclr,sagood/coreclr,poizan42/coreclr,dasMulli/coreclr,dasMulli/coreclr,russellhadley/coreclr,wateret/coreclr,JosephTremoulet/coreclr,sagood/coreclr,krk/coreclr,krytarowski/coreclr,neurospeech/coreclr,qiudesong/coreclr,yizhang82/coreclr,hseok-oh/coreclr,JosephTremoulet/coreclr,JonHanna/coreclr,jamesqo/coreclr,kyulee1/coreclr,wtgodbe/coreclr,botaberg/coreclr,YongseopKim/coreclr,mmitche/coreclr,cydhaselton/coreclr,botaberg/coreclr,neurospeech/coreclr,hseok-oh/coreclr,JosephTremoulet/coreclr,rartemev/coreclr,hseok-oh/coreclr,mmitche/coreclr,ruben-ayrapetyan/coreclr,gkhanna79/coreclr,ramarag/coreclr,alexperovich/coreclr,yizhang82/coreclr,cmckinsey/coreclr,wtgodbe/coreclr,dasMulli/coreclr,cmckinsey/coreclr,poizan42/coreclr,parjong/coreclr,JosephTremoulet/coreclr,wtgodbe/coreclr,rartemev/coreclr,russellhadley/coreclr,krytarowski/coreclr,dasMulli/coreclr,JonHanna/coreclr,yizhang82/coreclr,wateret/coreclr,James-Ko/coreclr,YongseopKim/coreclr,rartemev/coreclr,tijoytom/coreclr,sjsinju/coreclr,mmitche/coreclr,parjong/coreclr,jamesqo/coreclr,pgavlin/coreclr,dpodder/coreclr,poizan42/coreclr,AlexGhiondea/coreclr,russellhadley/coreclr,mmitche/coreclr,jamesqo/coreclr,tijoytom/coreclr,krk/coreclr,ramarag/coreclr,botaberg/coreclr,neurospeech/coreclr,parjong/coreclr,sagood/coreclr,hseok-oh/coreclr,gkhanna79/coreclr,cydhaselton/coreclr,qiudesong/coreclr,gkhanna79/coreclr,yizhang82/coreclr,Dmitry-Me/coreclr,sagood/coreclr,Dmitry-Me/coreclr,ruben-ayrapetyan/coreclr,tijoytom/coreclr,pgavlin/coreclr,James-Ko/coreclr,AlexGhiondea/coreclr,cmckinsey/coreclr,ramarag/coreclr,pgavlin/coreclr,alexperovich/coreclr,poizan42/coreclr,JonHanna/coreclr,jamesqo/coreclr,russellhadley/coreclr,sjsinju/coreclr,neurospeech/coreclr,cydhaselton/coreclr,tijoytom/coreclr,JonHanna/coreclr,dpodder/coreclr,dasMulli/coreclr,yeaicc/coreclr,alexperovich/coreclr,qiudesong/coreclr
53eccff651a1208fb9fa297e483420851dd11934
src/Booma.Proxy.Packets.Common/Message/Game/UnknownSubCommand6DCommand.cs
src/Booma.Proxy.Packets.Common/Message/Game/UnknownSubCommand6DCommand.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using FreecraftCore.Serializer; namespace Booma.Proxy { /// <summary> /// An unimplemented or unknown subcommand for the 0x6D packets. /// </summary> [WireDataContract] public sealed class UnknownSubCommand6DCommand : BaseSubCommand6D, IUnknownPayloadType { /// <inheritdoc /> public short OperationCode => (short)base.CommandOperationCode; /// <inheritdoc /> [ReadToEnd] [WireMember(1)] public byte[] UnknownBytes { get; } = new byte[0]; //readtoend requires at least an empty array init private UnknownSubCommand6DCommand() { } /// <inheritdoc /> public override string ToString() { if(Enum.IsDefined(typeof(SubCommand6DOperationCode), (byte)OperationCode)) return $"Unknown Subcommand6D OpCode: {OperationCode:X} Name: {((SubCommand6DOperationCode)OperationCode).ToString()} Type: {GetType().Name} CommandSize: {CommandSize * 4 - 2} (bytes size)"; else return $"Unknown Subcommand6D OpCode: {OperationCode:X} Type: {GetType().Name} CommandSize: {CommandSize * 4 - 2} (bytes size)"; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using FreecraftCore.Serializer; namespace Booma.Proxy { /// <summary> /// An unimplemented or unknown subcommand for the 0x6D packets. /// </summary> [WireDataContract] public sealed class UnknownSubCommand6DCommand : BaseSubCommand6D, IUnknownPayloadType { /// <inheritdoc /> public short OperationCode => (short)base.CommandOperationCode; /// <inheritdoc /> [ReadToEnd] [WireMember(1)] public byte[] UnknownBytes { get; } = new byte[0]; //readtoend requires at least an empty array init private UnknownSubCommand6DCommand() { } /// <inheritdoc /> public override string ToString() { if(Enum.IsDefined(typeof(SubCommand6DOperationCode), (byte)OperationCode)) return $"Unknown Subcommand6D OpCode: {OperationCode:X} Name: {((SubCommand6DOperationCode)OperationCode).ToString()} Type: {GetType().Name} CommandSize: {CommandSize} (bytes size)"; else return $"Unknown Subcommand6D OpCode: {OperationCode:X} Type: {GetType().Name} CommandSize: {CommandSize} (bytes size)"; } } }
Fix unknown 0x6D size logging
Fix unknown 0x6D size logging
C#
agpl-3.0
HelloKitty/Booma.Proxy
da25c07956a9599982002f16008d1cf722a58fbe
VotingApplication/VotingApplication.Web/Api/Services/SendMailEmailSender.cs
VotingApplication/VotingApplication.Web/Api/Services/SendMailEmailSender.cs
using Microsoft.AspNet.Identity; using SendGrid; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Mail; using System.Threading.Tasks; using System.Web; namespace VotingApplication.Web.Api.Services { public class SendMailEmailSender : IMailSender { private NetworkCredential credentials; private string hostEmail; public SendMailEmailSender(NetworkCredential credentials, string hostEmail) { this.credentials = credentials; this.hostEmail = hostEmail; } public Task SendMail(string to, string subject, string message) { SendGridMessage mail = new SendGridMessage(); mail.From = new MailAddress(this.hostEmail, "Voting App"); mail.AddTo(to); mail.Subject = subject; mail.Html = message; var transportWeb = new SendGrid.Web(this.credentials); return transportWeb.DeliverAsync(mail); } } }
using SendGrid; using System.Net; using System.Net.Mail; using System.Threading.Tasks; namespace VotingApplication.Web.Api.Services { public class SendMailEmailSender : IMailSender { private NetworkCredential credentials; private string hostEmail; public SendMailEmailSender(NetworkCredential credentials, string hostEmail) { this.credentials = credentials; this.hostEmail = hostEmail; } public Task SendMail(string to, string subject, string message) { SendGridMessage mail = new SendGridMessage(); mail.From = new MailAddress(this.hostEmail, "Vote On"); mail.AddTo(to); mail.Subject = subject; mail.Html = message; var transportWeb = new SendGrid.Web(this.credentials); return transportWeb.DeliverAsync(mail); } } }
Fix email sender to 'vote on'
Fix email sender to 'vote on'
C#
apache-2.0
Generic-Voting-Application/voting-application,stevenhillcox/voting-application,tpkelly/voting-application,JDawes-ScottLogic/voting-application,Generic-Voting-Application/voting-application,JDawes-ScottLogic/voting-application,stevenhillcox/voting-application,tpkelly/voting-application,Generic-Voting-Application/voting-application,JDawes-ScottLogic/voting-application,tpkelly/voting-application,stevenhillcox/voting-application
07952f53279bd453159888786ad52bd2e2087f4b
src/Workspaces/Remote/ServiceHub/Services/CodeAnalysisService_NavigateTo.cs
src/Workspaces/Remote/ServiceHub/Services/CodeAnalysisService_NavigateTo.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.Collections.Immutable; using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis.NavigateTo; namespace Microsoft.CodeAnalysis.Remote { internal partial class CodeAnalysisService : IRemoteNavigateToSearchService { public async Task<SerializableNavigateToSearchResult[]> SearchDocumentAsync( DocumentId documentId, string searchPattern) { var solution = await GetSolutionAsync().ConfigureAwait(false); var project = solution.GetDocument(documentId); var result = await AbstractNavigateToSearchService.SearchDocumentInCurrentProcessAsync( project, searchPattern, CancellationToken).ConfigureAwait(false); return Convert(result); } public async Task<SerializableNavigateToSearchResult[]> SearchProjectAsync( ProjectId projectId, string searchPattern) { var solution = await GetSolutionAsync().ConfigureAwait(false); var project = solution.GetProject(projectId); var result = await AbstractNavigateToSearchService.SearchProjectInCurrentProcessAsync( project, searchPattern, CancellationToken).ConfigureAwait(false); return Convert(result); } private SerializableNavigateToSearchResult[] Convert( ImmutableArray<INavigateToSearchResult> result) { return result.Select(SerializableNavigateToSearchResult.Dehydrate).ToArray(); } } }
// 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.Collections.Immutable; using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis.NavigateTo; namespace Microsoft.CodeAnalysis.Remote { internal partial class CodeAnalysisService : IRemoteNavigateToSearchService { public async Task<SerializableNavigateToSearchResult[]> SearchDocumentAsync( DocumentId documentId, string searchPattern) { using (UserOperationBooster.Boost()) { var solution = await GetSolutionAsync().ConfigureAwait(false); var project = solution.GetDocument(documentId); var result = await AbstractNavigateToSearchService.SearchDocumentInCurrentProcessAsync( project, searchPattern, CancellationToken).ConfigureAwait(false); return Convert(result); } } public async Task<SerializableNavigateToSearchResult[]> SearchProjectAsync( ProjectId projectId, string searchPattern) { using (UserOperationBooster.Boost()) { var solution = await GetSolutionAsync().ConfigureAwait(false); var project = solution.GetProject(projectId); var result = await AbstractNavigateToSearchService.SearchProjectInCurrentProcessAsync( project, searchPattern, CancellationToken).ConfigureAwait(false); return Convert(result); } } private SerializableNavigateToSearchResult[] Convert( ImmutableArray<INavigateToSearchResult> result) { return result.Select(SerializableNavigateToSearchResult.Dehydrate).ToArray(); } } }
Boost priority of NavigateTo when running in OOP server.
Boost priority of NavigateTo when running in OOP server.
C#
apache-2.0
tvand7093/roslyn,Giftednewt/roslyn,tmat/roslyn,KirillOsenkov/roslyn,yeaicc/roslyn,OmarTawfik/roslyn,jamesqo/roslyn,VSadov/roslyn,paulvanbrenk/roslyn,Hosch250/roslyn,OmarTawfik/roslyn,genlu/roslyn,DustinCampbell/roslyn,brettfo/roslyn,xasx/roslyn,pdelvo/roslyn,MichalStrehovsky/roslyn,abock/roslyn,robinsedlaczek/roslyn,MattWindsor91/roslyn,heejaechang/roslyn,swaroop-sridhar/roslyn,gafter/roslyn,abock/roslyn,KirillOsenkov/roslyn,davkean/roslyn,mgoertz-msft/roslyn,tvand7093/roslyn,jmarolf/roslyn,reaction1989/roslyn,cston/roslyn,AnthonyDGreen/roslyn,dotnet/roslyn,TyOverby/roslyn,tmeschter/roslyn,KevinRansom/roslyn,mgoertz-msft/roslyn,AnthonyDGreen/roslyn,tvand7093/roslyn,nguerrera/roslyn,dpoeschl/roslyn,diryboy/roslyn,diryboy/roslyn,diryboy/roslyn,pdelvo/roslyn,nguerrera/roslyn,lorcanmooney/roslyn,gafter/roslyn,jasonmalinowski/roslyn,bkoelman/roslyn,bkoelman/roslyn,panopticoncentral/roslyn,AlekseyTs/roslyn,dpoeschl/roslyn,shyamnamboodiripad/roslyn,panopticoncentral/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,KevinRansom/roslyn,gafter/roslyn,pdelvo/roslyn,shyamnamboodiripad/roslyn,eriawan/roslyn,reaction1989/roslyn,agocke/roslyn,davkean/roslyn,jamesqo/roslyn,robinsedlaczek/roslyn,Hosch250/roslyn,heejaechang/roslyn,physhi/roslyn,MattWindsor91/roslyn,mavasani/roslyn,DustinCampbell/roslyn,physhi/roslyn,kelltrick/roslyn,mattscheffer/roslyn,bartdesmet/roslyn,wvdd007/roslyn,mavasani/roslyn,jcouv/roslyn,CyrusNajmabadi/roslyn,davkean/roslyn,jasonmalinowski/roslyn,sharwell/roslyn,tannergooding/roslyn,CyrusNajmabadi/roslyn,eriawan/roslyn,tmeschter/roslyn,xasx/roslyn,dpoeschl/roslyn,srivatsn/roslyn,tannergooding/roslyn,panopticoncentral/roslyn,abock/roslyn,tmat/roslyn,cston/roslyn,AnthonyDGreen/roslyn,jkotas/roslyn,TyOverby/roslyn,jcouv/roslyn,robinsedlaczek/roslyn,orthoxerox/roslyn,mmitche/roslyn,brettfo/roslyn,wvdd007/roslyn,tannergooding/roslyn,srivatsn/roslyn,MattWindsor91/roslyn,aelij/roslyn,Giftednewt/roslyn,brettfo/roslyn,wvdd007/roslyn,AlekseyTs/roslyn,VSadov/roslyn,VSadov/roslyn,lorcanmooney/roslyn,ErikSchierboom/roslyn,genlu/roslyn,agocke/roslyn,MattWindsor91/roslyn,paulvanbrenk/roslyn,stephentoub/roslyn,AmadeusW/roslyn,heejaechang/roslyn,dotnet/roslyn,physhi/roslyn,stephentoub/roslyn,jasonmalinowski/roslyn,mattscheffer/roslyn,mavasani/roslyn,khyperia/roslyn,KirillOsenkov/roslyn,xasx/roslyn,Giftednewt/roslyn,yeaicc/roslyn,weltkante/roslyn,jkotas/roslyn,KevinRansom/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,mattscheffer/roslyn,swaroop-sridhar/roslyn,jcouv/roslyn,tmeschter/roslyn,mgoertz-msft/roslyn,paulvanbrenk/roslyn,reaction1989/roslyn,Hosch250/roslyn,DustinCampbell/roslyn,kelltrick/roslyn,aelij/roslyn,srivatsn/roslyn,OmarTawfik/roslyn,kelltrick/roslyn,weltkante/roslyn,bartdesmet/roslyn,TyOverby/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,yeaicc/roslyn,CyrusNajmabadi/roslyn,bartdesmet/roslyn,orthoxerox/roslyn,AmadeusW/roslyn,shyamnamboodiripad/roslyn,CaptainHayashi/roslyn,aelij/roslyn,mmitche/roslyn,bkoelman/roslyn,genlu/roslyn,orthoxerox/roslyn,eriawan/roslyn,MichalStrehovsky/roslyn,AmadeusW/roslyn,dotnet/roslyn,lorcanmooney/roslyn,ErikSchierboom/roslyn,nguerrera/roslyn,jmarolf/roslyn,AlekseyTs/roslyn,MichalStrehovsky/roslyn,cston/roslyn,stephentoub/roslyn,jmarolf/roslyn,ErikSchierboom/roslyn,mmitche/roslyn,sharwell/roslyn,agocke/roslyn,CaptainHayashi/roslyn,swaroop-sridhar/roslyn,jkotas/roslyn,weltkante/roslyn,CaptainHayashi/roslyn,sharwell/roslyn,jamesqo/roslyn,khyperia/roslyn,tmat/roslyn,khyperia/roslyn
f0d261bc494da9b62ad40c99538c66c866f33412
src/TeacherPouch/Views/Tag/Index.cshtml
src/TeacherPouch/Views/Tag/Index.cshtml
@model IEnumerable<Tag> @{ ViewBag.Title = "Tag Index"; } <h2>Tag Index</h2> @if (User.Identity.IsAuthenticated) { <p> <a asp-action="Create">Create new Tag</a> </p> } <h3>@Model.Count() tags</h3> <ul class="tag-buttons"> @Html.Partial("_TagButtons", Model) </ul>
@model IEnumerable<Tag> @{ ViewBag.Title = "Tag Index"; } <h2>Tag Index</h2> @if (User.Identity.IsAuthenticated) { <p> <a asp-action="Create">Create new Tag</a> </p> } <h3>@Model.Count() tags</h3> <div> @Html.Partial("_TagButtons", Model) </div>
Update tag button container markup
Update tag button container markup
C#
mit
dsteinweg/TeacherPouch,dsteinweg/TeacherPouch,dsteinweg/TeacherPouch,dsteinweg/TeacherPouch
9577117759dd48525bbfac8523db6dd5f1114d27
src/Terrajobst.Pns.Scanner/PnsResult.cs
src/Terrajobst.Pns.Scanner/PnsResult.cs
using System; namespace Terrajobst.Pns.Scanner { public struct PnsResult { public static readonly PnsResult DoesNotThrow = new PnsResult(-1); private PnsResult(int level) { Level = level; } public static PnsResult ThrowsAt(int level) { return new PnsResult(level); } public PnsResult Combine(PnsResult other) { if (!Throws) return other; return ThrowsAt(Math.Min(Level, other.Level)); } public bool Throws => Level >= 0; public int Level { get; } public override string ToString() { return Level.ToString(); } } }
using System; namespace Terrajobst.Pns.Scanner { public struct PnsResult { public static readonly PnsResult DoesNotThrow = new PnsResult(-1); private PnsResult(int level) { Level = level; } public static PnsResult ThrowsAt(int level) { return new PnsResult(level); } public PnsResult Combine(PnsResult other) { if (!Throws) return other; if (!other.Throws) return this; return ThrowsAt(Math.Min(Level, other.Level)); } public bool Throws => Level >= 0; public int Level { get; } public override string ToString() { return Level.ToString(); } } }
Fix bug in properties and event detection
Fix bug in properties and event detection
C#
mit
terrajobst/platform-compat
9ee0a1f943e125d81c7be8f281c159d36eb2e17a
Framework/Lokad.Cqrs.Azure.Tests/Feature.TapeStorage/BlobTapeStorageTests.cs
Framework/Lokad.Cqrs.Azure.Tests/Feature.TapeStorage/BlobTapeStorageTests.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Lokad.Cqrs.Properties; using Microsoft.WindowsAzure; using Microsoft.WindowsAzure.StorageClient; using NUnit.Framework; namespace Lokad.Cqrs.Feature.TapeStorage { [TestFixture] public class BlobTapeStorageTests : TapeStorageTests { const string ContainerName = "blob-tape-test"; CloudBlobClient _cloudBlobClient; ISingleThreadTapeWriterFactory _writerFactory; ITapeReaderFactory _readerFactory; protected override void SetUp() { CloudStorageAccount.SetConfigurationSettingPublisher( (configName, configSetter) => configSetter((string) Settings.Default[configName])); var cloudStorageAccount = CloudStorageAccount.FromConfigurationSetting("StorageConnectionString"); _cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient(); _writerFactory = new BlobTapeWriterFactory(_cloudBlobClient, ContainerName); _writerFactory.Init(); _readerFactory = new BlobTapeReaderFactory(_cloudBlobClient, ContainerName); } protected override void TearDown() { _cloudBlobClient.GetContainerReference(ContainerName).Delete(); } protected override TestConfiguration GetConfiguration() { return new TestConfiguration { Name = "test", WriterFactory = _writerFactory, ReaderFactory = _readerFactory }; } } }
using System; using Lokad.Cqrs.Properties; using Microsoft.WindowsAzure; using Microsoft.WindowsAzure.StorageClient; using NUnit.Framework; namespace Lokad.Cqrs.Feature.TapeStorage { [TestFixture] public class BlobTapeStorageTests : TapeStorageTests { const string ContainerName = "blob-tape-test"; CloudBlobClient _cloudBlobClient; ISingleThreadTapeWriterFactory _writerFactory; ITapeReaderFactory _readerFactory; protected override void SetUp() { CloudStorageAccount.SetConfigurationSettingPublisher( (configName, configSetter) => configSetter((string) Settings.Default[configName])); var cloudStorageAccount = CloudStorageAccount.FromConfigurationSetting("StorageConnectionString"); _cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient(); try { _cloudBlobClient.GetContainerReference(ContainerName).FetchAttributes(); throw new InvalidOperationException("Container '" + ContainerName + "' already exists!"); } catch (StorageClientException e) { if (e.ErrorCode != StorageErrorCode.ResourceNotFound) throw new InvalidOperationException("Container '" + ContainerName + "' already exists!"); } _writerFactory = new BlobTapeWriterFactory(_cloudBlobClient, ContainerName); _writerFactory.Init(); _readerFactory = new BlobTapeReaderFactory(_cloudBlobClient, ContainerName); } protected override void TearDown() { _cloudBlobClient.GetContainerReference(ContainerName).Delete(); } protected override TestConfiguration GetConfiguration() { return new TestConfiguration { Name = "test", WriterFactory = _writerFactory, ReaderFactory = _readerFactory }; } } }
Abort test if test container exists.
Abort test if test container exists. --HG-- branch : 2011-05-28-es
C#
bsd-3-clause
modulexcite/lokad-cqrs
22a9a037961eec94e38ccbf28174cd053864c74c
Lab01/CloudFoundry/Program.cs
Lab01/CloudFoundry/Program.cs
using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Steeltoe.Extensions.Configuration.CloudFoundry; namespace CloudFoundry { public class Program { public static void Main(string[] args) { BuildWebHost(args).Run(); } public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>() // Lab01 - Lab04 Start .AddCloudFoundry() // Lab01 - Lab04 End .Build(); } }
using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Steeltoe.Extensions.Configuration.CloudFoundry; namespace CloudFoundry { public class Program { public static void Main(string[] args) { BuildWebHost(args).Run(); } public static IWebHost BuildWebHost(string[] args) { // Lab01 - Lab04 Start var configuration = new ConfigurationBuilder().AddCommandLine(args).Build(); // Lab01 - Lab04 End return WebHost.CreateDefaultBuilder(args) // Lab01 - Lab04 Start .UseConfiguration(configuration) // Lab01 - Lab04 End .UseStartup<Startup>() // Lab01 - Lab04 Start .AddCloudFoundry() // Lab01 - Lab04 End .Build(); } } }
Fix startup problem on windows
Fix startup problem on windows
C#
apache-2.0
SteeltoeOSS/Workshop,SteeltoeOSS/Workshop,SteeltoeOSS/Workshop,SteeltoeOSS/Workshop
2e7fb19c39c4f60e9859e9890d3ff926034a252a
src/Dialog/PackageManagerUI/BaseProvider/PackagesSearchNode.cs
src/Dialog/PackageManagerUI/BaseProvider/PackagesSearchNode.cs
using System; using System.Linq; using Microsoft.VisualStudio.ExtensionsExplorer; namespace NuGet.Dialog.Providers { internal class PackagesSearchNode : PackagesTreeNodeBase { private string _searchText; private readonly PackagesTreeNodeBase _baseNode; public PackagesTreeNodeBase BaseNode { get { return _baseNode; } } public PackagesSearchNode(PackagesProviderBase provider, IVsExtensionsTreeNode parent, PackagesTreeNodeBase baseNode, string searchText) : base(parent, provider) { if (baseNode == null) { throw new ArgumentNullException("baseNode"); } _searchText = searchText; _baseNode = baseNode; // Mark this node as a SearchResults node to assist navigation in ExtensionsExplorer IsSearchResultsNode = true; } public override string Name { get { return Resources.Dialog_RootNodeSearch; } } public void SetSearchText(string newSearchText) { if (newSearchText == null) { throw new ArgumentNullException("newSearchText"); } if (_searchText != newSearchText) { _searchText = newSearchText; if (IsSelected) { ResetQuery(); Refresh(); } } } public override IQueryable<IPackage> GetPackages() { return _baseNode.GetPackages().Find(_searchText); } } }
using System; using System.Linq; using Microsoft.VisualStudio.ExtensionsExplorer; namespace NuGet.Dialog.Providers { internal class PackagesSearchNode : PackagesTreeNodeBase { private string _searchText; private readonly PackagesTreeNodeBase _baseNode; public PackagesTreeNodeBase BaseNode { get { return _baseNode; } } public PackagesSearchNode(PackagesProviderBase provider, IVsExtensionsTreeNode parent, PackagesTreeNodeBase baseNode, string searchText) : base(parent, provider) { if (baseNode == null) { throw new ArgumentNullException("baseNode"); } _searchText = searchText; _baseNode = baseNode; // Mark this node as a SearchResults node to assist navigation in ExtensionsExplorer IsSearchResultsNode = true; } public override string Name { get { return Resources.Dialog_RootNodeSearch; } } public void SetSearchText(string newSearchText) { if (newSearchText == null) { throw new ArgumentNullException("newSearchText"); } if (_searchText != newSearchText) { _searchText = newSearchText; if (IsSelected) { ResetQuery(); LoadPage(1); } } } public override IQueryable<IPackage> GetPackages() { return _baseNode.GetPackages().Find(_searchText); } } }
Reset page number to 1 when perform a new search. Work items: 569
Reset page number to 1 when perform a new search. Work items: 569 --HG-- branch : 1.1
C#
apache-2.0
mdavid/nuget,mdavid/nuget
974faeed7c29f9f9bd905ff43cde79addb2dee80
src/Libraries/SharpDox.Build.Roslyn/Parser/ProjectParser/MethodCallParser.cs
src/Libraries/SharpDox.Build.Roslyn/Parser/ProjectParser/MethodCallParser.cs
using System.Linq; using Microsoft.CodeAnalysis.CSharp.Syntax; using SharpDox.Build.Roslyn.MethodVisitors; namespace SharpDox.Build.Roslyn.Parser.ProjectParser { internal class MethodCallParser : BaseParser { internal MethodCallParser(ParserOptions parserOptions) : base(parserOptions) { } internal void ParseMethodCalls() { var namespaces = ParserOptions.SDRepository.GetAllNamespaces(); foreach (var sdNamespace in namespaces) { foreach (var sdType in sdNamespace.Types) { foreach (var sdMethod in sdType.Methods) { HandleOnItemParseStart(sdMethod.Name); var fileId = ParserOptions.CodeSolution.GetDocumentIdsWithFilePath(sdMethod.Region.FilePath).Single(); var file = ParserOptions.CodeSolution.GetDocument(fileId); var syntaxTree = file.GetSyntaxTreeAsync().Result; if (file.Project.Language == "C#") { var methodVisitor = new CSharpMethodVisitor(ParserOptions.SDRepository, sdMethod, sdType, file); var methodSyntaxNode = syntaxTree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>() .Single(m => m.Span.Start == sdMethod.Region.Start && m.Span.End == sdMethod.Region.End); methodVisitor.Visit(methodSyntaxNode); } else if (file.Project.Language == "VBNET") { } } } } } } }
using System.Linq; using Microsoft.CodeAnalysis.CSharp.Syntax; using SharpDox.Build.Roslyn.MethodVisitors; namespace SharpDox.Build.Roslyn.Parser.ProjectParser { internal class MethodCallParser : BaseParser { internal MethodCallParser(ParserOptions parserOptions) : base(parserOptions) { } internal void ParseMethodCalls() { var namespaces = ParserOptions.SDRepository.GetAllNamespaces(); foreach (var sdNamespace in namespaces) { foreach (var sdType in sdNamespace.Types) { foreach (var sdMethod in sdType.Methods) { HandleOnItemParseStart(sdMethod.Name); var fileId = ParserOptions.CodeSolution.GetDocumentIdsWithFilePath(sdMethod.Region.FilePath).FirstOrDefault(); var file = ParserOptions.CodeSolution.GetDocument(fileId); var syntaxTree = file.GetSyntaxTreeAsync().Result; if (file.Project.Language == "C#") { var methodVisitor = new CSharpMethodVisitor(ParserOptions.SDRepository, sdMethod, sdType, file); var methodSyntaxNode = syntaxTree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>() .FirstOrDefault(m => m.Span.Start == sdMethod.Region.Start && m.Span.End == sdMethod.Region.End); if (methodSyntaxNode != null) { methodVisitor.Visit(methodSyntaxNode); } } else if (file.Project.Language == "VBNET") { } } } } } } }
Fix Roslyn compiler issues when the same file is being used for multiple target platforms (and might result in a class without methods)
Fix Roslyn compiler issues when the same file is being used for multiple target platforms (and might result in a class without methods)
C#
mit
Geaz/sharpDox
883a937fecd087c760ee0326e0f2b447b75317e0
src/SDKs/SqlManagement/Sql.Tests/ServiceObjectiveScenarioTests.cs
src/SDKs/SqlManagement/Sql.Tests/ServiceObjectiveScenarioTests.cs
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using Microsoft.Azure.Management.Sql.Models; using Microsoft.Azure.Management.Sql; using Xunit; namespace Sql.Tests { public class ServiceObjectiveScenarioTests { [Fact] public void TestGetListServiceObjectives() { string testPrefix = "sqlcrudtest-"; string suiteName = this.GetType().FullName; string serverName = SqlManagementTestUtilities.GenerateName(testPrefix); SqlManagementTestUtilities.RunTestInNewV12Server(suiteName, "TestGetListServiceObjectives", testPrefix, (resClient, sqlClient, resourceGroup, server) => { var serviceObjectives = sqlClient.Servers.ListServiceObjectives(resourceGroup.Name, server.Name); foreach(ServiceObjective objective in serviceObjectives) { Assert.NotNull(objective.ServiceObjectiveName); Assert.NotNull(objective.IsDefault); Assert.NotNull(objective.IsSystem); Assert.NotNull(objective.Enabled); // Assert Get finds the service objective from List Assert.NotNull(sqlClient.Servers.GetServiceObjective(resourceGroup.Name, server.Name, objective.Name)); } }); } } }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using Microsoft.Azure.Management.Sql.Models; using Microsoft.Azure.Management.Sql; using Xunit; namespace Sql.Tests { public class ServiceObjectiveScenarioTests { [Fact] public void TestGetListServiceObjectives() { string testPrefix = "sqlcrudtest-"; string suiteName = this.GetType().FullName; SqlManagementTestUtilities.RunTestInNewV12Server(suiteName, "TestGetListServiceObjectives", testPrefix, (resClient, sqlClient, resourceGroup, server) => { var serviceObjectives = sqlClient.Servers.ListServiceObjectives(resourceGroup.Name, server.Name); foreach(ServiceObjective objective in serviceObjectives) { Assert.NotNull(objective.ServiceObjectiveName); Assert.NotNull(objective.IsDefault); Assert.NotNull(objective.IsSystem); Assert.NotNull(objective.Enabled); // Assert Get finds the service objective from List Assert.NotNull(sqlClient.Servers.GetServiceObjective(resourceGroup.Name, server.Name, objective.Name)); } }); } } }
Fix test failing in playback
Fix test failing in playback
C#
mit
atpham256/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,hyonholee/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,peshen/azure-sdk-for-net,stankovski/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,pilor/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,jamestao/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,hyonholee/azure-sdk-for-net,djyou/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,atpham256/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,hyonholee/azure-sdk-for-net,jamestao/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,shutchings/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,nathannfan/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,pilor/azure-sdk-for-net,nathannfan/azure-sdk-for-net,pilor/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,nathannfan/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,atpham256/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,jamestao/azure-sdk-for-net,shutchings/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,peshen/azure-sdk-for-net,stankovski/azure-sdk-for-net,djyou/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,hyonholee/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,peshen/azure-sdk-for-net,markcowl/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,shutchings/azure-sdk-for-net,jamestao/azure-sdk-for-net,hyonholee/azure-sdk-for-net,djyou/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net
9e230a8d9bcf6f3663cefe5a8ecf13ce4eae2c73
Mono.Debugger.Cli/Commands/LocalsCommand.cs
Mono.Debugger.Cli/Commands/LocalsCommand.cs
using System.Collections.Generic; using Mono.Debugger.Cli.Debugging; using Mono.Debugger.Cli.Logging; namespace Mono.Debugger.Cli.Commands { public sealed class LocalsCommand : ICommand { public string Name { get { return "Locals"; } } public string Description { get { return "Prints local variables."; } } public IEnumerable<string> Arguments { get { return Argument.None(); } } public void Execute(CommandArguments args) { var backtrace = SoftDebugger.Backtrace; if (backtrace == null) { Logger.WriteErrorLine("No backtrace available."); return; } var frame = backtrace.CurrentStackFrame; if (frame == null) { Logger.WriteErrorLine("No stack frame available."); return; } foreach (var local in frame.GetLocalVariables()) Logger.WriteInfoLine("[{0}] {1}: {2}", local.TypeName, local.Name, local.DisplayValue); } } }
using System.Collections.Generic; using Mono.Debugger.Cli.Debugging; using Mono.Debugger.Cli.Logging; namespace Mono.Debugger.Cli.Commands { public sealed class LocalsCommand : ICommand { public string Name { get { return "Locals"; } } public string Description { get { return "Prints local variables."; } } public IEnumerable<string> Arguments { get { return Argument.None(); } } public void Execute(CommandArguments args) { var backtrace = SoftDebugger.Backtrace; if (backtrace == null) { Logger.WriteErrorLine("No backtrace available."); return; } var frame = backtrace.CurrentStackFrame; if (frame == null) { Logger.WriteErrorLine("No stack frame available."); return; } foreach (var local in frame.GetLocalVariables()) if (!local.IsUnknown && !local.IsError && !local.IsNotSupported) Logger.WriteInfoLine("[{0}] {1}: {2}", local.TypeName, local.Name, local.DisplayValue); } } }
Make local evaluation a little safer.
Make local evaluation a little safer.
C#
mit
GunioRobot/sdb-cli,GunioRobot/sdb-cli
5f670fca966e5bba20f63cbd123508201258da0c
OrienteeringToolWPF/DAO/CompetitorHelper.cs
OrienteeringToolWPF/DAO/CompetitorHelper.cs
using OrienteeringToolWPF.Model; using OrienteeringToolWPF.Utils; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OrienteeringToolWPF.DAO { public static class CompetitorHelper { public static List<Competitor> CompetitorsJoinedWhereRelayId(long RelayId) { var db = DatabaseUtils.GetDatabase(); dynamic resultsAlias, punchAlias; var CompetitorList = (List<Competitor>)db.Competitors.FindAllByRelayId(RelayId) .LeftJoin(db.Results, out resultsAlias) .On(db.Results.Chip == db.Competitors.Chip) .LeftJoin(db.Punches, out punchAlias) .On(db.Punches.Chip == db.Competitors.Chip) .With(resultsAlias) .With(punchAlias); foreach (var competitor in CompetitorList) { var punches = (List<Punch>)competitor.Punches; try { punches?.Sort(); Punch.CalculateDeltaStart(ref punches, competitor.Result.StartTime); Punch.CalculateDeltaPrevious(ref punches); } catch (ArgumentNullException) { } competitor.Punches = punches; } return CompetitorList; } } }
using OrienteeringToolWPF.Model; using OrienteeringToolWPF.Utils; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OrienteeringToolWPF.DAO { public static class CompetitorHelper { public static List<Competitor> CompetitorsJoinedWhereRelayId(long RelayId) { var db = DatabaseUtils.GetDatabase(); dynamic resultsAlias, punchAlias; var CompetitorList = (List<Competitor>)db.Competitors.FindAllByRelayId(RelayId) .LeftJoin(db.Results, out resultsAlias) .On(db.Results.Chip == db.Competitors.Chip) .LeftJoin(db.Punches, out punchAlias) .On(db.Punches.Chip == db.Competitors.Chip) .With(resultsAlias) .With(punchAlias); foreach (var competitor in CompetitorList) { var punches = (List<Punch>)competitor.Punches; try { punches?.Sort(); Punch.CalculateDeltaStart(ref punches, competitor.Result.StartTime); Punch.CalculateDeltaPrevious(ref punches); } catch (NullReferenceException) { } competitor.Punches = punches; } return CompetitorList; } } }
Change exception to proper class
Change exception to proper class
C#
mit
iceslab/OrienteeringToolWPF
ea6dd98b9351bcc846497a8c71b6da235031d382
LiveScoreUpdateSystem/LiveScoreUpdateSystem.Data.Models/User.cs
LiveScoreUpdateSystem/LiveScoreUpdateSystem.Data.Models/User.cs
using LiveScoreUpdateSystem.Data.Models.Contracts; using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.EntityFramework; using System; using System.Security.Claims; using System.Threading.Tasks; namespace LiveScoreUpdateSystem.Data.Models { public class User : IdentityUser, IDeletable, IAuditable, IDataModel { public DateTime? CreatedOn { get; set; } public DateTime? ModifiedOn { get; set; } public bool IsDeleted { get; set; } public DateTime? DeletedOn { get; set; } Guid IDataModel.Id => throw new NotImplementedException(); public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<User> manager) { // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie); // Add custom user claims here return userIdentity; } } }
using LiveScoreUpdateSystem.Data.Models.Contracts; using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.EntityFramework; using System; using System.Security.Claims; using System.Threading.Tasks; namespace LiveScoreUpdateSystem.Data.Models { public class User : IdentityUser, IDeletable, IAuditable, IDataModel { public DateTime? CreatedOn { get; set; } public DateTime? ModifiedOn { get; set; } public bool IsDeleted { get; set; } public DateTime? DeletedOn { get; set; } Guid IDataModel.Id { get; } public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<User> manager) { // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie); // Add custom user claims here return userIdentity; } } }
Remove fat arrow getter because of appveyor .net version support
Remove fat arrow getter because of appveyor .net version support
C#
mit
BorislavBorisov22/LiveScoreUpdateSystem,BorislavBorisov22/LiveScoreUpdateSystem
77d7af42199bba5ba7eb7417d30fd4440d83628d
Battery-Commander.Web/Views/Shared/DisplayTemplates/VehicleStatus.cshtml
Battery-Commander.Web/Views/Shared/DisplayTemplates/VehicleStatus.cshtml
@model Vehicle @switch(Model.Status) { case Vehicle.VehicleStatus.FMC: <span class="label label-success">FMC</span> return; case Vehicle.VehicleStatus.NMC: <span class="label label-danger">NMC</span> return; default: <span class="label label-warning">@Model</span> return; }
@model Vehicle @switch(Model.Status) { case Vehicle.VehicleStatus.FMC: <span class="label label-success">FMC</span> return; case Vehicle.VehicleStatus.NMC: <span class="label label-danger">NMC</span> return; case Vehicle.VehicleStatus.Unknown: <span class="label label-warning">Unknown</span> return; }
Fix for Unknown status display
Fix for Unknown status display
C#
mit
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
bd8cda39537bb2716b78e0ad9c4bce9cbaba6c2a
src/SharpGraphEditor/Controls/GraphElements/VertexControl.xaml.cs
src/SharpGraphEditor/Controls/GraphElements/VertexControl.xaml.cs
using System.Windows.Controls.Primitives; namespace SharpGraphEditor.Controls.GraphElements { /// <summary> /// Логика взаимодействия для VertexControl.xaml /// </summary> public partial class VertexControl : Thumb { public VertexControl() { InitializeComponent(); } } }
using System.Windows.Controls.Primitives; namespace SharpGraphEditor.Controls.GraphElements { /// <summary> /// Логика взаимодействия для VertexControl.xaml /// </summary> public partial class VertexControl : Thumb { public VertexControl() { InitializeComponent(); SizeChanged += (_, __) => { var centerX = ActualWidth / 2; var centerY = ActualHeight / 2; Margin = new System.Windows.Thickness(-centerX, -centerY, centerX, centerY); }; } } }
Fix bug: incorrectly determines the center of the top
Fix bug: incorrectly determines the center of the top
C#
apache-2.0
AceSkiffer/SharpGraphEditor
0153692d478d48faca61d62adecd9d2ff7bb8859
sample/Responsive/Startup.cs
sample/Responsive/Startup.cs
// Copyright (c) 2014-2020 Sarin Na Wangkanai, All Rights Reserved. // The Apache v2. See License.txt in the project root for license information. using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; namespace Responsive { public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { // Add responsive services. services.AddDetection(); // Add framework services. services.AddControllersWithViews(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseDetection(); app.UseRouting(); app.UseEndpoints(endpoints => endpoints.MapDefaultControllerRoute()); } } }
// Copyright (c) 2014-2020 Sarin Na Wangkanai, All Rights Reserved. // The Apache v2. See License.txt in the project root for license information. using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; namespace Responsive { public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { // Add responsive services. services.AddDetection(); // Add framework services. services.AddControllersWithViews(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseDetection(); app.UseRouting(); app.UseEndpoints( endpoints => { endpoints.MapControllerRoute( "default", "{controller=Home}/{action=Index}/{id?}"); endpoints.MapControllerRoute( "areas", "{area:exists}/{controller=Home}/{action=Index}/{id?}" ); }); } } }
Set endpoint routing in responsive sample web app
Set endpoint routing in responsive sample web app
C#
apache-2.0
wangkanai/Detection
c2c63dd534dda428d5545246b79c27cb67d78dd3
src/CodeComb.AspNet.Upload/Models/ModelBuilderExtensions.cs
src/CodeComb.AspNet.Upload/Models/ModelBuilderExtensions.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.Data.Entity; namespace CodeComb.AspNet.Upload.Models { public static class ModelBuilderExtensions { public static ModelBuilder SetupBlob(this ModelBuilder self) { return self.Entity<File>(e => { e.HasIndex(x => x.Time); e.HasIndex(x => x.FileName); }); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.Data.Entity; namespace CodeComb.AspNet.Upload.Models { public static class ModelBuilderExtensions { public static ModelBuilder SetupFiles(this ModelBuilder self) { return self.Entity<File>(e => { e.HasIndex(x => x.Time); e.HasIndex(x => x.FileName); }); } } }
Rename setup blob => setup files
Rename setup blob => setup files
C#
apache-2.0
CodeComb/CodeComb.AspNet.Upload,CodeComb/CodeComb.AspNet.Upload
dd86e3d43743643f42ba6b9b9d86ad778358939e
Xamarin.Forms.GoogleMaps/Xamarin.Forms.GoogleMaps/Extensions/GeoConstants.cs
Xamarin.Forms.GoogleMaps/Xamarin.Forms.GoogleMaps/Extensions/GeoConstants.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Xamarin.Forms.GoogleMaps { public static class GeoConstants { public const double EarthRadiusKm = 6371; public const double EarthCircumferenceKm = EarthRadiusKm * 2 * Math.PI; public const double MetersPerMile = 1609.344; public const double MetersPerKilometer = 1000.0; } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Xamarin.Forms.GoogleMaps { internal static class GeoConstants { public const double EarthRadiusKm = 6371; public const double EarthCircumferenceKm = EarthRadiusKm * 2 * Math.PI; public const double MetersPerMile = 1609.344; public const double MetersPerKilometer = 1000.0; } }
Change classe accessibility to internal
Change classe accessibility to internal
C#
mit
JKennedy24/Xamarin.Forms.GoogleMaps,amay077/Xamarin.Forms.GoogleMaps,quesera2/Xamarin.Forms.GoogleMaps,JKennedy24/Xamarin.Forms.GoogleMaps
4142ba5bff4438150198811a4a422c86ee852c0b
CodeHub/ViewModels/Settings/NofiticationSettingsViewModel.cs
CodeHub/ViewModels/Settings/NofiticationSettingsViewModel.cs
using CodeHub.Services; using GalaSoft.MvvmLight; namespace CodeHub.ViewModels.Settings { public class NofiticationSettingsViewModel : ObservableObject { private bool _isToastEnabled = SettingsService.Get<bool>(SettingsKeys.IsToastEnabled); public bool IsToastEnabled { get => _isToastEnabled; set { if (_isToastEnabled != value) { _isToastEnabled = value; SettingsService.Save(SettingsKeys.IsToastEnabled, value); RaisePropertyChanged(); } } } public NofiticationSettingsViewModel() { } } }
using CodeHub.Services; using GalaSoft.MvvmLight; namespace CodeHub.ViewModels.Settings { public class NofiticationSettingsViewModel : ObservableObject { private bool _isToastEnabled = SettingsService.Get<bool>(SettingsKeys.IsToastEnabled); private bool _isLiveTilesEnabled = SettingsService.Get<bool>(SettingsKeys.IsLiveTilesEnabled); private bool _isLiveTilesBadgeEnabled = SettingsService.Get<bool>(SettingsKeys.IsLiveTilesBadgeEnabled); private bool _isLiveTileUpdateAllBadgesEnabled = SettingsService.Get<bool>(SettingsKeys.IsLiveTileUpdateAllBadgesEnabled); public bool IsToastEnabled { get => _isToastEnabled; set { if (_isToastEnabled != value) { _isToastEnabled = value; SettingsService.Save(SettingsKeys.IsToastEnabled, value); RaisePropertyChanged(() => IsToastEnabled); } } } public bool IsLiveTilesEnabled { get => _isLiveTilesEnabled; set { if (_isLiveTilesEnabled != value) { _isLiveTilesEnabled = value; SettingsService.Save(SettingsKeys.IsLiveTilesEnabled, value); RaisePropertyChanged(() => IsLiveTilesEnabled); } if (!value && IsLiveTilesBadgeEnabled) { IsLiveTilesBadgeEnabled = false; } } } public bool IsLiveTilesBadgeEnabled { get => _isLiveTilesBadgeEnabled; set { if (_isLiveTilesBadgeEnabled != value) { _isLiveTilesBadgeEnabled = value; SettingsService.Save(SettingsKeys.IsLiveTilesBadgeEnabled, value); RaisePropertyChanged(() => IsLiveTilesBadgeEnabled); } if (!value && IsAllBadgesUpdateEnabled) { IsAllBadgesUpdateEnabled = false; } } } public bool IsAllBadgesUpdateEnabled { get => _isLiveTilesEnabled; set { if (_isLiveTileUpdateAllBadgesEnabled != value) { _isLiveTileUpdateAllBadgesEnabled = value; SettingsService.Save(SettingsKeys.IsLiveTileUpdateAllBadgesEnabled, value); RaisePropertyChanged(() => IsAllBadgesUpdateEnabled); } } } public NofiticationSettingsViewModel() { } } }
Update NotificationSettingsVM for LiveTiles settings
Update NotificationSettingsVM for LiveTiles settings
C#
mit
aalok05/CodeHub
c3d2f81eabcdd95c4414323ca830374aa21f47a7
CodeCamp/Helpers/Settings.cs
CodeCamp/Helpers/Settings.cs
// Helpers/Settings.cs using Refractored.Xam.Settings; using Refractored.Xam.Settings.Abstractions; namespace CodeCamp.Helpers { /// <summary> /// This is the Settings static class that can be used in your Core solution or in any /// of your client applications. All settings are laid out the same exact way with getters /// and setters. /// </summary> public static class Settings { private static ISettings AppSettings { get { return CrossSettings.Current; } } #region Setting Constants private const string SettingsKey = "settings_key"; private static readonly string SettingsDefault = string.Empty; #endregion public static string GeneralSettings { get { return AppSettings.GetValueOrDefault(SettingsKey, SettingsDefault); } set { //if value has changed then save it! if (AppSettings.AddOrUpdateValue(SettingsKey, value)) AppSettings.Save(); } } } }
// Helpers/Settings.cs using Refractored.Xam.Settings; using Refractored.Xam.Settings.Abstractions; namespace CodeCamp.Helpers { /// <summary> /// This is the Settings static class that can be used in your Core solution or in any /// of your client applications. All settings are laid out the same exact way with getters /// and setters. /// </summary> public static class Settings { private static ISettings AppSettings { get { return CrossSettings.Current; } } #region Setting Constants private const string UsernameKey = "username_key"; private static readonly string UsernameDefault = string.Empty; private const string MasterConferenceKey = "masterconference_key"; private static readonly int MasterConferenceDefault = -1; private const string ConferenceKey = "conference_key"; private static readonly int ConferenceDefault = -1; #endregion public static string UsernameSettings { get { return AppSettings.GetValueOrDefault(UsernameKey, UsernameDefault); } set { if (AppSettings.AddOrUpdateValue(UsernameKey, value)) AppSettings.Save(); } } public static int MasterConference { get { return AppSettings.GetValueOrDefault(MasterConferenceKey, MasterConferenceDefault); } set { if (AppSettings.AddOrUpdateValue(MasterConferenceKey, value)) AppSettings.Save(); } } public static int Conference { get { return AppSettings.GetValueOrDefault(ConferenceKey, ConferenceDefault); } set { if (AppSettings.AddOrUpdateValue(ConferenceKey, value)) AppSettings.Save(); } } } }
Update settings with username and conference ids
Update settings with username and conference ids
C#
mit
jamesmontemagno/code-camp-app
e6757a4c42bef75cbca89d11bc3951b456f71ab7
CyLR/src/CollectionPaths.cs
CyLR/src/CollectionPaths.cs
using System; using System.IO; using System.Collections.Generic; namespace CyLR { internal static class CollectionPaths { public static List<string> GetPaths(Arguments arguments) { var paths = new List<string> { @"C:\Windows\System32\config", @"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup", @"C:\Windows\Prefetch", @"C:\Windows\Tasks", @"C:\Windows\SchedLgU.Txt", @"C:\Windows\System32\winevt\logs", @"C:\Windows\System32\drivers\etc\hosts", @"C:\$MFT" }; if (Platform.IsUnixLike()) { paths = new List<string> { "/root/.bash_history", "/var/logs" }; } if (arguments.CollectionFilePath != ".") { if (File.Exists(arguments.CollectionFilePath)) { paths.Clear(); paths.AddRange(File.ReadAllLines(arguments.CollectionFilePath)); } else { Console.WriteLine("Error: Could not find file: {0}", arguments.CollectionFilePath); Console.WriteLine("Exiting"); throw new ArgumentException(); } } return paths; } } }
using System; using System.IO; using System.Collections.Generic; namespace CyLR { internal static class CollectionPaths { public static List<string> GetPaths(Arguments arguments) { var paths = new List<string> { @"C:\Windows\System32\config", @"C:\Windows\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup", @"C:\Windows\Prefetch", @"C:\Windows\Tasks", @"C:\Windows\SchedLgU.Txt", @"C:\Windows\System32\winevt\logs", @"C:\Windows\System32\drivers\etc\hosts", @"C:\$MFT" }; if (Platform.IsUnixLike()) { paths = new List<string> { "/root/.bash_history", "/var/logs" }; } if (arguments.CollectionFilePath != ".") { if (File.Exists(arguments.CollectionFilePath)) { paths.Clear(); paths.AddRange(File.ReadAllLines(arguments.CollectionFilePath)); } else { Console.WriteLine("Error: Could not find file: {0}", arguments.CollectionFilePath); Console.WriteLine("Exiting"); throw new ArgumentException(); } } return paths; } } }
Revert "Fixing bad default path."
Revert "Fixing bad default path." This reverts commit 28f7d396adb79d66431aa7fad1c4c6b52f7bc125.
C#
apache-2.0
rough007/PythLR
718835255f48e015d7f5741b4eb38cd1d47d9598
BTCPayServer/Views/Shared/_StatusMessage.cshtml
BTCPayServer/Views/Shared/_StatusMessage.cshtml
@{ var parsedModel = TempData.GetStatusMessageModel(); } @if (parsedModel != null) { <div class="alert alert-@parsedModel.SeverityCSS @(parsedModel.AllowDismiss? "alert-dismissible":"" )" role="alert"> @if (parsedModel.AllowDismiss) { <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> } @if (!string.IsNullOrEmpty(parsedModel.Message)) { @parsedModel.Message } @if (!string.IsNullOrEmpty(parsedModel.Html)) { @Safe.Raw(parsedModel.Html) } </div> }
@{ var parsedModel = TempData.GetStatusMessageModel(); } @if (parsedModel != null) { <div class="alert alert-@parsedModel.SeverityCSS @(parsedModel.AllowDismiss? "alert-dismissible":"" ) mb-5" role="alert"> @if (parsedModel.AllowDismiss) { <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> } @if (!string.IsNullOrEmpty(parsedModel.Message)) { @parsedModel.Message } @if (!string.IsNullOrEmpty(parsedModel.Html)) { @Safe.Raw(parsedModel.Html) } </div> }
Improve spacing for status messages
Improve spacing for status messages
C#
mit
btcpayserver/btcpayserver,btcpayserver/btcpayserver,btcpayserver/btcpayserver,btcpayserver/btcpayserver
cd3edc869c3455fd77aa0348566faccd079a1b97
osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineButton.cs
osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineButton.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Edit.Timing; using osuTK; using osuTK.Graphics; namespace osu.Game.Screens.Edit.Compose.Components.Timeline { public class TimelineButton : CompositeDrawable { public Action Action; public readonly BindableBool Enabled = new BindableBool(true); public IconUsage Icon { get => button.Icon; set => button.Icon = value; } private readonly TimelineIconButton button; public TimelineButton() { InternalChild = button = new TimelineIconButton { Action = () => Action?.Invoke() }; button.Enabled.BindTo(Enabled); Width = button.Width; } protected override void Update() { base.Update(); button.Size = new Vector2(button.Width, DrawHeight); } private class TimelineIconButton : IconButton { public TimelineIconButton() { Anchor = Anchor.Centre; Origin = Anchor.Centre; IconColour = OsuColour.Gray(0.35f); IconHoverColour = Color4.White; HoverColour = OsuColour.Gray(0.25f); FlashColour = OsuColour.Gray(0.5f); Add(new RepeatingButtonBehaviour(this)); } protected override HoverSounds CreateHoverSounds(HoverSampleSet sampleSet) => new HoverSounds(sampleSet); } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Game.Graphics.UserInterface; using osu.Game.Overlays; using osu.Game.Screens.Edit.Timing; namespace osu.Game.Screens.Edit.Compose.Components.Timeline { public class TimelineButton : IconButton { [BackgroundDependencyLoader] private void load(OverlayColourProvider colourProvider) { // These are using colourProvider but don't match the design. // Just something to fit until someone implements the updated design. IconColour = colourProvider.Background1; IconHoverColour = colourProvider.Content2; HoverColour = colourProvider.Background1; FlashColour = colourProvider.Content2; Add(new RepeatingButtonBehaviour(this)); } protected override HoverSounds CreateHoverSounds(HoverSampleSet sampleSet) => new HoverSounds(sampleSet); } }
Remove unnecessary nesting of `IconButton` and update design a touch
Remove unnecessary nesting of `IconButton` and update design a touch
C#
mit
NeoAdonis/osu,ppy/osu,peppy/osu,NeoAdonis/osu,peppy/osu,ppy/osu,NeoAdonis/osu,peppy/osu,ppy/osu
739c906587018aaade88194708224c14475fb735
MvcNG/Views/ngApp/ngConstants.cshtml
MvcNG/Views/ngApp/ngConstants.cshtml
<script type="text/javascript"> angular.module("myapp") .constant("WAIT", @ViewBag.WAIT) .constant("NAME", @ViewBag.NAME) ; </script>
<script type="text/javascript"> angular.module("myapp") .constant("WAIT", @ViewBag.WAIT) .constant("NAME", '@ViewBag.NAME') ; </script>
Fix string injection of NAME from ViewBag to ng.constant
Fix string injection of NAME from ViewBag to ng.constant
C#
mit
dmorosinotto/MVC_NG_TS,dmorosinotto/MVC_NG_TS
4ceb145f649eb87cf0ebd5ead04743ae953f1c49
src/Glimpse.Server.Channel.Agent.Http/Broker/HttpChannelReceiver.cs
src/Glimpse.Server.Channel.Agent.Http/Broker/HttpChannelReceiver.cs
using Glimpse.Web; using Microsoft.AspNet.Http; using Newtonsoft.Json; using System.IO; using System.Text; using Microsoft.AspNet.Builder; namespace Glimpse.Server.Web { public class HttpChannelReceiver : IMiddlewareResourceComposer { private readonly IServerBroker _messageServerBus; public HttpChannelReceiver(IServerBroker messageServerBus) { _messageServerBus = messageServerBus; } public void Register(IApplicationBuilder appBuilder) { appBuilder.Map("/agent", chuldApp => chuldApp.Run(async context => { var envelope = ReadMessage(context.Request); _messageServerBus.SendMessage(envelope); // TEST CODE ONLY!!!! var response = context.Response; response.Headers.Set("Content-Type", "text/plain"); var data = Encoding.UTF8.GetBytes(envelope.Payload); await response.Body.WriteAsync(data, 0, data.Length); // TEST CODE ONLY!!!! })); } private Message ReadMessage(HttpRequest request) { var reader = new StreamReader(request.Body); var text = reader.ReadToEnd(); var message = JsonConvert.DeserializeObject<Message>(text); return message; } } }
using Glimpse.Web; using Microsoft.AspNet.Http; using Newtonsoft.Json; using System.IO; using System.Text; using Microsoft.AspNet.Builder; namespace Glimpse.Server.Web { public class HttpChannelReceiver : IMiddlewareResourceComposer { private readonly IServerBroker _messageServerBus; public HttpChannelReceiver(IServerBroker messageServerBus) { _messageServerBus = messageServerBus; } public void Register(IApplicationBuilder appBuilder) { appBuilder.Map("/agent", childApp => childApp.Run(async context => { var envelope = ReadMessage(context.Request); _messageServerBus.SendMessage(envelope); // TODO: Really should do something better var response = context.Response; response.Headers.Set("Content-Type", "text/plain"); var data = Encoding.UTF8.GetBytes("OK"); await response.Body.WriteAsync(data, 0, data.Length); })); } private Message ReadMessage(HttpRequest request) { var reader = new StreamReader(request.Body); var text = reader.ReadToEnd(); var message = JsonConvert.DeserializeObject<Message>(text); return message; } } }
Simplify the response from the server on the agent-server http channel
Simplify the response from the server on the agent-server http channel
C#
mit
pranavkm/Glimpse.Prototype,pranavkm/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,Glimpse/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,pranavkm/Glimpse.Prototype,pranavkm/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,Glimpse/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,Glimpse/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype
5f7ee9e5ff613dea26b75257bb3a66c95f1af6d0
src/Joinrpg.Web.Identity/ClaimInfoBuilder.cs
src/Joinrpg.Web.Identity/ClaimInfoBuilder.cs
using System.Collections.Generic; using JoinRpg.DataModel; using JoinRpg.Domain; using Claim = System.Security.Claims.Claim; using ClaimTypes = System.Security.Claims.ClaimTypes; namespace Joinrpg.Web.Identity { internal static class ClaimInfoBuilder { public static IList<Claim> ToClaimsList(this User dbUser) { return new List<Claim> { new Claim(ClaimTypes.Email, dbUser.Email), new Claim(JoinClaimTypes.DisplayName, dbUser.GetDisplayName()), new Claim(JoinClaimTypes.AvatarId, dbUser.SelectedAvatarId?.ToString()) }; } } }
using System.Collections.Generic; using JoinRpg.DataModel; using JoinRpg.Domain; using Claim = System.Security.Claims.Claim; using ClaimTypes = System.Security.Claims.ClaimTypes; namespace Joinrpg.Web.Identity { internal static class ClaimInfoBuilder { public static IList<Claim> ToClaimsList(this User dbUser) { var claimList = new List<Claim> { new Claim(ClaimTypes.Email, dbUser.Email), new Claim(JoinClaimTypes.DisplayName, dbUser.GetDisplayName()), }; if (dbUser.SelectedAvatarId is not null) { //TODO: When we fix all avatars, it will be not required check claimList.Add(new Claim(JoinClaimTypes.AvatarId, dbUser.SelectedAvatarId?.ToString())); } return claimList; } } }
Fix problem with missing avatars
Fix problem with missing avatars
C#
mit
joinrpg/joinrpg-net,leotsarev/joinrpg-net,leotsarev/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net,leotsarev/joinrpg-net,joinrpg/joinrpg-net,joinrpg/joinrpg-net
d6e917c44812dafc2d4bd40111a19d3142a9b1ed
Nubot.Interfaces/RobotPluginBase.cs
Nubot.Interfaces/RobotPluginBase.cs
namespace Nubot.Abstractions { using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; public abstract class RobotPluginBase : IRobotPlugin { protected readonly IRobot Robot; protected RobotPluginBase(string pluginName, IRobot robot) { Name = pluginName; Robot = robot; HelpMessages = new List<string>(); } static RobotPluginBase() { ExecutingDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); BasePluginsDirectory = Path.Combine(ExecutingDirectory, "plugins"); } public string Name { get; protected set; } public static string ExecutingDirectory { get; private set; } public static string BasePluginsDirectory { get; private set; } public IEnumerable<string> HelpMessages { get; protected set; } public virtual IEnumerable<IPluginSetting> Settings { get { return Enumerable.Empty<IPluginSetting>();} } public virtual string MakeConfigFileName() { var pluginName = Name.Replace(" ", string.Empty); //Bug it is not defined that the plugin is from the root folder var file = string.Format("{0}.config", pluginName); var configFileName = Path.Combine(BasePluginsDirectory, file); return configFileName; } } }
namespace Nubot.Abstractions { using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; public abstract class RobotPluginBase : IRobotPlugin { protected readonly IRobot Robot; protected RobotPluginBase(string pluginName, IRobot robot) { Name = pluginName; Robot = robot; HelpMessages = new List<string>(); } static RobotPluginBase() { ExecutingDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); BasePluginsDirectory = Path.Combine(ExecutingDirectory, "plugins"); } public string Name { get; private set; } public static string ExecutingDirectory { get; private set; } public static string BasePluginsDirectory { get; private set; } public IEnumerable<string> HelpMessages { get; protected set; } public virtual IEnumerable<IPluginSetting> Settings { get { return Enumerable.Empty<IPluginSetting>();} } public virtual string MakeConfigFileName() { var pluginName = Name.Replace(" ", string.Empty); var file = string.Format("{0}.config", pluginName); return Directory.GetFiles(BasePluginsDirectory, file, SearchOption.AllDirectories).FirstOrDefault(); } } }
Read plugin settings from BasePluginsDirectory and all sub-directories
Read plugin settings from BasePluginsDirectory and all sub-directories
C#
mit
lionelplessis/Nubot,laurentkempe/Nubot,laurentkempe/Nubot,lionelplessis/Nubot
d77882c21bcc9ebb4379fd7e6ad6d04a1f2ea451
osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/SliderBodyPiece.cs
osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/SliderBodyPiece.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; using osu.Framework.Allocation; using osu.Game.Graphics; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; using osuTK; using osuTK.Graphics; namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components { public class SliderBodyPiece : BlueprintPiece<Slider> { private readonly ManualSliderBody body; public SliderBodyPiece() { InternalChild = body = new ManualSliderBody { AccentColour = Color4.Transparent }; } [BackgroundDependencyLoader] private void load(OsuColour colours) { body.BorderColour = colours.Yellow; } public override void UpdateFrom(Slider hitObject) { base.UpdateFrom(hitObject); body.PathRadius = hitObject.Scale * OsuHitObject.OBJECT_RADIUS; var vertices = new List<Vector2>(); hitObject.Path.GetPathToProgress(vertices, 0, 1); body.SetVertices(vertices); Size = body.Size; OriginPosition = body.PathOffset; } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; using osu.Framework.Allocation; using osu.Game.Graphics; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; using osuTK; using osuTK.Graphics; namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components { public class SliderBodyPiece : BlueprintPiece<Slider> { private readonly ManualSliderBody body; public SliderBodyPiece() { InternalChild = body = new ManualSliderBody { AccentColour = Color4.Transparent }; } [BackgroundDependencyLoader] private void load(OsuColour colours) { body.BorderColour = colours.Yellow; } public override void UpdateFrom(Slider hitObject) { base.UpdateFrom(hitObject); body.PathRadius = hitObject.Scale * OsuHitObject.OBJECT_RADIUS; var vertices = new List<Vector2>(); hitObject.Path.GetPathToProgress(vertices, 0, 1); body.SetVertices(vertices); Size = body.Size; OriginPosition = body.PathOffset; } public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => body.ReceivePositionalInputAt(screenSpacePos); } }
Fix slider selection input handled outside path
Fix slider selection input handled outside path
C#
mit
smoogipoo/osu,peppy/osu,UselessToucan/osu,smoogipoo/osu,ppy/osu,johnneijzen/osu,ppy/osu,peppy/osu,NeoAdonis/osu,UselessToucan/osu,ppy/osu,EVAST9919/osu,smoogipooo/osu,2yangk23/osu,UselessToucan/osu,NeoAdonis/osu,peppy/osu,NeoAdonis/osu,EVAST9919/osu,johnneijzen/osu,smoogipoo/osu,2yangk23/osu,peppy/osu-new
bbb4b412fff0d3e6a61a6ef42f1349f1cd0316da
src/Server/Bit.OwinCore/Middlewares/AspNetCoreAutofacDependencyInjectionMiddlewareConfiguration.cs
src/Server/Bit.OwinCore/Middlewares/AspNetCoreAutofacDependencyInjectionMiddlewareConfiguration.cs
using Autofac; using Autofac.Integration.Owin; using Bit.Owin.Contracts; using Bit.Owin.Middlewares; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using Microsoft.Owin; using Owin; using System; using System.Reflection; using System.Threading.Tasks; namespace Bit.OwinCore.Middlewares { public class AspNetCoreAutofacDependencyInjectionMiddlewareConfiguration : IOwinMiddlewareConfiguration { public virtual void Configure(IAppBuilder owinApp) { owinApp.Use<AspNetCoreAutofacDependencyInjectionMiddleware>(); owinApp.Use<AutofacScopeBasedDependencyResolverMiddleware>(); } } public class AspNetCoreAutofacDependencyInjectionMiddleware : OwinMiddleware { public AspNetCoreAutofacDependencyInjectionMiddleware(OwinMiddleware next) : base(next) { } static AspNetCoreAutofacDependencyInjectionMiddleware() { TypeInfo autofacConstantsType = typeof(OwinContextExtensions).GetTypeInfo().Assembly.GetType("Autofac.Integration.Owin.Constants").GetTypeInfo(); FieldInfo owinLifetimeScopeKeyField = autofacConstantsType.GetField("OwinLifetimeScopeKey", BindingFlags.Static | BindingFlags.NonPublic); if (owinLifetimeScopeKeyField == null) throw new InvalidOperationException($"OwinLifetimeScopeKey field could not be found in {nameof(OwinContextExtensions)} "); OwinLifetimeScopeKey = (string)owinLifetimeScopeKeyField.GetValue(null); } private static readonly string OwinLifetimeScopeKey; public override async Task Invoke(IOwinContext context) { HttpContext aspNetCoreContext = (HttpContext)context.Environment["Microsoft.AspNetCore.Http.HttpContext"]; aspNetCoreContext.Items["OwinContext"] = context; ILifetimeScope autofacScope = aspNetCoreContext.RequestServices.GetService<ILifetimeScope>(); context.Set(OwinLifetimeScopeKey, autofacScope); await Next.Invoke(context); } } }
using Autofac; using Autofac.Integration.Owin; using Bit.Owin.Contracts; using Bit.Owin.Middlewares; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using Microsoft.Owin; using Owin; using System.Threading.Tasks; namespace Bit.OwinCore.Middlewares { public class AspNetCoreAutofacDependencyInjectionMiddlewareConfiguration : IOwinMiddlewareConfiguration { public virtual void Configure(IAppBuilder owinApp) { owinApp.Use<AspNetCoreAutofacDependencyInjectionMiddleware>(); owinApp.Use<AutofacScopeBasedDependencyResolverMiddleware>(); } } public class AspNetCoreAutofacDependencyInjectionMiddleware : OwinMiddleware { public AspNetCoreAutofacDependencyInjectionMiddleware(OwinMiddleware next) : base(next) { } public override async Task Invoke(IOwinContext context) { HttpContext aspNetCoreContext = (HttpContext)context.Environment["Microsoft.AspNetCore.Http.HttpContext"]; aspNetCoreContext.Items["OwinContext"] = context; ILifetimeScope autofacScope = aspNetCoreContext.RequestServices.GetService<ILifetimeScope>(); context.SetAutofacLifetimeScope(autofacScope); await Next.Invoke(context); } } }
Use newly introduced autofac's SetAutofacLifetimeScope method to pass autofac scope from asp.net core pipeline to owin pipeline
Use newly introduced autofac's SetAutofacLifetimeScope method to pass autofac scope from asp.net core pipeline to owin pipeline
C#
mit
bit-foundation/bit-framework,bit-foundation/bit-framework,bit-foundation/bit-framework,bit-foundation/bit-framework
4e955324de40a614e8f2d3d20f67ece9d91e3e5f
Source/Lib/TraktApiSharp/Requests/WithoutOAuth/Shows/Seasons/TraktSeasonCommentsRequest.cs
Source/Lib/TraktApiSharp/Requests/WithoutOAuth/Shows/Seasons/TraktSeasonCommentsRequest.cs
namespace TraktApiSharp.Requests.WithoutOAuth.Shows.Seasons { using Enums; using Objects.Basic; using Objects.Get.Shows.Seasons; using System.Collections.Generic; internal class TraktSeasonCommentsRequest : TraktGetByIdSeasonRequest<TraktPaginationListResult<TraktSeasonComment>, TraktSeasonComment> { internal TraktSeasonCommentsRequest(TraktClient client) : base(client) { } internal TraktCommentSortOrder? Sorting { get; set; } protected override IDictionary<string, object> GetUriPathParameters() { var uriParams = base.GetUriPathParameters(); if (Sorting.HasValue && Sorting.Value != TraktCommentSortOrder.Unspecified) uriParams.Add("sorting", Sorting.Value.AsString()); return uriParams; } protected override string UriTemplate => "shows/{id}/seasons/{season}/comments/{sorting}"; protected override bool SupportsPagination => true; protected override bool IsListResult => true; } }
namespace TraktApiSharp.Requests.WithoutOAuth.Shows.Seasons { using Enums; using Objects.Basic; using Objects.Get.Shows.Seasons; using System.Collections.Generic; internal class TraktSeasonCommentsRequest : TraktGetByIdSeasonRequest<TraktPaginationListResult<TraktSeasonComment>, TraktSeasonComment> { internal TraktSeasonCommentsRequest(TraktClient client) : base(client) { } internal TraktCommentSortOrder? Sorting { get; set; } protected override IDictionary<string, object> GetUriPathParameters() { var uriParams = base.GetUriPathParameters(); if (Sorting.HasValue && Sorting.Value != TraktCommentSortOrder.Unspecified) uriParams.Add("sorting", Sorting.Value.AsString()); return uriParams; } protected override string UriTemplate => "shows/{id}/seasons/{season}/comments{/sorting}"; protected override bool SupportsPagination => true; protected override bool IsListResult => true; } }
Fix uri templates in season requests.
Fix uri templates in season requests.
C#
mit
henrikfroehling/TraktApiSharp
6653721c4b0a32875254ca5815817bb0b5647720
src/NQuery/Optimization/AggregationPhysicalOperatorChooser.cs
src/NQuery/Optimization/AggregationPhysicalOperatorChooser.cs
using System; using System.Collections; using System.Collections.Immutable; using System.Linq; using NQuery.Binding; namespace NQuery.Optimization { internal sealed class AggregationPhysicalOperatorChooser : BoundTreeRewriter { protected override BoundRelation RewriteGroupByAndAggregationRelation(BoundGroupByAndAggregationRelation node) { var input = RewriteRelation(node.Input); var sortedValues = node.Groups.Select(g => new BoundSortedValue(g, Comparer.Default)).ToImmutableArray(); var sortedInput = new BoundSortRelation(input, sortedValues); return new BoundStreamAggregatesRelation(sortedInput, node.Groups, node.Aggregates); } } }
using System; using System.Collections; using System.Collections.Immutable; using System.Linq; using NQuery.Binding; namespace NQuery.Optimization { internal sealed class AggregationPhysicalOperatorChooser : BoundTreeRewriter { protected override BoundRelation RewriteGroupByAndAggregationRelation(BoundGroupByAndAggregationRelation node) { var input = RewriteRelation(node.Input); var sortedValues = node.Groups.Select(g => new BoundSortedValue(g, Comparer.Default)).ToImmutableArray(); var sortedInput = sortedValues.Any() ? new BoundSortRelation(input, sortedValues) : input; return new BoundStreamAggregatesRelation(sortedInput, node.Groups, node.Aggregates); } } }
Fix bug which causes unnecessary sorts
Fix bug which causes unnecessary sorts We currently insert a sort node independent of whether the aggregation has any groups. Omit the sorting if we only need to aggregate.
C#
mit
terrajobst/nquery-vnext
28f3bc840f6034249404c23fd039cf4436cd0492
src/Stripe.net/Services/Terminal/Readers/ReaderListOptions.cs
src/Stripe.net/Services/Terminal/Readers/ReaderListOptions.cs
namespace Stripe.Terminal { using System; using Newtonsoft.Json; public class ReaderListOptions : ListOptions { [JsonProperty("location")] public string Location { get; set; } [Obsolete("This feature has been deprecated and should not be used moving forward.")] [JsonProperty("operator_account")] public string OperatorAccount { get; set; } } }
namespace Stripe.Terminal { using System; using Newtonsoft.Json; public class ReaderListOptions : ListOptions { /// <summary> /// A location ID to filter the response list to only readers at the specific location. /// </summary> [JsonProperty("location")] public string Location { get; set; } /// <summary> /// A status filter to filter readers to only offline or online readers. Possible values /// are <c>offline</c> and <c>online</c>. /// </summary> [JsonProperty("status")] public string Status { get; set; } [Obsolete("This feature has been deprecated and should not be used moving forward.")] [JsonProperty("operator_account")] public string OperatorAccount { get; set; } } }
Support `Status` filter when listing Terminal `Reader`s
Support `Status` filter when listing Terminal `Reader`s
C#
apache-2.0
stripe/stripe-dotnet
c533e4cf675a0f8300034f5086e22a7604750225
src/Microsoft.Azure.WebJobs.ServiceBus/EventHubs/EventHubTriggerAttribute.cs
src/Microsoft.Azure.WebJobs.ServiceBus/EventHubs/EventHubTriggerAttribute.cs
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using System; using Microsoft.Azure.WebJobs.Description; namespace Microsoft.Azure.WebJobs.ServiceBus { /// <summary> /// Setup an 'trigger' on a parameter to listen on events from an event hub. /// </summary> [AttributeUsage(AttributeTargets.Parameter)] [Binding] public sealed class EventHubTriggerAttribute : Attribute { /// <summary> /// Create an instance of this attribute. /// </summary> /// <param name="eventHubName">Event hub to listen on for messages. </param> public EventHubTriggerAttribute(string eventHubName) { this.EventHubName = eventHubName; } /// <summary> /// Name of the event hub. /// </summary> public string EventHubName { get; private set; } /// <summary> /// Optional Name of the consumer group. If missing, then use the default name, "$Default" /// </summary> public string ConsumerGroup { get; set; } } }
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using System; using Microsoft.Azure.WebJobs.Description; namespace Microsoft.Azure.WebJobs.ServiceBus { /// <summary> /// Setup an 'trigger' on a parameter to listen on events from an event hub. /// </summary> [AttributeUsage(AttributeTargets.Parameter)] [Binding] public sealed class EventHubTriggerAttribute : Attribute { /// <summary> /// Create an instance of this attribute. /// </summary> /// <param name="eventHubName">Event hub to listen on for messages. </param> public EventHubTriggerAttribute(string eventHubName) { this.EventHubName = eventHubName; } /// <summary> /// Name of the event hub. /// </summary> public string EventHubName { get; private set; } /// <summary> /// Optional Name of the consumer group. If missing, then use the default name, "$Default" /// </summary> public string ConsumerGroup { get; set; } /// <summary> /// Optional connection name. If missing, tries to use a registered event hub receiver. /// </summary> public string Connection { get; set; } } }
Add event hub connection property
Add event hub connection property
C#
mit
Azure/azure-webjobs-sdk,Azure/azure-webjobs-sdk
a4bb225f103bbbcbbeb1fcc5d9d7b3f06b758e71
Web/EndPoints/ExecuteEndPoint.cs
Web/EndPoints/ExecuteEndPoint.cs
using System; using System.Threading.Tasks; using System.Web.Mvc; using BookSleeve; using SignalR; namespace Compilify.Web.EndPoints { public class ExecuteEndPoint : PersistentConnection { /// <summary> /// Handle messages sent by the client.</summary> protected override Task OnReceivedAsync(string connectionId, string data) { var redis = DependencyResolver.Current.GetService<RedisConnection>(); var command = new ExecuteCommand { ClientId = connectionId, Code = data }; var message = Convert.ToBase64String(command.GetBytes()); redis.Lists.AddLast(0, "queue:execute", message); return Send(new { status = "ok" }); } } }
using System; using System.Threading.Tasks; using System.Web.Mvc; using BookSleeve; using SignalR; namespace Compilify.Web.EndPoints { public class ExecuteEndPoint : PersistentConnection { /// <summary> /// Handle messages sent by the client.</summary> protected override Task OnReceivedAsync(string connectionId, string data) { var redis = DependencyResolver.Current.GetService<RedisConnection>(); if (redis.State != RedisConnectionBase.ConnectionState.Open) { throw new InvalidOperationException("RedisConnection state is " + redis.State); } var command = new ExecuteCommand { ClientId = connectionId, Code = data }; var message = Convert.ToBase64String(command.GetBytes()); redis.Lists.AddLast(0, "queue:execute", message); return Send(new { status = "ok" }); } } }
Throw an exception if the Redis connection is not open
Throw an exception if the Redis connection is not open
C#
mit
vendettamit/compilify,vendettamit/compilify,jrusbatch/compilify,appharbor/ConsolR,appharbor/ConsolR,jrusbatch/compilify
28f3f005e451aca980b56325fab805bd01f285ab
Norma/ViewModels/LibraryViewModel.cs
Norma/ViewModels/LibraryViewModel.cs
using System.Diagnostics; using System.Windows.Input; using Norma.Models; using Norma.ViewModels.Internal; using Prism.Commands; namespace Norma.ViewModels { internal class LibraryViewModel : ViewModel { private readonly Library _library; public string Name => _library.Name; public string Url => _library.Url; public string License => _library.License; public LibraryViewModel(Library library) { _library = library; } #region OpenHyperlinkCommand private ICommand _openHyperlinkCommand; public ICommand OpenHyperlinkCommand => _openHyperlinkCommand ?? (_openHyperlinkCommand = new DelegateCommand(OpenHyperlink)); private void OpenHyperlink() => Process.Start(Url); #endregion } }
using System.Diagnostics; using System.Windows.Input; using Norma.Models; using Norma.ViewModels.Internal; using Prism.Commands; namespace Norma.ViewModels { internal class LibraryViewModel : ViewModel { private readonly Library _library; public string Name => _library.Name; public string Url => _library.Url.Replace("https://", "").Replace("http://", ""); public string License => _library.License; public LibraryViewModel(Library library) { _library = library; } #region OpenHyperlinkCommand private ICommand _openHyperlinkCommand; public ICommand OpenHyperlinkCommand => _openHyperlinkCommand ?? (_openHyperlinkCommand = new DelegateCommand(OpenHyperlink)); private void OpenHyperlink() => Process.Start(_library.Url); #endregion } }
Remove protocol from licenses view.
Remove protocol from licenses view.
C#
mit
fuyuno/Norma
3770e63d4ff6a5e7a464d3c39525f5a171b59a02
CoffeeFilter.UITests.Shared/UITestsHelpers.cs
CoffeeFilter.UITests.Shared/UITestsHelpers.cs
using System; using System.ComponentModel; namespace CoffeeFilter.UITests.Shared { public static class UITestsHelpers { public static string XTCApiKey { get; } = "024b0d715a7e9c22388450cf0069cb19"; public static TestType SelectedTest { get; set; } public enum TestType { NoConnection, ParseError, OpenCoffee, ClosedCoffee, NoLocations, UserMoved } } public static class TestTypeExtensions { public static string ToFriendlyString(this UITestsHelpers.TestType me) { switch(me) { case UITestsHelpers.TestType.NoConnection: return "No Internet Connection"; case UITestsHelpers.TestType.ParseError: return "Parse Error"; case UITestsHelpers.TestType.OpenCoffee: return "Open Coffee Locations"; case UITestsHelpers.TestType.ClosedCoffee: return "Closed Coffee Locations"; case UITestsHelpers.TestType.NoLocations: return "No Locations Around"; case UITestsHelpers.TestType.UserMoved: return "User Moved and Refreshed"; } return string.Empty; } } }
using System; using System.ComponentModel; namespace CoffeeFilter.UITests.Shared { public static class UITestsHelpers { public static string XTCApiKey { get; } = "024b0d715a7e9c22388450cf0069cb19"; public static TestType SelectedTest { get; set; } public enum TestType { OpenCoffee = 0, NoConnection, ParseError, ClosedCoffee, NoLocations, UserMoved } } public static class TestTypeExtensions { public static string ToFriendlyString(this UITestsHelpers.TestType me) { switch(me) { case UITestsHelpers.TestType.NoConnection: return "No Internet Connection"; case UITestsHelpers.TestType.ParseError: return "Parse Error"; case UITestsHelpers.TestType.OpenCoffee: return "Open Coffee Locations"; case UITestsHelpers.TestType.ClosedCoffee: return "Closed Coffee Locations"; case UITestsHelpers.TestType.NoLocations: return "No Locations Around"; case UITestsHelpers.TestType.UserMoved: return "User Moved and Refreshed"; } return string.Empty; } } }
Set OpenCoffee as default test type
[CoffeeFilter.UITests] Set OpenCoffee as default test type
C#
mit
jamesmontemagno/Coffee-Filter,hoanganhx86/Coffee-Filter
fba11017f695f9b26b62c7670c1cd2d59232307d
src/CompaniesHouse.Tests/CompaniesHouseDocumentClientTests/CompaniesHouseDocumentClientTests.cs
src/CompaniesHouse.Tests/CompaniesHouseDocumentClientTests/CompaniesHouseDocumentClientTests.cs
using System; using System.IO; using System.Net.Http; using System.Threading.Tasks; using CompaniesHouse.Response.Document; using CompaniesHouse.UriBuilders; using FluentAssertions; using Moq; using NUnit.Framework; namespace CompaniesHouse.Tests.CompaniesHouseDocumentClientTests { [TestFixture] public class CompaniesHouseDocumentClientTests { private CompaniesHouseClientResponse<DocumentDownload> _result; private const string ExpectedMediaType = "application/pdf"; private const string ExpectedContent = "test pdf"; private const string DocumentId = "wibble"; [SetUp] public async Task GivenAClient_WhenDownloadingDocument() { var requestUri = new Uri($"https://document-api.companieshouse.gov.uk/document/{DocumentId}/content"); var stubHttpMessageHandler = new StubHttpMessageHandler(requestUri, ExpectedContent, ExpectedMediaType); var mockUriBuilder = new Mock<IDocumentUriBuilder>(); mockUriBuilder.Setup(x => x.WithContent()).Returns(mockUriBuilder.Object); mockUriBuilder.Setup(x => x.Build(DocumentId)).Returns(requestUri.ToString()); _result = await new CompaniesHouseDocumentClient(new HttpClient(stubHttpMessageHandler), mockUriBuilder.Object).DownloadDocumentAsync(DocumentId); } [Test] public void ThenDocumentContentIsCorrect() { var memoryStream = new MemoryStream(); _result.Data.Content.CopyToAsync(memoryStream); memoryStream.Seek(0, SeekOrigin.Begin); new StreamReader(memoryStream).ReadToEnd().Should().Be(ExpectedContent); } } }
using System; using System.IO; using System.Net.Http; using System.Threading.Tasks; using CompaniesHouse.Response.Document; using CompaniesHouse.UriBuilders; using FluentAssertions; using Moq; using NUnit.Framework; namespace CompaniesHouse.Tests.CompaniesHouseDocumentClientTests { [TestFixture] public class CompaniesHouseDocumentClientTests { private CompaniesHouseClientResponse<DocumentDownload> _result; private const string ExpectedMediaType = "application/pdf"; private const string ExpectedContent = "test pdf"; private const string DocumentId = "wibble"; [SetUp] public async Task GivenAClient_WhenDownloadingDocument() { var requestUri = new Uri($"https://document-api.companieshouse.gov.uk/document/{DocumentId}/content"); var stubHttpMessageHandler = new StubHttpMessageHandler(requestUri, ExpectedContent, ExpectedMediaType); var mockUriBuilder = new Mock<IDocumentUriBuilder>(); mockUriBuilder.Setup(x => x.WithContent()).Returns(mockUriBuilder.Object); mockUriBuilder.Setup(x => x.Build(DocumentId)).Returns(requestUri.ToString()); _result = await new CompaniesHouseDocumentClient(new HttpClient(stubHttpMessageHandler), mockUriBuilder.Object).DownloadDocumentAsync(DocumentId); } [Test] public void ThenDocumentContentIsCorrect() { using var memoryStream = new MemoryStream(); _result.Data.Content.CopyToAsync(memoryStream); memoryStream.Seek(0, SeekOrigin.Begin); new StreamReader(memoryStream).ReadToEnd().Should().Be(ExpectedContent); } } }
Add using when creating a memorystream
Add using when creating a memorystream
C#
mit
LiberisLabs/CompaniesHouse.NET,kevbite/CompaniesHouse.NET
bbf8187e0a678f84adf87e3ff20445551b4e417b
Engine/Plugins/Klawr/KlawrCodeGeneratorPlugin/Resources/WrapperProjectTemplate/TestActor.cs
Engine/Plugins/Klawr/KlawrCodeGeneratorPlugin/Resources/WrapperProjectTemplate/TestActor.cs
using System; using System.Runtime.InteropServices; using Klawr.ClrHost.Managed; using Klawr.ClrHost.Interfaces; using Klawr.ClrHost.Managed.SafeHandles; namespace Klawr.UnrealEngine { public class TestActor : AActorScriptObject { public TestActor(long instanceID, UObjectHandle nativeObject) : base(instanceID, nativeObject) { Console.WriteLine("TestActor()"); } public override void BeginPlay() { Console.WriteLine("BeginPlay()"); var world = K2_GetWorld(); var worldClass = UWorld.StaticClass(); bool isWorldClass = world.IsA(worldClass); var anotherWorldClass = (UClass)typeof(UWorld); bool isSameClass = worldClass == anotherWorldClass; bool isWorldClassDerivedFromObjectClass = worldClass.IsChildOf(UObject.StaticClass()); world.Dispose(); } public override void Tick(float deltaTime) { Console.WriteLine("Tick()"); } public override void Destroy() { Console.WriteLine("Destroy()"); } } }
using System; using System.Runtime.InteropServices; using Klawr.ClrHost.Managed; using Klawr.ClrHost.Interfaces; using Klawr.ClrHost.Managed.SafeHandles; namespace Klawr.UnrealEngine { // NOTE: IScriptObject should probably be considered deprecated in favor of UKlawrScriptComponent public class TestActor : AActorScriptObject { public TestActor(long instanceID, UObjectHandle nativeObject) : base(instanceID, nativeObject) { Console.WriteLine("TestActor()"); } public override void BeginPlay() { Console.WriteLine("BeginPlay()"); // FIXME: AActor::K2_GetWorld() is no more, and AActor::GetWorld() is not exposed to // Blueprints at all... may need to expose UObject::GetWorld() manually. /* var world = K2_GetWorld(); var worldClass = UWorld.StaticClass(); bool isWorldClass = world.IsA(worldClass); var anotherWorldClass = (UClass)typeof(UWorld); bool isSameClass = worldClass == anotherWorldClass; bool isWorldClassDerivedFromObjectClass = worldClass.IsChildOf(UObject.StaticClass()); world.Dispose(); */ } public override void Tick(float deltaTime) { Console.WriteLine("Tick()"); } public override void Destroy() { Console.WriteLine("Destroy()"); } } }
Comment out some test code that no longer works due to API changes in UE
Comment out some test code that no longer works due to API changes in UE AActor::K2_GetWorld() was removed in UE 4.7, and there doesn't seem to be any direct Blueprint equivalent for AActor::GetWorld().
C#
mit
Algorithman/klawr,lightszero/klawr,Algorithman/klawr,lightszero/klawr,enlight/klawr,enlight/klawr,enlight/klawr,Algorithman/klawr,lightszero/klawr
792512d98d2dcb2fe6057a2f439250eb8decf9f3
projects/FluentSample/test/FluentSample.Test.Unit/BeCompletedTest.cs
projects/FluentSample/test/FluentSample.Test.Unit/BeCompletedTest.cs
//----------------------------------------------------------------------- // <copyright file="BeCompletedTest.cs" company="Brian Rogers"> // Copyright (c) Brian Rogers. All rights reserved. // </copyright> //----------------------------------------------------------------------- namespace FluentSample.Test.Unit { using System; using System.Threading.Tasks; using FluentAssertions; using FluentSample; using Microsoft.VisualStudio.TestTools.UnitTesting; [TestClass] public class BeCompletedTest { [TestMethod] public void CompletedTaskShouldPassBeCompleted() { Task task = Task.FromResult(false); Action act = () => task.Should().BeCompleted(); act.ShouldNotThrow(); } [TestMethod] public void PendingTaskShouldFailBeCompleted() { Task task = new TaskCompletionSource<bool>().Task; Action act = () => task.Should().BeCompleted(); act.ShouldThrow<AssertFailedException>().WithMessage("Expected task to be completed but was WaitingForActivation."); } [TestMethod] public void NullTaskShouldFailBeCompleted() { Task task = null; Action act = () => task.Should().BeCompleted(); act.ShouldThrow<AssertFailedException>().WithMessage("Expected task to be completed but was <null>."); } [TestMethod] public void FaultedTaskShouldPassBeCompleted() { TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(); tcs.SetException(new InvalidCastException("Expected failure.")); Task task = tcs.Task; Action act = () => task.Should().BeCompleted(); act.ShouldNotThrow(); } } }
//----------------------------------------------------------------------- // <copyright file="BeCompletedTest.cs" company="Brian Rogers"> // Copyright (c) Brian Rogers. All rights reserved. // </copyright> //----------------------------------------------------------------------- namespace FluentSample.Test.Unit { using System; using System.Threading.Tasks; using FluentAssertions; using FluentSample; using Microsoft.VisualStudio.TestTools.UnitTesting; [TestClass] public class BeCompletedTest { [TestMethod] public void CompletedTaskShouldPass() { Task task = Task.FromResult(false); Action act = () => task.Should().BeCompleted(); act.ShouldNotThrow(); } [TestMethod] public void PendingTaskShouldFail() { Task task = new TaskCompletionSource<bool>().Task; Action act = () => task.Should().BeCompleted(); act.ShouldThrow<AssertFailedException>().WithMessage("Expected task to be completed but was WaitingForActivation."); } [TestMethod] public void NullTaskShouldFail() { Task task = null; Action act = () => task.Should().BeCompleted(); act.ShouldThrow<AssertFailedException>().WithMessage("Expected task to be completed but was <null>."); } [TestMethod] public void FaultedTaskShouldPass() { TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(); tcs.SetException(new InvalidCastException("Expected failure.")); Task task = tcs.Task; Action act = () => task.Should().BeCompleted(); act.ShouldNotThrow(); } } }
Rename tests after file rename
Rename tests after file rename
C#
unlicense
brian-dot-net/writeasync,brian-dot-net/writeasync,brian-dot-net/writeasync
e2693957abecb521752c5a40dbb31ef2e6862a94
src/Microsoft.DocAsCode.MarkdigEngine.Extensions/ResolveLink/ResolveLinkExtension.cs
src/Microsoft.DocAsCode.MarkdigEngine.Extensions/ResolveLink/ResolveLinkExtension.cs
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Microsoft.DocAsCode.MarkdigEngine.Extensions { using Markdig; using Markdig.Renderers; using Markdig.Syntax; using Markdig.Syntax.Inlines; public class ResolveLinkExtension : IMarkdownExtension { private readonly MarkdownContext _context; public ResolveLinkExtension(MarkdownContext context) { _context = context; } public void Setup(MarkdownPipelineBuilder pipeline) { pipeline.DocumentProcessed += UpdateLinks; } public void Setup(MarkdownPipeline pipeline, IMarkdownRenderer renderer) { } private void UpdateLinks(MarkdownObject markdownObject) { switch (markdownObject) { case TabTitleBlock _: break; case LinkInline linkInline: linkInline.Url = _context.GetLink(linkInline.Url, linkInline); break; case ContainerBlock containerBlock: foreach (var subBlock in containerBlock) { UpdateLinks(subBlock); } break; case LeafBlock leafBlock when leafBlock.Inline != null: foreach (var subInline in leafBlock.Inline) { UpdateLinks(subInline); } break; case ContainerInline containerInline: foreach (var subInline in containerInline) { UpdateLinks(subInline); } break; default: break; } } } }
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Microsoft.DocAsCode.MarkdigEngine.Extensions { using Markdig; using Markdig.Renderers; using Markdig.Syntax; using Markdig.Syntax.Inlines; public class ResolveLinkExtension : IMarkdownExtension { private readonly MarkdownContext _context; public ResolveLinkExtension(MarkdownContext context) { _context = context; } public void Setup(MarkdownPipelineBuilder pipeline) { pipeline.DocumentProcessed += UpdateLinks; } public void Setup(MarkdownPipeline pipeline, IMarkdownRenderer renderer) { } private void UpdateLinks(MarkdownObject markdownObject) { switch (markdownObject) { case TabTitleBlock _: break; case LinkInline linkInline: linkInline.Url = _context.GetLink(linkInline.Url, linkInline); foreach (var subBlock in linkInline) { UpdateLinks(subBlock); } break; case ContainerBlock containerBlock: foreach (var subBlock in containerBlock) { UpdateLinks(subBlock); } break; case LeafBlock leafBlock when leafBlock.Inline != null: foreach (var subInline in leafBlock.Inline) { UpdateLinks(subInline); } break; case ContainerInline containerInline: foreach (var subInline in containerInline) { UpdateLinks(subInline); } break; default: break; } } } }
Fix link resolve not resolving child token
Fix link resolve not resolving child token
C#
mit
dotnet/docfx,superyyrrzz/docfx,superyyrrzz/docfx,superyyrrzz/docfx,dotnet/docfx,dotnet/docfx
6d44cc958f3b5ba01c3cc903f2231978f1879be4
src/Orchard.Web/Modules/Orchard.Packaging/DefaultPackagingUpdater.cs
src/Orchard.Web/Modules/Orchard.Packaging/DefaultPackagingUpdater.cs
using System; using Orchard.Environment; using Orchard.Environment.Extensions; using Orchard.Environment.Extensions.Models; using Orchard.Localization; using Orchard.Packaging.Services; using Orchard.UI.Notify; namespace Orchard.Packaging { [OrchardFeature("Gallery")] public class DefaultPackagingUpdater : IFeatureEventHandler { private readonly IPackagingSourceManager _packagingSourceManager; private readonly INotifier _notifier; public DefaultPackagingUpdater(IPackagingSourceManager packagingSourceManager, INotifier notifier) { _packagingSourceManager = packagingSourceManager; _notifier = notifier; } public Localizer T { get; set; } public void Install(Feature feature) { _packagingSourceManager.AddSource(new PackagingSource { Id = Guid.NewGuid(), FeedTitle = "Orchard Module Gallery", FeedUrl = "http://orchardproject.net/gallery/feed" }); } public void Enable(Feature feature) { } public void Disable(Feature feature) { } public void Uninstall(Feature feature) { } } }
using System; using Orchard.Environment; using Orchard.Environment.Extensions; using Orchard.Environment.Extensions.Models; using Orchard.Localization; using Orchard.Packaging.Services; using Orchard.UI.Notify; namespace Orchard.Packaging { [OrchardFeature("Gallery")] public class DefaultPackagingUpdater : IFeatureEventHandler { private readonly IPackagingSourceManager _packagingSourceManager; private readonly INotifier _notifier; public DefaultPackagingUpdater(IPackagingSourceManager packagingSourceManager, INotifier notifier) { _packagingSourceManager = packagingSourceManager; _notifier = notifier; } public Localizer T { get; set; } public void Install(Feature feature) { _packagingSourceManager.AddSource(new PackagingSource { Id = Guid.NewGuid(), FeedTitle = "Orchard Module Gallery", FeedUrl = "http://orchardproject.net/gallery08/feed" }); } public void Enable(Feature feature) { } public void Disable(Feature feature) { } public void Uninstall(Feature feature) { } } }
Change the feed url to the new url for 0.8
Change the feed url to the new url for 0.8 --HG-- branch : dev
C#
bsd-3-clause
arminkarimi/Orchard,m2cms/Orchard,sfmskywalker/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,gcsuk/Orchard,Lombiq/Orchard,angelapper/Orchard,Lombiq/Orchard,salarvand/orchard,xkproject/Orchard,kouweizhong/Orchard,austinsc/Orchard,Codinlab/Orchard,jchenga/Orchard,tobydodds/folklife,aaronamm/Orchard,OrchardCMS/Orchard-Harvest-Website,rtpHarry/Orchard,salarvand/Portal,Anton-Am/Orchard,jtkech/Orchard,Sylapse/Orchard.HttpAuthSample,geertdoornbos/Orchard,armanforghani/Orchard,bedegaming-aleksej/Orchard,patricmutwiri/Orchard,stormleoxia/Orchard,jerryshi2007/Orchard,Cphusion/Orchard,Morgma/valleyviewknolls,aaronamm/Orchard,TalaveraTechnologySolutions/Orchard,JRKelso/Orchard,vard0/orchard.tan,geertdoornbos/Orchard,marcoaoteixeira/Orchard,caoxk/orchard,salarvand/orchard,planetClaire/Orchard-LETS,jerryshi2007/Orchard,escofieldnaxos/Orchard,escofieldnaxos/Orchard,jagraz/Orchard,MetSystem/Orchard,fortunearterial/Orchard,infofromca/Orchard,bigfont/orchard-continuous-integration-demo,KeithRaven/Orchard,salarvand/orchard,li0803/Orchard,tobydodds/folklife,fortunearterial/Orchard,planetClaire/Orchard-LETS,yonglehou/Orchard,brownjordaninternational/OrchardCMS,IDeliverable/Orchard,luchaoshuai/Orchard,vard0/orchard.tan,Praggie/Orchard,caoxk/orchard,omidnasri/Orchard,andyshao/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,tobydodds/folklife,bigfont/orchard-cms-modules-and-themes,mvarblow/Orchard,vard0/orchard.tan,geertdoornbos/Orchard,dcinzona/Orchard-Harvest-Website,omidnasri/Orchard,KeithRaven/Orchard,openbizgit/Orchard,enspiral-dev-academy/Orchard,xiaobudian/Orchard,DonnotRain/Orchard,luchaoshuai/Orchard,harmony7/Orchard,omidnasri/Orchard,geertdoornbos/Orchard,Dolphinsimon/Orchard,kouweizhong/Orchard,oxwanawxo/Orchard,DonnotRain/Orchard,enspiral-dev-academy/Orchard,MetSystem/Orchard,ehe888/Orchard,angelapper/Orchard,Fogolan/OrchardForWork,kouweizhong/Orchard,hbulzy/Orchard,dozoft/Orchard,KeithRaven/Orchard,sebastienros/msc,SzymonSel/Orchard,austinsc/Orchard,qt1/orchard4ibn,yonglehou/Orchard,xiaobudian/Orchard,mgrowan/Orchard,jerryshi2007/Orchard,alejandroaldana/Orchard,ericschultz/outercurve-orchard,MpDzik/Orchard,Dolphinsimon/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,Serlead/Orchard,grapto/Orchard.CloudBust,yonglehou/Orchard,jimasp/Orchard,SeyDutch/Airbrush,arminkarimi/Orchard,huoxudong125/Orchard,arminkarimi/Orchard,xkproject/Orchard,m2cms/Orchard,ehe888/Orchard,SeyDutch/Airbrush,spraiin/Orchard,jimasp/Orchard,salarvand/orchard,SouleDesigns/SouleDesigns.Orchard,Morgma/valleyviewknolls,AEdmunds/beautiful-springtime,jtkech/Orchard,sfmskywalker/Orchard,enspiral-dev-academy/Orchard,brownjordaninternational/OrchardCMS,asabbott/chicagodevnet-website,Anton-Am/Orchard,LaserSrl/Orchard,phillipsj/Orchard,MetSystem/Orchard,sfmskywalker/Orchard,Anton-Am/Orchard,fassetar/Orchard,neTp9c/Orchard,brownjordaninternational/OrchardCMS,kgacova/Orchard,huoxudong125/Orchard,TaiAivaras/Orchard,SzymonSel/Orchard,bedegaming-aleksej/Orchard,jimasp/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,gcsuk/Orchard,IDeliverable/Orchard,grapto/Orchard.CloudBust,armanforghani/Orchard,xkproject/Orchard,cooclsee/Orchard,oxwanawxo/Orchard,jagraz/Orchard,JRKelso/Orchard,abhishekluv/Orchard,phillipsj/Orchard,Cphusion/Orchard,qt1/orchard4ibn,Serlead/Orchard,hbulzy/Orchard,Dolphinsimon/Orchard,NIKASoftwareDevs/Orchard,jchenga/Orchard,bigfont/orchard-continuous-integration-demo,OrchardCMS/Orchard-Harvest-Website,spraiin/Orchard,TalaveraTechnologySolutions/Orchard,hannan-azam/Orchard,jaraco/orchard,Sylapse/Orchard.HttpAuthSample,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,jersiovic/Orchard,qt1/Orchard,openbizgit/Orchard,dburriss/Orchard,asabbott/chicagodevnet-website,brownjordaninternational/OrchardCMS,luchaoshuai/Orchard,ehe888/Orchard,jchenga/Orchard,stormleoxia/Orchard,Ermesx/Orchard,Inner89/Orchard,aaronamm/Orchard,Inner89/Orchard,oxwanawxo/Orchard,JRKelso/Orchard,neTp9c/Orchard,geertdoornbos/Orchard,dburriss/Orchard,salarvand/orchard,hbulzy/Orchard,fassetar/Orchard,jtkech/Orchard,johnnyqian/Orchard,omidnasri/Orchard,johnnyqian/Orchard,alejandroaldana/Orchard,patricmutwiri/Orchard,smartnet-developers/Orchard,stormleoxia/Orchard,omidnasri/Orchard,MpDzik/Orchard,mvarblow/Orchard,salarvand/Portal,xiaobudian/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,Serlead/Orchard,jimasp/Orchard,emretiryaki/Orchard,cryogen/orchard,jimasp/Orchard,dburriss/Orchard,omidnasri/Orchard,LaserSrl/Orchard,TalaveraTechnologySolutions/Orchard,rtpHarry/Orchard,dozoft/Orchard,SouleDesigns/SouleDesigns.Orchard,SouleDesigns/SouleDesigns.Orchard,patricmutwiri/Orchard,huoxudong125/Orchard,tobydodds/folklife,dcinzona/Orchard-Harvest-Website,johnnyqian/Orchard,johnnyqian/Orchard,Dolphinsimon/Orchard,DonnotRain/Orchard,IDeliverable/Orchard,hbulzy/Orchard,LaserSrl/Orchard,jtkech/Orchard,qt1/Orchard,JRKelso/Orchard,huoxudong125/Orchard,DonnotRain/Orchard,mvarblow/Orchard,asabbott/chicagodevnet-website,grapto/Orchard.CloudBust,omidnasri/Orchard,fassetar/Orchard,spraiin/Orchard,marcoaoteixeira/Orchard,yersans/Orchard,TalaveraTechnologySolutions/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,vard0/orchard.tan,dozoft/Orchard,dozoft/Orchard,infofromca/Orchard,spraiin/Orchard,OrchardCMS/Orchard-Harvest-Website,NIKASoftwareDevs/Orchard,TalaveraTechnologySolutions/Orchard,li0803/Orchard,armanforghani/Orchard,AdvantageCS/Orchard,caoxk/orchard,sebastienros/msc,m2cms/Orchard,abhishekluv/Orchard,bigfont/orchard-cms-modules-and-themes,MetSystem/Orchard,Fogolan/OrchardForWork,emretiryaki/Orchard,tobydodds/folklife,dcinzona/Orchard-Harvest-Website,escofieldnaxos/Orchard,armanforghani/Orchard,smartnet-developers/Orchard,sfmskywalker/Orchard,Morgma/valleyviewknolls,bedegaming-aleksej/Orchard,li0803/Orchard,neTp9c/Orchard,LaserSrl/Orchard,austinsc/Orchard,Serlead/Orchard,yonglehou/Orchard,dburriss/Orchard,xkproject/Orchard,m2cms/Orchard,Serlead/Orchard,fortunearterial/Orchard,cryogen/orchard,aaronamm/Orchard,jaraco/orchard,mgrowan/Orchard,emretiryaki/Orchard,dcinzona/Orchard,dozoft/Orchard,cryogen/orchard,Cphusion/Orchard,bigfont/orchard-cms-modules-and-themes,jagraz/Orchard,kgacova/Orchard,qt1/orchard4ibn,bedegaming-aleksej/Orchard,AndreVolksdorf/Orchard,SeyDutch/Airbrush,Lombiq/Orchard,RoyalVeterinaryCollege/Orchard,ehe888/Orchard,cooclsee/Orchard,Sylapse/Orchard.HttpAuthSample,Inner89/Orchard,marcoaoteixeira/Orchard,AdvantageCS/Orchard,kgacova/Orchard,Praggie/Orchard,li0803/Orchard,austinsc/Orchard,Lombiq/Orchard,smartnet-developers/Orchard,phillipsj/Orchard,kouweizhong/Orchard,Praggie/Orchard,NIKASoftwareDevs/Orchard,alejandroaldana/Orchard,AndreVolksdorf/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,KeithRaven/Orchard,jersiovic/Orchard,dcinzona/Orchard-Harvest-Website,sfmskywalker/Orchard,luchaoshuai/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,mgrowan/Orchard,Ermesx/Orchard,harmony7/Orchard,planetClaire/Orchard-LETS,Anton-Am/Orchard,MpDzik/Orchard,austinsc/Orchard,vairam-svs/Orchard,enspiral-dev-academy/Orchard,OrchardCMS/Orchard,escofieldnaxos/Orchard,qt1/orchard4ibn,AdvantageCS/Orchard,OrchardCMS/Orchard,Ermesx/Orchard,m2cms/Orchard,jaraco/orchard,kouweizhong/Orchard,andyshao/Orchard,RoyalVeterinaryCollege/Orchard,arminkarimi/Orchard,Morgma/valleyviewknolls,jersiovic/Orchard,TaiAivaras/Orchard,Codinlab/Orchard,enspiral-dev-academy/Orchard,dcinzona/Orchard,aaronamm/Orchard,Fogolan/OrchardForWork,cooclsee/Orchard,sfmskywalker/Orchard,jagraz/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,mgrowan/Orchard,stormleoxia/Orchard,salarvand/Portal,jersiovic/Orchard,hannan-azam/Orchard,grapto/Orchard.CloudBust,bigfont/orchard-cms-modules-and-themes,angelapper/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,IDeliverable/Orchard,hannan-azam/Orchard,phillipsj/Orchard,yersans/Orchard,MpDzik/Orchard,ericschultz/outercurve-orchard,spraiin/Orchard,AdvantageCS/Orchard,Ermesx/Orchard,patricmutwiri/Orchard,andyshao/Orchard,abhishekluv/Orchard,sfmskywalker/Orchard,AEdmunds/beautiful-springtime,andyshao/Orchard,Codinlab/Orchard,DonnotRain/Orchard,alejandroaldana/Orchard,cryogen/orchard,li0803/Orchard,sebastienros/msc,Fogolan/OrchardForWork,ericschultz/outercurve-orchard,TalaveraTechnologySolutions/Orchard,TaiAivaras/Orchard,hhland/Orchard,jagraz/Orchard,SzymonSel/Orchard,yonglehou/Orchard,Lombiq/Orchard,xiaobudian/Orchard,jtkech/Orchard,NIKASoftwareDevs/Orchard,huoxudong125/Orchard,grapto/Orchard.CloudBust,OrchardCMS/Orchard-Harvest-Website,OrchardCMS/Orchard-Harvest-Website,armanforghani/Orchard,dburriss/Orchard,MpDzik/Orchard,Anton-Am/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,jchenga/Orchard,SeyDutch/Airbrush,dcinzona/Orchard-Harvest-Website,openbizgit/Orchard,RoyalVeterinaryCollege/Orchard,fortunearterial/Orchard,hhland/Orchard,infofromca/Orchard,yersans/Orchard,mvarblow/Orchard,alejandroaldana/Orchard,AndreVolksdorf/Orchard,phillipsj/Orchard,cooclsee/Orchard,Inner89/Orchard,RoyalVeterinaryCollege/Orchard,mvarblow/Orchard,xiaobudian/Orchard,salarvand/Portal,marcoaoteixeira/Orchard,marcoaoteixeira/Orchard,bigfont/orchard-cms-modules-and-themes,salarvand/Portal,JRKelso/Orchard,Ermesx/Orchard,Codinlab/Orchard,luchaoshuai/Orchard,andyshao/Orchard,ericschultz/outercurve-orchard,omidnasri/Orchard,fortunearterial/Orchard,LaserSrl/Orchard,bigfont/orchard-continuous-integration-demo,jaraco/orchard,jerryshi2007/Orchard,gcsuk/Orchard,angelapper/Orchard,Cphusion/Orchard,OrchardCMS/Orchard,Sylapse/Orchard.HttpAuthSample,vairam-svs/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,bedegaming-aleksej/Orchard,hannan-azam/Orchard,infofromca/Orchard,kgacova/Orchard,stormleoxia/Orchard,escofieldnaxos/Orchard,angelapper/Orchard,harmony7/Orchard,abhishekluv/Orchard,neTp9c/Orchard,cooclsee/Orchard,gcsuk/Orchard,SouleDesigns/SouleDesigns.Orchard,vard0/orchard.tan,openbizgit/Orchard,NIKASoftwareDevs/Orchard,yersans/Orchard,caoxk/orchard,bigfont/orchard-continuous-integration-demo,vairam-svs/Orchard,Praggie/Orchard,Cphusion/Orchard,SzymonSel/Orchard,AndreVolksdorf/Orchard,planetClaire/Orchard-LETS,TaiAivaras/Orchard,SouleDesigns/SouleDesigns.Orchard,Morgma/valleyviewknolls,qt1/orchard4ibn,oxwanawxo/Orchard,xkproject/Orchard,jerryshi2007/Orchard,harmony7/Orchard,SeyDutch/Airbrush,yersans/Orchard,RoyalVeterinaryCollege/Orchard,MpDzik/Orchard,IDeliverable/Orchard,emretiryaki/Orchard,emretiryaki/Orchard,neTp9c/Orchard,omidnasri/Orchard,vard0/orchard.tan,abhishekluv/Orchard,TaiAivaras/Orchard,SzymonSel/Orchard,smartnet-developers/Orchard,jchenga/Orchard,oxwanawxo/Orchard,rtpHarry/Orchard,jersiovic/Orchard,qt1/Orchard,dcinzona/Orchard-Harvest-Website,dcinzona/Orchard,qt1/Orchard,KeithRaven/Orchard,harmony7/Orchard,hbulzy/Orchard,Dolphinsimon/Orchard,brownjordaninternational/OrchardCMS,dmitry-urenev/extended-orchard-cms-v10.1,tobydodds/folklife,AEdmunds/beautiful-springtime,fassetar/Orchard,hannan-azam/Orchard,abhishekluv/Orchard,sebastienros/msc,dcinzona/Orchard,mgrowan/Orchard,openbizgit/Orchard,hhland/Orchard,OrchardCMS/Orchard,smartnet-developers/Orchard,OrchardCMS/Orchard-Harvest-Website,arminkarimi/Orchard,TalaveraTechnologySolutions/Orchard,Sylapse/Orchard.HttpAuthSample,OrchardCMS/Orchard,Fogolan/OrchardForWork,grapto/Orchard.CloudBust,dcinzona/Orchard,Codinlab/Orchard,gcsuk/Orchard,sebastienros/msc,planetClaire/Orchard-LETS,infofromca/Orchard,AdvantageCS/Orchard,fassetar/Orchard,hhland/Orchard,asabbott/chicagodevnet-website,qt1/Orchard,Praggie/Orchard,qt1/orchard4ibn,AEdmunds/beautiful-springtime,vairam-svs/Orchard,Inner89/Orchard,ehe888/Orchard,MetSystem/Orchard,rtpHarry/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,AndreVolksdorf/Orchard,patricmutwiri/Orchard,vairam-svs/Orchard,kgacova/Orchard,TalaveraTechnologySolutions/Orchard,sfmskywalker/Orchard,johnnyqian/Orchard,rtpHarry/Orchard,hhland/Orchard
f7c8731df64930765937f9b6f54dce8cec448c77
NBi.Framework/FailureMessage/Markdown/LookupExistsViolationMessageMarkdown.cs
NBi.Framework/FailureMessage/Markdown/LookupExistsViolationMessageMarkdown.cs
using MarkdownLog; using NBi.Core.ResultSet; using NBi.Core.ResultSet.Lookup; using NBi.Core.ResultSet.Lookup.Violation; using NBi.Framework.FailureMessage.Common; using NBi.Framework.FailureMessage.Common.Helper; using NBi.Framework.FailureMessage.Markdown.Helper; using NBi.Framework.Sampling; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; namespace NBi.Framework.FailureMessage.Markdown { class LookupExistsViolationMessageMarkdown : LookupViolationMessageMarkdown { public LookupExistsViolationMessageMarkdown(IDictionary<string, ISampler<DataRow>> samplers) : base(samplers) { } protected override void RenderAnalysis(LookupViolationCollection violations, IEnumerable<ColumnMetadata> metadata, ISampler<DataRow> sampler, ColumnMappingCollection keyMappings, ColumnMappingCollection valueMappings, MarkdownContainer container) { container.Append("Analysis".ToMarkdownHeader()); var state = violations.Values.Select(x => x.State).First(); container.Append(GetExplanationText(violations, state).ToMarkdownParagraph()); var rows = violations.Values.Where(x => x is LookupExistsViolationInformation) .Cast<LookupExistsViolationInformation>() .SelectMany(x => x.CandidateRows); sampler.Build(rows); var tableHelper = new StandardTableHelperMarkdown(rows, metadata, sampler); tableHelper.Render(container); } } }
using MarkdownLog; using NBi.Core.ResultSet; using NBi.Core.ResultSet.Lookup; using NBi.Core.ResultSet.Lookup.Violation; using NBi.Framework.FailureMessage.Common; using NBi.Framework.FailureMessage.Common.Helper; using NBi.Framework.FailureMessage.Markdown.Helper; using NBi.Framework.Sampling; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; namespace NBi.Framework.FailureMessage.Markdown { class LookupExistsViolationMessageMarkdown : LookupViolationMessageMarkdown { public LookupExistsViolationMessageMarkdown(IDictionary<string, ISampler<DataRow>> samplers) : base(samplers) { } protected override void RenderAnalysis(LookupViolationCollection violations, IEnumerable<ColumnMetadata> metadata, ISampler<DataRow> sampler, ColumnMappingCollection keyMappings, ColumnMappingCollection valueMappings, MarkdownContainer container) { if (violations.Values.Any()) { container.Append("Analysis".ToMarkdownHeader()); var state = violations.Values.Select(x => x.State).First(); container.Append(GetExplanationText(violations, state).ToMarkdownParagraph()); var rows = violations.Values.Where(x => x is LookupExistsViolationInformation) .Cast<LookupExistsViolationInformation>() .SelectMany(x => x.CandidateRows); sampler.Build(rows); var tableHelper = new StandardTableHelperMarkdown(rows, metadata, sampler); tableHelper.Render(container); } } } }
Fix issue when the error messages are rendered in Markdown with an Always configuration
Fix issue when the error messages are rendered in Markdown with an Always configuration
C#
apache-2.0
Seddryck/NBi,Seddryck/NBi
ca7bc8266c990d43d6807254e4f93af3751b1125
bindings/src/BillboardSet.cs
bindings/src/BillboardSet.cs
using System; namespace Urho { public partial class BillboardSet { public BillboardWrapper GetBillboardSafe (uint index) { unsafe { Billboard* result = BillboardSet_GetBillboard (handle, index); if (result == null) return null; return new BillboardWrapper(result); } } } }
using System; namespace Urho { public partial class BillboardSet { public BillboardWrapper GetBillboardSafe (uint index) { unsafe { Billboard* result = BillboardSet_GetBillboard (handle, index); if (result == null) return null; return new BillboardWrapper(this, result); } } } }
Fix BillboardWrapper, prevent bb from collecting by GC
[Bindings] Fix BillboardWrapper, prevent bb from collecting by GC
C#
mit
florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho
0b326475f9438a1df7e9c1eb4abc6b6ec544c619
src/RestfulRouting/Mapper.cs
src/RestfulRouting/Mapper.cs
using System.Web.Mvc; using System.Web.Routing; namespace RestfulRouting { public abstract class Mapper { protected Route GenerateRoute(string path, string controller, string action, string[] httpMethods) { return new Route(path, new RouteValueDictionary(new { controller, action }), new RouteValueDictionary(new { httpMethod = new HttpMethodConstraint(httpMethods) }), new MvcRouteHandler()); } } }
using System.Web.Mvc; using System.Web.Routing; namespace RestfulRouting { public abstract class Mapper { private readonly IRouteHandler _routeHandler; protected Route GenerateRoute(string path, string controller, string action, string[] httpMethods) { return new Route(path, new RouteValueDictionary(new { controller, action }), new RouteValueDictionary(new { httpMethod = new HttpMethodConstraint(httpMethods) }), new MvcRouteHandler()); } } }
Add new private field for the route handler
Add new private field for the route handler
C#
mit
stevehodgkiss/restful-routing,restful-routing/restful-routing,stevehodgkiss/restful-routing,stevehodgkiss/restful-routing,restful-routing/restful-routing,restful-routing/restful-routing
67c596d6851fe9f2e36abb392120a91aace01508
Contentful.Core/Models/Management/UiExtension.cs
Contentful.Core/Models/Management/UiExtension.cs
using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Text; namespace Contentful.Core.Models.Management { /// <summary> /// Encapsulates information about a Contentful Ui Extension /// </summary> public class UiExtension : IContentfulResource { /// <summary> /// Common system managed metadata properties. /// </summary> [JsonProperty("sys")] public SystemProperties SystemProperties { get; set; } /// <summary> /// The source URL for html file for the extension. /// </summary> public string Src { get; set; } /// <summary> /// String representation of the widget, e.g. inline HTML. /// </summary> public string SrcDoc { get; set; } /// <summary> /// The name of the extension /// </summary> public string Name { get; set; } /// <summary> /// The field types for which this extension applies. /// </summary> public List<string> FieldTypes { get; set; } /// <summary> /// Whether or not this is an extension for the Contentful sidebar. /// </summary> public bool Sidebar { get; set; } } }
using Contentful.Core.Configuration; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Text; namespace Contentful.Core.Models.Management { /// <summary> /// Encapsulates information about a Contentful Ui Extension /// </summary> [JsonConverter(typeof(ExtensionJsonConverter))] public class UiExtension : IContentfulResource { /// <summary> /// Common system managed metadata properties. /// </summary> [JsonProperty("sys")] public SystemProperties SystemProperties { get; set; } /// <summary> /// The source URL for html file for the extension. /// </summary> public string Src { get; set; } /// <summary> /// String representation of the widget, e.g. inline HTML. /// </summary> public string SrcDoc { get; set; } /// <summary> /// The name of the extension /// </summary> public string Name { get; set; } /// <summary> /// The field types for which this extension applies. /// </summary> public List<string> FieldTypes { get; set; } /// <summary> /// Whether or not this is an extension for the Contentful sidebar. /// </summary> public bool Sidebar { get; set; } } }
Add jsonconverter to extension model
Add jsonconverter to extension model
C#
mit
contentful/contentful.net
710749fce43b4f9ae809cfdd9e1bef6d69cd9aa2
ValueConverters.Shared/ValueConverterGroup.cs
ValueConverters.Shared/ValueConverterGroup.cs
using System; using System.Collections.Generic; using System.Globalization; using System.Linq; #if (NETFX || WINDOWS_PHONE) using System.Windows; using System.Windows.Data; using System.Windows.Markup; #elif (NETFX_CORE) using Windows.UI.Xaml; using Windows.UI.Xaml.Data; #elif (XAMARIN) using Xamarin.Forms; #endif namespace ValueConverters { /// <summary> /// Value converters which aggregates the results of a sequence of converters: Converter1 >> Converter2 >> Converter3 /// The output of converter N becomes the input of converter N+1. /// </summary> #if (NETFX || XAMARIN || WINDOWS_PHONE) [ContentProperty(nameof(Converters))] #elif (NETFX_CORE) [ContentProperty(Name = nameof(Converters))] #endif public class ValueConverterGroup : SingletonConverterBase<ValueConverterGroup> { public List<IValueConverter> Converters { get; set; } = new List<IValueConverter>(); protected override object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return this.Converters?.Aggregate(value, (current, converter) => converter.Convert(current, targetType, parameter, culture)); } protected override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return this.Converters?.Reverse<IValueConverter>().Aggregate(value, (current, converter) => converter.Convert(current, targetType, parameter, culture)); } } }
using System; using System.Collections.Generic; using System.Globalization; using System.Linq; #if (NETFX || WINDOWS_PHONE) using System.Windows; using System.Windows.Data; using System.Windows.Markup; #elif (NETFX_CORE) using Windows.UI.Xaml; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Markup; #elif (XAMARIN) using Xamarin.Forms; #endif namespace ValueConverters { /// <summary> /// Value converters which aggregates the results of a sequence of converters: Converter1 >> Converter2 >> Converter3 /// The output of converter N becomes the input of converter N+1. /// </summary> #if (NETFX || XAMARIN || WINDOWS_PHONE) [ContentProperty(nameof(Converters))] #elif (NETFX_CORE) [ContentProperty(Name = nameof(Converters))] #endif public class ValueConverterGroup : SingletonConverterBase<ValueConverterGroup> { public List<IValueConverter> Converters { get; set; } = new List<IValueConverter>(); protected override object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return this.Converters?.Aggregate(value, (current, converter) => converter.Convert(current, targetType, parameter, culture)); } protected override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return this.Converters?.Reverse<IValueConverter>().Aggregate(value, (current, converter) => converter.Convert(current, targetType, parameter, culture)); } } }
Add missing namespace for uwp
Add missing namespace for uwp
C#
mit
thomasgalliker/ValueConverters.NET
180158d7019e32787c42487f4bf48812afcafd65
src/Bundlr/TemplateSource.cs
src/Bundlr/TemplateSource.cs
using System.IO; using System.Web; namespace Bundlr { public class TemplateSource : IContentSource { private readonly string global; private readonly Compiler compiler; private readonly TemplateFinder finder; public TemplateSource(string global, Compiler compiler, TemplateFinder finder) { this.global = global; this.compiler = compiler; this.finder = finder; } public string GetContent(HttpContextBase httpContext) { var templates = finder.Find(httpContext); using (var writer = new StringWriter()) { writer.WriteLine("!function() {"); writer.WriteLine(" var templates = {0}.templates = {{}};", global); foreach (var template in templates) { string name = template.GetName(); string content = compiler.Compile(template.GetContent()); writer.WriteLine(" templates['{0}'] = {1};", name, content); } writer.WriteLine("}();"); return writer.ToString(); } } } }
using System.Collections.Generic; using System.IO; using System.Linq; using System.Web; namespace Bundlr { public class TemplateSource : IContentSource { private readonly string global; private readonly Compiler compiler; private readonly TemplateFinder finder; public TemplateSource(string global, Compiler compiler, TemplateFinder finder) { this.global = global; this.compiler = compiler; this.finder = finder; } public string GetContent(HttpContextBase httpContext) { var templates = finder.Find(httpContext); using (var writer = new StringWriter()) { writer.WriteLine("!function() {"); writer.WriteLine(" var templates = {0}.templates = {{}};", global); var results = Compile(templates); foreach (var result in results) { writer.WriteLine(result); } writer.WriteLine("}();"); return writer.ToString(); } } private IEnumerable<string> Compile(IEnumerable<Template> templates) { return templates.AsParallel().Select(template => { string name = template.GetName(); string content = compiler.Compile(template.GetContent()); return string.Format(" templates['{0}'] = {1};", name, content); }); } } }
Add parallelism when compiling templates.
Add parallelism when compiling templates.
C#
mit
mrydengren/templar,mrydengren/templar
16e02fe572cff5df86fe79a44b7c2c45c81c0df7
Mindscape.Raygun4Net/Logging/RaygunLogger.cs
Mindscape.Raygun4Net/Logging/RaygunLogger.cs
using Mindscape.Raygun4Net.Utils; namespace Mindscape.Raygun4Net.Logging { public class RaygunLogger : Singleton<RaygunLogger>, IRaygunLogger { public RaygunLogLevel LogLevel { get; set; } public void Error(string message) { Log(RaygunLogLevel.Error, message); } public void Warning(string message) { Log(RaygunLogLevel.Warning, message); } public void Info(string message) { Log(RaygunLogLevel.Info, message); } public void Debug(string message) { Log(RaygunLogLevel.Debug, message); } public void Verbose(string message) { Log(RaygunLogLevel.Verbose, message); } private void Log(RaygunLogLevel level, string message) { if (LogLevel == RaygunLogLevel.None) { return; } if (level <= LogLevel) { System.Diagnostics.Trace.WriteLine(message); } } } }
using Mindscape.Raygun4Net.Utils; namespace Mindscape.Raygun4Net.Logging { public class RaygunLogger : Singleton<RaygunLogger>, IRaygunLogger { private const string RaygunPrefix = "Raygun: "; public RaygunLogLevel LogLevel { get; set; } public void Error(string message) { Log(RaygunLogLevel.Error, message); } public void Warning(string message) { Log(RaygunLogLevel.Warning, message); } public void Info(string message) { Log(RaygunLogLevel.Info, message); } public void Debug(string message) { Log(RaygunLogLevel.Debug, message); } public void Verbose(string message) { Log(RaygunLogLevel.Verbose, message); } private void Log(RaygunLogLevel level, string message) { if (LogLevel == RaygunLogLevel.None) { return; } if (level <= LogLevel) { System.Diagnostics.Trace.WriteLine($"{RaygunPrefix}{message}"); } } } }
Add a prefix to each log
Add a prefix to each log Add a prefix to each log
C#
mit
MindscapeHQ/raygun4net,MindscapeHQ/raygun4net,MindscapeHQ/raygun4net
aa863069a9093e70832aca8e46462db02cd181f1
MultiMiner.Utility/Networking/PortScanner.cs
MultiMiner.Utility/Networking/PortScanner.cs
using System; using System.Collections.Generic; using System.Net; using System.Net.Sockets; namespace MultiMiner.Utility.Networking { public class PortScanner { public static List<IPEndPoint> Find(string ipRange, int startingPort, int endingPort, int connectTimeout = 100) { if (startingPort >= endingPort) throw new ArgumentException(); List<IPEndPoint> endpoints = new List<IPEndPoint>(); IEnumerable<IPAddress> ipAddresses = new IPRange(ipRange).GetIPAddresses(); foreach (IPAddress ipAddress in ipAddresses) for (int currentPort = startingPort; currentPort <= endingPort; currentPort++) if (IsPortOpen(ipAddress, currentPort, connectTimeout)) endpoints.Add(new IPEndPoint(ipAddress, currentPort)); return endpoints; } private static bool IsPortOpen(IPAddress ipAddress, int currentPort, int connectTimeout) { bool portIsOpen = false; using (var tcp = new TcpClient()) { IAsyncResult ar = tcp.BeginConnect(ipAddress, currentPort, null, null); using (ar.AsyncWaitHandle) { //Wait connectTimeout ms for connection. if (ar.AsyncWaitHandle.WaitOne(connectTimeout, false)) { try { tcp.EndConnect(ar); portIsOpen = true; //Connect was successful. } catch { //Server refused the connection. } } } } return portIsOpen; } } }
using System; using System.Collections.Generic; using System.Net; using System.Net.Sockets; namespace MultiMiner.Utility.Networking { public class PortScanner { public static List<IPEndPoint> Find(string ipRange, int startingPort, int endingPort, int connectTimeout = 100) { if (startingPort >= endingPort) throw new ArgumentException(); List<IPEndPoint> endpoints = new List<IPEndPoint>(); IEnumerable<IPAddress> ipAddresses = new IPRange(ipRange).GetIPAddresses(); foreach (IPAddress ipAddress in ipAddresses) for (int currentPort = startingPort; currentPort <= endingPort; currentPort++) if (IsPortOpen(ipAddress, currentPort, connectTimeout)) endpoints.Add(new IPEndPoint(ipAddress, currentPort)); return endpoints; } private static bool IsPortOpen(IPAddress ipAddress, int currentPort, int connectTimeout) { bool portIsOpen = false; //use raw Sockets //using TclClient along with IAsyncResult can lead to ObjectDisposedException on Linux+Mono Socket socket = null; try { socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.DontLinger, false); IAsyncResult result = socket.BeginConnect(ipAddress.ToString(), currentPort, null, null); result.AsyncWaitHandle.WaitOne(TimeSpan.FromMilliseconds(connectTimeout), true); portIsOpen = socket.Connected; } catch { } finally { if (socket != null) socket.Close(); } return portIsOpen; } } }
Use Socket instead of TcpClient for port scanning Works around ObjectDisposedException on Linux + Mono
Use Socket instead of TcpClient for port scanning Works around ObjectDisposedException on Linux + Mono
C#
mit
IWBWbiz/MultiMiner,nwoolls/MultiMiner,IWBWbiz/MultiMiner,nwoolls/MultiMiner
7b42bf04d1b0db24d77d964ac2c41198224d92b2
TestAppUWP/Samples/Map/MapServiceSettings.cs
TestAppUWP/Samples/Map/MapServiceSettings.cs
namespace TestAppUWP.Samples.Map { public class MapServiceSettings { public static string Token = string.Empty; } }
namespace TestAppUWP.Samples.Map { public class MapServiceSettings { public const string TokenUwp1 = "TokenUwp1"; public const string TokenUwp2 = "TokenUwp2"; public static string SelectedToken = TokenUwp1; } }
Add multiple bing maps keys
Add multiple bing maps keys
C#
mit
DanieleScipioni/TestApp
6d5d4fc51b79d90d18072479f6cd288e25beceaa
src/lex4all/EngineControl.cs
src/lex4all/EngineControl.cs
using Microsoft.Speech.Recognition; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace lex4all { public static class EngineControl { /// <summary> /// creates engine and sets properties /// </summary> /// <returns> /// the engine used for recognition /// </returns> public static SpeechRecognitionEngine getEngine () { Console.WriteLine("Building recognition engine"); SpeechRecognitionEngine sre = new SpeechRecognitionEngine(new System.Globalization.CultureInfo("en-US")); // set confidence threshold(s) sre.UpdateRecognizerSetting("CFGConfidenceRejectionThreshold", 0); // add event handlers sre.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(sre_SpeechRecognized); Console.WriteLine("Done."); return sre; } /// <summary> /// handles the speech recognized event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> static void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e) { Console.WriteLine("Recognized text: " + e.Result.Text); } } }
using Microsoft.Speech.Recognition; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace lex4all { public static class EngineControl { /// <summary> /// creates engine and sets properties /// </summary> /// <returns> /// the engine used for recognition /// </returns> public static SpeechRecognitionEngine getEngine () { Console.WriteLine("Building recognition engine"); SpeechRecognitionEngine sre = new SpeechRecognitionEngine(new System.Globalization.CultureInfo("en-US")); // set confidence threshold(s) sre.UpdateRecognizerSetting("CFGConfidenceRejectionThreshold", 0); // add event handlers sre.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(sre_SpeechRecognized); Console.WriteLine("Done."); return sre; } /// <summary> /// handles the speech recognized event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> static void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e) { //Console.WriteLine("Recognized text: " + e.Result.Text); } } }
Change recognized event handler for eval
Change recognized event handler for eval
C#
bsd-2-clause
lex4all/lex4all,lex4all/lex4all,lex4all/lex4all
75fc999bfd3b7fd8339d6f346d5d3a29e051e282
src/OmniSharp/Api/Intellisense/OmnisharpController.Intellisense.cs
src/OmniSharp/Api/Intellisense/OmnisharpController.Intellisense.cs
using System.Linq; using System.Threading.Tasks; using Microsoft.AspNet.Mvc; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Recommendations; using Microsoft.CodeAnalysis.Text; using OmniSharp.Models; namespace OmniSharp { public partial class OmnisharpController { [HttpPost("autocomplete")] public async Task<IActionResult> AutoComplete([FromBody]Request request) { _workspace.EnsureBufferUpdated(request); var completions = Enumerable.Empty<AutoCompleteResponse>(); var document = _workspace.GetDocument(request.FileName); if (document != null) { var sourceText = await document.GetTextAsync(); var position = sourceText.Lines.GetPosition(new LinePosition(request.Line - 1, request.Column - 1)); var model = await document.GetSemanticModelAsync(); var symbols = Recommender.GetRecommendedSymbolsAtPosition(model, position, _workspace); completions = symbols.Select(MakeAutoCompleteResponse); } else { return new HttpNotFoundResult(); } return new ObjectResult(completions); } private AutoCompleteResponse MakeAutoCompleteResponse(ISymbol symbol) { var response = new AutoCompleteResponse(); response.CompletionText = symbol.Name; // TODO: Do something more intelligent here response.DisplayText = symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat); response.Description = symbol.GetDocumentationCommentXml(); return response; } } }
using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNet.Mvc; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Recommendations; using Microsoft.CodeAnalysis.Text; using OmniSharp.Models; namespace OmniSharp { public partial class OmnisharpController { [HttpPost("autocomplete")] public async Task<IActionResult> AutoComplete([FromBody]Request request) { _workspace.EnsureBufferUpdated(request); var completions = new List<AutoCompleteResponse>(); var documents = _workspace.GetDocuments(request.FileName); foreach (var document in documents) { var sourceText = await document.GetTextAsync(); var position = sourceText.Lines.GetPosition(new LinePosition(request.Line - 1, request.Column - 1)); var model = await document.GetSemanticModelAsync(); var symbols = Recommender.GetRecommendedSymbolsAtPosition(model, position, _workspace); completions.AddRange(symbols.Select(MakeAutoCompleteResponse)); } return new ObjectResult(completions); } private AutoCompleteResponse MakeAutoCompleteResponse(ISymbol symbol) { var response = new AutoCompleteResponse(); response.CompletionText = symbol.Name; // TODO: Do something more intelligent here response.DisplayText = symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat); response.Description = symbol.GetDocumentationCommentXml(); return response; } } }
Return completions from all documents
Return completions from all documents - Return the completions from all documents. This is a step towards combined intellisense for ASP.NET 5 projects.
C#
mit
sreal/omnisharp-roslyn,sreal/omnisharp-roslyn,OmniSharp/omnisharp-roslyn,ChrisHel/omnisharp-roslyn,OmniSharp/omnisharp-roslyn,nabychan/omnisharp-roslyn,DustinCampbell/omnisharp-roslyn,jtbm37/omnisharp-roslyn,ianbattersby/omnisharp-roslyn,nabychan/omnisharp-roslyn,fishg/omnisharp-roslyn,khellang/omnisharp-roslyn,sriramgd/omnisharp-roslyn,filipw/omnisharp-roslyn,khellang/omnisharp-roslyn,hitesh97/omnisharp-roslyn,david-driscoll/omnisharp-roslyn,RichiCoder1/omnisharp-roslyn,hal-ler/omnisharp-roslyn,david-driscoll/omnisharp-roslyn,haled/omnisharp-roslyn,hach-que/omnisharp-roslyn,ChrisHel/omnisharp-roslyn,ianbattersby/omnisharp-roslyn,filipw/omnisharp-roslyn,hal-ler/omnisharp-roslyn,hitesh97/omnisharp-roslyn,xdegtyarev/omnisharp-roslyn,fishg/omnisharp-roslyn,haled/omnisharp-roslyn,sriramgd/omnisharp-roslyn,RichiCoder1/omnisharp-roslyn,hach-que/omnisharp-roslyn,DustinCampbell/omnisharp-roslyn,jtbm37/omnisharp-roslyn,xdegtyarev/omnisharp-roslyn
f9edbdf378761dda5ebd4b0ab5b9b329269b8868
InfinniPlatform.Auth.HttpService/IoC/AuthHttpServiceContainerModule.cs
InfinniPlatform.Auth.HttpService/IoC/AuthHttpServiceContainerModule.cs
using InfinniPlatform.Http; using InfinniPlatform.IoC; namespace InfinniPlatform.Auth.HttpService.IoC { public class AuthHttpServiceContainerModule<TUser> : IContainerModule where TUser : AppUser { public void Load(IContainerBuilder builder) { builder.RegisterType(typeof(AuthInternalHttpService<>).MakeGenericType(typeof(TUser))) .As<IHttpService>() .SingleInstance(); builder.RegisterType<UserEventHandlerInvoker>() .AsSelf() .SingleInstance(); } } }
using InfinniPlatform.Http; using InfinniPlatform.IoC; namespace InfinniPlatform.Auth.HttpService.IoC { public class AuthHttpServiceContainerModule<TUser> : IContainerModule where TUser : AppUser { public void Load(IContainerBuilder builder) { builder.RegisterType(typeof(AuthInternalHttpService<>).MakeGenericType(typeof(TUser))) .As<IHttpService>() .SingleInstance(); builder.RegisterType(typeof(AuthExternalHttpService<>).MakeGenericType(typeof(TUser))) .As<IHttpService>() .SingleInstance(); builder.RegisterType(typeof(AuthManagementHttpService<>).MakeGenericType(typeof(TUser))) .As<IHttpService>() .SingleInstance(); builder.RegisterType<UserEventHandlerInvoker>() .AsSelf() .SingleInstance(); } } }
Fix auth http services registration
Fix auth http services registration
C#
agpl-3.0
InfinniPlatform/InfinniPlatform,InfinniPlatform/InfinniPlatform,InfinniPlatform/InfinniPlatform
08e31159fca22f2f599415f03de9b632073daa39
osu.Game.Tests/Visual/UserInterface/TestSceneToolbarRulesetSelector.cs
osu.Game.Tests/Visual/UserInterface/TestSceneToolbarRulesetSelector.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics.Containers; using osu.Game.Overlays.Toolbar; using System; using System.Collections.Generic; using osu.Framework.Graphics; using System.Linq; using osu.Framework.MathUtils; namespace osu.Game.Tests.Visual.UserInterface { public class TestSceneToolbarRulesetSelector : OsuTestScene { public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(ToolbarRulesetSelector), typeof(ToolbarRulesetTabButton), }; public TestSceneToolbarRulesetSelector() { ToolbarRulesetSelector selector; Add(new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, AutoSizeAxes = Axes.X, Height = Toolbar.HEIGHT, Child = selector = new ToolbarRulesetSelector() }); AddStep("Select random", () => { selector.Current.Value = selector.Items.ElementAt(RNG.Next(selector.Items.Count())); }); } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics.Containers; using osu.Game.Overlays.Toolbar; using System; using System.Collections.Generic; using osu.Framework.Graphics; using System.Linq; using osu.Framework.MathUtils; namespace osu.Game.Tests.Visual.UserInterface { public class TestSceneToolbarRulesetSelector : OsuTestScene { public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(ToolbarRulesetSelector), typeof(ToolbarRulesetTabButton), }; public TestSceneToolbarRulesetSelector() { ToolbarRulesetSelector selector; Add(new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, AutoSizeAxes = Axes.X, Height = Toolbar.HEIGHT, Child = selector = new ToolbarRulesetSelector() }); AddStep("Select random", () => { selector.Current.Value = selector.Items.ElementAt(RNG.Next(selector.Items.Count())); }); AddStep("Toggle disabled state", () => selector.Current.Disabled = !selector.Current.Disabled); } } }
Make testcase even more useful
Make testcase even more useful
C#
mit
NeoAdonis/osu,peppy/osu,EVAST9919/osu,2yangk23/osu,peppy/osu,NeoAdonis/osu,johnneijzen/osu,UselessToucan/osu,ppy/osu,smoogipoo/osu,ZLima12/osu,UselessToucan/osu,peppy/osu-new,smoogipoo/osu,peppy/osu,johnneijzen/osu,NeoAdonis/osu,EVAST9919/osu,ZLima12/osu,UselessToucan/osu,ppy/osu,smoogipooo/osu,ppy/osu,smoogipoo/osu,2yangk23/osu
c51fef28f9a40d26d2e6699ba3537f4056a8605b
RockLib.Logging.Microsoft.Extensions/RockLibLoggerExtensions.cs
RockLib.Logging.Microsoft.Extensions/RockLibLoggerExtensions.cs
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using RockLib.Logging.DependencyInjection; using System; namespace RockLib.Logging { public static class RockLibLoggerExtensions { public static ILoggingBuilder AddRockLibLoggerProvider(this ILoggingBuilder builder, string rockLibLoggerName = Logger.DefaultName) { if (builder is null) throw new ArgumentNullException(nameof(builder)); builder.Services.AddRockLibLoggerProvider(rockLibLoggerName); return builder; } public static IServiceCollection AddRockLibLoggerProvider(this IServiceCollection services, string rockLibLoggerName = Logger.DefaultName) { if (services is null) throw new ArgumentNullException(nameof(services)); services.Add(ServiceDescriptor.Singleton<ILoggerProvider>(serviceProvider => { var lookup = serviceProvider.GetRequiredService<LoggerLookup>(); var options = serviceProvider.GetService<IOptionsMonitor<RockLibLoggerOptions>>(); return new RockLibLoggerProvider(lookup(rockLibLoggerName), options); })); return services; } } }
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using RockLib.Logging.DependencyInjection; using System; namespace RockLib.Logging { public static class RockLibLoggerExtensions { public static ILoggingBuilder AddRockLibLoggerProvider(this ILoggingBuilder builder, string rockLibLoggerName = Logger.DefaultName, Action<RockLibLoggerOptions> configureOptions = null) { if (builder is null) throw new ArgumentNullException(nameof(builder)); builder.Services.AddRockLibLoggerProvider(rockLibLoggerName, configureOptions); return builder; } public static IServiceCollection AddRockLibLoggerProvider(this IServiceCollection services, string rockLibLoggerName = Logger.DefaultName, Action<RockLibLoggerOptions> configureOptions = null) { if (services is null) throw new ArgumentNullException(nameof(services)); services.Add(ServiceDescriptor.Singleton<ILoggerProvider>(serviceProvider => { var lookup = serviceProvider.GetRequiredService<LoggerLookup>(); var options = serviceProvider.GetService<IOptionsMonitor<RockLibLoggerOptions>>(); return new RockLibLoggerProvider(lookup(rockLibLoggerName), options); })); if (configureOptions != null) services.Configure(configureOptions); return services; } } }
Add configureOptions parameter to extension methods
Add configureOptions parameter to extension methods
C#
mit
RockFramework/Rock.Logging
2e326b9948767ea5030577beb1a83c312c81f2b6
ical.NET/Interfaces/DataTypes/IPeriodList.cs
ical.NET/Interfaces/DataTypes/IPeriodList.cs
using System.Collections.Generic; namespace Ical.Net.Interfaces.DataTypes { public interface IPeriodList : IEncodableDataType, IList<IPeriod> { string TzId { get; set; } IPeriod this[int index] { get; set; } void Add(IDateTime dt); void Remove(IDateTime dt); } }
using System.Collections.Generic; namespace Ical.Net.Interfaces.DataTypes { public interface IPeriodList : IEncodableDataType, IList<IPeriod> { string TzId { get; set; } new IPeriod this[int index] { get; set; } void Add(IDateTime dt); void Remove(IDateTime dt); } }
Stop hiding indexer on IList
Stop hiding indexer on IList
C#
mit
rianjs/ical.net
500ed7d236b39527e9d7e76d280bd156bcf6a1f2
Content.IntegrationTests/Tests/StationEvents/StationEventsSystemTest.cs
Content.IntegrationTests/Tests/StationEvents/StationEventsSystemTest.cs
using System.Threading.Tasks; using Content.Server.GameObjects.EntitySystems.StationEvents; using NUnit.Framework; using Robust.Shared.GameObjects.Systems; using Robust.Shared.Interfaces.Timing; using Robust.Shared.IoC; namespace Content.IntegrationTests.Tests.StationEvents { [TestFixture] public class StationEventsSystemTest : ContentIntegrationTest { [Test] public async Task Test() { var server = StartServerDummyTicker(); server.Assert(() => { // Idle each event once var stationEventsSystem = EntitySystem.Get<StationEventSystem>(); var dummyFrameTime = (float) IoCManager.Resolve<IGameTiming>().TickPeriod.TotalSeconds; foreach (var stationEvent in stationEventsSystem.StationEvents) { stationEvent.Startup(); stationEvent.Update(dummyFrameTime); stationEvent.Shutdown(); Assert.That(stationEvent.Occurrences == 1); } stationEventsSystem.ResettingCleanup(); foreach (var stationEvent in stationEventsSystem.StationEvents) { Assert.That(stationEvent.Occurrences == 0); } }); await server.WaitIdleAsync(); } } }
using System.Threading.Tasks; using Content.Server.GameObjects.EntitySystems.StationEvents; using NUnit.Framework; using Robust.Shared.GameObjects.Systems; using Robust.Shared.Interfaces.Timing; using Robust.Shared.IoC; namespace Content.IntegrationTests.Tests.StationEvents { [TestFixture] public class StationEventsSystemTest : ContentIntegrationTest { [Test] public async Task Test() { var server = StartServerDummyTicker(); server.Assert(() => { // Idle each event once var stationEventsSystem = EntitySystem.Get<StationEventSystem>(); var dummyFrameTime = (float) IoCManager.Resolve<IGameTiming>().TickPeriod.TotalSeconds; foreach (var stationEvent in stationEventsSystem.StationEvents) { stationEvent.Startup(); stationEvent.Update(dummyFrameTime); stationEvent.Shutdown(); Assert.That(stationEvent.Occurrences == 1); } stationEventsSystem.Reset(); foreach (var stationEvent in stationEventsSystem.StationEvents) { Assert.That(stationEvent.Occurrences == 0); } }); await server.WaitIdleAsync(); } } }
Fix station events system test
Fix station events system test
C#
mit
space-wizards/space-station-14,space-wizards/space-station-14-content,space-wizards/space-station-14-content,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14-content,space-wizards/space-station-14
a240f9a1748c8c0e29f3cc49d16c421b2c024f96
src/WebJobs.Script.WebHost/Security/KeyManagement/DefaultKeyValueConverterFactory.cs
src/WebJobs.Script.WebHost/Security/KeyManagement/DefaultKeyValueConverterFactory.cs
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using System; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Azure.WebJobs.Script.Config; using static Microsoft.Azure.Web.DataProtection.Constants; namespace Microsoft.Azure.WebJobs.Script.WebHost { public sealed class DefaultKeyValueConverterFactory : IKeyValueConverterFactory { private bool _encryptionSupported; private static readonly PlaintextKeyValueConverter PlaintextValueConverter = new PlaintextKeyValueConverter(FileAccess.ReadWrite); private static ScriptSettingsManager _settingsManager; public DefaultKeyValueConverterFactory(ScriptSettingsManager settingsManager) { _settingsManager = settingsManager; _encryptionSupported = IsEncryptionSupported(); } // In Linux Containers AzureWebsiteLocalEncryptionKey will be set, enabling encryption private static bool IsEncryptionSupported() => _settingsManager.IsAppServiceEnvironment || _settingsManager.GetSetting(AzureWebsiteLocalEncryptionKey) != null; public IKeyValueReader GetValueReader(Key key) { if (key.IsEncrypted) { return new DataProtectionKeyValueConverter(FileAccess.Read); } return PlaintextValueConverter; } public IKeyValueWriter GetValueWriter(Key key) { if (_encryptionSupported) { return new DataProtectionKeyValueConverter(FileAccess.Write); } return PlaintextValueConverter; } } }
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using System; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Azure.WebJobs.Script.Config; using static Microsoft.Azure.Web.DataProtection.Constants; namespace Microsoft.Azure.WebJobs.Script.WebHost { public sealed class DefaultKeyValueConverterFactory : IKeyValueConverterFactory { private readonly bool _encryptionSupported; private static readonly PlaintextKeyValueConverter PlaintextValueConverter = new PlaintextKeyValueConverter(FileAccess.ReadWrite); private static ScriptSettingsManager _settingsManager; public DefaultKeyValueConverterFactory(ScriptSettingsManager settingsManager) { _settingsManager = settingsManager; _encryptionSupported = IsEncryptionSupported(); } private static bool IsEncryptionSupported() { if (_settingsManager.IsLinuxContainerEnvironment) { // TEMP: https://github.com/Azure/azure-functions-host/issues/3035 return false; } return _settingsManager.IsAppServiceEnvironment || _settingsManager.GetSetting(AzureWebsiteLocalEncryptionKey) != null; } public IKeyValueReader GetValueReader(Key key) { if (key.IsEncrypted) { return new DataProtectionKeyValueConverter(FileAccess.Read); } return PlaintextValueConverter; } public IKeyValueWriter GetValueWriter(Key key) { if (_encryptionSupported) { return new DataProtectionKeyValueConverter(FileAccess.Write); } return PlaintextValueConverter; } } }
Use plain text for function secrets in Linux Containers
Use plain text for function secrets in Linux Containers
C#
mit
Azure/azure-webjobs-sdk-script,fabiocav/azure-webjobs-sdk-script,fabiocav/azure-webjobs-sdk-script,Azure/azure-webjobs-sdk-script,fabiocav/azure-webjobs-sdk-script,Azure/azure-webjobs-sdk-script,fabiocav/azure-webjobs-sdk-script,Azure/azure-webjobs-sdk-script
0dac770e38d899303147e6195a2fd9030a17c782
osu.Game/Tests/Visual/OsuTestCase.cs
osu.Game/Tests/Visual/OsuTestCase.cs
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using osu.Framework.Platform; using osu.Framework.Testing; namespace osu.Game.Tests.Visual { public abstract class OsuTestCase : TestCase { public override void RunTest() { Storage storage; using (var host = new HeadlessGameHost($"test-{Guid.NewGuid()}", realtime: false)) { storage = host.Storage; host.Run(new OsuTestCaseTestRunner(this)); } // clean up after each run storage.DeleteDirectory(string.Empty); } public class OsuTestCaseTestRunner : OsuGameBase { private readonly OsuTestCase testCase; public OsuTestCaseTestRunner(OsuTestCase testCase) { this.testCase = testCase; } protected override void LoadComplete() { base.LoadComplete(); Add(new TestCaseTestRunner.TestRunner(testCase)); } } } }
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using osu.Framework.Platform; using osu.Framework.Testing; namespace osu.Game.Tests.Visual { public abstract class OsuTestCase : TestCase { public override void RunTest() { using (var host = new HeadlessGameHost($"test-{Guid.NewGuid()}", realtime: false)) { host.Run(new OsuTestCaseTestRunner(this)); } // clean up after each run //storage.DeleteDirectory(string.Empty); } public class OsuTestCaseTestRunner : OsuGameBase { private readonly OsuTestCase testCase; public OsuTestCaseTestRunner(OsuTestCase testCase) { this.testCase = testCase; } protected override void LoadComplete() { base.LoadComplete(); Add(new TestCaseTestRunner.TestRunner(testCase)); } } } }
Remove TestCase cleanup temporarily until context disposal is sorted
Remove TestCase cleanup temporarily until context disposal is sorted
C#
mit
smoogipoo/osu,ppy/osu,NeoAdonis/osu,UselessToucan/osu,peppy/osu,ppy/osu,johnneijzen/osu,smoogipoo/osu,NeoAdonis/osu,naoey/osu,EVAST9919/osu,ZLima12/osu,smoogipoo/osu,DrabWeb/osu,ppy/osu,peppy/osu-new,smoogipooo/osu,DrabWeb/osu,naoey/osu,peppy/osu,Frontear/osuKyzer,DrabWeb/osu,EVAST9919/osu,johnneijzen/osu,Nabile-Rahmani/osu,NeoAdonis/osu,peppy/osu,UselessToucan/osu,2yangk23/osu,Drezi126/osu,ZLima12/osu,UselessToucan/osu,2yangk23/osu,naoey/osu
b36230755c26e7a064f3f3978293ce8cb4c36db6
apis/Google.Monitoring.V3/Google.Monitoring.V3.Snippets/GroupServiceClientSnippets.cs
apis/Google.Monitoring.V3/Google.Monitoring.V3.Snippets/GroupServiceClientSnippets.cs
// Copyright 2016 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using Google.Api.Gax; using System; using System.Linq; using Xunit; namespace Google.Monitoring.V3 { [Collection(nameof(MonitoringFixture))] public class GroupServiceClientSnippets { private readonly MonitoringFixture _fixture; public GroupServiceClientSnippets(MonitoringFixture fixture) { _fixture = fixture; } /* TODO: Reinstate when ListGroups is present again. [Fact] public void ListGroups() { string projectId = _fixture.ProjectId; // Snippet: ListGroups GroupServiceClient client = GroupServiceClient.Create(); string projectName = MetricServiceClient.FormatProjectName(projectId); IPagedEnumerable<ListGroupsResponse, Group> groups = client.ListGroups(projectName, "", "", ""); foreach (Group group in groups.Take(10)) { Console.WriteLine($"{group.Name}: {group.DisplayName}"); } // End snippet } */ } }
// Copyright 2016 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using Google.Api.Gax; using System; using System.Linq; using Xunit; namespace Google.Monitoring.V3 { [Collection(nameof(MonitoringFixture))] public class GroupServiceClientSnippets { private readonly MonitoringFixture _fixture; public GroupServiceClientSnippets(MonitoringFixture fixture) { _fixture = fixture; } /* TODO: Reinstate when ListGroups is present again. [Fact] public void ListGroups() { string projectId = _fixture.ProjectId; // FIXME:Snippet: ListGroups GroupServiceClient client = GroupServiceClient.Create(); string projectName = MetricServiceClient.FormatProjectName(projectId); IPagedEnumerable<ListGroupsResponse, Group> groups = client.ListGroups(projectName, "", "", ""); foreach (Group group in groups.Take(10)) { Console.WriteLine($"{group.Name}: {group.DisplayName}"); } // End snippet } */ } }
Remove the ListGroups snippet from Monitoring
Remove the ListGroups snippet from Monitoring The code is commented out, but the snippet was still found. Oops.
C#
apache-2.0
evildour/google-cloud-dotnet,googleapis/google-cloud-dotnet,ctaggart/google-cloud-dotnet,evildour/google-cloud-dotnet,evildour/google-cloud-dotnet,benwulfe/google-cloud-dotnet,chrisdunelm/google-cloud-dotnet,jskeet/google-cloud-dotnet,iantalarico/google-cloud-dotnet,ctaggart/google-cloud-dotnet,googleapis/google-cloud-dotnet,jskeet/google-cloud-dotnet,benwulfe/google-cloud-dotnet,ctaggart/google-cloud-dotnet,chrisdunelm/google-cloud-dotnet,jskeet/google-cloud-dotnet,iantalarico/google-cloud-dotnet,iantalarico/google-cloud-dotnet,chrisdunelm/gcloud-dotnet,googleapis/google-cloud-dotnet,chrisdunelm/google-cloud-dotnet,jskeet/google-cloud-dotnet,jskeet/gcloud-dotnet,jskeet/google-cloud-dotnet,benwulfe/google-cloud-dotnet
336d6ec9e787dcc9395e17cdd19df6ff4bfa7276
MediaManager/Plugin.MediaManager.Android/Properties/AssemblyInfo.cs
MediaManager/Plugin.MediaManager.Android/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Android.App; // 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("Plugin.MediaManager.Android")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Plugin.MediaManager.Android")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Android.App; // 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("Plugin.MediaManager.Android")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Plugin.MediaManager.Android")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: UsesPermission(Android.Manifest.Permission.AccessWifiState)] [assembly: UsesPermission(Android.Manifest.Permission.Internet)] [assembly: UsesPermission(Android.Manifest.Permission.MediaContentControl)] [assembly: UsesPermission(Android.Manifest.Permission.WakeLock)]
Set Android permissions through Assemblyinfo
Set Android permissions through Assemblyinfo
C#
mit
martijn00/XamarinMediaManager,mike-rowley/XamarinMediaManager,bubavanhalen/XamarinMediaManager,mike-rowley/XamarinMediaManager,modplug/XamarinMediaManager,martijn00/XamarinMediaManager
e78a480966c57d84cfe8bfd102aa29742c495c75
BigEgg.ConsoleExtension/Parameters/Errors/CommandHelpRequestError.cs
BigEgg.ConsoleExtension/Parameters/Errors/CommandHelpRequestError.cs
namespace BigEgg.ConsoleExtension.Parameters.Errors { using System; internal class CommandHelpRequestError : Error { public CommandHelpRequestError() : base(ErrorType.CommandHelpRequest, true) { } public string CommandName { get; private set; } public bool Existed { get; set; } public Type CommandType { get; set; } } }
namespace BigEgg.ConsoleExtension.Parameters.Errors { using System; internal class CommandHelpRequestError : Error { public CommandHelpRequestError(string commandName, bool existed, Type commandType) : base(ErrorType.CommandHelpRequest, true) { CommandName = commandName; Existed = existed; CommandType = existed ? commandType : null; } public string CommandName { get; private set; } public bool Existed { get; private set; } public Type CommandType { get; private set; } } }
Update the Command Help Request Error to get the value
Update the Command Help Request Error to get the value
C#
mit
BigEggTools/JsonComparer
251bdfdee8c0232235b8de4f25620ca270946fd6
osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmap.cs
osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmap.cs
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; using System.Linq; using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Osu.Objects; namespace osu.Game.Rulesets.Osu.Beatmaps { public class OsuBeatmap : Beatmap<OsuHitObject> { public override IEnumerable<BeatmapStatistic> GetStatistics() { IEnumerable<HitObject> circles = HitObjects.Where(c => c is HitCircle); IEnumerable<HitObject> sliders = HitObjects.Where(s => s is Slider); IEnumerable<HitObject> spinners = HitObjects.Where(s => s is Spinner); return new[] { new BeatmapStatistic { Name = @"Circle Count", Content = circles.Count().ToString(), Icon = FontAwesome.fa_circle_o }, new BeatmapStatistic { Name = @"Slider Count", Content = sliders.Count().ToString(), Icon = FontAwesome.fa_circle }, new BeatmapStatistic { Name = @"Spinner Count", Content = spinners.Count().ToString(), Icon = FontAwesome.fa_circle } }; } } }
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; using System.Linq; using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Rulesets.Osu.Objects; namespace osu.Game.Rulesets.Osu.Beatmaps { public class OsuBeatmap : Beatmap<OsuHitObject> { public override IEnumerable<BeatmapStatistic> GetStatistics() { int circles = HitObjects.Count(c => c is HitCircle); int sliders = HitObjects.Count(s => s is Slider); int spinners = HitObjects.Count(s => s is Spinner); return new[] { new BeatmapStatistic { Name = @"Circle Count", Content = circles.ToString(), Icon = FontAwesome.fa_circle_o }, new BeatmapStatistic { Name = @"Slider Count", Content = sliders.ToString(), Icon = FontAwesome.fa_circle }, new BeatmapStatistic { Name = @"Spinner Count", Content = spinners.ToString(), Icon = FontAwesome.fa_circle } }; } } }
Simplify statistics in osu ruleset
Simplify statistics in osu ruleset
C#
mit
smoogipoo/osu,johnneijzen/osu,ppy/osu,naoey/osu,naoey/osu,UselessToucan/osu,EVAST9919/osu,peppy/osu,2yangk23/osu,ZLima12/osu,ppy/osu,naoey/osu,johnneijzen/osu,ppy/osu,DrabWeb/osu,DrabWeb/osu,UselessToucan/osu,smoogipoo/osu,UselessToucan/osu,ZLima12/osu,peppy/osu,peppy/osu-new,NeoAdonis/osu,NeoAdonis/osu,DrabWeb/osu,2yangk23/osu,EVAST9919/osu,smoogipoo/osu,peppy/osu,NeoAdonis/osu,smoogipooo/osu
523332242038c4216b4ad7898a3566e3d82c0ac3
ChildProcessUtil/Program.cs
ChildProcessUtil/Program.cs
using System; using System.Collections.Generic; using System.Threading; using Nancy; using Nancy.Hosting.Self; namespace ChildProcessUtil { public class Program { private const string HttpAddress = "http://localhost:"; private static NancyHost host; private static void Main(string[] args) { if (args.Length != 2) { Console.WriteLine("usage: ChildProcessUtil.exe serverPort mainProcessId"); return; } StartServer(int.Parse(args[0]), int.Parse(args[1])); } public static void StartServer(int port, int mainProcessId) { var hostConfigs = new HostConfiguration { UrlReservations = new UrlReservations {CreateAutomatically = true} }; var uriString = HttpAddress + port; ProcessModule.ActiveProcesses = new List<int>(); host = new NancyHost(new Uri(uriString), new DefaultNancyBootstrapper(), hostConfigs); host.Start(); new MainProcessWatcher(mainProcessId); Thread.Sleep(Timeout.Infinite); } internal static void StopServer(int port) { host.Stop(); } } }
using System; using System.Collections.Generic; using System.Threading; using Nancy; using Nancy.Hosting.Self; namespace ChildProcessUtil { public class Program { private const string HttpAddress = "http://localhost:"; private static NancyHost host; private static void Main(string[] args) { Console.WriteLine("Child process watcher and automatic killer"); if (args.Length != 2) { Console.WriteLine("usage: ChildProcessUtil.exe serverPort mainProcessId"); return; } StartServer(int.Parse(args[0]), int.Parse(args[1])); } public static void StartServer(int port, int mainProcessId) { var hostConfigs = new HostConfiguration { UrlReservations = new UrlReservations {CreateAutomatically = true} }; var uriString = HttpAddress + port; ProcessModule.ActiveProcesses = new List<int>(); host = new NancyHost(new Uri(uriString), new DefaultNancyBootstrapper(), hostConfigs); host.Start(); new MainProcessWatcher(mainProcessId); Thread.Sleep(Timeout.Infinite); } internal static void StopServer(int port) { host.Stop(); } } }
Add short desc on main
Add short desc on main
C#
mit
ramik/ChildProcessUtil
5406194784278a5d74d903079e77933fc10969cc
Common/Constants.cs
Common/Constants.cs
namespace ReimuPlugins.Common { public enum Revision { Rev1 = 1, Rev2 } public enum ErrorCode { NoFunction = -1, AllRight, NotSupport, FileReadError, FileWriteError, NoMemory, UnknownError, DialogCanceled } public enum TextAlign { Left = 0, Right, Center } public enum SortType { String = 0, Number, Float, Hex } public enum SystemInfoType { String = 0, Path, Directory, Title, Extension, CreateTime, LastAccessTime, LastWriteTime, FileSize } }
using System.Text; namespace ReimuPlugins.Common { public enum Revision { Rev1 = 1, Rev2 } public enum ErrorCode { NoFunction = -1, AllRight, NotSupport, FileReadError, FileWriteError, NoMemory, UnknownError, DialogCanceled } public enum TextAlign { Left = 0, Right, Center } public enum SortType { String = 0, Number, Float, Hex } public enum SystemInfoType { String = 0, Path, Directory, Title, Extension, CreateTime, LastAccessTime, LastWriteTime, FileSize } public static class Enc { public static readonly Encoding SJIS = Encoding.GetEncoding("shift_jis"); public static readonly Encoding UTF8 = Encoding.UTF8; } }
Add Enc class for convenience
Add Enc class for convenience
C#
bsd-2-clause
y-iihoshi/REIMU_Plugins_V2,y-iihoshi/REIMU_Plugins_V2
68d196b0d4e19da43d44b64325b1a05436696cf7
Settings/OptionsDialogPage.cs
Settings/OptionsDialogPage.cs
/** Copyright 2014-2017 Robert McNeel and Associates Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **/ using Rhino; using Rhino.DocObjects; using Rhino.UI; using System; using System.Drawing; namespace RhinoCycles.Settings { public class OptionsDialogPage : Rhino.UI.OptionsDialogPage { public OptionsDialogPage() : base(Localization.LocalizeString("Raytraced settings", 37)) { CollapsibleSectionHolder = new OptionsDialogCollapsibleSectionUIPanel(); } public override object PageControl => CollapsibleSectionHolder; private OptionsDialogCollapsibleSectionUIPanel CollapsibleSectionHolder { get; } } }
/** Copyright 2014-2017 Robert McNeel and Associates Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **/ using Rhino; using Rhino.DocObjects; using Rhino.UI; using System; using System.Drawing; namespace RhinoCycles.Settings { public class OptionsDialogPage : Rhino.UI.OptionsDialogPage { public OptionsDialogPage() : base(Localization.LocalizeString("Cycles", 7)) { CollapsibleSectionHolder = new OptionsDialogCollapsibleSectionUIPanel(); } public override object PageControl => CollapsibleSectionHolder; private OptionsDialogCollapsibleSectionUIPanel CollapsibleSectionHolder { get; } } }
Rename Raytraced settings Options page to just Cycles.
Rename Raytraced settings Options page to just Cycles.
C#
apache-2.0
mcneel/RhinoCycles
5522f022576e8e20225d2c3094b06529a7848bc1
src/NodaTime/Utility/InvalidNodaDataException.cs
src/NodaTime/Utility/InvalidNodaDataException.cs
// Copyright 2013 The Noda Time Authors. All rights reserved. // Use of this source code is governed by the Apache License 2.0, // as found in the LICENSE.txt file. using System; namespace NodaTime.Utility { /// <summary> /// Exception thrown when data read by Noda Time (such as serialized time zone data) is invalid. /// </summary> /// <remarks> /// This type only exists as <c>InvalidDataException</c> doesn't exist in the Portable Class Library. /// Unfortunately, <c>InvalidDataException</c> itself is sealed, so we can't derive from it for the sake /// of backward compatibility. /// </remarks> /// <threadsafety>Any public static members of this type are thread safe. Any instance members are not guaranteed to be thread safe. /// See the thread safety section of the user guide for more information. /// </threadsafety> #if !PCL [Serializable] #endif // TODO: Derive from IOException instead, like EndOfStreamException does? public class InvalidNodaDataException : Exception { /// <summary> /// Creates an instance with the given message. /// </summary> /// <param name="message">The message for the exception.</param> public InvalidNodaDataException(string message) : base(message) { } } }
// Copyright 2013 The Noda Time Authors. All rights reserved. // Use of this source code is governed by the Apache License 2.0, // as found in the LICENSE.txt file. using System; namespace NodaTime.Utility { /// <summary> /// Exception thrown when data read by Noda Time (such as serialized time zone data) is invalid. /// </summary> /// <remarks> /// This type only exists as <c>InvalidDataException</c> doesn't exist in the Portable Class Library. /// Unfortunately, <c>InvalidDataException</c> itself is sealed, so we can't derive from it for the sake /// of backward compatibility. /// </remarks> /// <threadsafety>Any public static members of this type are thread safe. Any instance members are not guaranteed to be thread safe. /// See the thread safety section of the user guide for more information. /// </threadsafety> #if !PCL [Serializable] #endif // TODO: Derive from IOException instead, like EndOfStreamException does? public class InvalidNodaDataException : Exception { /// <summary> /// Creates an instance with the given message. /// </summary> /// <param name="message">The message for the exception.</param> public InvalidNodaDataException(string message) : base(message) { } } }
Fix crazy Unix line endings ;)
Fix crazy Unix line endings ;)
C#
apache-2.0
BenJenkinson/nodatime,nodatime/nodatime,zaccharles/nodatime,BenJenkinson/nodatime,jskeet/nodatime,malcolmr/nodatime,malcolmr/nodatime,zaccharles/nodatime,jskeet/nodatime,zaccharles/nodatime,malcolmr/nodatime,zaccharles/nodatime,zaccharles/nodatime,malcolmr/nodatime,nodatime/nodatime,zaccharles/nodatime
be70d0e1ea242e6a7ba0829a188240bd453a26bd
src/Cake.Yarn/IYarnRunnerCommands.cs
src/Cake.Yarn/IYarnRunnerCommands.cs
using System; namespace Cake.Yarn { /// <summary> /// Yarn Runner command interface /// </summary> public interface IYarnRunnerCommands { /// <summary> /// execute 'yarn install' with options /// </summary> /// <param name="configure">options when running 'yarn install'</param> IYarnRunnerCommands Install(Action<YarnInstallSettings> configure = null); /// <summary> /// execute 'yarn add' with options /// </summary> /// <param name="configure">options when running 'yarn add'</param> IYarnRunnerCommands Add(Action<YarnAddSettings> configure = null); /// <summary> /// execute 'yarn run' with arguments /// </summary> /// <param name="scriptName">name of the </param> /// <param name="configure">options when running 'yarn run'</param> IYarnRunnerCommands RunScript(string scriptName, Action<YarnRunSettings> configure = null); /// <summary> /// execute 'yarn pack' with options /// </summary> /// <param name="packSettings">options when running 'yarn pack'</param> IYarnRunnerCommands Pack(Action<YarnPackSettings> packSettings = null); /// <summary> /// execute 'yarn version' with options /// </summary> /// <param name="versionSettings">options when running 'yarn version'</param> IYarnRunnerCommands Version(Action<YarnVersionSettings> versionSettings = null); } }
using System; namespace Cake.Yarn { /// <summary> /// Yarn Runner command interface /// </summary> public interface IYarnRunnerCommands { /// <summary> /// execute 'yarn install' with options /// </summary> /// <param name="configure">options when running 'yarn install'</param> IYarnRunnerCommands Install(Action<YarnInstallSettings> configure = null); /// <summary> /// execute 'yarn add' with options /// </summary> /// <param name="configure">options when running 'yarn add'</param> IYarnRunnerCommands Add(Action<YarnAddSettings> configure = null); /// <summary> /// execute 'yarn run' with arguments /// </summary> /// <param name="scriptName">name of the </param> /// <param name="configure">options when running 'yarn run'</param> IYarnRunnerCommands RunScript(string scriptName, Action<YarnRunSettings> configure = null); /// <summary> /// execute 'yarn pack' with options /// </summary> /// <param name="packSettings">options when running 'yarn pack'</param> IYarnRunnerCommands Pack(Action<YarnPackSettings> packSettings = null); /// <summary> /// execute 'yarn version' with options /// </summary> /// <param name="versionSettings">options when running 'yarn version'</param> IYarnRunnerCommands Version(Action<YarnVersionSettings> versionSettings = null); /// <summary> /// execute 'yarn audit' with options /// </summary> /// <param name="auditSettings">options when running 'yarn audit'</param> /// <returns></returns> IYarnRunnerCommands Audit(Action<YarnAuditSettings> auditSettings = null); } }
Fix 'yarn audit'. Register the Audit alias
Fix 'yarn audit'. Register the Audit alias Fixes commit cd2e060948ba57c64798fa551b3a33cc6a792314
C#
mit
MilovanovM/cake-yarn,MilovanovM/cake-yarn
225adbdae2af28ceb19195001fbdde60b8783a61
src/Wave.IoC.Unity/Extensions/FluentConfigurationSourceExtensions.cs
src/Wave.IoC.Unity/Extensions/FluentConfigurationSourceExtensions.cs
/* Copyright 2014 Jonathan Holland. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using Microsoft.Practices.Unity; using Wave.Configuration; using Wave.IoC.Unity; namespace Wave { public static class FluentConfigurationSourceExtensions { public static FluentConfigurationSource UseUnity(this FluentConfigurationSource builder, UnityContainer container) { return builder.UsingContainer(new UnityContainerAdapter(container)); } } }
/* Copyright 2014 Jonathan Holland. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using Microsoft.Practices.Unity; using Wave.Configuration; using Wave.IoC.Unity; namespace Wave { public static class FluentConfigurationSourceExtensions { public static FluentConfigurationSource UseUnity(this FluentConfigurationSource builder, IUnityContainer container) { return builder.UsingContainer(new UnityContainerAdapter(container)); } } }
Use interface, not concrete type, for Unity Fluent extension.
Use interface, not concrete type, for Unity Fluent extension.
C#
apache-2.0
WaveServiceBus/WaveServiceBus
f4b9eef94902a6e7c4b3db0df7d56b13b6a17dc2
tests/Magick.NET.Tests/Shared/MagickImageTests/TheAddNoiseMethod.cs
tests/Magick.NET.Tests/Shared/MagickImageTests/TheAddNoiseMethod.cs
// Copyright 2013-2020 Dirk Lemstra <https://github.com/dlemstra/Magick.NET/> // // Licensed under the ImageMagick License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // // https://www.imagemagick.org/script/license.php // // Unless required by applicable law or agreed to in writing, software distributed under the // License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, // either express or implied. See the License for the specific language governing permissions // and limitations under the License. using ImageMagick; using Xunit; namespace Magick.NET.Tests { public partial class MagickImageTests { public class TheAddNoiseMethod { [Fact] public void ShouldCreateDifferentImagesEachRun() { using (var imageA = new MagickImage(MagickColors.Black, 10, 10)) { using (var imageB = new MagickImage(MagickColors.Black, 10, 10)) { imageA.AddNoise(NoiseType.Random); imageB.AddNoise(NoiseType.Random); Assert.NotEqual(0.0, imageA.Compare(imageB, ErrorMetric.RootMeanSquared)); } } } } } }
// Copyright 2013-2020 Dirk Lemstra <https://github.com/dlemstra/Magick.NET/> // // Licensed under the ImageMagick License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // // https://www.imagemagick.org/script/license.php // // Unless required by applicable law or agreed to in writing, software distributed under the // License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, // either express or implied. See the License for the specific language governing permissions // and limitations under the License. using ImageMagick; using Xunit; namespace Magick.NET.Tests { public partial class MagickImageTests { public class TheAddNoiseMethod { [Fact] public void ShouldCreateDifferentImagesEachRun() { using (var imageA = new MagickImage(MagickColors.Black, 100, 100)) { imageA.AddNoise(NoiseType.Random); using (var imageB = new MagickImage(MagickColors.Black, 100, 100)) { imageB.AddNoise(NoiseType.Random); Assert.NotEqual(0.0, imageA.Compare(imageB, ErrorMetric.RootMeanSquared)); } } } } } }
Test with a slightly larger image.
Test with a slightly larger image.
C#
apache-2.0
dlemstra/Magick.NET,dlemstra/Magick.NET