commit
stringlengths
40
40
subject
stringlengths
4
1.73k
repos
stringlengths
5
127k
old_file
stringlengths
2
751
new_file
stringlengths
2
751
new_contents
stringlengths
1
8.98k
old_contents
stringlengths
0
6.59k
license
stringclasses
13 values
lang
stringclasses
23 values
43547ae1903118a90d2ec1082a38159e056225ad
test commit
FriendlyNPC/MVC6_Mac,FriendlyNPC/MVC6_Mac
DiplomaDataModel/Class1.cs
DiplomaDataModel/Class1.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace DiplomaDataModel { public class Class1 { public Class1() { var test; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace DiplomaDataModel { public class Class1 { public Class1() { } } }
mit
C#
5b3b6a3c3e0a3c12c8c8366108848d101764d36d
Fix access denied issue when access process information in RemoteProcessService
mdavid/SuperSocket,mdavid/SuperSocket,mdavid/SuperSocket
RemoteProcessTool/RemoteProcessService/Command/LIST.cs
RemoteProcessTool/RemoteProcessService/Command/LIST.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using SuperSocket.SocketServiceCore.Command; using System.Diagnostics; namespace RemoteProcessService.Command { public class LIST : ICommand<RemotePrcessSession> { #region ICommand<RemotePrcessSession> Members public void Execute(RemotePrcessSession session, CommandInfo commandData) { Process[] processes; string firstParam = commandData.GetFirstParam(); if (string.IsNullOrEmpty(firstParam) || firstParam == "*") processes = Process.GetProcesses(); else processes = Process.GetProcesses().Where(p => p.ProcessName.IndexOf(firstParam, StringComparison.OrdinalIgnoreCase) >= 0).ToArray(); StringBuilder sb = new StringBuilder(); foreach (var p in processes) { sb.AppendLine(string.Format("{0}\t{1}", p.ProcessName, p.Id)); } sb.AppendLine(); session.SendResponse(sb.ToString()); } #endregion } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using SuperSocket.SocketServiceCore.Command; using System.Diagnostics; namespace RemoteProcessService.Command { public class LIST : ICommand<RemotePrcessSession> { #region ICommand<RemotePrcessSession> Members public void Execute(RemotePrcessSession session, CommandInfo commandData) { Process[] processes; string firstParam = commandData.GetFirstParam(); if (string.IsNullOrEmpty(firstParam) || firstParam == "*") processes = Process.GetProcesses(); else processes = Process.GetProcesses().Where(p => p.ProcessName.IndexOf(firstParam, StringComparison.OrdinalIgnoreCase) >= 0).ToArray(); StringBuilder sb = new StringBuilder(); foreach (var p in processes) { sb.AppendLine(string.Format("{0}\t{1}\t{2}", p.ProcessName, p.Id, p.TotalProcessorTime)); } sb.AppendLine(); session.SendResponse(sb.ToString()); } #endregion } }
apache-2.0
C#
a656e677e4d8c989d4cd20ee6d109471e65d41db
Simplify EqualsHelper by calling WriteInvoke (#192)
jonathanpeppers/Embeddinator-4000,mono/Embeddinator-4000,mono/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,mono/Embeddinator-4000,mono/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,mono/Embeddinator-4000,mono/Embeddinator-4000,mono/Embeddinator-4000,jonathanpeppers/Embeddinator-4000,jonathanpeppers/Embeddinator-4000
objcgen/EqualsHelper.cs
objcgen/EqualsHelper.cs
using System; using Embeddinator; namespace ObjC { public class EqualsHelper : MethodHelper{ public EqualsHelper (SourceWriter headers, SourceWriter implementation) : base (headers, implementation) { MonoSignature = "Equals(object)"; ObjCSignature = "isEqual:(id _Nullable)other"; ReturnType = "bool"; } public void WriteImplementation () { BeginImplementation (); implementation.WriteLine ("if (![other respondsToSelector: @selector (xamarinGetGCHandle)])"); implementation.Indent++; implementation.WriteLine ("return false;"); implementation.Indent--; WriteMethodLookup (); implementation.WriteLine ("void* __args [1];"); implementation.WriteLine ("int gchandle = [other xamarinGetGCHandle];"); implementation.WriteLine ("__args[0] = mono_gchandle_get_target (gchandle);"); WriteInvoke ("__args"); implementation.WriteLine ("void* __unbox = mono_object_unbox (__result);"); implementation.WriteLine ("return *((bool*)__unbox);"); EndImplementation (); } } }
using System; using System.IO; using Embeddinator; namespace ObjC { public class EqualsHelper : MethodHelper{ public EqualsHelper (SourceWriter headers, SourceWriter implementation) : base (headers, implementation) { MonoSignature = "Equals(object)"; ObjCSignature = "isEqual:(id _Nullable)other"; ReturnType = "bool"; } public void WriteImplementation () { BeginImplementation (); implementation.WriteLine ("if (![other respondsToSelector: @selector (xamarinGetGCHandle)])"); implementation.Indent++; implementation.WriteLine ("return false;"); implementation.Indent--; WriteMethodLookup (); implementation.WriteLine ("MonoObject* __exception = nil;"); var instance = "nil"; implementation.WriteLine ($"MonoObject* __instance = mono_gchandle_get_target (_object->_handle);"); instance = "__instance"; implementation.WriteLine ("void* __args [1];"); implementation.WriteLine ("int gchandle = [other xamarinGetGCHandle];"); implementation.WriteLine ("__args[0] = mono_gchandle_get_target (gchandle);"); implementation.Write ("MonoObject* __result = "); implementation.WriteLine ($"mono_runtime_invoke (__method, {instance}, __args, &__exception);"); implementation.WriteLine ("if (__exception)"); implementation.Indent++; if (IgnoreException) { // TODO: Apple often do NSLog (or asserts but they are more brutal) and returning nil is allowed (and common) implementation.WriteLine ("return nil;"); } else { implementation.WriteLine ("mono_embeddinator_throw_exception (__exception);"); } implementation.Indent--; implementation.WriteLine ("void* __unbox = mono_object_unbox (__result);"); implementation.WriteLine ("return *((bool*)__unbox);"); EndImplementation (); } } }
mit
C#
d7544f570184be26579f32f1bdeee0f17e681768
Fix test name
bhaveshmaniya/Habitat,GoranHalvarsson/Habitat,zyq524/Habitat,nurunquebec/Habitat,ClearPeopleLtd/Habitat,nurunquebec/Habitat,GoranHalvarsson/Habitat,bhaveshmaniya/Habitat,zyq524/Habitat,ClearPeopleLtd/Habitat
src/Foundation/SitecoreExtensions/Tests/Extensions/StringExtensionsTests.cs
src/Foundation/SitecoreExtensions/Tests/Extensions/StringExtensionsTests.cs
namespace Sitecore.Foundation.SitecoreExtensions.Tests.Extensions { using System; using FluentAssertions; using NSubstitute; using Sitecore.Data; using Sitecore.Data.Items; using Sitecore.FakeDb; using Sitecore.FakeDb.AutoFixture; using Sitecore.Foundation.SitecoreExtensions.Extensions; using Sitecore.Foundation.SitecoreExtensions.Tests.Common; using Xunit; public class StringExtensionsTests { [Theory] [InlineData("TestString","Test String")] [InlineData("Test String","Test String")] public void Humanize_ShouldReturnValueSplittedWithWhitespaces(string input, string expected) { input.Humanize().Should().Be(expected); } } }
namespace Sitecore.Foundation.SitecoreExtensions.Tests.Extensions { using System; using FluentAssertions; using NSubstitute; using Sitecore.Data; using Sitecore.Data.Items; using Sitecore.FakeDb; using Sitecore.FakeDb.AutoFixture; using Sitecore.Foundation.SitecoreExtensions.Extensions; using Sitecore.Foundation.SitecoreExtensions.Tests.Common; using Xunit; public class StringExtensionsTests { [Theory] [InlineData("TestString","Test String")] [InlineData("Test String","Test String")] public void DisplayNameShouldReturnActualValue(string input, string expected) { input.Humanize().Should().Be(expected); } } }
apache-2.0
C#
a555e617e8ee94e3cc7d778105d66404243806ff
Update Agent String (#3953)
fassadlr/StratisBitcoinFullNode,stratisproject/StratisBitcoinFullNode,quantumagi/StratisBitcoinFullNode,stratisproject/StratisBitcoinFullNode,fassadlr/StratisBitcoinFullNode,quantumagi/StratisBitcoinFullNode
src/Stratis.Bitcoin.Features.SmartContracts/SmartContractVersionProvider.cs
src/Stratis.Bitcoin.Features.SmartContracts/SmartContractVersionProvider.cs
using Stratis.Bitcoin.Interfaces; namespace Stratis.Bitcoin.Features.SmartContracts { public sealed class SmartContractVersionProvider : IVersionProvider { /// <inheritdoc /> public string GetVersion() { return "1.0.2.0"; } } }
using Stratis.Bitcoin.Interfaces; namespace Stratis.Bitcoin.Features.SmartContracts { public sealed class SmartContractVersionProvider : IVersionProvider { /// <inheritdoc /> public string GetVersion() { return "1.0.2.0-beta"; } } }
mit
C#
d71c4318c1b7e874df27edab7f5ad4f2e4edf2fb
Add new keyword for hiding the none generic generate
inputfalken/Sharpy
GeneratorAPI/IGenerator.cs
GeneratorAPI/IGenerator.cs
namespace GeneratorAPI { /// <summary> /// Represents a generic generator which can generate any ammount of elements. /// </summary> /// <typeparam name="T"></typeparam> public interface IGenerator<out T> : IGenerator { /// <summary> /// Generate next element. /// </summary> new T Generate(); } public interface IGenerator { object Generate(); } }
namespace GeneratorAPI { /// <summary> /// Represents a generic generator which can generate any ammount of elements. /// </summary> /// <typeparam name="T"></typeparam> public interface IGenerator<out T> : IGenerator { /// <summary> /// Generate next element. /// </summary> T Generate(); } public interface IGenerator { object Generate(); } }
mit
C#
cd0091dc80a412eadb2941691c23abb3b73677f1
remove Obsolete from GameType, it's not actually obsolete
HearthSim/HearthDb
HearthDb/Enums/GameType.cs
HearthDb/Enums/GameType.cs
using System; namespace HearthDb.Enums { public enum GameType { GT_UNKNOWN = 0, GT_VS_AI = 1, GT_VS_FRIEND = 2, GT_TUTORIAL = 4, GT_ARENA = 5, GT_TEST = 6, GT_RANKED = 7, GT_UNRANKED = 8, GT_TAVERNBRAWL = 16, GT_TB_2P_COOP = 18, GT_LAST = 17 } }
using System; namespace HearthDb.Enums { [Obsolete("Use BnetGameType")] public enum GameType { GT_UNKNOWN = 0, GT_VS_AI = 1, GT_VS_FRIEND = 2, GT_TUTORIAL = 4, GT_ARENA = 5, GT_TEST = 6, GT_RANKED = 7, GT_UNRANKED = 8, GT_TAVERNBRAWL = 16, GT_TB_2P_COOP = 18, GT_LAST = 17 } }
mit
C#
e2431d5217fec7a9f489003328a2a3e4b7d08fc5
Update SMSTodayAMController.cs
dkitchen/bpcc,dkitchen/bpcc
src/BPCCScheduler.Web/Controllers/SMSTodayAMController.cs
src/BPCCScheduler.Web/Controllers/SMSTodayAMController.cs
using BPCCScheduler.Models; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; using Twilio; namespace BPCCScheduler.Controllers { public class SMSTodayAMController : SMSApiController { //public IEnumerable<SMSMessage> Get() public IEnumerable<Appointment> Get() { //any appointment today after last-night midnight, but before today noon var lastNightMidnight = DateTime.Now.Date; var ret = ""; ret += lastNightMidnight.ToLongDateString(); ret += " " + lastNightMidnight.ToLongTimeString(); var todayNoon = lastNightMidnight.AddHours(12); ret += " " + todayNoon.ToLongDateString(); ret += " " + todayNoon.ToLongTimeString(); return ret; var appts = base.AppointmentContext.Appointments.ToList() //materialize for date conversion //.Where(i => i.Date.ToLocalTime() > lastNightMidnight && i.Date.ToLocalTime() < todayNoon); .Select(i => new Appointment { Date = i.Date.ToLocalTime(), ClientName = i.ClientName, Cell = i.Cell}); return appts; var messages = new List<SMSMessage>(); foreach (var appt in appts) { var body = string.Format("BPCC Reminder: Appointment this morning at {0}", appt.Date.ToLocalTime().ToShortTimeString()); var cell = string.Format("+1{0}", appt.Cell); messages.Add(base.SendSmsMessage(cell, body)); } //return messages; } } }
using BPCCScheduler.Models; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; using Twilio; namespace BPCCScheduler.Controllers { public class SMSTodayAMController : SMSApiController { //public IEnumerable<SMSMessage> Get() public string Get() { //any appointment today after last-night midnight, but before today noon var lastNightMidnight = DateTime.Now.Date; var ret = ""; ret += lastNightMidnight.ToLongDateString(); ret += " " + lastNightMidnight.ToLongTimeString(); var todayNoon = lastNightMidnight.AddHours(12); ret += " " + todayNoon.ToLongDateString(); ret += " " + todayNoon.ToLongTimeString(); return ret; var appts = base.AppointmentContext.Appointments.ToList() //materialize for date conversion .Where(i => i.Date.ToLocalTime() > lastNightMidnight && i.Date.ToLocalTime() < todayNoon); var messages = new List<SMSMessage>(); foreach (var appt in appts) { var body = string.Format("BPCC Reminder: Appointment this morning at {0}", appt.Date.ToLocalTime().ToShortTimeString()); var cell = string.Format("+1{0}", appt.Cell); messages.Add(base.SendSmsMessage(cell, body)); } //return messages; } } }
mit
C#
b27add915b1f113ee416f6f529908f169920b525
Fix code using old style code-gen factory classes - use GrainClient.GrainFactory
amccool/orleans,rrector/orleans,Liversage/orleans,SoftWar1923/orleans,benjaminpetit/orleans,jokin/orleans,dotnet/orleans,gabikliot/orleans,sergeybykov/orleans,xclayl/orleans,tsibelman/orleans,hoopsomuah/orleans,MikeHardman/orleans,kowalot/orleans,gigya/orleans,bstauff/orleans,rrector/orleans,tsibelman/orleans,LoveElectronics/orleans,MikeHardman/orleans,kylemc/orleans,veikkoeeva/orleans,kylemc/orleans,Joshua-Ferguson/orleans,ticup/orleans,ashkan-saeedi-mazdeh/orleans,yevhen/orleans,bstauff/orleans,centur/orleans,jkonecki/orleans,yevhen/orleans,centur/orleans,amccool/orleans,ElanHasson/orleans,sergeybykov/orleans,jason-bragg/orleans,jokin/orleans,dotnet/orleans,ReubenBond/orleans,ibondy/orleans,SoftWar1923/orleans,jdom/orleans,Liversage/orleans,shlomiw/orleans,brhinescot/orleans,kowalot/orleans,ashkan-saeedi-mazdeh/orleans,ElanHasson/orleans,Carlm-MS/orleans,jthelin/orleans,LoveElectronics/orleans,jokin/orleans,pherbel/orleans,Joshua-Ferguson/orleans,dVakulen/orleans,Carlm-MS/orleans,Liversage/orleans,ashkan-saeedi-mazdeh/orleans,brhinescot/orleans,xclayl/orleans,pherbel/orleans,dVakulen/orleans,brhinescot/orleans,amccool/orleans,sebastianburckhardt/orleans,jdom/orleans,ticup/orleans,shayhatsor/orleans,galvesribeiro/orleans,shayhatsor/orleans,hoopsomuah/orleans,jkonecki/orleans,shlomiw/orleans,galvesribeiro/orleans,waynemunro/orleans,gabikliot/orleans,ibondy/orleans,waynemunro/orleans,dVakulen/orleans,gigya/orleans,sebastianburckhardt/orleans
Samples/GPSTracker/GPSTracker.Web/Controllers/HomeController.cs
Samples/GPSTracker/GPSTracker.Web/Controllers/HomeController.cs
using System; using System.Threading.Tasks; using System.Web.Mvc; using GPSTracker.Common; using GPSTracker.GrainInterface; using Orleans; namespace GPSTracker.Web.Controllers { public class HomeController : Controller { public ActionResult Index() { return View(); } public async Task<ActionResult> Test() { var rand = new Random(); IDeviceGrain grain = GrainClient.GrainFactory.GetGrain<IDeviceGrain>(1); await grain.ProcessMessage(new DeviceMessage(rand.Next(-90, 90), rand.Next(-180, 180), 1, 1, DateTime.UtcNow)); return Content("Sent"); } } }
using System; using System.Threading.Tasks; using System.Web.Mvc; using GPSTracker.Common; using GPSTracker.GrainInterface; namespace GPSTracker.Web.Controllers { public class HomeController : Controller { public ActionResult Index() { return View(); } public async Task<ActionResult> Test() { var rand = new Random(); var grain = DeviceGrainFactory.GetGrain(1); await grain.ProcessMessage(new DeviceMessage(rand.Next(-90, 90), rand.Next(-180, 180), 1, 1, DateTime.UtcNow)); return Content("Sent"); } } }
mit
C#
1d992608d6820fbe85dae7fd2e6fbba6dd8891a8
Update EntityUnitOfWorkFactoryBase.cs
tiksn/TIKSN-Framework
TIKSN.Framework.Core/Data/EntityFrameworkCore/EntityUnitOfWorkFactoryBase.cs
TIKSN.Framework.Core/Data/EntityFrameworkCore/EntityUnitOfWorkFactoryBase.cs
using System; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; namespace TIKSN.Data.EntityFrameworkCore { public abstract class EntityUnitOfWorkFactoryBase : IUnitOfWorkFactory { private readonly IServiceProvider serviceProvider; protected EntityUnitOfWorkFactoryBase(IServiceProvider serviceProvider) => this.serviceProvider = serviceProvider; public IUnitOfWork Create() { var dbContexts = this.GetContexts(); return new EntityUnitOfWork(dbContexts); } protected TContext GetContext<TContext>() where TContext : DbContext => this.serviceProvider.GetRequiredService<TContext>(); protected abstract DbContext[] GetContexts(); } }
using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using System; namespace TIKSN.Data.EntityFrameworkCore { public abstract class EntityUnitOfWorkFactoryBase : IUnitOfWorkFactory { private readonly IServiceProvider serviceProvider; protected EntityUnitOfWorkFactoryBase(IServiceProvider serviceProvider) { this.serviceProvider = serviceProvider; } public IUnitOfWork Create() { var dbContexts = GetContexts(); return new EntityUnitOfWork(dbContexts); } protected TContext GetContext<TContext>() where TContext : DbContext { return serviceProvider.GetRequiredService<TContext>(); } protected abstract DbContext[] GetContexts(); } }
mit
C#
5b21d3adc072f9901373d69cc1cdcb041387c9c9
Change naming in test too
ZLima12/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,ZLima12/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,peppy/osu-framework,peppy/osu-framework,ppy/osu-framework
osu.Framework.Tests/MathUtils/TestPathApproximator.cs
osu.Framework.Tests/MathUtils/TestPathApproximator.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 NUnit.Framework; using osu.Framework.Utils; using osuTK; namespace osu.Framework.Tests.MathUtils { [TestFixture] public class TestPathApproximator { [Test] public void TestLagrange() { // lagrange of (0,0) (0.5,0.35) (1,1) is equal to 0.6x*x + 0.4x Vector2[] points = { new Vector2(0, 0), new Vector2(0.5f, 0.35f), new Vector2(1, 1) }; List<Vector2> approximated = PathApproximator.ApproximateLagrangePolynomial(points); Assert.Greater(approximated.Count, 10, "Approximated polynomial should have at least 10 points to test"); for (int i = 0; i < approximated.Count; i++) { float x = approximated[i].X; Assert.GreaterOrEqual(x, 0); Assert.LessOrEqual(x, 1); Assert.AreEqual(0.6f * x * x + 0.4f * x, approximated[i].Y, 1e-4); } } [Test] public void TestBSpline() { Vector2[] points = { new Vector2(0, 0), new Vector2(1, 0), new Vector2(1, -1), new Vector2(-1, -1), new Vector2(-1, 1), new Vector2(3, 2), new Vector2(3, 0) }; List<Vector2> approximated = PathApproximator.ApproximateBSpline(points, 4); Assert.AreEqual(approximated.Count, 29, "Approximated path should have 29 points to test"); Assert.True(Precision.AlmostEquals(approximated[0], points[0], 1e-4f)); Assert.True(Precision.AlmostEquals(approximated[28], points[6], 1e-4f)); Assert.True(Precision.AlmostEquals(approximated[10], new Vector2(-0.11415f, -0.69065f), 1e-4f)); } } }
// 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 NUnit.Framework; using osu.Framework.Utils; using osuTK; namespace osu.Framework.Tests.MathUtils { [TestFixture] public class TestPathApproximator { [Test] public void TestLagrange() { // lagrange of (0,0) (0.5,0.35) (1,1) is equal to 0.6x*x + 0.4x Vector2[] points = { new Vector2(0, 0), new Vector2(0.5f, 0.35f), new Vector2(1, 1) }; List<Vector2> approximated = PathApproximator.ApproximateLagrangePolynomial(points); Assert.Greater(approximated.Count, 10, "Approximated polynomial should have at least 10 points to test"); for (int i = 0; i < approximated.Count; i++) { float x = approximated[i].X; Assert.GreaterOrEqual(x, 0); Assert.LessOrEqual(x, 1); Assert.AreEqual(0.6f * x * x + 0.4f * x, approximated[i].Y, 1e-4); } } [Test] public void TestBspline() { Vector2[] points = { new Vector2(0, 0), new Vector2(1, 0), new Vector2(1, -1), new Vector2(-1, -1), new Vector2(-1, 1), new Vector2(3, 2), new Vector2(3, 0) }; List<Vector2> approximated = PathApproximator.ApproximateBspline(points, 4); Assert.AreEqual(approximated.Count, 29, "Approximated path should have 29 points to test"); Assert.True(Precision.AlmostEquals(approximated[0], points[0], 1e-4f)); Assert.True(Precision.AlmostEquals(approximated[28], points[6], 1e-4f)); Assert.True(Precision.AlmostEquals(approximated[10], new Vector2(-0.11415f, -0.69065f), 1e-4f)); } } }
mit
C#
91e72772da7650e24a5065071d3a6320181c8941
Throw proper exception
MortenLiebmann/holoholona,MortenLiebmann/holoholona
Holoholona/Repositories/AnimalRepository/AnimalRepositoryMock.cs
Holoholona/Repositories/AnimalRepository/AnimalRepositoryMock.cs
using System.Collections.Generic; using Holoholona.Models; using Holoholona.Models.Enums; using System; namespace Holoholona.Repositories.AnimalRepository { public class AnimalRepositoryMock : IAnimalRepository { public Animal GetAnimal(int id) { foreach (Animal item in GetAnimals()) { if (item.Id == id) return item; } throw new IndexOutOfRangeException("Animal does not exist"); } public List<Animal> GetAnimals() { Animal a1 = new Dog() { Id = 1, Name = "Chihuahua", Type = AnimalTypeEnum.Mammal }; Animal a2 = new Dog() { Id = 2, Name = "Siamese", Type = AnimalTypeEnum.Mammal }; List<Animal> lst = new List<Animal>(); lst.AddRange(new List<Animal> { a1, a2 }); return lst; } } }
using System.Collections.Generic; using Holoholona.Models; using Holoholona.Models.Enums; namespace Holoholona.Repositories.AnimalRepository { public class AnimalRepositoryMock : IAnimalRepository { public Animal GetAnimal(int id) { foreach (Animal item in GetAnimals()) { if (item.Id == id) return item; } throw new KeyNotFoundException("Animal was not found"); } public List<Animal> GetAnimals() { Animal a1 = new Dog() { Id = 1, Name = "Chihuahua", Type = AnimalTypeEnum.Mammal }; Animal a2 = new Dog() { Id = 2, Name = "Siamese", Type = AnimalTypeEnum.Mammal }; List<Animal> lst = new List<Animal>(); lst.AddRange(new List<Animal> { a1, a2 }); return lst; } } }
mit
C#
d3b1be36a2317d5f043f540d130c0f6e45be17af
Remove unneeded object cloning
protyposis/Aurio,protyposis/Aurio
AudioAlign/AudioAlign.Audio/Matching/HaitsmaKalker2002/DictionaryCollisionMap.cs
AudioAlign/AudioAlign.Audio/Matching/HaitsmaKalker2002/DictionaryCollisionMap.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace AudioAlign.Audio.Matching.HaitsmaKalker2002 { class DictionaryCollisionMap : IFingerprintCollisionMap { private Dictionary<SubFingerprint, List<SubFingerprintLookupEntry>> lookupTable; public DictionaryCollisionMap() { lookupTable = new Dictionary<SubFingerprint, List<SubFingerprintLookupEntry>>(); } public void Add(SubFingerprint subFingerprint, SubFingerprintLookupEntry lookupEntry) { if (!lookupTable.ContainsKey(subFingerprint)) { lookupTable.Add(subFingerprint, new List<SubFingerprintLookupEntry>()); } lookupTable[subFingerprint].Add(lookupEntry); } public List<SubFingerprint> GetCollidingKeys() { List<SubFingerprint> subFingerprints = new List<SubFingerprint>(); foreach (SubFingerprint subFingerprint in lookupTable.Keys) { if (lookupTable[subFingerprint].Count > 1) { subFingerprints.Add(subFingerprint); } } return subFingerprints; } public List<SubFingerprintLookupEntry> GetValues(SubFingerprint subFingerprint) { return lookupTable[subFingerprint]; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace AudioAlign.Audio.Matching.HaitsmaKalker2002 { class DictionaryCollisionMap : IFingerprintCollisionMap { private Dictionary<SubFingerprint, List<SubFingerprintLookupEntry>> lookupTable; public DictionaryCollisionMap() { lookupTable = new Dictionary<SubFingerprint, List<SubFingerprintLookupEntry>>(); } public void Add(SubFingerprint subFingerprint, SubFingerprintLookupEntry lookupEntry) { if (!lookupTable.ContainsKey(subFingerprint)) { lookupTable.Add(subFingerprint, new List<SubFingerprintLookupEntry>()); } lookupTable[subFingerprint].Add(new SubFingerprintLookupEntry(lookupEntry.AudioTrack, lookupEntry.Index)); } public List<SubFingerprint> GetCollidingKeys() { List<SubFingerprint> subFingerprints = new List<SubFingerprint>(); foreach (SubFingerprint subFingerprint in lookupTable.Keys) { if (lookupTable[subFingerprint].Count > 1) { subFingerprints.Add(subFingerprint); } } return subFingerprints; } public List<SubFingerprintLookupEntry> GetValues(SubFingerprint subFingerprint) { return lookupTable[subFingerprint]; } } }
agpl-3.0
C#
fa875ad23101bad0dd848a5a31d2acd908ce31e0
Fix regex to work with older items
hubbardgary/TaskScheduler,hubbardgary/TaskScheduler,hubbardgary/TaskScheduler
TaskScheduler.Core/TaskTypes/Recording/Extensions/RecordingBaseTaskExtensions.cs
TaskScheduler.Core/TaskTypes/Recording/Extensions/RecordingBaseTaskExtensions.cs
using System; using System.Text.RegularExpressions; using TaskScheduler.Core.Models.Recording; using TaskScheduler.Core.TaskTypes.Base; namespace TaskScheduler.Core.TaskTypes.Recording.Extensions { public static class RecordingBaseTaskExtensions { public static int GetDuration(this BaseTask task) { const string RegexDuration = @"duration=(?<duration>\d+)"; int duration; int.TryParse(Regex.Match(task.Model.ExecAction, RegexDuration).Groups["duration"].Value, out duration); return duration; } public static ChannelModel GetChannel(this BaseTask task) { const string RegexChannelFromTaskDescription = @"Record(ing)? .* on (?<channel>[a-zA-Z0-9+ *]+) (from|at)"; // TODO: What should really happen here? if (string.IsNullOrEmpty(task.Model.Description)) return new ChannelModel(0); return new ChannelModel(Regex.Match(task.Model.Description, RegexChannelFromTaskDescription).Groups["channel"].Value); } public static DateTime GetRecordingStart(this BaseTask task) { const string RegexStartTimeFromTaskDescription = @"at (?<time>[0-9][0-9]:[0-9][0-9]) on (?<date>[0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9])"; var matches = Regex.Match(task.Model.TriggerTime, RegexStartTimeFromTaskDescription, RegexOptions.IgnoreCase); string dateMatch = matches.Groups["date"].Value; string timeMatch = matches.Groups["time"].Value; DateTime startDate; DateTime.TryParse($"{dateMatch} {timeMatch}", out startDate); if (startDate > DateTime.MinValue) { return startDate; } return task.Model.StartDate; } } }
using System; using System.Text.RegularExpressions; using TaskScheduler.Core.Models.Recording; using TaskScheduler.Core.TaskTypes.Base; namespace TaskScheduler.Core.TaskTypes.Recording.Extensions { public static class RecordingBaseTaskExtensions { public static int GetDuration(this BaseTask task) { const string RegexDuration = @"duration=(?<duration>\d+)"; int duration; int.TryParse(Regex.Match(task.Model.ExecAction, RegexDuration).Groups["duration"].Value, out duration); return duration; } public static ChannelModel GetChannel(this BaseTask task) { const string RegexChannelFromTaskDescription = @"Recording .* on (?<channel>[a-zA-Z0-9+ *]+) (from|at)"; // TODO: What should really happen here? if (string.IsNullOrEmpty(task.Model.Description)) return new ChannelModel(0); return new ChannelModel(Regex.Match(task.Model.Description, RegexChannelFromTaskDescription).Groups["channel"].Value); } public static DateTime GetRecordingStart(this BaseTask task) { const string RegexStartTimeFromTaskDescription = @"at (?<time>[0-9][0-9]:[0-9][0-9]) on (?<date>[0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9])"; var matches = Regex.Match(task.Model.TriggerTime, RegexStartTimeFromTaskDescription, RegexOptions.IgnoreCase); string dateMatch = matches.Groups["date"].Value; string timeMatch = matches.Groups["time"].Value; DateTime startDate; DateTime.TryParse($"{dateMatch} {timeMatch}", out startDate); if (startDate > DateTime.MinValue) { return startDate; } return task.Model.StartDate; } } }
mit
C#
0de28354cfa0e5f12b425fd7fa3578c3c445824e
Fix First() for MD
xamarin/Xamarin.Mobile,xamarin/Xamarin.Mobile,orand/Xamarin.Mobile,haithemaraissia/Xamarin.Mobile,nexussays/Xamarin.Mobile,moljac/Xamarin.Mobile
MonoDroid/MonoMobile.Extensions/Contacts/ContactQueryProvider.cs
MonoDroid/MonoMobile.Extensions/Contacts/ContactQueryProvider.cs
using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using Android.Content; using Android.Content.Res; using Android.Database; using Android.Provider; using Uri = Android.Net.Uri; namespace Xamarin.Contacts { internal class ContactQueryProvider : IQueryProvider { internal ContactQueryProvider (bool rawContacts, ContentResolver content, Resources resources) { this.rawContacts = rawContacts; this.content = content; this.resources = resources; } private readonly bool rawContacts; protected readonly ContentResolver content; protected readonly Resources resources; IQueryable IQueryProvider.CreateQuery (Expression expression) { throw new NotImplementedException(); } object IQueryProvider.Execute (Expression expression) { IQueryable<Contact> q = GetContacts().AsQueryable(); expression = ReplaceQueryable (expression, q); if (expression.Type.IsGenericType && expression.Type.GetGenericTypeDefinition() == typeof(IOrderedQueryable<>)) return q.Provider.CreateQuery (expression); else return q.Provider.Execute (expression); } IQueryable<TElement> IQueryProvider.CreateQuery<TElement> (Expression expression) { return new Query<TElement> (this, expression); } TResult IQueryProvider.Execute<TResult> (Expression expression) { return (TResult)((IQueryProvider)this).Execute (expression); } private IEnumerable<Contact> GetContacts () { return ContactHelper.GetContacts (this.rawContacts, this.content, this.resources); } private Expression ReplaceQueryable (Expression expression, object value) { MethodCallExpression mc = expression as MethodCallExpression; if (mc != null) { Expression[] args = mc.Arguments.ToArray(); Expression narg = ReplaceQueryable (mc.Arguments[0], value); if (narg != args[0]) { args[0] = narg; return Expression.Call (mc.Method, args); } else return mc; } ConstantExpression c = expression as ConstantExpression; if (c != null && c.Type.GetInterfaces().Contains (typeof(IQueryable<Contact>))) return Expression.Constant (value); return expression; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using Android.Content; using Android.Content.Res; using Android.Database; using Android.Provider; using Uri = Android.Net.Uri; namespace Xamarin.Contacts { internal class ContactQueryProvider : IQueryProvider { internal ContactQueryProvider (bool rawContacts, ContentResolver content, Resources resources) { this.rawContacts = rawContacts; this.content = content; this.resources = resources; } private readonly bool rawContacts; protected readonly ContentResolver content; protected readonly Resources resources; IQueryable IQueryProvider.CreateQuery (Expression expression) { throw new NotImplementedException(); } object IQueryProvider.Execute (Expression expression) { IQueryable<Contact> q = GetContacts().AsQueryable(); expression = ReplaceQueryable (expression, q); return q.Provider.CreateQuery (expression); } IQueryable<TElement> IQueryProvider.CreateQuery<TElement> (Expression expression) { return new Query<TElement> (this, expression); } TResult IQueryProvider.Execute<TResult> (Expression expression) { return (TResult)((IQueryProvider)this).Execute (expression); } private IEnumerable<Contact> GetContacts () { return ContactHelper.GetContacts (this.rawContacts, this.content, this.resources); } private Expression ReplaceQueryable (Expression expression, object value) { MethodCallExpression mc = expression as MethodCallExpression; if (mc != null) { Expression[] args = mc.Arguments.ToArray(); Expression narg = ReplaceQueryable (mc.Arguments[0], value); if (narg != args[0]) { args[0] = narg; return Expression.Call (mc.Method, args); } else return mc; } ConstantExpression c = expression as ConstantExpression; if (c != null && c.Type.GetInterfaces().Contains (typeof(IQueryable<Contact>))) return Expression.Constant (value); return expression; } } }
apache-2.0
C#
254e2799626de1bba87e412e56015ac288a48246
Add more Popup methods
laicasaane/VFW
Assets/Plugins/Editor/Vexe/GUIs/BaseGUI/Controls/Popups.cs
Assets/Plugins/Editor/Vexe/GUIs/BaseGUI/Controls/Popups.cs
using UnityEngine; namespace Vexe.Editor.GUIs { public abstract partial class BaseGUI { public int Popup(int selectedIndex, string[] displayedOptions) { return Popup(selectedIndex, displayedOptions, null); } public int Popup(int selectedIndex, GUIContent[] displayedOptions) { return Popup(selectedIndex, displayedOptions, null); } public int Popup(int selectedIndex, string[] displayedOptions, Layout option) { return Popup(string.Empty, selectedIndex, displayedOptions, option); } public int Popup(int selectedIndex, GUIContent[] displayedOptions, Layout option) { return Popup(string.Empty, selectedIndex, displayedOptions, option); } public int Popup(string text, int selectedIndex, string[] displayedOptions) { return Popup(text, selectedIndex, displayedOptions, null); } public int Popup(string text, int selectedIndex, GUIContent[] displayedOptions) { return Popup(text, selectedIndex, displayedOptions, null); } public int Popup(string text, int selectedIndex, string[] displayedOptions, Layout option) { return Popup(text, selectedIndex, displayedOptions, GUIStyles.Popup, option); } public int Popup(string text, int selectedIndex, GUIContent[] displayedOptions, Layout option) { return Popup(text, selectedIndex, displayedOptions, GUIStyles.Popup, option); } public abstract int Popup(string text, int selectedIndex, string[] displayedOptions, GUIStyle style, Layout option); public abstract int Popup(string text, int selectedIndex, GUIContent[] displayedOptions, GUIStyle style, Layout option); public string Tag(string tag) { return Tag(string.Empty, tag); } public string Tag(string content, string tag) { return Tag(content, tag, null); } public string Tag(string content, string tag, Layout layout) { return Tag(GetContent(content), tag, GUIStyles.Popup, layout); } public abstract string Tag(GUIContent content, string tag, GUIStyle style, Layout layout); public string TextFieldDropDown(string text, string[] displayedOptions) { return TextFieldDropDown(text, displayedOptions, null); } public string TextFieldDropDown(string text, string[] displayedOptions, Layout option) { return TextFieldDropDown(string.Empty, text, displayedOptions, option); } public string TextFieldDropDown(string label, string text, string[] displayedOptions) { return TextFieldDropDown(label, text, displayedOptions, null); } public string TextFieldDropDown(string label, string text, string[] displayedOptions, Layout option) { return TextFieldDropDown(GetContent(label), text, displayedOptions, option); } public abstract string TextFieldDropDown(GUIContent label, string text, string[] displayedOptions, Layout option); } }
using UnityEngine; namespace Vexe.Editor.GUIs { public abstract partial class BaseGUI { public int Popup(int selectedIndex, string[] displayedOptions) { return Popup(selectedIndex, displayedOptions, null); } public int Popup(int selectedIndex, string[] displayedOptions, Layout option) { return Popup(string.Empty, selectedIndex, displayedOptions, option); } public int Popup(string text, int selectedIndex, string[] displayedOptions) { return Popup(text, selectedIndex, displayedOptions, null); } public int Popup(string text, int selectedIndex, string[] displayedOptions, Layout option) { return Popup(text, selectedIndex, displayedOptions, GUIStyles.Popup, option); } public abstract int Popup(string text, int selectedIndex, string[] displayedOptions, GUIStyle style, Layout option); public string Tag(string tag) { return Tag(string.Empty, tag); } public string Tag(string content, string tag) { return Tag(content, tag, null); } public string Tag(string content, string tag, Layout layout) { return Tag(GetContent(content), tag, GUIStyles.Popup, layout); } public abstract string Tag(GUIContent content, string tag, GUIStyle style, Layout layout); public string TextFieldDropDown(string text, string[] displayedOptions) { return TextFieldDropDown(text, displayedOptions, null); } public string TextFieldDropDown(string text, string[] displayedOptions, Layout option) { return TextFieldDropDown(string.Empty, text, displayedOptions, option); } public string TextFieldDropDown(string label, string text, string[] displayedOptions) { return TextFieldDropDown(label, text, displayedOptions, null); } public string TextFieldDropDown(string label, string text, string[] displayedOptions, Layout option) { return TextFieldDropDown(GetContent(label), text, displayedOptions, option); } public abstract string TextFieldDropDown(GUIContent label, string text, string[] displayedOptions, Layout option); } }
mit
C#
032ae9ebeda7ae9f813655901d284e283a391d6f
test inplace
scottcarr/reviewbot
TestRunner/Program.cs
TestRunner/Program.cs
/* ReviewBot 0.1 Copyright (c) Microsoft Corporation All rights reserved. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; using Microsoft.Research.ReviewBot.Utils; namespace TestRunner { class Program { static void Main(string[] args) { // This assumes you didn't move the exe from the directory where VS puts it var cwd = Directory.GetCurrentDirectory(); var slnDir = Directory.GetParent(Directory.GetParent(Directory.GetParent(cwd).FullName).FullName); var sln = Path.Combine(slnDir.FullName, "ReviewBot.sln"); var testDir = Path.Combine(slnDir.FullName, "Tests"); var tmpDir = Path.Combine(slnDir.FullName, "tmp"); Console.WriteLine(testDir); var projs = Directory.GetFiles(testDir, @"*.csproj", SearchOption.AllDirectories); foreach (var p in projs) { var projDir = Directory.GetParent(p); var pName = Path.GetFileNameWithoutExtension(p); var ccCheckXml = Path.Combine(tmpDir, pName + "_ccCheck.xml"); Console.WriteLine(p); var reviewArgs = new string[] { ccCheckXml, "-project", p, "-solution", sln, "-inplace" }; } Console.ReadKey(); } } }
/* ReviewBot 0.1 Copyright (c) Microsoft Corporation All rights reserved. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; using Microsoft.Research.ReviewBot.Utils; namespace TestRunner { class Program { static void Main(string[] args) { // This assumes you didn't move the exe from the directory where VS puts it var cwd = Directory.GetCurrentDirectory(); var slnDir = Directory.GetParent(Directory.GetParent(Directory.GetParent(cwd).FullName).FullName); var sln = Path.Combine(slnDir.FullName, "ReviewBot.sln"); var testDir = Path.Combine(slnDir.FullName, "Tests"); var tmpDir = Path.Combine(slnDir.FullName, "tmp"); Console.WriteLine(testDir); var projs = Directory.GetFiles(testDir, @"*.csproj", SearchOption.AllDirectories); foreach (var p in projs) { var projDir = Directory.GetParent(p); var pName = Path.GetFileNameWithoutExtension(p); var ccCheckXml = Path.Combine(tmpDir, pName + "_ccCheck.xml"); Console.WriteLine(p); var reviewArgs = new string[] { ccCheckXml, "-project", p, "-solution", sln, "-github", /*gitroot*/, /*branch?*/ }; } Console.ReadKey(); } } }
mit
C#
e2dc2fac32bf104a2686515f565fa1c2ac8a36fe
Save AuthenticationConfiguration.cs as UTF-8
cnblogs/EnyimMemcachedCore,cnblogs/EnyimMemcachedCore
Enyim.Caching/Configuration/AuthenticationConfiguration.cs
Enyim.Caching/Configuration/AuthenticationConfiguration.cs
using Enyim.Caching.Memcached; using System; using System.Collections.Generic; namespace Enyim.Caching.Configuration { public class AuthenticationConfiguration : IAuthenticationConfiguration { private Type authenticator; private Dictionary<string, object> parameters; Type IAuthenticationConfiguration.Type { get { return this.authenticator; } set { ConfigurationHelper.CheckForInterface(value, typeof(ISaslAuthenticationProvider)); this.authenticator = value; } } Dictionary<string, object> IAuthenticationConfiguration.Parameters { get { return this.parameters ?? (this.parameters = new Dictionary<string, object>()); } } } } #region [ License information ] /* ************************************************************ * * Copyright (c) 2010 Attila Kisk? enyim.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * ************************************************************/ #endregion
using System; using System.Collections.Generic; using Enyim.Caching.Memcached; namespace Enyim.Caching.Configuration { public class AuthenticationConfiguration : IAuthenticationConfiguration { private Type authenticator; private Dictionary<string, object> parameters; Type IAuthenticationConfiguration.Type { get { return this.authenticator; } set { ConfigurationHelper.CheckForInterface(value, typeof(ISaslAuthenticationProvider)); this.authenticator = value; } } Dictionary<string, object> IAuthenticationConfiguration.Parameters { get { return this.parameters ?? (this.parameters = new Dictionary<string, object>()); } } } } #region [ License information ] /* ************************************************************ * * Copyright (c) 2010 Attila Kisk, enyim.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * ************************************************************/ #endregion
apache-2.0
C#
66e08bd7cfd48d11fee5d7fe0056f301cf32331e
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major.
autofac/Autofac.Extras.DomainServices
Properties/AssemblyInfo.cs
Properties/AssemblyInfo.cs
using System.Reflection; [assembly: AssemblyTitle("Autofac.Extras.Tests.DomainServices")]
using System.Reflection; [assembly: AssemblyTitle("Autofac.Extras.Tests.DomainServices")] [assembly: AssemblyDescription("")]
mit
C#
af2e09ab73f04421fdc187a869b97b46ed1dc7c5
Clean up namespace imports.
mcneel/RhinoCycles
RenderEngine.UploadData.cs
RenderEngine.UploadData.cs
/** Copyright 2014-2015 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. **/ namespace RhinoCycles { partial class RenderEngine { /// <summary> /// Main entry point for uploading data to Cycles. /// </summary> private void UploadData() { // linear workflow changes Database.UploadLinearWorkflowChanges(); // gamma changes Database.UploadGammaChanges(); // environment changes Database.UploadEnvironmentChanges(); // transforms on objects, no geometry changes Database.UploadDynamicObjectTransforms(); // viewport changes Database.UploadCameraChanges(); // new shaders we've got Database.UploadShaderChanges(); // light changes Database.UploadLightChanges(); // mesh changes (new ones, updated ones) Database.UploadMeshChanges(); // shader changes on objects (replacement) Database.UploadObjectShaderChanges(); // object changes (new ones, deleted ones) Database.UploadObjectChanges(); // done, now clear out our change queue stuff so we're ready for the next time around :) ClearChanges(); } private void ClearChanges() { Database.ClearChanges(); } } }
/** Copyright 2014-2015 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 System; using System.Linq; using ccl; using Object = ccl.Object; namespace RhinoCycles { partial class RenderEngine { /// <summary> /// Main entry point for uploading data to Cycles. /// </summary> private void UploadData() { // linear workflow changes Database.UploadLinearWorkflowChanges(); // gamma changes Database.UploadGammaChanges(); // environment changes Database.UploadEnvironmentChanges(); // transforms on objects, no geometry changes Database.UploadDynamicObjectTransforms(); // viewport changes Database.UploadCameraChanges(); // new shaders we've got Database.UploadShaderChanges(); // light changes Database.UploadLightChanges(); // mesh changes (new ones, updated ones) Database.UploadMeshChanges(); // shader changes on objects (replacement) Database.UploadObjectShaderChanges(); // object changes (new ones, deleted ones) Database.UploadObjectChanges(); // done, now clear out our change queue stuff so we're ready for the next time around :) ClearChanges(); } private void ClearChanges() { Database.ClearChanges(); } } }
apache-2.0
C#
30918ab0874ca949ad61dcd4e5683c4bbe7ef064
Bump Version
WillsB3/WOAI-P3D-Installer
WOAI-P3D-Installer/WOAI-P3D-Installer/Properties/AssemblyInfo.cs
WOAI-P3D-Installer/WOAI-P3D-Installer/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("WOAI P3D Installer")] [assembly: AssemblyDescription("Install utility for installing World of AI into P3D v3.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("WOAI P3D Installer")] [assembly: AssemblyCopyright("Copyright © 2016 Wills Bithrey")] [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("91cc4fd8-b3ad-4741-b012-2200c21d2850")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.5.3.1")] [assembly: AssemblyFileVersion("0.5.3.1")] [assembly: AssemblyMetadata("SquirrelAwareVersion", "1")]
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("WOAI P3D Installer")] [assembly: AssemblyDescription("Install utility for installing World of AI into P3D v3.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("WOAI P3D Installer")] [assembly: AssemblyCopyright("Copyright © 2016 Wills Bithrey")] [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("91cc4fd8-b3ad-4741-b012-2200c21d2850")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.5.3")] [assembly: AssemblyFileVersion("0.5.3")] [assembly: AssemblyMetadata("SquirrelAwareVersion", "1")]
mit
C#
6674567af1d678f33eb7c54920e3f11cba7301a5
Use -1 as the default preview time globally in metadata
ppy/osu,NeoAdonis/osu,NeoAdonis/osu,peppy/osu,peppy/osu,NeoAdonis/osu,ppy/osu,ppy/osu,peppy/osu
osu.Game/Beatmaps/BeatmapMetadata.cs
osu.Game/Beatmaps/BeatmapMetadata.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 JetBrains.Annotations; using Newtonsoft.Json; using osu.Framework.Testing; using osu.Game.Models; using osu.Game.Users; using Realms; #nullable enable namespace osu.Game.Beatmaps { [ExcludeFromDynamicCompile] [Serializable] [MapTo("BeatmapMetadata")] public class BeatmapMetadata : RealmObject, IBeatmapMetadataInfo { public string Title { get; set; } = string.Empty; [JsonProperty("title_unicode")] public string TitleUnicode { get; set; } = string.Empty; public string Artist { get; set; } = string.Empty; [JsonProperty("artist_unicode")] public string ArtistUnicode { get; set; } = string.Empty; public RealmUser Author { get; set; } = null!; public string Source { get; set; } = string.Empty; [JsonProperty(@"tags")] public string Tags { get; set; } = string.Empty; /// <summary> /// The time in milliseconds to begin playing the track for preview purposes. /// If -1, the track should begin playing at 40% of its length. /// </summary> public int PreviewTime { get; set; } = -1; public string AudioFile { get; set; } = string.Empty; public string BackgroundFile { get; set; } = string.Empty; public BeatmapMetadata(RealmUser? user = null) { Author = new RealmUser(); } [UsedImplicitly] // Realm private BeatmapMetadata() { } IUser IBeatmapMetadataInfo.Author => Author; public override string ToString() => this.GetDisplayTitle(); } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using JetBrains.Annotations; using Newtonsoft.Json; using osu.Framework.Testing; using osu.Game.Models; using osu.Game.Users; using Realms; #nullable enable namespace osu.Game.Beatmaps { [ExcludeFromDynamicCompile] [Serializable] [MapTo("BeatmapMetadata")] public class BeatmapMetadata : RealmObject, IBeatmapMetadataInfo { public string Title { get; set; } = string.Empty; [JsonProperty("title_unicode")] public string TitleUnicode { get; set; } = string.Empty; public string Artist { get; set; } = string.Empty; [JsonProperty("artist_unicode")] public string ArtistUnicode { get; set; } = string.Empty; public RealmUser Author { get; set; } = null!; public string Source { get; set; } = string.Empty; [JsonProperty(@"tags")] public string Tags { get; set; } = string.Empty; /// <summary> /// The time in milliseconds to begin playing the track for preview purposes. /// If -1, the track should begin playing at 40% of its length. /// </summary> public int PreviewTime { get; set; } public string AudioFile { get; set; } = string.Empty; public string BackgroundFile { get; set; } = string.Empty; public BeatmapMetadata(RealmUser? user = null) { Author = new RealmUser(); } [UsedImplicitly] // Realm private BeatmapMetadata() { } IUser IBeatmapMetadataInfo.Author => Author; public override string ToString() => this.GetDisplayTitle(); } }
mit
C#
5cf370cde220c29d5b73ada8154eecb4f94bc261
Fix behaviour from calling create multiple times
pekin0609/-,wbap/hackathon-2017-sample,wbap/hackathon-2017-sample,pekin0609/-,wbap/hackathon-2017-sample,wbap/hackathon-2017-sample,pekin0609/-,pekin0609/-
unity-sample-environment/Assets/Scripts/AgentBehaviour.cs
unity-sample-environment/Assets/Scripts/AgentBehaviour.cs
using UnityEngine; using MsgPack; [RequireComponent(typeof (AgentController))] [RequireComponent(typeof (AgentSensor))] public class AgentBehaviour : MonoBehaviour { private LISClient client = new LISClient("myagent"); private AgentController controller; private AgentSensor sensor; private MsgPack.CompiledPacker packer = new MsgPack.CompiledPacker(); bool created = false; public float Reward = 0.0F; void OnCollisionEnter(Collision col) { if(col.gameObject.tag == "Reward") { NotificationCenter.DefaultCenter.PostNotification(this, "OnRewardCollision"); } } byte[] GenerateMessage() { Message msg = new Message(); msg.reward = PlayerPrefs.GetFloat("Reward"); msg.image = sensor.GetRgbImages(); msg.depth = sensor.GetDepthImages(); return packer.Pack(msg); } void Start () { controller = GetComponent<AgentController>(); sensor = GetComponent<AgentSensor>(); } void Update () { if(!created) { if(!client.Calling) { client.Create(GenerateMessage()); created = true; } } else { if(!client.Calling) { client.Step(GenerateMessage()); } if(client.HasAction) { string action = client.GetAction(); controller.PerformAction(action); } } } }
using UnityEngine; using MsgPack; [RequireComponent(typeof (AgentController))] [RequireComponent(typeof (AgentSensor))] public class AgentBehaviour : MonoBehaviour { private LISClient client = new LISClient("myagent"); private AgentController controller; private AgentSensor sensor; private MsgPack.CompiledPacker packer = new MsgPack.CompiledPacker(); bool created = false; public float Reward = 0.0F; void OnCollisionEnter(Collision col) { if(col.gameObject.tag == "Reward") { NotificationCenter.DefaultCenter.PostNotification(this, "OnRewardCollision"); } } byte[] GenerateMessage() { Message msg = new Message(); msg.reward = PlayerPrefs.GetFloat("Reward"); msg.image = sensor.GetRgbImages(); msg.depth = sensor.GetDepthImages(); return packer.Pack(msg); } void Start () { controller = GetComponent<AgentController>(); sensor = GetComponent<AgentSensor>(); } void Update () { if(!created) { client.Create(GenerateMessage()); created = true; } else { if(!client.Calling) { client.Step(GenerateMessage()); } if(client.HasAction) { string action = client.GetAction(); controller.PerformAction(action); } } } }
apache-2.0
C#
55407b26d4f2fe18721f28dad5e8088570e1ed3f
Support for dynamic types in SetAttributeAction (#89)
commercetools/commercetools-dotnet-sdk
commercetools.NET/Products/UpdateActions/SetAttributeAction.cs
commercetools.NET/Products/UpdateActions/SetAttributeAction.cs
using System; using commercetools.Common; using commercetools.Types; using Newtonsoft.Json; namespace commercetools.Products.UpdateActions { /// <summary> /// Adds/Removes/Changes a custom attribute. /// </summary> /// <see href="http://dev.commercetools.com/http-api-projects-products.html#set-attribute"/> public class SetAttributeAction : UpdateAction { #region Properties /// <summary> /// Variant ID /// </summary> [JsonProperty(PropertyName = "variantId")] public int? VariantId { get; set; } /// <summary> /// Sku /// </summary> [JsonProperty(PropertyName = "sku")] public string Sku { get; set; } /// <summary> /// Name /// </summary> [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// <summary> /// Value /// </summary> [JsonProperty(PropertyName = "value")] public object Value { get; set; } /// <summary> /// Staged /// </summary> /// <remarks> /// Defaults to true /// </remarks> [JsonProperty(PropertyName = "staged")] public bool Staged { get; set; } = true; #endregion #region Constructors /// <summary> /// Constructor. /// </summary> /// <param name="name">Name</param> /// <param name="variantId">Variant ID</param> /// <param name="sku">Sku</param> public SetAttributeAction(string name, int? variantId = null, string sku = null) { if (!variantId.HasValue && string.IsNullOrWhiteSpace(sku)) { throw new ArgumentException("Either variantId or sku are required"); } this.Action = "setAttribute"; this.Name = name; this.VariantId = variantId; this.Sku = sku; } #endregion } }
using System; using commercetools.Common; using commercetools.Types; using Newtonsoft.Json; namespace commercetools.Products.UpdateActions { /// <summary> /// Adds/Removes/Changes a custom attribute. /// </summary> /// <see href="http://dev.commercetools.com/http-api-projects-products.html#set-attribute"/> public class SetAttributeAction : UpdateAction { #region Properties /// <summary> /// Variant ID /// </summary> [JsonProperty(PropertyName = "variantId")] public int? VariantId { get; set; } /// <summary> /// Sku /// </summary> [JsonProperty(PropertyName = "sku")] public string Sku { get; set; } /// <summary> /// Name /// </summary> [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// <summary> /// Value /// </summary> [JsonProperty(PropertyName = "value")] public FieldType Value { get; set; } /// <summary> /// Staged /// </summary> /// <remarks> /// Defaults to true /// </remarks> [JsonProperty(PropertyName = "staged")] public bool Staged { get; set; } = true; #endregion #region Constructors /// <summary> /// Constructor. /// </summary> /// <param name="name">Name</param> /// <param name="variantId">Variant ID</param> /// <param name="sku">Sku</param> public SetAttributeAction(string name, int? variantId = null, string sku = null) { if (!variantId.HasValue && string.IsNullOrWhiteSpace(sku)) { throw new ArgumentException("Either variantId or sku are required"); } this.Action = "setAttribute"; this.Name = name; this.VariantId = variantId; this.Sku = sku; } #endregion } }
mit
C#
e0d6a1a9a7ffec1bf4dc995fec0e4ca741f12086
Add quotes
planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell
src/Firehose.Web/Authors/DanTsekhanskiy.cs
src/Firehose.Web/Authors/DanTsekhanskiy.cs
using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel.Syndication; using System.Web; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class DanTsekhanskiy : IAmACommunityMember { public string FirstName => "Dan"; public string LastName => "Tsekhanskiy"; public string ShortBioOrTagLine => "SRE from a Windows Guy"; public string StateOrRegion => "New York, NY"; public string EmailAddress => "dan@tsknet.com"; public string TwitterHandle => "tseknet"; public string GravatarHash => "fc477805e58b913f5082111d3dcdbe90"; public string GitHubHandle => "tseknet"; public GeoPosition Position => new GeoPosition(40.740764, -74.002003); public Uri WebSite => new Uri("https://tseknet.com"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://tseknet.com/feed.xml"); } } public bool Filter(SyndicationItem item) { return item.Categories.Any(c => c.Name.ToLowerInvariant().Equals("powershell")); } public string FeedLanguageCode => "en"; } }
using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel.Syndication; using System.Web; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class DanTsekhanskiy : IAmACommunityMember { public string FirstName => "Dan"; public string LastName => "Tsekhanskiy"; public string ShortBioOrTagLine => "SRE from a Windows Guy"; public string StateOrRegion => "New York, NY"; public string EmailAddress => dan@tsknet.com; public string TwitterHandle => "tseknet"; public string GravatarHash => "fc477805e58b913f5082111d3dcdbe90"; public string GitHubHandle => "tseknet"; public GeoPosition Position => new GeoPosition(40.740764, -74.002003); public Uri WebSite => new Uri("https://tseknet.com"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://tseknet.com/feed.xml"); } } public bool Filter(SyndicationItem item) { return item.Categories.Any(c => c.Name.ToLowerInvariant().Equals("powershell")); } public string FeedLanguageCode => "en"; } }
mit
C#
b3f2066f50f968c449011b4dc88369afd4cdff1f
Update AssemblyInfo.cs
EmphaticFist/Fluky,michaeljbaird/Fluky,michaeljbaird/Fluky,EmphaticFistGames/Fluky
src/Fluky.Tests/Properties/AssemblyInfo.cs
src/Fluky.Tests/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Fluky.Tests")] [assembly: AssemblyTrademark("")] [assembly: AssemblyVersion("2.0.0")] [assembly: AssemblyFileVersion("2.0.0")] [assembly: AssemblyInformationalVersion("2.0.0")] // 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("b6621d43-e103-4475-98cc-15a72933b9d9")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Fluky.Tests")] [assembly: AssemblyTrademark("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("b6621d43-e103-4475-98cc-15a72933b9d9")]
mit
C#
b5d7d09dca0461aa02d246c1daea4f40f0990b08
change send message service receive sms to use inboundMessage
Paymentsense/Dapper.SimpleSave
PS.Mothership.Core/PS.Mothership.Core.Common/Contracts/ISendMessageService.cs
PS.Mothership.Core/PS.Mothership.Core.Common/Contracts/ISendMessageService.cs
using System; using System.Collections; using System.Collections.Generic; using System.ServiceModel; using PS.Mothership.Core.Common.Dto.Event.Notification; using PS.Mothership.Core.Common.Dto.Message; using PS.Mothership.Core.Common.Dto.SendMessage; namespace PS.Mothership.Core.Common.Contracts { [ServiceContract(CallbackContract = typeof(ISendMessageServiceCallback))] public interface ISendMessageService { [OperationContract] void QueueSMSMessage(SendSmsRequestDto insertSmsMessageDto); [OperationContract] void QueueEmailMessage(SendEmailRequestDto insertEmailMessageDto); [OperationContract] void SMSMessageDeliveryFailed(string xmlString); [OperationContract] void SMSMessageDeliverySuccess(string xmlString); [OperationContract] void SmsMessageReceived(InboundMessage inboundMessage); [OperationContract] string SendSMSMessageFrom(Guid userGuid); [OperationContract(IsOneWay = false)] void MessageServiceStatusSubscribe(string applicationName); [OperationContract(IsOneWay = true)] void MessageServiceStatusEndSubscribe(string applicationName); [OperationContract(IsOneWay = false)] void EmailNotificationSubscribe(string applicationName); [OperationContract(IsOneWay = true)] void EmailNotificationEndSubscribe(string applicationName); [OperationContract(IsOneWay = false)] void SmsNotificationSubscribe(string applicationName); [OperationContract(IsOneWay = true)] void SmsNotificationEndSubscribe(string applicationName); [OperationContract] void StartMessageListener(); [OperationContract] IList<SendMessageServiceStatusDto> GetMessageServiceStatus(); [OperationContract] IList<NotificationReceivedDto> GetEventNotications(Guid userGuid); } }
using System; using System.Collections; using System.Collections.Generic; using System.ServiceModel; using PS.Mothership.Core.Common.Dto.Event.Notification; using PS.Mothership.Core.Common.Dto.SendMessage; namespace PS.Mothership.Core.Common.Contracts { [ServiceContract(CallbackContract = typeof(ISendMessageServiceCallback))] public interface ISendMessageService { [OperationContract] void QueueSMSMessage(SendSmsRequestDto insertSmsMessageDto); [OperationContract] void QueueEmailMessage(SendEmailRequestDto insertEmailMessageDto); [OperationContract] void SMSMessageDeliveryFailed(string xmlString); [OperationContract] void SMSMessageDeliverySuccess(string xmlString); [OperationContract] void SMSMessageReceived(string xmlString); [OperationContract] string SendSMSMessageFrom(Guid userGuid); [OperationContract(IsOneWay = false)] void MessageServiceStatusSubscribe(string applicationName); [OperationContract(IsOneWay = true)] void MessageServiceStatusEndSubscribe(string applicationName); [OperationContract(IsOneWay = false)] void EmailNotificationSubscribe(string applicationName); [OperationContract(IsOneWay = true)] void EmailNotificationEndSubscribe(string applicationName); [OperationContract(IsOneWay = false)] void SmsNotificationSubscribe(string applicationName); [OperationContract(IsOneWay = true)] void SmsNotificationEndSubscribe(string applicationName); [OperationContract] void StartMessageListener(); [OperationContract] IList<SendMessageServiceStatusDto> GetMessageServiceStatus(); [OperationContract] IList<NotificationReceivedDto> GetEventNotications(Guid userGuid); } }
mit
C#
44cfa2d6f9a19d1c2e9b59df30db7a860bb48c3f
Update src/Abp.AspNetCore/AspNetCore/MultiTenancy/HttpCookieTenantResolveContributor.cs
aspnetboilerplate/aspnetboilerplate,ilyhacker/aspnetboilerplate,ryancyq/aspnetboilerplate,verdentk/aspnetboilerplate,beratcarsi/aspnetboilerplate,carldai0106/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,verdentk/aspnetboilerplate,carldai0106/aspnetboilerplate,ilyhacker/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,luchaoshuai/aspnetboilerplate,luchaoshuai/aspnetboilerplate,beratcarsi/aspnetboilerplate,ilyhacker/aspnetboilerplate,ryancyq/aspnetboilerplate,carldai0106/aspnetboilerplate,ryancyq/aspnetboilerplate,beratcarsi/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,carldai0106/aspnetboilerplate,ryancyq/aspnetboilerplate,verdentk/aspnetboilerplate
src/Abp.AspNetCore/AspNetCore/MultiTenancy/HttpCookieTenantResolveContributor.cs
src/Abp.AspNetCore/AspNetCore/MultiTenancy/HttpCookieTenantResolveContributor.cs
using Abp.Configuration.Startup; using Abp.Dependency; using Abp.Extensions; using Abp.MultiTenancy; using Microsoft.AspNetCore.Http; namespace Abp.AspNetCore.MultiTenancy { public class HttpCookieTenantResolveContributor : ITenantResolveContributor, ITransientDependency { private readonly IHttpContextAccessor _httpContextAccessor; private readonly IMultiTenancyConfig _multiTenancyConfig; public HttpCookieTenantResolveContributor( IHttpContextAccessor httpContextAccessor, IMultiTenancyConfig multiTenancyConfig) { _httpContextAccessor = httpContextAccessor; _multiTenancyConfig = multiTenancyConfig; } public int? ResolveTenantId() { var httpContext = _httpContextAccessor.HttpContext; if (httpContext == null) { return null; } var tenantIdValue = httpContext.Request.Cookies[_multiTenancyConfig.TenantIdResolveKey]; if (tenantIdValue.IsNullOrEmpty()) { return null; } return int.TryParse(tenantIdValue, out var tenantId) ? tenantId : (int?) null; } } }
using Abp.Configuration.Startup; using Abp.Dependency; using Abp.Extensions; using Abp.MultiTenancy; using Microsoft.AspNetCore.Http; namespace Abp.AspNetCore.MultiTenancy { public class HttpCookieTenantResolveContributor : ITenantResolveContributor, ITransientDependency { private readonly IHttpContextAccessor _httpContextAccessor; private readonly IMultiTenancyConfig _multiTenancyConfig; public HttpCookieTenantResolveContributor( IHttpContextAccessor httpContextAccessor, IMultiTenancyConfig multiTenancyConfig) { _httpContextAccessor = httpContextAccessor; _multiTenancyConfig = multiTenancyConfig; } public int? ResolveTenantId() { var httpContext = _httpContextAccessor.HttpContext; if (httpContext == null) { return null; } var tenantIdValue = httpContext.Request.Cookies[_multiTenancyConfig.TenantIdResolveKey]; if (tenantIdValue.IsNullOrEmpty()) { return null; } return !int.TryParse(tenantIdValue, out var tenantId) ? (int?) null : tenantId; } } }
mit
C#
f865e0f0042aa494403a1ae6b46faccbab893f87
Update examples
aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET
Examples/CSharp/Files/Handling/OpeningTabDelimitedFiles.cs
Examples/CSharp/Files/Handling/OpeningTabDelimitedFiles.cs
using System.IO; using Aspose.Cells; using System; namespace Aspose.Cells.Examples.Files.Handling { public class OpeningTabDelimitedFiles { public static void Main(string[] args) { //ExStart:1 // The path to the documents directory. string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); // Opening Tab Delimited Files //Instantiate LoadOptions specified by the LoadFormat. LoadOptions loadOptions5 = new LoadOptions(LoadFormat.TabDelimited); //Create a Workbook object and opening the file from its path Workbook wbTabDelimited = new Workbook(dataDir + "Book1TabDelimited.txt", loadOptions5); Console.WriteLine("Tab delimited file opened successfully!"); //ExEnd:1 } } }
using System.IO; using Aspose.Cells; using System; namespace Aspose.Cells.Examples.Files.Handling { public class OpeningFiles { public static void Main(string[] args) { //ExStart:1 // The path to the documents directory. string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); // Opening Tab Delimited Files //Instantiate LoadOptions specified by the LoadFormat. LoadOptions loadOptions5 = new LoadOptions(LoadFormat.TabDelimited); //Create a Workbook object and opening the file from its path Workbook wbTabDelimited = new Workbook(dataDir + "Book1TabDelimited.txt", loadOptions5); Console.WriteLine("Tab delimited file opened successfully!"); //ExEnd:1 } } }
mit
C#
2a61092ef24ada2205ee0219b77e54cea8dbb7d5
Update GeoPointFieldSettings.cs
petedavis/Orchard2,petedavis/Orchard2,petedavis/Orchard2,petedavis/Orchard2
src/OrchardCore.Modules/OrchardCore.Spatial/Settings/GeoPointFieldSettings.cs
src/OrchardCore.Modules/OrchardCore.Spatial/Settings/GeoPointFieldSettings.cs
namespace OrchardCore.Spatial.Settings { public class GeoPointFieldSettings { public string Hint { get; set; } public bool Required { get; set; } } }
namespace OrchardCore.Spatial.Settings { public class GeoPointFieldSettings { public string Hint { get; set; } public bool Required { get; set; } } }
bsd-3-clause
C#
c996c29e553ff0e673426f5d926e1420ac0d7f39
Disable also console logging on AppVeyor.
mchaloupka/DotNetR2RMLStore,mchaloupka/EVI
src/Slp.Evi.Storage/Slp.Evi.Test.System/SPARQL/SPARQL_TestSuite/Db/MSSQLDb.cs
src/Slp.Evi.Storage/Slp.Evi.Test.System/SPARQL/SPARQL_TestSuite/Db/MSSQLDb.cs
using System; using System.Collections; using System.Collections.Generic; using System.Configuration; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Console; using Microsoft.VisualStudio.TestTools.UnitTesting; using Slp.Evi.Storage; using Slp.Evi.Storage.Bootstrap; using Slp.Evi.Storage.Database; using Slp.Evi.Storage.Database.Vendor.MsSql; namespace Slp.Evi.Test.System.SPARQL.SPARQL_TestSuite.Db { [TestClass] public class MSSQLDb : TestSuite { private static Dictionary<string, EviQueryableStorage> _storages; [ClassInitialize] public static void TestSuiteInitialization(TestContext context) { _storages = new Dictionary<string, EviQueryableStorage>(); foreach (var dataset in StorageNames) { var storage = InitializeDataset(dataset, GetSqlDb(), GetStorageFactory()); _storages.Add(dataset, storage); } } private static ISqlDatabase GetSqlDb() { var connectionString = ConfigurationManager.ConnectionStrings["mssql_connection"].ConnectionString; return (new MsSqlDbFactory()).CreateSqlDb(connectionString); } private static IEviQueryableStorageFactory GetStorageFactory() { var loggerFactory = new LoggerFactory(); if (Environment.GetEnvironmentVariable("APPVEYOR") != "True") { loggerFactory.AddConsole(LogLevel.Trace); loggerFactory.AddDebug(LogLevel.Trace); } return new DefaultEviQueryableStorageFactory(loggerFactory); } protected override EviQueryableStorage GetStorage(string storageName) { return _storages[storageName]; } } }
using System; using System.Collections.Generic; using System.Configuration; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Console; using Microsoft.VisualStudio.TestTools.UnitTesting; using Slp.Evi.Storage; using Slp.Evi.Storage.Bootstrap; using Slp.Evi.Storage.Database; using Slp.Evi.Storage.Database.Vendor.MsSql; namespace Slp.Evi.Test.System.SPARQL.SPARQL_TestSuite.Db { [TestClass] public class MSSQLDb : TestSuite { private static Dictionary<string, EviQueryableStorage> _storages; [ClassInitialize] public static void TestSuiteInitialization(TestContext context) { _storages = new Dictionary<string, EviQueryableStorage>(); foreach (var dataset in StorageNames) { var storage = InitializeDataset(dataset, GetSqlDb(), GetStorageFactory()); _storages.Add(dataset, storage); } } private static ISqlDatabase GetSqlDb() { var connectionString = ConfigurationManager.ConnectionStrings["mssql_connection"].ConnectionString; return (new MsSqlDbFactory()).CreateSqlDb(connectionString); } private static IEviQueryableStorageFactory GetStorageFactory() { var loggerFactory = new LoggerFactory(); loggerFactory.AddConsole(LogLevel.Trace); if (Environment.GetEnvironmentVariable("APPVEYOR") != "True") { loggerFactory.AddDebug(LogLevel.Trace); } return new DefaultEviQueryableStorageFactory(loggerFactory); } protected override EviQueryableStorage GetStorage(string storageName) { return _storages[storageName]; } } }
mit
C#
185601744b9168e028b2a2f902e8243fbe205fcf
Disable SslStream_SameCertUsedForClientAndServer_Ok test failing on Win7
twsouthwick/corefx,jlin177/corefx,stephenmichaelf/corefx,zhenlan/corefx,tijoytom/corefx,krytarowski/corefx,ViktorHofer/corefx,axelheer/corefx,JosephTremoulet/corefx,jlin177/corefx,ViktorHofer/corefx,axelheer/corefx,ptoonen/corefx,shimingsg/corefx,billwert/corefx,wtgodbe/corefx,seanshpark/corefx,krk/corefx,stone-li/corefx,jlin177/corefx,YoupHulsebos/corefx,elijah6/corefx,Ermiar/corefx,seanshpark/corefx,ptoonen/corefx,the-dwyer/corefx,parjong/corefx,tijoytom/corefx,ViktorHofer/corefx,stephenmichaelf/corefx,cydhaselton/corefx,yizhang82/corefx,mazong1123/corefx,Ermiar/corefx,mazong1123/corefx,billwert/corefx,cydhaselton/corefx,billwert/corefx,krk/corefx,parjong/corefx,stone-li/corefx,richlander/corefx,zhenlan/corefx,rubo/corefx,axelheer/corefx,DnlHarvey/corefx,elijah6/corefx,DnlHarvey/corefx,wtgodbe/corefx,nbarbettini/corefx,yizhang82/corefx,zhenlan/corefx,Ermiar/corefx,rubo/corefx,nchikanov/corefx,ptoonen/corefx,nchikanov/corefx,yizhang82/corefx,ericstj/corefx,dotnet-bot/corefx,stephenmichaelf/corefx,billwert/corefx,alexperovich/corefx,stone-li/corefx,fgreinacher/corefx,seanshpark/corefx,ericstj/corefx,cydhaselton/corefx,yizhang82/corefx,dotnet-bot/corefx,gkhanna79/corefx,ravimeda/corefx,mazong1123/corefx,nchikanov/corefx,mazong1123/corefx,krk/corefx,krytarowski/corefx,gkhanna79/corefx,nchikanov/corefx,dhoehna/corefx,rubo/corefx,seanshpark/corefx,mazong1123/corefx,nbarbettini/corefx,Jiayili1/corefx,elijah6/corefx,gkhanna79/corefx,zhenlan/corefx,elijah6/corefx,dotnet-bot/corefx,cydhaselton/corefx,wtgodbe/corefx,cydhaselton/corefx,the-dwyer/corefx,rubo/corefx,krytarowski/corefx,twsouthwick/corefx,nbarbettini/corefx,jlin177/corefx,krk/corefx,tijoytom/corefx,billwert/corefx,dhoehna/corefx,twsouthwick/corefx,krk/corefx,richlander/corefx,alexperovich/corefx,wtgodbe/corefx,twsouthwick/corefx,ericstj/corefx,stone-li/corefx,parjong/corefx,ViktorHofer/corefx,zhenlan/corefx,JosephTremoulet/corefx,gkhanna79/corefx,ViktorHofer/corefx,elijah6/corefx,the-dwyer/corefx,axelheer/corefx,JosephTremoulet/corefx,ericstj/corefx,nbarbettini/corefx,fgreinacher/corefx,stephenmichaelf/corefx,mmitche/corefx,twsouthwick/corefx,parjong/corefx,wtgodbe/corefx,ptoonen/corefx,zhenlan/corefx,mmitche/corefx,BrennanConroy/corefx,DnlHarvey/corefx,Ermiar/corefx,wtgodbe/corefx,mmitche/corefx,yizhang82/corefx,ptoonen/corefx,parjong/corefx,DnlHarvey/corefx,alexperovich/corefx,tijoytom/corefx,mmitche/corefx,dotnet-bot/corefx,shimingsg/corefx,ravimeda/corefx,JosephTremoulet/corefx,mazong1123/corefx,dotnet-bot/corefx,seanshpark/corefx,JosephTremoulet/corefx,YoupHulsebos/corefx,billwert/corefx,Jiayili1/corefx,ravimeda/corefx,elijah6/corefx,nbarbettini/corefx,krytarowski/corefx,krk/corefx,stone-li/corefx,zhenlan/corefx,mazong1123/corefx,nchikanov/corefx,parjong/corefx,nchikanov/corefx,richlander/corefx,mmitche/corefx,krytarowski/corefx,gkhanna79/corefx,richlander/corefx,krytarowski/corefx,ViktorHofer/corefx,ravimeda/corefx,yizhang82/corefx,jlin177/corefx,cydhaselton/corefx,Jiayili1/corefx,wtgodbe/corefx,ravimeda/corefx,ravimeda/corefx,DnlHarvey/corefx,MaggieTsang/corefx,ViktorHofer/corefx,ravimeda/corefx,ericstj/corefx,richlander/corefx,jlin177/corefx,stephenmichaelf/corefx,shimingsg/corefx,nbarbettini/corefx,richlander/corefx,gkhanna79/corefx,MaggieTsang/corefx,fgreinacher/corefx,parjong/corefx,YoupHulsebos/corefx,MaggieTsang/corefx,yizhang82/corefx,DnlHarvey/corefx,krytarowski/corefx,MaggieTsang/corefx,Jiayili1/corefx,MaggieTsang/corefx,twsouthwick/corefx,dhoehna/corefx,YoupHulsebos/corefx,MaggieTsang/corefx,ptoonen/corefx,Jiayili1/corefx,cydhaselton/corefx,Ermiar/corefx,ericstj/corefx,mmitche/corefx,alexperovich/corefx,richlander/corefx,shimingsg/corefx,YoupHulsebos/corefx,YoupHulsebos/corefx,stone-li/corefx,JosephTremoulet/corefx,twsouthwick/corefx,stephenmichaelf/corefx,Jiayili1/corefx,the-dwyer/corefx,axelheer/corefx,alexperovich/corefx,dhoehna/corefx,JosephTremoulet/corefx,tijoytom/corefx,BrennanConroy/corefx,Jiayili1/corefx,YoupHulsebos/corefx,stone-li/corefx,fgreinacher/corefx,jlin177/corefx,the-dwyer/corefx,alexperovich/corefx,stephenmichaelf/corefx,Ermiar/corefx,billwert/corefx,ericstj/corefx,the-dwyer/corefx,tijoytom/corefx,DnlHarvey/corefx,dhoehna/corefx,rubo/corefx,axelheer/corefx,alexperovich/corefx,MaggieTsang/corefx,shimingsg/corefx,shimingsg/corefx,tijoytom/corefx,Ermiar/corefx,nbarbettini/corefx,seanshpark/corefx,dotnet-bot/corefx,dhoehna/corefx,elijah6/corefx,gkhanna79/corefx,seanshpark/corefx,the-dwyer/corefx,shimingsg/corefx,nchikanov/corefx,dotnet-bot/corefx,dhoehna/corefx,BrennanConroy/corefx,ptoonen/corefx,krk/corefx,mmitche/corefx
src/System.Net.Security/tests/FunctionalTests/SslStreamCredentialCacheTest.cs
src/System.Net.Security/tests/FunctionalTests/SslStreamCredentialCacheTest.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.ComponentModel; using System.Net.Test.Common; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; using Xunit; namespace System.Net.Security.Tests { using Configuration = System.Net.Test.Common.Configuration; public class SslStreamCredentialCacheTest { [ActiveIssue(19699, TestPlatforms.Windows)] [Fact] public void SslStream_SameCertUsedForClientAndServer_Ok() { SslSessionsCacheTest().GetAwaiter().GetResult(); } private static async Task SslSessionsCacheTest() { VirtualNetwork network = new VirtualNetwork(); using (var clientStream = new VirtualNetworkStream(network, isServer: false)) using (var serverStream = new VirtualNetworkStream(network, isServer: true)) using (var client = new SslStream(clientStream, true, AllowAnyCertificate)) using (var server = new SslStream(serverStream, true, AllowAnyCertificate)) using (X509Certificate2 certificate = Configuration.Certificates.GetServerCertificate()) { // Using the same certificate for server and client auth. X509Certificate2Collection clientCertificateCollection = new X509Certificate2Collection(certificate); var tasks = new Task[2]; tasks[0] = server.AuthenticateAsServerAsync(certificate, true, false); tasks[1] = client.AuthenticateAsClientAsync( certificate.GetNameInfo(X509NameType.SimpleName, false), clientCertificateCollection, false); await Task.WhenAll(tasks).TimeoutAfter(15 * 1000); Assert.True(client.IsMutuallyAuthenticated); Assert.True(server.IsMutuallyAuthenticated); } } private static bool AllowAnyCertificate( object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; } } }
// 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.ComponentModel; using System.Net.Test.Common; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; using Xunit; namespace System.Net.Security.Tests { using Configuration = System.Net.Test.Common.Configuration; public class SslStreamCredentialCacheTest { [Fact] public void SslStream_SameCertUsedForClientAndServer_Ok() { SslSessionsCacheTest().GetAwaiter().GetResult(); } private static async Task SslSessionsCacheTest() { VirtualNetwork network = new VirtualNetwork(); using (var clientStream = new VirtualNetworkStream(network, isServer: false)) using (var serverStream = new VirtualNetworkStream(network, isServer: true)) using (var client = new SslStream(clientStream, true, AllowAnyCertificate)) using (var server = new SslStream(serverStream, true, AllowAnyCertificate)) using (X509Certificate2 certificate = Configuration.Certificates.GetServerCertificate()) { // Using the same certificate for server and client auth. X509Certificate2Collection clientCertificateCollection = new X509Certificate2Collection(certificate); var tasks = new Task[2]; tasks[0] = server.AuthenticateAsServerAsync(certificate, true, false); tasks[1] = client.AuthenticateAsClientAsync( certificate.GetNameInfo(X509NameType.SimpleName, false), clientCertificateCollection, false); await Task.WhenAll(tasks).TimeoutAfter(15 * 1000); Assert.True(client.IsMutuallyAuthenticated); Assert.True(server.IsMutuallyAuthenticated); } } private static bool AllowAnyCertificate( object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; } } }
mit
C#
88b5e73c265127fc7f2cbde63cae36921036ec85
Make WebSocketReceiveResult's fields readonly
BrennanConroy/corefx,billwert/corefx,zhenlan/corefx,weltkante/corefx,rahku/corefx,ptoonen/corefx,alphonsekurian/corefx,ericstj/corefx,cydhaselton/corefx,dotnet-bot/corefx,mazong1123/corefx,richlander/corefx,weltkante/corefx,DnlHarvey/corefx,wtgodbe/corefx,krytarowski/corefx,YoupHulsebos/corefx,iamjasonp/corefx,tijoytom/corefx,iamjasonp/corefx,nbarbettini/corefx,Jiayili1/corefx,DnlHarvey/corefx,fgreinacher/corefx,iamjasonp/corefx,lggomez/corefx,shimingsg/corefx,manu-silicon/corefx,rjxby/corefx,dhoehna/corefx,MaggieTsang/corefx,alphonsekurian/corefx,nchikanov/corefx,tijoytom/corefx,marksmeltzer/corefx,wtgodbe/corefx,gkhanna79/corefx,Jiayili1/corefx,gkhanna79/corefx,krk/corefx,parjong/corefx,wtgodbe/corefx,cydhaselton/corefx,alexperovich/corefx,mmitche/corefx,MaggieTsang/corefx,JosephTremoulet/corefx,seanshpark/corefx,twsouthwick/corefx,nbarbettini/corefx,lggomez/corefx,alphonsekurian/corefx,ViktorHofer/corefx,nchikanov/corefx,ericstj/corefx,cydhaselton/corefx,wtgodbe/corefx,tijoytom/corefx,zhenlan/corefx,JosephTremoulet/corefx,ptoonen/corefx,krk/corefx,elijah6/corefx,Ermiar/corefx,axelheer/corefx,ravimeda/corefx,wtgodbe/corefx,ptoonen/corefx,rjxby/corefx,krk/corefx,zhenlan/corefx,shmao/corefx,JosephTremoulet/corefx,shmao/corefx,stone-li/corefx,rjxby/corefx,yizhang82/corefx,ptoonen/corefx,DnlHarvey/corefx,alphonsekurian/corefx,rahku/corefx,ptoonen/corefx,YoupHulsebos/corefx,MaggieTsang/corefx,Jiayili1/corefx,nchikanov/corefx,jlin177/corefx,rahku/corefx,fgreinacher/corefx,yizhang82/corefx,tijoytom/corefx,yizhang82/corefx,krk/corefx,the-dwyer/corefx,stone-li/corefx,shmao/corefx,ericstj/corefx,manu-silicon/corefx,parjong/corefx,Petermarcu/corefx,shimingsg/corefx,shimingsg/corefx,stephenmichaelf/corefx,rubo/corefx,krytarowski/corefx,ViktorHofer/corefx,krytarowski/corefx,rjxby/corefx,the-dwyer/corefx,krytarowski/corefx,stephenmichaelf/corefx,seanshpark/corefx,mazong1123/corefx,dotnet-bot/corefx,Chrisboh/corefx,shmao/corefx,zhenlan/corefx,nbarbettini/corefx,dotnet-bot/corefx,jhendrixMSFT/corefx,twsouthwick/corefx,manu-silicon/corefx,mazong1123/corefx,stephenmichaelf/corefx,manu-silicon/corefx,stone-li/corefx,jhendrixMSFT/corefx,nbarbettini/corefx,shmao/corefx,stephenmichaelf/corefx,tijoytom/corefx,mmitche/corefx,richlander/corefx,twsouthwick/corefx,jhendrixMSFT/corefx,Jiayili1/corefx,jlin177/corefx,elijah6/corefx,parjong/corefx,nchikanov/corefx,shimingsg/corefx,wtgodbe/corefx,weltkante/corefx,ericstj/corefx,ericstj/corefx,JosephTremoulet/corefx,gkhanna79/corefx,parjong/corefx,iamjasonp/corefx,yizhang82/corefx,marksmeltzer/corefx,alexperovich/corefx,MaggieTsang/corefx,Petermarcu/corefx,ravimeda/corefx,richlander/corefx,marksmeltzer/corefx,iamjasonp/corefx,jlin177/corefx,jhendrixMSFT/corefx,parjong/corefx,rjxby/corefx,dotnet-bot/corefx,marksmeltzer/corefx,axelheer/corefx,yizhang82/corefx,Petermarcu/corefx,stone-li/corefx,BrennanConroy/corefx,alexperovich/corefx,marksmeltzer/corefx,BrennanConroy/corefx,axelheer/corefx,dotnet-bot/corefx,JosephTremoulet/corefx,ravimeda/corefx,the-dwyer/corefx,krk/corefx,alexperovich/corefx,rubo/corefx,JosephTremoulet/corefx,iamjasonp/corefx,stone-li/corefx,cydhaselton/corefx,the-dwyer/corefx,zhenlan/corefx,YoupHulsebos/corefx,Jiayili1/corefx,rjxby/corefx,nchikanov/corefx,axelheer/corefx,tijoytom/corefx,billwert/corefx,fgreinacher/corefx,Petermarcu/corefx,ravimeda/corefx,zhenlan/corefx,YoupHulsebos/corefx,twsouthwick/corefx,lggomez/corefx,rubo/corefx,nbarbettini/corefx,krk/corefx,nbarbettini/corefx,mmitche/corefx,jhendrixMSFT/corefx,YoupHulsebos/corefx,seanshpark/corefx,shimingsg/corefx,Petermarcu/corefx,manu-silicon/corefx,dhoehna/corefx,weltkante/corefx,mazong1123/corefx,marksmeltzer/corefx,ravimeda/corefx,elijah6/corefx,seanshpark/corefx,MaggieTsang/corefx,alexperovich/corefx,stephenmichaelf/corefx,richlander/corefx,the-dwyer/corefx,shimingsg/corefx,DnlHarvey/corefx,ViktorHofer/corefx,weltkante/corefx,Ermiar/corefx,mmitche/corefx,Jiayili1/corefx,axelheer/corefx,seanshpark/corefx,alphonsekurian/corefx,krk/corefx,mazong1123/corefx,billwert/corefx,ericstj/corefx,alexperovich/corefx,rubo/corefx,billwert/corefx,marksmeltzer/corefx,DnlHarvey/corefx,Ermiar/corefx,stone-li/corefx,jhendrixMSFT/corefx,YoupHulsebos/corefx,YoupHulsebos/corefx,richlander/corefx,alphonsekurian/corefx,parjong/corefx,lggomez/corefx,richlander/corefx,elijah6/corefx,mmitche/corefx,Chrisboh/corefx,rahku/corefx,iamjasonp/corefx,shmao/corefx,dotnet-bot/corefx,Petermarcu/corefx,elijah6/corefx,ViktorHofer/corefx,rubo/corefx,the-dwyer/corefx,krytarowski/corefx,twsouthwick/corefx,elijah6/corefx,DnlHarvey/corefx,MaggieTsang/corefx,alphonsekurian/corefx,jhendrixMSFT/corefx,Ermiar/corefx,elijah6/corefx,seanshpark/corefx,ravimeda/corefx,dhoehna/corefx,zhenlan/corefx,weltkante/corefx,dhoehna/corefx,stone-li/corefx,Ermiar/corefx,twsouthwick/corefx,stephenmichaelf/corefx,ViktorHofer/corefx,krytarowski/corefx,lggomez/corefx,axelheer/corefx,cydhaselton/corefx,seanshpark/corefx,nbarbettini/corefx,jlin177/corefx,cydhaselton/corefx,yizhang82/corefx,mazong1123/corefx,weltkante/corefx,jlin177/corefx,gkhanna79/corefx,billwert/corefx,Petermarcu/corefx,cydhaselton/corefx,rahku/corefx,Chrisboh/corefx,jlin177/corefx,Ermiar/corefx,rahku/corefx,nchikanov/corefx,Chrisboh/corefx,MaggieTsang/corefx,billwert/corefx,mazong1123/corefx,the-dwyer/corefx,krytarowski/corefx,JosephTremoulet/corefx,shmao/corefx,DnlHarvey/corefx,rahku/corefx,stephenmichaelf/corefx,manu-silicon/corefx,lggomez/corefx,fgreinacher/corefx,dotnet-bot/corefx,ViktorHofer/corefx,tijoytom/corefx,richlander/corefx,gkhanna79/corefx,jlin177/corefx,dhoehna/corefx,alexperovich/corefx,mmitche/corefx,ViktorHofer/corefx,gkhanna79/corefx,shimingsg/corefx,yizhang82/corefx,parjong/corefx,Chrisboh/corefx,dhoehna/corefx,rjxby/corefx,ptoonen/corefx,wtgodbe/corefx,Chrisboh/corefx,billwert/corefx,lggomez/corefx,Jiayili1/corefx,ericstj/corefx,dhoehna/corefx,ptoonen/corefx,manu-silicon/corefx,twsouthwick/corefx,nchikanov/corefx,gkhanna79/corefx,ravimeda/corefx,Ermiar/corefx,mmitche/corefx
src/System.Net.WebSockets/src/System/Net/WebSockets/WebSocketReceiveResult.cs
src/System.Net.WebSockets/src/System/Net/WebSockets/WebSocketReceiveResult.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.Diagnostics; namespace System.Net.WebSockets { public class WebSocketReceiveResult { public WebSocketReceiveResult(int count, WebSocketMessageType messageType, bool endOfMessage) : this(count, messageType, endOfMessage, null, null) { } public WebSocketReceiveResult(int count, WebSocketMessageType messageType, bool endOfMessage, WebSocketCloseStatus? closeStatus, string closeStatusDescription) { if (count < 0) { throw new ArgumentOutOfRangeException(nameof(count)); } Count = count; EndOfMessage = endOfMessage; MessageType = messageType; CloseStatus = closeStatus; CloseStatusDescription = closeStatusDescription; } public int Count { get; } public bool EndOfMessage { get; } public WebSocketMessageType MessageType { get; } public WebSocketCloseStatus? CloseStatus { get; } public string CloseStatusDescription { get; } } }
// 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.Diagnostics; namespace System.Net.WebSockets { public class WebSocketReceiveResult { public WebSocketReceiveResult(int count, WebSocketMessageType messageType, bool endOfMessage) : this(count, messageType, endOfMessage, null, null) { } public WebSocketReceiveResult(int count, WebSocketMessageType messageType, bool endOfMessage, WebSocketCloseStatus? closeStatus, string closeStatusDescription) { if (count < 0) { throw new ArgumentOutOfRangeException(nameof(count)); } Count = count; EndOfMessage = endOfMessage; MessageType = messageType; CloseStatus = closeStatus; CloseStatusDescription = closeStatusDescription; } public int Count { get; private set; } public bool EndOfMessage { get; private set; } public WebSocketMessageType MessageType { get; private set; } public WebSocketCloseStatus? CloseStatus { get; private set; } public string CloseStatusDescription { get; private set; } internal WebSocketReceiveResult Copy(int count) { Debug.Assert(count >= 0, "'count' MUST NOT be negative."); Debug.Assert(count <= Count, "'count' MUST NOT be bigger than 'this.Count'."); Count -= count; return new WebSocketReceiveResult(count, MessageType, Count == 0 && this.EndOfMessage, CloseStatus, CloseStatusDescription); } } }
mit
C#
5704e9ee6553de4324dffa802cdf7bbada5108ec
Fix failing at beginning of map
naoey/osu,naoey/osu,DrabWeb/osu,ppy/osu,peppy/osu,peppy/osu,johnneijzen/osu,2yangk23/osu,UselessToucan/osu,UselessToucan/osu,naoey/osu,Nabile-Rahmani/osu,NeoAdonis/osu,smoogipooo/osu,smoogipoo/osu,EVAST9919/osu,smoogipoo/osu,ZLima12/osu,ppy/osu,DrabWeb/osu,2yangk23/osu,ZLima12/osu,johnneijzen/osu,EVAST9919/osu,peppy/osu-new,UselessToucan/osu,NeoAdonis/osu,NeoAdonis/osu,DrabWeb/osu,peppy/osu,smoogipoo/osu,Drezi126/osu,Frontear/osuKyzer,ppy/osu,Damnae/osu
osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs
osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Catch.Judgements; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Catch.Scoring { internal class CatchScoreProcessor : ScoreProcessor<CatchBaseHit, CatchJudgement> { public CatchScoreProcessor() { } public CatchScoreProcessor(HitRenderer<CatchBaseHit, CatchJudgement> hitRenderer) : base(hitRenderer) { } protected override void Reset() { base.Reset(); Health.Value = 1; Accuracy.Value = 1; } protected override void OnNewJudgement(CatchJudgement judgement) { } } }
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Catch.Judgements; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Catch.Scoring { internal class CatchScoreProcessor : ScoreProcessor<CatchBaseHit, CatchJudgement> { public CatchScoreProcessor() { } public CatchScoreProcessor(HitRenderer<CatchBaseHit, CatchJudgement> hitRenderer) : base(hitRenderer) { } protected override void OnNewJudgement(CatchJudgement judgement) { } } }
mit
C#
c75d5a8e775b70b255f5f7522ebf0d1619f6915e
add lastUseOn to UserAddress
simplcommerce/SimplCommerce,arst/SimplCommerce,simplcommerce/SimplCommerce,arst/SimplCommerce,simplcommerce/SimplCommerce,simplcommerce/SimplCommerce,arst/SimplCommerce,arst/SimplCommerce
src/Core/Shopcuatoi.Core/Domain/Models/UserAddress.cs
src/Core/Shopcuatoi.Core/Domain/Models/UserAddress.cs
using System; using Shopcuatoi.Infrastructure.Domain.Models; namespace Shopcuatoi.Core.Domain.Models { public class UserAddress : Entity { public long UserId { get; set; } public virtual User User { get; set; } public long AddressId { get; set; } public virtual Address Address { get; set; } public AddressType AddressType { get; set; } public DateTime? LastUsedOn { get; set; } } }
using Shopcuatoi.Infrastructure.Domain.Models; namespace Shopcuatoi.Core.Domain.Models { public class UserAddress : Entity { public long UserId { get; set; } public virtual User User { get; set; } public long AddressId { get; set; } public virtual Address Address { get; set; } public AddressType AddressType { get; set; } } }
apache-2.0
C#
a0f02a0346f53a50f65b7b36959ce8da64a1509a
Fix typos in NormalizeString P/Invoke signature
elijah6/corefx,gkhanna79/corefx,mmitche/corefx,shmao/corefx,alphonsekurian/corefx,stephenmichaelf/corefx,dhoehna/corefx,zhenlan/corefx,Petermarcu/corefx,weltkante/corefx,MaggieTsang/corefx,ravimeda/corefx,DnlHarvey/corefx,rahku/corefx,ptoonen/corefx,cydhaselton/corefx,alphonsekurian/corefx,Petermarcu/corefx,yizhang82/corefx,richlander/corefx,wtgodbe/corefx,alphonsekurian/corefx,rjxby/corefx,nchikanov/corefx,manu-silicon/corefx,richlander/corefx,cydhaselton/corefx,richlander/corefx,krk/corefx,parjong/corefx,DnlHarvey/corefx,dotnet-bot/corefx,billwert/corefx,dotnet-bot/corefx,fgreinacher/corefx,seanshpark/corefx,nbarbettini/corefx,shmao/corefx,alexperovich/corefx,krytarowski/corefx,Ermiar/corefx,ericstj/corefx,mazong1123/corefx,parjong/corefx,shimingsg/corefx,marksmeltzer/corefx,dotnet-bot/corefx,Ermiar/corefx,Petermarcu/corefx,cydhaselton/corefx,elijah6/corefx,krytarowski/corefx,stephenmichaelf/corefx,YoupHulsebos/corefx,BrennanConroy/corefx,dotnet-bot/corefx,seanshpark/corefx,mazong1123/corefx,krk/corefx,shimingsg/corefx,cydhaselton/corefx,nbarbettini/corefx,Jiayili1/corefx,marksmeltzer/corefx,tijoytom/corefx,manu-silicon/corefx,Ermiar/corefx,Jiayili1/corefx,ericstj/corefx,stephenmichaelf/corefx,Jiayili1/corefx,gkhanna79/corefx,twsouthwick/corefx,shimingsg/corefx,dotnet-bot/corefx,yizhang82/corefx,Jiayili1/corefx,yizhang82/corefx,JosephTremoulet/corefx,axelheer/corefx,jlin177/corefx,nbarbettini/corefx,the-dwyer/corefx,axelheer/corefx,seanshpark/corefx,marksmeltzer/corefx,stone-li/corefx,jlin177/corefx,alexperovich/corefx,tijoytom/corefx,Petermarcu/corefx,shimingsg/corefx,stephenmichaelf/corefx,jlin177/corefx,the-dwyer/corefx,iamjasonp/corefx,manu-silicon/corefx,Ermiar/corefx,seanshpark/corefx,manu-silicon/corefx,jhendrixMSFT/corefx,ptoonen/corefx,mazong1123/corefx,YoupHulsebos/corefx,mazong1123/corefx,lggomez/corefx,stephenmichaelf/corefx,ravimeda/corefx,nchikanov/corefx,marksmeltzer/corefx,YoupHulsebos/corefx,wtgodbe/corefx,alphonsekurian/corefx,MaggieTsang/corefx,mazong1123/corefx,jhendrixMSFT/corefx,shmao/corefx,MaggieTsang/corefx,zhenlan/corefx,krk/corefx,lggomez/corefx,krytarowski/corefx,shimingsg/corefx,ViktorHofer/corefx,twsouthwick/corefx,ravimeda/corefx,nbarbettini/corefx,zhenlan/corefx,YoupHulsebos/corefx,lggomez/corefx,wtgodbe/corefx,parjong/corefx,krytarowski/corefx,rubo/corefx,ptoonen/corefx,stone-li/corefx,ptoonen/corefx,alexperovich/corefx,jhendrixMSFT/corefx,zhenlan/corefx,ericstj/corefx,weltkante/corefx,richlander/corefx,dhoehna/corefx,DnlHarvey/corefx,lggomez/corefx,billwert/corefx,tijoytom/corefx,cydhaselton/corefx,twsouthwick/corefx,krytarowski/corefx,billwert/corefx,axelheer/corefx,JosephTremoulet/corefx,DnlHarvey/corefx,wtgodbe/corefx,iamjasonp/corefx,twsouthwick/corefx,ptoonen/corefx,weltkante/corefx,ViktorHofer/corefx,dhoehna/corefx,yizhang82/corefx,weltkante/corefx,DnlHarvey/corefx,ravimeda/corefx,dotnet-bot/corefx,lggomez/corefx,nbarbettini/corefx,billwert/corefx,krk/corefx,jlin177/corefx,iamjasonp/corefx,marksmeltzer/corefx,cydhaselton/corefx,weltkante/corefx,rjxby/corefx,DnlHarvey/corefx,tijoytom/corefx,ravimeda/corefx,stone-li/corefx,ericstj/corefx,zhenlan/corefx,marksmeltzer/corefx,MaggieTsang/corefx,JosephTremoulet/corefx,elijah6/corefx,zhenlan/corefx,richlander/corefx,dhoehna/corefx,Jiayili1/corefx,tijoytom/corefx,BrennanConroy/corefx,jhendrixMSFT/corefx,fgreinacher/corefx,YoupHulsebos/corefx,nbarbettini/corefx,dhoehna/corefx,mmitche/corefx,iamjasonp/corefx,axelheer/corefx,krk/corefx,nbarbettini/corefx,rahku/corefx,rubo/corefx,JosephTremoulet/corefx,parjong/corefx,wtgodbe/corefx,ravimeda/corefx,krk/corefx,shmao/corefx,wtgodbe/corefx,rahku/corefx,ViktorHofer/corefx,Jiayili1/corefx,ericstj/corefx,weltkante/corefx,alexperovich/corefx,Petermarcu/corefx,stephenmichaelf/corefx,mazong1123/corefx,iamjasonp/corefx,cydhaselton/corefx,YoupHulsebos/corefx,stephenmichaelf/corefx,shimingsg/corefx,nchikanov/corefx,Jiayili1/corefx,Ermiar/corefx,fgreinacher/corefx,elijah6/corefx,mmitche/corefx,stone-li/corefx,mmitche/corefx,richlander/corefx,manu-silicon/corefx,JosephTremoulet/corefx,marksmeltzer/corefx,tijoytom/corefx,rjxby/corefx,elijah6/corefx,rubo/corefx,iamjasonp/corefx,nchikanov/corefx,jlin177/corefx,gkhanna79/corefx,alexperovich/corefx,alexperovich/corefx,gkhanna79/corefx,rahku/corefx,parjong/corefx,jhendrixMSFT/corefx,iamjasonp/corefx,billwert/corefx,Ermiar/corefx,ViktorHofer/corefx,YoupHulsebos/corefx,rjxby/corefx,rubo/corefx,alphonsekurian/corefx,fgreinacher/corefx,ptoonen/corefx,mazong1123/corefx,manu-silicon/corefx,yizhang82/corefx,ViktorHofer/corefx,rahku/corefx,mmitche/corefx,lggomez/corefx,nchikanov/corefx,twsouthwick/corefx,ptoonen/corefx,dhoehna/corefx,shmao/corefx,shmao/corefx,ericstj/corefx,alphonsekurian/corefx,mmitche/corefx,billwert/corefx,krytarowski/corefx,rahku/corefx,wtgodbe/corefx,parjong/corefx,MaggieTsang/corefx,parjong/corefx,stone-li/corefx,alphonsekurian/corefx,jlin177/corefx,yizhang82/corefx,the-dwyer/corefx,rahku/corefx,nchikanov/corefx,seanshpark/corefx,jhendrixMSFT/corefx,BrennanConroy/corefx,gkhanna79/corefx,rubo/corefx,seanshpark/corefx,jlin177/corefx,the-dwyer/corefx,Petermarcu/corefx,alexperovich/corefx,lggomez/corefx,zhenlan/corefx,tijoytom/corefx,rjxby/corefx,shimingsg/corefx,ViktorHofer/corefx,krk/corefx,axelheer/corefx,twsouthwick/corefx,billwert/corefx,ravimeda/corefx,DnlHarvey/corefx,axelheer/corefx,ericstj/corefx,seanshpark/corefx,mmitche/corefx,MaggieTsang/corefx,richlander/corefx,the-dwyer/corefx,yizhang82/corefx,weltkante/corefx,the-dwyer/corefx,krytarowski/corefx,manu-silicon/corefx,dhoehna/corefx,nchikanov/corefx,MaggieTsang/corefx,Ermiar/corefx,elijah6/corefx,gkhanna79/corefx,rjxby/corefx,stone-li/corefx,JosephTremoulet/corefx,JosephTremoulet/corefx,twsouthwick/corefx,the-dwyer/corefx,dotnet-bot/corefx,rjxby/corefx,elijah6/corefx,jhendrixMSFT/corefx,Petermarcu/corefx,ViktorHofer/corefx,shmao/corefx,gkhanna79/corefx,stone-li/corefx
src/Common/src/Interop/Windows/mincore/Interop.Normalization.cs
src/Common/src/Interop/Windows/mincore/Interop.Normalization.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Runtime.InteropServices; internal partial class Interop { // These are error codes we get back from the Normalization DLL internal const int ERROR_SUCCESS = 0; internal const int ERROR_NOT_ENOUGH_MEMORY = 8; internal const int ERROR_INVALID_PARAMETER = 87; internal const int ERROR_INSUFFICIENT_BUFFER = 122; internal const int ERROR_INVALID_NAME = 123; internal const int ERROR_NO_UNICODE_TRANSLATION = 1113; // The VM can override the last error code with this value in debug builds // so this value for us is equivalent to ERROR_SUCCESS internal const int LAST_ERROR_TRASH_VALUE = 42424; internal partial class mincore { // // Normalization APIs // [DllImport("api-ms-win-core-normalization-l1-1-0.dll", CharSet = CharSet.Unicode, SetLastError = true)] internal static extern bool IsNormalizedString(int normForm, string source, int length); [DllImport("api-ms-win-core-normalization-l1-1-0.dll", CharSet = CharSet.Unicode, SetLastError = true)] internal static extern int NormalizeString( int normForm, string source, int sourceLength, [System.Runtime.InteropServices.OutAttribute()] char[] destination, int destinationLength); } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Runtime.InteropServices; internal partial class Interop { // These are error codes we get back from the Normalization DLL internal const int ERROR_SUCCESS = 0; internal const int ERROR_NOT_ENOUGH_MEMORY = 8; internal const int ERROR_INVALID_PARAMETER = 87; internal const int ERROR_INSUFFICIENT_BUFFER = 122; internal const int ERROR_INVALID_NAME = 123; internal const int ERROR_NO_UNICODE_TRANSLATION = 1113; // The VM can override the last error code with this value in debug builds // so this value for us is equivalent to ERROR_SUCCESS internal const int LAST_ERROR_TRASH_VALUE = 42424; internal partial class mincore { // // Normalization APIs // [DllImport("api-ms-win-core-normalization-l1-1-0.dll", CharSet = CharSet.Unicode, SetLastError = true)] internal static extern bool IsNormalizedString(int normForm, string source, int length); [DllImport("api-ms-win-core-normalization-l1-1-0.dll", CharSet = CharSet.Unicode, SetLastError = true)] internal static extern int NormalizeString( int normForm, string source, int sourceLength, [System.Runtime.InteropServices.OutAttribute()] char[] destenation, int destenationLength); } }
mit
C#
9e9e9457029869604b3c4fcf7b0cc259cfe7a92d
Fix debugger visualizer
OmarTawfik/roslyn,ljw1004/roslyn,droyad/roslyn,supriyantomaftuh/roslyn,TyOverby/roslyn,GuilhermeSa/roslyn,reaction1989/roslyn,evilc0des/roslyn,HellBrick/roslyn,drognanar/roslyn,kelltrick/roslyn,amcasey/roslyn,diryboy/roslyn,russpowers/roslyn,kelltrick/roslyn,chenxizhang/roslyn,srivatsn/roslyn,rchande/roslyn,ValentinRueda/roslyn,doconnell565/roslyn,JakeGinnivan/roslyn,vslsnap/roslyn,mirhagk/roslyn,bbarry/roslyn,aelij/roslyn,lorcanmooney/roslyn,OmarTawfik/roslyn,davkean/roslyn,basoundr/roslyn,REALTOBIZ/roslyn,tmat/roslyn,enginekit/roslyn,ilyes14/roslyn,orthoxerox/roslyn,hanu412/roslyn,MichalStrehovsky/roslyn,swaroop-sridhar/roslyn,supriyantomaftuh/roslyn,aelij/roslyn,Shiney/roslyn,pjmagee/roslyn,oberxon/roslyn,heejaechang/roslyn,ErikSchierboom/roslyn,robinsedlaczek/roslyn,mgoertz-msft/roslyn,AmadeusW/roslyn,dovzhikova/roslyn,khellang/roslyn,TyOverby/roslyn,pdelvo/roslyn,tmat/roslyn,jbhensley/roslyn,MattWindsor91/roslyn,weltkante/roslyn,danielcweber/roslyn,oocx/roslyn,shyamnamboodiripad/roslyn,managed-commons/roslyn,brettfo/roslyn,jonatassaraiva/roslyn,rchande/roslyn,pjmagee/roslyn,jeffanders/roslyn,tannergooding/roslyn,taylorjonl/roslyn,thomaslevesque/roslyn,oocx/roslyn,Hosch250/roslyn,srivatsn/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,DustinCampbell/roslyn,genlu/roslyn,chenxizhang/roslyn,supriyantomaftuh/roslyn,JakeGinnivan/roslyn,magicbing/roslyn,xoofx/roslyn,brettfo/roslyn,heejaechang/roslyn,balajikris/roslyn,kelltrick/roslyn,moozzyk/roslyn,chenxizhang/roslyn,eriawan/roslyn,jasonmalinowski/roslyn,yjfxfjch/roslyn,evilc0des/roslyn,huoxudong125/roslyn,AnthonyDGreen/roslyn,panopticoncentral/roslyn,khyperia/roslyn,genlu/roslyn,sharadagrawal/Roslyn,davkean/roslyn,KirillOsenkov/roslyn,dotnet/roslyn,HellBrick/roslyn,budcribar/roslyn,gafter/roslyn,Hosch250/roslyn,AlexisArce/roslyn,doconnell565/roslyn,agocke/roslyn,jkotas/roslyn,drognanar/roslyn,tmat/roslyn,CaptainHayashi/roslyn,natidea/roslyn,managed-commons/roslyn,diryboy/roslyn,paulvanbrenk/roslyn,nagyistoce/roslyn,mgoertz-msft/roslyn,krishnarajbb/roslyn,khellang/roslyn,AlexisArce/roslyn,xoofx/roslyn,a-ctor/roslyn,oberxon/roslyn,taylorjonl/roslyn,zooba/roslyn,EricArndt/roslyn,jcouv/roslyn,ValentinRueda/roslyn,pdelvo/roslyn,antonssonj/roslyn,michalhosala/roslyn,Maxwe11/roslyn,tmeschter/roslyn,jkotas/roslyn,MihaMarkic/roslyn-prank,ErikSchierboom/roslyn,stebet/roslyn,yjfxfjch/roslyn,mattscheffer/roslyn,natgla/roslyn,KevinH-MS/roslyn,mattscheffer/roslyn,balajikris/roslyn,jcouv/roslyn,reaction1989/roslyn,akrisiun/roslyn,jaredpar/roslyn,vcsjones/roslyn,KevinRansom/roslyn,ljw1004/roslyn,nguerrera/roslyn,nguerrera/roslyn,jonatassaraiva/roslyn,enginekit/roslyn,aanshibudhiraja/Roslyn,lisong521/roslyn,magicbing/roslyn,MatthieuMEZIL/roslyn,rgani/roslyn,zooba/roslyn,devharis/roslyn,abock/roslyn,jroggeman/roslyn,jhendrixMSFT/roslyn,Shiney/roslyn,kuhlenh/roslyn,srivatsn/roslyn,RipCurrent/roslyn,BugraC/roslyn,dpoeschl/roslyn,KirillOsenkov/roslyn,ericfe-ms/roslyn,OmniSharp/roslyn,natidea/roslyn,rgani/roslyn,bartdesmet/roslyn,ahmedshuhel/roslyn,enginekit/roslyn,mmitche/roslyn,mavasani/roslyn,moozzyk/roslyn,hanu412/roslyn,wvdd007/roslyn,robinsedlaczek/roslyn,krishnarajbb/roslyn,KevinH-MS/roslyn,bkoelman/roslyn,davkean/roslyn,MatthieuMEZIL/roslyn,zmaruo/roslyn,bbarry/roslyn,leppie/roslyn,KamalRathnayake/roslyn,natgla/roslyn,xasx/roslyn,mseamari/Stuff,kienct89/roslyn,huoxudong125/roslyn,Maxwe11/roslyn,basoundr/roslyn,KamalRathnayake/roslyn,bbarry/roslyn,jamesqo/roslyn,JakeGinnivan/roslyn,KirillOsenkov/roslyn,RipCurrent/roslyn,jasonmalinowski/roslyn,ericfe-ms/roslyn,Giftednewt/roslyn,jonatassaraiva/roslyn,reaction1989/roslyn,CaptainHayashi/roslyn,Giten2004/roslyn,tannergooding/roslyn,jamesqo/roslyn,AlekseyTs/roslyn,AlexisArce/roslyn,balajikris/roslyn,AArnott/roslyn,oocx/roslyn,dpoeschl/roslyn,budcribar/roslyn,evilc0des/roslyn,KiloBravoLima/roslyn,antonssonj/roslyn,mirhagk/roslyn,orthoxerox/roslyn,mattscheffer/roslyn,abock/roslyn,yeaicc/roslyn,BugraC/roslyn,SeriaWei/roslyn,managed-commons/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,YOTOV-LIMITED/roslyn,tsdl2013/roslyn,pjmagee/roslyn,jrharmon/roslyn,kienct89/roslyn,antiufo/roslyn,MichalStrehovsky/roslyn,shyamnamboodiripad/roslyn,Giten2004/roslyn,amcasey/roslyn,jbhensley/roslyn,AnthonyDGreen/roslyn,leppie/roslyn,VShangxiao/roslyn,khellang/roslyn,jhendrixMSFT/roslyn,DustinCampbell/roslyn,GuilhermeSa/roslyn,stebet/roslyn,tmeschter/roslyn,OmniSharp/roslyn,mattwar/roslyn,danielcweber/roslyn,agocke/roslyn,grianggrai/roslyn,AnthonyDGreen/roslyn,wvdd007/roslyn,shyamnamboodiripad/roslyn,eriawan/roslyn,jamesqo/roslyn,Giftednewt/roslyn,CyrusNajmabadi/roslyn,antiufo/roslyn,v-codeel/roslyn,3F/roslyn,KiloBravoLima/roslyn,ahmedshuhel/roslyn,v-codeel/roslyn,grianggrai/roslyn,yjfxfjch/roslyn,mattwar/roslyn,kuhlenh/roslyn,physhi/roslyn,MattWindsor91/roslyn,ValentinRueda/roslyn,YOTOV-LIMITED/roslyn,heejaechang/roslyn,xasx/roslyn,devharis/roslyn,poizan42/roslyn,kuhlenh/roslyn,3F/roslyn,tmeschter/roslyn,nagyistoce/roslyn,OmarTawfik/roslyn,mseamari/Stuff,CyrusNajmabadi/roslyn,MattWindsor91/roslyn,nemec/roslyn,moozzyk/roslyn,paulvanbrenk/roslyn,VPashkov/roslyn,DustinCampbell/roslyn,Maxwe11/roslyn,jkotas/roslyn,HellBrick/roslyn,stebet/roslyn,lorcanmooney/roslyn,Inverness/roslyn,vslsnap/roslyn,KiloBravoLima/roslyn,xoofx/roslyn,jrharmon/roslyn,robinsedlaczek/roslyn,natgla/roslyn,magicbing/roslyn,jrharmon/roslyn,ahmedshuhel/roslyn,MattWindsor91/roslyn,sharwell/roslyn,EricArndt/roslyn,FICTURE7/roslyn,xasx/roslyn,bkoelman/roslyn,Hosch250/roslyn,VPashkov/roslyn,leppie/roslyn,antonssonj/roslyn,jbhensley/roslyn,antiufo/roslyn,jeffanders/roslyn,ilyes14/roslyn,MihaMarkic/roslyn-prank,diryboy/roslyn,zmaruo/roslyn,tannergooding/roslyn,aelij/roslyn,VSadov/roslyn,jcouv/roslyn,Inverness/roslyn,jeremymeng/roslyn,ilyes14/roslyn,orthoxerox/roslyn,agocke/roslyn,Inverness/roslyn,v-codeel/roslyn,REALTOBIZ/roslyn,AArnott/roslyn,physhi/roslyn,MichalStrehovsky/roslyn,FICTURE7/roslyn,jeffanders/roslyn,mgoertz-msft/roslyn,panopticoncentral/roslyn,stephentoub/roslyn,RipCurrent/roslyn,aanshibudhiraja/Roslyn,jeremymeng/roslyn,jasonmalinowski/roslyn,aanshibudhiraja/Roslyn,stephentoub/roslyn,grianggrai/roslyn,dotnet/roslyn,brettfo/roslyn,yeaicc/roslyn,thomaslevesque/roslyn,AArnott/roslyn,Pvlerick/roslyn,mseamari/Stuff,genlu/roslyn,AmadeusW/roslyn,zooba/roslyn,khyperia/roslyn,natidea/roslyn,a-ctor/roslyn,VitalyTVA/roslyn,gafter/roslyn,Shiney/roslyn,FICTURE7/roslyn,EricArndt/roslyn,MihaMarkic/roslyn-prank,poizan42/roslyn,swaroop-sridhar/roslyn,mavasani/roslyn,bartdesmet/roslyn,VSadov/roslyn,MatthieuMEZIL/roslyn,tsdl2013/roslyn,basoundr/roslyn,dotnet/roslyn,GuilhermeSa/roslyn,jroggeman/roslyn,jaredpar/roslyn,sharadagrawal/Roslyn,ericfe-ms/roslyn,Pvlerick/roslyn,zmaruo/roslyn,cston/roslyn,doconnell565/roslyn,Giftednewt/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,Pvlerick/roslyn,tang7526/roslyn,nemec/roslyn,REALTOBIZ/roslyn,AlekseyTs/roslyn,hanu412/roslyn,jaredpar/roslyn,tvand7093/roslyn,weltkante/roslyn,CyrusNajmabadi/roslyn,ErikSchierboom/roslyn,gafter/roslyn,Giten2004/roslyn,amcasey/roslyn,michalhosala/roslyn,jeremymeng/roslyn,jroggeman/roslyn,rchande/roslyn,mattwar/roslyn,jmarolf/roslyn,VShangxiao/roslyn,a-ctor/roslyn,vslsnap/roslyn,stephentoub/roslyn,sharadagrawal/Roslyn,VitalyTVA/roslyn,mirhagk/roslyn,tvand7093/roslyn,tang7526/roslyn,lisong521/roslyn,tvand7093/roslyn,sharwell/roslyn,wvdd007/roslyn,KevinH-MS/roslyn,VSadov/roslyn,pdelvo/roslyn,vcsjones/roslyn,rgani/roslyn,KamalRathnayake/roslyn,sharwell/roslyn,YOTOV-LIMITED/roslyn,OmniSharp/roslyn,VPashkov/roslyn,KevinRansom/roslyn,cston/roslyn,danielcweber/roslyn,mmitche/roslyn,huoxudong125/roslyn,SeriaWei/roslyn,taylorjonl/roslyn,nguerrera/roslyn,mmitche/roslyn,dovzhikova/roslyn,drognanar/roslyn,droyad/roslyn,weltkante/roslyn,AlekseyTs/roslyn,michalhosala/roslyn,jmarolf/roslyn,akrisiun/roslyn,jmarolf/roslyn,khyperia/roslyn,nemec/roslyn,SeriaWei/roslyn,swaroop-sridhar/roslyn,dpoeschl/roslyn,nagyistoce/roslyn,ljw1004/roslyn,poizan42/roslyn,akrisiun/roslyn,panopticoncentral/roslyn,eriawan/roslyn,paulvanbrenk/roslyn,AmadeusW/roslyn,jhendrixMSFT/roslyn,oberxon/roslyn,devharis/roslyn,lisong521/roslyn,bkoelman/roslyn,yeaicc/roslyn,bartdesmet/roslyn,kienct89/roslyn,krishnarajbb/roslyn,VShangxiao/roslyn,thomaslevesque/roslyn,BugraC/roslyn,droyad/roslyn,VitalyTVA/roslyn,vcsjones/roslyn,mavasani/roslyn,tang7526/roslyn,tsdl2013/roslyn,lorcanmooney/roslyn,abock/roslyn,budcribar/roslyn,CaptainHayashi/roslyn,dovzhikova/roslyn,cston/roslyn,TyOverby/roslyn,physhi/roslyn,russpowers/roslyn,3F/roslyn,KevinRansom/roslyn,russpowers/roslyn
src/Tools/Source/DebuggerVisualizers/IL/ILDebuggerVisualizer.cs
src/Tools/Source/DebuggerVisualizers/IL/ILDebuggerVisualizer.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.Diagnostics; using System.Text; using Microsoft.CodeAnalysis.EditAndContinue; using Microsoft.VisualStudio.DebuggerVisualizers; using Roslyn.DebuggerVisualizers; using Roslyn.DebuggerVisualizers.UI; using Roslyn.Test.MetadataUtilities; [assembly: DebuggerVisualizer(typeof(ILDebuggerVisualizer), Target = typeof(ILDelta), Description = "IL Visualizer")] namespace Roslyn.DebuggerVisualizers { public sealed class ILDebuggerVisualizer : DialogDebuggerVisualizer { protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { StringBuilder sb = new StringBuilder(); var ilBytes = ((ILDelta)objectProvider.GetObject()).Value; var viewer = new TextViewer(ImmutableArray.Create(ilBytes).GetMethodIL(), "IL"); viewer.ShowDialog(); } } }
// 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.Diagnostics; using System.Text; using Microsoft.CodeAnalysis.EditAndContinue; using Microsoft.VisualStudio.DebuggerVisualizers; using Roslyn.DebuggerVisualizers; using Roslyn.DebuggerVisualizers.UI; using Roslyn.Test.MetadataUtilities; [assembly: DebuggerVisualizer(typeof(ILDebuggerVisualizer), Target = typeof(ILDelta), Description = "IL Visualizer")] namespace Roslyn.DebuggerVisualizers { public sealed class ILDebuggerVisualizer : DialogDebuggerVisualizer { protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { StringBuilder sb = new StringBuilder(); var ilBytes = ((ILDelta)objectProvider.GetObject()).Value; var viewer = new TextViewer(ilBytes.GetMethodIL(), "IL"); viewer.ShowDialog(); } } }
mit
C#
78028c21f2e6933d74a5a1ac716259a0f02d5ade
Remove and sort usings
CyrusNajmabadi/roslyn,dotnet/roslyn,mavasani/roslyn,mavasani/roslyn,mavasani/roslyn,dotnet/roslyn,shyamnamboodiripad/roslyn,shyamnamboodiripad/roslyn,CyrusNajmabadi/roslyn,shyamnamboodiripad/roslyn,dotnet/roslyn,CyrusNajmabadi/roslyn
src/EditorFeatures/Core/Options/IsRoslynPackageLoadedOption.cs
src/EditorFeatures/Core/Options/IsRoslynPackageLoadedOption.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.ComponentModel.Composition; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Utilities; using Microsoft.VisualStudio.Utilities.BaseUtility; namespace Microsoft.CodeAnalysis.Options; /// <summary> /// Editor option to indicate if the RoslynPackage is loaded/unloaded. /// This is done to support DeferCreationAttribute of Editor extensions that should be /// defer created only after Roslyn package has been loaded. /// See https://github.com/dotnet/roslyn/issues/62877#issuecomment-1271493105 for more details. /// </summary> [Export(typeof(EditorOptionDefinition))] [Name(OptionName)] [DefaultEditorOptionValue(false)] internal sealed class IsRoslynPackageLoadedOption : EditorOptionDefinition<bool> { private static readonly EditorOptionKey<bool> s_optionKey = new(OptionName); public const string OptionName = nameof(IsRoslynPackageLoadedOption); [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public IsRoslynPackageLoadedOption() { } public override bool Default => false; public override EditorOptionKey<bool> Key => s_optionKey; }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Utilities.BaseUtility; using Microsoft.VisualStudio.Utilities; using System.ComponentModel.Composition; using System; using Microsoft.CodeAnalysis.Host.Mef; namespace Microsoft.CodeAnalysis.Options; /// <summary> /// Editor option to indicate if the RoslynPackage is loaded/unloaded. /// This is done to support DeferCreationAttribute of Editor extensions that should be /// defer created only after Roslyn package has been loaded. /// See https://github.com/dotnet/roslyn/issues/62877#issuecomment-1271493105 for more details. /// </summary> [Export(typeof(EditorOptionDefinition))] [Name(OptionName)] [DefaultEditorOptionValue(false)] internal sealed class IsRoslynPackageLoadedOption : EditorOptionDefinition<bool> { private static readonly EditorOptionKey<bool> s_optionKey = new(OptionName); public const string OptionName = nameof(IsRoslynPackageLoadedOption); [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public IsRoslynPackageLoadedOption() { } public override bool Default => false; public override EditorOptionKey<bool> Key => s_optionKey; }
mit
C#
a525bf61d9961abc4c3ad5174c8b8a1086b6cf37
fix #1105 add default and ignore_missing to timestamp mappings
TheFireCookie/elasticsearch-net,junlapong/elasticsearch-net,UdiBen/elasticsearch-net,joehmchan/elasticsearch-net,wawrzyn/elasticsearch-net,junlapong/elasticsearch-net,CSGOpenSource/elasticsearch-net,robertlyson/elasticsearch-net,gayancc/elasticsearch-net,jonyadamit/elasticsearch-net,tkirill/elasticsearch-net,RossLieberman/NEST,adam-mccoy/elasticsearch-net,geofeedia/elasticsearch-net,DavidSSL/elasticsearch-net,UdiBen/elasticsearch-net,gayancc/elasticsearch-net,cstlaurent/elasticsearch-net,cstlaurent/elasticsearch-net,KodrAus/elasticsearch-net,tkirill/elasticsearch-net,TheFireCookie/elasticsearch-net,cstlaurent/elasticsearch-net,TheFireCookie/elasticsearch-net,mac2000/elasticsearch-net,mac2000/elasticsearch-net,robertlyson/elasticsearch-net,abibell/elasticsearch-net,robertlyson/elasticsearch-net,elastic/elasticsearch-net,ststeiger/elasticsearch-net,faisal00813/elasticsearch-net,robrich/elasticsearch-net,abibell/elasticsearch-net,starckgates/elasticsearch-net,DavidSSL/elasticsearch-net,azubanov/elasticsearch-net,KodrAus/elasticsearch-net,jonyadamit/elasticsearch-net,starckgates/elasticsearch-net,LeoYao/elasticsearch-net,geofeedia/elasticsearch-net,azubanov/elasticsearch-net,starckgates/elasticsearch-net,RossLieberman/NEST,SeanKilleen/elasticsearch-net,azubanov/elasticsearch-net,tkirill/elasticsearch-net,joehmchan/elasticsearch-net,SeanKilleen/elasticsearch-net,KodrAus/elasticsearch-net,robrich/elasticsearch-net,ststeiger/elasticsearch-net,LeoYao/elasticsearch-net,joehmchan/elasticsearch-net,SeanKilleen/elasticsearch-net,junlapong/elasticsearch-net,geofeedia/elasticsearch-net,adam-mccoy/elasticsearch-net,CSGOpenSource/elasticsearch-net,CSGOpenSource/elasticsearch-net,elastic/elasticsearch-net,wawrzyn/elasticsearch-net,DavidSSL/elasticsearch-net,abibell/elasticsearch-net,UdiBen/elasticsearch-net,ststeiger/elasticsearch-net,faisal00813/elasticsearch-net,RossLieberman/NEST,faisal00813/elasticsearch-net,LeoYao/elasticsearch-net,robrich/elasticsearch-net,wawrzyn/elasticsearch-net,mac2000/elasticsearch-net,jonyadamit/elasticsearch-net,adam-mccoy/elasticsearch-net,gayancc/elasticsearch-net
src/Nest/Domain/Mapping/SpecialFields/TimestampFieldMapping.cs
src/Nest/Domain/Mapping/SpecialFields/TimestampFieldMapping.cs
using System; using Newtonsoft.Json; using System.Linq.Expressions; using Nest.Resolvers.Converters; namespace Nest { [JsonConverter(typeof(ReadAsTypeConverter<TimestampFieldMapping>))] public interface ITimestampFieldMapping : ISpecialField { [JsonProperty("enabled")] bool Enabled { get; set; } [JsonProperty("path")] PropertyPathMarker Path { get; set; } [JsonProperty("format")] string Format { get; set; } [JsonProperty("default")] string Default { get; set; } [JsonProperty("ignore_missing")] bool? IgnoreMissing { get; set; } } public class TimestampFieldMapping : ITimestampFieldMapping { public bool Enabled { get; set; } public PropertyPathMarker Path { get; set; } public string Format { get; set; } public string Default { get; set; } public bool? IgnoreMissing { get; set; } } public class TimestampFieldMappingDescriptor<T> : ITimestampFieldMapping { private ITimestampFieldMapping Self { get { return this; } } bool ITimestampFieldMapping.Enabled { get; set;} PropertyPathMarker ITimestampFieldMapping.Path { get; set;} string ITimestampFieldMapping.Format { get; set; } string ITimestampFieldMapping.Default { get; set; } bool? ITimestampFieldMapping.IgnoreMissing { get; set; } public TimestampFieldMappingDescriptor<T> Enabled(bool enabled = true) { Self.Enabled = enabled; return this; } public TimestampFieldMappingDescriptor<T> Path(string path) { Self.Path = path; return this; } public TimestampFieldMappingDescriptor<T> Path(Expression<Func<T, object>> objectPath) { objectPath.ThrowIfNull("objectPath"); Self.Path = objectPath; return this; } public TimestampFieldMappingDescriptor<T> Format(string format) { Self.Format = format; return this; } public TimestampFieldMappingDescriptor<T> Default(string defaultValue) { Self.Default = defaultValue; return this; } public TimestampFieldMappingDescriptor<T> IgnoreMissing(bool ignoreMissing = true) { Self.IgnoreMissing = ignoreMissing; return this; } } }
using System; using Newtonsoft.Json; using System.Linq.Expressions; using Nest.Resolvers.Converters; namespace Nest { [JsonConverter(typeof(ReadAsTypeConverter<TimestampFieldMapping>))] public interface ITimestampFieldMapping : ISpecialField { [JsonProperty("enabled")] bool Enabled { get; set; } [JsonProperty("path")] PropertyPathMarker Path { get; set; } [JsonProperty("format")] string Format { get; set; } } public class TimestampFieldMapping : ITimestampFieldMapping { public bool Enabled { get; set; } public PropertyPathMarker Path { get; set; } public string Format { get; set; } } public class TimestampFieldMappingDescriptor<T> : ITimestampFieldMapping { private ITimestampFieldMapping Self { get { return this; } } bool ITimestampFieldMapping.Enabled { get; set;} PropertyPathMarker ITimestampFieldMapping.Path { get; set;} string ITimestampFieldMapping.Format { get; set; } public TimestampFieldMappingDescriptor<T> Enabled(bool enabled = true) { Self.Enabled = enabled; return this; } public TimestampFieldMappingDescriptor<T> Path(string path) { Self.Path = path; return this; } public TimestampFieldMappingDescriptor<T> Path(Expression<Func<T, object>> objectPath) { objectPath.ThrowIfNull("objectPath"); Self.Path = objectPath; return this; } public TimestampFieldMappingDescriptor<T> Format(string format) { Self.Format = format; return this; } } }
apache-2.0
C#
ac86a64e0a57662abff33112d2f2d22597e0faf8
fix for possible null ref exception
OfficeDev/PnP-Sites-Core,OfficeDev/PnP-Sites-Core,OfficeDev/PnP-Sites-Core
Core/OfficeDevPnP.Core/Framework/Provisioning/Providers/Xml/Resolvers/V201801/AppCatalogFromModelToSchemaTypeResolver.cs
Core/OfficeDevPnP.Core/Framework/Provisioning/Providers/Xml/Resolvers/V201801/AppCatalogFromModelToSchemaTypeResolver.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml; using System.Xml.Linq; namespace OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.Resolvers.V201801 { internal class AppCatalogFromModelToSchemaTypeResolver : ITypeResolver { public string Name => this.GetType().Name; public bool CustomCollectionResolver => false; public AppCatalogFromModelToSchemaTypeResolver() { } public object Resolve(object source, Dictionary<String, IResolver> resolvers = null, Boolean recursive = false) { Object result = null; // Try with the tenant-wide AppCatalog var tenant = source as Model.ProvisioningTenant; var appCatalog = tenant?.AppCatalog; if (null == appCatalog) { // If that one is missing, let's try with the local Site Collection App Catalog var alm = source as Model.ApplicationLifecycleManagement; appCatalog = alm?.AppCatalog; } if (null != appCatalog) { var appCatalogPackageTypeName = $"{PnPSerializationScope.Current?.BaseSchemaNamespace}.AppCatalogPackage, {PnPSerializationScope.Current?.BaseSchemaAssemblyName}"; var appCatalogPackageType = Type.GetType(appCatalogPackageTypeName, true); resolvers = new Dictionary<string, IResolver>(); resolvers.Add($"{appCatalogPackageType}.SkipFeatureDeploymentSpecified", new ExpressionValueResolver(() => true)); var resolver = new CollectionFromModelToSchemaTypeResolver(appCatalogPackageType); result = resolver.Resolve(appCatalog.Packages, resolvers, true); } return (result); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml; using System.Xml.Linq; namespace OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.Resolvers.V201801 { internal class AppCatalogFromModelToSchemaTypeResolver : ITypeResolver { public string Name => this.GetType().Name; public bool CustomCollectionResolver => false; public AppCatalogFromModelToSchemaTypeResolver() { } public object Resolve(object source, Dictionary<String, IResolver> resolvers = null, Boolean recursive = false) { Object result = null; // Try with the tenant-wide AppCatalog var tenant = source as Model.ProvisioningTenant; var appCatalog = tenant?.AppCatalog; if (null == appCatalog) { // If that one is missing, let's try with the local Site Collection App Catalog var alm = source as Model.ApplicationLifecycleManagement; appCatalog = alm.AppCatalog; } if (null != appCatalog) { var appCatalogPackageTypeName = $"{PnPSerializationScope.Current?.BaseSchemaNamespace}.AppCatalogPackage, {PnPSerializationScope.Current?.BaseSchemaAssemblyName}"; var appCatalogPackageType = Type.GetType(appCatalogPackageTypeName, true); resolvers = new Dictionary<string, IResolver>(); resolvers.Add($"{appCatalogPackageType}.SkipFeatureDeploymentSpecified", new ExpressionValueResolver(() => true)); var resolver = new CollectionFromModelToSchemaTypeResolver(appCatalogPackageType); result = resolver.Resolve(appCatalog.Packages, resolvers, true); } return (result); } } }
mit
C#
b457b41e379673a5e073a7336b876d67ca8c2c69
Add assembly resolution failure logging to PowerShell console host
mrward/monodevelop-nuget-extensions,mrward/monodevelop-nuget-extensions
src/MonoDevelop.PackageManagement.PowerShell.ConsoleHost/MonoDevelop.PackageManagement.PowerShell.ConsoleHost/Program.cs
src/MonoDevelop.PackageManagement.PowerShell.ConsoleHost/MonoDevelop.PackageManagement.PowerShell.ConsoleHost/Program.cs
// // Program.cs // // Author: // Matt Ward <matt.ward@microsoft.com> // // Copyright (c) 2019 Microsoft // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Linq; using System.Reflection; using System.Runtime.Loader; namespace MonoDevelop.PackageManagement.PowerShell.ConsoleHost { class Program { static int Main (string[] args) { try { InitializeLogger (args); AssemblyLoadContext.Default.Resolving += AssemblyLoadContextResolving; var host = new PowerShellConsoleHost (); host.Run (); return 0; } catch (Exception ex) { Logger.Log ("Startup failed. {0}", ex); return -1; } } static Assembly AssemblyLoadContextResolving (AssemblyLoadContext context, AssemblyName assemblyName) { Logger.Log ("Assembly resolve: {0}", assemblyName); return null; } static void InitializeLogger (string[] args) { string logDirectory = args.FirstOrDefault () ?? string.Empty; Logger.Initialize (logDirectory); } } }
// // Program.cs // // Author: // Matt Ward <matt.ward@microsoft.com> // // Copyright (c) 2019 Microsoft // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Linq; namespace MonoDevelop.PackageManagement.PowerShell.ConsoleHost { class Program { static int Main (string[] args) { try { InitializeLogger (args); var host = new PowerShellConsoleHost (); host.Run (); return 0; } catch (Exception ex) { Logger.Log ("Startup failed. {0}", ex); return -1; } } static void InitializeLogger (string[] args) { string logDirectory = args.FirstOrDefault () ?? string.Empty; Logger.Initialize (logDirectory); } } }
mit
C#
26cbb279f580a36920569d272c2fe65deb9760a5
rename method
RyotaMurohoshi/unity_snippets
experimental_2d/Assets/Scripts/Editor/TileMapConvertor.cs
experimental_2d/Assets/Scripts/Editor/TileMapConvertor.cs
using UnityEngine; using UnityEngine.Tilemaps; using UnityEditor; public class TilemapConvertor { [MenuItem("Assets/Convert TileMap to Sprites")] public static void Convert() { foreach (var grid in GameObject.FindObjectsOfType<Grid>()) { foreach (var tilemap in grid.GetComponentsInChildren<Tilemap>()) { CreateTilemap(tilemap); } } } static void CreateTilemap(Tilemap tilemap) { var spritePrefab = Resources.Load<SpriteRenderer>("TileSpriteRenderer"); var parent = new GameObject("TileParent").transform; var tilemapRotation = tilemap.orientationMatrix.rotation; var tileAnchor = tilemap.orientationMatrix.MultiplyPoint(tilemap.tileAnchor); foreach (var position in tilemap.cellBounds.allPositionsWithin) { if (tilemap.HasTile(position)) { var matrix = tilemap.orientationMatrix * tilemap.GetTransformMatrix(position); var localPosition = tilemap.CellToWorld(position) + tileAnchor; var spriteRenderer = GameObject.Instantiate( spritePrefab, localPosition, matrix.rotation, parent); spriteRenderer.transform.localScale = matrix.scale; spriteRenderer.name = position.ToString(); spriteRenderer.sprite = tilemap.GetSprite(position); } } } }
using UnityEngine; using UnityEngine.Tilemaps; using UnityEditor; public class TilemapConvertor { [MenuItem("Assets/Convert TileMap to Sprites")] public static void Convert() { foreach (var grid in GameObject.FindObjectsOfType<Grid>()) { foreach (var tilemap in grid.GetComponentsInChildren<Tilemap>()) { Update(tilemap); } } } static void Update(Tilemap tilemap) { var spritePrefab = Resources.Load<SpriteRenderer>("TileSpriteRenderer"); var parent = new GameObject("TileParent").transform; var tilemapRotation = tilemap.orientationMatrix.rotation; var tileAnchor = tilemap.orientationMatrix.MultiplyPoint(tilemap.tileAnchor); foreach (var position in tilemap.cellBounds.allPositionsWithin) { if (tilemap.HasTile(position)) { var matrix = tilemap.orientationMatrix * tilemap.GetTransformMatrix(position); var localPosition = tilemap.CellToWorld(position) + tileAnchor; var spriteRenderer = GameObject.Instantiate( spritePrefab, localPosition, matrix.rotation, parent); spriteRenderer.transform.localScale = matrix.scale; spriteRenderer.name = position.ToString(); spriteRenderer.sprite = tilemap.GetSprite(position); } } } }
mit
C#
2d33262d8938f4808d7cfb2ae449c2601df7f476
add tests for exception event emitting custom properties when toStringDictionary is called
eShopWorld/devopsflex-core
src/Tests/Eshopworld.Core.Tests/ExceptionEventTest.cs
src/Tests/Eshopworld.Core.Tests/ExceptionEventTest.cs
using System; using System.Globalization; using System.Net; using Eshopworld.Core; using Eshopworld.Tests.Core; using FluentAssertions; using Newtonsoft.Json; using Xunit; // ReSharper disable once CheckNamespace public class ExceptionEventTest { [Fact, IsUnit] public void Ensure_ExceptionIsntSerialized() { var json = JsonConvert.SerializeObject(new ExceptionEvent(new Exception())); var poco = JsonConvert.DeserializeObject<ExceptionEvent>(json); poco.Exception.Should().BeNull(); } public class ToBbEvent { [Fact, IsUnit] public void Test_BbEventPopulate() { const string exceptionMessage = "KABUM!!!"; var exception = new Exception(exceptionMessage); var bbEvent = exception.ToExceptionEvent(); bbEvent.Exception.Message.Should().Be(exceptionMessage); } [Fact, IsUnit] public void Test_ExceptionCustomProperties() { var exc = new CustomTestException {CustomByte = 123, CustomEnum = HttpStatusCode.Accepted, CustomString = "blah"}; var bbEvent = exc.ToExceptionEvent(); var dict = bbEvent.ToStringDictionary(); dict[nameof(CustomTestException.CustomString)].Should().Be("blah"); dict[nameof(CustomTestException.CustomByte)].Should().Be(123.ToString()); dict[nameof(CustomTestException.CustomEnum)].Should() .Be(((int) HttpStatusCode.Accepted).ToString()); dict.ContainsKey(nameof(AnonymousTelemetryEvent.CallerMemberName)).Should().BeTrue(); dict.ContainsKey(nameof(AnonymousTelemetryEvent.CallerFilePath)).Should().BeTrue(); dict.ContainsKey(nameof(AnonymousTelemetryEvent.CallerLineNumber)).Should().BeTrue(); } public class CustomTestException : Exception { public string CustomString { get; set; } public byte CustomByte { get; set; } public HttpStatusCode CustomEnum { get; set; } } } }
using System; using Eshopworld.Core; using Eshopworld.Tests.Core; using FluentAssertions; using Newtonsoft.Json; using Xunit; // ReSharper disable once CheckNamespace public class ExceptionEventTest { [Fact, IsUnit] public void Ensure_ExceptionIsntSerialized() { var json = JsonConvert.SerializeObject(new ExceptionEvent(new Exception())); var poco = JsonConvert.DeserializeObject<ExceptionEvent>(json); poco.Exception.Should().BeNull(); } public class ToBbEvent { [Fact, IsUnit] public void Test_BbEventPopulate() { const string exceptionMessage = "KABUM!!!"; var exception = new Exception(exceptionMessage); var bbEvent = exception.ToExceptionEvent(); bbEvent.Exception.Message.Should().Be(exceptionMessage); } } }
mit
C#
a27974785cac927241546e2502e6ac2d2eb562dc
make a generic extension for table providers
northwoodspd/UIA.Extensions,northwoodspd/UIA.Extensions
src/UIA.Extensions/Extensions/AutomationExtensions.cs
src/UIA.Extensions/Extensions/AutomationExtensions.cs
using System; using System.Windows.Forms; using UIA.Extensions.AutomationProviders; using UIA.Extensions.AutomationProviders.Defaults.Tables; using UIA.Extensions.AutomationProviders.Tables; namespace UIA.Extensions.Extensions { public static class AutomationExtensions { public static AutomationConfigurer ExposeAutomation(this Control control) { return new AutomationConfigurer(control); } public static AutomationConfigurer AsValueControl(this Control control, Func<string> getter, Action<string> setter) { return new AutomationConfigurer(control, new ValueProvider(control, getter, setter)); } public static AutomationConfigurer AsTable(this DataGridView control) { return control.AsTable<DataGridTableInformation>(); } public static AutomationConfigurer AsTable<T>(this Control control) where T : TableInformation { var provider = (T)Activator.CreateInstance(typeof (T), control); return new AutomationConfigurer(control, new TableProvider(provider)); } } }
using System; using System.Windows.Forms; using UIA.Extensions.AutomationProviders; using UIA.Extensions.AutomationProviders.Defaults.Tables; using UIA.Extensions.AutomationProviders.Tables; namespace UIA.Extensions.Extensions { public static class AutomationExtensions { public static AutomationConfigurer ExposeAutomation(this Control control) { return new AutomationConfigurer(control); } public static AutomationConfigurer AsValueControl(this Control control, Func<string> getter, Action<string> setter) { return new AutomationConfigurer(control, new ValueProvider(control, getter, setter)); } public static AutomationConfigurer AsTable(this DataGridView dataGridView) { return new AutomationConfigurer(dataGridView, new TableProvider(new DataGridTableInformation(dataGridView))); } } }
mit
C#
69ce7fda0eac74d8bd52aca0d2f40b60a126e33b
Add test coverage of double disposal crashing
smoogipooo/osu-framework,ppy/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,ppy/osu-framework,ppy/osu-framework,ZLima12/osu-framework,ZLima12/osu-framework,peppy/osu-framework
osu.Framework.Tests/Threading/ThreadedTaskSchedulerTest.cs
osu.Framework.Tests/Threading/ThreadedTaskSchedulerTest.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Threading; using System.Threading.Tasks; using NUnit.Framework; using osu.Framework.Threading; namespace osu.Framework.Tests.Threading { [TestFixture] public class ThreadedTaskSchedulerTest { /// <summary> /// On disposal, <see cref="ThreadedTaskScheduler"/> does a blocking shutdown sequence. /// This asserts all outstanding tasks are run before the shutdown completes. /// </summary> [Test] public void EnsureThreadedTaskSchedulerProcessesBeforeDispose() { int runCount = 0; const int target_count = 128; using var taskScheduler = new ThreadedTaskScheduler(4, "test"); for (int i = 0; i < target_count; i++) { Task.Factory.StartNew(() => { Interlocked.Increment(ref runCount); Thread.Sleep(100); }, default, TaskCreationOptions.HideScheduler, taskScheduler); } taskScheduler.Dispose(); // test against double disposal crashes. taskScheduler.Dispose(); Assert.AreEqual(target_count, runCount); } [Test] public void EnsureEventualDisposalWithStuckTasks() { ManualResetEventSlim exited = new ManualResetEventSlim(); Task.Run(() => { using (var taskScheduler = new ThreadedTaskScheduler(4, "test")) { Task.Factory.StartNew(() => { while (!exited.IsSet) Thread.Sleep(100); }, default, TaskCreationOptions.HideScheduler, taskScheduler); } exited.Set(); }); Assert.That(exited.Wait(30000)); } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Threading; using System.Threading.Tasks; using NUnit.Framework; using osu.Framework.Threading; namespace osu.Framework.Tests.Threading { [TestFixture] public class ThreadedTaskSchedulerTest { /// <summary> /// On disposal, <see cref="ThreadedTaskScheduler"/> does a blocking shutdown sequence. /// This asserts all outstanding tasks are run before the shutdown completes. /// </summary> [Test] public void EnsureThreadedTaskSchedulerProcessesBeforeDispose() { int runCount = 0; const int target_count = 128; using (var taskScheduler = new ThreadedTaskScheduler(4, "test")) { for (int i = 0; i < target_count; i++) { Task.Factory.StartNew(() => { Interlocked.Increment(ref runCount); Thread.Sleep(100); }, default, TaskCreationOptions.HideScheduler, taskScheduler); } } Assert.AreEqual(target_count, runCount); } [Test] public void EnsureEventualDisposalWithStuckTasks() { ManualResetEventSlim exited = new ManualResetEventSlim(); Task.Run(() => { using (var taskScheduler = new ThreadedTaskScheduler(4, "test")) { Task.Factory.StartNew(() => { while (!exited.IsSet) Thread.Sleep(100); }, default, TaskCreationOptions.HideScheduler, taskScheduler); } exited.Set(); }); Assert.That(exited.Wait(30000)); } } }
mit
C#
dcc4a75094353c3f002e61f6fe20a4e04e32b469
Improve help texts for CLI file generation
arkivverket/arkade5,arkivverket/arkade5,arkivverket/arkade5
src/Arkivverket.Arkade.CLI/Options/GenerateOptions.cs
src/Arkivverket.Arkade.CLI/Options/GenerateOptions.cs
using System.Collections.Generic; using CommandLine; using CommandLine.Text; namespace Arkivverket.Arkade.CLI.Options { [Verb("generate", HelpText = "Generate a specified file. Run this command followed by '--help' for more detailed info.")] public class GenerateOptions : OutputOptions { [Option('m', "metadata-example", Group = "file-type", HelpText = "Generate a metadata example file.")] public bool GenerateMetadataExampleFile { get; set; } [Option('s', "noark5-test-selection", Group = "file-type", HelpText = "Generate a Noark 5 test selection file.")] public bool GenerateNoark5TestSelectionFile { get; set; } [Usage(ApplicationAlias = "arkade")] public static IEnumerable<Example> Examples { get { yield return new Example("Generate a metadata example file", new GenerateOptions { OutputDirectory = "outputDirectory", GenerateMetadataExampleFile = true }); yield return new Example("Generate a Noark 5 test selection file", new GenerateOptions { OutputDirectory = "outputDirectory", GenerateNoark5TestSelectionFile = true }); yield return new Example("Generate a metadata example file and a Noark 5 test selection file", new GenerateOptions { OutputDirectory = "outputDirectory", GenerateMetadataExampleFile = true, GenerateNoark5TestSelectionFile = true }); } } } }
using System.Collections.Generic; using CommandLine; using CommandLine.Text; namespace Arkivverket.Arkade.CLI.Options { [Verb("generate", HelpText = "Generate a specified file. Run this command followed by '--help' for more detailed info.")] public class GenerateOptions : OutputOptions { [Option('m', "metadata-example", Group = "file-type", HelpText = "Generate json file with example metadata.")] public bool GenerateMetadataExampleFile { get; set; } [Option('s', "noark5-test-selection", Group = "file-type", HelpText = "Generate text file with list of noark5 tests.")] public bool GenerateNoark5TestSelectionFile { get; set; } [Usage(ApplicationAlias = "arkade")] public static IEnumerable<Example> Examples { get { yield return new Example("Generate json file with metadata example", new GenerateOptions { OutputDirectory = "outputDirectory", GenerateMetadataExampleFile = true }); yield return new Example("Generate text file with list of noark5-test", new GenerateOptions { OutputDirectory = "outputDirectory", GenerateNoark5TestSelectionFile = true }); yield return new Example("Generate both files", new GenerateOptions { OutputDirectory = "outputDirectory", GenerateMetadataExampleFile = true, GenerateNoark5TestSelectionFile = true }); } } } }
agpl-3.0
C#
27d2bdb30965e1446a0683321be8e1f77fcdc78c
update httpModuleVersion to 0.0.6
mdsol/Medidata.ZipkinTracerModule
src/Medidata.ZipkinTracer.HttpModule/Properties/AssemblyInfo.cs
src/Medidata.ZipkinTracer.HttpModule/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("Medidata.ZipkinTracer.HttpModule")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Medidata Solutions Inc")] [assembly: AssemblyProduct("Medidata.ZipkinTracer.HttpModule")] [assembly: AssemblyCopyright("Copyright © Medidata Solutions Inc 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("fe98b064-b7d0-416e-a744-483acf6c0d5d")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.0.6")] [assembly: AssemblyFileVersion("0.0.6")] [assembly: AssemblyInformationalVersion("0.0.6")] [assembly: InternalsVisibleTo("Medidata.ZipkinTracer.HttpModule.Test")]
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("Medidata.ZipkinTracer.HttpModule")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Medidata Solutions Inc")] [assembly: AssemblyProduct("Medidata.ZipkinTracer.HttpModule")] [assembly: AssemblyCopyright("Copyright © Medidata Solutions Inc 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("fe98b064-b7d0-416e-a744-483acf6c0d5d")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.0.5")] [assembly: AssemblyFileVersion("0.0.5")] [assembly: AssemblyInformationalVersion("0.0.5")] [assembly: InternalsVisibleTo("Medidata.ZipkinTracer.HttpModule.Test")]
mit
C#
c81eb4b29c92949c6e023b25820940b211b08de0
Add doc
Krusen/ErgastApi.Net
src/ErgastiApi/Responses/Models/Standings/Standing.cs
src/ErgastiApi/Responses/Models/Standings/Standing.cs
namespace ErgastApi.Responses.Models.Standings { public abstract class Standing { public int Position { get; set; } /// <summary> /// Finishing position. /// R = Retired, D = Disqualified, E = Excluded, W = Withdrawn, F = Failed to qualify, N = Not classified. /// </summary> public string PositionText { get; set; } public int Points { get; set; } public int Wins { get; set; } } }
namespace ErgastApi.Responses.Models.Standings { public abstract class Standing { public int Position { get; set; } // TODO: Some of these values are not relevant for standings (if any) // TODO: Docu: equals Position or "R" retired, "D" disqualified, "E" excluded, "W" withdrawn, "F" failed to qualify, "N" not classified. See Status for more info public string PositionText { get; set; } public int Points { get; set; } public int Wins { get; set; } } }
unlicense
C#
05d9247eaca33dad7c19aa187411545243387965
Update Informational Version to 1.1.0-pre2
dansiegel/Prism.Plugin.Popups,dansiegel/Prism.Plugin.Popups
src/Prism.Plugin.Popups.Shared/AssemblyInfo-Shared.cs
src/Prism.Plugin.Popups.Shared/AssemblyInfo-Shared.cs
using System.Reflection; using System.Resources; [assembly: AssemblyCompany( "AvantiPoint, LLC" )] [assembly: AssemblyCopyright( "Copyright © Dan Siegel 2016" )] [assembly: NeutralResourcesLanguage( "en" )] [assembly: AssemblyVersion( "1.1.0.0" )] [assembly: AssemblyFileVersion( "1.1.0.0" )] [assembly: AssemblyInformationalVersion( "1.1.0-pre2" )]
using System.Reflection; using System.Resources; [assembly: AssemblyCompany( "AvantiPoint, LLC" )] [assembly: AssemblyCopyright( "Copyright © Dan Siegel 2016" )] [assembly: NeutralResourcesLanguage( "en" )] [assembly: AssemblyVersion( "1.1.0.0" )] [assembly: AssemblyFileVersion( "1.1.0.0" )] [assembly: AssemblyInformationalVersion( "1.1.0-pre1" )]
mit
C#
00d7da3e07c9c2792d02d5db48c94e6277e16ba7
Add explanation to ErrorRecordExtensions
PowerShell/PowerShellEditorServices
src/PowerShellEditorServices/Services/PowerShell/Utility/ErrorRecordExtensions.cs
src/PowerShellEditorServices/Services/PowerShell/Utility/ErrorRecordExtensions.cs
using Microsoft.PowerShell.EditorServices.Utility; using System; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Management.Automation; using System.Reflection; namespace Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility { internal static class ErrorRecordExtensions { private static Action<PSObject> s_setWriteStreamProperty = null; [SuppressMessage("Performance", "CA1810:Initialize reference type static fields inline", Justification = "cctor needed for version specific initialization")] static ErrorRecordExtensions() { if (VersionUtils.IsPS7OrGreater) { // Used to write ErrorRecords to the Error stream. Using Public and NonPublic because the plan is to make this property // public in 7.0.1 PropertyInfo writeStreamProperty = typeof(PSObject).GetProperty("WriteStream", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); Type writeStreamType = typeof(PSObject).Assembly.GetType("System.Management.Automation.WriteStreamType"); object errorStreamType = Enum.Parse(writeStreamType, "Error"); var errorObjectParameter = Expression.Parameter(typeof(PSObject)); // Generates a call like: // $errorPSObject.WriteStream = [System.Management.Automation.WriteStreamType]::Error // So that error record PSObjects will be rendered in the console properly s_setWriteStreamProperty = Expression.Lambda<Action<PSObject>>( Expression.Call( errorObjectParameter, writeStreamProperty.GetSetMethod(), Expression.Constant(errorStreamType)), errorObjectParameter) .Compile(); } } public static PSObject AsPSObject(this ErrorRecord errorRecord) { var errorObject = PSObject.AsPSObject(errorRecord); // Used to write ErrorRecords to the Error stream so they are rendered in the console correctly. if (s_setWriteStreamProperty != null) { s_setWriteStreamProperty(errorObject); } else { var note = new PSNoteProperty("writeErrorStream", true); errorObject.Properties.Add(note); } return errorObject; } } }
using Microsoft.PowerShell.EditorServices.Utility; using System; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Management.Automation; using System.Reflection; namespace Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility { internal static class ErrorRecordExtensions { private static Action<PSObject> s_setWriteStreamProperty = null; [SuppressMessage("Performance", "CA1810:Initialize reference type static fields inline", Justification = "cctor needed for version specific initialization")] static ErrorRecordExtensions() { if (VersionUtils.IsPS7OrGreater) { // Used to write ErrorRecords to the Error stream. Using Public and NonPublic because the plan is to make this property // public in 7.0.1 PropertyInfo writeStreamProperty = typeof(PSObject).GetProperty("WriteStream", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); Type writeStreamType = typeof(PSObject).Assembly.GetType("System.Management.Automation.WriteStreamType"); object errorStreamType = Enum.Parse(writeStreamType, "Error"); var errorObjectParameter = Expression.Parameter(typeof(PSObject)); s_setWriteStreamProperty = Expression.Lambda<Action<PSObject>>( Expression.Call( errorObjectParameter, writeStreamProperty.GetSetMethod(), Expression.Constant(errorStreamType)), errorObjectParameter) .Compile(); } } public static PSObject AsPSObject(this ErrorRecord errorRecord) { var errorObject = PSObject.AsPSObject(errorRecord); // Used to write ErrorRecords to the Error stream so they are rendered in the console correctly. if (s_setWriteStreamProperty != null) { s_setWriteStreamProperty(errorObject); } else { var note = new PSNoteProperty("writeErrorStream", true); errorObject.Properties.Add(note); } return errorObject; } } }
mit
C#
2d2e336d4342fe75067655b6bc9295f1aad0f7de
Fix - Corretta gestione di Rimozione stato di "In Lavorazione"
vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf
src/backend/SO115App.Models/Servizi/CQRS/Commands/GestioneSoccorso/GestioneIntervento/RimozioneInLavorazione/RimozioneInLavorazioneCommandHandler.cs
src/backend/SO115App.Models/Servizi/CQRS/Commands/GestioneSoccorso/GestioneIntervento/RimozioneInLavorazione/RimozioneInLavorazioneCommandHandler.cs
//----------------------------------------------------------------------- // <copyright file="AddInterventoCommandHandler.cs" company="CNVVF"> // Copyright (C) 2017 - CNVVF // // This file is part of SOVVF. // SOVVF is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // SOVVF is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see http://www.gnu.org/licenses/. // </copyright> //----------------------------------------------------------------------- using CQRS.Commands; using SO115App.API.Models.Servizi.Infrastruttura.GestioneSoccorso; using SO115App.Models.Classi.Soccorso; using SO115App.Models.Servizi.Infrastruttura.GestioneSoccorso; using SO115App.Models.Servizi.Infrastruttura.GestioneUtenti; namespace DomainModel.CQRS.Commands.RimozioneInLavorazione { public class RimozioneInLavorazioneCommandHandler : ICommandHandler<RimozioneInLavorazioneCommand> { private readonly IGetRichiestaById _getRichiestaById; private readonly IUpDateRichiestaAssistenza _updateRichiestaAssistenza; private readonly IGetUtenteById _getUtenteById; public RimozioneInLavorazioneCommandHandler( IGetRichiestaById getRichiestaById, IUpDateRichiestaAssistenza updateRichiestaAssistenza, IGetUtenteById getUtenteById ) { _getRichiestaById = getRichiestaById; _updateRichiestaAssistenza = updateRichiestaAssistenza; _getUtenteById = getUtenteById; } public void Handle(RimozioneInLavorazioneCommand command) { var richiesta = _getRichiestaById.GetById(command.IdRichiesta); var utente = _getUtenteById.GetUtenteByCodice(command.IdUtente); var attivita = new AttivitaUtente(); var nominativo = utente.Nome + "." + utente.Cognome; richiesta.UtInLavorazione.RemoveAll(x => x == nominativo); _updateRichiestaAssistenza.UpDate(richiesta); } } }
//----------------------------------------------------------------------- // <copyright file="AddInterventoCommandHandler.cs" company="CNVVF"> // Copyright (C) 2017 - CNVVF // // This file is part of SOVVF. // SOVVF is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // SOVVF is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see http://www.gnu.org/licenses/. // </copyright> //----------------------------------------------------------------------- using CQRS.Commands; using SO115App.API.Models.Servizi.Infrastruttura.GestioneSoccorso; using SO115App.Models.Classi.Soccorso; using SO115App.Models.Servizi.Infrastruttura.GestioneSoccorso; namespace DomainModel.CQRS.Commands.RimozioneInLavorazione { public class RimozioneInLavorazioneCommandHandler : ICommandHandler<RimozioneInLavorazioneCommand> { private readonly IGetRichiestaById _getRichiestaById; private readonly IUpDateRichiestaAssistenza _updateRichiestaAssistenza; public RimozioneInLavorazioneCommandHandler( IGetRichiestaById getRichiestaById, IUpDateRichiestaAssistenza updateRichiestaAssistenza ) { _getRichiestaById = getRichiestaById; _updateRichiestaAssistenza = updateRichiestaAssistenza; } public void Handle(RimozioneInLavorazioneCommand command) { var richiesta = _getRichiestaById.GetById(command.IdRichiesta); var attivita = new AttivitaUtente(); richiesta.UtInLavorazione.RemoveAll(x => x == command.IdUtente); //if (command.Chiamata.ListaUtentiInLavorazione != null) // command.Chiamata.ListaUtentiInLavorazione = richiesta.UtInLavorazione; //else //{ // if (richiesta.UtInLavorazione.Count > 0) // { // command.Chiamata.ListaUtentiInLavorazione = new List<AttivitaUtente>(); // command.Chiamata.ListaUtentiInLavorazione = richiesta.UtInLavorazione; // } //} _updateRichiestaAssistenza.UpDate(richiesta); } } }
agpl-3.0
C#
905b55aeaa02b33596b7f2ff4a82d9e034dde101
Simplify logic with System.Math
EgorBo/left-pad-net
left-pad/StringExtensions.cs
left-pad/StringExtensions.cs
using System; namespace left_pad { public static class StringExtensions { public static string LeftPad(this string str, char ch, int len) { if (len <= 0) throw new InvalidOperationException(); return new string(ch, Math.Max(len - str?.Length ?? 0, 0)) + str; } } }
using System; namespace left_pad { public static class StringExtensions { public static string LeftPad(this string str, char ch, int len) { if (len <= 0) throw new InvalidOperationException(); if (string.IsNullOrEmpty(str)) return new string(ch, len); var i = -1; len = len - str.Length; while (++i < len) { str = ch + str; } return str; } } }
mit
C#
81e640194200a6c595f1a9c5e7fe3bf313653a9f
fix #772 fix UnixDateTimeConverter to fixate the epoch in UTC
robertlyson/elasticsearch-net,RossLieberman/NEST,Grastveit/NEST,LeoYao/elasticsearch-net,CSGOpenSource/elasticsearch-net,ststeiger/elasticsearch-net,wawrzyn/elasticsearch-net,RossLieberman/NEST,TheFireCookie/elasticsearch-net,gayancc/elasticsearch-net,abibell/elasticsearch-net,tkirill/elasticsearch-net,azubanov/elasticsearch-net,KodrAus/elasticsearch-net,tkirill/elasticsearch-net,wawrzyn/elasticsearch-net,faisal00813/elasticsearch-net,geofeedia/elasticsearch-net,cstlaurent/elasticsearch-net,Grastveit/NEST,cstlaurent/elasticsearch-net,jonyadamit/elasticsearch-net,abibell/elasticsearch-net,amyzheng424/elasticsearch-net,robrich/elasticsearch-net,Grastveit/NEST,elastic/elasticsearch-net,azubanov/elasticsearch-net,abibell/elasticsearch-net,mac2000/elasticsearch-net,CSGOpenSource/elasticsearch-net,CSGOpenSource/elasticsearch-net,geofeedia/elasticsearch-net,TheFireCookie/elasticsearch-net,jonyadamit/elasticsearch-net,joehmchan/elasticsearch-net,azubanov/elasticsearch-net,robrich/elasticsearch-net,DavidSSL/elasticsearch-net,tkirill/elasticsearch-net,TheFireCookie/elasticsearch-net,junlapong/elasticsearch-net,wawrzyn/elasticsearch-net,geofeedia/elasticsearch-net,robertlyson/elasticsearch-net,ststeiger/elasticsearch-net,starckgates/elasticsearch-net,starckgates/elasticsearch-net,amyzheng424/elasticsearch-net,joehmchan/elasticsearch-net,starckgates/elasticsearch-net,LeoYao/elasticsearch-net,KodrAus/elasticsearch-net,mac2000/elasticsearch-net,cstlaurent/elasticsearch-net,DavidSSL/elasticsearch-net,SeanKilleen/elasticsearch-net,robertlyson/elasticsearch-net,adam-mccoy/elasticsearch-net,UdiBen/elasticsearch-net,junlapong/elasticsearch-net,RossLieberman/NEST,robrich/elasticsearch-net,SeanKilleen/elasticsearch-net,joehmchan/elasticsearch-net,LeoYao/elasticsearch-net,adam-mccoy/elasticsearch-net,SeanKilleen/elasticsearch-net,elastic/elasticsearch-net,faisal00813/elasticsearch-net,UdiBen/elasticsearch-net,mac2000/elasticsearch-net,ststeiger/elasticsearch-net,faisal00813/elasticsearch-net,adam-mccoy/elasticsearch-net,DavidSSL/elasticsearch-net,gayancc/elasticsearch-net,UdiBen/elasticsearch-net,jonyadamit/elasticsearch-net,amyzheng424/elasticsearch-net,gayancc/elasticsearch-net,junlapong/elasticsearch-net,KodrAus/elasticsearch-net
src/Nest/Resolvers/Converters/UnixDateTimeConverter.cs
src/Nest/Resolvers/Converters/UnixDateTimeConverter.cs
using System; using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace Nest.Resolvers.Converters { public class UnixDateTimeConverter : DateTimeConverterBase { private static readonly DateTime EpochUtc = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc) ; public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { long val; if (value is DateTime) { val = (long)((DateTime)value - EpochUtc).TotalMilliseconds; } else { throw new Exception("Expected date object value."); } writer.WriteValue(val); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { if (reader.TokenType != JsonToken.Integer) { throw new Exception("Wrong Token Type"); } var time = (long)reader.Value; return EpochUtc.AddMilliseconds(time); } } }
using System; using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace Nest.Resolvers.Converters { public class UnixDateTimeConverter : DateTimeConverterBase { private static readonly DateTime EpochUtc = new DateTime(1970, 1, 1); public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { long val; if (value is DateTime) { val = (long)((DateTime)value - EpochUtc).TotalMilliseconds; } else { throw new Exception("Expected date object value."); } writer.WriteValue(val); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { if (reader.TokenType != JsonToken.Integer) { throw new Exception("Wrong Token Type"); } var time = (long)reader.Value; return EpochUtc.AddMilliseconds(time); } } }
apache-2.0
C#
bd86649e658ccb0db1e053edbbafbdec0715dadc
change Invoke method to virtual
AspectCore/AspectCore-Framework,AspectCore/Abstractions,AspectCore/Lite,AspectCore/AspectCore-Framework
src/AspectCore.Lite.Abstractions/Descriptors/TargetDescriptor.cs
src/AspectCore.Lite.Abstractions/Descriptors/TargetDescriptor.cs
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; namespace AspectCore.Lite.Abstractions { public class TargetDescriptor { public object ImplementationInstance { get; } public MethodInfo ServiceMethod { get; } public MethodInfo ImplementationMethod { get; } public Type ServiceType { get; } public Type ImplementationType { get; } public TargetDescriptor(object implementationInstance, MethodInfo serviceMethod, Type serviceType, MethodInfo implementationMethod, Type implementationType) { if (implementationInstance == null) { throw new ArgumentNullException(nameof(implementationInstance)); } if (serviceMethod == null) { throw new ArgumentNullException(nameof(serviceMethod)); } if (serviceType == null) { throw new ArgumentNullException(nameof(serviceType)); } if (implementationMethod == null) { throw new ArgumentNullException(nameof(implementationMethod)); } if (implementationType == null) { throw new ArgumentNullException(nameof(implementationType)); } ServiceMethod = serviceMethod; ServiceType = serviceType; ImplementationInstance = implementationInstance; ImplementationMethod = implementationMethod; ImplementationType = implementationType; } public virtual object Invoke(IEnumerable<ParameterDescriptor> parameterDescriptors) { try { var parameters = parameterDescriptors?.Select(descriptor => descriptor.Value).ToArray(); return ImplementationMethod.Invoke(ImplementationInstance, parameters); } catch (TargetInvocationException exception) { throw exception.InnerException; } catch (Exception exception) { throw exception; } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; namespace AspectCore.Lite.Abstractions { public sealed class TargetDescriptor { public object ImplementationInstance { get; } public MethodInfo ServiceMethod { get; } public MethodInfo ImplementationMethod { get; } public Type ServiceType { get; } public Type ImplementationType { get; } public TargetDescriptor(object implementationInstance, MethodInfo serviceMethod, Type serviceType, MethodInfo implementationMethod, Type implementationType) { if (implementationInstance == null) { throw new ArgumentNullException(nameof(implementationInstance)); } if (serviceMethod == null) { throw new ArgumentNullException(nameof(serviceMethod)); } if (serviceType == null) { throw new ArgumentNullException(nameof(serviceType)); } if (implementationMethod == null) { throw new ArgumentNullException(nameof(implementationMethod)); } if (implementationType == null) { throw new ArgumentNullException(nameof(implementationType)); } ServiceMethod = serviceMethod; ServiceType = serviceType; ImplementationInstance = implementationInstance; ImplementationMethod = implementationMethod; ImplementationType = implementationType; } public object Invoke(IEnumerable<ParameterDescriptor> parameterDescriptors) { try { var parameters = parameterDescriptors?.Select(descriptor => descriptor.Value).ToArray(); return ImplementationMethod.Invoke(ImplementationInstance, parameters); } catch (TargetInvocationException exception) { throw exception.InnerException; } catch (Exception exception) { throw exception; } } } }
mit
C#
3fed1f0fc23e85cb7ed77b3bd3b61a4b14183c5a
Comment Guid attribute. Workaround for https://github.com/dotnet/corefx/issues/7387.
matthewvukomanovic/Cryptography,sshnet/Cryptography
src/Renci.Security.Cryptography.UAP10/Properties/AssemblyInfo.cs
src/Renci.Security.Cryptography.UAP10/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Renci.SshNet.Security.Cryptography for UAP 10.0")] // https://github.com/dotnet/corefx/issues/7387 //[assembly: Guid("EB0D62D0-F031-4CC3-A294-D7B867DA517B")]
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Renci.SshNet.Security.Cryptography for UAP 10.0")] [assembly: Guid("EB0D62D0-F031-4CC3-A294-D7B867DA517B")]
mit
C#
458945eb24d6055907de08fa14764bcb5b15cdd8
Rename Sdl2Functions methods and make internal
ppy/osu-framework,peppy/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,ppy/osu-framework,ZLima12/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,peppy/osu-framework
osu.Framework/Platform/Sdl2Functions.cs
osu.Framework/Platform/Sdl2Functions.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.Numerics; using System.Runtime.InteropServices; using Veldrid.Sdl2; namespace osu.Framework.Platform { internal static unsafe class Sdl2Functions { [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void SdlGLGetDrawableSizeDelegate(SDL_Window window, int* w, int* h); private static readonly SdlGLGetDrawableSizeDelegate sdl_gl_get_drawable_size = Sdl2Native.LoadFunction<SdlGLGetDrawableSizeDelegate>("SDL_GL_GetDrawableSize"); public static Vector2 SDL_GL_GetDrawableSize(SDL_Window window) { int w, h; sdl_gl_get_drawable_size(window, &w, &h); return new Vector2(w, h); } [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate int SdlGLGetSwapIntervalDelegate(); private static readonly SdlGLGetSwapIntervalDelegate sdl_gl_get_swap_interval = Sdl2Native.LoadFunction<SdlGLGetSwapIntervalDelegate>("SDL_GL_GetSwapInterval"); public static int SDL_GL_GetSwapInterval() => sdl_gl_get_swap_interval(); } }
// 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.Numerics; using System.Runtime.InteropServices; using Veldrid.Sdl2; // ReSharper disable InconsistentNaming namespace osu.Framework.Platform { public static unsafe class Sdl2Functions { [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void SDL_GL_GetDrawableSize_t(SDL_Window window, int* w, int* h); private static readonly SDL_GL_GetDrawableSize_t s_glGetDrawableSize = Sdl2Native.LoadFunction<SDL_GL_GetDrawableSize_t>("SDL_GL_GetDrawableSize"); public static Vector2 SDL_GL_GetDrawableSize(SDL_Window window) { int w, h; s_glGetDrawableSize(window, &w, &h); return new Vector2(w, h); } [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate int SDL_GL_GetSwapInterval_t(); private static readonly SDL_GL_GetSwapInterval_t s_gl_getSwapInterval = Sdl2Native.LoadFunction<SDL_GL_GetSwapInterval_t>("SDL_GL_GetSwapInterval"); public static int SDL_GL_GetSwapInterval() => s_gl_getSwapInterval(); } }
mit
C#
f669a4563f3d9a42058a77c185a028789a57c003
Fix networked movement controller
carlossdparaujo/MultiPacMan
MultiPacMan/Assets/Scripts/Player/MovementController/NetworkedMovementController.cs
MultiPacMan/Assets/Scripts/Player/MovementController/NetworkedMovementController.cs
using UnityEngine; using System.Collections; namespace MultiPacMan.Player { enum NetworkingOptions { Default, Interpolation, InterpolationAndExtrapolation }; public class NetworkedMovementController : MovementController { [SerializeField] private NetworkingOptions option = NetworkingOptions.Default; private float t = 0.0f; private float timeWaited = 0.0f; private Vector2 newPosition = Vector2.zero; private bool started = false; public override void OnStart() { newPosition = this.transform.root.position; started = true; } public void UpdatePosition(Vector2 position, Vector2 velocity) { switch (option) { case NetworkingOptions.Interpolation: MoveWithInterpolation(position, velocity); break; case NetworkingOptions.InterpolationAndExtrapolation: MoveWithExtrapolation(position, velocity); break; default: Move(position); break; } } private void MoveWithInterpolation(Vector2 position, Vector2 velocity) { timeWaited = t; newPosition = position; t = 0.0f; } private void MoveWithExtrapolation(Vector2 position, Vector2 velocity) { timeWaited = t; newPosition = position + timeWaited*velocity; t = 0.0f; } private void Move(Vector2 position) { rb.MovePosition(position); } void FixedUpdate() { if (!started || option == NetworkingOptions.Default) { t = 0.0f; timeWaited = 0.0f; newPosition = Vector2.zero; return; } t += Time.deltaTime; rb.MovePosition(Vector2.Lerp(rb.position, newPosition, t/timeWaited)); } } }
using UnityEngine; using System.Collections; namespace MultiPacMan.Player { enum NetworkingOptions { Default, Interpolation, InterpolationAndExtrapolation }; public class NetworkedMovementController : MovementController { [SerializeField] private NetworkingOptions option = NetworkingOptions.Default; private float t = 0.0f; private float timeWaited = 0.0f; private Vector2 newPosition = Vector2.zero; private bool started = false; public override void OnStart() { newPosition = this.transform.root.position; started = true; } public void UpdatePosition(Vector2 position, Vector2 velocity) { switch (option) { case NetworkingOptions.Interpolation: MoveWithInterpolation(position, velocity); break; case NetworkingOptions.InterpolationAndExtrapolation: MoveWithExtrapolation(position, velocity); break; default: Move(position); break; } } private void MoveWithInterpolation(Vector2 position, Vector2 velocity) { timeWaited = t; newPosition = position; } private void MoveWithExtrapolation(Vector2 position, Vector2 velocity) { timeWaited = t; newPosition = position + timeWaited*velocity; } private void Move(Vector2 position) { rb.MovePosition(position); } void Update() { if (!started || option == NetworkingOptions.Default) { t = 0.0f; timeWaited = 0.0f; newPosition = Vector2.zero; return; } t += Time.deltaTime; Vector2.Lerp(rb.position, newPosition, t/timeWaited); } } }
mit
C#
e25503fee385a502dd4b4b28563fdecf1507d969
Update food box item with fibre
lukecahill/NutritionTracker
food_tracker/FoodBoxItem.cs
food_tracker/FoodBoxItem.cs
using System.Windows.Controls; using System.Windows.Forms; namespace food_tracker { public class FoodBoxItem : ListBoxItem { public int calories { get; set; } public int fats { get; set; } public int saturatedFat { get; set; } public int carbohydrates { get; set; } public int sugar { get; set; } public int protein { get; set; } public int salt { get; set; } public int fibre { get; set; } public string name { get; set; } public FoodBoxItem() : base() { } public FoodBoxItem(int cals, int fats, int satFat, int carbs, int sugars, int protein, int salt, int fibre, string name) { this.name = name; this.calories = cals; this.fats = fats; this.salt = salt; this.saturatedFat = satFat; this.carbohydrates = carbs; this.sugar = sugars; this.protein = protein; this.fibre = fibre; } public override string ToString() { return name; } } }
using System.Windows.Controls; using System.Windows.Forms; namespace food_tracker { public class FoodBoxItem : ListBoxItem { public int calories { get; set; } public int fats { get; set; } public int saturatedFat { get; set; } public int carbohydrates { get; set; } public int sugar { get; set; } public int protein { get; set; } public int salt { get; set; } public string name { get; set; } public FoodBoxItem() : base() { } public FoodBoxItem(int cals, int fats, int satFat, int carbs, int sugars, int protein, int salt, string name) { this.name = name; this.calories = cals; this.fats = fats; this.salt = salt; this.saturatedFat = satFat; this.carbohydrates = carbs; this.sugar = sugars; this.protein = protein; } public override string ToString() { return name; } } }
mit
C#
3e1637cd2e6a0c62c784d03eb9b37c23acbd71a8
Fix NRE when a ctor is not found
FUR10N/NullContracts,FUR10N/NullContracts
src/FUR10N.NullContracts/FlowAnalysis/CtorFlowAnalysis.cs
src/FUR10N.NullContracts/FlowAnalysis/CtorFlowAnalysis.cs
using System; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; namespace FUR10N.NullContracts.FlowAnalysis { internal class CtorFlowAnalysis { private readonly SemanticModel model; public readonly ConstructorDeclarationSyntax Constructor; public ImmutableArray<NotNullFieldInfo> UnassignedMembers; private IMethodSymbol constructorSymbol; public IMethodSymbol ConstructorSymbol { get { return constructorSymbol ?? (constructorSymbol = model.GetDeclaredSymbol(Constructor)); } } public CtorFlowAnalysis(SemanticModel model, ConstructorDeclarationSyntax constructor, IEnumerable<NotNullFieldInfo> membersNotAssigned) { this.model = model; Constructor = constructor; UnassignedMembers = ImmutableArray.Create(membersNotAssigned.ToArray()); } /// <summary> /// Returns all constructors that this constructor invokes. /// </summary> /// <param name="flowAnalysis"></param> /// <param name="target"></param> /// <returns></returns> public IEnumerable<CtorFlowAnalysis> GetAllChainedCtors(IList<CtorFlowAnalysis> allCtors) { // TODO: guard against cyclical ctors var chainedCtor = this.Constructor.Initializer; if (chainedCtor == null) { yield break; } var targetSymbol = model.GetSymbolInfo(chainedCtor); if (targetSymbol.Symbol == null) { yield break; } foreach (var ctor in allCtors) { if (targetSymbol.Symbol.Equals(ctor.ConstructorSymbol)) { yield return ctor; foreach (var nestedCtor in ctor.GetAllChainedCtors(allCtors)) { yield return nestedCtor; } } } } } }
using System; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; namespace FUR10N.NullContracts.FlowAnalysis { internal class CtorFlowAnalysis { private readonly SemanticModel model; public readonly ConstructorDeclarationSyntax Constructor; public ImmutableArray<NotNullFieldInfo> UnassignedMembers; private IMethodSymbol constructorSymbol; public IMethodSymbol ConstructorSymbol { get { return constructorSymbol ?? (constructorSymbol = model.GetDeclaredSymbol(Constructor)); } } public CtorFlowAnalysis(SemanticModel model, ConstructorDeclarationSyntax constructor, IEnumerable<NotNullFieldInfo> membersNotAssigned) { this.model = model; Constructor = constructor; UnassignedMembers = ImmutableArray.Create(membersNotAssigned.ToArray()); } /// <summary> /// Returns all constructors that this constructor invokes. /// </summary> /// <param name="flowAnalysis"></param> /// <param name="target"></param> /// <returns></returns> public IEnumerable<CtorFlowAnalysis> GetAllChainedCtors(IList<CtorFlowAnalysis> allCtors) { // TODO: guard against cyclical ctors var chainedCtor = this.Constructor.Initializer; if (chainedCtor == null) { yield break; } var targetSymbol = model.GetSymbolInfo(chainedCtor); foreach (var ctor in allCtors) { if (targetSymbol.Symbol.Equals(ctor.ConstructorSymbol)) { yield return ctor; foreach (var nestedCtor in ctor.GetAllChainedCtors(allCtors)) { yield return nestedCtor; } } } } } }
mit
C#
721ed8d6473b3e2656f07356e406a255cf7d0616
Add culture changer helper
henriksen/Humanizer,mrchief/Humanizer,nigel-sampson/Humanizer,vgrigoriu/Humanizer,nigel-sampson/Humanizer,schalpat/Humanizer,vgrigoriu/Humanizer,llehouerou/Humanizer,thunsaker/Humanizer,mexx/Humanizer,maximn/Humanizer,kikoanis/Humanizer,HalidCisse/Humanizer,thunsaker/Humanizer,harouny/Humanizer,ErikSchierboom/Humanizer,gyurisc/Humanizer,micdenny/Humanizer,CodeFromJordan/Humanizer,jaxx-rep/Humanizer,CodeFromJordan/Humanizer,GeorgeHahn/Humanizer,mexx/Humanizer,mrchief/Humanizer,hazzik/Humanizer,HalidCisse/Humanizer,llehouerou/Humanizer,preetksingh80/Humanizer,GeorgeHahn/Humanizer,vgrigoriu/Humanizer,thunsaker/Humanizer,maximn/Humanizer,llehouerou/Humanizer,ErikSchierboom/Humanizer,kikoanis/Humanizer,MehdiK/Humanizer,gyurisc/Humanizer,preetksingh80/Humanizer,ammachado/Humanizer,preetksingh80/Humanizer,schalpat/Humanizer,HalidCisse/Humanizer,aloisdg/Humanizer,mrchief/Humanizer,henriksen/Humanizer,Flatlineato/Humanizer,CodeFromJordan/Humanizer,ammachado/Humanizer,micdenny/Humanizer,Flatlineato/Humanizer,harouny/Humanizer
src/Humanizer.Tests/Extensions/DateHumanizeTests.ro-RO.cs
src/Humanizer.Tests/Extensions/DateHumanizeTests.ro-RO.cs
using System; using System.Globalization; using System.Threading; using Xunit; namespace Humanizer.Tests.Extensions { public class RomanianDateHumanizeTests { [Fact] public void RomanianTranslationIsCorrectForThreeHoursAgo() { using (RomanianCulture()) { var threeHoursAgo = DateTime.UtcNow.AddHours(-3).Humanize(); Assert.Equal("acum 3 ore", threeHoursAgo); } } [Fact] public void RomanianTranslationIsCorrectFor20HoursAgo() { using (RomanianCulture()) { var threeHoursAgo = DateTime.UtcNow.AddHours(-20).Humanize(); Assert.Equal("acum 20 de ore", threeHoursAgo); } } private static CurrentCultureChanger RomanianCulture() { return new CurrentCultureChanger(new CultureInfo("ro-RO")); } /// <summary> /// Temporarily change the CurrentUICulture and restore it back /// </summary> private class CurrentCultureChanger: IDisposable { private readonly CultureInfo initialCulture; private readonly Thread initialThread; public CurrentCultureChanger(CultureInfo cultureInfo) { if (cultureInfo == null) throw new ArgumentNullException("cultureInfo"); initialThread = Thread.CurrentThread; initialCulture = initialThread.CurrentUICulture; initialThread.CurrentUICulture = cultureInfo; } public void Dispose() { initialThread.CurrentUICulture = initialCulture; } } } }
using System; using System.Globalization; using System.Threading; using Xunit; namespace Humanizer.Tests.Extensions { public class RomanianDateHumanizeTests { [Fact] public void RomanianTranslationIsCorrectForThreeHoursAgo() { var currentCulture = Thread.CurrentThread.CurrentUICulture; Thread.CurrentThread.CurrentUICulture = new CultureInfo("ro-RO"); var threeHoursAgo = DateTime.UtcNow.AddHours(-3).Humanize(); Thread.CurrentThread.CurrentUICulture = currentCulture; Assert.Equal("acum 3 ore", threeHoursAgo); } [Fact] public void RomanianTranslationIsCorrectFor20HoursAgo() { var currentCulture = Thread.CurrentThread.CurrentUICulture; Thread.CurrentThread.CurrentUICulture = new CultureInfo("ro-RO"); var threeHoursAgo = DateTime.UtcNow.AddHours(-20).Humanize(); Thread.CurrentThread.CurrentUICulture = currentCulture; Assert.Equal("acum 20 de ore", threeHoursAgo); } } }
mit
C#
98a808861b3e286f5a4a0b7d07d3ab0187298e9a
Fix namespace
TORISOUP/NcmbAsObservable
Assets/NcmbAsObservables/scripts/NcmbPushExtensions.cs
Assets/NcmbAsObservables/scripts/NcmbPushExtensions.cs
using NCMB; using UniRx; namespace NcmbAsObservables { public static class NcmbPushExtensions { /// <summary> /// プッシュの送信を行います。 /// </summary> public static IObservable<NCMBPush> SendPushAsync(this NCMBPush origin) { return Observable.Create<NCMBPush>(observer => { origin.SendPush(error => { if (error == null) { observer.OnNext(origin); observer.OnCompleted(); } else { observer.OnError(error); } }); return Disposable.Empty; }); } } }
using NCMB; using UniRx; namespace Assets.NcmbAsObservables { public static class NcmbPushExtensions { /// <summary> /// プッシュの送信を行います。 /// </summary> public static IObservable<NCMBPush> SendPushAsync(this NCMBPush origin) { return Observable.Create<NCMBPush>(observer => { origin.SendPush(error => { if (error == null) { observer.OnNext(origin); observer.OnCompleted(); } else { observer.OnError(error); } }); return Disposable.Empty; }); } } }
mit
C#
24f8a18579d4a51d01de34f81c5f6cdba134ba90
make stringextensions available
TomPallister/Ocelot,geffzhang/Ocelot,geffzhang/Ocelot,TomPallister/Ocelot
src/Ocelot/Infrastructure/Extensions/StringValuesExtensions.cs
src/Ocelot/Infrastructure/Extensions/StringValuesExtensions.cs
using Microsoft.Extensions.Primitives; using System.Linq; namespace Ocelot.Infrastructure.Extensions { public static class StringValuesExtensions { public static string GetValue(this StringValues stringValues) { if (stringValues.Count == 1) { return stringValues; } return stringValues.ToArray().LastOrDefault(); } } }
using Microsoft.Extensions.Primitives; using System.Linq; namespace Ocelot.Infrastructure.Extensions { internal static class StringValuesExtensions { public static string GetValue(this StringValues stringValues) { if (stringValues.Count == 1) { return stringValues; } return stringValues.ToArray().LastOrDefault(); } } }
mit
C#
d8022904aaaa686d25c44a4d33b8848ca7476871
Update ExitCode to long. This is because Windows Containers sometimes exit with 3221225725
mariotoffia/FluentDocker,mariotoffia/FluentDocker,mariotoffia/FluentDocker,mariotoffia/FluentDocker
Ductus.FluentDocker/Model/Containers/ContainerState.cs
Ductus.FluentDocker/Model/Containers/ContainerState.cs
using System; // ReSharper disable InconsistentNaming namespace Ductus.FluentDocker.Model.Containers { public sealed class ContainerState { public string Status { get; set; } public bool Running { get; set; } public bool Paused { get; set; } public bool Restarting { get; set; } public bool OOMKilled { get; set; } public bool Dead { get; set; } public int Pid { get; set; } public long ExitCode { get; set; } public string Error { get; set; } public DateTime StartedAt { get; set; } public DateTime FinishedAt { get; set; } public Health Health { get; set; } } }
using System; // ReSharper disable InconsistentNaming namespace Ductus.FluentDocker.Model.Containers { public sealed class ContainerState { public string Status { get; set; } public bool Running { get; set; } public bool Paused { get; set; } public bool Restarting { get; set; } public bool OOMKilled { get; set; } public bool Dead { get; set; } public int Pid { get; set; } public int ExitCode { get; set; } public string Error { get; set; } public DateTime StartedAt { get; set; } public DateTime FinishedAt { get; set; } public Health Health { get; set; } } }
apache-2.0
C#
d055641b18795e6ab95f9745414e737d6154298b
Update QueueCallerJoinEvent.cs
skrusty/AsterNET,AsterNET/AsterNET
Asterisk.2013/Asterisk.NET/Manager/Event/QueueCallerJoinEvent.cs
Asterisk.2013/Asterisk.NET/Manager/Event/QueueCallerJoinEvent.cs
namespace AsterNET.Manager.Event { /// <summary> /// A QueueCallerJoinEvent is triggered when a channel joins a queue.<br/> /// </summary> public class QueueCallerJoinEvent : JoinEvent { // "Channel" in ManagerEvent.cs // "Queue" in QueueEvent.cs /// <summary> /// Get/Set the Caller*ID number of the channel that joined the queue if set. /// If the channel has no caller id set "unknown" is returned. /// </summary> public string CallerIDNum { get; set; } // "CallerIdName" in JoinEvent.cs // "Position" in JoinEvent.cs public QueueCallerJoinEvent(ManagerConnection source) : base(source) { } } }
namespace AsterNET.Manager.Event { /// <summary> /// A QueueCallerJoinEvent is triggered when a channel joins a queue.<br/> /// </summary> public class QueueCallerJoinEvent : QueueEvent { public string Position { get; set; } public QueueCallerJoinEvent(ManagerConnection source) : base(source) { } } }
mit
C#
ab3010f0b692eb51309bc17a08938103341893bb
Make WalletViewModel private and WalletViewModelBase protected.
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi.Gui/ViewModels/WasabiWalletDocumentTabViewModel.cs
WalletWasabi.Gui/ViewModels/WasabiWalletDocumentTabViewModel.cs
using ReactiveUI; using Splat; using System; using System.Reactive.Linq; using WalletWasabi.Gui.Controls.WalletExplorer; using WalletWasabi.Wallets; namespace WalletWasabi.Gui.ViewModels { public abstract class WasabiWalletDocumentTabViewModel : WasabiDocumentTabViewModel { protected WasabiWalletDocumentTabViewModel(string title, WalletViewModelBase walletViewModel) : base(title) { WalletViewModel = walletViewModel; } public void ExpandWallet () { WalletViewModel.IsExpanded = true; } private WalletViewModelBase WalletViewModel { get; } protected Wallet Wallet => WalletViewModel.Wallet; } }
using System; using System.Collections.Generic; using System.Text; using WalletWasabi.Gui.Controls.WalletExplorer; using WalletWasabi.Wallets; namespace WalletWasabi.Gui.ViewModels { public abstract class WasabiWalletDocumentTabViewModel : WasabiDocumentTabViewModel { protected WasabiWalletDocumentTabViewModel(string title, WalletViewModelBase walletViewModel) : base(title) { WalletViewModel = walletViewModel; } public WalletViewModelBase WalletViewModel { get; } public Wallet Wallet => WalletViewModel.Wallet; } }
mit
C#
888ef19d95a5bd2858dd6ea9d75288aa5f0d4117
change this back to FullName
github/VisualStudio,github/VisualStudio,github/VisualStudio
src/GitHub.VisualStudio/Helpers/ActiveDocumentSnapshot.cs
src/GitHub.VisualStudio/Helpers/ActiveDocumentSnapshot.cs
using Microsoft.VisualStudio; using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.TextManager.Interop; using System; using System.ComponentModel.Composition; using System.Diagnostics; namespace GitHub.VisualStudio { [Export(typeof(IActiveDocumentSnapshot))] [PartCreationPolicy(CreationPolicy.NonShared)] public class ActiveDocumentSnapshot : IActiveDocumentSnapshot { public string Name { get; private set; } public int StartLine { get; private set; } public int EndLine { get; private set; } [ImportingConstructor] public ActiveDocumentSnapshot([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider) { StartLine = EndLine = -1; Name = Services.Dte2?.ActiveDocument?.FullName; var textManager = serviceProvider.GetService(typeof(SVsTextManager)) as IVsTextManager; Debug.Assert(textManager != null, "No SVsTextManager service available"); if (textManager == null) return; IVsTextView view; int anchorLine, anchorCol, endLine, endCol; if (ErrorHandler.Succeeded(textManager.GetActiveView(0, null, out view)) && ErrorHandler.Succeeded(view.GetSelection(out anchorLine, out anchorCol, out endLine, out endCol))) { StartLine = anchorLine + 1; EndLine = endLine + 1; } } } }
using Microsoft.VisualStudio; using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.TextManager.Interop; using System; using System.ComponentModel.Composition; using System.Diagnostics; namespace GitHub.VisualStudio { [Export(typeof(IActiveDocumentSnapshot))] [PartCreationPolicy(CreationPolicy.NonShared)] public class ActiveDocumentSnapshot : IActiveDocumentSnapshot { public string Name { get; private set; } public int StartLine { get; private set; } public int EndLine { get; private set; } [ImportingConstructor] public ActiveDocumentSnapshot([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider) { StartLine = EndLine = -1; Name = Services.Dte2?.ActiveDocument?.ProjectItem.Name; var textManager = serviceProvider.GetService(typeof(SVsTextManager)) as IVsTextManager; Debug.Assert(textManager != null, "No SVsTextManager service available"); if (textManager == null) return; IVsTextView view; int anchorLine, anchorCol, endLine, endCol; if (ErrorHandler.Succeeded(textManager.GetActiveView(0, null, out view)) && ErrorHandler.Succeeded(view.GetSelection(out anchorLine, out anchorCol, out endLine, out endCol))) { StartLine = anchorLine + 1; EndLine = endLine + 1; } } } }
mit
C#
4df466b818d2192fa9a1c002d43b4e68dca92bf4
Remove unused methods from ContextMenuElement
nunit/nunit-gui,nunit/nunit-gui,NUnitSoftware/nunit-gui,NUnitSoftware/nunit-gui
src/TestCentric/components/Elements/ContextMenuElement.cs
src/TestCentric/components/Elements/ContextMenuElement.cs
// *********************************************************************** // Copyright (c) 2015 Charlie Poole // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** using System.Windows.Forms; namespace TestCentric.Gui.Elements { /// <summary> /// MenuElement is the implementation of ToolStripItem /// used in the actual application. /// </summary> public class ContextMenuElement : ControlElement<ContextMenuStrip>, IContextMenu { public ContextMenuElement(ContextMenuStrip contextMenu) : base(contextMenu) { contextMenu.Opening += (s, cea) => { if (Popup != null) Popup(); }; } public event CommandHandler Popup; public ToolStripItemCollection Items { get { return Control.Items; } } } }
// *********************************************************************** // Copyright (c) 2015 Charlie Poole // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** using System.Windows.Forms; namespace TestCentric.Gui.Elements { /// <summary> /// MenuElement is the implementation of ToolStripItem /// used in the actual application. /// </summary> public class ContextMenuElement : ControlElement<ContextMenuStrip>, IContextMenu { public ContextMenuElement(ContextMenuStrip contextMenu) : base(contextMenu) { contextMenu.Opening += (s, cea) => { if (Popup != null) Popup(); }; } public event CommandHandler Popup; public ToolStripItemCollection Items { get { return Control.Items; } } public void AddSeparator() { Control.Items.Add(new ToolStripSeparator()); } public void Add(ToolStripMenuItem menuItem) { Control.Items.Add(menuItem); } } }
mit
C#
b0edd1cd690eee9483d82664b8091a3a85c303aa
Fix typo and use <see langword=""/>.
Alan-Lun/git-p3
Microsoft.TeamFoundation.Authentication/ITokenStore.cs
Microsoft.TeamFoundation.Authentication/ITokenStore.cs
using System; namespace Microsoft.TeamFoundation.Authentication { public interface ITokenStore { /// <summary> /// Deletes a <see cref="Token"/> from the underlying storage. /// </summary> /// <param name="targetUri">The key identifying which token is being deleted.</param> void DeleteToken(Uri targetUri); /// <summary> /// Reads a <see cref="Token"/> from the underlying storage. /// </summary> /// <param name="targetUri">The key identifying which token to read.</param> /// <param name="token">A <see cref="Token"/> if successful; otherwise <see langword="null"/>.</param> /// <returns><see langword="true"/> if successful; otherwise <see langword="false"/>.</returns> bool ReadToken(Uri targetUri, out Token token); /// <summary> /// Writes a <see cref="Token"/> to the underlying storage. /// </summary> /// <param name="targetUri"> /// Unique identifier for the token, used when reading back from storage. /// </param> /// <param name="token">The <see cref="Token"/> to be written.</param> void WriteToken(Uri targetUri, Token token); } }
using System; namespace Microsoft.TeamFoundation.Authentication { public interface ITokenStore { /// <summary> /// Deletes a <see cref="Token"/> from the underlying storage. /// </summary> /// <param name="targetUri">The key identifying which token is being deleted.</param> void DeleteToken(Uri targetUri); /// <summary> /// Reads a <see cref="Token"/> from the underlying storage. /// </summary> /// <param name="targetUri">The key identifying which token to read.</param> /// <param name="token">A <see cref="Token"/> if successful; otherwise false.</param> /// <returns>True if successful; otherwise false.</returns> bool ReadToken(Uri targetUri, out Token token); /// <summary> /// Writes a <see cref="Token"/> to the underlying storage. /// </summary> /// <param name="targetUri"> /// Unique identifier for the token, used when reading back from storage. /// </param> /// <param name="token">The <see cref="Token"/> to writen.</param> void WriteToken(Uri targetUri, Token token); } }
mit
C#
aa25c10703aaafe638a1a14348594cbef0b78513
set password to empty string.
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi.Fluent/ViewModels/Dialogs/EnterPasswordViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/EnterPasswordViewModel.cs
using ReactiveUI; using System.Reactive.Linq; using System.Windows.Input; using WalletWasabi.Gui.Validation; using WalletWasabi.Models; using WalletWasabi.Userfacing; namespace WalletWasabi.Fluent.ViewModels.Dialogs { public class EnterPasswordViewModel : DialogViewModelBase<string?> { private string? _password; private string? _confirmPassword; public EnterPasswordViewModel() { // This means pressing continue will make the password empty string. // pressing cancel will return null. _password = ""; this.ValidateProperty(x => x.Password, ValidatePassword); this.ValidateProperty(x => x.ConfirmPassword, ValidateConfirmPassword); var continueCommandCanExecute = this.WhenAnyValue( x => x.Password, x => x.ConfirmPassword, (password, confirmPassword) => { // This will fire validations before return canExecute value. this.RaisePropertyChanged(nameof(Password)); this.RaisePropertyChanged(nameof(ConfirmPassword)); return (string.IsNullOrEmpty(password) && string.IsNullOrEmpty(confirmPassword)) || (!string.IsNullOrEmpty(password) && !string.IsNullOrEmpty(confirmPassword) && !Validations.Any); }) .ObserveOn(RxApp.MainThreadScheduler); ContinueCommand = ReactiveCommand.Create(() => Close(Password), continueCommandCanExecute); CancelCommand = ReactiveCommand.Create(() => Close()); } public string? Password { get => _password; set => this.RaiseAndSetIfChanged(ref _password, value); } public string? ConfirmPassword { get => _confirmPassword; set => this.RaiseAndSetIfChanged(ref _confirmPassword, value); } public ICommand ContinueCommand { get; } public ICommand CancelCommand { get; } protected override void OnDialogClosed() { Password = ""; ConfirmPassword = ""; } private void ValidateConfirmPassword(IValidationErrors errors) { if (!string.IsNullOrEmpty(ConfirmPassword) && Password != ConfirmPassword) { errors.Add(ErrorSeverity.Error, PasswordHelper.MatchingMessage); } } private void ValidatePassword(IValidationErrors errors) { if (PasswordHelper.IsTrimable(Password, out _)) { errors.Add(ErrorSeverity.Error, PasswordHelper.WhitespaceMessage); } if (PasswordHelper.IsTooLong(Password, out _)) { errors.Add(ErrorSeverity.Error, PasswordHelper.PasswordTooLongMessage); } } } }
using ReactiveUI; using System.Reactive.Linq; using System.Windows.Input; using WalletWasabi.Gui.Validation; using WalletWasabi.Models; using WalletWasabi.Userfacing; namespace WalletWasabi.Fluent.ViewModels.Dialogs { public class EnterPasswordViewModel : DialogViewModelBase<string?> { private string _password; private string _confirmPassword; public EnterPasswordViewModel() { this.ValidateProperty(x => x.Password, ValidatePassword); this.ValidateProperty(x => x.ConfirmPassword, ValidateConfirmPassword); var continueCommandCanExecute = this.WhenAnyValue( x => x.Password, x => x.ConfirmPassword, (password, confirmPassword) => { // This will fire validations before return canExecute value. this.RaisePropertyChanged(nameof(Password)); this.RaisePropertyChanged(nameof(ConfirmPassword)); return (string.IsNullOrEmpty(password) && string.IsNullOrEmpty(confirmPassword)) || (!string.IsNullOrEmpty(password) && !string.IsNullOrEmpty(confirmPassword) && !Validations.Any); }) .ObserveOn(RxApp.MainThreadScheduler); ContinueCommand = ReactiveCommand.Create(() => Close(Password), continueCommandCanExecute); CancelCommand = ReactiveCommand.Create(() => Close()); } public string? Password { get => _password; set => this.RaiseAndSetIfChanged(ref _password, value); } public string? ConfirmPassword { get => _confirmPassword; set => this.RaiseAndSetIfChanged(ref _confirmPassword, value); } public ICommand ContinueCommand { get; } public ICommand CancelCommand { get; } protected override void OnDialogClosed() { Password = ""; ConfirmPassword = ""; } private void ValidateConfirmPassword(IValidationErrors errors) { if (!string.IsNullOrEmpty(ConfirmPassword) && Password != ConfirmPassword) { errors.Add(ErrorSeverity.Error, PasswordHelper.MatchingMessage); } } private void ValidatePassword(IValidationErrors errors) { if (PasswordHelper.IsTrimable(Password, out _)) { errors.Add(ErrorSeverity.Error, PasswordHelper.WhitespaceMessage); } if (PasswordHelper.IsTooLong(Password, out _)) { errors.Add(ErrorSeverity.Error, PasswordHelper.PasswordTooLongMessage); } } } }
mit
C#
a75e47d01030ae36d91ff29089b823b16493657b
Set ViewData for context/container
restful-routing/restful-routing,stevehodgkiss/restful-routing,restful-routing/restful-routing,stevehodgkiss/restful-routing,restful-routing/restful-routing,stevehodgkiss/restful-routing
src/RestfulRouting.Tests/Unit/HtmlHelperExtensionsSpec.cs
src/RestfulRouting.Tests/Unit/HtmlHelperExtensionsSpec.cs
using System; using System.Web; using System.Web.Mvc; using System.Web.Routing; using Machine.Specifications; using MvcContrib.TestHelper; using RestfulRouting; using Rhino.Mocks; namespace HtmlExtensionsSpecs { [Subject(typeof(HtmlHelperExtensions))] public abstract class base_context { protected static HttpRequestBase _httpRequestBase; protected static RequestContext _requestContext; protected static RouteData _routeData; protected static string _form; protected static HtmlHelper _htmlHelper; Establish context = () => { var builder = new TestControllerBuilder(); var requestContext = new RequestContext(builder.HttpContext, new RouteData()); requestContext.HttpContext.Response.Stub(x => x.ApplyAppPathModifier(null)).IgnoreArguments().Do(new Func<string, string>(s => s)).Repeat.Any(); var viewData = new ViewDataDictionary(); var viewContext = MockRepository.GenerateStub<ViewContext>(); viewContext.RequestContext = requestContext; viewContext.ViewData = viewData; var viewDataContainer = MockRepository.GenerateStub<IViewDataContainer>(); viewDataContainer.ViewData = viewData; _htmlHelper = new HtmlHelper(viewContext, viewDataContainer); }; } public class when_generating_a_put_override : base_context { static string _tag; Because of = () => _tag = _htmlHelper.PutOverrideTag(); It should_return_a_hidden_field_with_method_put = () => _tag.ShouldBe("<input type=\"hidden\" name=\"_method\" value=\"put\" />"); } public class when_generating_a_delete_override : base_context { static string _tag; Because of = () => _tag = _htmlHelper.DeleteOverrideTag(); It should_return_a_hidden_field_with_method_delete = () => _tag.ShouldBe("<input type=\"hidden\" name=\"_method\" value=\"delete\" />"); } }
using System; using System.Web; using System.Web.Mvc; using System.Web.Routing; using Machine.Specifications; using MvcContrib.TestHelper; using RestfulRouting; using Rhino.Mocks; namespace HtmlExtensionsSpecs { [Subject(typeof(HtmlHelperExtensions))] public abstract class base_context { protected static HttpRequestBase _httpRequestBase; protected static RequestContext _requestContext; protected static RouteData _routeData; protected static string _form; protected static HtmlHelper _htmlHelper; Establish context = () => { var builder = new TestControllerBuilder(); var requestContext = new RequestContext(builder.HttpContext, new RouteData()); requestContext.HttpContext.Response.Stub(x => x.ApplyAppPathModifier(null)).IgnoreArguments().Do(new Func<string, string>(s => s)).Repeat.Any(); var viewContext = MockRepository.GenerateStub<ViewContext>(); viewContext.RequestContext = requestContext; var viewDataContainer = MockRepository.GenerateStub<IViewDataContainer>(); _htmlHelper = new HtmlHelper(viewContext, viewDataContainer); }; } public class when_generating_a_put_override : base_context { static string _tag; Because of = () => _tag = _htmlHelper.PutOverrideTag(); It should_return_a_hidden_field_with_method_put = () => _tag.ShouldBe("<input type=\"hidden\" name=\"_method\" value=\"put\" />"); } public class when_generating_a_delete_override : base_context { static string _tag; Because of = () => _tag = _htmlHelper.DeleteOverrideTag(); It should_return_a_hidden_field_with_method_delete = () => _tag.ShouldBe("<input type=\"hidden\" name=\"_method\" value=\"delete\" />"); } }
mit
C#
523032e6ee7ff1123f83a68e91aabc1cad9e9ca9
Update VersionInfo.cs
blorgbeard/pickles,irfanah/pickles,irfanah/pickles,magicmonty/pickles,picklesdoc/pickles,magicmonty/pickles,picklesdoc/pickles,blorgbeard/pickles,dirkrombauts/pickles,blorgbeard/pickles,blorgbeard/pickles,ludwigjossieaux/pickles,ludwigjossieaux/pickles,picklesdoc/pickles,ludwigjossieaux/pickles,magicmonty/pickles,irfanah/pickles,magicmonty/pickles,picklesdoc/pickles,irfanah/pickles,dirkrombauts/pickles,dirkrombauts/pickles,dirkrombauts/pickles
src/Pickles/VersionInfo.cs
src/Pickles/VersionInfo.cs
// <auto-generated/> using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyProductAttribute("Pickles")] [assembly: AssemblyCompanyAttribute("Pickles")] [assembly: AssemblyCopyrightAttribute("Copyright (c) Jeffrey Cameron 2010-2012, PicklesDoc 2012-present")] [assembly: AssemblyTrademarkAttribute("")] [assembly: AssemblyCultureAttribute("")] [assembly: ComVisibleAttribute(false)] [assembly: AssemblyVersionAttribute("0.18.1")] [assembly: AssemblyFileVersionAttribute("0.18.1")] namespace System { internal static class AssemblyVersionInformation { internal const string Version = "0.18.1"; } }
// <auto-generated/> using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyProductAttribute("Pickles")] [assembly: AssemblyCompanyAttribute("Pickles")] [assembly: AssemblyCopyrightAttribute("Copyright (c) Jeffrey Cameron 2010-2012, PicklesDoc 2012-2013")] [assembly: AssemblyTrademarkAttribute("")] [assembly: AssemblyCultureAttribute("")] [assembly: ComVisibleAttribute(false)] [assembly: AssemblyVersionAttribute("0.18.0")] [assembly: AssemblyFileVersionAttribute("0.18.0")] namespace System { internal static class AssemblyVersionInformation { internal const string Version = "0.18.0"; } }
apache-2.0
C#
fa1322599fb1cf6df9dd898544694a7e0eadeccb
remove using
bitwarden/core,bitwarden/core,bitwarden/core,bitwarden/core
src/Api/Utilities/DisableFormValueModelBindingAttribute.cs
src/Api/Utilities/DisableFormValueModelBindingAttribute.cs
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.ModelBinding; using System; namespace Bit.Api.Utilities { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] public class DisableFormValueModelBindingAttribute : Attribute, IResourceFilter { public void OnResourceExecuting(ResourceExecutingContext context) { var factories = context.ValueProviderFactories; factories.RemoveType<FormValueProviderFactory>(); factories.RemoveType<FormFileValueProviderFactory>(); factories.RemoveType<JQueryFormValueProviderFactory>(); } public void OnResourceExecuted(ResourceExecutedContext context) { } } }
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.ModelBinding; using System; using System.Linq; namespace Bit.Api.Utilities { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] public class DisableFormValueModelBindingAttribute : Attribute, IResourceFilter { public void OnResourceExecuting(ResourceExecutingContext context) { var factories = context.ValueProviderFactories; factories.RemoveType<FormValueProviderFactory>(); factories.RemoveType<FormFileValueProviderFactory>(); factories.RemoveType<JQueryFormValueProviderFactory>(); } public void OnResourceExecuted(ResourceExecutedContext context) { } } }
agpl-3.0
C#
2a661ec0946f6eb05d14e3f4adda98599600bdd0
update all players whenever something changes
pako1337/Arena,pako1337/Arena
Arena/Hubs/FightArenaHub.cs
Arena/Hubs/FightArenaHub.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using Microsoft.AspNet.SignalR; using System.Collections.Concurrent; using System.Threading; using ArenaModel; namespace ArenaUI.Hubs { public class FightArenaHub : Hub { private ArenaRepository _arenaRepository = new ArenaRepository(); public void Register() { var arena = _arenaRepository.GetArena(); var player = arena.RegisterPlayer(Context.ConnectionId); Clients.Client(Context.ConnectionId).NewUser(arena.Players); Clients.AllExcept(Context.ConnectionId).NewUser(new[] { player }); } public void MarkAsReady() { var arena = _arenaRepository.GetArena(); var player = arena.MarkPlayerAsReady(Context.ConnectionId); UpdateAllPlayers(arena); } public void MoveUser(int x, int y) { var arena = _arenaRepository.GetArena(); var player = arena.MoveUser(Context.ConnectionId, x, y); UpdateAllPlayers(arena); } public override System.Threading.Tasks.Task OnDisconnected(bool stopCalled) { var arena = _arenaRepository.GetArena(); string tokenId = arena.RemovePlayer(Context.ConnectionId); Clients.All.UserExit(tokenId); UpdateAllPlayers(arena); return base.OnDisconnected(stopCalled); } private void UpdateAllPlayers(Arena arena) { Clients.All.UpdatePlayer(arena.Players); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using Microsoft.AspNet.SignalR; using System.Collections.Concurrent; using System.Threading; using ArenaModel; namespace ArenaUI.Hubs { public class FightArenaHub : Hub { private ArenaRepository _arenaRepository = new ArenaRepository(); public void Register() { var arena = _arenaRepository.GetArena(); var player = arena.RegisterPlayer(Context.ConnectionId); Clients.Client(Context.ConnectionId).NewUser(arena.Players); Clients.AllExcept(Context.ConnectionId).NewUser(new[] { player }); } public void MarkAsReady() { var arena = _arenaRepository.GetArena(); var player = arena.MarkPlayerAsReady(Context.ConnectionId); Clients.All.UpdatePlayer(new [] {player}); } public void MoveUser(int x, int y) { var arena = _arenaRepository.GetArena(); var player = arena.MoveUser(Context.ConnectionId, x, y); Clients.All.UpdatePlayer(new [] {player}); } public override System.Threading.Tasks.Task OnDisconnected(bool stopCalled) { var arena = _arenaRepository.GetArena(); string tokenId = arena.RemovePlayer(Context.ConnectionId); Clients.All.UserExit(tokenId); return base.OnDisconnected(stopCalled); } } }
mit
C#
49fc3215783c81e29542954cd9e0edf17f6c0960
Bump version for release
jehhynes/griddly,programcsharp/griddly,nickdevore/griddly,nickdevore/griddly,jehhynes/griddly,programcsharp/griddly,programcsharp/griddly
Build/CommonAssemblyInfo.cs
Build/CommonAssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyProduct("Griddly")] [assembly: AssemblyCopyright("Copyright © 2015 Chris Hynes and Data Research Group")] [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 Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.5.21")] [assembly: AssemblyFileVersion("1.5.21")] //[assembly: AssemblyInformationalVersion("1.4.5-editlyalpha2")]
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyProduct("Griddly")] [assembly: AssemblyCopyright("Copyright © 2015 Chris Hynes and Data Research Group")] [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 Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.5.20")] [assembly: AssemblyFileVersion("1.5.20")] //[assembly: AssemblyInformationalVersion("1.4.5-editlyalpha2")]
mit
C#
ef8b833c96bb41b20ba3c59a82cc42e4145eb30c
Fix device network connection infinite recursion (#3121)
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,space-wizards/space-station-14
Content.Server/DeviceNetwork/DeviceNetworkConnection.cs
Content.Server/DeviceNetwork/DeviceNetworkConnection.cs
using Content.Server.Interfaces; using Robust.Shared.ViewVariables; using System.Collections.Generic; namespace Content.Server.GameObjects.EntitySystems.DeviceNetwork { public class DeviceNetworkConnection : IDeviceNetworkConnection { private readonly DeviceNetwork _network; [ViewVariables] private readonly int _netId; [ViewVariables] public bool Open { get; private set; } [ViewVariables] public string Address { get; private set; } [ViewVariables] public int Frequency { get; private set; } [ViewVariables] public bool ReceiveAll { get => _network.GetDeviceReceiveAll(_netId, Frequency, Address); set => _network.SetDeviceReceiveAll(_netId, Frequency, Address, value); } public DeviceNetworkConnection(DeviceNetwork network, int netId, string address, int frequency) { _network = network; _netId = netId; Open = true; Address = address; Frequency = frequency; } public bool Send(int frequency, string address, IReadOnlyDictionary<string, string> payload, Metadata metadata) { return Open && _network.EnqueuePackage(_netId, frequency, address, payload, Address, metadata); } public bool Send(int frequency, string address, Dictionary<string, string> payload) { return Send(frequency, address, payload, new Metadata()); } public bool Send(string address, Dictionary<string, string> payload) { return Send(0, address, payload); } public bool Broadcast(int frequency, IReadOnlyDictionary<string, string> payload, Metadata metadata) { return Open && _network.EnqueuePackage(_netId, frequency, "", payload, Address, metadata, true); } public bool Broadcast(int frequency, Dictionary<string, string> payload) { return Broadcast(frequency, payload, new Metadata()); } public bool Broadcast(Dictionary<string, string> payload) { return Broadcast(0, payload); } public void Close() { _network.RemoveDevice(_netId, Frequency, Address); Open = false; } } }
using Content.Server.Interfaces; using Robust.Shared.ViewVariables; using System.Collections.Generic; namespace Content.Server.GameObjects.EntitySystems.DeviceNetwork { public class DeviceNetworkConnection : IDeviceNetworkConnection { private readonly DeviceNetwork _network; [ViewVariables] private readonly int _netId; [ViewVariables] public bool Open { get; private set; } [ViewVariables] public string Address { get; private set; } [ViewVariables] public int Frequency { get; private set; } [ViewVariables] public bool ReceiveAll { get => _network.GetDeviceReceiveAll(_netId, Frequency, Address); set => _network.SetDeviceReceiveAll(_netId, Frequency, Address, value); } public DeviceNetworkConnection(DeviceNetwork network, int netId, string address, int frequency) { _network = network; _netId = netId; Open = true; Address = address; Frequency = frequency; } public bool Send(int frequency, string address, IReadOnlyDictionary<string, string> payload, Metadata metadata) { return Open && _network.EnqueuePackage(_netId, frequency, address, payload, Address, metadata); } public bool Send(int frequency, string address, Dictionary<string, string> payload) { return Send(frequency, address, payload); } public bool Send(string address, Dictionary<string, string> payload) { return Send(0, address, payload); } public bool Broadcast(int frequency, IReadOnlyDictionary<string, string> payload, Metadata metadata) { return Open && _network.EnqueuePackage(_netId, frequency, "", payload, Address, metadata, true); } public bool Broadcast(int frequency, Dictionary<string, string> payload) { return Broadcast(frequency, payload); } public bool Broadcast(Dictionary<string, string> payload) { return Broadcast(0, payload); } public void Close() { _network.RemoveDevice(_netId, Frequency, Address); Open = false; } } }
mit
C#
27a299c779df61e5de5e7779e587a4262d8aa6c2
Update GetSmartMarkerNotifications.cs
asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET
Examples/CSharp/Articles/GetSmartMarkerNotifications.cs
Examples/CSharp/Articles/GetSmartMarkerNotifications.cs
using System; using Aspose.Cells; namespace Aspose.Cells.Examples.Articles { class GetSmartMarkerNotifications { static void Main() { //ExStart:1 string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); string outputPath = dataDir + "Output.out.xlsx"; //Instantiate a new Workbook designer WorkbookDesigner designer = new WorkbookDesigner(); /********************************************************************** //Get the first worksheet of the workbook Worksheet sheet = report.Workbook.Worksheets[0]; //Set the Variable Array marker to a cell //You may also place this Smart Marker into a template file manually using Excel and then open this file via WorkbookDesigner sheet.Cells.Get("A1").PutValue("&=$VariableArray"); //Set the data source for the marker(s) report.DataSource("VariableArray", new String[] { "English", "Arabic", "Hindi", "Urdu", "French" }); //Set the CallBack property report.CallBack(new SmartMarkerCallBack(report.Workbook)); //Process the markers report.Process(false); //Save the result report.Workbook.Save(outputPath); *******************************************/ Console.WriteLine("File saved {0}", outputPath); } } class SmartMarkerCallBack: ISmartMarkerCallBack { Workbook workbook; public SmartMarkerCallBack(Workbook workbook) { this.workbook = workbook; } public void Process(int sheetIndex, int rowIndex, int colIndex, String tableName, String columnName) { Console.WriteLine("Processing Cell: " + workbook.Worksheets[sheetIndex].Name + "!" + CellsHelper.CellIndexToName(rowIndex, colIndex)); Console.WriteLine("Processing Marker: " + tableName + "." + columnName); } //ExEnd:1 } }
using System; using Aspose.Cells; namespace Aspose.Cells.Examples.Articles { class GetSmartMarkerNotifications { static void Main() { string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); string outputPath = dataDir + "Output.out.xlsx"; //Instantiate a new Workbook designer WorkbookDesigner designer = new WorkbookDesigner(); /********************************************************************** //Get the first worksheet of the workbook Worksheet sheet = report.Workbook.Worksheets[0]; //Set the Variable Array marker to a cell //You may also place this Smart Marker into a template file manually using Excel and then open this file via WorkbookDesigner sheet.Cells.Get("A1").PutValue("&=$VariableArray"); //Set the data source for the marker(s) report.DataSource("VariableArray", new String[] { "English", "Arabic", "Hindi", "Urdu", "French" }); //Set the CallBack property report.CallBack(new SmartMarkerCallBack(report.Workbook)); //Process the markers report.Process(false); //Save the result report.Workbook.Save(outputPath); *******************************************/ Console.WriteLine("File saved {0}", outputPath); } } class SmartMarkerCallBack: ISmartMarkerCallBack { Workbook workbook; public SmartMarkerCallBack(Workbook workbook) { this.workbook = workbook; } public void Process(int sheetIndex, int rowIndex, int colIndex, String tableName, String columnName) { Console.WriteLine("Processing Cell: " + workbook.Worksheets[sheetIndex].Name + "!" + CellsHelper.CellIndexToName(rowIndex, colIndex)); Console.WriteLine("Processing Marker: " + tableName + "." + columnName); } } }
mit
C#
d55b4061100e11ba508726196fcec8995380ed09
Support importing of grayscale textures
virtuallynaked/virtually-naked,virtuallynaked/virtually-naked
Importer/src/texturing/processing/UnmanagedRgbaImage.cs
Importer/src/texturing/processing/UnmanagedRgbaImage.cs
using SharpDX; using SharpDX.WIC; using System; using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; public class UnmanagedRgbaImage : IDisposable { private static readonly HashSet<Guid> SupportedInputPixelFormats = new HashSet<Guid> { PixelFormat.Format24bppRGB, PixelFormat.Format24bppBGR, PixelFormat.Format32bppRGB, PixelFormat.Format32bppBGR, PixelFormat.Format32bppRGBA, PixelFormat.Format32bppBGRA, PixelFormat.Format8bppGray }; public static UnmanagedRgbaImage Load(FileInfo file) { using (var factory = new ImagingFactory()) using (var decoder = new BitmapDecoder(factory, file.FullName, new DecodeOptions { })) using (var frame = decoder.GetFrame(0)) { if (!SupportedInputPixelFormats.Contains(frame.PixelFormat)) { throw new InvalidOperationException($"unsupported pixel format: {frame.PixelFormat}"); } using (var converter = new FormatConverter(factory)) { converter.Initialize(frame, PixelFormat.Format32bppBGR); var size = converter.Size; var image = new UnmanagedRgbaImage(size); converter.CopyPixels(image.Stride, image.PixelData, image.SizeInBytes); return image; } } } public void Save(FileInfo file) { using (var factory = new ImagingFactory()) using (var bitmap = new Bitmap(factory, Size.Width, Size.Height, PixelFormat.Format32bppBGR, DataRectangle)) using (var stream = file.OpenWrite()) using (var encoder = new BitmapEncoder(factory, ContainerFormatGuids.Png, stream)) { using (var frameEncode = new BitmapFrameEncode(encoder)) { frameEncode.Initialize(); frameEncode.WriteSource(bitmap); frameEncode.Commit(); } encoder.Commit(); } } public const int BytesPerPixel = 4; public Size2 Size { get; } public IntPtr PixelData { get; } public UnmanagedRgbaImage(Size2 size) { Size = size; PixelData = Marshal.AllocHGlobal(SizeInBytes); } public int Stride => Size.Width * BytesPerPixel; public int SizeInBytes => Size.Height * Stride; public DataBox DataBox => new DataBox(PixelData, Stride, SizeInBytes); public DataRectangle DataRectangle => new DataRectangle(PixelData, Stride); public uint this[int index] { get { return Utilities.Read<uint>(PixelData + index * BytesPerPixel); } set { Utilities.Write<uint>(PixelData + index * BytesPerPixel, ref value); } } public void Dispose() { Marshal.FreeHGlobal(PixelData); } }
using SharpDX; using SharpDX.WIC; using System; using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; public class UnmanagedRgbaImage : IDisposable { private static readonly HashSet<Guid> SupportedInputPixelFormats = new HashSet<Guid> { PixelFormat.Format24bppRGB, PixelFormat.Format24bppBGR, PixelFormat.Format32bppRGB, PixelFormat.Format32bppBGR, PixelFormat.Format32bppRGBA, PixelFormat.Format32bppBGRA }; public static UnmanagedRgbaImage Load(FileInfo file) { using (var factory = new ImagingFactory()) using (var decoder = new BitmapDecoder(factory, file.FullName, new DecodeOptions { })) using (var frame = decoder.GetFrame(0)) { if (!SupportedInputPixelFormats.Contains(frame.PixelFormat)) { throw new InvalidOperationException($"unsupported pixel format: {frame.PixelFormat}"); } using (var converter = new FormatConverter(factory)) { converter.Initialize(frame, PixelFormat.Format32bppBGR); var size = converter.Size; var image = new UnmanagedRgbaImage(size); converter.CopyPixels(image.Stride, image.PixelData, image.SizeInBytes); return image; } } } public void Save(FileInfo file) { using (var factory = new ImagingFactory()) using (var bitmap = new Bitmap(factory, Size.Width, Size.Height, PixelFormat.Format32bppBGR, DataRectangle)) using (var stream = file.OpenWrite()) using (var encoder = new BitmapEncoder(factory, ContainerFormatGuids.Png, stream)) { using (var frameEncode = new BitmapFrameEncode(encoder)) { frameEncode.Initialize(); frameEncode.WriteSource(bitmap); frameEncode.Commit(); } encoder.Commit(); } } public const int BytesPerPixel = 4; public Size2 Size { get; } public IntPtr PixelData { get; } public UnmanagedRgbaImage(Size2 size) { Size = size; PixelData = Marshal.AllocHGlobal(SizeInBytes); } public int Stride => Size.Width * BytesPerPixel; public int SizeInBytes => Size.Height * Stride; public DataBox DataBox => new DataBox(PixelData, Stride, SizeInBytes); public DataRectangle DataRectangle => new DataRectangle(PixelData, Stride); public uint this[int index] { get { return Utilities.Read<uint>(PixelData + index * BytesPerPixel); } set { Utilities.Write<uint>(PixelData + index * BytesPerPixel, ref value); } } public void Dispose() { Marshal.FreeHGlobal(PixelData); } }
mit
C#
d04b263442af05253b21d8e5841ff13158586d3f
Update version
rockfordlhotka/csla,rockfordlhotka/csla,MarimerLLC/csla,MarimerLLC/csla,rockfordlhotka/csla,MarimerLLC/csla
Source/Csla.Axml.Android/Resources/Resource.Designer.cs
Source/Csla.Axml.Android/Resources/Resource.Designer.cs
#pragma warning disable 1591 //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ [assembly: global::Android.Runtime.ResourceDesignerAttribute("Csla.Axml.Resource", IsApplication=false)] namespace Csla.Axml { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "13.0.0.73")] public partial class Resource { static Resource() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } public partial class Attribute { static Attribute() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Attribute() { } } public partial class String { // aapt resource value: 0x7F010000 public static int ApplicationName = 2130771968; static String() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private String() { } } } } #pragma warning restore 1591
#pragma warning disable 1591 //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ [assembly: global::Android.Runtime.ResourceDesignerAttribute("Csla.Axml.Resource", IsApplication=false)] namespace Csla.Axml { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.3.99.16")] public partial class Resource { static Resource() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } public partial class Attribute { static Attribute() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Attribute() { } } public partial class String { // aapt resource value: 0x7F010000 public static int ApplicationName = 2130771968; static String() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private String() { } } } } #pragma warning restore 1591
mit
C#
a06068a0a0f38156a91ac6bca45f1c805d1645d0
Fix issue #304
KevinHorvatin/poshtools,SpotLabsNET/poshtools,daviwil/poshtools,adamdriscoll/poshtools,mgreenegit/poshtools,Microsoft/poshtools,erwindevreugd/poshtools
PowerShellTools/Commands/ExecuteWithParametersAsScriptCommand.cs
PowerShellTools/Commands/ExecuteWithParametersAsScriptCommand.cs
using System.Management.Automation.Language; using EnvDTE80; using Microsoft.VisualStudio.Editor; using Microsoft.VisualStudio.TextManager.Interop; using PowerShellTools.Commands.UserInterface; namespace PowerShellTools.Commands { /// <summary> /// Command for executing a script with parameters prompt from the editor context menu. /// </summary> internal sealed class ExecuteWithParametersAsScriptCommand : ExecuteFromEditorContextMenuCommand { private ScriptParameterResult _parameterResult; private IVsTextManager _textManager; private IVsEditorAdaptersFactoryService _adaptersFactory; private ParamBlockAst _paramBlock; internal ExecuteWithParametersAsScriptCommand(IVsEditorAdaptersFactoryService adaptersFactory, IVsTextManager textManager, IDependencyValidator validator) : base(validator) { _adaptersFactory = adaptersFactory; _textManager = textManager; } protected override ScriptParameterResult ScriptArgs { get { if (_parameterResult == null && HasParameters()) { _parameterResult = ParameterEditorHelper.GetScriptParamters(_paramBlock); } return _parameterResult; } } protected override int Id { get { return (int)GuidList.CmdidExecuteWithParametersAsScript; } } protected override bool ShouldShowCommand(DTE2 dte2) { return base.ShouldShowCommand(dte2) && HasParameters(); } private bool HasParameters() { _parameterResult = null; return ParameterEditorHelper.HasParameters(_adaptersFactory, _textManager, out _paramBlock); } } }
using System.Management.Automation.Language; using EnvDTE80; using Microsoft.VisualStudio.Editor; using Microsoft.VisualStudio.TextManager.Interop; using PowerShellTools.Commands.UserInterface; namespace PowerShellTools.Commands { /// <summary> /// Command for executing a script with parameters prompt from the editor context menu. /// </summary> internal sealed class ExecuteWithParametersAsScriptCommand : ExecuteFromEditorContextMenuCommand { private ScriptParameterResult _parameterResult; private IVsTextManager _textManager; private IVsEditorAdaptersFactoryService _adaptersFactory; private ParamBlockAst _paramBlock; internal ExecuteWithParametersAsScriptCommand(IVsEditorAdaptersFactoryService adaptersFactory, IVsTextManager textManager, IDependencyValidator validator) : base(validator) { _adaptersFactory = adaptersFactory; _textManager = textManager; } protected override ScriptParameterResult ScriptArgs { get { if (_parameterResult == null) { _parameterResult = ParameterEditorHelper.GetScriptParamters(_paramBlock); } return _parameterResult; } } protected override int Id { get { return (int)GuidList.CmdidExecuteWithParametersAsScript; } } protected override bool ShouldShowCommand(DTE2 dte2) { return base.ShouldShowCommand(dte2) && HasParameters(); } private bool HasParameters() { _parameterResult = null; return ParameterEditorHelper.HasParameters(_adaptersFactory, _textManager, out _paramBlock); } } }
apache-2.0
C#
492870ba7b619b83adf20ca06e6004fcdb11aa1f
fix instructor controller route
louthy/language-ext,StefanBertels/language-ext,StanJav/language-ext
Samples/Contoso/Contoso.Web/Controllers/InstructorsController.cs
Samples/Contoso/Contoso.Web/Controllers/InstructorsController.cs
using System.Threading.Tasks; using Contoso.Application.Instructors.Commands; using Contoso.Application.Instructors.Queries; using Contoso.Web.Extensions; using MediatR; using Microsoft.AspNetCore.Mvc; namespace Contoso.Web.Controllers { [Produces("application/json")] [Route("api/[controller]")] [ApiController] public class InstructorsController : ControllerBase { private readonly IMediator _mediator; public InstructorsController(IMediator mediator) => _mediator = mediator; [HttpGet("{instructorId}")] public Task<IActionResult> Get(int instructorId) => _mediator.Send(new GetInstructorById(instructorId)).ToActionResult(); [HttpPost] public Task<IActionResult> Create([FromBody] CreateInstructor createInstructor) => _mediator.Send(createInstructor).ToActionResult(); [HttpPut] public Task<IActionResult> Update([FromBody] UpdateInstructor updateInstructor) => _mediator.Send(updateInstructor).ToActionResult(); [HttpDelete] public Task<IActionResult> Delete([FromBody] DeleteInstructor deleteInstructor) => _mediator.Send(deleteInstructor).ToActionResult(); [HttpGet("officeassignment/{instructorId}")] public Task<IActionResult> GetOfficeAssignment(int instructorId) => _mediator.Send(new GetOfficeAssignment(instructorId)).ToActionResult(); [HttpPost("officeassignment")] public async Task<IActionResult> CreateOfficeAssignment([FromBody] CreateOfficeAssignment create) => await _mediator.Send(create).ToActionResult(); } }
using System.Threading.Tasks; using Contoso.Application.Instructors.Commands; using Contoso.Application.Instructors.Queries; using Contoso.Web.Extensions; using MediatR; using Microsoft.AspNetCore.Mvc; namespace Contoso.Web.Controllers { [Produces("application/json")] [Route("api/[controller]")] [ApiController] public class InstructorsController : ControllerBase { private readonly IMediator _mediator; public InstructorsController(IMediator mediator) => _mediator = mediator; [HttpGet("{instructorId}")] public Task<IActionResult> Get(int instructorId) => _mediator.Send(new GetInstructorById(instructorId)).ToActionResult(); [HttpPost] public Task<IActionResult> Create([FromBody] CreateInstructor createInstructor) => _mediator.Send(createInstructor).ToActionResult(); [HttpPut] public Task<IActionResult> Update([FromBody] UpdateInstructor updateInstructor) => _mediator.Send(updateInstructor).ToActionResult(); [HttpDelete] public Task<IActionResult> Delete([FromBody] DeleteInstructor deleteInstructor) => _mediator.Send(deleteInstructor).ToActionResult(); [HttpGet("officeassignment/{instructorId}")] public Task<IActionResult> GetOfficeAssignment(int instructorId) => _mediator.Send(new GetOfficeAssignment(instructorId)).ToActionResult(); [HttpPost] public async Task<IActionResult> CreateOfficeAssignment([FromBody] CreateOfficeAssignment create) => await _mediator.Send(create).ToActionResult(); } }
mit
C#
160459a2c058d14ab7a21bab25a0e8cb9262c0f0
Update ConfigurationRootSetupBase.cs
tiksn/TIKSN-Framework
TIKSN.Core/Configuration/ConfigurationRootSetupBase.cs
TIKSN.Core/Configuration/ConfigurationRootSetupBase.cs
using System.Collections.Generic; using Microsoft.Extensions.Configuration; using TIKSN.Analytics.Logging.NLog; using TIKSN.FileSystem; namespace TIKSN.Configuration { public abstract class ConfigurationRootSetupBase { protected readonly ConfigurationBuilder _configurationBuilder; protected readonly object _configurationRootLocker = new(); protected IConfigurationRoot _configurationRoot; protected IDictionary<string, string> _switchMappings; protected ConfigurationRootSetupBase() { this._configurationBuilder = new ConfigurationBuilder(); this._switchMappings = new Dictionary<string, string> { { "--nlog-viewer-address", ConfigurationPath.Combine(RemoteNLogViewerOptions.RemoteNLogViewerConfigurationSection, nameof(RemoteNLogViewerOptions.Address)) }, { "--nlog-viewer-include-call-site", ConfigurationPath.Combine(RemoteNLogViewerOptions.RemoteNLogViewerConfigurationSection, nameof(RemoteNLogViewerOptions.IncludeCallSite)) }, { "--nlog-viewer-include-source-info", ConfigurationPath.Combine(RemoteNLogViewerOptions.RemoteNLogViewerConfigurationSection, nameof(RemoteNLogViewerOptions.IncludeSourceInfo)) } }; } public virtual IConfigurationRoot GetConfigurationRoot() { if (this._configurationRoot == null) { lock (this._configurationRootLocker) { if (this._configurationRoot == null) { var builder = new ConfigurationBuilder(); this.SetupConfiguration(builder); this._configurationRoot = builder.Build(); } } } return this._configurationRoot; } public virtual void UpdateSources(IKnownFolders knownFolders) => this._configurationRoot.Reload(); protected virtual void SetupConfiguration(IConfigurationBuilder builder) => builder.AddInMemoryCollection(); } }
using System.Collections.Generic; using Microsoft.Extensions.Configuration; using TIKSN.Analytics.Logging.NLog; using TIKSN.FileSystem; namespace TIKSN.Configuration { public abstract class ConfigurationRootSetupBase { protected readonly ConfigurationBuilder _configurationBuilder; protected readonly object _configurationRootLocker = new(); protected IConfigurationRoot _configurationRoot; protected IDictionary<string, string> _switchMappings; protected ConfigurationRootSetupBase() { this._configurationBuilder = new ConfigurationBuilder(); this._switchMappings = new Dictionary<string, string>(); this._switchMappings.Add("--nlog-viewer-address", ConfigurationPath.Combine(RemoteNLogViewerOptions.RemoteNLogViewerConfigurationSection, nameof(RemoteNLogViewerOptions.Address))); this._switchMappings.Add("--nlog-viewer-include-call-site", ConfigurationPath.Combine(RemoteNLogViewerOptions.RemoteNLogViewerConfigurationSection, nameof(RemoteNLogViewerOptions.IncludeCallSite))); this._switchMappings.Add("--nlog-viewer-include-source-info", ConfigurationPath.Combine(RemoteNLogViewerOptions.RemoteNLogViewerConfigurationSection, nameof(RemoteNLogViewerOptions.IncludeSourceInfo))); } public virtual IConfigurationRoot GetConfigurationRoot() { if (this._configurationRoot == null) { lock (this._configurationRootLocker) { if (this._configurationRoot == null) { var builder = new ConfigurationBuilder(); this.SetupConfiguration(builder); this._configurationRoot = builder.Build(); } } } return this._configurationRoot; } public virtual void UpdateSources(IKnownFolders knownFolders) => this._configurationRoot.Reload(); protected virtual void SetupConfiguration(IConfigurationBuilder builder) => builder.AddInMemoryCollection(); } }
mit
C#
e7cb93519a9f344a802eb66827052c5ae0421791
Add information about http status codes in the reporting API
TimeLog/TimeLogApiSdk,TimeLog/TimeLogApiSdk,TimeLog/TimeLogApiSdk
TimeLog.Api.Documentation/Views/Reporting/Index.cshtml
TimeLog.Api.Documentation/Views/Reporting/Index.cshtml
 @{ ViewBag.Title = "Reporting API - Introduction"; } <article class="article"> <h1>Introduction to the Reporting API</h1> <p> The Reporting API is based on standard web technologies, web services and XML. Use the Reporting API to extract from TimeLog into intranets, extranets, business reporting tools, applications etc. </p> <p> The idea behind the Reporting API is to give access to as much of the TimeLog Project data models as possible in a easy to use XML format. The origin of the API goes way back in the history of TimeLog, so we will extend on it on a per-request basis for new fields and data types. Please get in touch, if you think we lack some information in the various methods. </p> <p> Be aware that no security policies on user access will be applied to any of the methods in the Reporting API. The Reporting API is for flat data extractions. Take care to apply your own policies if you are exposing the data in a data warehouse or other business intelligence tools. </p> <h2 id="status-codes">Status codes</h2> <p> The reporting will (starting from end May 2021) return specific HTTP status codes related to the result. The result body will remain unchanged and will in many cases provide additional information. Possible status responses: </p> <ul class="arrows"> <li>200 OK - request successful</li> <li>204 No Content - the result of the request is empty</li> <li>400 Bad Request - covers both issues with input parameters, but possibly also internal errors</li> <li>401 Unauthorized - the Site ID, API ID and API password combination is invalid</li> </ul> </article>
 @{ ViewBag.Title = "Reporting API - Introduction"; } <article class="article"> <h1>Introduction to the Reporting API</h1> <p> The Reporting API is based on standard web technologies, web services and XML. Use the Reporting API to extract from TimeLog into intranets, extranets, business reporting tools, applications etc. </p> <p> The idea behind the Reporting API is to give access to as much of the TimeLog Project data models as possible in a easy to use XML format. The origin of the API goes way back in the history of TimeLog, so we will extend on it on a per-request basis for new fields and data types. Please get in touch, if you think we lack some information in the various methods. </p> <p> Be aware that no security policies on user access will be applied to any of the methods in the Reporting API. The Reporting API is for flat data extractions. Take care to apply your own policies if you are exposing the data in a data warehouse or other business intelligence tools. </p> </article>
mit
C#
5ec5f4d4fa6fe08734bd7e3c460e84890a80c199
change test to use available port
zhdusurfin/HttpMock,oschwald/HttpMock,mattolenik/HttpMock,hibri/HttpMock
src/HttpMock.Integration.Tests/MultipleTestsUsingTheSameStubServerAndDifferentUris.cs
src/HttpMock.Integration.Tests/MultipleTestsUsingTheSameStubServerAndDifferentUris.cs
using System.Net; using NUnit.Framework; namespace HttpMock.Integration.Tests { [TestFixture] public class MultipleTestsUsingTheSameStubServerAndDifferentUris { private IHttpServer _httpMockRepository; private string _host; [SetUp] public void SetUp() { _host = string.Format("http://localhost:{0}", PortHelper.FindLocalAvailablePortForTesting()); _httpMockRepository = HttpMockRepository.At(_host); } [Test] public void FirstTest() { var wc = new WebClient(); string stubbedReponse = "Response for first test"; var stubHttp = _httpMockRepository .WithNewContext(); stubHttp .Stub(x => x.Post("/firsttest")) .Return(stubbedReponse) .OK(); Assert.That(wc.UploadString(string.Format("{0}/firsttest/", _host), "x"), Is.EqualTo(stubbedReponse)); } [Test] public void SecondTest() { var wc = new WebClient(); string stubbedReponse = "Response for second test"; _httpMockRepository .WithNewContext() .Stub(x => x.Post("/secondtest")) .Return(stubbedReponse) .OK(); Assert.That(wc.UploadString(string.Format("{0}/secondtest/", _host), "x"), Is.EqualTo(stubbedReponse)); } [Test] public void Stubs_should_be_unique_within_context() { var wc = new WebClient(); string stubbedReponseOne = "Response for first test in context"; string stubbedReponseTwo = "Response for second test in context"; IHttpServer stubHttp = _httpMockRepository.WithNewContext(); stubHttp.Stub(x => x.Post("/firsttest")) .Return(stubbedReponseOne) .OK(); stubHttp.Stub(x => x.Post("/secondtest")) .Return(stubbedReponseTwo) .OK(); Assert.That(wc.UploadString(string.Format("{0}/firsttest/", _host), "x"), Is.EqualTo(stubbedReponseOne)); Assert.That(wc.UploadString(string.Format("{0}/secondtest/", _host), "x"), Is.EqualTo(stubbedReponseTwo)); } } }
using System.Net; using NUnit.Framework; namespace HttpMock.Integration.Tests { [TestFixture] public class MultipleTestsUsingTheSameStubServerAndDifferentUris { private IHttpServer _httpMockRepository; [SetUp] public void SetUp() { _httpMockRepository = HttpMockRepository.At("http://localhost:8080"); } [Test] public void FirstTest() { var wc = new WebClient(); string stubbedReponse = "Response for first test"; var stubHttp = _httpMockRepository .WithNewContext(); stubHttp .Stub(x => x.Post("/firsttest")) .Return(stubbedReponse) .OK(); Assert.That(wc.UploadString("Http://localhost:8080/firsttest/", "x"), Is.EqualTo(stubbedReponse)); } [Test] public void SecondTest() { var wc = new WebClient(); string stubbedReponse = "Response for second test"; _httpMockRepository .WithNewContext() .Stub(x => x.Post("/secondtest")) .Return(stubbedReponse) .OK(); Assert.That(wc.UploadString("Http://localhost:8080/secondtest/", "x"), Is.EqualTo(stubbedReponse)); } [Test] public void Stubs_should_be_unique_within_context() { var wc = new WebClient(); string stubbedReponseOne = "Response for first test in context"; string stubbedReponseTwo = "Response for second test in context"; IHttpServer stubHttp = _httpMockRepository.WithNewContext(); stubHttp.Stub(x => x.Post("/firsttest")) .Return(stubbedReponseOne) .OK(); stubHttp.Stub(x => x.Post("/secondtest")) .Return(stubbedReponseTwo) .OK(); Assert.That(wc.UploadString("Http://localhost:8080/firsttest/", "x"), Is.EqualTo(stubbedReponseOne)); Assert.That(wc.UploadString("Http://localhost:8080/secondtest/", "x"), Is.EqualTo(stubbedReponseTwo)); } } }
mit
C#
e36702ffbd68fcf85592ceabdd5348af4b9bd7b6
Fix DropFilterFactory namespace
karolz-ms/diagnostics-eventflow
src/Microsoft.Diagnostics.EventFlow.Core/Implementations/Filters/DropFilterFactory.cs
src/Microsoft.Diagnostics.EventFlow.Core/Implementations/Filters/DropFilterFactory.cs
// ------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the repo root for license information. // ------------------------------------------------------------ using Microsoft.Diagnostics.EventFlow.Configuration; using Microsoft.Diagnostics.EventFlow.Filters; using Microsoft.Extensions.Configuration; using Validation; namespace Microsoft.Diagnostics.EventFlow.Filters { public class DropFilterFactory: IPipelineItemFactory<DropFilter> { public DropFilter CreateItem(IConfiguration configuration, IHealthReporter healthReporter) { Requires.NotNull(configuration, nameof(configuration)); Requires.NotNull(healthReporter, nameof(healthReporter)); var filterConfiguration = new IncludeConditionFilterConfiguration(); try { configuration.Bind(filterConfiguration); } catch { healthReporter.ReportProblem($"{nameof(DropFilterFactory)}: configuration is invalid for filter {configuration.ToString()}"); return null; } return new DropFilter(filterConfiguration.Include); } } }
// ------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the repo root for license information. // ------------------------------------------------------------ using Microsoft.Diagnostics.EventFlow.Configuration; using Microsoft.Diagnostics.EventFlow.Filters; using Microsoft.Extensions.Configuration; using Validation; namespace Microsoft.Diagnostics.EventFlow.Core.Implementations.Filters { public class DropFilterFactory: IPipelineItemFactory<DropFilter> { public DropFilter CreateItem(IConfiguration configuration, IHealthReporter healthReporter) { Requires.NotNull(configuration, nameof(configuration)); Requires.NotNull(healthReporter, nameof(healthReporter)); var filterConfiguration = new IncludeConditionFilterConfiguration(); try { configuration.Bind(filterConfiguration); } catch { healthReporter.ReportProblem($"{nameof(DropFilterFactory)}: configuration is invalid for filter {configuration.ToString()}"); return null; } return new DropFilter(filterConfiguration.Include); } } }
mit
C#
32f5a23835b45a74ffc5dfd04f76cc9bbde4a0a3
Add ING homepay
foxip/mollie-api-csharp
Mollie.Api/Models/Method.cs
Mollie.Api/Models/Method.cs
namespace Mollie.Api.Models { /// <summary> /// Payment method /// </summary> public enum Method { ideal, creditcard, mistercash, sofort, banktransfer, directdebit, belfius, kbc, bitcoin, paypal, paysafecard, giftcard, inghomepay } }
namespace Mollie.Api.Models { /// <summary> /// Payment method /// </summary> public enum Method { ideal, creditcard, mistercash, sofort, banktransfer, directdebit, belfius, kbc, bitcoin, paypal, paysafecard, giftcard, } }
bsd-2-clause
C#
f8cab3353a2f76c933d68254aa9fd502b7b237da
Add CylinderLineRenderer to Graphics namespace
thijser/ARGAME,thijser/ARGAME,thijser/ARGAME
ARGame/Assets/Scripts/Graphics/CylinderLineRenderer.cs
ARGame/Assets/Scripts/Graphics/CylinderLineRenderer.cs
using UnityEngine; using System.Collections; using System.Collections.Generic; namespace Graphics { /// <summary> /// Custom LineRenderer for lasers that doesn't have the rendering problems /// that occur in the Unity LineRenderer implementation. /// /// NOTE: Implementation assumes that up is always [0, 1, 0]. /// </summary> public class CylinderLineRenderer : MonoBehaviour { public Vector3[] Positions; public Material LineMaterial; public float LineWidth = 1.0f; private MeshFilter meshFilter; private MeshRenderer meshRenderer; public void Start() { // Create components for rendering line mesh meshFilter = gameObject.AddComponent<MeshFilter>(); meshRenderer = gameObject.AddComponent<MeshRenderer>(); meshFilter.mesh = new Mesh(); } public void Update() { // Update line material meshRenderer.material = LineMaterial; // Create mesh that represents line Mesh mesh = meshFilter.mesh; List<Vector3> vertices = new List<Vector3>(); List<int> triangles = new List<int>(); for (int i = 0; i < Positions.Length - 1; i++) { AddLineSegment(Positions[i], Positions[i + 1], vertices, triangles); } mesh.vertices = vertices.ToArray(); mesh.triangles = triangles.ToArray(); mesh.RecalculateNormals(); } private void AddLineSegment(Vector3 from, Vector3 to, List<Vector3> vertices, List<int> triangles) { int offset = vertices.Count; triangles.Add(offset + 0); triangles.Add(offset + 1); triangles.Add(offset + 2); triangles.Add(offset + 2); triangles.Add(offset + 3); triangles.Add(offset + 0); Vector3 left = Vector3.Cross(from - to, Vector3.up).normalized; Vector3 up = Vector3.up; vertices.Add(from - left * LineWidth / 2); vertices.Add(to - left * LineWidth / 2); vertices.Add(to + left * LineWidth / 2); vertices.Add(from + left * LineWidth / 2); } } }
using UnityEngine; using System.Collections; using System.Collections.Generic; public class CylinderLineRenderer : MonoBehaviour { public Vector3[] Positions; public Material LineMaterial; public float LineWidth = 1.0f; public bool UseWorldSpace = true; private MeshFilter meshFilter; private MeshRenderer meshRenderer; public void Start() { // Create components for rendering line mesh meshFilter = gameObject.AddComponent<MeshFilter>(); meshRenderer = gameObject.AddComponent<MeshRenderer>(); meshFilter.mesh = new Mesh(); } public void Update() { // Update line material meshRenderer.material = LineMaterial; // Create mesh that represents line Mesh mesh = meshFilter.mesh; List<Vector3> vertices = new List<Vector3>(); List<int> triangles = new List<int>(); for (int i = 0; i < Positions.Length - 1; i++) { AddLineSegment(Positions[i], Positions[i + 1], vertices, triangles); } mesh.vertices = vertices.ToArray(); mesh.triangles = triangles.ToArray(); mesh.RecalculateNormals(); } private void AddLineSegment(Vector3 from, Vector3 to, List<Vector3> vertices, List<int> triangles) { int offset = vertices.Count; triangles.Add(offset + 0); triangles.Add(offset + 1); triangles.Add(offset + 2); triangles.Add(offset + 2); triangles.Add(offset + 3); triangles.Add(offset + 0); Vector3 left = Vector3.Cross(from - to, Vector3.up).normalized; Vector3 up = Vector3.up; vertices.Add(from - left * LineWidth / 2); vertices.Add(to - left * LineWidth / 2); vertices.Add(to + left * LineWidth / 2); vertices.Add(from + left * LineWidth / 2); } }
mit
C#
674b30fb3e92e3ebd9ce1edb8d3f784e67382a75
Add '__GLOBALOFFSET__' variable
whampson/cascara,whampson/bft-spec
Cascara/Src/Interpreter/SpecialVariables.cs
Cascara/Src/Interpreter/SpecialVariables.cs
#region License /* Copyright (c) 2017-2018 Wes Hampson * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #endregion using System.Collections.Generic; using WHampson.Cascara.Extensions; namespace WHampson.Cascara.Interpreter { internal static partial class ReservedWords { /// <summary> /// Defines all special variable identifiers. /// </summary> /// <remarks> /// "Special variables" are variables that are predefined by the interpreter. /// </remarks> public static class SpecialVariables { public const string Offset = "__OFFSET__"; public const string GlobalOffset = "__GLOBALOFFSET__"; public const string Filesize = "__FILESIZE__"; public static readonly HashSet<string> AllSpecialVariables = new HashSet<string>( typeof(SpecialVariables).GetPublicConstants<string>()); } } }
#region License /* Copyright (c) 2017-2018 Wes Hampson * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #endregion using System.Collections.Generic; using WHampson.Cascara.Extensions; namespace WHampson.Cascara.Interpreter { internal static partial class ReservedWords { /// <summary> /// Defines all special variable identifiers. /// </summary> /// <remarks> /// "Special variables" are variables that are predefined by the interpreter. /// </remarks> public static class SpecialVariables { public const string Filesize = "__FILESIZE__"; public const string Offset = "__OFFSET__"; public static readonly HashSet<string> AllSpecialVariables = new HashSet<string>( typeof(SpecialVariables).GetPublicConstants<string>()); } } }
mit
C#
839fb2028dd540e22803b5b82ed01c806a9c8298
Make time public
ParkitectNexus/Dodgems
CustomFlatRide/FlatRideScript/BumperCars.cs
CustomFlatRide/FlatRideScript/BumperCars.cs
using BumperCars.CustomFlatRide.BumperCars; using UnityEngine; namespace BumperCars.CustomFlatRide.FlatRideScript { public class BumperCars : FlatRide { public new enum State { Stopped, Running } [Serialized] public State CurrentState; [Serialized] public float Time; public AudioClip Tune; void Start() { guestsCanRaiseArms = false; CurrentState = State.Stopped; Transform cars = transform.Find("Cars"); foreach (Transform car in cars) { car.gameObject.AddComponent<BumperCar>(); } AudioSource audio = gameObject.AddComponent<AudioSource>(); audio.clip = Tune; audio.playOnAwake = true; audio.loop = true; audio.spatialBlend = 1; audio.rolloffMode = AudioRolloffMode.Linear; audio.maxDistance = 75; audio.volume = 0.1f; base.Start(); } public override void onStartRide() { base.onStartRide(); CurrentState = State.Running; } public override void tick(StationController stationController) { if (CurrentState == State.Running) { Time += UnityEngine.Time.deltaTime; if (Time > 25) { CurrentState = State.Stopped; Time = 0; } } } public override bool shouldLetGuestsOut() { return CurrentState == State.Stopped; } } }
using BumperCars.CustomFlatRide.BumperCars; using UnityEngine; namespace BumperCars.CustomFlatRide.FlatRideScript { public class BumperCars : FlatRide { public new enum State { Stopped, Running } [Serialized] public State CurrentState; [Serialized] private float _time; public AudioClip Tune; void Start() { guestsCanRaiseArms = false; CurrentState = State.Stopped; Transform cars = transform.Find("Cars"); foreach (Transform car in cars) { car.gameObject.AddComponent<BumperCar>(); } AudioSource audio = gameObject.AddComponent<AudioSource>(); audio.clip = Tune; audio.playOnAwake = true; audio.loop = true; audio.spatialBlend = 1; audio.rolloffMode = AudioRolloffMode.Linear; audio.maxDistance = 75; audio.volume = 0.1f; base.Start(); } public override void onStartRide() { base.onStartRide(); CurrentState = State.Running; } public override void tick(StationController stationController) { if (CurrentState == State.Running) { _time += Time.deltaTime; if (_time > 25) { CurrentState = State.Stopped; _time = 0; } } } public override bool shouldLetGuestsOut() { return CurrentState == State.Stopped; } } }
mit
C#
099d0bd502cc49300193492747c79c112e8d33e1
support options on service bus triggers
aranasoft/cobweb
src/Azure/ServiceBus/Queue.cs
src/Azure/ServiceBus/Queue.cs
using System; using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.ServiceBus; using Microsoft.ServiceBus.Messaging; namespace Cobweb.Azure.ServiceBus { public abstract class Queue { private NamespaceManager _namespaceManager; private QueueClient _queueClient; private bool queueValidated; protected abstract string Name { get; } protected abstract string ConnectionString { get; set; } protected NamespaceManager NamespaceManager { get { _namespaceManager = _namespaceManager ?? (_namespaceManager = NamespaceManager.CreateFromConnectionString(ConnectionString)); return _namespaceManager; } } protected QueueClient QueueClient { get { EnsureQueue(); _queueClient = _queueClient ?? (_queueClient = QueueClient.CreateFromConnectionString(ConnectionString, Name)); return _queueClient; } } protected void EnsureQueue() { if (!NamespaceManager.QueueExists(Name)) { NamespaceManager.CreateQueue(Name); queueValidated = true; } } public void SendMessage(BrokeredMessage message) { QueueClient.Send(message); } public Task SendMessageAsync(BrokeredMessage message) { return QueueClient.SendAsync(message); } public void SendMessages(IEnumerable<BrokeredMessage> messages) { QueueClient.SendBatch(messages); } public Task SendMessagesAsync(IEnumerable<BrokeredMessage> messages) { return QueueClient.SendBatchAsync(messages); } public void OnMessage(Action<BrokeredMessage> callback) { QueueClient.OnMessage(callback); } public void OnMessage(Action<BrokeredMessage> callback, OnMessageOptions options) { QueueClient.OnMessage(callback, options); } } }
using System; using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.ServiceBus; using Microsoft.ServiceBus.Messaging; namespace Cobweb.Azure.ServiceBus { public abstract class Queue { private NamespaceManager _namespaceManager; private QueueClient _queueClient; private bool queueValidated; protected abstract string Name { get; } protected abstract string ConnectionString { get; set; } protected NamespaceManager NamespaceManager { get { _namespaceManager = _namespaceManager ?? (_namespaceManager = NamespaceManager.CreateFromConnectionString(ConnectionString)); return _namespaceManager; } } protected QueueClient QueueClient { get { EnsureQueue(); _queueClient = _queueClient ?? (_queueClient = QueueClient.CreateFromConnectionString(ConnectionString, Name)); return _queueClient; } } protected void EnsureQueue() { if (!NamespaceManager.QueueExists(Name)) { NamespaceManager.CreateQueue(Name); queueValidated = true; } } public void SendMessage(BrokeredMessage message) { QueueClient.Send(message); } public Task SendMessageAsync(BrokeredMessage message) { return QueueClient.SendAsync(message); } public void SendMessages(IEnumerable<BrokeredMessage> messages) { QueueClient.SendBatch(messages); } public Task SendMessagesAsync(IEnumerable<BrokeredMessage> messages) { return QueueClient.SendBatchAsync(messages); } public void OnMessage(Action<BrokeredMessage> callback) { QueueClient.OnMessage(callback); } } }
bsd-3-clause
C#
45f7ec54aee736d594aa36395df554df249b996a
Fix hair rendering on Linux
ethanmoffat/EndlessClient
EndlessClient/Rendering/CharacterProperties/HatRenderer.cs
EndlessClient/Rendering/CharacterProperties/HatRenderer.cs
// Original Work Copyright (c) Ethan Moffat 2014-2016 // This file is subject to the GPL v2 License // For additional details, see the LICENSE file using EndlessClient.Content; using EndlessClient.Rendering.Sprites; using EOLib; using EOLib.Domain.Character; using EOLib.Domain.Extensions; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace EndlessClient.Rendering.CharacterProperties { public class HatRenderer : BaseCharacterPropertyRenderer { private readonly IShaderProvider _shaderProvider; private readonly ISpriteSheet _hatSheet; private readonly ISpriteSheet _hairSheet; private readonly HairRenderLocationCalculator _hairRenderLocationCalculator; public override bool CanRender => _hatSheet.HasTexture && _renderProperties.HatGraphic != 0; public HatRenderer(IShaderProvider shaderProvider, ICharacterRenderProperties renderProperties, ISpriteSheet hatSheet, ISpriteSheet hairSheet) : base(renderProperties) { _shaderProvider = shaderProvider; _hatSheet = hatSheet; _hairSheet = hairSheet; _hairRenderLocationCalculator = new HairRenderLocationCalculator(_renderProperties); } public override void Render(SpriteBatch spriteBatch, Rectangle parentCharacterDrawArea) { var offsets = _hairRenderLocationCalculator.CalculateDrawLocationOfCharacterHair(_hairSheet.SourceRectangle, parentCharacterDrawArea); var flippedOffset = _renderProperties.IsFacing(EODirection.Up, EODirection.Right) ? -2 : 0; var drawLoc = new Vector2(offsets.X + flippedOffset, offsets.Y - 3); _shaderProvider.Shaders[ShaderRepository.HairClip].CurrentTechnique.Passes[0].Apply(); Render(spriteBatch, _hatSheet, drawLoc); } } }
// Original Work Copyright (c) Ethan Moffat 2014-2016 // This file is subject to the GPL v2 License // For additional details, see the LICENSE file using EndlessClient.Content; using EndlessClient.Rendering.Sprites; using EOLib; using EOLib.Domain.Character; using EOLib.Domain.Extensions; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace EndlessClient.Rendering.CharacterProperties { public class HatRenderer : BaseCharacterPropertyRenderer { private readonly IShaderProvider _shaderProvider; private readonly ISpriteSheet _hatSheet; private readonly ISpriteSheet _hairSheet; private readonly HairRenderLocationCalculator _hairRenderLocationCalculator; public override bool CanRender => _hatSheet.HasTexture && _renderProperties.HatGraphic != 0; public HatRenderer(IShaderProvider shaderProvider, ICharacterRenderProperties renderProperties, ISpriteSheet hatSheet, ISpriteSheet hairSheet) : base(renderProperties) { _shaderProvider = shaderProvider; _hatSheet = hatSheet; _hairSheet = hairSheet; _hairRenderLocationCalculator = new HairRenderLocationCalculator(_renderProperties); } public override void Render(SpriteBatch spriteBatch, Rectangle parentCharacterDrawArea) { var offsets = _hairRenderLocationCalculator.CalculateDrawLocationOfCharacterHair(_hairSheet.SourceRectangle, parentCharacterDrawArea); var flippedOffset = _renderProperties.IsFacing(EODirection.Up, EODirection.Right) ? -2 : 0; var drawLoc = new Vector2(offsets.X + flippedOffset, offsets.Y - 3); #if LINUX spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.Immediate, effect: _shaderProvider.Shaders[ShaderRepository.HairClip]); #endif Render(spriteBatch, _hatSheet, drawLoc); #if LINUX spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend); #endif } } }
mit
C#
57b3c07aa4395260417e64781f2dc2137d932888
Add ContentType of the response.
andyfmiller/LtiLibrary
LtiLibrary.NetCore/Profiles/ToolConsumerProfileResponse.cs
LtiLibrary.NetCore/Profiles/ToolConsumerProfileResponse.cs
using System.Net; namespace LtiLibrary.NetCore.Profiles { public class ToolConsumerProfileResponse { public string ContentType { get; set; } public HttpStatusCode StatusCode { get; set; } public ToolConsumerProfile ToolConsumerProfile { get; set; } } }
using System.Net; namespace LtiLibrary.NetCore.Profiles { public class ToolConsumerProfileResponse { public HttpStatusCode StatusCode { get; set; } public ToolConsumerProfile ToolConsumerProfile { get; set; } } }
apache-2.0
C#
d6911571bd629cb764d10d04091c2d67734b46ab
add azure bdd connection string
NebcoOrganization/Yuffie,NebcoOrganization/Yuffie
WebApp/Models/AppContext.cs
WebApp/Models/AppContext.cs
using System; using System.IO; using Microsoft.EntityFrameworkCore; namespace Yuffie.WebApp.Models { public class AppContext : DbContext { // public AppContext(DbContextOptions<AppContext> options) : base(options) // { } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseSqlServer(@"Server=tcp:anime-co-db.database.windows.net,1433;Initial Catalog=yuffie-anim;Persist Security Info=False;User ID=azureworker;Password=Tennis94;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30"); // optionsBuilder.UseSqlite("Filename=./confWebApp.db"); } public DbSet<Entity> Entity { get; set; } } }
using System; using System.IO; using Microsoft.EntityFrameworkCore; namespace Yuffie.WebApp.Models { public class AppContext : DbContext { // public AppContext(DbContextOptions<AppContext> options) : base(options) // { } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { //optionsBuilder.UseSqlServer(@"Server=(localdb)\mssqllocaldb;Database=MyDatabase;Trusted_Connection=True;"); optionsBuilder.UseSqlite("Filename=./confWebApp.db"); } public DbSet<Entity> Entity { get; set; } } }
mit
C#
c8dd2f6ec3fe0eefff65f9c407629bde8e4ffb21
Add some docs for ITeamExplorerContext
github/VisualStudio,github/VisualStudio,github/VisualStudio
src/GitHub.Exports/Services/ITeamExplorerContext.cs
src/GitHub.Exports/Services/ITeamExplorerContext.cs
using System; using System.ComponentModel; using GitHub.Models; namespace GitHub.Services { /// <summary> /// Responsible for watching the active repository in Team Explorer. /// A PropertyChanged event is fired when moving to a new repository. /// A StatusChanged event is fired when the CurrentBranch or HeadSha changes. /// </summary> public interface ITeamExplorerContext : INotifyPropertyChanged { /// <summary> /// The active Git repository in Team Explorer. /// This will be null if no repository is active. /// </summary> ILocalRepositoryModel ActiveRepository { get; } /// <summary> /// Fired when the CurrentBranch or HeadSha changes. /// </summary> event EventHandler StatusChanged; } }
using System; using System.ComponentModel; using GitHub.Models; namespace GitHub.Services { public interface ITeamExplorerContext : INotifyPropertyChanged { ILocalRepositoryModel ActiveRepository { get; } event EventHandler StatusChanged; } }
mit
C#
e4f0d88207025465d392519fa12a64520781e3d9
Use of LinkedHashMap instead SequencedHashMap
alobakov/nhibernate-core,livioc/nhibernate-core,ngbrown/nhibernate-core,RogerKratz/nhibernate-core,livioc/nhibernate-core,nhibernate/nhibernate-core,fredericDelaporte/nhibernate-core,nhibernate/nhibernate-core,fredericDelaporte/nhibernate-core,hazzik/nhibernate-core,alobakov/nhibernate-core,hazzik/nhibernate-core,fredericDelaporte/nhibernate-core,hazzik/nhibernate-core,ngbrown/nhibernate-core,gliljas/nhibernate-core,hazzik/nhibernate-core,nkreipke/nhibernate-core,gliljas/nhibernate-core,nkreipke/nhibernate-core,nkreipke/nhibernate-core,ManufacturingIntelligence/nhibernate-core,ManufacturingIntelligence/nhibernate-core,lnu/nhibernate-core,gliljas/nhibernate-core,ngbrown/nhibernate-core,livioc/nhibernate-core,RogerKratz/nhibernate-core,lnu/nhibernate-core,RogerKratz/nhibernate-core,lnu/nhibernate-core,alobakov/nhibernate-core,ManufacturingIntelligence/nhibernate-core,fredericDelaporte/nhibernate-core,RogerKratz/nhibernate-core,nhibernate/nhibernate-core,gliljas/nhibernate-core,nhibernate/nhibernate-core
src/NHibernate/Tuple/EntityModeToTuplizerMapping.cs
src/NHibernate/Tuple/EntityModeToTuplizerMapping.cs
using System; using System.Collections.Generic; using NHibernate.Util; namespace NHibernate.Tuple { /// <summary> Centralizes handling of <see cref="EntityMode"/> to <see cref="ITuplizer"/> mappings. </summary> [Serializable] public abstract class EntityModeToTuplizerMapping { // map of EntityMode -> Tuplizer private readonly IDictionary<EntityMode, ITuplizer> tuplizers = new LinkedHashMap<EntityMode, ITuplizer>(); protected internal void AddTuplizer(EntityMode entityMode, ITuplizer tuplizer) { tuplizers[entityMode] = tuplizer; } /// <summary> Given a supposed instance of an entity/component, guess its entity mode. </summary> /// <param name="obj">The supposed instance of the entity/component.</param> /// <returns> The guessed entity mode. </returns> public virtual EntityMode? GuessEntityMode(object obj) { foreach (KeyValuePair<EntityMode, ITuplizer> entry in tuplizers) { ITuplizer tuplizer = entry.Value; if (tuplizer.IsInstance(obj)) { return entry.Key; } } return null; } /// <summary> /// Locate the contained tuplizer responsible for the given entity-mode. If /// no such tuplizer is defined on this mapping, then return null. /// </summary> /// <param name="entityMode">The entity-mode for which the caller wants a tuplizer. </param> /// <returns> The tuplizer, or null if not found. </returns> public virtual ITuplizer GetTuplizerOrNull(EntityMode entityMode) { ITuplizer result; tuplizers.TryGetValue(entityMode, out result); return result; } /// <summary> Locate the tuplizer contained within this mapping which is responsible /// for the given entity-mode. If no such tuplizer is defined on this /// mapping, then an exception is thrown. /// /// </summary> /// <param name="entityMode">The entity-mode for which the caller wants a tuplizer. /// </param> /// <returns> The tuplizer. /// </returns> /// <throws> HibernateException Unable to locate the requested tuplizer. </throws> public virtual ITuplizer GetTuplizer(EntityMode entityMode) { ITuplizer tuplizer = GetTuplizerOrNull(entityMode); if (tuplizer == null) { throw new HibernateException("No tuplizer found for entity-mode [" + entityMode + "]"); } return tuplizer; } } }
using System; using System.Collections; using NHibernate.Util; namespace NHibernate.Tuple { /// <summary> Centralizes handling of <see cref="EntityMode"/> to <see cref="ITuplizer"/> mappings. </summary> [Serializable] public abstract class EntityModeToTuplizerMapping { // map of EntityMode -> Tuplizer private readonly IDictionary tuplizers = new SequencedHashMap(); protected internal void AddTuplizer(EntityMode entityMode, ITuplizer tuplizer) { tuplizers[entityMode] = tuplizer; } /// <summary> Given a supposed instance of an entity/component, guess its entity mode. </summary> /// <param name="obj">The supposed instance of the entity/component.</param> /// <returns> The guessed entity mode. </returns> public virtual EntityMode? GuessEntityMode(object obj) { foreach (DictionaryEntry entry in tuplizers) { ITuplizer tuplizer = (ITuplizer)entry.Value; if (tuplizer.IsInstance(obj)) { return (EntityMode)entry.Key; } } return null; } /// <summary> /// Locate the contained tuplizer responsible for the given entity-mode. If /// no such tuplizer is defined on this mapping, then return null. /// </summary> /// <param name="entityMode">The entity-mode for which the caller wants a tuplizer. /// </param> /// <returns> The tuplizer, or null if not found. /// </returns> public virtual ITuplizer GetTuplizerOrNull(EntityMode entityMode) { return (ITuplizer)tuplizers[entityMode]; } /// <summary> Locate the tuplizer contained within this mapping which is responsible /// for the given entity-mode. If no such tuplizer is defined on this /// mapping, then an exception is thrown. /// /// </summary> /// <param name="entityMode">The entity-mode for which the caller wants a tuplizer. /// </param> /// <returns> The tuplizer. /// </returns> /// <throws> HibernateException Unable to locate the requested tuplizer. </throws> public virtual ITuplizer GetTuplizer(EntityMode entityMode) { ITuplizer tuplizer = GetTuplizerOrNull(entityMode); if (tuplizer == null) { throw new HibernateException("No tuplizer found for entity-mode [" + entityMode + "]"); } return tuplizer; } } }
lgpl-2.1
C#
ce7309721073c17d39f850b1bdab56c628cc5444
Update to messages v3
cucumber/cucumber,cucumber/cucumber,cucumber/cucumber,cucumber/cucumber,cucumber/cucumber,cucumber/cucumber,cucumber/cucumber,cucumber/cucumber,cucumber/cucumber,cucumber/cucumber,cucumber/cucumber,cucumber/cucumber
cucumber-messages/dotnet/Cucumber.Messages.Specs/MessagesSpec.cs
cucumber-messages/dotnet/Cucumber.Messages.Specs/MessagesSpec.cs
using Xunit; using System.IO; using static Io.Cucumber.Messages.PickleStepArgument.Types; namespace Io.Cucumber.Messages.Specs { public class MessagesSpec { [Fact] public void SerializesPickeDocString() { var pickleDocSring = new PickleDocString { Location = new Location { Line = 10, Column = 20 }, ContentType = "text/plain", Content = "some\ncontent\n" }; byte[] serializedBytes; using (MemoryStream stream = new MemoryStream()) { var codedOutputStream = new Google.Protobuf.CodedOutputStream(stream); codedOutputStream.WriteMessage(pickleDocSring); codedOutputStream.Flush(); serializedBytes = stream.ToArray(); } PickleDocString parsedCopy = PickleDocString.Parser.ParseDelimitedFrom(new MemoryStream(serializedBytes)); Assert.Equal(pickleDocSring, parsedCopy); } } }
using Xunit; using System.IO; using System; namespace Io.Cucumber.Messages.Specs { public class MessagesSpec { [Fact] public void SerializesPickeDocString() { var pickleDocSring = new PickleDocString { Location = new Location { Line = 10, Column = 20 }, ContentType = "text/plain", Content = "some\ncontent\n" }; byte[] serializedBytes; using (MemoryStream stream = new MemoryStream()) { var codedOutputStream = new Google.Protobuf.CodedOutputStream(stream); codedOutputStream.WriteMessage(pickleDocSring); codedOutputStream.Flush(); serializedBytes = stream.ToArray(); } PickleDocString parsedCopy = PickleDocString.Parser.ParseDelimitedFrom(new MemoryStream(serializedBytes)); Assert.Equal(pickleDocSring, parsedCopy); } } }
mit
C#
1451fb7ad627d6fd2262166ca4bcafdf3c54c593
Fix NPE in ghost controlelr
duaiwe/ld36
src/Assets/GameObjects/Aletheia/Scripts/GhostController.cs
src/Assets/GameObjects/Aletheia/Scripts/GhostController.cs
using UnityEngine; using System.Collections.Generic; public class GhostController : MonoBehaviour { bool _isGhost = false; bool isRecording = false; public bool isGhost { get { return _isGhost; } } int actionCount; PlayerFrameAction[] actions; Vector3 spawnPoint; private Chronolabe chronolabe; public GhostController CreateGhost (PlayerFrameAction[] actions, Vector3 spawn) { GameObject newObj = Instantiate (gameObject) as GameObject; newObj.SetActive (false); GhostController ghost = newObj.GetComponent<GhostController> (); ghost._isGhost = true; ghost.actions = actions; ghost.spawnPoint = spawn; return ghost; } public void StopRecording () { Debug.LogFormat ("Finished recording {0} frames", actionCount); isRecording = false; Chronolabe labe = chronolabe; chronolabe = null; labe.AddGhost (CreateGhost (actions, spawnPoint)); } public void StartRecording (int frames, Chronolabe labe) { Debug.LogFormat ("Starting to record {0} frames", frames); chronolabe = labe; isRecording = true; actionCount = 0; actions = new PlayerFrameAction[frames]; spawnPoint = gameObject.transform.position; } public void StartPlayback () { if (_isGhost) { Debug.LogFormat ("Beginning Playback of {0} frames", actionCount); actionCount = 0; gameObject.SetActive (true); } } public void StopPlayback () { if (_isGhost) { Debug.Log ("Stopping playback"); gameObject.SetActive (false); gameObject.transform.position = spawnPoint; } } public bool isPlayback { get { return _isGhost && gameObject.activeSelf; } } void LateUpdate () { if (!UISystem.Instance.CutSceneDisplaying ()) { if (isRecording) { Debug.LogFormat ("Recording frame: {0}", actionCount); PlayerFrameAction action = new PlayerFrameAction (); action.SetKeyStateFromInput (KeyCode.Space); action.SetKeyStateFromInput (KeyCode.UpArrow); action.SetKeyStateFromInput (KeyCode.DownArrow); action.SetKeyStateFromInput (KeyCode.LeftArrow); action.SetKeyStateFromInput (KeyCode.RightArrow); actions [actionCount] = action; } if (isPlayback || isRecording) { actionCount += 1; } if (null != actions && actionCount >= actions.Length) { if (isRecording) StopRecording (); if (isPlayback) StopPlayback (); } } } public bool GetKey (KeyCode key) { return isPlayback ? actions [actionCount].GetKey (key) : Input.GetKey (key); } public bool GetKeyDown (KeyCode key) { return isPlayback ? actions [actionCount].GetKeyDown (key) : Input.GetKeyDown (key); } public bool GetKeyUp (KeyCode key) { return isPlayback ? actions [actionCount].GetKeyUp (key) : Input.GetKeyUp (key); } }
using UnityEngine; using System.Collections.Generic; public class GhostController : MonoBehaviour { bool _isGhost = false; bool isRecording = false; public bool isGhost { get { return _isGhost; } } int actionCount; PlayerFrameAction[] actions; Vector3 spawnPoint; private Chronolabe chronolabe; public GhostController CreateGhost (PlayerFrameAction[] actions, Vector3 spawn) { GameObject newObj = Instantiate (gameObject) as GameObject; newObj.SetActive (false); GhostController ghost = newObj.GetComponent<GhostController> (); ghost._isGhost = true; ghost.actions = actions; ghost.spawnPoint = spawn; return ghost; } public void StopRecording () { Debug.LogFormat ("Finished recording {0} frames", actionCount); isRecording = false; Chronolabe labe = chronolabe; chronolabe = null; labe.AddGhost (CreateGhost (actions, spawnPoint)); } public void StartRecording (int frames, Chronolabe labe) { Debug.LogFormat ("Starting to record {0} frames", frames); chronolabe = labe; isRecording = true; actionCount = 0; actions = new PlayerFrameAction[frames]; spawnPoint = gameObject.transform.position; } public void StartPlayback () { if (_isGhost) { Debug.LogFormat ("Beginning Playback of {0} frames", actionCount); actionCount = 0; gameObject.SetActive (true); } } public void StopPlayback () { if (_isGhost) { Debug.Log ("Stopping playback"); gameObject.SetActive (false); gameObject.transform.position = spawnPoint; } } public bool isPlayback { get { return _isGhost && gameObject.activeSelf; } } void LateUpdate () { if (!UISystem.Instance.CutSceneDisplaying ()) { if (isRecording) { Debug.LogFormat ("Recording frame: {0}", actionCount); PlayerFrameAction action = new PlayerFrameAction (); action.SetKeyStateFromInput (KeyCode.Space); action.SetKeyStateFromInput (KeyCode.UpArrow); action.SetKeyStateFromInput (KeyCode.DownArrow); action.SetKeyStateFromInput (KeyCode.LeftArrow); action.SetKeyStateFromInput (KeyCode.RightArrow); actions [actionCount] = action; } if (isPlayback || isRecording) { actionCount += 1; } if (actionCount >= actions.Length) { if (isRecording) StopRecording (); if (isPlayback) StopPlayback (); } } } public bool GetKey (KeyCode key) { return isPlayback ? actions [actionCount].GetKey (key) : Input.GetKey (key); } public bool GetKeyDown (KeyCode key) { return isPlayback ? actions [actionCount].GetKeyDown (key) : Input.GetKeyDown (key); } public bool GetKeyUp (KeyCode key) { return isPlayback ? actions [actionCount].GetKeyUp (key) : Input.GetKeyUp (key); } }
mit
C#
6ecbc16c0c6f1bef5ab6e9431d26f8dae1bc5d96
Reduce the number of request after refining Watson dialog flow.
ProjectSteward/StewardTRBot,ProjectSteward/StewardTRBot
Steward/Ai/Watson.Conversation/WatsonConverationService.cs
Steward/Ai/Watson.Conversation/WatsonConverationService.cs
using System; using System.Dynamic; using System.Threading.Tasks; using Newtonsoft.Json; using Steward.Ai.Watson.Conversation.Model; using Steward.Helper; namespace Steward.Ai.Watson.Conversation { [Serializable] internal class WatsonConverationService : IWatsonConversationService { private readonly Uri endpoint; private readonly string credential; internal WatsonConverationService(string endpoint, string credential) { this.credential = credential; this.endpoint = new UriBuilder(endpoint).Uri; } async Task<MessageResponse> IWatsonConversationService.SendMessage(string message, dynamic context) { using (var client = CreateWebClient()) { dynamic inputContext = context; dynamic messageObj = new ExpandoObject(); messageObj.input = new ExpandoObject(); messageObj.input.text = message; messageObj.context = inputContext; var responseMessage = await UploadStringTaskAsync(client, JsonConvert.SerializeObject(messageObj)); return JsonConvert.DeserializeObject<MessageResponse>(responseMessage); } } private async Task<string> UploadStringTaskAsync(IWebClient client, string data) { var headers = client.Headers; const string contentType = "Content-Type"; if(headers[contentType] == null) { headers.Add(contentType, "application/json"); } const string authorization = "Authorization"; if (headers[authorization] == null) { client.Headers.Add(authorization, $"Basic {credential}"); } return await client.UploadStringTaskAsync(endpoint, data); } protected virtual IWebClient CreateWebClient() { return new WebClient(); } } }
using System; using System.Dynamic; using System.Threading.Tasks; using Newtonsoft.Json; using Steward.Ai.Watson.Conversation.Model; using Steward.Helper; namespace Steward.Ai.Watson.Conversation { [Serializable] internal class WatsonConverationService : IWatsonConversationService { private readonly Uri endpoint; private readonly string credential; internal WatsonConverationService(string endpoint, string credential) { this.credential = credential; this.endpoint = new UriBuilder(endpoint).Uri; } async Task<MessageResponse> IWatsonConversationService.SendMessage(string message, dynamic context) { using (var client = CreateWebClient()) { dynamic inputContext = context; dynamic messageObj = new ExpandoObject(); messageObj.input = new ExpandoObject(); messageObj.input.text = string.Empty; if (inputContext == null) { // Try to send the first conversation var welcomeMessage = JsonConvert.DeserializeObject<MessageResponse>( await UploadStringTaskAsync(client, JsonConvert.SerializeObject(messageObj))); inputContext = welcomeMessage.Context; } messageObj.input.text = message; messageObj.context = inputContext; var responseMessage = await UploadStringTaskAsync(client, JsonConvert.SerializeObject(messageObj)); return JsonConvert.DeserializeObject<MessageResponse>(responseMessage); } } private async Task<string> UploadStringTaskAsync(IWebClient client, string data) { var headers = client.Headers; const string contentType = "Content-Type"; if(headers[contentType] == null) { headers.Add(contentType, "application/json"); } const string authorization = "Authorization"; if (headers[authorization] == null) { client.Headers.Add(authorization, $"Basic {credential}"); } return await client.UploadStringTaskAsync(endpoint, data); } protected virtual IWebClient CreateWebClient() { return new WebClient(); } } }
mit
C#
f5eaedcc0fc9d51f0eb021ba652923d47a35fdf6
Add example of getting root YRD file.
Albiglittle/YaccConstructor,sanyaade-g2g-repos/YaccConstructor,Albiglittle/YaccConstructor,sanyaade-g2g-repos/YaccConstructor,melentyev/YaccConstructor,RomanBelkov/YaccConstructor,fedorovr/YaccConstructor,YaccConstructor/YaccConstructor,sanyaade-g2g-repos/YaccConstructor,melentyev/YaccConstructor,fedorovr/YaccConstructor,nbIxMaN/YaccConstructor,VereshchaginaE/YaccConstructor,VereshchaginaE/YaccConstructor,YaccConstructor/YaccConstructor,fedorovr/YaccConstructor,nbIxMaN/YaccConstructor,melentyev/YaccConstructor,RomanBelkov/YaccConstructor,VereshchaginaE/YaccConstructor,YaccConstructor/YaccConstructor,nbIxMaN/YaccConstructor,Albiglittle/YaccConstructor,RomanBelkov/YaccConstructor
VSYard/VSYard/BraceMatching/BraceMatchingTaggerProvider.cs
VSYard/VSYard/BraceMatching/BraceMatchingTaggerProvider.cs
namespace VSYard.BraceMatching { using System; using System.Collections.Generic; using System.ComponentModel.Composition; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Classification; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Text.Tagging; using Microsoft.VisualStudio.Utilities; using System.Linq; using System.Windows.Media; using EnvDTE; using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Interop; [Export(typeof(EditorFormatDefinition))] [Name("green")] [UserVisible(true)] internal class HighlightFormatDefinition1 : MarkerFormatDefinition { public HighlightFormatDefinition1() { this.BackgroundColor = Colors.Aquamarine; this.ForegroundColor = Colors.Teal; this.DisplayName = "green element!"; this.ZOrder = 5; } } [Export(typeof(IViewTaggerProvider))] [ContentType("yardtype")] [TagType(typeof(TextMarkerTag))] internal class BraceMatchingTaggerProvider : IViewTaggerProvider { public ITagger<T> CreateTagger<T>(ITextView textView, ITextBuffer buffer) where T : ITag { //It is exampe of getting root *.yrd file of active project. //Should be removed var t = MyCompany.VSYard.Helpers.SolutionNavigatorHelper.GetRootYrd (MyCompany.VSYard.Helpers.SolutionNavigatorHelper.GetActiveProject()); if (textView == null) return null; //provide highlighting only on the top-level buffer if (textView.TextBuffer != buffer) return null; return new VSYardNS.BraceMatchingTagger(textView, buffer) as ITagger<T>; } } }
namespace VSYard.BraceMatching { using System; using System.Collections.Generic; using System.ComponentModel.Composition; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Classification; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Text.Tagging; using Microsoft.VisualStudio.Utilities; using System.Linq; using System.Windows.Media; [Export(typeof(EditorFormatDefinition))] [Name("green")] [UserVisible(true)] internal class HighlightFormatDefinition1 : MarkerFormatDefinition { public HighlightFormatDefinition1() { this.BackgroundColor = Colors.Aquamarine; this.ForegroundColor = Colors.Teal; this.DisplayName = "green element!"; this.ZOrder = 5; } } [Export(typeof(IViewTaggerProvider))] [ContentType("yardtype")] [TagType(typeof(TextMarkerTag))] internal class BraceMatchingTaggerProvider : IViewTaggerProvider { public ITagger<T> CreateTagger<T>(ITextView textView, ITextBuffer buffer) where T : ITag { if (textView == null) return null; //provide highlighting only on the top-level buffer if (textView.TextBuffer != buffer) return null; return new VSYardNS.BraceMatchingTagger(textView, buffer) as ITagger<T>; } } }
apache-2.0
C#
8f7d2811b71d0f1a2ea45103f71c8a12bce1d7a6
Fix options serialization issue causing the VB language settings to deserialize within a C# project
lorcanmooney/roslyn,thomaslevesque/roslyn,huoxudong125/roslyn,vslsnap/roslyn,KevinRansom/roslyn,mgoertz-msft/roslyn,dovzhikova/roslyn,budcribar/roslyn,sharadagrawal/Roslyn,tannergooding/roslyn,tmeschter/roslyn,doconnell565/roslyn,MihaMarkic/roslyn-prank,RipCurrent/roslyn,MattWindsor91/roslyn,MichalStrehovsky/roslyn,reaction1989/roslyn,bbarry/roslyn,basoundr/roslyn,pjmagee/roslyn,panopticoncentral/roslyn,aelij/roslyn,jamesqo/roslyn,mattwar/roslyn,Shiney/roslyn,magicbing/roslyn,tannergooding/roslyn,jaredpar/roslyn,balajikris/roslyn,jeffanders/roslyn,mattwar/roslyn,ljw1004/roslyn,khyperia/roslyn,weltkante/roslyn,orthoxerox/roslyn,YOTOV-LIMITED/roslyn,heejaechang/roslyn,wvdd007/roslyn,dpoeschl/roslyn,robinsedlaczek/roslyn,FICTURE7/roslyn,srivatsn/roslyn,SeriaWei/roslyn,panopticoncentral/roslyn,kienct89/roslyn,srivatsn/roslyn,xasx/roslyn,khyperia/roslyn,agocke/roslyn,natidea/roslyn,weltkante/roslyn,jonatassaraiva/roslyn,bkoelman/roslyn,AArnott/roslyn,orthoxerox/roslyn,bartdesmet/roslyn,mattscheffer/roslyn,aanshibudhiraja/Roslyn,nguerrera/roslyn,Hosch250/roslyn,KevinH-MS/roslyn,Hosch250/roslyn,panopticoncentral/roslyn,brettfo/roslyn,swaroop-sridhar/roslyn,VSadov/roslyn,YOTOV-LIMITED/roslyn,vcsjones/roslyn,mseamari/Stuff,tvand7093/roslyn,VShangxiao/roslyn,huoxudong125/roslyn,abock/roslyn,ErikSchierboom/roslyn,ilyes14/roslyn,jmarolf/roslyn,a-ctor/roslyn,thomaslevesque/roslyn,bartdesmet/roslyn,grianggrai/roslyn,natgla/roslyn,kelltrick/roslyn,MichalStrehovsky/roslyn,DustinCampbell/roslyn,genlu/roslyn,Maxwe11/roslyn,TyOverby/roslyn,krishnarajbb/roslyn,gafter/roslyn,MihaMarkic/roslyn-prank,robinsedlaczek/roslyn,KirillOsenkov/roslyn,sharadagrawal/Roslyn,reaction1989/roslyn,magicbing/roslyn,akrisiun/roslyn,khyperia/roslyn,vslsnap/roslyn,thomaslevesque/roslyn,mmitche/roslyn,KiloBravoLima/roslyn,KamalRathnayake/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,agocke/roslyn,AlekseyTs/roslyn,bbarry/roslyn,CaptainHayashi/roslyn,abock/roslyn,tmat/roslyn,amcasey/roslyn,aelij/roslyn,wvdd007/roslyn,KevinH-MS/roslyn,gafter/roslyn,Giftednewt/roslyn,physhi/roslyn,zooba/roslyn,yjfxfjch/roslyn,jbhensley/roslyn,balajikris/roslyn,MatthieuMEZIL/roslyn,kienct89/roslyn,davkean/roslyn,gafter/roslyn,SeriaWei/roslyn,khellang/roslyn,oocx/roslyn,jaredpar/roslyn,jkotas/roslyn,jamesqo/roslyn,aanshibudhiraja/Roslyn,sharadagrawal/Roslyn,lisong521/roslyn,basoundr/roslyn,Hosch250/roslyn,pdelvo/roslyn,danielcweber/roslyn,TyOverby/roslyn,AnthonyDGreen/roslyn,tmat/roslyn,AArnott/roslyn,mavasani/roslyn,basoundr/roslyn,lorcanmooney/roslyn,brettfo/roslyn,CaptainHayashi/roslyn,grianggrai/roslyn,nguerrera/roslyn,akrisiun/roslyn,Maxwe11/roslyn,mattscheffer/roslyn,KevinRansom/roslyn,nguerrera/roslyn,vcsjones/roslyn,dotnet/roslyn,krishnarajbb/roslyn,diryboy/roslyn,xasx/roslyn,MattWindsor91/roslyn,dpoeschl/roslyn,AmadeusW/roslyn,KamalRathnayake/roslyn,bkoelman/roslyn,robinsedlaczek/roslyn,sharwell/roslyn,jmarolf/roslyn,huoxudong125/roslyn,mmitche/roslyn,FICTURE7/roslyn,jasonmalinowski/roslyn,danielcweber/roslyn,xasx/roslyn,Pvlerick/roslyn,AnthonyDGreen/roslyn,HellBrick/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,jonatassaraiva/roslyn,yjfxfjch/roslyn,zooba/roslyn,HellBrick/roslyn,AnthonyDGreen/roslyn,reaction1989/roslyn,ValentinRueda/roslyn,managed-commons/roslyn,physhi/roslyn,yeaicc/roslyn,tannergooding/roslyn,jeffanders/roslyn,EricArndt/roslyn,jcouv/roslyn,jasonmalinowski/roslyn,russpowers/roslyn,eriawan/roslyn,jamesqo/roslyn,lorcanmooney/roslyn,shyamnamboodiripad/roslyn,leppie/roslyn,michalhosala/roslyn,tmeschter/roslyn,CyrusNajmabadi/roslyn,VSadov/roslyn,brettfo/roslyn,michalhosala/roslyn,OmarTawfik/roslyn,jkotas/roslyn,budcribar/roslyn,evilc0des/roslyn,tvand7093/roslyn,evilc0des/roslyn,EricArndt/roslyn,pjmagee/roslyn,drognanar/roslyn,kienct89/roslyn,balajikris/roslyn,dovzhikova/roslyn,v-codeel/roslyn,weltkante/roslyn,leppie/roslyn,KiloBravoLima/roslyn,KevinH-MS/roslyn,drognanar/roslyn,jkotas/roslyn,abock/roslyn,a-ctor/roslyn,Inverness/roslyn,jhendrixMSFT/roslyn,stephentoub/roslyn,CyrusNajmabadi/roslyn,supriyantomaftuh/roslyn,akrisiun/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,jbhensley/roslyn,amcasey/roslyn,AmadeusW/roslyn,v-codeel/roslyn,KirillOsenkov/roslyn,vcsjones/roslyn,genlu/roslyn,Maxwe11/roslyn,jcouv/roslyn,ErikSchierboom/roslyn,evilc0des/roslyn,AArnott/roslyn,mgoertz-msft/roslyn,cston/roslyn,drognanar/roslyn,tmat/roslyn,mattscheffer/roslyn,yjfxfjch/roslyn,nemec/roslyn,dpoeschl/roslyn,jeffanders/roslyn,xoofx/roslyn,pjmagee/roslyn,MichalStrehovsky/roslyn,Pvlerick/roslyn,VPashkov/roslyn,Inverness/roslyn,ericfe-ms/roslyn,supriyantomaftuh/roslyn,mseamari/Stuff,KamalRathnayake/roslyn,yeaicc/roslyn,GuilhermeSa/roslyn,aanshibudhiraja/Roslyn,grianggrai/roslyn,ErikSchierboom/roslyn,OmarTawfik/roslyn,Giftednewt/roslyn,vslsnap/roslyn,mattwar/roslyn,cston/roslyn,srivatsn/roslyn,zooba/roslyn,paulvanbrenk/roslyn,moozzyk/roslyn,GuilhermeSa/roslyn,ericfe-ms/roslyn,rgani/roslyn,HellBrick/roslyn,a-ctor/roslyn,zmaruo/roslyn,VShangxiao/roslyn,shyamnamboodiripad/roslyn,Inverness/roslyn,FICTURE7/roslyn,dotnet/roslyn,danielcweber/roslyn,natgla/roslyn,eriawan/roslyn,jmarolf/roslyn,nemec/roslyn,AlekseyTs/roslyn,khellang/roslyn,RipCurrent/roslyn,zmaruo/roslyn,ericfe-ms/roslyn,jhendrixMSFT/roslyn,magicbing/roslyn,diryboy/roslyn,diryboy/roslyn,CaptainHayashi/roslyn,TyOverby/roslyn,agocke/roslyn,orthoxerox/roslyn,sharwell/roslyn,lisong521/roslyn,oocx/roslyn,dovzhikova/roslyn,eriawan/roslyn,DustinCampbell/roslyn,sharwell/roslyn,KevinRansom/roslyn,bartdesmet/roslyn,rgani/roslyn,antonssonj/roslyn,russpowers/roslyn,AmadeusW/roslyn,krishnarajbb/roslyn,tvand7093/roslyn,cston/roslyn,wvdd007/roslyn,dotnet/roslyn,YOTOV-LIMITED/roslyn,xoofx/roslyn,rgani/roslyn,jasonmalinowski/roslyn,genlu/roslyn,natidea/roslyn,Shiney/roslyn,leppie/roslyn,mseamari/Stuff,ValentinRueda/roslyn,russpowers/roslyn,jcouv/roslyn,mgoertz-msft/roslyn,heejaechang/roslyn,tmeschter/roslyn,ljw1004/roslyn,davkean/roslyn,managed-commons/roslyn,xoofx/roslyn,Pvlerick/roslyn,amcasey/roslyn,ilyes14/roslyn,ValentinRueda/roslyn,moozzyk/roslyn,MihaMarkic/roslyn-prank,DustinCampbell/roslyn,VShangxiao/roslyn,Giftednewt/roslyn,RipCurrent/roslyn,jaredpar/roslyn,heejaechang/roslyn,swaroop-sridhar/roslyn,mavasani/roslyn,mavasani/roslyn,kelltrick/roslyn,VSadov/roslyn,oocx/roslyn,supriyantomaftuh/roslyn,natidea/roslyn,shyamnamboodiripad/roslyn,EricArndt/roslyn,AlekseyTs/roslyn,swaroop-sridhar/roslyn,OmarTawfik/roslyn,MattWindsor91/roslyn,paulvanbrenk/roslyn,khellang/roslyn,MattWindsor91/roslyn,doconnell565/roslyn,physhi/roslyn,jonatassaraiva/roslyn,moozzyk/roslyn,MatthieuMEZIL/roslyn,bbarry/roslyn,yeaicc/roslyn,natgla/roslyn,zmaruo/roslyn,stephentoub/roslyn,KirillOsenkov/roslyn,pdelvo/roslyn,aelij/roslyn,ljw1004/roslyn,MatthieuMEZIL/roslyn,michalhosala/roslyn,lisong521/roslyn,stephentoub/roslyn,Shiney/roslyn,SeriaWei/roslyn,davkean/roslyn,managed-commons/roslyn,antonssonj/roslyn,GuilhermeSa/roslyn,mmitche/roslyn,doconnell565/roslyn,jhendrixMSFT/roslyn,jbhensley/roslyn,kelltrick/roslyn,ilyes14/roslyn,VPashkov/roslyn,pdelvo/roslyn,v-codeel/roslyn,paulvanbrenk/roslyn,antonssonj/roslyn,VPashkov/roslyn,budcribar/roslyn,bkoelman/roslyn,KiloBravoLima/roslyn,nemec/roslyn,CyrusNajmabadi/roslyn
src/Features/Core/Portable/Completion/CompletionOptions.cs
src/Features/Core/Portable/Completion/CompletionOptions.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 Microsoft.CodeAnalysis.Options; namespace Microsoft.CodeAnalysis.Completion { internal static class CompletionOptions { public const string FeatureName = "Completion"; public const string ControllerFeatureName = "CompletionController"; public static readonly PerLanguageOption<bool> HideAdvancedMembers = new PerLanguageOption<bool>(FeatureName, "HideAdvancedMembers", defaultValue: false); public static readonly PerLanguageOption<bool> IncludeKeywords = new PerLanguageOption<bool>(FeatureName, "IncludeKeywords", defaultValue: true); public static readonly PerLanguageOption<bool> TriggerOnTyping = new PerLanguageOption<bool>(FeatureName, "TriggerOnTyping", defaultValue: true); public static readonly PerLanguageOption<bool> TriggerOnTypingLetters = new PerLanguageOption<bool>(FeatureName, "TriggerOnTypingLetters", defaultValue: true); public static readonly Option<bool> AlwaysShowBuilder = new Option<bool>(ControllerFeatureName, "AlwaysShowBuilder", defaultValue: false); public static readonly Option<bool> FilterOutOfScopeLocals = new Option<bool>(ControllerFeatureName, "FilterOutOfScopeLocals", defaultValue: true); public static readonly Option<bool> ShowXmlDocCommentCompletion = new Option<bool>(ControllerFeatureName, "ShowXmlDocCommentCompletion", defaultValue: true); } }
// 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 Microsoft.CodeAnalysis.Options; namespace Microsoft.CodeAnalysis.Completion { internal static class CompletionOptions { public const string FeatureName = "Completion"; public static readonly PerLanguageOption<bool> HideAdvancedMembers = new PerLanguageOption<bool>(FeatureName, "HideAdvancedMembers", defaultValue: false); public static readonly PerLanguageOption<bool> IncludeKeywords = new PerLanguageOption<bool>(FeatureName, "IncludeKeywords", defaultValue: true); public static readonly PerLanguageOption<bool> TriggerOnTyping = new PerLanguageOption<bool>(FeatureName, "TriggerOnTyping", defaultValue: true); public static readonly PerLanguageOption<bool> TriggerOnTypingLetters = new PerLanguageOption<bool>(FeatureName, "TriggerOnTypingLetters", defaultValue: true); public static readonly Option<bool> AlwaysShowBuilder = new Option<bool>(FeatureName, "AlwaysShowBuilder", defaultValue: false); public static readonly Option<bool> FilterOutOfScopeLocals = new Option<bool>(FeatureName, "FilterOutOfScopeLocals", defaultValue: true); public static readonly Option<bool> ShowXmlDocCommentCompletion = new Option<bool>(FeatureName, "ShowXmlDocCommentCompletion", defaultValue: true); } }
mit
C#
198fe94a9f999b4c97e1f9d2d2920eea374d0ada
Add fix for missing method on interface
MilovanovM/cake-yarn,MilovanovM/cake-yarn
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); } }
mit
C#