commit
stringlengths 40
40
| old_file
stringlengths 4
237
| new_file
stringlengths 4
237
| old_contents
stringlengths 1
4.24k
| new_contents
stringlengths 1
4.87k
| subject
stringlengths 15
778
| message
stringlengths 15
8.75k
| lang
stringclasses 266
values | license
stringclasses 13
values | repos
stringlengths 5
127k
|
|---|---|---|---|---|---|---|---|---|---|
a317d1d0240ffdb91d87be2faee1c0db34d3eafc
|
Assets/Scripts/ComponentSolvers/Modded/CoroutineModComponentSolver.cs
|
Assets/Scripts/ComponentSolvers/Modded/CoroutineModComponentSolver.cs
|
using System.Collections;
using System.Reflection;
using UnityEngine;
public class CoroutineModComponentSolver : ComponentSolver
{
public CoroutineModComponentSolver(BombCommander bombCommander, MonoBehaviour bombComponent, IRCConnection ircConnection, CoroutineCanceller canceller, MethodInfo processMethod, Component commandComponent) :
base(bombCommander, bombComponent, ircConnection, canceller)
{
ProcessMethod = processMethod;
CommandComponent = commandComponent;
}
protected override IEnumerator RespondToCommandInternal(string inputCommand)
{
IEnumerator responseCoroutine = (IEnumerator)ProcessMethod.Invoke(CommandComponent, new object[] { inputCommand });
if (responseCoroutine == null)
{
yield break;
}
yield return "modcoroutine";
while (responseCoroutine.MoveNext())
{
yield return responseCoroutine.Current;
}
}
private readonly MethodInfo ProcessMethod = null;
private readonly Component CommandComponent = null;
}
|
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;
public class CoroutineModComponentSolver : ComponentSolver
{
public CoroutineModComponentSolver(BombCommander bombCommander, MonoBehaviour bombComponent, IRCConnection ircConnection, CoroutineCanceller canceller, MethodInfo processMethod, Component commandComponent) :
base(bombCommander, bombComponent, ircConnection, canceller)
{
ProcessMethod = processMethod;
CommandComponent = commandComponent;
}
protected override IEnumerator RespondToCommandInternal(string inputCommand)
{
IEnumerator responseCoroutine = (IEnumerator)ProcessMethod.Invoke(CommandComponent, new object[] { inputCommand });
if (responseCoroutine == null)
{
yield break;
}
yield return "modcoroutine";
while (responseCoroutine.MoveNext())
{
object currentObject = responseCoroutine.Current;
if (currentObject.GetType() == typeof(KMSelectable))
{
KMSelectable selectable = (KMSelectable)currentObject;
if (HeldSelectables.Contains(selectable))
{
DoInteractionEnd(selectable);
HeldSelectables.Remove(selectable);
}
else
{
DoInteractionStart(selectable);
HeldSelectables.Add(selectable);
}
}
yield return currentObject;
}
}
private readonly MethodInfo ProcessMethod = null;
private readonly Component CommandComponent = null;
private readonly List<KMSelectable> HeldSelectables = new List<KMSelectable>();
}
|
Add option to yield return a KMSelectable to toggle-interact with.
|
Add option to yield return a KMSelectable to toggle-interact with.
|
C#
|
mit
|
ashbash1987/ktanemod-twitchplays,CaitSith2/ktanemod-twitchplays
|
206b8de107e191f065ed304957dd6a5ccfdd6fbf
|
AsyncRewriter/RewriteAsync.cs
|
AsyncRewriter/RewriteAsync.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace AsyncRewriter
{
/// <summary>
/// </summary>
/// <remarks>
/// http://stackoverflow.com/questions/2961753/how-to-hide-files-generated-by-custom-tool-in-visual-studio
/// </remarks>
public class RewriteAsync : Microsoft.Build.Utilities.Task
{
[Required]
public ITaskItem[] InputFiles { get; set; }
[Required]
public ITaskItem OutputFile { get; set; }
readonly Rewriter _rewriter;
public RewriteAsync()
{
_rewriter = new Rewriter(new TaskLoggingAdapter(Log));
}
public override bool Execute()
{
var asyncCode = _rewriter.RewriteAndMerge(InputFiles.Select(f => f.ItemSpec).ToArray());
File.WriteAllText(OutputFile.ItemSpec, asyncCode);
return true;
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace AsyncRewriter
{
/// <summary>
/// </summary>
/// <remarks>
/// http://stackoverflow.com/questions/2961753/how-to-hide-files-generated-by-custom-tool-in-visual-studio
/// </remarks>
public class RewriteAsync : Microsoft.Build.Utilities.Task
{
[Required]
public ITaskItem[] InputFiles { get; set; }
[Required]
public ITaskItem OutputFile { get; set; }
readonly Rewriter _rewriter;
public RewriteAsync()
{
_rewriter = Log == null ? new Rewriter() : new Rewriter(new TaskLoggingAdapter(Log));
}
public override bool Execute()
{
var asyncCode = _rewriter.RewriteAndMerge(InputFiles.Select(f => f.ItemSpec).ToArray());
File.WriteAllText(OutputFile.ItemSpec, asyncCode);
return true;
}
}
}
|
Fix null reference exception when running under Mono
|
Fix null reference exception when running under Mono
When running under Mono, Log property is null and then, Rewriter throws NullReferenceExceptions when trying to use the underlying Log.
When Log is null, use the default Rewriter constructor which uses a Console logger.
|
C#
|
mit
|
roji/AsyncRewriter
|
fd838d3d800ce9eca3f70f2d89d0bf10a59d9f5e
|
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42069_Page.xaml.cs
|
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42069_Page.xaml.cs
|
using System;
using System.Diagnostics;
using System.Threading;
namespace Xamarin.Forms.Controls.Issues
{
public partial class Bugzilla42069_Page : ContentPage
{
public const string DestructorMessage = ">>>>>>>>>> Bugzilla42069_Page destructor <<<<<<<<<<";
public Bugzilla42069_Page()
{
InitializeComponent();
ImageWhichChanges = ImageSource.FromFile("oasissmall.jpg") as FileImageSource;
ChangingImage.SetBinding(Image.SourceProperty, nameof(ImageWhichChanges));
Button.Clicked += (sender, args) => Navigation.PopAsync(false);
Button2.Clicked += (sender, args) =>
{
ImageWhichChanges.File = ImageWhichChanges.File == "bank.png" ? "oasissmall.jpg" : "bank.png";
};
BindingContext = this;
}
~Bugzilla42069_Page()
{
Debug.WriteLine(DestructorMessage);
}
public FileImageSource ImageWhichChanges { get; set; }
}
}
|
using System;
using System.Diagnostics;
using System.Threading;
namespace Xamarin.Forms.Controls.Issues
{
public partial class Bugzilla42069_Page : ContentPage
{
public const string DestructorMessage = ">>>>>>>>>> Bugzilla42069_Page destructor <<<<<<<<<<";
public Bugzilla42069_Page()
{
#if APP
InitializeComponent();
ImageWhichChanges = ImageSource.FromFile("oasissmall.jpg") as FileImageSource;
ChangingImage.SetBinding(Image.SourceProperty, nameof(ImageWhichChanges));
Button.Clicked += (sender, args) => Navigation.PopAsync(false);
Button2.Clicked += (sender, args) =>
{
ImageWhichChanges.File = ImageWhichChanges.File == "bank.png" ? "oasissmall.jpg" : "bank.png";
};
BindingContext = this;
#endif
}
~Bugzilla42069_Page()
{
Debug.WriteLine(DestructorMessage);
}
public FileImageSource ImageWhichChanges { get; set; }
}
}
|
Add missing compiler directives to fix build error
|
Add missing compiler directives to fix build error
|
C#
|
mit
|
Hitcents/Xamarin.Forms,Hitcents/Xamarin.Forms,Hitcents/Xamarin.Forms
|
c6440d810dfe007eb88470d5d23fd30b94333dc0
|
src/Castle.Windsor.MsDependencyInjection/WindsorServiceProviderFactory.cs
|
src/Castle.Windsor.MsDependencyInjection/WindsorServiceProviderFactory.cs
|
using System;
using Microsoft.Extensions.DependencyInjection;
namespace Castle.Windsor.MsDependencyInjection
{
public class WindsorServiceProviderFactory : IServiceProviderFactory<IWindsorContainer>
{
public IWindsorContainer CreateBuilder(IServiceCollection services)
{
var container = services.GetSingletonServiceOrNull<IWindsorContainer>();
if (container == null)
{
container = new WindsorContainer();
services.AddSingleton(container);
}
WindsorRegistrationHelper.AddServices(container, services);
return container;
}
public IServiceProvider CreateServiceProvider(IWindsorContainer containerBuilder)
{
return containerBuilder.Resolve<IServiceProvider>();
}
}
}
|
using System;
using Microsoft.Extensions.DependencyInjection;
namespace Castle.Windsor.MsDependencyInjection
{
public class WindsorServiceProviderFactory : IServiceProviderFactory<IWindsorContainer>
{
public IWindsorContainer CreateBuilder(IServiceCollection services)
{
var container = services.GetSingletonServiceOrNull<IWindsorContainer>();
if (container == null)
{
container = new WindsorContainer();
services.AddSingleton(container);
}
container.AddServices(services);
return container;
}
public IServiceProvider CreateServiceProvider(IWindsorContainer containerBuilder)
{
return containerBuilder.Resolve<IServiceProvider>();
}
}
}
|
Use extension method for WindsorRegistrationHelper.AddServices
|
Use extension method for WindsorRegistrationHelper.AddServices
|
C#
|
mit
|
volosoft/castle-windsor-ms-adapter
|
a7e541a941f4068a4f5d66d3a607663d6dbe82cd
|
src/Smooth.IoC.Dapper.Repository.UnitOfWork.Tests/TestHelpers/MyDatabaseSettings.cs
|
src/Smooth.IoC.Dapper.Repository.UnitOfWork.Tests/TestHelpers/MyDatabaseSettings.cs
|
using NUnit.Framework;
namespace Smooth.IoC.Dapper.FastCRUD.Repository.UnitOfWork.Tests.TestHelpers
{
public class MyDatabaseSettings
{
public string ConnectionString { get; } = $@"{TestContext.CurrentContext.TestDirectory}\Tests.db";
}
}
|
using NUnit.Framework;
namespace Smooth.IoC.Dapper.FastCRUD.Repository.UnitOfWork.Tests.TestHelpers
{
public class MyDatabaseSettings : IMyDatabaseSettings
{
public string ConnectionString { get; } = $@"Data Source={TestContext.CurrentContext.TestDirectory}\Tests.db;Version=3;New=True;BinaryGUID=False;";
}
}
|
Add interface as resharper forgot
|
Add interface as resharper forgot
|
C#
|
mit
|
generik0/Smooth.IoC.Dapper.Repository.UnitOfWork,generik0/Smooth.IoC.Dapper.Repository.UnitOfWork
|
20470b9f31bed9ba1fd3d5189190ebd9f05dfdb0
|
IModel.cs
|
IModel.cs
|
using System;
using System.Collections.Generic;
namespace ChamberLib
{
public interface IModel
{
object Tag { get; set; }
IEnumerable<IMesh> GetMeshes();
void Draw(Matrix world, Matrix view, Matrix projection,
IMaterial materialOverride=null,
LightingData? lightingOverride=null);
IBone Root { get; set; }
void SetAmbientLightColor(Vector3 value);
void SetEmissiveColor(Vector3 value);
void SetDirectionalLight(DirectionalLight light, int index=0);
void DisableDirectionalLight(int index);
void SetAlpha(float alpha);
void SetTexture(ITexture2D texture);
void SetBoneTransforms(Matrix[] boneTransforms,
IMaterial materialOverride=null);
IEnumerable<Triangle> EnumerateTriangles();
}
public static class ModelHelper
{
public static Vector3? IntersectClosest(this IModel model, Ray ray)
{
Vector3? closest = null;
float closestDist = -1;
foreach (var tri in model.EnumerateTriangles())
{
var p = tri.Intersects(ray);
if (!p.HasValue) continue;
if (!closest.HasValue)
{
closest = p;
}
else
{
var dist = (p.Value - ray.Position).LengthSquared();
if (dist < closestDist)
{
closest = p;
closestDist = dist;
}
}
}
return closest;
}
}
}
|
using System;
using System.Collections.Generic;
namespace ChamberLib
{
public interface IModel
{
object Tag { get; set; }
IEnumerable<IMesh> GetMeshes();
void Draw(Matrix world, Matrix view, Matrix projection,
IMaterial materialOverride=null,
LightingData? lightingOverride=null);
IBone Root { get; set; }
void SetAmbientLightColor(Vector3 value);
void SetEmissiveColor(Vector3 value);
void SetDirectionalLight(DirectionalLight light, int index=0);
void DisableDirectionalLight(int index);
void SetAlpha(float alpha);
void SetTexture(ITexture2D texture);
void SetBoneTransforms(Matrix[] boneTransforms,
IMaterial materialOverride=null);
IEnumerable<Triangle> EnumerateTriangles();
}
public static class ModelHelper
{
public static Vector3? IntersectClosest(this IModel model, Ray ray)
{
Vector3? closest = null;
float closestDist = -1;
foreach (var tri in model.EnumerateTriangles())
{
var p = tri.Intersects(ray);
if (!p.HasValue) continue;
if (!closest.HasValue)
{
closest = p;
closestDist = (p.Value - ray.Position).LengthSquared();
}
else
{
var dist = (p.Value - ray.Position).LengthSquared();
if (dist < closestDist)
{
closest = p;
closestDist = dist;
}
}
}
return closest;
}
}
}
|
Update the closest known distance.
|
Update the closest known distance.
|
C#
|
lgpl-2.1
|
izrik/ChamberLib,izrik/ChamberLib,izrik/ChamberLib
|
66f86e3f7d0d39c53d38a7135aa8e10b3eed9e55
|
src/Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearch/Configuration/ElasticSearchMappingsConfiguration.cs
|
src/Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearch/Configuration/ElasticSearchMappingsConfiguration.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.Diagnostics.EventFlow.Configuration
{
public class ElasticSearchMappingsConfiguration
{
public Dictionary<string, ElasticSearchMappingsConfigurationPropertyDescriptor> Properties { get; private set; }
public ElasticSearchMappingsConfiguration()
{
Properties = new Dictionary<string, ElasticSearchMappingsConfigurationPropertyDescriptor>();
}
internal ElasticSearchMappingsConfiguration DeepClone()
{
var other = new ElasticSearchMappingsConfiguration();
foreach (var item in this.Properties)
{
other.Properties.Add(item.Key, item.Value.DeepClone());
}
return other;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.Diagnostics.EventFlow.Configuration
{
public class ElasticSearchMappingsConfiguration
{
public Dictionary<string, ElasticSearchMappingsConfigurationPropertyDescriptor> Properties { get; set; }
public ElasticSearchMappingsConfiguration()
{
Properties = new Dictionary<string, ElasticSearchMappingsConfigurationPropertyDescriptor>();
}
internal ElasticSearchMappingsConfiguration DeepClone()
{
var other = new ElasticSearchMappingsConfiguration();
foreach (var item in this.Properties)
{
other.Properties.Add(item.Key, item.Value.DeepClone());
}
return other;
}
}
}
|
Make ES mapping configuration Properties setter public
|
Make ES mapping configuration Properties setter public
(emphasizes the use of the property during deserialization)
|
C#
|
mit
|
karolz-ms/diagnostics-eventflow
|
08928f6a11802d7cc0208a3dd8c2637f2a7b6396
|
Src/XmlDocInspections.Plugin.Tests/Integrative/MissingXmlDocHighlightingTestsBase.cs
|
Src/XmlDocInspections.Plugin.Tests/Integrative/MissingXmlDocHighlightingTestsBase.cs
|
using System.IO;
using JetBrains.Annotations;
using JetBrains.Application.Settings;
using JetBrains.ReSharper.Feature.Services.Daemon;
using JetBrains.ReSharper.FeaturesTestFramework.Daemon;
using JetBrains.ReSharper.Psi;
using XmlDocInspections.Plugin.Highlighting;
namespace XmlDocInspections.Plugin.Tests.Integrative
{
public abstract class MissingXmlDocHighlightingTestsBase : CSharpHighlightingTestNet4Base
{
protected override string RelativeTestDataPath => "Highlighting";
protected override string GetGoldTestDataPath(string fileName)
{
return base.GetGoldTestDataPath(Path.Combine(GetType().Name, fileName));
}
protected override bool HighlightingPredicate(IHighlighting highlighting, IPsiSourceFile sourceFile)
{
return highlighting is MissingXmlDocHighlighting;
}
protected override void DoTestSolution(params string[] fileSet)
{
ExecuteWithinSettingsTransaction(settingsStore =>
{
RunGuarded(() => MutateSettings(settingsStore));
base.DoTestSolution(fileSet);
});
}
protected abstract void MutateSettings([NotNull] IContextBoundSettingsStore settingsStore);
}
}
|
using System.IO;
using JetBrains.Annotations;
using JetBrains.Application.Settings;
using JetBrains.ReSharper.Feature.Services.Daemon;
using JetBrains.ReSharper.FeaturesTestFramework.Daemon;
using JetBrains.ReSharper.Psi;
using JetBrains.ReSharper.TestFramework;
using XmlDocInspections.Plugin.Highlighting;
namespace XmlDocInspections.Plugin.Tests.Integrative
{
[TestNetFramework4]
public abstract class MissingXmlDocHighlightingTestsBase : CSharpHighlightingTestBase
{
protected override string RelativeTestDataPath => "Highlighting";
protected override string GetGoldTestDataPath(string fileName)
{
return base.GetGoldTestDataPath(Path.Combine(GetType().Name, fileName));
}
protected override bool HighlightingPredicate(IHighlighting highlighting, IPsiSourceFile sourceFile)
{
return highlighting is MissingXmlDocHighlighting;
}
protected override void DoTestSolution(params string[] fileSet)
{
ExecuteWithinSettingsTransaction(settingsStore =>
{
RunGuarded(() => MutateSettings(settingsStore));
base.DoTestSolution(fileSet);
});
}
protected abstract void MutateSettings([NotNull] IContextBoundSettingsStore settingsStore);
}
}
|
Replace CSharpHighlightingTestBase (will be removed in 2016.2 SDK) usage with TestNetFramework4-attribute
|
Replace CSharpHighlightingTestBase (will be removed in 2016.2 SDK) usage with TestNetFramework4-attribute
|
C#
|
mit
|
ulrichb/XmlDocInspections,ulrichb/XmlDocInspections,ulrichb/XmlDocInspections
|
ec467a1aaa5f5fbf4e95bb49e3196bca4e2a257c
|
src/SFA.DAS.EmployerApprenticeshipsService.Infrastructure/Services/CompaniesHouseEmployerVerificationService.cs
|
src/SFA.DAS.EmployerApprenticeshipsService.Infrastructure/Services/CompaniesHouseEmployerVerificationService.cs
|
using System;
using System.Net;
using System.Threading.Tasks;
using Microsoft.Azure;
using Newtonsoft.Json;
using NLog;
using SFA.DAS.EmployerApprenticeshipsService.Domain;
using SFA.DAS.EmployerApprenticeshipsService.Domain.Interfaces;
namespace SFA.DAS.EmployerApprenticeshipsService.Infrastructure.Services
{
public class CompaniesHouseEmployerVerificationService : IEmployerVerificationService
{
private static readonly ILogger Logger = LogManager.GetCurrentClassLogger();
private readonly string _apiKey;
public CompaniesHouseEmployerVerificationService(string apiKey)
{
_apiKey = apiKey;
}
public async Task<EmployerInformation> GetInformation(string id)
{
Logger.Info($"GetInformation({id})");
var webClient = new WebClient();
webClient.Headers.Add($"Authorization: Basic {_apiKey}");
try
{
var result = await webClient.DownloadStringTaskAsync($"https://api.companieshouse.gov.uk/company/{id}");
return JsonConvert.DeserializeObject<EmployerInformation>(result);
}
catch (WebException ex)
{
Logger.Error(ex, "There was a problem with the call to Companies House");
}
return null;
}
}
}
|
using System.Net;
using System.Threading.Tasks;
using Newtonsoft.Json;
using NLog;
using SFA.DAS.EmployerApprenticeshipsService.Domain;
using SFA.DAS.EmployerApprenticeshipsService.Domain.Configuration;
using SFA.DAS.EmployerApprenticeshipsService.Domain.Interfaces;
namespace SFA.DAS.EmployerApprenticeshipsService.Infrastructure.Services
{
public class CompaniesHouseEmployerVerificationService : IEmployerVerificationService
{
private readonly EmployerApprenticeshipsServiceConfiguration _configuration;
private static readonly ILogger Logger = LogManager.GetCurrentClassLogger();
public CompaniesHouseEmployerVerificationService(EmployerApprenticeshipsServiceConfiguration configuration)
{
_configuration = configuration;
}
public async Task<EmployerInformation> GetInformation(string id)
{
Logger.Info($"GetInformation({id})");
var webClient = new WebClient();
webClient.Headers.Add($"Authorization: Basic {_configuration.CompaniesHouse.ApiKey}");
try
{
var result = await webClient.DownloadStringTaskAsync($"https://api.companieshouse.gov.uk/company/{id}");
return JsonConvert.DeserializeObject<EmployerInformation>(result);
}
catch (WebException ex)
{
Logger.Error(ex, "There was a problem with the call to Companies House");
}
return null;
}
}
}
|
Modify the companies house verification service to use the config initalised as a constructor parameter
|
Modify the companies house verification service to use the config initalised as a constructor parameter
|
C#
|
mit
|
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
|
cb417c0277b1b0106232e77972ee87a1ba1818d2
|
src/Esfa.Vacancy.Register.UnitTests/SearchApprenticeship/Api/GivenSearchApprenticeshipParameters/AndPageNumber.cs
|
src/Esfa.Vacancy.Register.UnitTests/SearchApprenticeship/Api/GivenSearchApprenticeshipParameters/AndPageNumber.cs
|
using AutoMapper;
using Esfa.Vacancy.Api.Types;
using Esfa.Vacancy.Register.Api;
using Esfa.Vacancy.Register.Application.Queries.SearchApprenticeshipVacancies;
using FluentAssertions;
using NUnit.Framework;
namespace Esfa.Vacancy.Register.UnitTests.SearchApprenticeship.Api.GivenSearchApprenticeshipParameters
{
[TestFixture]
public class AndPageNumber
{
private IMapper _mapper;
[SetUp]
public void Setup()
{
var config = AutoMapperConfig.Configure();
_mapper = config.CreateMapper();
}
[Test]
public void WhenProvided_ThenPopulateRequestWithTheGivenValue()
{
var expectedPageNumber = 2;
var parameters = new SearchApprenticeshipParameters() { PageNumber = expectedPageNumber };
var result = _mapper.Map<SearchApprenticeshipVacanciesRequest>(parameters);
result.PageNumber.Should().Be(expectedPageNumber);
}
[Test]
public void WhenNotProvided_ThenPoplateRequestWithTheDefaultValue()
{
var parameters = new SearchApprenticeshipParameters();
var result = _mapper.Map<SearchApprenticeshipVacanciesRequest>(parameters);
result.PageNumber.Should().Be(1);
}
}
}
|
using AutoMapper;
using Esfa.Vacancy.Api.Types;
using Esfa.Vacancy.Register.Api;
using Esfa.Vacancy.Register.Application.Queries.SearchApprenticeshipVacancies;
using FluentAssertions;
using NUnit.Framework;
namespace Esfa.Vacancy.Register.UnitTests.SearchApprenticeship.Api.GivenSearchApprenticeshipParameters
{
[TestFixture]
public class AndPageNumber
{
private IMapper _mapper;
[SetUp]
public void Setup()
{
var config = AutoMapperConfig.Configure();
_mapper = config.CreateMapper();
}
[Test]
public void WhenProvided_ThenPopulateRequestWithTheGivenValue()
{
var expectedPageNumber = 2;
var parameters = new SearchApprenticeshipParameters() { PageNumber = expectedPageNumber };
var result = _mapper.Map<SearchApprenticeshipVacanciesRequest>(parameters);
result.PageNumber.Should().Be(expectedPageNumber);
}
[Test]
public void WhenNotProvided_ThenPopulateRequestWithTheDefaultValue()
{
var parameters = new SearchApprenticeshipParameters();
var result = _mapper.Map<SearchApprenticeshipVacanciesRequest>(parameters);
result.PageNumber.Should().Be(1);
}
}
}
|
Fix spelling error in method name
|
Fix spelling error in method name
|
C#
|
mit
|
SkillsFundingAgency/vacancy-register-api,SkillsFundingAgency/vacancy-register-api,SkillsFundingAgency/vacancy-register-api
|
d410d5576e529888c29db558cd65ed94ed601451
|
Assets/HoloToolkit/Utilities/Scripts/Extensions/TransformExtensions.cs
|
Assets/HoloToolkit/Utilities/Scripts/Extensions/TransformExtensions.cs
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using System.Text;
using UnityEngine;
namespace HoloToolkit.Unity
{
public static class TransformExtensions
{
/// <summary>
/// An extension method that will get you the full path to an object.
/// </summary>
/// <param name="transform">The transform you wish a full path to.</param>
/// <param name="delimiter">The delimiter with which each object is delimited in the string.</param>
/// <param name="prefix">Prefix with which the full path to the object should start.</param>
/// <returns>A delimited string that is the full path to the game object in the hierarchy.</returns>
public static string GetFullPath(this Transform transform, string delimiter = ".", string prefix = "/")
{
StringBuilder stringBuilder = new StringBuilder();
if (transform.parent == null)
{
stringBuilder.Append(prefix);
stringBuilder.Append(transform.name);
}
else
{
stringBuilder.Append(transform.parent.GetFullPath(delimiter, prefix));
stringBuilder.Append(delimiter);
stringBuilder.Append(transform.name);
}
return stringBuilder.ToString();
}
}
}
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using System.Text;
using UnityEngine;
namespace HoloToolkit.Unity
{
public static class TransformExtensions
{
/// <summary>
/// An extension method that will get you the full path to an object.
/// </summary>
/// <param name="transform">The transform you wish a full path to.</param>
/// <param name="delimiter">The delimiter with which each object is delimited in the string.</param>
/// <param name="prefix">Prefix with which the full path to the object should start.</param>
/// <returns>A delimited string that is the full path to the game object in the hierarchy.</returns>
public static string GetFullPath(this Transform transform, string delimiter = ".", string prefix = "/")
{
StringBuilder stringBuilder = new StringBuilder();
GetFullPath(stringBuilder, transform, delimiter, prefix);
return stringBuilder.ToString();
}
private static void GetFullPath(StringBuilder stringBuilder, Transform transform, string delimiter = ".", string prefix = "/")
{
if (transform.parent == null)
{
stringBuilder.Append(prefix);
}
else
{
GetFullPath(stringBuilder, transform.parent, delimiter, prefix);
stringBuilder.Append(delimiter);
}
stringBuilder.Append(transform.name);
}
}
}
|
Create one single instance of StringBuilder
|
Create one single instance of StringBuilder
|
C#
|
mit
|
davesmits/HoloToolkit-Unity,out-of-pixel/HoloToolkit-Unity,dbastienMS/HoloToolkit-Unity,HoloFan/HoloToolkit-Unity,darax/HoloToolkit-Unity,HattMarris1/HoloToolkit-Unity,chadbramwell/HoloToolkit-Unity,CameronVetter/HoloToolkit-Unity,willcong/HoloToolkit-Unity,ForrestTrepte/HoloToolkit-Unity,paseb/MixedRealityToolkit-Unity,vbandi/HoloToolkit-Unity,paseb/HoloToolkit-Unity,NeerajW/HoloToolkit-Unity
|
a9f7b0b6793e6e94457d19b04e263f57fd10b158
|
webscripthook-android/WebActivity.cs
|
webscripthook-android/WebActivity.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Webkit;
using Android.Widget;
namespace webscripthook_android
{
[Activity(Label = "GTAV WebScriptHook", ScreenOrientation = ScreenOrientation.Sensor)]
public class WebActivity : Activity
{
WebView webView;
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
Window.AddFlags(WindowManagerFlags.KeepScreenOn);
Window.RequestFeature(WindowFeatures.NoTitle);
SetContentView(Resource.Layout.Web);
webView = FindViewById<WebView>(Resource.Id.webView1);
webView.Settings.JavaScriptEnabled = true;
webView.SetWebViewClient(new WebViewClient()); // stops request going to Web Browser
if (savedInstanceState == null)
{
webView.LoadUrl(Intent.GetStringExtra("Address"));
}
}
public override void OnBackPressed()
{
if (webView.CanGoBack())
{
webView.GoBack();
}
else
{
base.OnBackPressed();
}
}
protected override void OnSaveInstanceState (Bundle outState)
{
base.OnSaveInstanceState(outState);
webView.SaveState(outState);
}
protected override void OnRestoreInstanceState(Bundle savedInstanceState)
{
base.OnRestoreInstanceState(savedInstanceState);
webView.RestoreState(savedInstanceState);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Webkit;
using Android.Widget;
namespace webscripthook_android
{
[Activity(Label = "GTAV WebScriptHook", ScreenOrientation = ScreenOrientation.Sensor,
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize)]
public class WebActivity : Activity
{
WebView webView;
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
Window.AddFlags(WindowManagerFlags.KeepScreenOn);
Window.RequestFeature(WindowFeatures.NoTitle);
SetContentView(Resource.Layout.Web);
webView = FindViewById<WebView>(Resource.Id.webView1);
webView.Settings.JavaScriptEnabled = true;
webView.SetWebViewClient(new WebViewClient()); // stops request going to Web Browser
if (savedInstanceState == null)
{
webView.LoadUrl(Intent.GetStringExtra("Address"));
}
}
public override void OnBackPressed()
{
if (webView.CanGoBack())
{
webView.GoBack();
}
else
{
base.OnBackPressed();
}
}
}
}
|
Stop webview from reloading when rotated
|
Stop webview from reloading when rotated
|
C#
|
mit
|
LibertyLocked/webscripthook-android
|
98726e9ec54c29f0cd8aed4bdc599b55224a79d0
|
src/SFA.DAS.EmployerUsers.Web/Views/Login/AuthorizeResponse.cshtml
|
src/SFA.DAS.EmployerUsers.Web/Views/Login/AuthorizeResponse.cshtml
|
@model IdentityServer3.Core.ViewModels.AuthorizeResponseViewModel
<h1 class="heading-large">Login successful</h1>
<form id="mainForm" method="post" action="@Model.ResponseFormUri">
<div id="autoRedirect" style="display: none;">Please wait...</div>
@Html.Raw(Model.ResponseFormFields)
<div id="manualLoginContainer">
<p>It appears you do not have javascript enabled. Please click the continue button to complete your login.</p>
<button type="submit" class="button" autofocus="autofocus">Continue</button>
</div>
</form>
@section scripts
{
<script>
$('#manualLoginContainer').hide();
$('#autoRedirect').show();
$('#mainForm').submit();
</script>
}
|
@model IdentityServer3.Core.ViewModels.AuthorizeResponseViewModel
@{
ViewBag.PageID = "authorize-response";
ViewBag.Title = "Login Successful";
ViewBag.HideSigninLink = "true";
}
<h1 class="heading-xlarge">Login successful</h1>
<form id="mainForm" method="post" action="@Model.ResponseFormUri">
<div id="autoRedirect" style="display: none;">Please wait...</div>
@Html.Raw(Model.ResponseFormFields)
<div id="manualLoginContainer">
<p>It appears you do not have javascript enabled. Please click the continue button to complete your login.</p>
<button type="submit" class="button" autofocus="autofocus">Continue</button>
</div>
</form>
@section scripts
{
<script>
$('#manualLoginContainer').hide();
$('#autoRedirect').show();
$('#mainForm').submit();
</script>
}
|
Fix h1 class to match other views
|
Fix h1 class to match other views
|
C#
|
mit
|
SkillsFundingAgency/das-employerusers,SkillsFundingAgency/das-employerusers,SkillsFundingAgency/das-employerusers
|
680869a1424c32130b06d4e7e57f7b32cb849089
|
FbxTime.cs
|
FbxTime.cs
|
using System;
namespace FbxSharp
{
public struct FbxTime
{
public static readonly FbxTime Infinite = new FbxTime(0x7fffffffffffffffL);
public static readonly FbxTime Zero = new FbxTime(0);
public FbxTime(long time)
{
Value = time;
}
public long Value;
public long Get()
{
return Value;
}
public double GetSecondDouble()
{
return Value / 46186158000.0;
}
public long GetFrameCount()
{
return Value / 1539538600L;
}
}
}
|
using System;
namespace FbxSharp
{
public struct FbxTime
{
public static readonly FbxTime Infinite = new FbxTime(0x7fffffffffffffffL);
public static readonly FbxTime Zero = new FbxTime(0);
public const long UnitsPerSecond = 46186158000L;
public FbxTime(long time)
{
Value = time;
}
public long Value;
public long Get()
{
return Value;
}
public double GetSecondDouble()
{
return Value / (double)UnitsPerSecond;
}
public long GetFrameCount()
{
return Value / 1539538600L;
}
}
}
|
Store the number of time units per second in a static const value.
|
Store the number of time units per second in a static const value.
|
C#
|
lgpl-2.1
|
izrik/FbxSharp,izrik/FbxSharp,izrik/FbxSharp,izrik/FbxSharp,izrik/FbxSharp
|
7d25ac7ab17b804325bafbe14a99bbe26681df6f
|
PU-Stub/Controllers/SnodController.cs
|
PU-Stub/Controllers/SnodController.cs
|
using Kentor.PU_Adapter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace PU_Stub.Controllers
{
public class SnodController : ApiController
{
private static readonly IDictionary<string, string> TestPersons;
static SnodController()
{
TestPersons = Kentor.PU_Adapter.TestData.TestPersonsPuData.PuDataList
.ToDictionary(p => p.Substring(8, 12)); // index by person number
}
[HttpGet]
public HttpResponseMessage PKNODPLUS(string arg)
{
System.Threading.Thread.Sleep(30); // Introduce production like latency
string result;
if (!TestPersons.TryGetValue(arg, out result))
{
// Returkod: 0001 = Sökt person saknas i registren
result = "13270001 _";
}
var resp = new HttpResponseMessage(HttpStatusCode.OK);
resp.Content = new StringContent(result, System.Text.Encoding.GetEncoding("ISO-8859-1"), "text/plain");
return resp;
}
}
}
|
using Kentor.PU_Adapter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace PU_Stub.Controllers
{
public class SnodController : ApiController
{
private static readonly IDictionary<string, string> TestPersons;
static SnodController()
{
TestPersons = Kentor.PU_Adapter.TestData.TestPersonsPuData.PuDataList
.ToDictionary(p => p.Substring(8, 12)); // index by person number
}
[HttpGet]
public HttpResponseMessage PKNODPLUS(string arg)
{
System.Threading.Thread.Sleep(30); // Introduce production like latency
string result;
if (!TestPersons.TryGetValue(arg, out result))
{
// Returkod: 0001 = Sökt person saknas i registren
result = "13270001 _";
}
result = "0\n0\n1327\n" + result; // add magic initial lines, like production PU does
var resp = new HttpResponseMessage(HttpStatusCode.OK);
resp.Content = new StringContent(result, System.Text.Encoding.GetEncoding("ISO-8859-1"), "text/plain");
return resp;
}
}
}
|
Add inital response lines in PU-Stub to mimic production PU
|
Add inital response lines in PU-Stub to mimic production PU
|
C#
|
mit
|
KentorIT/PU-Adapter,KentorIT/PU-Adapter
|
064efcb8a8622a7e533e791d322b4cf2f21f2a73
|
CIV/Program.cs
|
CIV/Program.cs
|
using CIV.Ccs;
namespace CIV
{
class Program
{
static void Main(string[] args)
{
var text = System.IO.File.ReadAllText(args[0]);
var processes = CcsFacade.ParseAll(text);
var trace = CcsFacade.RandomTrace(processes["Prison"], 450);
foreach (var action in trace)
{
System.Console.WriteLine(action);
}
}
}
}
|
using static System.Console;
using CIV.Ccs;
namespace CIV
{
class Program
{
static void Main(string[] args)
{
var text = System.IO.File.ReadAllText(args[0]);
var processes = CcsFacade.ParseAll(text);
var trace = CcsFacade.RandomTrace(processes["Prison"], 450);
foreach (var action in trace)
{
WriteLine(action);
}
}
}
}
|
Add “using static System.Console” to main
|
Add “using static System.Console” to main
|
C#
|
mit
|
lou1306/CIV,lou1306/CIV
|
140ea7beb8cc69d51115be67046fb9f5085aed88
|
src/Lunet.Core/SiteFactory.cs
|
src/Lunet.Core/SiteFactory.cs
|
// Copyright (c) Alexandre Mutel. All rights reserved.
// This file is licensed under the BSD-Clause 2 license.
// See the license.txt file in the project root for more information.
using System;
using System.IO;
using System.Reflection;
using Autofac;
using Lunet.Core;
using Microsoft.Extensions.Logging;
namespace Lunet
{
public class SiteFactory
{
private readonly ContainerBuilder _containerBuilder;
public SiteFactory()
{
_containerBuilder = new ContainerBuilder();
// Pre-register some type
_containerBuilder.RegisterInstance(this);
_containerBuilder.RegisterType<LoggerFactory>().As<ILoggerFactory>().SingleInstance();
_containerBuilder.RegisterType<SiteObject>().SingleInstance();
}
public ContainerBuilder ContainerBuilder => _containerBuilder;
public SiteFactory Register<TPlugin>() where TPlugin : ISitePlugin
{
Register(typeof(TPlugin));
return this;
}
public SiteFactory Register(Type pluginType)
{
if (pluginType == null) throw new ArgumentNullException(nameof(pluginType));
if (!typeof(ISitePlugin).GetTypeInfo().IsAssignableFrom(pluginType))
{
throw new ArgumentException("Expecting a plugin type inheriting from ISitePlugin", nameof(pluginType));
}
_containerBuilder.RegisterType(pluginType).AsSelf().As<ISitePlugin>();
return this;
}
public SiteObject Build()
{
var container = _containerBuilder.Build();
return container.Resolve<SiteObject>();
}
}
}
|
// Copyright (c) Alexandre Mutel. All rights reserved.
// This file is licensed under the BSD-Clause 2 license.
// See the license.txt file in the project root for more information.
using System;
using System.IO;
using System.Reflection;
using Autofac;
using Lunet.Core;
using Microsoft.Extensions.Logging;
namespace Lunet
{
public class SiteFactory
{
private readonly ContainerBuilder _containerBuilder;
public SiteFactory()
{
_containerBuilder = new ContainerBuilder();
// Pre-register some type
_containerBuilder.RegisterInstance(this);
_containerBuilder.RegisterType<LoggerFactory>().As<ILoggerFactory>().SingleInstance();
_containerBuilder.RegisterType<SiteObject>().SingleInstance();
}
public ContainerBuilder ContainerBuilder => _containerBuilder;
public SiteFactory Register<TPlugin>() where TPlugin : ISitePlugin
{
Register(typeof(TPlugin));
return this;
}
public SiteFactory Register(Type pluginType)
{
if (pluginType == null) throw new ArgumentNullException(nameof(pluginType));
if (!typeof(ISitePlugin).GetTypeInfo().IsAssignableFrom(pluginType))
{
throw new ArgumentException("Expecting a plugin type inheriting from ISitePlugin", nameof(pluginType));
}
_containerBuilder.RegisterType(pluginType).SingleInstance().AsSelf().As<ISitePlugin>();
return this;
}
public SiteObject Build()
{
var container = _containerBuilder.Build();
return container.Resolve<SiteObject>();
}
}
}
|
Make sure that a plugin is only created once
|
Make sure that a plugin is only created once
|
C#
|
bsd-2-clause
|
lunet-io/lunet,lunet-io/lunet
|
4cd47cbe710464ee62133ca9cec8967bf47d8b3c
|
Assets/Resources/Scripts/GameStart.cs
|
Assets/Resources/Scripts/GameStart.cs
|
using UnityEngine;
using System.Collections;
public class GameStart : MonoBehaviour {
static int gameMode = INSTRUCTION;
const int INSTRUCTION = -1;
const int ONE_PLAYER = 1;
const int TWO_PLAYER = 2;
/// <summary>
/// The game mode of the current game
/// </summary>
public static int GameMode
{
get { return gameMode; }
set
{
if(value == ONE_PLAYER || value == TWO_PLAYER || value == INSTRUCTION)
{
gameMode = value;
}
}
}
/// <summary>
/// Add the game to the global board and then destroy this (no longer necessary)
/// </summary>
private void Awake()
{
if(GameMode == ONE_PLAYER)
{
gameObject.AddComponent<SinglePlayerGame>();
}
else if (GameMode == TWO_PLAYER)
{
gameObject.AddComponent<Game>();
}
else if (GameMode == INSTRUCTION)
{
gameObject.AddComponent<InstructionGame>();
}
Destroy(this);
}
}
|
using UnityEngine;
using System.Collections;
public class GameStart : MonoBehaviour {
static int gameMode = ONE_PLAYER;
const int INSTRUCTION = -1;
const int ONE_PLAYER = 1;
const int TWO_PLAYER = 2;
/// <summary>
/// The game mode of the current game
/// </summary>
public static int GameMode
{
get { return gameMode; }
set
{
if(value == ONE_PLAYER || value == TWO_PLAYER || value == INSTRUCTION)
{
gameMode = value;
}
}
}
/// <summary>
/// Add the game to the global board and then destroy this (no longer necessary)
/// </summary>
private void Awake()
{
if(GameMode == ONE_PLAYER)
{
gameObject.AddComponent<SinglePlayerGame>();
}
else if (GameMode == TWO_PLAYER)
{
gameObject.AddComponent<Game>();
}
else if (GameMode == INSTRUCTION)
{
gameObject.AddComponent<InstructionGame>();
}
Destroy(this);
}
}
|
Change default gamemode from INSTRUCTION to ONE_PLAYER
|
Change default gamemode from INSTRUCTION to ONE_PLAYER
|
C#
|
mit
|
Curdflappers/UltimateTicTacToe
|
198f2ea8c87c83e308be4f0e06cb12f49efc1815
|
AbpODataDemo-Core/aspnet-core/src/AbpODataDemo.Web.Core/Controllers/PersonsController.cs
|
AbpODataDemo-Core/aspnet-core/src/AbpODataDemo.Web.Core/Controllers/PersonsController.cs
|
using Abp.AspNetCore.OData.Controllers;
using Abp.Dependency;
using Abp.Domain.Repositories;
using Abp.Web.Models;
using AbpODataDemo.People;
using Microsoft.AspNet.OData;
using Microsoft.AspNetCore.Mvc;
using System.Linq;
using System.Threading.Tasks;
namespace AbpODataDemo.Controllers
{
[DontWrapResult]
public class PersonsController : AbpODataEntityController<Person>, ITransientDependency
{
public PersonsController(IRepository<Person> repository)
: base(repository)
{
}
public override Task<IActionResult> Delete([FromODataUri] int key)
{
return base.Delete(key);
}
public override IQueryable<Person> Get()
{
return base.Get();
}
public override SingleResult<Person> Get([FromODataUri] int key)
{
return base.Get(key);
}
public override Task<IActionResult> Patch([FromODataUri] int key, Delta<Person> entity)
{
return base.Patch(key, entity);
}
public override Task<IActionResult> Post(Person entity)
{
return base.Post(entity);
}
public override Task<IActionResult> Put([FromODataUri] int key, Person update)
{
return base.Put(key, update);
}
}
}
|
using Abp.AspNetCore.OData.Controllers;
using Abp.Dependency;
using Abp.Domain.Repositories;
using Abp.Web.Models;
using AbpODataDemo.People;
using Microsoft.AspNet.OData;
using Microsoft.AspNetCore.Mvc;
using System.Linq;
using System.Threading.Tasks;
namespace AbpODataDemo.Controllers
{
[DontWrapResult]
public class PersonsController : AbpODataEntityController<Person>, ITransientDependency
{
public PersonsController(IRepository<Person> repository)
: base(repository)
{
}
public override Task<IActionResult> Delete([FromODataUri] int key)
{
return base.Delete(key);
}
public override IQueryable<Person> Get()
{
return base.Get();
}
public override SingleResult<Person> Get([FromODataUri] int key)
{
return base.Get(key);
}
public override Task<IActionResult> Patch([FromODataUri] int key, [FromBody] Delta<Person> entity)
{
return base.Patch(key, entity);
}
public override Task<IActionResult> Post([FromBody] Person entity)
{
return base.Post(entity);
}
public override Task<IActionResult> Put([FromODataUri] int key, [FromBody] Person update)
{
return base.Put(key, update);
}
}
}
|
Fix model binding for OData Patch, Post, Put
|
Fix model binding for OData Patch, Post, Put
|
C#
|
mit
|
aspnetboilerplate/sample-odata,aspnetboilerplate/sample-odata,aspnetboilerplate/sample-odata
|
ee6d1c9952cef13c992e0162bc1d4c78f9980c68
|
Settings/OptionsDialogPage.cs
|
Settings/OptionsDialogPage.cs
|
/**
Copyright 2014-2017 Robert McNeel and Associates
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
**/
using Rhino;
using Rhino.DocObjects;
using Rhino.UI;
using RhinoCyclesCore.Core;
using System;
using System.Drawing;
namespace RhinoCycles.Settings
{
public class OptionsDialogPage : Rhino.UI.OptionsDialogPage
{
public OptionsDialogPage() : base(Localization.LocalizeString("Cycles", 7))
{
CollapsibleSectionHolder = new OptionsDialogCollapsibleSectionUIPanel();
}
public override object PageControl => CollapsibleSectionHolder;
public override bool ShowApplyButton => false;
public override bool ShowDefaultsButton => true;
public override void OnDefaults()
{
RcCore.It.EngineSettings.DefaultSettings();
CollapsibleSectionHolder.UpdateSections();
}
private OptionsDialogCollapsibleSectionUIPanel CollapsibleSectionHolder { get; }
}
}
|
/**
Copyright 2014-2017 Robert McNeel and Associates
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
**/
using Rhino;
using Rhino.DocObjects;
using Rhino.UI;
using RhinoCyclesCore.Core;
using System;
using System.Drawing;
namespace RhinoCycles.Settings
{
public class OptionsDialogPage : Rhino.UI.OptionsDialogPage
{
public OptionsDialogPage() : base("Cycles")
{
CollapsibleSectionHolder = new OptionsDialogCollapsibleSectionUIPanel();
}
public override object PageControl => CollapsibleSectionHolder;
public override bool ShowApplyButton => false;
public override bool ShowDefaultsButton => true;
public override string LocalPageTitle => Localization.LocalizeString ("Cycles", 7);
public override Image PageImage {
get {
var icon = Properties.Resources.Cycles_viewport_properties;
return icon.ToBitmap ();
}
}
public override void OnDefaults()
{
RcCore.It.EngineSettings.DefaultSettings();
CollapsibleSectionHolder.UpdateSections();
}
private OptionsDialogCollapsibleSectionUIPanel CollapsibleSectionHolder { get; }
}
}
|
Add PageImage override for Mac and fix title string
|
Add PageImage override for Mac and fix title string
|
C#
|
apache-2.0
|
mcneel/RhinoCycles
|
b77fa121c3b8eb873d28db6b77dc2638c1c1fa96
|
src/SFA.DAS.EmployerApprenticeshipsService.Web/Views/EmployerTeam/Index.cshtml
|
src/SFA.DAS.EmployerApprenticeshipsService.Web/Views/EmployerTeam/Index.cshtml
|
@model SFA.DAS.EmployerApprenticeshipsService.Domain.Entities.Account.Account
<h1 class="heading-xlarge" id="company-Name">@Model.Name</h1>
<div class="grid-row">
<div class="column-two-thirds">
<div style="max-width: 90%">
<div class="grid-row">
<div class="column-half">
<h3 class="heading-medium" style="margin-top: 0;">
<a href="@Url.Action("View", new { accountId = Model.Id })">Team</a>
</h3>
<p>Invite new users and manage existing ones</p>
</div>
<div class="column-half ">
<h3 class="heading-medium" style="margin-top: 0">
<a href="#">Funding</a>
</h3>
<p>Manage your funds including how much you have available to spend, your transactions and funds you could lose</p>
</div>
</div>
</div>
</div>
</div>
|
@model SFA.DAS.EmployerApprenticeshipsService.Domain.Entities.Account.Account
<h1 class="heading-xlarge" id="company-Name">@Model.Name</h1>
<div class="grid-row">
<div class="column-two-thirds">
<div style="max-width: 90%">
<div class="grid-row">
<div class="column-half">
<h3 class="heading-medium" style="margin-top: 0;">
<a href="@Url.Action("View", new { accountId = Model.Id })">Team</a>
</h3>
<p>Invite new users and manage existing ones</p>
</div>
<div class="column-half ">
<h3 class="heading-medium" style="margin-top: 0">
<a href="@Url.Action("Index", "EmployerAccountTransactions", new { accountId = Model.Id })">Funding</a>
</h3>
<p>Manage your funds including how much you have available to spend, your transactions and funds you could lose</p>
</div>
</div>
</div>
</div>
</div>
|
Update funding link to go to account transactions index
|
Update funding link to go to account transactions index
|
C#
|
mit
|
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
|
4086811ab7ee0fe024735b9727f49b362f1caf8b
|
MadeWithLove.Middleware/Extensions.cs
|
MadeWithLove.Middleware/Extensions.cs
|
namespace MadeWithLove.Middleware
{
using Owin;
public static class Extensions
{
public static void MakeWithLove(this IAppBuilder app, string customIngredient)
{
app.Use<MadeWithLoveMiddleware>(customIngredient);
}
}
}
|
namespace MadeWithLove.Middleware
{
using Owin;
public static class Extensions
{
public static void MakeWithLove(this IAppBuilder app, string customIngredient = null)
{
app.Use<MadeWithLoveMiddleware>(customIngredient);
}
}
}
|
Make custom ingredient optional on extension method
|
Make custom ingredient optional on extension method
|
C#
|
mit
|
druttka/made-with-love
|
c7dc3c80a9f7f8f67c01b8f800907edf501e851c
|
osu.Framework/OS/HeadlessGameHost.cs
|
osu.Framework/OS/HeadlessGameHost.cs
|
// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Input;
using osu.Framework.Statistics;
namespace osu.Framework.OS
{
/// <summary>
/// A GameHost which doesn't require a graphical or sound device.
/// </summary>
public class HeadlessGameHost : BasicGameHost
{
public override GLControl GLControl => null;
public override bool IsActive => true;
public override TextInputSource TextInput => null;
protected override void DrawFrame()
{
//we can't draw.
}
public override void Run()
{
while (!ExitRequested)
{
UpdateMonitor.NewFrame();
using (UpdateMonitor.BeginCollecting(PerformanceCollectionType.Scheduler))
{
UpdateScheduler.Update();
}
using (UpdateMonitor.BeginCollecting(PerformanceCollectionType.Update))
{
UpdateSubTree();
using (var buffer = DrawRoots.Get(UsageType.Write))
buffer.Object = GenerateDrawNodeSubtree(buffer.Object);
}
using (UpdateMonitor.BeginCollecting(PerformanceCollectionType.Sleep))
{
UpdateClock.ProcessFrame();
}
}
}
}
}
|
// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Input;
using osu.Framework.Input.Handlers;
using osu.Framework.Statistics;
namespace osu.Framework.OS
{
/// <summary>
/// A GameHost which doesn't require a graphical or sound device.
/// </summary>
public class HeadlessGameHost : BasicGameHost
{
public override GLControl GLControl => null;
public override bool IsActive => true;
public override TextInputSource TextInput => null;
protected override void DrawFrame()
{
//we can't draw.
}
public override void Run()
{
while (!ExitRequested)
{
UpdateMonitor.NewFrame();
using (UpdateMonitor.BeginCollecting(PerformanceCollectionType.Scheduler))
{
UpdateScheduler.Update();
}
using (UpdateMonitor.BeginCollecting(PerformanceCollectionType.Update))
{
UpdateSubTree();
using (var buffer = DrawRoots.Get(UsageType.Write))
buffer.Object = GenerateDrawNodeSubtree(buffer.Object);
}
using (UpdateMonitor.BeginCollecting(PerformanceCollectionType.Sleep))
{
UpdateClock.ProcessFrame();
}
}
}
public override IEnumerable<InputHandler> GetInputHandlers() => new InputHandler[] { };
}
}
|
Add empty inputhandlers list for headless execution.
|
Add empty inputhandlers list for headless execution.
|
C#
|
mit
|
Nabile-Rahmani/osu-framework,Tom94/osu-framework,EVAST9919/osu-framework,RedNesto/osu-framework,ZLima12/osu-framework,naoey/osu-framework,NeoAdonis/osu-framework,default0/osu-framework,Nabile-Rahmani/osu-framework,smoogipooo/osu-framework,DrabWeb/osu-framework,DrabWeb/osu-framework,ppy/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,Tom94/osu-framework,EVAST9919/osu-framework,RedNesto/osu-framework,NeoAdonis/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,peppy/osu-framework,paparony03/osu-framework,ZLima12/osu-framework,naoey/osu-framework,EVAST9919/osu-framework,default0/osu-framework,paparony03/osu-framework,ppy/osu-framework,DrabWeb/osu-framework,ppy/osu-framework
|
12fe8820083b1d6f47e81a5c8414cef7cb634504
|
source/AssemblyInfo.cs
|
source/AssemblyInfo.cs
|
using System;
using System.Reflection;
using System.Runtime.InteropServices;
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.225
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: AssemblyProductAttribute("Gitnub: Automated Tasks for Github")]
[assembly: AssemblyCompanyAttribute("Tall Ambitions LLC")]
[assembly: AssemblyCopyrightAttribute("Copyright 2011 Tall Ambitions LLC, and contributors")]
[assembly: AssemblyVersionAttribute("0.0.0.0")]
[assembly: AssemblyFileVersionAttribute("0.0.0.0")]
[assembly: ComVisibleAttribute(false)]
[assembly: CLSCompliantAttribute(true)]
|
using System;
using System.Reflection;
using System.Runtime.InteropServices;
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.225
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: AssemblyProductAttribute("Gitnub: Automated Tasks for Github")]
[assembly: AssemblyCompanyAttribute("Tall Ambitions LLC")]
[assembly: AssemblyCopyrightAttribute("Copyright 2011 Tall Ambitions LLC, and contributors")]
[assembly: AssemblyVersionAttribute("0.1.0.0")]
[assembly: AssemblyFileVersionAttribute("0.1.0.0")]
[assembly: ComVisibleAttribute(false)]
[assembly: CLSCompliantAttribute(true)]
|
Increase version number to 0.1.0.0.
|
Increase version number to 0.1.0.0.
|
C#
|
mit
|
TallAmbitions/Gitnub
|
814e398b80c476337243c45e88f6a678e5740676
|
LiveSplit/LiveSplit.Core/Model/Comparisons/StandardComparisonGeneratorsFactory.cs
|
LiveSplit/LiveSplit.Core/Model/Comparisons/StandardComparisonGeneratorsFactory.cs
|
using System.Collections.Generic;
namespace LiveSplit.Model.Comparisons
{
public class StandardComparisonGeneratorsFactory : IComparisonGeneratorsFactory
{
static StandardComparisonGeneratorsFactory()
{
CompositeComparisons.AddShortComparisonName(BestSegmentsComparisonGenerator.ComparisonName, BestSegmentsComparisonGenerator.ShortComparisonName);
CompositeComparisons.AddShortComparisonName(Run.PersonalBestComparisonName, "PB");
CompositeComparisons.AddShortComparisonName(AverageSegmentsComparisonGenerator.ComparisonName, AverageSegmentsComparisonGenerator.ShortComparisonName);
CompositeComparisons.AddShortComparisonName(PercentileComparisonGenerator.ComparisonName, PercentileComparisonGenerator.ShortComparisonName);
}
public IEnumerable<IComparisonGenerator> Create(IRun run)
{
yield return new BestSegmentsComparisonGenerator(run);
yield return new AverageSegmentsComparisonGenerator(run);
}
public IEnumerable<IComparisonGenerator> GetAllGenerators(IRun run)
{
yield return new BestSegmentsComparisonGenerator(run);
yield return new BestSplitTimesComparisonGenerator(run);
yield return new AverageSegmentsComparisonGenerator(run);
yield return new WorstSegmentsComparisonGenerator(run);
yield return new PercentileComparisonGenerator(run);
yield return new NoneComparisonGenerator(run);
}
}
}
|
using System.Collections.Generic;
namespace LiveSplit.Model.Comparisons
{
public class StandardComparisonGeneratorsFactory : IComparisonGeneratorsFactory
{
static StandardComparisonGeneratorsFactory()
{
CompositeComparisons.AddShortComparisonName(BestSegmentsComparisonGenerator.ComparisonName, BestSegmentsComparisonGenerator.ShortComparisonName);
CompositeComparisons.AddShortComparisonName(Run.PersonalBestComparisonName, "PB");
CompositeComparisons.AddShortComparisonName(AverageSegmentsComparisonGenerator.ComparisonName, AverageSegmentsComparisonGenerator.ShortComparisonName);
CompositeComparisons.AddShortComparisonName(WorstSegmentsComparisonGenerator.ComparisonName, WorstSegmentsComparisonGenerator.ShortComparisonName);
CompositeComparisons.AddShortComparisonName(PercentileComparisonGenerator.ComparisonName, PercentileComparisonGenerator.ShortComparisonName);
}
public IEnumerable<IComparisonGenerator> Create(IRun run)
{
yield return new BestSegmentsComparisonGenerator(run);
yield return new AverageSegmentsComparisonGenerator(run);
}
public IEnumerable<IComparisonGenerator> GetAllGenerators(IRun run)
{
yield return new BestSegmentsComparisonGenerator(run);
yield return new BestSplitTimesComparisonGenerator(run);
yield return new AverageSegmentsComparisonGenerator(run);
yield return new WorstSegmentsComparisonGenerator(run);
yield return new PercentileComparisonGenerator(run);
yield return new NoneComparisonGenerator(run);
}
}
}
|
Add short name for Worst Segments
|
Add short name for Worst Segments
|
C#
|
mit
|
Fluzzarn/LiveSplit,Jiiks/LiveSplit,PackSciences/LiveSplit,kugelrund/LiveSplit,ROMaster2/LiveSplit,chloe747/LiveSplit,stoye/LiveSplit,Glurmo/LiveSplit,Jiiks/LiveSplit,stoye/LiveSplit,chloe747/LiveSplit,Dalet/LiveSplit,Dalet/LiveSplit,zoton2/LiveSplit,ROMaster2/LiveSplit,ROMaster2/LiveSplit,kugelrund/LiveSplit,Glurmo/LiveSplit,PackSciences/LiveSplit,Fluzzarn/LiveSplit,stoye/LiveSplit,LiveSplit/LiveSplit,PackSciences/LiveSplit,zoton2/LiveSplit,zoton2/LiveSplit,Dalet/LiveSplit,Jiiks/LiveSplit,Glurmo/LiveSplit,kugelrund/LiveSplit,chloe747/LiveSplit,Fluzzarn/LiveSplit
|
30a292eaa381a8304dd8f1e8ba8978538478a828
|
test/Microsoft.ApplicationInsights.AspNetCore.Tests/TelemetryInitializers/DomainNameRoleInstanceTelemetryInitializerTests.cs
|
test/Microsoft.ApplicationInsights.AspNetCore.Tests/TelemetryInitializers/DomainNameRoleInstanceTelemetryInitializerTests.cs
|
namespace Microsoft.ApplicationInsights.AspNetCore.Tests.ContextInitializers
{
using System;
using System.Globalization;
using System.Net;
using System.Net.NetworkInformation;
using Helpers;
using Microsoft.ApplicationInsights.AspNetCore.TelemetryInitializers;
using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.ApplicationInsights.Extensibility.Implementation;
using Microsoft.AspNetCore.Http;
using Xunit;
public class DomainNameRoleInstanceTelemetryInitializerTests
{
private const string TestListenerName = "TestListener";
[Fact]
public void RoleInstanceNameIsSetToDomainAndHost()
{
var source = new DomainNameRoleInstanceTelemetryInitializer();
var requestTelemetry = new RequestTelemetry();
source.Initialize(requestTelemetry);
string hostName = Dns.GetHostName();
#if net46
string domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName;
if (hostName.EndsWith(domainName, StringComparison.OrdinalIgnoreCase) == false)
{
hostName = string.Format(CultureInfo.InvariantCulture, "{0}.{1}", hostName, domainName);
}
#endif
Assert.Equal(hostName, requestTelemetry.Context.Cloud.RoleInstance);
}
[Fact]
public void ContextInitializerDoesNotOverrideMachineName()
{
var source = new DomainNameRoleInstanceTelemetryInitializer();
var requestTelemetry = new RequestTelemetry();
requestTelemetry.Context.Cloud.RoleInstance = "Test";
source.Initialize(requestTelemetry);
Assert.Equal("Test", requestTelemetry.Context.Cloud.RoleInstance);
}
}
}
|
namespace Microsoft.ApplicationInsights.AspNetCore.Tests.ContextInitializers
{
using System;
using System.Globalization;
using System.Net;
using System.Net.NetworkInformation;
using Helpers;
using Microsoft.ApplicationInsights.AspNetCore.TelemetryInitializers;
using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.ApplicationInsights.Extensibility.Implementation;
using Microsoft.AspNetCore.Http;
using Xunit;
public class DomainNameRoleInstanceTelemetryInitializerTests
{
private const string TestListenerName = "TestListener";
[Fact]
public void RoleInstanceNameIsSetToDomainAndHost()
{
var source = new DomainNameRoleInstanceTelemetryInitializer();
var requestTelemetry = new RequestTelemetry();
source.Initialize(requestTelemetry);
string hostName = Dns.GetHostName();
#if NET46
string domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName;
if (hostName.EndsWith(domainName, StringComparison.OrdinalIgnoreCase) == false)
{
hostName = string.Format(CultureInfo.InvariantCulture, "{0}.{1}", hostName, domainName);
}
#endif
Assert.Equal(hostName, requestTelemetry.Context.Cloud.RoleInstance);
}
[Fact]
public void ContextInitializerDoesNotOverrideMachineName()
{
var source = new DomainNameRoleInstanceTelemetryInitializer();
var requestTelemetry = new RequestTelemetry();
requestTelemetry.Context.Cloud.RoleInstance = "Test";
source.Initialize(requestTelemetry);
Assert.Equal("Test", requestTelemetry.Context.Cloud.RoleInstance);
}
}
}
|
Correct compie time constant to be NET46
|
Correct compie time constant to be NET46
|
C#
|
mit
|
Microsoft/ApplicationInsights-aspnetcore,Microsoft/ApplicationInsights-aspnet5,Microsoft/ApplicationInsights-aspnet5,Microsoft/ApplicationInsights-aspnet5,Microsoft/ApplicationInsights-aspnetcore,Microsoft/ApplicationInsights-aspnetcore
|
016267ad2a8cbebd3e6b6538744e12bab1f3c26e
|
ElectronicCash/BaseActor.cs
|
ElectronicCash/BaseActor.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicCash
{
public abstract class BaseActor
{
public string Name { get; set; }
public Guid ActorGuid { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicCash
{
/// <summary>
/// The base actor abstracts all common properties of our actors (mainly Bank, Merchant, Customer)
/// </summary>
public abstract class BaseActor
{
public string Name { get; set; }
public Guid ActorGuid { get; set; }
public Int32 Money { get; set; }
public Dictionary<Guid, List<MoneyOrder>> Ledger { get; private set; }
}
}
|
Move more stuff to superclass
|
Move more stuff to superclass
|
C#
|
mit
|
0culus/ElectronicCash
|
3ce1952af4bb0ed39ad1fed660431a77c34950cb
|
CefSharp.Example/CefExample.cs
|
CefSharp.Example/CefExample.cs
|
using System;
using System.Linq;
namespace CefSharp.Example
{
public static class CefExample
{
public const string DefaultUrl = "custom://cefsharp/BindingTest.html";
// Use when debugging the actual SubProcess, to make breakpoints etc. inside that project work.
private const bool debuggingSubProcess = true;
public static void Init()
{
var settings = new CefSettings();
settings.RemoteDebuggingPort = 8088;
//settings.CefCommandLineArgs.Add("renderer-process-limit", "1");
//settings.CefCommandLineArgs.Add("renderer-startup-dialog", "renderer-startup-dialog");
if (debuggingSubProcess)
{
settings.BrowserSubprocessPath = "..\\..\\..\\..\\CefSharp.BrowserSubprocess\\bin\\x86\\Debug\\CefSharp.BrowserSubprocess.exe";
}
settings.RegisterScheme(new CefCustomScheme
{
SchemeName = CefSharpSchemeHandlerFactory.SchemeName,
SchemeHandlerFactory = new CefSharpSchemeHandlerFactory()
});
if (!Cef.Initialize(settings))
{
if (Environment.GetCommandLineArgs().Contains("--type=renderer"))
{
Environment.Exit(0);
}
else
{
return;
}
}
}
}
}
|
using System;
using System.Linq;
namespace CefSharp.Example
{
public static class CefExample
{
public const string DefaultUrl = "custom://cefsharp/BindingTest.html";
// Use when debugging the actual SubProcess, to make breakpoints etc. inside that project work.
private const bool debuggingSubProcess = true;
public static void Init()
{
var settings = new CefSettings();
settings.RemoteDebuggingPort = 8088;
//settings.CefCommandLineArgs.Add("renderer-process-limit", "1");
//settings.CefCommandLineArgs.Add("renderer-startup-dialog", "renderer-startup-dialog");
if (debuggingSubProcess)
{
var architecture = Environment.Is64BitProcess ? "x64" : "x86";
settings.BrowserSubprocessPath = "..\\..\\..\\..\\CefSharp.BrowserSubprocess\\bin\\" + architecture + "\\Debug\\CefSharp.BrowserSubprocess.exe";
}
settings.RegisterScheme(new CefCustomScheme
{
SchemeName = CefSharpSchemeHandlerFactory.SchemeName,
SchemeHandlerFactory = new CefSharpSchemeHandlerFactory()
});
if (!Cef.Initialize(settings))
{
if (Environment.GetCommandLineArgs().Contains("--type=renderer"))
{
Environment.Exit(0);
}
else
{
return;
}
}
}
}
}
|
Add environment check to determine architecture
|
Add environment check to determine architecture
|
C#
|
bsd-3-clause
|
windygu/CefSharp,VioletLife/CefSharp,illfang/CefSharp,AJDev77/CefSharp,illfang/CefSharp,rover886/CefSharp,ruisebastiao/CefSharp,jamespearce2006/CefSharp,joshvera/CefSharp,haozhouxu/CefSharp,wangzheng888520/CefSharp,rover886/CefSharp,rlmcneary2/CefSharp,zhangjingpu/CefSharp,rlmcneary2/CefSharp,wangzheng888520/CefSharp,ITGlobal/CefSharp,Octopus-ITSM/CefSharp,Livit/CefSharp,rover886/CefSharp,zhangjingpu/CefSharp,dga711/CefSharp,VioletLife/CefSharp,Livit/CefSharp,ruisebastiao/CefSharp,Haraguroicha/CefSharp,Livit/CefSharp,NumbersInternational/CefSharp,gregmartinhtc/CefSharp,twxstar/CefSharp,battewr/CefSharp,jamespearce2006/CefSharp,Livit/CefSharp,twxstar/CefSharp,joshvera/CefSharp,illfang/CefSharp,gregmartinhtc/CefSharp,Haraguroicha/CefSharp,battewr/CefSharp,NumbersInternational/CefSharp,windygu/CefSharp,Octopus-ITSM/CefSharp,dga711/CefSharp,rlmcneary2/CefSharp,ITGlobal/CefSharp,dga711/CefSharp,Haraguroicha/CefSharp,VioletLife/CefSharp,zhangjingpu/CefSharp,wangzheng888520/CefSharp,gregmartinhtc/CefSharp,NumbersInternational/CefSharp,twxstar/CefSharp,haozhouxu/CefSharp,Octopus-ITSM/CefSharp,yoder/CefSharp,wangzheng888520/CefSharp,NumbersInternational/CefSharp,windygu/CefSharp,jamespearce2006/CefSharp,joshvera/CefSharp,illfang/CefSharp,rover886/CefSharp,yoder/CefSharp,Haraguroicha/CefSharp,joshvera/CefSharp,AJDev77/CefSharp,ruisebastiao/CefSharp,ruisebastiao/CefSharp,jamespearce2006/CefSharp,Haraguroicha/CefSharp,windygu/CefSharp,ITGlobal/CefSharp,zhangjingpu/CefSharp,yoder/CefSharp,Octopus-ITSM/CefSharp,rover886/CefSharp,gregmartinhtc/CefSharp,battewr/CefSharp,yoder/CefSharp,ITGlobal/CefSharp,battewr/CefSharp,rlmcneary2/CefSharp,AJDev77/CefSharp,haozhouxu/CefSharp,jamespearce2006/CefSharp,VioletLife/CefSharp,haozhouxu/CefSharp,twxstar/CefSharp,dga711/CefSharp,AJDev77/CefSharp
|
d45b438bb0ceb8e20d8bf5d2f8d505e37f70f6fd
|
Source/SharedAssemblyInfo.cs
|
Source/SharedAssemblyInfo.cs
|
using System.Reflection;
#if DEBUG
[assembly: AssemblyProduct("Ensure.That (Debug)")]
[assembly: AssemblyConfiguration("Debug")]
#else
[assembly: AssemblyProduct("Ensure.That (Release)")]
[assembly: AssemblyConfiguration("Release")]
#endif
[assembly: AssemblyDescription("Yet another guard clause project.")]
[assembly: AssemblyCompany("Daniel Wertheim")]
[assembly: AssemblyCopyright("Copyright © Daniel Wertheim")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("0.0.0.0")]
[assembly: AssemblyFileVersion("0.0.0.0")]
|
using System.Reflection;
#if DEBUG
[assembly: AssemblyProduct("Ensure.That (Debug)")]
[assembly: AssemblyConfiguration("Debug")]
#else
[assembly: AssemblyProduct("Ensure.That (Release)")]
[assembly: AssemblyConfiguration("Release")]
#endif
[assembly: AssemblyDescription("Yet another guard clause project.")]
[assembly: AssemblyCompany("Daniel Wertheim")]
[assembly: AssemblyCopyright("Copyright © Daniel Wertheim")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("0.10.1.*")]
[assembly: AssemblyFileVersion("0.10.1")]
|
Include version to get e.g ReSharper happy.
|
Include version to get e.g ReSharper happy.
|
C#
|
mit
|
danielwertheim/Ensure.That,danielwertheim/Ensure.That
|
0b9a9a5101d6c25abdce11b41bf3143a3928afda
|
UnitTests/ExtensionsFixture.cs
|
UnitTests/ExtensionsFixture.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
namespace Moq.Tests
{
public class ExtensionsFixture
{
[Fact]
public void IsMockeableReturnsFalseForValueType()
{
Assert.False(typeof(int).IsMockeable());
}
// [Fact]
// public void OnceDoesNotThrowOnSecondCallIfCountWasResetBefore()
// {
// var mock = new Mock<IFooReset>();
// mock.Setup(foo => foo.Execute("ping"))
// .Returns("ack")
// .AtMostOnce();
// Assert.Equal("ack", mock.Object.Execute("ping"));
// mock.ResetAllCalls();
// Assert.DoesNotThrow(() => mock.Object.Execute("ping"));
// }
}
public interface IFooReset
{
object Execute(string ping);
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
namespace Moq.Tests
{
public class ExtensionsFixture
{
#region Public Methods
[Fact]
public void IsMockeableReturnsFalseForValueType()
{
Assert.False(typeof(int).IsMockeable());
}
[Fact]
public void OnceDoesNotThrowOnSecondCallIfCountWasResetBefore()
{
var mock = new Mock<IFooReset>();
mock.Setup(foo => foo.Execute("ping")).Returns("ack");
mock.Object.Execute("ping");
mock.ResetAllCalls();
mock.Object.Execute("ping");
mock.Verify(o => o.Execute("ping"), Times.Once());
}
#endregion
}
public interface IFooReset
{
#region Public Methods
object Execute(string ping);
#endregion
}
}
|
Fix poorly written test (sorry).
|
Fix poorly written test (sorry).
- test was using obsolete methods, leading to a failed build in Release mode, because of the unit test was failing.
|
C#
|
bsd-3-clause
|
RobSiklos/moq4,kulkarnisachin07/moq4,LeonidLevin/moq4,iskiselev/moq4,AhmedAssaf/moq4,HelloKitty/moq4,Moq/moq4,ocoanet/moq4,chkpnt/moq4,jeremymeng/moq4,JohanLarsson/moq4,AhmedAssaf/moq4,ramanraghur/moq4,kolomanschaft/moq4,breyed/moq4,madcapsoftware/moq4,cgourlay/moq4
|
0899829e0d433cc71dc4c34e2c977ca361c27b02
|
src/Dotnet.Script.Core/ScriptDownloader.cs
|
src/Dotnet.Script.Core/ScriptDownloader.cs
|
using System;
using System.IO;
using System.IO.Compression;
using System.Net.Http;
using System.Threading.Tasks;
namespace Dotnet.Script.Core
{
public class ScriptDownloader
{
public async Task<string> Download(string uri)
{
using (HttpClient client = new HttpClient())
{
using (HttpResponseMessage response = await client.GetAsync(uri, HttpCompletionOption.ResponseHeadersRead))
{
response.EnsureSuccessStatusCode();
using (HttpContent content = response.Content)
{
var mediaType = content.Headers.ContentType.MediaType?.ToLowerInvariant().Trim();
switch (mediaType)
{
case null:
case "":
case "text/plain":
return await content.ReadAsStringAsync();
case "application/gzip":
case "application/x-gzip":
using (var stream = await content.ReadAsStreamAsync())
using (var gzip = new GZipStream(stream, CompressionMode.Decompress))
using (var reader = new StreamReader(gzip))
return await reader.ReadToEndAsync();
default:
throw new NotSupportedException($"The media type '{mediaType}' is not supported when executing a script over http/https");
}
}
}
}
}
}
}
|
using System;
using System.IO;
using System.IO.Compression;
using System.Net.Http;
using System.Threading.Tasks;
namespace Dotnet.Script.Core
{
public class ScriptDownloader
{
public async Task<string> Download(string uri)
{
using (HttpClient client = new HttpClient())
{
using (HttpResponseMessage response = await client.GetAsync(uri, HttpCompletionOption.ResponseHeadersRead))
{
response.EnsureSuccessStatusCode();
using (HttpContent content = response.Content)
{
var mediaType = content.Headers.ContentType?.MediaType?.ToLowerInvariant().Trim();
switch (mediaType)
{
case null:
case "":
case "text/plain":
return await content.ReadAsStringAsync();
case "application/gzip":
case "application/x-gzip":
using (var stream = await content.ReadAsStreamAsync())
using (var gzip = new GZipStream(stream, CompressionMode.Decompress))
using (var reader = new StreamReader(gzip))
return await reader.ReadToEndAsync();
default:
throw new NotSupportedException($"The media type '{mediaType}' is not supported when executing a script over http/https");
}
}
}
}
}
}
}
|
Support remote scripts with empty/null Content Type
|
Support remote scripts with empty/null Content Type
|
C#
|
mit
|
filipw/dotnet-script,filipw/dotnet-script
|
4dd90d1584a1b82fbecd6a7c0e4afbbca06a4e7c
|
src/Firehose.Web/Authors/MartijnVanDijk.cs
|
src/Firehose.Web/Authors/MartijnVanDijk.cs
|
using System;
using System.Collections.Generic;
using Firehose.Web.Infrastructure;
namespace Firehose.Web.Authors
{
public class MartijnVanDijk : IAmAMicrosoftMVP, IAmAXamarinMVP
{
public IEnumerable<Uri> FeedUris
{
get { yield return new Uri("https://medium.com/feed/@martijn00"); }
}
public string FirstName => "Martijn";
public string LastName => "Van Dijk";
public string StateOrRegion => "Amsterdam, Netherlands";
public string EmailAddress => "mhvdijk@gmail.com";
public string ShortBioOrTagLine => "";
public Uri WebSite => new Uri("https://medium.com/@martijn00");
public string TwitterHandle => "mhvdijk";
public string GravatarHash => "22155f520ab611cf04f76762556ca3f5";
public string GitHubHandle => string.Empty;
public GeoPosition Position => new GeoPosition(52.3702160, 4.8951680);
}
}
|
using System;
using System.Collections.Generic;
using Firehose.Web.Infrastructure;
namespace Firehose.Web.Authors
{
public class MartijnVanDijk : IAmAMicrosoftMVP, IAmAXamarinMVP
{
public IEnumerable<Uri> FeedUris
{
get { yield return new Uri("https://medium.com/feed/@martijn00"); }
}
public string FirstName => "Martijn";
public string LastName => "Van Dijk";
public string StateOrRegion => "Amsterdam, Netherlands";
public string EmailAddress => "mhvdijk@gmail.com";
public string ShortBioOrTagLine => "is a Xamarin and Microsoft MVP working with MvvmCross";
public Uri WebSite => new Uri("https://medium.com/@martijn00");
public string TwitterHandle => "mhvdijk";
public string GravatarHash => "22155f520ab611cf04f76762556ca3f5";
public string GitHubHandle => "martijn00";
public GeoPosition Position => new GeoPosition(52.3702160, 4.8951680);
}
}
|
Add bio and Github profile
|
Add bio and Github profile
|
C#
|
mit
|
planetxamarin/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin
|
9abec8ae101be7d50e3c33ca999a128a7d4cad98
|
src/MassTransit/Internals/Mapping/NullableValueObjectMapper.cs
|
src/MassTransit/Internals/Mapping/NullableValueObjectMapper.cs
|
// Copyright 2007-2015 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// 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 MassTransit.Internals.Mapping
{
using System;
using Reflection;
public class NullableValueObjectMapper<T, TValue> :
IObjectMapper<T>
where TValue : struct
{
readonly ReadWriteProperty<T> _property;
public NullableValueObjectMapper(ReadWriteProperty<T> property)
{
_property = property;
}
public void ApplyTo(T obj, IObjectValueProvider valueProvider)
{
object value;
if (valueProvider.TryGetValue(_property.Property.Name, out value))
{
TValue? nullableValue = value as TValue?;
if (!nullableValue.HasValue)
nullableValue = (TValue)Convert.ChangeType(value, typeof(TValue));
_property.Set(obj, nullableValue);
}
}
}
}
|
// Copyright 2007-2015 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// 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 MassTransit.Internals.Mapping
{
using System;
using System.ComponentModel;
using Reflection;
public class NullableValueObjectMapper<T, TValue> :
IObjectMapper<T>
where TValue : struct
{
readonly ReadWriteProperty<T> _property;
public NullableValueObjectMapper(ReadWriteProperty<T> property)
{
_property = property;
}
public void ApplyTo(T obj, IObjectValueProvider valueProvider)
{
object value;
if (valueProvider.TryGetValue(_property.Property.Name, out value))
{
TValue? nullableValue = null;
if (value != null)
{
var converter = TypeDescriptor.GetConverter(typeof(TValue));
nullableValue = converter.CanConvertFrom(value.GetType())
? (TValue)converter.ConvertFrom(value)
: default(TValue?);
}
_property.Set(obj, nullableValue);
}
}
}
}
|
Use a type converter to try and convert values
|
Use a type converter to try and convert values
|
C#
|
apache-2.0
|
jsmale/MassTransit
|
40feeac06b804af4571404cb4696333906abb568
|
osu.Framework/Platform/Linux/SDL2/SDL2Clipboard.cs
|
osu.Framework/Platform/Linux/SDL2/SDL2Clipboard.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 System.Runtime.InteropServices;
namespace osu.Framework.Platform.Linux.SDL2
{
public class SDL2Clipboard : Clipboard
{
private const string lib = "libSDL2.so";
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_free", ExactSpelling = true)]
internal static extern void SDL_free(IntPtr ptr);
/// <returns>Returns the clipboard text on success or <see cref="IntPtr.Zero"/> on failure. </returns>
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetClipboardText", ExactSpelling = true)]
internal static extern IntPtr SDL_GetClipboardText();
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetClipboardText", ExactSpelling = true)]
internal static extern int SDL_SetClipboardText(string text);
public override string GetText()
{
IntPtr ptrToText = SDL_GetClipboardText();
string text = Marshal.PtrToStringAnsi(ptrToText);
SDL_free(ptrToText);
return text;
}
public override void SetText(string selectedText)
{
SDL_SetClipboardText(selectedText);
}
}
}
|
// 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 SDL2;
namespace osu.Framework.Platform.Linux.SDL2
{
public class SDL2Clipboard : Clipboard
{
public override string GetText() => SDL.SDL_GetClipboardText();
public override void SetText(string selectedText) => SDL.SDL_SetClipboardText(selectedText);
}
}
|
Remove no longer required SDL2 P/Invokes in Linux clipboard
|
Remove no longer required SDL2 P/Invokes in Linux clipboard
|
C#
|
mit
|
ppy/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,peppy/osu-framework,peppy/osu-framework
|
fc0f01e957a169fd9b7b73c912cb73e3e0c74d13
|
src/IdentityServer3.Contrib.AzureKeyVaultTokenSigningService/AzureKeyVaultPublicKeyProvider.cs
|
src/IdentityServer3.Contrib.AzureKeyVaultTokenSigningService/AzureKeyVaultPublicKeyProvider.cs
|
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using IdentityServer.Contrib.JsonWebKeyAdapter;
using Microsoft.Azure.KeyVault;
using Microsoft.Extensions.OptionsModel;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using Microsoft.IdentityModel.Protocols;
namespace IdentityServer3.Contrib.AzureKeyVaultTokenSigningService
{
public class AzureKeyVaultPublicKeyProvider : IPublicKeyProvider
{
private readonly AzureKeyVaultTokenSigningServiceOptions _options;
private readonly AzureKeyVaultAuthentication _authentication;
private JsonWebKey _jwk;
/// <summary>
/// Initializes a new instance of the <see cref="AzureKeyVaultTokenSigningService"/> class.
/// </summary>
/// <param name="options">The options.</param>
public AzureKeyVaultPublicKeyProvider(IOptions<AzureKeyVaultTokenSigningServiceOptions> options)
{
_options = options.Value;
_authentication = new AzureKeyVaultAuthentication(_options.ClientId, _options.ClientSecret);
}
public async Task<IEnumerable<JsonWebKey>> GetAsync()
{
if (_jwk == null)
{
var keyVaultClient = new KeyVaultClient(_authentication.KeyVaultClientAuthenticationCallback);
var keyBundle = await keyVaultClient.GetKeyAsync(_options.KeyIdentifier).ConfigureAwait(false);
_jwk = new JsonWebKey(keyBundle.Key.ToString());
}
return new List<JsonWebKey> { _jwk };
}
}
}
|
using System.Collections.Generic;
using System.Threading.Tasks;
using IdentityServer.Contrib.JsonWebKeyAdapter;
using Microsoft.Azure.KeyVault;
using Microsoft.Extensions.OptionsModel;
using Microsoft.IdentityModel.Protocols;
namespace IdentityServer3.Contrib.AzureKeyVaultTokenSigningService
{
public class AzureKeyVaultPublicKeyProvider : IPublicKeyProvider
{
private readonly AzureKeyVaultTokenSigningServiceOptions _options;
private readonly AzureKeyVaultAuthentication _authentication;
private JsonWebKey _jwk;
/// <summary>
/// Initializes a new instance of the <see cref="AzureKeyVaultTokenSigningService"/> class.
/// </summary>
/// <param name="options">The options.</param>
public AzureKeyVaultPublicKeyProvider(IOptions<AzureKeyVaultTokenSigningServiceOptions> options)
{
_options = options.Value;
_authentication = new AzureKeyVaultAuthentication(_options.ClientId, _options.ClientSecret);
}
public async Task<IEnumerable<JsonWebKey>> GetAsync()
{
if (_jwk == null)
{
var keyVaultClient = new KeyVaultClient(_authentication.KeyVaultClientAuthenticationCallback);
var keyBundle = await keyVaultClient.GetKeyAsync(_options.KeyIdentifier).ConfigureAwait(false);
_jwk = new JsonWebKey(keyBundle.Key.ToString());
}
return new List<JsonWebKey> { _jwk };
}
}
}
|
Tidy up some unused usings
|
Tidy up some unused usings
|
C#
|
mit
|
MattCotterellNZ/IdentityServer3.Contrib.AzureKeyVaultTokenSigningService,MattCotterellNZ/IdentityServer.Contrib.AzureKeyVaultTokenSigningService
|
e38e06c3d9ae7c0b0cd03c34f92997dade01c5ff
|
src/Workspaces/Remote/Core/Storage/RemotePersistentStorageLocationService.cs
|
src/Workspaces/Remote/Core/Storage/RemotePersistentStorageLocationService.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.Generic;
using System.Composition;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Host;
namespace Microsoft.CodeAnalysis.Remote.Storage
{
[ExportWorkspaceService(typeof(IPersistentStorageLocationService)), Shared]
[Export(typeof(RemotePersistentStorageLocationService))]
internal class RemotePersistentStorageLocationService : IPersistentStorageLocationService
{
private static readonly object _gate = new object();
private static readonly Dictionary<SolutionId, string> _idToStorageLocation = new Dictionary<SolutionId, string>();
public string GetStorageLocation(Solution solution)
{
string result;
_idToStorageLocation.TryGetValue(solution.Id, out result);
return result;
}
public bool IsSupported(Workspace workspace)
{
lock (_gate)
{
return _idToStorageLocation.ContainsKey(workspace.CurrentSolution.Id);
}
}
public static void UpdateStorageLocation(SolutionId id, string storageLocation)
{
lock (_gate)
{
_idToStorageLocation[id] = storageLocation;
}
}
}
}
|
// 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.Generic;
using System.Composition;
using System.IO;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Host.Mef;
namespace Microsoft.CodeAnalysis.Remote.Storage
{
[ExportWorkspaceService(typeof(IPersistentStorageLocationService)), Shared]
[Export(typeof(RemotePersistentStorageLocationService))]
internal class RemotePersistentStorageLocationService : IPersistentStorageLocationService
{
private static readonly object _gate = new object();
private static readonly Dictionary<SolutionId, string> _idToStorageLocation = new Dictionary<SolutionId, string>();
public string GetStorageLocation(Solution solution)
{
string result;
_idToStorageLocation.TryGetValue(solution.Id, out result);
return result;
}
public bool IsSupported(Workspace workspace)
{
lock (_gate)
{
return _idToStorageLocation.ContainsKey(workspace.CurrentSolution.Id);
}
}
public static void UpdateStorageLocation(SolutionId id, string storageLocation)
{
lock (_gate)
{
// Store the esent database in a different location for the out of proc server.
_idToStorageLocation[id] = Path.Combine(storageLocation, "Server");
}
}
}
}
|
Store OOP server persistence database in a different file.
|
Store OOP server persistence database in a different file.
|
C#
|
mit
|
brettfo/roslyn,Giftednewt/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,a-ctor/roslyn,jasonmalinowski/roslyn,AnthonyDGreen/roslyn,mattscheffer/roslyn,tmeschter/roslyn,mmitche/roslyn,amcasey/roslyn,xoofx/roslyn,a-ctor/roslyn,CaptainHayashi/roslyn,tannergooding/roslyn,AnthonyDGreen/roslyn,agocke/roslyn,AnthonyDGreen/roslyn,khyperia/roslyn,zooba/roslyn,tmat/roslyn,vslsnap/roslyn,OmarTawfik/roslyn,diryboy/roslyn,gafter/roslyn,jcouv/roslyn,sharwell/roslyn,weltkante/roslyn,KevinH-MS/roslyn,dotnet/roslyn,TyOverby/roslyn,yeaicc/roslyn,KevinH-MS/roslyn,OmarTawfik/roslyn,jeffanders/roslyn,DustinCampbell/roslyn,dpoeschl/roslyn,robinsedlaczek/roslyn,Giftednewt/roslyn,TyOverby/roslyn,dpoeschl/roslyn,kelltrick/roslyn,kelltrick/roslyn,drognanar/roslyn,davkean/roslyn,panopticoncentral/roslyn,robinsedlaczek/roslyn,mattwar/roslyn,pdelvo/roslyn,CaptainHayashi/roslyn,OmarTawfik/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,tannergooding/roslyn,bkoelman/roslyn,sharwell/roslyn,heejaechang/roslyn,jasonmalinowski/roslyn,brettfo/roslyn,Pvlerick/roslyn,Hosch250/roslyn,drognanar/roslyn,DustinCampbell/roslyn,natidea/roslyn,AmadeusW/roslyn,amcasey/roslyn,jmarolf/roslyn,mmitche/roslyn,genlu/roslyn,zooba/roslyn,MichalStrehovsky/roslyn,pdelvo/roslyn,nguerrera/roslyn,cston/roslyn,srivatsn/roslyn,KevinRansom/roslyn,jamesqo/roslyn,KevinRansom/roslyn,abock/roslyn,Pvlerick/roslyn,heejaechang/roslyn,stephentoub/roslyn,AArnott/roslyn,KirillOsenkov/roslyn,shyamnamboodiripad/roslyn,akrisiun/roslyn,genlu/roslyn,VSadov/roslyn,bkoelman/roslyn,jcouv/roslyn,eriawan/roslyn,jmarolf/roslyn,vslsnap/roslyn,AlekseyTs/roslyn,mattscheffer/roslyn,diryboy/roslyn,stephentoub/roslyn,mattwar/roslyn,paulvanbrenk/roslyn,KirillOsenkov/roslyn,dpoeschl/roslyn,cston/roslyn,natidea/roslyn,robinsedlaczek/roslyn,nguerrera/roslyn,nguerrera/roslyn,reaction1989/roslyn,a-ctor/roslyn,AArnott/roslyn,weltkante/roslyn,ErikSchierboom/roslyn,cston/roslyn,paulvanbrenk/roslyn,aelij/roslyn,akrisiun/roslyn,khyperia/roslyn,pdelvo/roslyn,jeffanders/roslyn,dotnet/roslyn,orthoxerox/roslyn,MattWindsor91/roslyn,KirillOsenkov/roslyn,jkotas/roslyn,swaroop-sridhar/roslyn,genlu/roslyn,ErikSchierboom/roslyn,CyrusNajmabadi/roslyn,Hosch250/roslyn,yeaicc/roslyn,dotnet/roslyn,ErikSchierboom/roslyn,mgoertz-msft/roslyn,kelltrick/roslyn,shyamnamboodiripad/roslyn,bbarry/roslyn,AlekseyTs/roslyn,srivatsn/roslyn,reaction1989/roslyn,jkotas/roslyn,physhi/roslyn,xasx/roslyn,xasx/roslyn,orthoxerox/roslyn,bbarry/roslyn,agocke/roslyn,AmadeusW/roslyn,lorcanmooney/roslyn,mmitche/roslyn,xoofx/roslyn,abock/roslyn,AlekseyTs/roslyn,MichalStrehovsky/roslyn,Hosch250/roslyn,Pvlerick/roslyn,abock/roslyn,eriawan/roslyn,brettfo/roslyn,KevinRansom/roslyn,VSadov/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,jmarolf/roslyn,Giftednewt/roslyn,lorcanmooney/roslyn,MattWindsor91/roslyn,sharwell/roslyn,mgoertz-msft/roslyn,mavasani/roslyn,reaction1989/roslyn,mavasani/roslyn,aelij/roslyn,heejaechang/roslyn,tmeschter/roslyn,agocke/roslyn,weltkante/roslyn,zooba/roslyn,jamesqo/roslyn,swaroop-sridhar/roslyn,DustinCampbell/roslyn,srivatsn/roslyn,VSadov/roslyn,mattwar/roslyn,vslsnap/roslyn,bartdesmet/roslyn,diryboy/roslyn,shyamnamboodiripad/roslyn,natidea/roslyn,physhi/roslyn,orthoxerox/roslyn,CyrusNajmabadi/roslyn,MichalStrehovsky/roslyn,AmadeusW/roslyn,tvand7093/roslyn,bkoelman/roslyn,jeffanders/roslyn,lorcanmooney/roslyn,physhi/roslyn,wvdd007/roslyn,bbarry/roslyn,xoofx/roslyn,swaroop-sridhar/roslyn,akrisiun/roslyn,jkotas/roslyn,AArnott/roslyn,tmat/roslyn,jcouv/roslyn,tmeschter/roslyn,CaptainHayashi/roslyn,wvdd007/roslyn,stephentoub/roslyn,panopticoncentral/roslyn,davkean/roslyn,davkean/roslyn,yeaicc/roslyn,bartdesmet/roslyn,tvand7093/roslyn,amcasey/roslyn,mgoertz-msft/roslyn,bartdesmet/roslyn,eriawan/roslyn,tannergooding/roslyn,panopticoncentral/roslyn,jasonmalinowski/roslyn,MattWindsor91/roslyn,jamesqo/roslyn,tmat/roslyn,TyOverby/roslyn,wvdd007/roslyn,xasx/roslyn,mattscheffer/roslyn,mavasani/roslyn,drognanar/roslyn,gafter/roslyn,CyrusNajmabadi/roslyn,paulvanbrenk/roslyn,KevinH-MS/roslyn,aelij/roslyn,khyperia/roslyn,tvand7093/roslyn,MattWindsor91/roslyn,gafter/roslyn
|
137ecaef3ade46ef7fba5df70691e2c3e7df4399
|
SH.Site/Views/Partials/_Disqus.cshtml
|
SH.Site/Views/Partials/_Disqus.cshtml
|
@inherits UmbracoViewPage<IMaster>
<div id="disqus_thread"></div>
<script>
var disqus_config = function () {
this.page.url = '@Umbraco.NiceUrlWithDomain(Model.Id)';
this.page.identifier = '@Model.Id';
this.page.title = '@Model.SeoMetadata.Title';
};
(function () {
var d = document,
s = d.createElement('script');
s.src = '//stevenhar-land.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
}());
</script>
|
@inherits UmbracoViewPage<IPublishedContent>
<div id="disqus_thread"></div>
<script>
var disqus_config = function () {
this.page.url = '@Umbraco.NiceUrlWithDomain(Model.Id)';
this.page.identifier = '@Model.Id';
this.page.title = '@Model.Name';
};
(function () {
var d = document,
s = d.createElement('script');
s.src = '//stevenhar-land.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
}());
</script>
|
Update Disqus partial to use node name for the page title configuration variable
|
Update Disqus partial to use node name for the page title configuration variable
|
C#
|
mit
|
stvnhrlnd/SH,stvnhrlnd/SH,stvnhrlnd/SH
|
263d76421554042e5029d2e3b14b7fea473349ee
|
src/Microsoft.AspNetCore.WebSockets.Protocol/Properties/AssemblyInfo.cs
|
src/Microsoft.AspNetCore.WebSockets.Protocol/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Microsoft.Net.WebSockets")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[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("9a9e41ae-1494-4d87-a66f-a4019ff68ce5")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: NeutralResourcesLanguage("en-us")]
[assembly: AssemblyCompany("Microsoft Corporation.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft ASP.NET Core")]
|
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Microsoft.Net.WebSockets")]
[assembly: ComVisible(false)]
[assembly: Guid("9a9e41ae-1494-4d87-a66f-a4019ff68ce5")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: NeutralResourcesLanguage("en-us")]
[assembly: AssemblyCompany("Microsoft Corporation.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft ASP.NET Core")]
|
Fix assembly metadata to fix package verifier warnings
|
Fix assembly metadata to fix package verifier warnings
|
C#
|
apache-2.0
|
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
|
a06d6fb59c6c7e923b2e83dc32d1f1ff001f6eb2
|
TAUtil/Gaf/Structures/GafFrameData.cs
|
TAUtil/Gaf/Structures/GafFrameData.cs
|
namespace TAUtil.Gaf.Structures
{
using System.IO;
public struct GafFrameData
{
public ushort Width;
public ushort Height;
public ushort XPos;
public ushort YPos;
public char Unknown1;
public bool Compressed;
public ushort FramePointers;
public uint Unknown2;
public uint PtrFrameData;
public uint Unknown3;
public static void Read(Stream f, ref GafFrameData e)
{
BinaryReader b = new BinaryReader(f);
e.Width = b.ReadUInt16();
e.Height = b.ReadUInt16();
e.XPos = b.ReadUInt16();
e.YPos = b.ReadUInt16();
e.Unknown1 = b.ReadChar();
e.Compressed = b.ReadBoolean();
e.FramePointers = b.ReadUInt16();
e.Unknown2 = b.ReadUInt32();
e.PtrFrameData = b.ReadUInt32();
e.Unknown3 = b.ReadUInt32();
}
}
}
|
namespace TAUtil.Gaf.Structures
{
using System.IO;
public struct GafFrameData
{
public ushort Width;
public ushort Height;
public ushort XPos;
public ushort YPos;
public byte Unknown1;
public bool Compressed;
public ushort FramePointers;
public uint Unknown2;
public uint PtrFrameData;
public uint Unknown3;
public static void Read(Stream f, ref GafFrameData e)
{
BinaryReader b = new BinaryReader(f);
e.Width = b.ReadUInt16();
e.Height = b.ReadUInt16();
e.XPos = b.ReadUInt16();
e.YPos = b.ReadUInt16();
e.Unknown1 = b.ReadByte();
e.Compressed = b.ReadBoolean();
e.FramePointers = b.ReadUInt16();
e.Unknown2 = b.ReadUInt32();
e.PtrFrameData = b.ReadUInt32();
e.Unknown3 = b.ReadUInt32();
}
}
}
|
Change char to byte in gaf frame header
|
Change char to byte in gaf frame header
|
C#
|
mit
|
MHeasell/Mappy,MHeasell/Mappy
|
222f319651020382c26ad358af0d17882938e81a
|
Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
|
Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
|
using System.Collections.Generic;
using Promact.Trappist.DomainModel.Models.Question;
using System.Linq;
using Promact.Trappist.DomainModel.DbContext;
namespace Promact.Trappist.Repository.Questions
{
public class QuestionRepository : IQuestionRepository
{
private readonly TrappistDbContext _dbContext;
public QuestionRepository(TrappistDbContext dbContext)
{
_dbContext = dbContext;
}
/// <summary>
/// Get all questions
/// </summary>
/// <returns>Question list</returns>
public List<SingleMultipleAnswerQuestion> GetAllQuestions()
{
var questions = _dbContext.SingleMultipleAnswerQuestion.ToList();
return questions;
}
/// <summary>
/// Add single multiple answer question into SingleMultipleAnswerQuestion model
/// </summary>
/// <param name="singleMultipleAnswerQuestion"></param>
/// <param name="singleMultipleAnswerQuestionOption"></param>
public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption)
{
_dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion);
_dbContext.SingleMultipleAnswerQuestionOption.Add(singleMultipleAnswerQuestionOption);
_dbContext.SaveChanges();
}
}
}
|
using System.Collections.Generic;
using Promact.Trappist.DomainModel.Models.Question;
using System.Linq;
using Promact.Trappist.DomainModel.DbContext;
namespace Promact.Trappist.Repository.Questions
{
public class QuestionRepository : IQuestionRepository
{
private readonly TrappistDbContext _dbContext;
public QuestionRepository(TrappistDbContext dbContext)
{
_dbContext = dbContext;
}
/// <summary>
/// Get all questions
/// </summary>
/// <returns>Question list</returns>
public List<SingleMultipleAnswerQuestion> GetAllQuestions()
{
var questions = _dbContext.SingleMultipleAnswerQuestion.ToList();
return questions;
}
/// <summary>
/// Add single multiple answer question into SingleMultipleAnswerQuestion model
/// </summary>
/// <param name="singleMultipleAnswerQuestion"></param>
/// <param name="singleMultipleAnswerQuestionOption"></param>
public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption)
{
_dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion);
_dbContext.SingleMultipleAnswerQuestionOption.Add(singleMultipleAnswerQuestionOption);
_dbContext.SaveChanges();
}
}
}
|
Update server side API for single multiple answer question
|
Update server side API for single multiple answer question
|
C#
|
mit
|
Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist
|
4777b1bf4a588f2e46c25045ea323b57657f8803
|
Opserver/Views/SQL/Instance.Selector.cshtml
|
Opserver/Views/SQL/Instance.Selector.cshtml
|
@using StackExchange.Opserver.Data.SQL
@{
Layout = null;
var clusters = SQLModule.Clusters;
var standalone = SQLModule.StandaloneInstances;
}
@helper RenderInstances(IEnumerable<SQLInstance> instances)
{
foreach (var i in instances)
{
var props = i.ServerProperties.SafeData(true);
<a class="list-group-item" href="?node=@i.Name.UrlEncode()">
@i.IconSpan() @i.Name
<span class="badge" title="@props.FullVersion">@props.MajorVersion</span>
</a>
}
}
<h5 class="page-header">Please select a SQL instance.</h5>
<div class="row">
@foreach (var c in clusters)
{
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-heading">@c.Name</div>
<div class="panel-body small list-group">
@RenderInstances(c.Nodes)
</div>
</div>
</div>
}
@if (standalone.Any())
{
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-heading">Standalone</div>
<div class="panel-body small list-group">
@RenderInstances(standalone)
</div>
</div>
</div>
}
</div>
|
@using StackExchange.Opserver.Data.SQL
@{
Layout = null;
var clusters = SQLModule.Clusters;
var standalone = SQLModule.StandaloneInstances;
}
@helper RenderInstances(IEnumerable<SQLInstance> instances, bool showVersion)
{
foreach (var i in instances)
{
var props = i.ServerProperties.SafeData(true);
<a class="list-group-item" href="?node=@i.Name.UrlEncode()">
@i.IconSpan() @i.Name
<span class="badge" title="@props.FullVersion">
@props.MajorVersion
@if (showVersion)
{
<span class="small"> (@i.Version.ToString())</span>
}
</span>
</a>
}
}
@helper RenderList(IEnumerable<SQLInstance> instances, string title)
{
var versions = instances.Select(n => n.Version).Distinct().ToList();
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-heading">
@title
@if (versions.Count == 1)
{
<span class="small text-muted">(Version @versions[0].ToString())</span>
}
</div>
<div class="panel-body small list-group">
@RenderInstances(instances, versions.Count > 1)
</div>
</div>
</div>
}
<h5 class="page-header">Please select a SQL instance.</h5>
<div class="row">
@foreach (var c in clusters)
{
@RenderList(c.Nodes, c.Name)
}
@if (standalone.Any())
{
@RenderList(standalone, "Standalone")
}
</div>
|
Add version to SQL instance selector screen
|
Add version to SQL instance selector screen
This selector now doubles as a dashboard for checking versions across
your infrastructure.
|
C#
|
mit
|
GABeech/Opserver,GABeech/Opserver,opserver/Opserver,mqbk/Opserver,opserver/Opserver,manesiotise/Opserver,opserver/Opserver,manesiotise/Opserver,mqbk/Opserver,manesiotise/Opserver
|
8a2e86c7ecbe5269c816f7206f58322a367e9a39
|
src/NCrypt/NCrypt+NCryptCreatePersistedKeyFlags.cs
|
src/NCrypt/NCrypt+NCryptCreatePersistedKeyFlags.cs
|
// Copyright (c) to owners found in https://github.com/AArnott/pinvoke/blob/master/COPYRIGHT.md. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
namespace PInvoke
{
using System;
/// <content>
/// Contains the <see cref="NCryptCreatePersistedKeyFlags"/> nested type.
/// </content>
public static partial class NCrypt
{
/// <summary>
/// Flags that may be passed to the <see cref="NCryptCreatePersistedKey(SafeProviderHandle, out SafeKeyHandle, string, string, LegacyKeySpec, NCryptCreatePersistedKeyFlags)"/> method.
/// </summary>
[Flags]
public enum NCryptCreatePersistedKeyFlags
{
/// <summary>
/// No flags.
/// </summary>
None = 0x0,
/// <summary>
/// The key applies to the local computer. If this flag is not present, the key applies to the current user.
/// </summary>
NCRYPT_MACHINE_KEY_FLAG,
/// <summary>
/// If a key already exists in the container with the specified name, the existing key will be overwritten. If this flag is not specified and a key with the specified name already exists, this function will return <see cref="SECURITY_STATUS.NTE_EXISTS"/>.
/// </summary>
NCRYPT_OVERWRITE_KEY_FLAG,
}
}
}
|
// Copyright (c) to owners found in https://github.com/AArnott/pinvoke/blob/master/COPYRIGHT.md. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
namespace PInvoke
{
using System;
/// <content>
/// Contains the <see cref="NCryptCreatePersistedKeyFlags"/> nested type.
/// </content>
public static partial class NCrypt
{
/// <summary>
/// Flags that may be passed to the <see cref="NCryptCreatePersistedKey(SafeProviderHandle, out SafeKeyHandle, string, string, LegacyKeySpec, NCryptCreatePersistedKeyFlags)"/> method.
/// </summary>
[Flags]
public enum NCryptCreatePersistedKeyFlags
{
/// <summary>
/// No flags.
/// </summary>
None = 0x0,
/// <summary>
/// The key applies to the local computer. If this flag is not present, the key applies to the current user.
/// </summary>
NCRYPT_MACHINE_KEY_FLAG = 0x20,
/// <summary>
/// If a key already exists in the container with the specified name, the existing key will be overwritten. If this flag is not specified and a key with the specified name already exists, this function will return <see cref="SECURITY_STATUS.NTE_EXISTS"/>.
/// </summary>
NCRYPT_OVERWRITE_KEY_FLAG = 0x80,
}
}
}
|
Add values for a couple of enum values
|
Add values for a couple of enum values
|
C#
|
mit
|
fearthecowboy/pinvoke,jmelosegui/pinvoke,AArnott/pinvoke,vbfox/pinvoke
|
f511b00bd4a803265036079fe170d18a717709ad
|
MessageBird/Objects/Recipient.cs
|
MessageBird/Objects/Recipient.cs
|
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace MessageBird.Objects
{
public class Recipient
{
public enum RecipientStatus { Scheduled, Sent, Buffered, Delivered, DeliveryFailed };
[JsonProperty("recipient")]
public long Msisdn {get; set;}
[JsonProperty("status")]
[JsonConverter(typeof(StringEnumConverter))]
public RecipientStatus? Status {get; set;}
[JsonProperty("statusDatetime")]
public DateTime? StatusDatetime {get; set;}
public Recipient(long msisdn)
{
Msisdn = msisdn;
}
}
}
|
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Runtime.Serialization;
namespace MessageBird.Objects
{
public class Recipient
{
public enum RecipientStatus
{
// Message status
[EnumMember(Value = "scheduled")]
Scheduled,
[EnumMember(Value = "sent")]
Sent,
[EnumMember(Value = "buffered")]
Buffered,
[EnumMember(Value = "delivered")]
Delivered,
[EnumMember(Value = "delivery_failed")]
DeliveryFailed,
};
[JsonProperty("recipient")]
public long Msisdn {get; set;}
[JsonProperty("status")]
[JsonConverter(typeof(StringEnumConverter))]
public RecipientStatus? Status {get; set;}
[JsonProperty("statusDatetime")]
public DateTime? StatusDatetime {get; set;}
public Recipient(long msisdn)
{
Msisdn = msisdn;
}
}
}
|
Fix incorrect serialization of recipient status
|
Fix incorrect serialization of recipient status
|
C#
|
isc
|
messagebird/csharp-rest-api
|
e737a4deefe7f6a70144f991a6efe5850c7dee18
|
src/Run/Interop.cs
|
src/Run/Interop.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.IO;
namespace Microsoft.DotNet.Execute
{
internal class Interop
{
public static bool GetUnixVersion(out string result)
{
result = null;
const string OSReleaseFileName = @"/etc/os-release";
if (File.Exists(OSReleaseFileName))
{
string content = File.ReadAllText(OSReleaseFileName);
int idIndex = content.IndexOf("ID");
int versionIndex = content.IndexOf("VERSION_ID");
if (idIndex != -1 && versionIndex != -1)
{
string id = content.Substring(idIndex + 3, content.IndexOf(Environment.NewLine, idIndex + 3) - idIndex - 3);
string version = content.Substring(versionIndex + 12, content.IndexOf('"', versionIndex + 12) - versionIndex - 12);
result = $"{id}.{version}";
}
}
return result != null;
}
}
}
|
// 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.IO;
namespace Microsoft.DotNet.Execute
{
internal class Interop
{
public static bool GetUnixVersion(out string result)
{
const string OSId = "ID=";
const string OSVersionId = "VERSION_ID=";
result = null;
const string OSReleaseFileName = @"/etc/os-release";
if (File.Exists(OSReleaseFileName))
{
string[] content = File.ReadAllLines(OSReleaseFileName);
string id = null, version = null;
foreach (string line in content)
{
if (line.StartsWith(OSId))
{
id = line.Substring(OSId.Length, line.Length - OSId.Length);
}
else if (line.StartsWith(OSVersionId))
{
int startOfVersion = line.IndexOf('"', OSVersionId.Length) + 1;
int endOfVersion = startOfVersion == 0 ? line.Length : line.IndexOf('"', startOfVersion);
if (startOfVersion == 0)
startOfVersion = OSVersionId.Length;
version = line.Substring(startOfVersion, endOfVersion - startOfVersion);
}
// Skip parsing rest of the file contents.
if (id != null && version != null)
break;
}
result = $"{id}.{version}";
}
return result != null;
}
}
}
|
Improve parsing /etc/os-release, handle more cases.
|
Improve parsing /etc/os-release, handle more cases.
|
C#
|
mit
|
joperezr/buildtools,alexperovich/buildtools,ericstj/buildtools,ChadNedzlek/buildtools,JeremyKuhne/buildtools,tarekgh/buildtools,karajas/buildtools,crummel/dotnet_buildtools,mmitche/buildtools,nguerrera/buildtools,weshaggard/buildtools,ianhays/buildtools,ChadNedzlek/buildtools,MattGal/buildtools,ericstj/buildtools,dotnet/buildtools,jhendrixMSFT/buildtools,jthelin/dotnet-buildtools,nguerrera/buildtools,crummel/dotnet_buildtools,naamunds/buildtools,ChadNedzlek/buildtools,weshaggard/buildtools,jhendrixMSFT/buildtools,AlexGhiondea/buildtools,weshaggard/buildtools,nguerrera/buildtools,weshaggard/buildtools,JeremyKuhne/buildtools,stephentoub/buildtools,MattGal/buildtools,ChadNedzlek/buildtools,ianhays/buildtools,naamunds/buildtools,alexperovich/buildtools,stephentoub/buildtools,tarekgh/buildtools,jthelin/dotnet-buildtools,stephentoub/buildtools,chcosta/buildtools,karajas/buildtools,tarekgh/buildtools,naamunds/buildtools,MattGal/buildtools,joperezr/buildtools,karajas/buildtools,naamunds/buildtools,crummel/dotnet_buildtools,dotnet/buildtools,AlexGhiondea/buildtools,ericstj/buildtools,stephentoub/buildtools,jthelin/dotnet-buildtools,roncain/buildtools,AlexGhiondea/buildtools,JeremyKuhne/buildtools,AlexGhiondea/buildtools,jthelin/dotnet-buildtools,tarekgh/buildtools,mmitche/buildtools,mmitche/buildtools,joperezr/buildtools,jhendrixMSFT/buildtools,alexperovich/buildtools,roncain/buildtools,JeremyKuhne/buildtools,dotnet/buildtools,alexperovich/buildtools,chcosta/buildtools,joperezr/buildtools,MattGal/buildtools,mmitche/buildtools,crummel/dotnet_buildtools,mmitche/buildtools,karajas/buildtools,jhendrixMSFT/buildtools,roncain/buildtools,dotnet/buildtools,joperezr/buildtools,ianhays/buildtools,ianhays/buildtools,alexperovich/buildtools,chcosta/buildtools,ericstj/buildtools,roncain/buildtools,MattGal/buildtools,nguerrera/buildtools,tarekgh/buildtools,chcosta/buildtools
|
0c3682c5222a7f5fbd471b653928d6ee8eb402d2
|
src/VisualStudio/IntegrationTest/TestUtilities/Common/ProjectUtilities.cs
|
src/VisualStudio/IntegrationTest/TestUtilities/Common/ProjectUtilities.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.
namespace Microsoft.VisualStudio.IntegrationTest.Utilities.Common.ProjectUtils
{
public abstract class Identity
{
public string Name { get; protected set; }
}
public class Project : Identity
{
public Project(string name, string relativePath = null)
{
Name = name;
RelativePath = relativePath;
}
public string RelativePath { get; }
}
public class ProjectReference : Identity
{
public ProjectReference(string name)
{
Name = name;
}
}
public class AssemblyReference : Identity
{
public AssemblyReference(string name)
{
Name = name;
}
}
public class PackageReference : Identity
{
public string Version { get; }
public PackageReference(string name, string version)
{
Name = name;
Version = version;
}
}
}
|
// 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.IO;
namespace Microsoft.VisualStudio.IntegrationTest.Utilities.Common.ProjectUtils
{
public abstract class Identity
{
public string Name { get; protected set; }
}
public class Project : Identity
{
public Project(string name, string projectExtension = ".csproj", string relativePath = null)
{
Name = name;
if (string.IsNullOrWhiteSpace(relativePath))
{
RelativePath = Path.Combine(name, name + projectExtension);
}
else
{
RelativePath = relativePath;
}
}
/// <summary>
/// This path is relative to the Solution file. Default value is set to ProjectName\ProjectName.csproj
/// </summary>
public string RelativePath { get; }
}
public class ProjectReference : Identity
{
public ProjectReference(string name)
{
Name = name;
}
}
public class AssemblyReference : Identity
{
public AssemblyReference(string name)
{
Name = name;
}
}
public class PackageReference : Identity
{
public string Version { get; }
public PackageReference(string name, string version)
{
Name = name;
Version = version;
}
}
}
|
Set default relative path for Project Identity in Integration tests
|
Set default relative path for Project Identity in Integration tests
|
C#
|
apache-2.0
|
aelij/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,jcouv/roslyn,cston/roslyn,eriawan/roslyn,CaptainHayashi/roslyn,tmeschter/roslyn,dotnet/roslyn,tmat/roslyn,reaction1989/roslyn,agocke/roslyn,mavasani/roslyn,aelij/roslyn,MichalStrehovsky/roslyn,dpoeschl/roslyn,KevinRansom/roslyn,mmitche/roslyn,orthoxerox/roslyn,lorcanmooney/roslyn,agocke/roslyn,gafter/roslyn,nguerrera/roslyn,shyamnamboodiripad/roslyn,tannergooding/roslyn,swaroop-sridhar/roslyn,OmarTawfik/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,jcouv/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,brettfo/roslyn,davkean/roslyn,AnthonyDGreen/roslyn,TyOverby/roslyn,nguerrera/roslyn,sharwell/roslyn,orthoxerox/roslyn,jamesqo/roslyn,panopticoncentral/roslyn,bkoelman/roslyn,bkoelman/roslyn,jamesqo/roslyn,jcouv/roslyn,aelij/roslyn,stephentoub/roslyn,AnthonyDGreen/roslyn,mgoertz-msft/roslyn,Giftednewt/roslyn,tvand7093/roslyn,cston/roslyn,Hosch250/roslyn,DustinCampbell/roslyn,wvdd007/roslyn,AmadeusW/roslyn,mavasani/roslyn,gafter/roslyn,abock/roslyn,genlu/roslyn,jmarolf/roslyn,ErikSchierboom/roslyn,KevinRansom/roslyn,KirillOsenkov/roslyn,abock/roslyn,wvdd007/roslyn,khyperia/roslyn,mattscheffer/roslyn,eriawan/roslyn,CyrusNajmabadi/roslyn,Hosch250/roslyn,ErikSchierboom/roslyn,panopticoncentral/roslyn,CyrusNajmabadi/roslyn,MattWindsor91/roslyn,orthoxerox/roslyn,tannergooding/roslyn,KevinRansom/roslyn,tmeschter/roslyn,kelltrick/roslyn,abock/roslyn,MichalStrehovsky/roslyn,MattWindsor91/roslyn,MichalStrehovsky/roslyn,jmarolf/roslyn,mmitche/roslyn,sharwell/roslyn,reaction1989/roslyn,AlekseyTs/roslyn,CyrusNajmabadi/roslyn,mgoertz-msft/roslyn,AnthonyDGreen/roslyn,bkoelman/roslyn,pdelvo/roslyn,wvdd007/roslyn,gafter/roslyn,weltkante/roslyn,Giftednewt/roslyn,srivatsn/roslyn,bartdesmet/roslyn,MattWindsor91/roslyn,heejaechang/roslyn,genlu/roslyn,jasonmalinowski/roslyn,lorcanmooney/roslyn,reaction1989/roslyn,mattscheffer/roslyn,eriawan/roslyn,TyOverby/roslyn,OmarTawfik/roslyn,MattWindsor91/roslyn,swaroop-sridhar/roslyn,mavasani/roslyn,dpoeschl/roslyn,diryboy/roslyn,physhi/roslyn,tmat/roslyn,xasx/roslyn,VSadov/roslyn,lorcanmooney/roslyn,tvand7093/roslyn,tmeschter/roslyn,tannergooding/roslyn,brettfo/roslyn,KirillOsenkov/roslyn,jamesqo/roslyn,khyperia/roslyn,CaptainHayashi/roslyn,DustinCampbell/roslyn,pdelvo/roslyn,jkotas/roslyn,paulvanbrenk/roslyn,dotnet/roslyn,shyamnamboodiripad/roslyn,AlekseyTs/roslyn,srivatsn/roslyn,cston/roslyn,stephentoub/roslyn,CaptainHayashi/roslyn,davkean/roslyn,OmarTawfik/roslyn,mattscheffer/roslyn,sharwell/roslyn,Giftednewt/roslyn,xasx/roslyn,genlu/roslyn,tvand7093/roslyn,weltkante/roslyn,AmadeusW/roslyn,tmat/roslyn,mmitche/roslyn,jasonmalinowski/roslyn,DustinCampbell/roslyn,jkotas/roslyn,VSadov/roslyn,AlekseyTs/roslyn,VSadov/roslyn,jkotas/roslyn,khyperia/roslyn,jasonmalinowski/roslyn,jmarolf/roslyn,dotnet/roslyn,dpoeschl/roslyn,mgoertz-msft/roslyn,kelltrick/roslyn,diryboy/roslyn,AmadeusW/roslyn,paulvanbrenk/roslyn,pdelvo/roslyn,ErikSchierboom/roslyn,robinsedlaczek/roslyn,paulvanbrenk/roslyn,shyamnamboodiripad/roslyn,robinsedlaczek/roslyn,kelltrick/roslyn,nguerrera/roslyn,physhi/roslyn,brettfo/roslyn,davkean/roslyn,swaroop-sridhar/roslyn,TyOverby/roslyn,srivatsn/roslyn,bartdesmet/roslyn,heejaechang/roslyn,heejaechang/roslyn,xasx/roslyn,robinsedlaczek/roslyn,agocke/roslyn,panopticoncentral/roslyn,physhi/roslyn,diryboy/roslyn,KirillOsenkov/roslyn,stephentoub/roslyn,bartdesmet/roslyn,weltkante/roslyn,Hosch250/roslyn
|
7d7a3bab0e86251710f0825c602719805f742f9b
|
osu.Game.Rulesets.Catch/Replays/CatchReplayFrame.cs
|
osu.Game.Rulesets.Catch/Replays/CatchReplayFrame.cs
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Replays;
using osu.Game.Rulesets.Replays.Legacy;
using osu.Game.Rulesets.Replays.Types;
namespace osu.Game.Rulesets.Catch.Replays
{
public class CatchReplayFrame : ReplayFrame, IConvertibleReplayFrame
{
public float Position;
public bool Dashing;
public CatchReplayFrame()
{
}
public CatchReplayFrame(double time, float? position = null, bool dashing = false)
: base(time)
{
Position = position ?? -1;
Dashing = dashing;
}
public void ConvertFrom(LegacyReplayFrame legacyFrame, Beatmap beatmap)
{
// Todo: This needs to be re-scaled
Position = legacyFrame.Position.X;
Dashing = legacyFrame.ButtonState == ReplayButtonState.Left1;
}
}
}
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Catch.UI;
using osu.Game.Rulesets.Replays;
using osu.Game.Rulesets.Replays.Legacy;
using osu.Game.Rulesets.Replays.Types;
namespace osu.Game.Rulesets.Catch.Replays
{
public class CatchReplayFrame : ReplayFrame, IConvertibleReplayFrame
{
public float Position;
public bool Dashing;
public CatchReplayFrame()
{
}
public CatchReplayFrame(double time, float? position = null, bool dashing = false)
: base(time)
{
Position = position ?? -1;
Dashing = dashing;
}
public void ConvertFrom(LegacyReplayFrame legacyFrame, Beatmap beatmap)
{
Position = legacyFrame.Position.X / CatchPlayfield.BASE_WIDTH;
Dashing = legacyFrame.ButtonState == ReplayButtonState.Left1;
}
}
}
|
Fix catch legacy replay positions not being relative to playfield size
|
Fix catch legacy replay positions not being relative to playfield size
|
C#
|
mit
|
johnneijzen/osu,smoogipooo/osu,UselessToucan/osu,Frontear/osuKyzer,peppy/osu,DrabWeb/osu,EVAST9919/osu,ppy/osu,UselessToucan/osu,naoey/osu,smoogipoo/osu,smoogipoo/osu,johnneijzen/osu,peppy/osu,2yangk23/osu,DrabWeb/osu,naoey/osu,peppy/osu,EVAST9919/osu,ppy/osu,ZLima12/osu,NeoAdonis/osu,NeoAdonis/osu,smoogipoo/osu,UselessToucan/osu,ZLima12/osu,NeoAdonis/osu,Nabile-Rahmani/osu,ppy/osu,naoey/osu,peppy/osu-new,2yangk23/osu,DrabWeb/osu
|
008efa081659d98d41da29b2a5304a60bc216d9a
|
Searching/ISearchService.cs
|
Searching/ISearchService.cs
|
#region
using System.Net;
using Tabster.Core.Data.Processing;
using Tabster.Core.Types;
#endregion
namespace Tabster.Core.Searching
{
/// <summary>
/// Tab service which enables searching.
/// </summary>
public interface ISearchService
{
/// <summary>
/// Service name.
/// </summary>
string Name { get; }
/// <summary>
/// Associated parser.
/// </summary>
ITablatureWebpageImporter Parser { get; }
/// <summary>
/// Service flags.
/// </summary>
SearchServiceFlags Flags { get; }
/// <summary>
/// Proxy settings.
/// </summary>
WebProxy Proxy { get; }
/// <summary>
/// Determines whether the service supports ratings.
/// </summary>
bool SupportsRatings { get; }
/// <summary>
/// Queries service and returns results based on search parameters.
/// </summary>
/// <param name="query"> Search query. </param>
SearchResult[] Search(SearchQuery query);
///<summary>
/// Determines whether a specific TabType is supported by the service.
///</summary>
///<param name="type"> The type to check. </param>
///<returns> True if the type is supported by the service; otherwise, False. </returns>
bool SupportsTabType(TabType type);
}
}
|
#region
using System.Net;
using Tabster.Core.Data.Processing;
using Tabster.Core.Types;
#endregion
namespace Tabster.Core.Searching
{
/// <summary>
/// Tab service which enables searching.
/// </summary>
public interface ISearchService
{
/// <summary>
/// Service name.
/// </summary>
string Name { get; }
/// <summary>
/// Associated parser.
/// </summary>
ITablatureWebpageImporter Parser { get; }
/// <summary>
/// Service flags.
/// </summary>
SearchServiceFlags Flags { get; }
/// <summary>
/// Proxy settings.
/// </summary>
WebProxy Proxy { get; set; }
/// <summary>
/// Determines whether the service supports ratings.
/// </summary>
bool SupportsRatings { get; }
/// <summary>
/// Queries service and returns results based on search parameters.
/// </summary>
/// <param name="query"> Search query. </param>
SearchResult[] Search(SearchQuery query);
///<summary>
/// Determines whether a specific TabType is supported by the service.
///</summary>
///<param name="type"> The type to check. </param>
///<returns> True if the type is supported by the service; otherwise, False. </returns>
bool SupportsTabType(TabType type);
}
}
|
Add setter to Proxy property.
|
Add setter to Proxy property.
|
C#
|
apache-2.0
|
GetTabster/Tabster.Core
|
2467322501a2f7f03d98510f8ba7d83095cc1ebf
|
BTDB/Properties/AssemblyInfo.cs
|
BTDB/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("BTDB")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BTDB")]
[assembly: AssemblyCopyright("Copyright Boris Letocha 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM componenets. 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("d949b20a-70ec-46bf-8eed-3a3cfb0d4593")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
[assembly: AssemblyVersion("2.13.0.0")]
[assembly: AssemblyFileVersion("2.13.0.0")]
[assembly: InternalsVisibleTo("BTDBTest")]
|
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("BTDB")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BTDB")]
[assembly: AssemblyCopyright("Copyright Boris Letocha 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM componenets. 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("d949b20a-70ec-46bf-8eed-3a3cfb0d4593")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: InternalsVisibleTo("BTDBTest")]
|
Bump it even more to follow semver
|
Bump it even more to follow semver
|
C#
|
mit
|
karasek/BTDB,klesta490/BTDB,Bobris/BTDB
|
a51b3e2b5ae0e0f9c30847a12ed84c002a310dd6
|
OData/src/CommonAssemblyInfo.cs
|
OData/src/CommonAssemblyInfo.cs
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
#if !BUILD_GENERATED_VERSION
[assembly: AssemblyCompany("Microsoft Corporation.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
#endif
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
#if !NOT_CLS_COMPLIANT
[assembly: CLSCompliant(true)]
#endif
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyMetadata("Serviceable", "True")]
// ===========================================================================
// DO NOT EDIT OR REMOVE ANYTHING BELOW THIS COMMENT.
// Version numbers are automatically generated based on regular expressions.
// ===========================================================================
#if ASPNETODATA
#if !BUILD_GENERATED_VERSION
[assembly: AssemblyVersion("5.5.0.0")] // ASPNETODATA
[assembly: AssemblyFileVersion("5.5.0.0")] // ASPNETODATA
#endif
[assembly: AssemblyProduct("Microsoft OData Web API")]
#endif
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
#if !BUILD_GENERATED_VERSION
[assembly: AssemblyCompany("Microsoft Corporation.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
#endif
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
#if !NOT_CLS_COMPLIANT
[assembly: CLSCompliant(true)]
#endif
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyMetadata("Serviceable", "True")]
// ===========================================================================
// DO NOT EDIT OR REMOVE ANYTHING BELOW THIS COMMENT.
// Version numbers are automatically generated based on regular expressions.
// ===========================================================================
#if ASPNETODATA
#if !BUILD_GENERATED_VERSION
[assembly: AssemblyVersion("5.5.1.0")] // ASPNETODATA
[assembly: AssemblyFileVersion("5.5.1.0")] // ASPNETODATA
#endif
[assembly: AssemblyProduct("Microsoft OData Web API")]
#endif
|
Upgrade version from 5.5.0 to 5.5.1
|
Upgrade version from 5.5.0 to 5.5.1
|
C#
|
mit
|
lungisam/WebApi,chimpinano/WebApi,scz2011/WebApi,yonglehou/WebApi,lungisam/WebApi,lewischeng-ms/WebApi,chimpinano/WebApi,LianwMS/WebApi,scz2011/WebApi,yonglehou/WebApi,lewischeng-ms/WebApi,congysu/WebApi,congysu/WebApi,abkmr/WebApi,abkmr/WebApi,LianwMS/WebApi
|
c12f88a48c2a0a861e0646f8b663fe152989abbc
|
XtabFileOpener/TableContainer/SpreadsheetTableContainer/ExcelTableContainer/ExcelTable.cs
|
XtabFileOpener/TableContainer/SpreadsheetTableContainer/ExcelTableContainer/ExcelTable.cs
|
using System;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Office.Interop.Excel;
namespace XtabFileOpener.TableContainer.SpreadsheetTableContainer.ExcelTableContainer
{
/// <summary>
/// Implementation of Table, that manages an Excel table
/// </summary>
internal class ExcelTable : Table
{
internal ExcelTable(string name, Range cells) : base(name)
{
/*
* "The only difference between this property and the Value property is that the Value2 property
* doesn’t use the Currency and Date data types. You can return values formatted with these
* data types as floating-point numbers by using the Double data type."
* */
tableArray = cells.Value;
firstRowContainsColumnNames = true;
}
}
}
|
using System;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Office.Interop.Excel;
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("XtabFileOpenerTest")]
namespace XtabFileOpener.TableContainer.SpreadsheetTableContainer.ExcelTableContainer
{
/// <summary>
/// Implementation of Table, that manages an Excel table.
/// Cells that are date formatted in Excel will be converted to ISO strings.
/// </summary>
internal class ExcelTable : Table
{
internal ExcelTable(string name, Range cells) : base(name)
{
tableArray = cells.Value;
firstRowContainsColumnNames = true;
ConvertDateTimesToIsoFormat();
}
private void ConvertDateTimesToIsoFormat()
{
string iso_time_format = "{0:yyyy-MM-dd HH:mm:ss}";
string iso_time_format_with_miliseconds = "{0:yyyy-MM-dd HH:mm:ss.ffffff}00";
for (int i = tableArray.GetLowerBound(0); i <= tableArray.GetUpperBound(0); i++)
{
for (int j = tableArray.GetLowerBound(1); j <= tableArray.GetUpperBound(1); j++)
{
object cell = tableArray[i, j];
if (cell is DateTime && cell != null)
{
DateTime dt = (DateTime) cell;
string format = (dt.Millisecond > 0) ? iso_time_format_with_miliseconds : iso_time_format;
tableArray[i, j] = String.Format(format, dt);
}
}
}
}
}
}
|
Convert DateTime objects to ISO format that is understood by DBUnit. DateTime objects are returned by Excel if cell is formatted for date display.
|
Convert DateTime objects to ISO format that is understood by DBUnit. DateTime objects are returned by Excel if cell is formatted for date display.
|
C#
|
apache-2.0
|
TNG/xtab-opener
|
5273595dc6f9ee28eb20b4c6b8bd51dcc88d05f0
|
Properties/AssemblyInfo.cs
|
Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Autofac.Extras.NHibernate")]
[assembly: AssemblyDescription("Autofac Integration for NHibernate")]
[assembly: ComVisible(false)]
|
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Autofac.Extras.NHibernate")]
[assembly: ComVisible(false)]
|
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major.
|
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major.
|
C#
|
mit
|
autofac/Autofac.Extras.NHibernate
|
3a31cd95015bc147b57e956e80a8b3537757f752
|
Example1/Program.cs
|
Example1/Program.cs
|
using System;
using System.Threading;
namespace Example1
{
public class Program
{
public static void Main (string [] args)
{
using (var streamer = new AudioStreamer ("ws://agektmr.node-ninja.com:3000/socket"))
//using (var streamer = new AudioStreamer ("ws://localhost:3000/socket"))
{
string name;
do {
Console.Write ("Input your name> ");
name = Console.ReadLine ();
}
while (name.Length == 0);
streamer.Connect (name);
Console.WriteLine ("\nType \"exit\" to exit.\n");
while (true) {
Thread.Sleep (1000);
Console.Write ("> ");
var msg = Console.ReadLine ();
if (msg == "exit")
break;
streamer.Write (msg);
}
}
}
}
}
|
using System;
using System.Threading;
namespace Example1
{
public class Program
{
public static void Main (string [] args)
{
using (var streamer = new AudioStreamer ("ws://agektmr.node-ninja.com:3000/socket"))
//using (var streamer = new AudioStreamer ("ws://localhost:3000/socket"))
{
string name;
do {
Console.Write ("Input your name> ");
name = Console.ReadLine ();
}
while (name.Length == 0);
streamer.Connect (name);
Console.WriteLine ("\nType 'exit' to exit.\n");
while (true) {
Thread.Sleep (1000);
Console.Write ("> ");
var msg = Console.ReadLine ();
if (msg == "exit")
break;
streamer.Write (msg);
}
}
}
}
}
|
Fix a few for Example1
|
Fix a few for Example1
|
C#
|
mit
|
TabbedOut/websocket-sharp,pjc0247/websocket-sharp-unity,Liryna/websocket-sharp,microdee/websocket-sharp,zq513705971/WebSocketApp,prepare/websocket-sharp,zq513705971/WebSocketApp,jogibear9988/websocket-sharp,zhangwei900808/websocket-sharp,2Toad/websocket-sharp,zq513705971/WebSocketApp,sta/websocket-sharp,sinha-abhishek/websocket-sharp,pjc0247/websocket-sharp-unity,Liryna/websocket-sharp,TabbedOut/websocket-sharp,pjc0247/websocket-sharp-unity,microdee/websocket-sharp,hybrid1969/websocket-sharp,2Toad/websocket-sharp,TabbedOut/websocket-sharp,sinha-abhishek/websocket-sharp,prepare/websocket-sharp,pjc0247/websocket-sharp-unity,sta/websocket-sharp,zq513705971/WebSocketApp,hybrid1969/websocket-sharp,sta/websocket-sharp,jjrdk/websocket-sharp,jogibear9988/websocket-sharp,Liryna/websocket-sharp,alberist/websocket-sharp,prepare/websocket-sharp,microdee/websocket-sharp,juoni/websocket-sharp,juoni/websocket-sharp,jogibear9988/websocket-sharp,jmptrader/websocket-sharp,jogibear9988/websocket-sharp,prepare/websocket-sharp,jmptrader/websocket-sharp,jmptrader/websocket-sharp,microdee/websocket-sharp,juoni/websocket-sharp,jjrdk/websocket-sharp,hybrid1969/websocket-sharp,sinha-abhishek/websocket-sharp,hybrid1969/websocket-sharp,sinha-abhishek/websocket-sharp,2Toad/websocket-sharp,2Toad/websocket-sharp,TabbedOut/websocket-sharp,jmptrader/websocket-sharp,juoni/websocket-sharp,alberist/websocket-sharp,zhangwei900808/websocket-sharp,alberist/websocket-sharp,alberist/websocket-sharp,zhangwei900808/websocket-sharp,sta/websocket-sharp,zhangwei900808/websocket-sharp
|
d0016b4e1afcb3ab1df011ca4b63b3388cb7e680
|
Src/GoogleApis.Tools.CodeGen.Tests/Decorator/ServiceDecorator/NewtonsoftObjectToJsonTest.cs
|
Src/GoogleApis.Tools.CodeGen.Tests/Decorator/ServiceDecorator/NewtonsoftObjectToJsonTest.cs
|
using System;
using NUnit.Framework;
namespace Google.Apis.Tools.CodeGen.Tests
{
[TestFixture()]
public class NewtonsoftObjectToJsonTest
{
[Test()]
public void TestCase ()
{
Assert.Fail("Not tested yet");
}
}
}
|
/*
Copyright 2010 Google Inc
Licensed under the Apache License, Version 2.0 (the ""License"");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an ""AS IS"" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
using System;
using NUnit.Framework;
namespace Google.Apis.Tools.CodeGen.Tests.Decorator.ServiceDecorator
{
[TestFixture()]
public class NewtonsoftObjectToJsonTest
{
[Test()]
public void TestCase ()
{
Assert.Fail("Not tested yet");
}
}
}
|
Correct the namespace and add copyright message.
|
Correct the namespace and add copyright message.
|
C#
|
apache-2.0
|
googleapis/google-api-dotnet-client,maha-khedr/google-api-dotnet-client,sqt-android/google-api-dotnet-client,eydjey/google-api-dotnet-client,liuqiaosz/google-api-dotnet-client,amit-learning/google-api-dotnet-client,joesoc/google-api-dotnet-client,shumaojie/google-api-dotnet-client,eshangin/google-api-dotnet-client,ajmal744/google-api-dotnet-client,milkmeat/google-api-dotnet-client,kelvinRosa/google-api-dotnet-client,amitla/google-api-dotnet-client,ErAmySharma/google-api-dotnet-client,googleapis/google-api-dotnet-client,ivannaranjo/google-api-dotnet-client,aoisensi/google-api-dotnet-client,jtattermusch/google-api-dotnet-client,line21c/google-api-dotnet-client,RavindraPatidar/google-api-dotnet-client,kapil-chauhan-ngi/google-api-dotnet-client,mjacobsen4DFM/google-api-dotnet-client,pgallastegui/google-api-dotnet-client,jskeet/google-api-dotnet-client,hivie7510/google-api-dotnet-client,peleyal/google-api-dotnet-client,duckhamqng/google-api-dotnet-client,duongnhyt/google-api-dotnet-client,chrisdunelm/google-api-dotnet-client,kekewong/google-api-dotnet-client,hurcane/google-api-dotnet-client,SimonAntony/google-api-dotnet-client,hoangduit/google-api-dotnet-client,Duikmeester/google-api-dotnet-client,chrisdunelm/google-api-dotnet-client,ssett/google-api-dotnet-client,hurcane/google-api-dotnet-client,karishmal/google-api-dotnet-client,amnsinghl/google-api-dotnet-client,jskeet/google-api-dotnet-client,ajaypradeep/google-api-dotnet-client,bacm/google-api-dotnet-client,olofd/google-api-dotnet-client,jtattermusch/google-api-dotnet-client,rburgstaler/google-api-dotnet-client,duongnhyt/google-api-dotnet-client,jskeet/google-api-dotnet-client,PiRSquared17/google-api-dotnet-client,asifshaon/google-api-dotnet-client,chrisdunelm/google-api-dotnet-client,chenneo/google-api-dotnet-client,sawanmishra/google-api-dotnet-client,MesutGULECYUZ/google-api-dotnet-client,eshivakant/google-api-dotnet-client,neil-119/google-api-dotnet-client,peleyal/google-api-dotnet-client,hurcane/google-api-dotnet-client,abujehad139/google-api-dotnet-client,Senthilvera/google-api-dotnet-client,jesusog/google-api-dotnet-client,initaldk/google-api-dotnet-client,ephraimncory/google-api-dotnet-client,shumaojie/google-api-dotnet-client,initaldk/google-api-dotnet-client,aoisensi/google-api-dotnet-client,neil-119/google-api-dotnet-client,Duikmeester/google-api-dotnet-client,amitla/google-api-dotnet-client,peleyal/google-api-dotnet-client,cdanielm58/google-api-dotnet-client,DJJam/google-api-dotnet-client,initaldk/google-api-dotnet-client,inetdream/google-api-dotnet-client,ivannaranjo/google-api-dotnet-client,MyOwnClone/google-api-dotnet-client,luantn2/google-api-dotnet-client,chrisdunelm/google-api-dotnet-client,mylemans/google-api-dotnet-client,hurcane/google-api-dotnet-client,LPAMNijoel/google-api-dotnet-client,ivannaranjo/google-api-dotnet-client,arjunRanosys/google-api-dotnet-client,ivannaranjo/google-api-dotnet-client,lli-klick/google-api-dotnet-client,nicolasdavel/google-api-dotnet-client,Duikmeester/google-api-dotnet-client,smarly-net/google-api-dotnet-client,googleapis/google-api-dotnet-client,Duikmeester/google-api-dotnet-client,LPAMNijoel/google-api-dotnet-client
|
2571549fdb42adf894bd11632aa9c16a4a47d36e
|
Source/XenkoToolkit.Samples/XenkoToolkit.Samples.Game/Core/NavigationButtonHandler.cs
|
Source/XenkoToolkit.Samples/XenkoToolkit.Samples.Game/Core/NavigationButtonHandler.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SiliconStudio.Core.Mathematics;
using SiliconStudio.Xenko.Input;
using SiliconStudio.Xenko.Engine;
using SiliconStudio.Xenko.UI.Controls;
using XenkoToolkit.Samples.Core;
namespace XenkoToolkit.Samples.Core
{
public class NavigationButtonHandler : SyncScript
{
public UIPage Page { get; set; }
public string ButtonName { get; set; }
public INavigationButtonAction ButtonAction { get; set; } = new NavigateToScreen();
public override void Start()
{
Page = Page ?? this.Entity.Get<UIComponent>()?.Page;
if (string.IsNullOrEmpty(ButtonName) || ButtonAction == null) return;
// Initialization of the script.
if (Page?.RootElement.FindName(ButtonName) is Button button)
{
button.Click += Button_Click;
}
}
private async void Button_Click(object sender, SiliconStudio.Xenko.UI.Events.RoutedEventArgs e)
{
var navService = Game.Services.GetService<ISceneNavigationService>();
await ButtonAction?.Handle(navService);
}
public override void Update()
{
// Do stuff every new frame
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SiliconStudio.Core.Mathematics;
using SiliconStudio.Xenko.Input;
using SiliconStudio.Xenko.Engine;
using SiliconStudio.Xenko.UI.Controls;
using XenkoToolkit.Samples.Core;
namespace XenkoToolkit.Samples.Core
{
public class NavigationButtonHandler : SyncScript
{
public UIPage Page { get; set; }
public string ButtonName { get; set; }
public INavigationButtonAction ButtonAction { get; set; } = new NavigateToScreen();
public override void Start()
{
Page = Page ?? this.Entity.Get<UIComponent>()?.Page;
if (string.IsNullOrEmpty(ButtonName) || ButtonAction == null) return;
// Initialization of the script.
if (Page?.RootElement.FindName(ButtonName) is Button button)
{
button.Click += Button_Click;
}
}
private async void Button_Click(object sender, SiliconStudio.Xenko.UI.Events.RoutedEventArgs e)
{
var navService = Game.Services.GetService<ISceneNavigationService>();
await ButtonAction?.Handle(navService);
}
public override void Update()
{
// Do stuff every new frame
}
public override void Cancel()
{
if (Page?.RootElement.FindName(ButtonName) is Button button)
{
button.Click -= Button_Click;
}
}
}
}
|
Remove button handler on Cancel.
|
Remove button handler on Cancel.
|
C#
|
mit
|
dfkeenan/XenkoToolkit,dfkeenan/XenkoToolkit
|
f199e1027987bd1208dc71cbdd99bc1a445d5249
|
src/SparkPost.Tests/UserAgentTests.cs
|
src/SparkPost.Tests/UserAgentTests.cs
|
using System;
using Xunit;
namespace SparkPost.Tests
{
public partial class ClientTests
{
public partial class UserAgentTests
{
private readonly Client.Settings settings;
public UserAgentTests()
{
settings = new Client.Settings();
}
[Fact]
public void It_should_default_to_the_library_version()
{
Assert.Equal($"csharp-sparkpost/2.0.0", settings.UserAgent);
}
[Fact]
public void It_should_allow_the_user_agent_to_be_changed()
{
var userAgent = Guid.NewGuid().ToString();
settings.UserAgent = userAgent;
Assert.Equal(userAgent, settings.UserAgent);
}
}
}
}
|
using System;
using Xunit;
namespace SparkPost.Tests
{
public partial class ClientTests
{
public partial class UserAgentTests
{
private readonly Client.Settings settings;
public UserAgentTests()
{
settings = new Client.Settings();
}
[Fact]
public void It_should_default_to_the_library_version()
{
Assert.StartsWith($"csharp-sparkpost/2.", settings.UserAgent);
}
[Fact]
public void It_should_allow_the_user_agent_to_be_changed()
{
var userAgent = Guid.NewGuid().ToString();
settings.UserAgent = userAgent;
Assert.Equal(userAgent, settings.UserAgent);
}
}
}
}
|
Make agent test less brittle
|
Make agent test less brittle
|
C#
|
apache-2.0
|
darrencauthon/csharp-sparkpost,darrencauthon/csharp-sparkpost
|
c5a8b429835a82f4e331471d8fe7158ff65b39ec
|
src/Tools/RPCGen.Tests/RPCGenTests.cs
|
src/Tools/RPCGen.Tests/RPCGenTests.cs
|
using Flood.Tools.RPCGen;
using NUnit.Framework;
using System;
using System.IO;
using System.Reflection;
namespace RPCGen.Tests
{
[TestFixture]
class RPCGenTests
{
[Test]
public void MainTest()
{
string genDirectory = Path.Combine("..", "..", "gen", "RPCGen.Tests");
Directory.CreateDirectory(genDirectory);
var sourceDllPath = Path.GetFullPath("RPCGen.Tests.Services.dll");
var destDllPath = Path.Combine(genDirectory, "RPCGen.Tests.Services.dll");
var sourcePdbPath = Path.GetFullPath("RPCGen.Tests.Services.pdb");
var destPdbPath = Path.Combine(genDirectory, "RPCGen.Tests.Services.pdb");
System.IO.File.Copy(sourceDllPath, destDllPath, true);
if (File.Exists(sourcePdbPath))
System.IO.File.Copy(sourcePdbPath, destPdbPath, true);
var args = new string[]
{
String.Format("-o={0}", genDirectory),
destDllPath
};
var ret = Flood.Tools.RPCGen.Program.Main(args);
Assert.AreEqual(0, ret);
}
}
}
|
using NUnit.Framework;
using System;
using System.IO;
namespace RPCGen.Tests
{
[TestFixture]
class RPCGenTests
{
[Test]
public void MainTest()
{
string genDirectory = Path.Combine("..", "..", "gen", "RPCGen.Tests");
Directory.CreateDirectory(genDirectory);
var assemblyName = "RPCGen.Tests.Services";
var assemblyDll = assemblyName + ".dll";
var assemblyPdb = assemblyName + ".pdb";
var sourceDllPath = Path.GetFullPath(assemblyDll);
var destDllPath = Path.Combine(genDirectory, assemblyDll);
var sourcePdbPath = Path.GetFullPath(assemblyPdb);
var destPdbPath = Path.Combine(genDirectory, assemblyPdb);
File.Copy(sourceDllPath, destDllPath, true);
if (File.Exists(sourcePdbPath))
File.Copy(sourcePdbPath, destPdbPath, true);
var args = new string[]
{
String.Format("-o={0}", genDirectory),
destDllPath
};
var ret = Flood.Tools.RPCGen.Program.Main(args);
Assert.AreEqual(0, ret);
}
}
}
|
Refactor assembly name in MainTests.
|
Refactor assembly name in MainTests.
|
C#
|
bsd-2-clause
|
FloodProject/flood,FloodProject/flood,FloodProject/flood
|
a1b9a4dc91aa75c4bd67eb931b4e58beec82e810
|
app/views/bs_accordion.cshtml
|
app/views/bs_accordion.cshtml
|
@inherits Umbraco.Web.Mvc.UmbracoViewPage<dynamic>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" @AccordionHelper() href="#collapse-@Model.UniqueId">@Model.Header </a>
</h4>
</div>
<div id="collapse-@Model.UniqueId" class="panel-collapse collapse">
<div class="panel-body">
@Html.Raw(@Model.Body)
</div>
@if (Model.Footer != null && !String.IsNullOrEmpty(Convert.ToString(Model.Footer)))
{
<div class="panel-footer">
@Model.Footer
</div>
}
</div>
</div>
@helper AccordionHelper()
{
if (Model != null && Model.AccordionParent != null)
{
@:data-parent="@Model.AccordionParent"
}
}
|
@inherits Umbraco.Web.Mvc.UmbracoViewPage<dynamic>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" @AccordionHelper() href="#collapse-@Model.UniqueId">@Model.Header </a>
</h4>
</div>
<div id="collapse-@Model.UniqueId" class="panel-collapse collapse">
<div class="panel-body">
@Html.Raw(@Model.Body)
</div>
@if (Model.Footer != null && !String.IsNullOrEmpty(Convert.ToString(Model.Footer)))
{
<div class="panel-footer">
@Model.Footer
</div>
}
</div>
</div>
@helper AccordionHelper()
{
if (Model != null && Model.AccordionParent != null)
{
@:data-parent="@Model.AccordionParent" class="collapsed"
}
}
|
Set accordion panels to be default collapsed
|
Set accordion panels to be default collapsed
|
C#
|
mit
|
mmichaels01/umbraco-bootstrap-accordion-editor,mmichaels01/umbraco-bootstrap-accordion-editor,mmichaels01/umbraco-bootstrap-accordion-editor
|
553169098369f48158835c55168863041f898dec
|
ValueUtilsTest/SampleClass.cs
|
ValueUtilsTest/SampleClass.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ValueUtilsTest {
class SampleClass {
public SampleEnum AnEnum;
public string AutoPropWithPrivateBackingField { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ValueUtilsTest {
struct CustomStruct {
public int Bla;
}
class SampleClass {
public SampleEnum AnEnum;
public int? NullableField;
public CustomStruct PlainStruct;
public CustomStruct? NullableStruct;
public string AutoPropWithPrivateBackingField { get; set; }
}
}
|
Add tricky cases to test class: - nullable primitives - non-nullable custom structs - nullable structs
|
Add tricky cases to test class:
- nullable primitives
- non-nullable custom structs
- nullable structs
|
C#
|
apache-2.0
|
EamonNerbonne/ValueUtils,EamonNerbonne/ValueUtils,EamonNerbonne/ValueUtils
|
5de6f908b2ab2642428e9cc84ecc0e7990201616
|
source/XSharp.Launch/RuntimeHelper.cs
|
source/XSharp.Launch/RuntimeHelper.cs
|
#if NETCOREAPP2_1
using System.Runtime.InteropServices;
#endif
namespace XSharp.Launch
{
internal static class RuntimeHelper
{
public static bool IsWindows
{
get
{
#if NETCOREAPP2_1
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
#elif NET471
return true;
#endif
}
}
public static bool IsOSX
{
get
{
#if NETCOREAPP2_1
return RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
#elif NET471
return false;
#endif
}
}
public static bool IsLinux
{
get
{
#if NETCOREAPP2_1
return RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
#elif NET471
return false;
#endif
}
}
}
}
|
#if NETCOREAPP2_0
using System.Runtime.InteropServices;
#endif
namespace XSharp.Launch
{
internal static class RuntimeHelper
{
public static bool IsWindows
{
get
{
#if NETCOREAPP2_0
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
#elif NET472
return true;
#endif
}
}
public static bool IsOSX
{
get
{
#if NETCOREAPP2_0
return RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
#elif NET472
return false;
#endif
}
}
public static bool IsLinux
{
get
{
#if NETCOREAPP2_0
return RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
#elif NET472
return false;
#endif
}
}
}
}
|
Update conditional code blocks with new versions
|
Update conditional code blocks with new versions
|
C#
|
bsd-3-clause
|
CosmosOS/XSharp,CosmosOS/XSharp,CosmosOS/XSharp
|
b6ea350bd20879fcf9e96f20d6ec0175d50bff94
|
Source/Tests/TraktApiSharp.Tests/Experimental/Requests/Users/OAuth/TraktUserFollowUserRequestTests.cs
|
Source/Tests/TraktApiSharp.Tests/Experimental/Requests/Users/OAuth/TraktUserFollowUserRequestTests.cs
|
namespace TraktApiSharp.Tests.Experimental.Requests.Users.OAuth
{
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TraktApiSharp.Experimental.Requests.Base.Post.Bodyless;
using TraktApiSharp.Experimental.Requests.Users.OAuth;
using TraktApiSharp.Objects.Post.Users.Responses;
[TestClass]
public class TraktUserFollowUserRequestTests
{
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserFollowUserRequestIsNotAbstract()
{
typeof(TraktUserFollowUserRequest).IsAbstract.Should().BeFalse();
}
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserFollowUserRequestIsSealed()
{
typeof(TraktUserFollowUserRequest).IsSealed.Should().BeTrue();
}
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserFollowUserRequestIsSubclassOfATraktSingleItemBodylessPostRequest()
{
typeof(TraktUserFollowUserRequest).IsSubclassOf(typeof(ATraktSingleItemBodylessPostRequest<TraktUserFollowUserPostResponse>)).Should().BeTrue();
}
}
}
|
namespace TraktApiSharp.Tests.Experimental.Requests.Users.OAuth
{
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TraktApiSharp.Experimental.Requests.Base.Post.Bodyless;
using TraktApiSharp.Experimental.Requests.Users.OAuth;
using TraktApiSharp.Objects.Post.Users.Responses;
using TraktApiSharp.Requests;
[TestClass]
public class TraktUserFollowUserRequestTests
{
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserFollowUserRequestIsNotAbstract()
{
typeof(TraktUserFollowUserRequest).IsAbstract.Should().BeFalse();
}
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserFollowUserRequestIsSealed()
{
typeof(TraktUserFollowUserRequest).IsSealed.Should().BeTrue();
}
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserFollowUserRequestIsSubclassOfATraktSingleItemBodylessPostRequest()
{
typeof(TraktUserFollowUserRequest).IsSubclassOf(typeof(ATraktSingleItemBodylessPostRequest<TraktUserFollowUserPostResponse>)).Should().BeTrue();
}
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserFollowUserRequestHasAuthorizationRequired()
{
var request = new TraktUserFollowUserRequest(null);
request.AuthorizationRequirement.Should().Be(TraktAuthorizationRequirement.Required);
}
}
}
|
Add test for authorization requirement in TraktUserFollowUserRequest
|
Add test for authorization requirement in TraktUserFollowUserRequest
|
C#
|
mit
|
henrikfroehling/TraktApiSharp
|
005a9f9411cf877621a640c1181d6d7523555529
|
src/Protractor/JavaScriptBy.cs
|
src/Protractor/JavaScriptBy.cs
|
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using OpenQA.Selenium;
namespace Protractor
{
internal class JavaScriptBy : By
{
private string script;
private object[] args;
public JavaScriptBy(string script, params object[] args)
{
this.script = script;
this.args = args;
}
public IWebElement RootElement { get; set; }
public override IWebElement FindElement(ISearchContext context)
{
ReadOnlyCollection<IWebElement> elements = this.FindElements(context);
return elements.Count > 0 ? elements[0] : null;
}
public override ReadOnlyCollection<IWebElement> FindElements(ISearchContext context)
{
// Create script arguments
object[] scriptArgs = new object[this.args.Length + 1];
scriptArgs[0] = this.RootElement;
Array.Copy(this.args, 0, scriptArgs, 1, this.args.Length);
ReadOnlyCollection<IWebElement> elements = ((IJavaScriptExecutor)context).ExecuteScript(this.script, scriptArgs) as ReadOnlyCollection<IWebElement>;
if (elements == null)
{
elements = new ReadOnlyCollection<IWebElement>(new List<IWebElement>(0));
}
return elements;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using OpenQA.Selenium;
using OpenQA.Selenium.Internal;
namespace Protractor
{
internal class JavaScriptBy : By
{
private string script;
private object[] args;
public JavaScriptBy(string script, params object[] args)
{
this.script = script;
this.args = args;
}
public IWebElement RootElement { get; set; }
public override IWebElement FindElement(ISearchContext context)
{
ReadOnlyCollection<IWebElement> elements = this.FindElements(context);
return elements.Count > 0 ? elements[0] : null;
}
public override ReadOnlyCollection<IWebElement> FindElements(ISearchContext context)
{
// Create script arguments
object[] scriptArgs = new object[this.args.Length + 1];
scriptArgs[0] = this.RootElement;
Array.Copy(this.args, 0, scriptArgs, 1, this.args.Length);
// Get JS executor
IJavaScriptExecutor jsExecutor = context as IJavaScriptExecutor;
if (jsExecutor == null)
{
IWrapsDriver wrapsDriver = context as IWrapsDriver;
if (wrapsDriver != null)
{
jsExecutor = wrapsDriver.WrappedDriver as IJavaScriptExecutor;
}
}
if (jsExecutor == null)
{
throw new NotSupportedException("Could not get an IJavaScriptExecutor instance from the context.");
}
ReadOnlyCollection<IWebElement> elements = jsExecutor.ExecuteScript(this.script, scriptArgs) as ReadOnlyCollection<IWebElement>;
if (elements == null)
{
elements = new ReadOnlyCollection<IWebElement>(new List<IWebElement>(0));
}
return elements;
}
}
}
|
Fix NgBy when used with IWebElement
|
Fix NgBy when used with IWebElement
|
C#
|
mit
|
sergueik/protractor-net,JonWang0/protractor-net,bbaia/protractor-net
|
9a7a2cffc2e2d8b001804c68d0425e03c3ee1b52
|
app/Desktop/Arguments.cs
|
app/Desktop/Arguments.cs
|
using System;
using DHT.Utils.Logging;
namespace DHT.Desktop {
sealed class Arguments {
private static readonly Log Log = Log.ForType<Arguments>();
public static Arguments Empty => new(Array.Empty<string>());
public string? DatabaseFile { get; }
public ushort? ServerPort { get; }
public string? ServerToken { get; }
public Arguments(string[] args) {
for (int i = 0; i < args.Length; i++) {
string key = args[i];
if (i >= args.Length - 1) {
Log.Warn("Missing value for command line argument: " + key);
continue;
}
string value = args[++i];
switch (key) {
case "-db":
DatabaseFile = value;
continue;
case "-port": {
if (ushort.TryParse(value, out var port)) {
ServerPort = port;
}
else {
Log.Warn("Invalid port number: " + value);
}
continue;
}
case "-token":
ServerToken = value;
continue;
default:
Log.Warn("Unknown command line argument: " + key);
break;
}
}
}
}
}
|
using System;
using DHT.Utils.Logging;
namespace DHT.Desktop {
sealed class Arguments {
private static readonly Log Log = Log.ForType<Arguments>();
public static Arguments Empty => new(Array.Empty<string>());
public string? DatabaseFile { get; }
public ushort? ServerPort { get; }
public string? ServerToken { get; }
public Arguments(string[] args) {
for (int i = 0; i < args.Length; i++) {
string key = args[i];
string value;
if (i == 0 && !key.StartsWith('-')) {
value = key;
key = "-db";
}
else if (i >= args.Length - 1) {
Log.Warn("Missing value for command line argument: " + key);
continue;
}
else {
value = args[++i];
}
switch (key) {
case "-db":
DatabaseFile = value;
continue;
case "-port": {
if (ushort.TryParse(value, out var port)) {
ServerPort = port;
}
else {
Log.Warn("Invalid port number: " + value);
}
continue;
}
case "-token":
ServerToken = value;
continue;
default:
Log.Warn("Unknown command line argument: " + key);
break;
}
}
}
}
}
|
Allow database file path to be passed as the first command line argument to the app
|
Allow database file path to be passed as the first command line argument to the app
This adds support for directly opening files with the DHT app, for ex. in Windows Explorer by using "Open With", or by associating the ".dht" extension with the app.
|
C#
|
mit
|
chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker
|
f7049c22acd1054e3b7c919635ad93b36316198e
|
src/xp.cert/commands/Update_MacOSX.cs
|
src/xp.cert/commands/Update_MacOSX.cs
|
using System;
using System.IO;
using System.Diagnostics;
using Xp.Cert;
namespace Xp.Cert.Commands
{
public partial class Update : Command
{
const string SECURITY_EXECUTABLE = "/usr/bin/security";
const string SECURITY_ARGUMENTS = "find-certificate -a -p";
const string SECURITY_KEYCHAIN = "/System/Library/Keychains/SystemRootCertificates.keychain";
/// <summary>Execute this command</summary>
public void MacOSX(FileInfo bundle)
{
var proc = new Process();
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.FileName = SECURITY_EXECUTABLE;
proc.StartInfo.Arguments = SECURITY_ARGUMENTS + " " + SECURITY_KEYCHAIN;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.RedirectStandardError = false;
try {
Console.Write("> From {0}: [", SECURITY_KEYCHAIN);
proc.Start();
using (var writer = new StreamWriter(bundle.Open(FileMode.Create)))
{
var count = 0;
proc.OutputDataReceived += (sender, e) => {
if (e.Data.StartsWith(BEGIN_CERT))
{
count++;
Console.Write('.');
}
writer.WriteLine(e.Data);
};
proc.BeginOutputReadLine();
proc.WaitForExit();
Console.WriteLine("]");
Console.WriteLine(" {0} certificates", count);
}
}
finally
{
proc.Close();
}
}
}
}
|
using System;
using System.IO;
using System.Diagnostics;
using Xp.Cert;
namespace Xp.Cert.Commands
{
public partial class Update : Command
{
const string SECURITY_EXECUTABLE = "/usr/bin/security";
const string SECURITY_ARGUMENTS = "find-certificate -a -p";
const string SECURITY_KEYCHAIN = "/System/Library/Keychains/SystemRootCertificates.keychain";
/// <summary>Execute this command</summary>
public void MacOSX(FileInfo bundle)
{
var proc = new Process();
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.FileName = SECURITY_EXECUTABLE;
proc.StartInfo.Arguments = SECURITY_ARGUMENTS + " " + SECURITY_KEYCHAIN;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.RedirectStandardError = false;
try {
Console.Write("> From {0}: [", SECURITY_KEYCHAIN);
proc.Start();
using (var writer = new StreamWriter(bundle.Open(FileMode.Create)))
{
var count = 0;
proc.OutputDataReceived += (sender, e) => {
if (e.Data.StartsWith(BEGIN_CERT))
{
count++;
Console.Write('.');
}
writer.WriteLine(e.Data);
};
proc.BeginOutputReadLine();
proc.WaitForExit();
Console.WriteLine("]");
Console.WriteLine(" {0} certificates", count);
Console.WriteLine();
}
}
finally
{
proc.Close();
}
}
}
}
|
Add a newline to Mac OS X output
|
Add a newline to Mac OS X output
|
C#
|
bsd-3-clause
|
xp-runners/cert
|
71c856282bdec06c9879c0ac23187a9172ff3c8a
|
AndHUD/XHUD.cs
|
AndHUD/XHUD.cs
|
using System;
using Android.App;
using AndroidHUD;
namespace XHUD
{
public enum MaskType
{
// None = 1,
Clear,
Black,
// Gradient
}
public static class HUD
{
public static Activity MyActivity;
public static void Show(string message, int progress = -1, MaskType maskType = MaskType.Black)
{
AndHUD.Shared.Show(HUD.MyActivity, message, progress,(AndroidHUD.MaskType)maskType);
}
public static void Dismiss()
{
AndHUD.Shared.Dismiss(HUD.MyActivity);
}
public static void ShowToast(string message, bool showToastCentered = true, double timeoutMs = 1000)
{
AndHUD.Shared.ShowToast(HUD.MyActivity, message, (AndroidHUD.MaskType)MaskType.Black, TimeSpan.FromSeconds(timeoutMs/1000), showToastCentered);
}
public static void ShowToast (string message, MaskType maskType, bool showToastCentered = true, double timeoutMs = 1000)
{
AndHUD.Shared.ShowToast(HUD.MyActivity, message, (AndroidHUD.MaskType)maskType, TimeSpan.FromSeconds(timeoutMs/1000), showToastCentered);
}
}
}
|
using System;
using Android.App;
using AndroidHUD;
namespace XHUD
{
public enum MaskType
{
// None = 1,
Clear,
Black,
// Gradient
}
public static class HUD
{
public static Activity MyActivity;
public static void Show(string message, int progress = -1, MaskType maskType = MaskType.Black)
{
AndHUD.Shared.Show(HUD.MyActivity, message, progress,(AndroidHUD.MaskType)maskType);
}
public static void Dismiss()
{
AndHUD.Shared.Dismiss(HUD.MyActivity);
}
public static void ShowToast(string message, bool showToastCentered = true, double timeoutMs = 1000)
{
AndHUD.Shared.ShowToast(HUD.MyActivity, message, (AndroidHUD.MaskType)MaskType.Black, TimeSpan.FromSeconds(timeoutMs/1000), showToastCentered);
}
public static void ShowToast(string message, MaskType maskType, bool showToastCentered = true, double timeoutMs = 1000)
{
AndHUD.Shared.ShowToast(HUD.MyActivity, message, (AndroidHUD.MaskType)maskType, TimeSpan.FromSeconds(timeoutMs/1000), showToastCentered);
}
}
}
|
Format change to match other methods;
|
Format change to match other methods;
|
C#
|
apache-2.0
|
Redth/AndHUD,Redth/AndHUD,skela/AndHUD
|
0c52ffefe7d8fccd1f1c0b75b703be525e2dfdb6
|
Source/Lib/TraktApiSharp/Requests/WithoutOAuth/Movies/Common/TraktMoviesMostPlayedRequest.cs
|
Source/Lib/TraktApiSharp/Requests/WithoutOAuth/Movies/Common/TraktMoviesMostPlayedRequest.cs
|
namespace TraktApiSharp.Requests.WithoutOAuth.Movies.Common
{
using Base.Get;
using Enums;
using Objects.Basic;
using Objects.Get.Movies.Common;
using System.Collections.Generic;
internal class TraktMoviesMostPlayedRequest : TraktGetRequest<TraktPaginationListResult<TraktMostPlayedMovie>, TraktMostPlayedMovie>
{
internal TraktMoviesMostPlayedRequest(TraktClient client) : base(client) { Period = TraktPeriod.Weekly; }
internal TraktPeriod? Period { get; set; }
protected override IDictionary<string, object> GetUriPathParameters()
{
var uriParams = base.GetUriPathParameters();
if (Period.HasValue && Period.Value != TraktPeriod.Unspecified)
uriParams.Add("period", Period.Value.AsString());
return uriParams;
}
protected override string UriTemplate => "movies/played{/period}{?extended,page,limit}";
protected override TraktAuthorizationRequirement AuthorizationRequirement => TraktAuthorizationRequirement.NotRequired;
protected override bool SupportsPagination => true;
protected override bool IsListResult => true;
}
}
|
namespace TraktApiSharp.Requests.WithoutOAuth.Movies.Common
{
using Base;
using Base.Get;
using Enums;
using Objects.Basic;
using Objects.Get.Movies.Common;
using System.Collections.Generic;
internal class TraktMoviesMostPlayedRequest : TraktGetRequest<TraktPaginationListResult<TraktMostPlayedMovie>, TraktMostPlayedMovie>
{
internal TraktMoviesMostPlayedRequest(TraktClient client) : base(client) { Period = TraktPeriod.Weekly; }
internal TraktPeriod? Period { get; set; }
protected override IDictionary<string, object> GetUriPathParameters()
{
var uriParams = base.GetUriPathParameters();
if (Period.HasValue && Period.Value != TraktPeriod.Unspecified)
uriParams.Add("period", Period.Value.AsString());
return uriParams;
}
protected override string UriTemplate => "movies/played{/period}{?extended,page,limit,query,years,genres,languages,countries,runtimes,ratings,certifications}";
protected override TraktAuthorizationRequirement AuthorizationRequirement => TraktAuthorizationRequirement.NotRequired;
internal TraktMovieFilter Filter { get; set; }
protected override bool SupportsPagination => true;
protected override bool IsListResult => true;
}
}
|
Add filter property to most played movies request.
|
Add filter property to most played movies request.
|
C#
|
mit
|
henrikfroehling/TraktApiSharp
|
6e9e923abba8a8d96452c731b490c20048037a24
|
GoldenAnvil.Utility.Windows/CommonConverters.cs
|
GoldenAnvil.Utility.Windows/CommonConverters.cs
|
using System;
using System.Globalization;
using System.Windows.Data;
namespace GoldenAnvil.Utility.Windows
{
public static class CommonConverters
{
public static readonly IValueConverter BooleanNot = new BooleanNotConverter();
private sealed class BooleanNotConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (targetType != typeof(bool))
throw new InvalidOperationException(@"The target must be a boolean.");
return !((bool) value);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
}
|
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace GoldenAnvil.Utility.Windows
{
public static class CommonConverters
{
public static readonly IValueConverter BooleanNot = new BooleanNotConverter();
public static readonly IValueConverter BooleanToVisibility = new BooleanToVisibilityConverter();
public static readonly IValueConverter IsEqual = new IsEqualConverter();
public static readonly IValueConverter IsEqualToVisibility = new IsEqualToVisibilityConverter();
private sealed class BooleanNotConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (!targetType.IsAssignableFrom(typeof(bool)))
throw new InvalidOperationException(@"The target must be assignable from a boolean.");
return !((bool) value);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
private sealed class BooleanToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (!targetType.IsAssignableFrom(typeof(Visibility)))
throw new InvalidOperationException(@"The target must be assignable from a Visibility.");
return (bool) value ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
private sealed class IsEqualConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (!targetType.IsAssignableFrom(typeof(bool)))
throw new InvalidOperationException(@"The target must be assignable from a boolean.");
return object.Equals(value, parameter);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
private sealed class IsEqualToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (!targetType.IsAssignableFrom(typeof(Visibility)))
throw new InvalidOperationException(@"The target must be assignable from a Visibility.");
return object.Equals(value, parameter) ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
}
|
Add BooleanToVisibility, IsEqual, and IsEqualToVisbility converters
|
Add BooleanToVisibility, IsEqual, and IsEqualToVisbility converters
|
C#
|
mit
|
SaberSnail/GoldenAnvil.Utility
|
62c7ab7d5053e8571af9d2c4fb929726d1b58e68
|
OpenVASManager.cs
|
OpenVASManager.cs
|
using System;
using System.Xml;
using System.Xml.Linq;
namespace openvassharp
{
public class OpenVASManager : IDisposable
{
private OpenVASSession _session;
public OpenVASManager ()
{
_session = null;
}
public OpenVASManager(OpenVASSession session)
{
if (session != null)
_session = session;
}
public XDocument GetVersion() {
return _session.ExecuteCommand (XDocument.Parse ("<get_version />"));
}
private bool CheckSession()
{
if (!_session.Stream.CanRead)
throw new Exception("Bad session");
return true;
}
public void Dispose()
{
_session = null;
}
}
}
|
using System;
using System.Xml;
using System.Xml.Linq;
namespace openvassharp
{
public class OpenVASManager : IDisposable
{
private OpenVASSession _session;
public OpenVASManager(OpenVASSession session)
{
if (session != null)
_session = session;
}
public XDocument GetVersion() {
return _session.ExecuteCommand (XDocument.Parse ("<get_version />"));
}
public void Dispose()
{
_session = null;
}
}
}
|
Remove un-needed ctor and other methods
|
Remove un-needed ctor and other methods
|
C#
|
bsd-3-clause
|
VolatileMindsLLC/openvas-sharp
|
4e3e09d4188722777d36a7859911cf0b10b00b85
|
Source/Tests/TraktApiSharp.Tests/Experimental/Requests/Users/OAuth/TraktUserUnfollowUserRequestTests.cs
|
Source/Tests/TraktApiSharp.Tests/Experimental/Requests/Users/OAuth/TraktUserUnfollowUserRequestTests.cs
|
namespace TraktApiSharp.Tests.Experimental.Requests.Users.OAuth
{
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TraktApiSharp.Experimental.Requests.Base.Delete;
using TraktApiSharp.Experimental.Requests.Users.OAuth;
[TestClass]
public class TraktUserUnfollowUserRequestTests
{
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserUnfollowUserRequestIsNotAbstract()
{
typeof(TraktUserUnfollowUserRequest).IsAbstract.Should().BeFalse();
}
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserUnfollowUserRequestIsSealed()
{
typeof(TraktUserUnfollowUserRequest).IsSealed.Should().BeTrue();
}
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserUnfollowUserRequestIsSubclassOfATraktNoContentDeleteRequest()
{
typeof(TraktUserUnfollowUserRequest).IsSubclassOf(typeof(ATraktNoContentDeleteRequest)).Should().BeTrue();
}
}
}
|
namespace TraktApiSharp.Tests.Experimental.Requests.Users.OAuth
{
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TraktApiSharp.Experimental.Requests.Base.Delete;
using TraktApiSharp.Experimental.Requests.Users.OAuth;
using TraktApiSharp.Requests;
[TestClass]
public class TraktUserUnfollowUserRequestTests
{
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserUnfollowUserRequestIsNotAbstract()
{
typeof(TraktUserUnfollowUserRequest).IsAbstract.Should().BeFalse();
}
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserUnfollowUserRequestIsSealed()
{
typeof(TraktUserUnfollowUserRequest).IsSealed.Should().BeTrue();
}
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserUnfollowUserRequestIsSubclassOfATraktNoContentDeleteRequest()
{
typeof(TraktUserUnfollowUserRequest).IsSubclassOf(typeof(ATraktNoContentDeleteRequest)).Should().BeTrue();
}
[TestMethod, TestCategory("Requests"), TestCategory("Users")]
public void TestTraktUserUnfollowUserRequestHasAuthorizationRequired()
{
var request = new TraktUserUnfollowUserRequest(null);
request.AuthorizationRequirement.Should().Be(TraktAuthorizationRequirement.Required);
}
}
}
|
Add test for authorization requirement in TraktUserUnfollowUserRequest
|
Add test for authorization requirement in TraktUserUnfollowUserRequest
|
C#
|
mit
|
henrikfroehling/TraktApiSharp
|
bc11b838cd1abd3064fd0565ca6fd3143670f001
|
src/Fixie/ReflectionExtensions.cs
|
src/Fixie/ReflectionExtensions.cs
|
namespace Fixie
{
using System;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
public static class ReflectionExtensions
{
public static string TypeName(this object o)
{
return o?.GetType().FullName;
}
public static bool IsVoid(this MethodInfo method)
{
return method.ReturnType == typeof(void);
}
public static bool IsStatic(this Type type)
{
return type.IsAbstract && type.IsSealed;
}
public static bool Has<TAttribute>(this Type type) where TAttribute : Attribute
{
return type.GetTypeInfo().GetCustomAttributes<TAttribute>(false).Any();
}
public static bool HasOrInherits<TAttribute>(this Type type) where TAttribute : Attribute
{
return type.GetTypeInfo().GetCustomAttributes<TAttribute>(true).Any();
}
public static bool Has<TAttribute>(this MethodInfo method) where TAttribute : Attribute
{
return method.GetCustomAttributes<TAttribute>(false).Any();
}
public static bool HasOrInherits<TAttribute>(this MethodInfo method) where TAttribute : Attribute
{
return method.GetCustomAttributes<TAttribute>(true).Any();
}
public static bool IsAsync(this MethodInfo method)
{
return method.Has<AsyncStateMachineAttribute>();
}
public static bool IsInNamespace(this Type type, string ns)
{
var actual = type.Namespace;
if (ns == null)
return actual == null;
if (actual == null)
return false;
return actual == ns || actual.StartsWith(ns + ".");
}
public static void Dispose(this object o)
{
(o as IDisposable)?.Dispose();
}
}
}
|
namespace Fixie
{
using System;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
public static class ReflectionExtensions
{
public static string TypeName(this object o)
{
return o?.GetType().FullName;
}
public static bool IsVoid(this MethodInfo method)
{
return method.ReturnType == typeof(void);
}
public static bool IsStatic(this Type type)
{
return type.IsAbstract && type.IsSealed;
}
public static bool Has<TAttribute>(this Type type) where TAttribute : Attribute
{
return type.GetCustomAttributes<TAttribute>(false).Any();
}
public static bool HasOrInherits<TAttribute>(this Type type) where TAttribute : Attribute
{
return type.GetCustomAttributes<TAttribute>(true).Any();
}
public static bool Has<TAttribute>(this MethodInfo method) where TAttribute : Attribute
{
return method.GetCustomAttributes<TAttribute>(false).Any();
}
public static bool HasOrInherits<TAttribute>(this MethodInfo method) where TAttribute : Attribute
{
return method.GetCustomAttributes<TAttribute>(true).Any();
}
public static bool IsAsync(this MethodInfo method)
{
return method.Has<AsyncStateMachineAttribute>();
}
public static bool IsInNamespace(this Type type, string ns)
{
var actual = type.Namespace;
if (ns == null)
return actual == null;
if (actual == null)
return false;
return actual == ns || actual.StartsWith(ns + ".");
}
public static void Dispose(this object o)
{
(o as IDisposable)?.Dispose();
}
}
}
|
Remove calls to GetTypeInfo() now that they are no longer necessary for our minimum netcoreapp version of 2.0.
|
Remove calls to GetTypeInfo() now that they are no longer necessary for our minimum netcoreapp version of 2.0.
|
C#
|
mit
|
fixie/fixie
|
a716481f945bce7800e3e7d24504d1709f82af0e
|
src/CSharpViaTest.Collections/20_YieldPractices/TakeUntilCatchingAnException.cs
|
src/CSharpViaTest.Collections/20_YieldPractices/TakeUntilCatchingAnException.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using CSharpViaTest.Collections.Annotations;
using Xunit;
namespace CSharpViaTest.Collections._20_YieldPractices
{
[Medium]
public class TakeUntilCatchingAnException
{
readonly int indexThatWillThrow = new Random().Next(2, 10);
IEnumerable<int> GetSequenceOfData()
{
for (int i = 0;; ++i)
{
if (i == indexThatWillThrow) { throw new Exception("An exception is thrown"); }
yield return i;
}
}
#region Please modifies the code to pass the test
static IEnumerable<int> TakeUntilError(IEnumerable<int> sequence)
{
throw new NotImplementedException();
}
#endregion
[Fact]
public void should_get_sequence_until_an_exception_is_thrown()
{
IEnumerable<int> sequence = TakeUntilError(GetSequenceOfData());
Assert.Equal(Enumerable.Range(0, indexThatWillThrow + 1), sequence);
}
[Fact]
public void should_get_sequence_given_normal_collection()
{
var sequence = new[] { 1, 2, 3 };
IEnumerable<int> result = TakeUntilError(sequence);
Assert.Equal(sequence, result);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using CSharpViaTest.Collections.Annotations;
using Xunit;
namespace CSharpViaTest.Collections._20_YieldPractices
{
[Medium]
public class TakeUntilCatchingAnException
{
readonly int indexThatWillThrow = new Random().Next(2, 10);
IEnumerable<int> GetSequenceOfData()
{
for (int i = 0;; ++i)
{
if (i == indexThatWillThrow) { throw new Exception("An exception is thrown"); }
yield return i;
}
}
#region Please modifies the code to pass the test
static IEnumerable<int> TakeUntilError(IEnumerable<int> sequence)
{
throw new NotImplementedException();
}
#endregion
[Fact]
public void should_get_sequence_until_an_exception_is_thrown()
{
IEnumerable<int> sequence = TakeUntilError(GetSequenceOfData());
Assert.Equal(Enumerable.Range(0, indexThatWillThrow), sequence);
}
[Fact]
public void should_get_sequence_given_normal_collection()
{
var sequence = new[] { 1, 2, 3 };
IEnumerable<int> result = TakeUntilError(sequence);
Assert.Equal(sequence, result);
}
}
}
|
Fix take until exception error.
|
[liuxia] Fix take until exception error.
|
C#
|
mit
|
AxeDotNet/AxePractice.CSharpViaTest
|
c4183bf0736e2083cf65ed7d69a329a4335b0ebe
|
aspnet-core/src/AbpCompanyName.AbpProjectName.Core/Identity/IdentityRegistrar.cs
|
aspnet-core/src/AbpCompanyName.AbpProjectName.Core/Identity/IdentityRegistrar.cs
|
using AbpCompanyName.AbpProjectName.Authorization;
using AbpCompanyName.AbpProjectName.Authorization.Roles;
using AbpCompanyName.AbpProjectName.Authorization.Users;
using AbpCompanyName.AbpProjectName.Editions;
using AbpCompanyName.AbpProjectName.MultiTenancy;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.DependencyInjection;
namespace AbpCompanyName.AbpProjectName.Identity
{
public static class IdentityRegistrar
{
public static void Register(IServiceCollection services)
{
services.AddLogging();
services.AddAbpIdentity<Tenant, User, Role>()
.AddAbpTenantManager<TenantManager>()
.AddAbpUserManager<UserManager>()
.AddAbpRoleManager<RoleManager>()
.AddAbpEditionManager<EditionManager>()
.AddAbpUserStore<UserStore>()
.AddAbpRoleStore<RoleStore>()
.AddAbpLogInManager<LogInManager>()
.AddAbpSignInManager<SignInManager>()
.AddAbpSecurityStampValidator<SecurityStampValidator>()
.AddAbpUserClaimsPrincipalFactory<UserClaimsPrincipalFactory>()
.AddDefaultTokenProviders();
}
}
}
|
using AbpCompanyName.AbpProjectName.Authorization;
using AbpCompanyName.AbpProjectName.Authorization.Roles;
using AbpCompanyName.AbpProjectName.Authorization.Users;
using AbpCompanyName.AbpProjectName.Editions;
using AbpCompanyName.AbpProjectName.MultiTenancy;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.DependencyInjection;
namespace AbpCompanyName.AbpProjectName.Identity
{
public static class IdentityRegistrar
{
public static void Register(IServiceCollection services)
{
services.AddLogging();
services.AddAbpIdentity<Tenant, User, Role>()
.AddAbpTenantManager<TenantManager>()
.AddAbpUserManager<UserManager>()
.AddAbpRoleManager<RoleManager>()
.AddAbpEditionManager<EditionManager>()
.AddAbpUserStore<UserStore>()
.AddAbpRoleStore<RoleStore>()
.AddAbpLogInManager<LogInManager>()
.AddAbpSignInManager<SignInManager>()
.AddAbpSecurityStampValidator<SecurityStampValidator>()
.AddAbpUserClaimsPrincipalFactory<UserClaimsPrincipalFactory>()
.AddPermissionChecker<PermissionChecker>()
.AddDefaultTokenProviders();
}
}
}
|
Add PermissionChecker for Identity registration.
|
Add PermissionChecker for Identity registration.
|
C#
|
mit
|
aspnetboilerplate/module-zero-core-template,aspnetboilerplate/module-zero-core-template,aspnetboilerplate/module-zero-core-template,aspnetboilerplate/module-zero-core-template,aspnetboilerplate/module-zero-core-template
|
f7e11873472235822e5136daa5994cfdda692156
|
src/WriteStdout.cs
|
src/WriteStdout.cs
|
using System;
namespace kgrep {
public class WriteStdout : IHandleOutput {
public void Write(string line) {
if (line.EndsWith("\n"))
Console.Write(line);
else
Console.Write(line);
}
public string Close() {
return "";
}
}
}
|
using System;
namespace kgrep {
public class WriteStdout : IHandleOutput {
public void Write(string line) {
Console.WriteLine(line);
}
public string Close() {
return "";
}
}
}
|
Use newline when writing to stdout.
|
Use newline when writing to stdout.
The unit tests do not test stdout. Need a regression suite to test stdout to catch these conditions.
|
C#
|
mit
|
kcummings/kgrep,kcummings/kgrep
|
5d92cbd9a65676cadb5c1f234f50c13b77f7b3cf
|
RestRPC.Framework/Messages/Outputs/WebReturn.cs
|
RestRPC.Framework/Messages/Outputs/WebReturn.cs
|
using Newtonsoft.Json;
using RestRPC.Framework.Messages.Inputs;
namespace RestRPC.Framework.Messages.Outputs
{
/// <summary>
/// This message is sent to server as a response to a request
/// </summary>
class WebReturn : WebOutput
{
const char HEADER_RETURN = 'r';
[JsonConstructor]
public WebReturn(object Data, WebInput input)
: base(HEADER_RETURN, new object[] { Data }, input.UID, input.CID)
{ }
}
}
|
using Newtonsoft.Json;
using RestRPC.Framework.Messages.Inputs;
namespace RestRPC.Framework.Messages.Outputs
{
/// <summary>
/// This message is sent to server as a response to a request
/// </summary>
class WebReturn : WebOutput
{
const char HEADER_RETURN = 'r';
[JsonConstructor]
public WebReturn(object Data, WebInput input)
: base(HEADER_RETURN, Data, input.UID, input.CID)
{ }
}
}
|
Return a single value in procedure return message
|
Return a single value in procedure return message
|
C#
|
mit
|
LibertyLocked/RestRPC,LibertyLocked/RestRPC,LibertyLocked/RestRPC,LibertyLocked/RestRPC
|
d752c11837cbff987d9e3b993645fa208f40e5a1
|
Alexa.NET/Response/Reprompt.cs
|
Alexa.NET/Response/Reprompt.cs
|
using Newtonsoft.Json;
namespace Alexa.NET.Response
{
public class Reprompt
{
public Reprompt()
{
}
public Reprompt(string text)
{
OutputSpeech = new PlainTextOutputSpeech {Text = text};
}
public Reprompt(Ssml.Speech speech)
{
OutputSpeech = new SsmlOutputSpeech {Ssml = speech.ToXml()};
}
[JsonProperty("outputSpeech", NullValueHandling=NullValueHandling.Ignore)]
public IOutputSpeech OutputSpeech { get; set; }
}
}
|
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Alexa.NET.Response
{
public class Reprompt
{
public Reprompt()
{
}
public Reprompt(string text)
{
OutputSpeech = new PlainTextOutputSpeech {Text = text};
}
public Reprompt(Ssml.Speech speech)
{
OutputSpeech = new SsmlOutputSpeech {Ssml = speech.ToXml()};
}
[JsonProperty("outputSpeech", NullValueHandling=NullValueHandling.Ignore)]
public IOutputSpeech OutputSpeech { get; set; }
[JsonProperty("directives", NullValueHandling = NullValueHandling.Ignore)]
public IList<IDirective> Directives { get; set; } = new List<IDirective>();
public bool ShouldSerializeDirectives()
{
return Directives.Count > 0;
}
}
}
|
Add directives to reprompt object
|
Add directives to reprompt object
|
C#
|
mit
|
stoiveyp/alexa-skills-dotnet,timheuer/alexa-skills-dotnet
|
645615f9730ab5d27f1759ea1f095b1963cc16bf
|
CouchTrafficClient/QueryBase.cs
|
CouchTrafficClient/QueryBase.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using Newtonsoft.Json;
using System.Windows.Forms;
using System.Dynamic;
namespace CouchTrafficClient
{
class QueryException : Exception
{
}
class QueryBase
{
public string Run()
{
return "Query Client Not Implemented";
}
public string Server { get { return "http://52.10.252.48:5984/traffic/"; } }
protected ExpandoObject Query(string designDocumentName, string viewName)
{
try
{
var url = Server + "_design/" + designDocumentName + "/_view/" + viewName;
using (WebClient wc = new WebClient())
{
wc.Encoding = System.Text.Encoding.UTF8;
wc.Headers["User-Agent"] = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E)";
string str = wc.DownloadString(url);
return JsonConvert.DeserializeObject<ExpandoObject>(str);
}
}
catch (Exception e)
{
MessageBox.Show("Error in WebClient: " + e.ToString());
throw new QueryException();
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using Newtonsoft.Json;
using System.Windows.Forms;
using System.Dynamic;
namespace CouchTrafficClient
{
class QueryException : Exception
{
}
class QueryBase
{
public string Run()
{
return "Query Client Not Implemented";
}
public string Server { get { return "http://52.10.252.48:5984/traffic/"; } }
protected ExpandoObject Query(string designDocumentName, string viewName, IList<object> keys = null)
{
try
{
var keyString = "";
if (keys != null)
{
keyString = string.Format("?keys={0}", Uri.EscapeDataString(JsonConvert.SerializeObject(keys)));
}
var url = Server + "_design/" + designDocumentName + "/_view/" + viewName + keyString;
using (WebClient wc = new WebClient())
{
wc.Encoding = System.Text.Encoding.UTF8;
wc.Headers["User-Agent"] = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E)";
string str = wc.DownloadString(url);
return JsonConvert.DeserializeObject<ExpandoObject>(str);
}
}
catch (Exception e)
{
MessageBox.Show("Error in WebClient: " + e.ToString());
throw new QueryException();
}
}
}
}
|
Add support for optional list of keys to limit view queries
|
Add support for optional list of keys to limit view queries
|
C#
|
apache-2.0
|
stacybird/CS510CouchDB,stacybird/CS510CouchDB,stacybird/CS510CouchDB
|
58d471a20ea1aa645a66dbcafaad5287cc932d0d
|
src/Glimpse.Common/Broker/DefaultMessageConverter.cs
|
src/Glimpse.Common/Broker/DefaultMessageConverter.cs
|
using Newtonsoft.Json;
using System;
using System.Globalization;
using System.IO;
using System.Text;
namespace Glimpse
{
public class DefaultMessageConverter : IMessageConverter
{
private readonly JsonSerializer _jsonSerializer;
public DefaultMessageConverter(JsonSerializer jsonSerializer)
{
_jsonSerializer = jsonSerializer;
}
public IMessageEnvelope ConvertMessage(IMessage message)
{
var newMessage = new MessageEnvelope();
newMessage.Type = message.GetType().FullName;
newMessage.Payload = Serialize(message);
return newMessage;
}
protected string Serialize(object data)
{
// Brought across from - https://github.com/JamesNK/Newtonsoft.Json/blob/master/Src/Newtonsoft.Json/JsonConvert.cs#L635
var stringBuilder = new StringBuilder(256);
using (var stringWriter = new StringWriter(stringBuilder, CultureInfo.InvariantCulture))
using (var jsonWriter = new JsonTextWriter(stringWriter) { Formatting = _jsonSerializer.Formatting })
{
_jsonSerializer.Serialize(jsonWriter, data, data.GetType());
return stringWriter.ToString();
}
}
}
}
|
using Newtonsoft.Json;
using System;
using System.Globalization;
using System.IO;
using System.Text;
namespace Glimpse
{
public class DefaultMessageConverter : IMessageConverter
{
private readonly JsonSerializer _jsonSerializer;
public DefaultMessageConverter(JsonSerializer jsonSerializer)
{
_jsonSerializer = jsonSerializer;
}
public IMessageEnvelope ConvertMessage(IMessage message)
{
var newMessage = new MessageEnvelope();
newMessage.Type = message.GetType().FullName;
newMessage.Payload = Serialize(message);
return newMessage;
}
protected string Serialize(object data)
{
// Brought across from - https://github.com/JamesNK/Newtonsoft.Json/blob/master/Src/Newtonsoft.Json/JsonConvert.cs#L635
var stringBuilder = new StringBuilder(256);
using (var stringWriter = new StringWriter(stringBuilder, CultureInfo.InvariantCulture))
using (var jsonWriter = new JsonTextWriter(stringWriter))
{
_jsonSerializer.Serialize(jsonWriter, data, data.GetType());
return stringWriter.ToString();
}
}
}
}
|
Remove unneeded property carry over for jsonwritter
|
Remove unneeded property carry over for jsonwritter
|
C#
|
mit
|
Glimpse/Glimpse.Prototype,pranavkm/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,Glimpse/Glimpse.Prototype,zanetdev/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,pranavkm/Glimpse.Prototype,pranavkm/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,pranavkm/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype
|
386818b87093aef876ff37077d7594d0238d77b2
|
Scripting/Script/Application.cs
|
Scripting/Script/Application.cs
|
using System.Windows.Forms;
namespace IronAHK.Scripting
{
partial class Script
{
public static void Init()
{
Application.EnableVisualStyles();
}
public static void Run()
{
Application.Run();
}
}
}
|
using System;
using System.Windows.Forms;
namespace IronAHK.Scripting
{
partial class Script
{
public static void Init()
{
if (Environment.OSVersion.Platform == PlatformID.Unix)
Environment.SetEnvironmentVariable("MONO_VISUAL_STYLES", "gtkplus");
Application.EnableVisualStyles();
}
public static void Run()
{
Application.Run();
}
}
}
|
Enable GTK theming on Mono.
|
Enable GTK theming on Mono.
|
C#
|
bsd-2-clause
|
yatsek/IronAHK,polyethene/IronAHK,michaltakac/IronAHK,polyethene/IronAHK,yatsek/IronAHK,michaltakac/IronAHK,yatsek/IronAHK,yatsek/IronAHK,michaltakac/IronAHK,yatsek/IronAHK,polyethene/IronAHK,michaltakac/IronAHK,michaltakac/IronAHK,polyethene/IronAHK
|
54ea5b5eefa896a91df29f32f693b7873c3fbf35
|
src/Storage/Atom.cs
|
src/Storage/Atom.cs
|
using System;
namespace Scheme.Storage
{
internal abstract class Atom : Object
{
public static Atom Parse(string input)
{
double number;
bool isNumber = Double.TryParse(input, out number);
if (isNumber)
return new Number(number);
bool isString = input[0] == '"' && input[input.Length - 1] == '"';
if (isString)
return new String(input.Substring(1, input.Length - 2));
bool isValidSymbol = true;
// TODO: validate.
if (isValidSymbol)
return Symbol.FromString(input);
throw new FormatException();
}
}
}
|
using System;
namespace Scheme.Storage
{
internal abstract class Atom : Object
{
public static Atom Parse(string input)
{
double number;
bool isNumber = Double.TryParse(input, out number);
if (isNumber)
return new Number(number);
bool isString = input.Length > 2 && input[0] == '"' && input[input.Length - 1] == '"';
if (isString)
return new String(input.Substring(1, input.Length - 2));
bool isValidSymbol = true;
// TODO: validate.
if (isValidSymbol)
return Symbol.FromString(input);
throw new FormatException();
}
}
}
|
Fix a bug with parsing.
|
Fix a bug with parsing.
|
C#
|
apache-2.0
|
phamhathanh/scheme-net,phamhathanh/scheme
|
f5c27d99a4f3a3d9255a7cebe554703a2612dff4
|
osu.Game/IPC/BeatmapImporter.cs
|
osu.Game/IPC/BeatmapImporter.cs
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Diagnostics;
using System.Threading.Tasks;
using osu.Framework.Platform;
using osu.Game.Database;
namespace osu.Game.IPC
{
public class BeatmapImporter
{
private IpcChannel<BeatmapImportMessage> channel;
private BeatmapDatabase beatmaps;
public BeatmapImporter(GameHost host, BeatmapDatabase beatmaps = null)
{
this.beatmaps = beatmaps;
channel = new IpcChannel<BeatmapImportMessage>(host);
channel.MessageReceived += messageReceived;
}
public async Task ImportAsync(string path)
{
if (beatmaps != null)
beatmaps.Import(path);
else
{
await channel.SendMessageAsync(new BeatmapImportMessage { Path = path });
}
}
private void messageReceived(BeatmapImportMessage msg)
{
Debug.Assert(beatmaps != null);
ImportAsync(msg.Path);
}
}
public class BeatmapImportMessage
{
public string Path;
}
}
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Diagnostics;
using System.Threading.Tasks;
using osu.Framework.Logging;
using osu.Framework.Platform;
using osu.Game.Database;
namespace osu.Game.IPC
{
public class BeatmapImporter
{
private IpcChannel<BeatmapImportMessage> channel;
private BeatmapDatabase beatmaps;
public BeatmapImporter(GameHost host, BeatmapDatabase beatmaps = null)
{
this.beatmaps = beatmaps;
channel = new IpcChannel<BeatmapImportMessage>(host);
channel.MessageReceived += messageReceived;
}
public async Task ImportAsync(string path)
{
if (beatmaps != null)
beatmaps.Import(path);
else
{
await channel.SendMessageAsync(new BeatmapImportMessage { Path = path });
}
}
private void messageReceived(BeatmapImportMessage msg)
{
Debug.Assert(beatmaps != null);
ImportAsync(msg.Path).ContinueWith(t => Logger.Error(t.Exception, @"error during async import"), TaskContinuationOptions.OnlyOnFaulted);
}
}
public class BeatmapImportMessage
{
public string Path;
}
}
|
Add error handling to import process (resolves await warning).
|
Add error handling to import process (resolves await warning).
|
C#
|
mit
|
naoey/osu,UselessToucan/osu,2yangk23/osu,peppy/osu,peppy/osu,NeoAdonis/osu,RedNesto/osu,ppy/osu,smoogipoo/osu,tacchinotacchi/osu,ZLima12/osu,naoey/osu,Frontear/osuKyzer,ppy/osu,NeoAdonis/osu,peppy/osu,UselessToucan/osu,DrabWeb/osu,2yangk23/osu,johnneijzen/osu,EVAST9919/osu,peppy/osu-new,Nabile-Rahmani/osu,nyaamara/osu,EVAST9919/osu,naoey/osu,johnneijzen/osu,smoogipoo/osu,DrabWeb/osu,Drezi126/osu,UselessToucan/osu,osu-RP/osu-RP,NeoAdonis/osu,smoogipooo/osu,ppy/osu,DrabWeb/osu,ZLima12/osu,Damnae/osu,smoogipoo/osu
|
8d488a5dae7934c822351940a12befc7ffa0f548
|
Mos6510/Register.cs
|
Mos6510/Register.cs
|
using System;
using System.Collections;
namespace Mos6510
{
public class Register
{
public Register(int numberOfBits)
{
bits = new BitArray(numberOfBits);
}
public int Length
{
get { return bits.Length; }
}
public int GetValue()
{
return ToInt();
}
public void SetValue(int value)
{
FromInt(value);
}
private int ToInt()
{
int[] array = new int[1];
bits.CopyTo(array, 0);
return array[0];
}
private void FromInt(int value)
{
var inputBits = new BitArray(new[]{ value });
for (var i = 0; i < bits.Length; ++i)
bits[i] = inputBits[i];
}
private BitArray bits;
}
}
|
using System;
using System.Collections;
namespace Mos6510
{
public class Register
{
private BitArray bits;
public Register(int numberOfBits)
{
bits = new BitArray(numberOfBits);
}
public int Length
{
get { return bits.Length; }
}
public int GetValue()
{
return ToInt();
}
public void SetValue(int value)
{
FromInt(value);
}
private int ToInt()
{
int[] array = new int[1];
bits.CopyTo(array, 0);
return array[0];
}
private void FromInt(int value)
{
var inputBits = new BitArray(new[]{ value });
for (var i = 0; i < bits.Length; ++i)
bits[i] = inputBits[i];
}
}
}
|
Move the private member to the top of the class
|
Move the private member to the top of the class
|
C#
|
mit
|
joshpeterson/mos,joshpeterson/mos,joshpeterson/mos
|
d811a70f4b42cb638a6cc6be169acfb0f99275f9
|
osu.Game/Screens/Edit/PromptForSaveDialog.cs
|
osu.Game/Screens/Edit/PromptForSaveDialog.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Graphics.Sprites;
using osu.Game.Overlays.Dialog;
namespace osu.Game.Screens.Edit
{
public class PromptForSaveDialog : PopupDialog
{
public PromptForSaveDialog(Action exit, Action saveAndExit, Action cancel)
{
HeaderText = "Did you want to save your changes?";
Icon = FontAwesome.Regular.Save;
Buttons = new PopupDialogButton[]
{
new PopupDialogCancelButton
{
Text = @"Save my masterpiece!",
Action = saveAndExit
},
new PopupDialogOkButton
{
Text = @"Forget all changes",
Action = exit
},
new PopupDialogCancelButton
{
Text = @"Oops, continue editing",
Action = cancel
},
};
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Graphics.Sprites;
using osu.Game.Overlays.Dialog;
namespace osu.Game.Screens.Edit
{
public class PromptForSaveDialog : PopupDialog
{
public PromptForSaveDialog(Action exit, Action saveAndExit, Action cancel)
{
HeaderText = "Did you want to save your changes?";
Icon = FontAwesome.Regular.Save;
Buttons = new PopupDialogButton[]
{
new PopupDialogOkButton
{
Text = @"Save my masterpiece!",
Action = saveAndExit
},
new PopupDialogDangerousButton
{
Text = @"Forget all changes",
Action = exit
},
new PopupDialogCancelButton
{
Text = @"Oops, continue editing",
Action = cancel
},
};
}
}
}
|
Change button types on editor exit dialog to match purpose
|
Change button types on editor exit dialog to match purpose
Addresses https://github.com/ppy/osu/discussions/17363.
|
C#
|
mit
|
ppy/osu,peppy/osu,peppy/osu,NeoAdonis/osu,peppy/osu,ppy/osu,ppy/osu,NeoAdonis/osu,NeoAdonis/osu
|
d64a0e8aaa39aaa6099a71d9fc5160b9486d1953
|
src/Orchard.Web/Modules/Orchard.MultiTenancy/Extensions/UrlHelperExtensions.cs
|
src/Orchard.Web/Modules/Orchard.MultiTenancy/Extensions/UrlHelperExtensions.cs
|
using System.Web.Mvc;
using Orchard.Environment.Configuration;
namespace Orchard.MultiTenancy.Extensions {
public static class UrlHelperExtensions {
public static string Tenant(this UrlHelper urlHelper, ShellSettings tenantShellSettings) {
//info: (heskew) might not keep the port insertion around beyond...
var port = string.Empty;
string host = urlHelper.RequestContext.HttpContext.Request.Headers["Host"];
if(host.Contains(":"))
port = host.Substring(host.IndexOf(":"));
return string.Format(
"http://{0}/{1}",
!string.IsNullOrEmpty(tenantShellSettings.RequestUrlHost)
? tenantShellSettings.RequestUrlHost + port : host,
tenantShellSettings.RequestUrlPrefix);
}
}
}
|
using System.Web.Mvc;
using Orchard.Environment.Configuration;
namespace Orchard.MultiTenancy.Extensions {
public static class UrlHelperExtensions {
public static string Tenant(this UrlHelper urlHelper, ShellSettings tenantShellSettings) {
//info: (heskew) might not keep the port/vdir insertion around beyond...
var port = string.Empty;
string host = urlHelper.RequestContext.HttpContext.Request.Headers["Host"];
if (host.Contains(":"))
port = host.Substring(host.IndexOf(":"));
var result = string.Format("http://{0}",
!string.IsNullOrEmpty(tenantShellSettings.RequestUrlHost)
? tenantShellSettings.RequestUrlHost + port : host);
if (!string.IsNullOrEmpty(tenantShellSettings.RequestUrlPrefix))
result += "/" + tenantShellSettings.RequestUrlPrefix;
if (!string.IsNullOrEmpty(urlHelper.RequestContext.HttpContext.Request.ApplicationPath))
result += urlHelper.RequestContext.HttpContext.Request.ApplicationPath;
return result;
}
}
}
|
Add "ApplicationPath" in tenant URL
|
Add "ApplicationPath" in tenant URL
--HG--
branch : dev
|
C#
|
bsd-3-clause
|
salarvand/orchard,xiaobudian/Orchard,bedegaming-aleksej/Orchard,openbizgit/Orchard,m2cms/Orchard,salarvand/orchard,bigfont/orchard-cms-modules-and-themes,phillipsj/Orchard,omidnasri/Orchard,fassetar/Orchard,JRKelso/Orchard,OrchardCMS/Orchard-Harvest-Website,dburriss/Orchard,enspiral-dev-academy/Orchard,LaserSrl/Orchard,mgrowan/Orchard,oxwanawxo/Orchard,ericschultz/outercurve-orchard,JRKelso/Orchard,vairam-svs/Orchard,jimasp/Orchard,AndreVolksdorf/Orchard,oxwanawxo/Orchard,mgrowan/Orchard,andyshao/Orchard,Sylapse/Orchard.HttpAuthSample,OrchardCMS/Orchard,fassetar/Orchard,AEdmunds/beautiful-springtime,IDeliverable/Orchard,MpDzik/Orchard,TaiAivaras/Orchard,neTp9c/Orchard,AdvantageCS/Orchard,kouweizhong/Orchard,Ermesx/Orchard,sebastienros/msc,qt1/orchard4ibn,spraiin/Orchard,hbulzy/Orchard,johnnyqian/Orchard,kouweizhong/Orchard,dcinzona/Orchard,cooclsee/Orchard,openbizgit/Orchard,enspiral-dev-academy/Orchard,grapto/Orchard.CloudBust,sfmskywalker/Orchard,neTp9c/Orchard,TalaveraTechnologySolutions/Orchard,yonglehou/Orchard,marcoaoteixeira/Orchard,asabbott/chicagodevnet-website,jchenga/Orchard,jagraz/Orchard,Praggie/Orchard,jaraco/orchard,hhland/Orchard,hannan-azam/Orchard,bigfont/orchard-cms-modules-and-themes,kouweizhong/Orchard,yersans/Orchard,kgacova/Orchard,asabbott/chicagodevnet-website,vairam-svs/Orchard,Fogolan/OrchardForWork,TaiAivaras/Orchard,xkproject/Orchard,escofieldnaxos/Orchard,SouleDesigns/SouleDesigns.Orchard,RoyalVeterinaryCollege/Orchard,omidnasri/Orchard,huoxudong125/Orchard,OrchardCMS/Orchard-Harvest-Website,li0803/Orchard,TalaveraTechnologySolutions/Orchard,vairam-svs/Orchard,salarvand/orchard,jtkech/Orchard,dcinzona/Orchard,Anton-Am/Orchard,enspiral-dev-academy/Orchard,smartnet-developers/Orchard,alejandroaldana/Orchard,austinsc/Orchard,armanforghani/Orchard,hhland/Orchard,Fogolan/OrchardForWork,jersiovic/Orchard,SzymonSel/Orchard,dcinzona/Orchard-Harvest-Website,rtpHarry/Orchard,dozoft/Orchard,AndreVolksdorf/Orchard,sebastienros/msc,Ermesx/Orchard,luchaoshuai/Orchard,emretiryaki/Orchard,jagraz/Orchard,openbizgit/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,hhland/Orchard,salarvand/orchard,salarvand/Portal,marcoaoteixeira/Orchard,vairam-svs/Orchard,planetClaire/Orchard-LETS,asabbott/chicagodevnet-website,salarvand/Portal,alejandroaldana/Orchard,yersans/Orchard,fassetar/Orchard,hbulzy/Orchard,hannan-azam/Orchard,jagraz/Orchard,vard0/orchard.tan,vard0/orchard.tan,gcsuk/Orchard,xkproject/Orchard,vairam-svs/Orchard,Lombiq/Orchard,hannan-azam/Orchard,SeyDutch/Airbrush,MetSystem/Orchard,planetClaire/Orchard-LETS,jtkech/Orchard,NIKASoftwareDevs/Orchard,Serlead/Orchard,kgacova/Orchard,SzymonSel/Orchard,dburriss/Orchard,brownjordaninternational/OrchardCMS,dmitry-urenev/extended-orchard-cms-v10.1,harmony7/Orchard,NIKASoftwareDevs/Orchard,OrchardCMS/Orchard-Harvest-Website,tobydodds/folklife,phillipsj/Orchard,neTp9c/Orchard,Lombiq/Orchard,qt1/orchard4ibn,dcinzona/Orchard-Harvest-Website,abhishekluv/Orchard,armanforghani/Orchard,salarvand/Portal,MetSystem/Orchard,jersiovic/Orchard,vard0/orchard.tan,patricmutwiri/Orchard,salarvand/Portal,fassetar/Orchard,escofieldnaxos/Orchard,stormleoxia/Orchard,OrchardCMS/Orchard-Harvest-Website,Serlead/Orchard,Anton-Am/Orchard,phillipsj/Orchard,fortunearterial/Orchard,RoyalVeterinaryCollege/Orchard,SzymonSel/Orchard,ehe888/Orchard,jchenga/Orchard,Cphusion/Orchard,caoxk/orchard,IDeliverable/Orchard,Praggie/Orchard,SeyDutch/Airbrush,harmony7/Orchard,Dolphinsimon/Orchard,Inner89/Orchard,ericschultz/outercurve-orchard,angelapper/Orchard,jtkech/Orchard,johnnyqian/Orchard,huoxudong125/Orchard,angelapper/Orchard,Inner89/Orchard,kouweizhong/Orchard,OrchardCMS/Orchard,Fogolan/OrchardForWork,jersiovic/Orchard,arminkarimi/Orchard,geertdoornbos/Orchard,grapto/Orchard.CloudBust,Codinlab/Orchard,rtpHarry/Orchard,TaiAivaras/Orchard,ehe888/Orchard,DonnotRain/Orchard,bigfont/orchard-cms-modules-and-themes,rtpHarry/Orchard,jersiovic/Orchard,harmony7/Orchard,Morgma/valleyviewknolls,Praggie/Orchard,xiaobudian/Orchard,phillipsj/Orchard,jaraco/orchard,patricmutwiri/Orchard,RoyalVeterinaryCollege/Orchard,fortunearterial/Orchard,yonglehou/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,escofieldnaxos/Orchard,OrchardCMS/Orchard-Harvest-Website,Ermesx/Orchard,cryogen/orchard,ericschultz/outercurve-orchard,omidnasri/Orchard,jerryshi2007/Orchard,oxwanawxo/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,Lombiq/Orchard,MetSystem/Orchard,dcinzona/Orchard-Harvest-Website,AEdmunds/beautiful-springtime,dozoft/Orchard,dozoft/Orchard,jerryshi2007/Orchard,LaserSrl/Orchard,dcinzona/Orchard,spraiin/Orchard,abhishekluv/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,li0803/Orchard,AdvantageCS/Orchard,IDeliverable/Orchard,grapto/Orchard.CloudBust,gcsuk/Orchard,aaronamm/Orchard,KeithRaven/Orchard,kgacova/Orchard,fortunearterial/Orchard,luchaoshuai/Orchard,mvarblow/Orchard,jagraz/Orchard,omidnasri/Orchard,MpDzik/Orchard,vard0/orchard.tan,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,bedegaming-aleksej/Orchard,Sylapse/Orchard.HttpAuthSample,jerryshi2007/Orchard,austinsc/Orchard,patricmutwiri/Orchard,Morgma/valleyviewknolls,Cphusion/Orchard,vard0/orchard.tan,cooclsee/Orchard,sfmskywalker/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,KeithRaven/Orchard,vard0/orchard.tan,bedegaming-aleksej/Orchard,sebastienros/msc,caoxk/orchard,abhishekluv/Orchard,arminkarimi/Orchard,dburriss/Orchard,marcoaoteixeira/Orchard,aaronamm/Orchard,Cphusion/Orchard,mgrowan/Orchard,sfmskywalker/Orchard,johnnyqian/Orchard,Dolphinsimon/Orchard,Fogolan/OrchardForWork,Cphusion/Orchard,m2cms/Orchard,huoxudong125/Orchard,jimasp/Orchard,OrchardCMS/Orchard,Anton-Am/Orchard,TaiAivaras/Orchard,sfmskywalker/Orchard,yersans/Orchard,armanforghani/Orchard,TaiAivaras/Orchard,huoxudong125/Orchard,gcsuk/Orchard,spraiin/Orchard,escofieldnaxos/Orchard,bigfont/orchard-continuous-integration-demo,Lombiq/Orchard,smartnet-developers/Orchard,Sylapse/Orchard.HttpAuthSample,Lombiq/Orchard,mgrowan/Orchard,emretiryaki/Orchard,andyshao/Orchard,MetSystem/Orchard,JRKelso/Orchard,sfmskywalker/Orchard,cooclsee/Orchard,harmony7/Orchard,Inner89/Orchard,Morgma/valleyviewknolls,oxwanawxo/Orchard,brownjordaninternational/OrchardCMS,qt1/orchard4ibn,xiaobudian/Orchard,sfmskywalker/Orchard,cooclsee/Orchard,qt1/Orchard,dcinzona/Orchard,OrchardCMS/Orchard-Harvest-Website,gcsuk/Orchard,yonglehou/Orchard,smartnet-developers/Orchard,NIKASoftwareDevs/Orchard,planetClaire/Orchard-LETS,Ermesx/Orchard,JRKelso/Orchard,austinsc/Orchard,luchaoshuai/Orchard,spraiin/Orchard,MpDzik/Orchard,ehe888/Orchard,NIKASoftwareDevs/Orchard,andyshao/Orchard,m2cms/Orchard,jerryshi2007/Orchard,MpDzik/Orchard,OrchardCMS/Orchard,harmony7/Orchard,jtkech/Orchard,xkproject/Orchard,jimasp/Orchard,dcinzona/Orchard-Harvest-Website,Anton-Am/Orchard,JRKelso/Orchard,LaserSrl/Orchard,sebastienros/msc,infofromca/Orchard,li0803/Orchard,openbizgit/Orchard,fortunearterial/Orchard,tobydodds/folklife,TalaveraTechnologySolutions/Orchard,bigfont/orchard-continuous-integration-demo,Praggie/Orchard,hbulzy/Orchard,arminkarimi/Orchard,xkproject/Orchard,sebastienros/msc,stormleoxia/Orchard,escofieldnaxos/Orchard,cryogen/orchard,luchaoshuai/Orchard,smartnet-developers/Orchard,IDeliverable/Orchard,jimasp/Orchard,dcinzona/Orchard-Harvest-Website,jchenga/Orchard,AEdmunds/beautiful-springtime,Codinlab/Orchard,fassetar/Orchard,bigfont/orchard-continuous-integration-demo,MetSystem/Orchard,tobydodds/folklife,angelapper/Orchard,johnnyqian/Orchard,dcinzona/Orchard,dburriss/Orchard,johnnyqian/Orchard,DonnotRain/Orchard,cooclsee/Orchard,omidnasri/Orchard,yersans/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,jaraco/orchard,Serlead/Orchard,geertdoornbos/Orchard,armanforghani/Orchard,KeithRaven/Orchard,hhland/Orchard,yonglehou/Orchard,xiaobudian/Orchard,mvarblow/Orchard,SzymonSel/Orchard,stormleoxia/Orchard,cryogen/orchard,TalaveraTechnologySolutions/Orchard,jerryshi2007/Orchard,Sylapse/Orchard.HttpAuthSample,dmitry-urenev/extended-orchard-cms-v10.1,Codinlab/Orchard,grapto/Orchard.CloudBust,infofromca/Orchard,luchaoshuai/Orchard,Dolphinsimon/Orchard,grapto/Orchard.CloudBust,qt1/orchard4ibn,qt1/Orchard,Sylapse/Orchard.HttpAuthSample,ehe888/Orchard,SeyDutch/Airbrush,Inner89/Orchard,omidnasri/Orchard,jchenga/Orchard,DonnotRain/Orchard,SouleDesigns/SouleDesigns.Orchard,RoyalVeterinaryCollege/Orchard,andyshao/Orchard,kgacova/Orchard,jtkech/Orchard,spraiin/Orchard,geertdoornbos/Orchard,AndreVolksdorf/Orchard,Fogolan/OrchardForWork,brownjordaninternational/OrchardCMS,TalaveraTechnologySolutions/Orchard,omidnasri/Orchard,LaserSrl/Orchard,jimasp/Orchard,emretiryaki/Orchard,rtpHarry/Orchard,AdvantageCS/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,salarvand/Portal,AEdmunds/beautiful-springtime,tobydodds/folklife,huoxudong125/Orchard,bedegaming-aleksej/Orchard,KeithRaven/Orchard,Praggie/Orchard,xiaobudian/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,smartnet-developers/Orchard,SeyDutch/Airbrush,Serlead/Orchard,gcsuk/Orchard,sfmskywalker/Orchard,Morgma/valleyviewknolls,infofromca/Orchard,dozoft/Orchard,dcinzona/Orchard-Harvest-Website,li0803/Orchard,li0803/Orchard,qt1/orchard4ibn,oxwanawxo/Orchard,bigfont/orchard-cms-modules-and-themes,emretiryaki/Orchard,m2cms/Orchard,bigfont/orchard-continuous-integration-demo,SeyDutch/Airbrush,abhishekluv/Orchard,angelapper/Orchard,jaraco/orchard,geertdoornbos/Orchard,AndreVolksdorf/Orchard,mgrowan/Orchard,Inner89/Orchard,phillipsj/Orchard,brownjordaninternational/OrchardCMS,patricmutwiri/Orchard,austinsc/Orchard,aaronamm/Orchard,salarvand/orchard,marcoaoteixeira/Orchard,AndreVolksdorf/Orchard,Serlead/Orchard,Morgma/valleyviewknolls,armanforghani/Orchard,SouleDesigns/SouleDesigns.Orchard,caoxk/orchard,Ermesx/Orchard,abhishekluv/Orchard,enspiral-dev-academy/Orchard,SzymonSel/Orchard,jersiovic/Orchard,bigfont/orchard-cms-modules-and-themes,hannan-azam/Orchard,xkproject/Orchard,TalaveraTechnologySolutions/Orchard,KeithRaven/Orchard,enspiral-dev-academy/Orchard,arminkarimi/Orchard,ericschultz/outercurve-orchard,hhland/Orchard,TalaveraTechnologySolutions/Orchard,yersans/Orchard,stormleoxia/Orchard,qt1/orchard4ibn,planetClaire/Orchard-LETS,kouweizhong/Orchard,AdvantageCS/Orchard,infofromca/Orchard,m2cms/Orchard,MpDzik/Orchard,ehe888/Orchard,alejandroaldana/Orchard,alejandroaldana/Orchard,mvarblow/Orchard,grapto/Orchard.CloudBust,aaronamm/Orchard,neTp9c/Orchard,MpDzik/Orchard,qt1/Orchard,Dolphinsimon/Orchard,arminkarimi/Orchard,DonnotRain/Orchard,Codinlab/Orchard,planetClaire/Orchard-LETS,marcoaoteixeira/Orchard,omidnasri/Orchard,alejandroaldana/Orchard,andyshao/Orchard,qt1/Orchard,RoyalVeterinaryCollege/Orchard,infofromca/Orchard,hannan-azam/Orchard,aaronamm/Orchard,OrchardCMS/Orchard,qt1/Orchard,NIKASoftwareDevs/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,jagraz/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,abhishekluv/Orchard,geertdoornbos/Orchard,mvarblow/Orchard,mvarblow/Orchard,SouleDesigns/SouleDesigns.Orchard,brownjordaninternational/OrchardCMS,Dolphinsimon/Orchard,neTp9c/Orchard,kgacova/Orchard,austinsc/Orchard,asabbott/chicagodevnet-website,IDeliverable/Orchard,Anton-Am/Orchard,hbulzy/Orchard,rtpHarry/Orchard,Cphusion/Orchard,jchenga/Orchard,TalaveraTechnologySolutions/Orchard,tobydodds/folklife,Codinlab/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,patricmutwiri/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,bedegaming-aleksej/Orchard,LaserSrl/Orchard,DonnotRain/Orchard,omidnasri/Orchard,hbulzy/Orchard,cryogen/orchard,dburriss/Orchard,dozoft/Orchard,stormleoxia/Orchard,caoxk/orchard,fortunearterial/Orchard,SouleDesigns/SouleDesigns.Orchard,openbizgit/Orchard,angelapper/Orchard,tobydodds/folklife,yonglehou/Orchard,AdvantageCS/Orchard,sfmskywalker/Orchard,emretiryaki/Orchard
|
86b1f21f8d5bca1e5d340433e42d49fdf85d9e54
|
Kudu.SignalR/Hubs/Deployment.cs
|
Kudu.SignalR/Hubs/Deployment.cs
|
using System.Collections.Generic;
using System.Linq;
using Kudu.Core.Deployment;
using Kudu.SignalR.ViewModels;
using SignalR.Hubs;
namespace Kudu.SignalR.Hubs
{
public class Deployment : Hub
{
private readonly IDeploymentManager _deploymentManager;
public Deployment(IDeploymentManager deploymentManager)
{
_deploymentManager = deploymentManager;
}
public IEnumerable<DeployResultViewModel> GetDeployments()
{
string active = _deploymentManager.ActiveDeploymentId;
Caller.id = active;
return _deploymentManager.GetResults().Select(d => new DeployResultViewModel(d)
{
Active = active == d.Id
});
}
public IEnumerable<LogEntryViewModel> GetDeployLog(string id)
{
return from entry in _deploymentManager.GetLogEntries(id)
select new LogEntryViewModel(entry);
}
public void Deploy(string id)
{
_deploymentManager.Deploy(id);
}
}
}
|
using System.Collections.Generic;
using System.Linq;
using Kudu.Core.Deployment;
using Kudu.SignalR.ViewModels;
using SignalR.Hubs;
namespace Kudu.SignalR.Hubs
{
public class Deployment : Hub
{
private readonly IDeploymentManager _deploymentManager;
public Deployment(IDeploymentManager deploymentManager)
{
_deploymentManager = deploymentManager;
}
public IEnumerable<DeployResultViewModel> GetDeployments()
{
string active = _deploymentManager.ActiveDeploymentId;
Caller.id = active;
return _deploymentManager.GetResults()
.OrderByDescending(d => d.DeployStartTime)
.Select(d => new DeployResultViewModel(d)
{
Active = active == d.Id
});
}
public IEnumerable<LogEntryViewModel> GetDeployLog(string id)
{
return from entry in _deploymentManager.GetLogEntries(id)
select new LogEntryViewModel(entry);
}
public void Deploy(string id)
{
_deploymentManager.Deploy(id);
}
}
}
|
Order the list of deployments by start time.
|
Order the list of deployments by start time.
|
C#
|
apache-2.0
|
uQr/kudu,badescuga/kudu,barnyp/kudu,mauricionr/kudu,juvchan/kudu,badescuga/kudu,barnyp/kudu,EricSten-MSFT/kudu,mauricionr/kudu,shibayan/kudu,oliver-feng/kudu,shrimpy/kudu,projectkudu/kudu,shibayan/kudu,puneet-gupta/kudu,oliver-feng/kudu,juoni/kudu,puneet-gupta/kudu,shrimpy/kudu,YOTOV-LIMITED/kudu,mauricionr/kudu,kenegozi/kudu,bbauya/kudu,oliver-feng/kudu,WeAreMammoth/kudu-obsolete,juoni/kudu,badescuga/kudu,EricSten-MSFT/kudu,shanselman/kudu,badescuga/kudu,duncansmart/kudu,bbauya/kudu,sitereactor/kudu,shrimpy/kudu,kenegozi/kudu,oliver-feng/kudu,shibayan/kudu,WeAreMammoth/kudu-obsolete,kali786516/kudu,juvchan/kudu,YOTOV-LIMITED/kudu,shanselman/kudu,shibayan/kudu,chrisrpatterson/kudu,duncansmart/kudu,bbauya/kudu,dev-enthusiast/kudu,MavenRain/kudu,shrimpy/kudu,juvchan/kudu,sitereactor/kudu,uQr/kudu,barnyp/kudu,barnyp/kudu,dev-enthusiast/kudu,WeAreMammoth/kudu-obsolete,projectkudu/kudu,mauricionr/kudu,uQr/kudu,juoni/kudu,duncansmart/kudu,projectkudu/kudu,bbauya/kudu,kenegozi/kudu,dev-enthusiast/kudu,sitereactor/kudu,kali786516/kudu,projectkudu/kudu,shanselman/kudu,shibayan/kudu,puneet-gupta/kudu,chrisrpatterson/kudu,puneet-gupta/kudu,chrisrpatterson/kudu,MavenRain/kudu,MavenRain/kudu,juvchan/kudu,EricSten-MSFT/kudu,kali786516/kudu,kali786516/kudu,YOTOV-LIMITED/kudu,puneet-gupta/kudu,uQr/kudu,sitereactor/kudu,YOTOV-LIMITED/kudu,juoni/kudu,duncansmart/kudu,badescuga/kudu,EricSten-MSFT/kudu,MavenRain/kudu,sitereactor/kudu,chrisrpatterson/kudu,projectkudu/kudu,juvchan/kudu,kenegozi/kudu,EricSten-MSFT/kudu,dev-enthusiast/kudu
|
b000d25657f5020c63503cad9042fe73de2e80f2
|
HearthDb.EnumsGenerator/Program.cs
|
HearthDb.EnumsGenerator/Program.cs
|
using System;
using System.Linq;
using System.Net;
using System.IO;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Formatting;
using Microsoft.CodeAnalysis.MSBuild;
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
namespace HearthDb.EnumsGenerator
{
internal class Program
{
private const string File = "../../../HearthDb/Enums/Enums.cs";
static void Main()
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
string enums;
using(var wc = new WebClient())
enums = wc.DownloadString("https://api.hearthstonejson.com/v1/enums.cs");
var header = ParseLeadingTrivia(@"/* THIS FILE WAS GENERATED BY HearthDb.EnumsGenerator. DO NOT EDIT. */" + Environment.NewLine + Environment.NewLine);
var members = ParseCompilationUnit(enums).Members;
var first = members.First().WithLeadingTrivia(header);
var @namespace = NamespaceDeclaration(IdentifierName("HearthDb.Enums")).AddMembers(new [] {first}.Concat(members.Skip(1)).ToArray());
var root = Formatter.Format(@namespace, MSBuildWorkspace.Create());
using(var sr = new StreamWriter(File))
sr.Write(root.ToString());
}
}
}
|
using System;
using System.Linq;
using System.Net;
using System.IO;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Formatting;
using Microsoft.CodeAnalysis.MSBuild;
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
namespace HearthDb.EnumsGenerator
{
internal class Program
{
private const string File = "../../../HearthDb/Enums/Enums.cs";
static void Main()
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
string enums;
using(var wc = new WebClient())
enums = wc.DownloadString("https://api.hearthstonejson.com/v1/enums.cs?" + DateTime.Now.Ticks);
var header = ParseLeadingTrivia(@"/* THIS FILE WAS GENERATED BY HearthDb.EnumsGenerator. DO NOT EDIT. */" + Environment.NewLine + Environment.NewLine);
var members = ParseCompilationUnit(enums).Members;
var first = members.First().WithLeadingTrivia(header);
var @namespace = NamespaceDeclaration(IdentifierName("HearthDb.Enums")).AddMembers(new [] {first}.Concat(members.Skip(1)).ToArray());
var root = Formatter.Format(@namespace, MSBuildWorkspace.Create());
using(var sr = new StreamWriter(File))
sr.Write(root.ToString());
}
}
}
|
Add random param to enums url
|
Add random param to enums url
|
C#
|
mit
|
HearthSim/HearthDb
|
5296bc73791120900f0e3a26c67391868b2f523a
|
SolutionVersion.cs
|
SolutionVersion.cs
|
using System.Reflection;
[assembly: AssemblyVersion("2.10.7.0")]
[assembly: AssemblyFileVersion("2.10.7.0")]
[assembly: AssemblyInformationalVersion("2.10.7")]
|
using System.Reflection;
[assembly: AssemblyVersion("2.11.0.0")]
[assembly: AssemblyFileVersion("2.11.0.0")]
[assembly: AssemblyInformationalVersion("2.11.0")]
|
Update version number to 2.11.0.
|
Update version number to 2.11.0.
Add ability to disable SQLite logging through the 'disableSqliteLogging' app setting.
|
C#
|
mit
|
Faithlife/System.Data.SQLite,Faithlife/System.Data.SQLite
|
dc807bc67dc49ce7d1f4345d4d67eff0c16573d6
|
Messaging/Plugin.Messaging.iOSUnified/PhoneCallTask.cs
|
Messaging/Plugin.Messaging.iOSUnified/PhoneCallTask.cs
|
using System;
#if __UNIFIED__
using Foundation;
using UIKit;
#else
using MonoTouch.Foundation;
using MonoTouch.UIKit;
#endif
namespace Plugin.Messaging
{
internal class PhoneCallTask : IPhoneCallTask
{
public PhoneCallTask()
{
}
#region IPhoneCallTask Members
public bool CanMakePhoneCall
{
get
{
// UIApplication.SharedApplication.CanOpenUrl does not validate the URL, it merely checks whether a handler for
// the URL has been installed on the system. Therefore string.Empty can be used as phone number.
var nsurl = CreateNsUrl(string.Empty);
return UIApplication.SharedApplication.CanOpenUrl(nsurl);
}
}
public void MakePhoneCall(string number, string name = null)
{
if (string.IsNullOrWhiteSpace(number))
throw new ArgumentNullException(nameof(number));
if (CanMakePhoneCall)
{
var nsurl = CreateNsUrl(number);
UIApplication.SharedApplication.OpenUrl(nsurl);
}
}
private NSUrl CreateNsUrl(string number)
{
return new NSUrl(new Uri($"tel:{number}").AbsoluteUri);
}
#endregion
}
}
|
using System;
#if __UNIFIED__
using Foundation;
using UIKit;
using CoreTelephony;
#else
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.CoreTelephony;
#endif
namespace Plugin.Messaging
{
internal class PhoneCallTask : IPhoneCallTask
{
public PhoneCallTask()
{
}
#region IPhoneCallTask Members
public bool CanMakePhoneCall
{
get
{
var nsurl = CreateNsUrl("0000000000");
bool canCall = UIApplication.SharedApplication.CanOpenUrl(nsurl);
if (canCall)
{
using (CTTelephonyNetworkInfo netInfo = new CTTelephonyNetworkInfo())
{
string mnc = netInfo.SubscriberCellularProvider?.MobileNetworkCode;
return !string.IsNullOrEmpty(mnc) && mnc != "65535"; //65535 stands for NoNetwordProvider
}
}
return false;
}
}
public void MakePhoneCall(string number, string name = null)
{
if (string.IsNullOrWhiteSpace(number))
throw new ArgumentNullException(nameof(number));
if (CanMakePhoneCall)
{
var nsurl = CreateNsUrl(number);
UIApplication.SharedApplication.OpenUrl(nsurl);
}
}
private NSUrl CreateNsUrl(string number)
{
return new NSUrl(new Uri($"tel:{number}").AbsoluteUri);
}
#endregion
}
}
|
Improve CanMakePhoneCall on iOS to check support of url and link to a carrier
|
Improve CanMakePhoneCall on iOS to check support of url and link to a carrier
|
C#
|
mit
|
cjlotz/Xamarin.Plugins,cjlotz/Xamarin.Plugins,BSVN/Xamarin.Plugins,BSVN/Xamarin.Plugins
|
03a2aacfc7dc4230e6bd0c0a64ac7b7e4569242d
|
Kudu.Web/Infrastructure/ApplicationExtensions.cs
|
Kudu.Web/Infrastructure/ApplicationExtensions.cs
|
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Xml.Linq;
using Kudu.Client.Deployment;
using Kudu.Client.Infrastructure;
using Kudu.Client.SourceControl;
using Kudu.Core.SourceControl;
using Kudu.Web.Models;
namespace Kudu.Web.Infrastructure
{
public static class ApplicationExtensions
{
public static Task<RepositoryInfo> GetRepositoryInfo(this IApplication application, ICredentials credentials)
{
var repositoryManager = new RemoteRepositoryManager(application.ServiceUrl + "live/scm", credentials);
return repositoryManager.GetRepositoryInfo();
}
public static RemoteDeploymentManager GetDeploymentManager(this IApplication application, ICredentials credentials)
{
var deploymentManager = new RemoteDeploymentManager(application.ServiceUrl + "/deployments", credentials);
return deploymentManager;
}
public static RemoteDeploymentSettingsManager GetSettingsManager(this IApplication application, ICredentials credentials)
{
var deploymentSettingsManager = new RemoteDeploymentSettingsManager(application.ServiceUrl + "/settings", credentials);
return deploymentSettingsManager;
}
public static Task<XDocument> DownloadTrace(this IApplication application, ICredentials credentials)
{
var clientHandler = HttpClientHelper.CreateClientHandler(application.ServiceUrl, credentials);
var client = new HttpClient(clientHandler);
return client.GetAsync(application.ServiceUrl + "dump").Then(response =>
{
return response.EnsureSuccessStatusCode().Content.ReadAsStreamAsync().Then(stream =>
{
return ZipHelper.ExtractTrace(stream);
});
});
}
}
}
|
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Xml.Linq;
using Kudu.Client.Deployment;
using Kudu.Client.Infrastructure;
using Kudu.Client.SourceControl;
using Kudu.Core.SourceControl;
using Kudu.Web.Models;
namespace Kudu.Web.Infrastructure
{
public static class ApplicationExtensions
{
public static Task<RepositoryInfo> GetRepositoryInfo(this IApplication application, ICredentials credentials)
{
var repositoryManager = new RemoteRepositoryManager(application.ServiceUrl + "scm", credentials);
return repositoryManager.GetRepositoryInfo();
}
public static RemoteDeploymentManager GetDeploymentManager(this IApplication application, ICredentials credentials)
{
var deploymentManager = new RemoteDeploymentManager(application.ServiceUrl + "deployments", credentials);
return deploymentManager;
}
public static RemoteDeploymentSettingsManager GetSettingsManager(this IApplication application, ICredentials credentials)
{
var deploymentSettingsManager = new RemoteDeploymentSettingsManager(application.ServiceUrl + "settings", credentials);
return deploymentSettingsManager;
}
public static Task<XDocument> DownloadTrace(this IApplication application, ICredentials credentials)
{
var clientHandler = HttpClientHelper.CreateClientHandler(application.ServiceUrl, credentials);
var client = new HttpClient(clientHandler);
return client.GetAsync(application.ServiceUrl + "dump").Then(response =>
{
return response.EnsureSuccessStatusCode().Content.ReadAsStreamAsync().Then(stream =>
{
return ZipHelper.ExtractTrace(stream);
});
});
}
}
}
|
Fix a few service paths in portal
|
Fix a few service paths in portal
|
C#
|
apache-2.0
|
duncansmart/kudu,juvchan/kudu,barnyp/kudu,shrimpy/kudu,shrimpy/kudu,shanselman/kudu,juoni/kudu,shibayan/kudu,chrisrpatterson/kudu,barnyp/kudu,bbauya/kudu,uQr/kudu,EricSten-MSFT/kudu,oliver-feng/kudu,oliver-feng/kudu,sitereactor/kudu,YOTOV-LIMITED/kudu,puneet-gupta/kudu,shibayan/kudu,dev-enthusiast/kudu,kali786516/kudu,kenegozi/kudu,bbauya/kudu,puneet-gupta/kudu,YOTOV-LIMITED/kudu,WeAreMammoth/kudu-obsolete,shanselman/kudu,MavenRain/kudu,sitereactor/kudu,WeAreMammoth/kudu-obsolete,EricSten-MSFT/kudu,puneet-gupta/kudu,MavenRain/kudu,uQr/kudu,uQr/kudu,shibayan/kudu,projectkudu/kudu,mauricionr/kudu,puneet-gupta/kudu,projectkudu/kudu,dev-enthusiast/kudu,WeAreMammoth/kudu-obsolete,kenegozi/kudu,juoni/kudu,sitereactor/kudu,juvchan/kudu,kali786516/kudu,projectkudu/kudu,kali786516/kudu,kenegozi/kudu,sitereactor/kudu,chrisrpatterson/kudu,mauricionr/kudu,puneet-gupta/kudu,juoni/kudu,kenegozi/kudu,chrisrpatterson/kudu,barnyp/kudu,duncansmart/kudu,dev-enthusiast/kudu,dev-enthusiast/kudu,YOTOV-LIMITED/kudu,bbauya/kudu,kali786516/kudu,badescuga/kudu,duncansmart/kudu,juoni/kudu,EricSten-MSFT/kudu,chrisrpatterson/kudu,juvchan/kudu,projectkudu/kudu,sitereactor/kudu,oliver-feng/kudu,mauricionr/kudu,EricSten-MSFT/kudu,duncansmart/kudu,EricSten-MSFT/kudu,shrimpy/kudu,MavenRain/kudu,barnyp/kudu,oliver-feng/kudu,YOTOV-LIMITED/kudu,badescuga/kudu,juvchan/kudu,mauricionr/kudu,badescuga/kudu,shrimpy/kudu,juvchan/kudu,badescuga/kudu,projectkudu/kudu,MavenRain/kudu,uQr/kudu,bbauya/kudu,shanselman/kudu,shibayan/kudu,badescuga/kudu,shibayan/kudu
|
2a14ba93d8b97510a1a32bb231d33bce3d4d8652
|
Linking/Form1.cs
|
Linking/Form1.cs
|
using System;
using System.Drawing;
using System.Windows.Forms;
using Linking.Controls;
using Linking.Core;
using Linking.Core.Blocks;
namespace Linking
{
public partial class Form1 : Form
{
public Form1()
{
//이것도 커밋해 보시지!!
InitializeComponent();
Board board = new Board();
BoardControl boardCtrl = new BoardControl(board);
boardCtrl.Dock = DockStyle.Fill;
this.Controls.Add(boardCtrl);
EntryBlock entry = new EntryBlock(board);
BlockControl b = new BlockControl(entry);
b.Location = new Point(50, 50);
boardCtrl.AddBlock(entry);
}
}
}
|
using System;
using System.Drawing;
using System.Windows.Forms;
using Linking.Controls;
using Linking.Core;
using Linking.Core.Blocks;
namespace Linking
{
public partial class Form1 : Form
{
public Form1()
{
//이것도 커밋해 보시지!!
InitializeComponent();
Board board = new Board();
BoardControl boardCtrl = new BoardControl(board);
boardCtrl.Dock = DockStyle.Fill;
this.Controls.Add(boardCtrl);
EntryBlock entry = new EntryBlock(board);
boardCtrl.AddBlock(entry);
}
}
}
|
Remove useless code in blockcontrol test
|
Remove useless code in blockcontrol test
|
C#
|
mit
|
phillyai/Linking-VPL
|
d71e2267c2adc5bb59af3ac7c14b2325fe9d92fa
|
Mvc.JQuery.Datatables/TypeExtensions.cs
|
Mvc.JQuery.Datatables/TypeExtensions.cs
|
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Reflection;
public static class TypeExtensions
{
public static IEnumerable<PropertyInfo> GetSortedProperties(this Type t)
{
return from pi in t.GetProperties()
let da = (DisplayAttribute)pi.GetCustomAttributes(typeof(DisplayAttribute), false).SingleOrDefault()
let order = ((da != null && da.Order != 0) ? da.Order : int.MaxValue)
orderby order
select pi;
}
public static IEnumerable<PropertyInfo> GetSortedProperties<T>()
{
return typeof(T).GetSortedProperties();
}
public static IEnumerable<PropertyInfo> GetProperties(this Type t)
{
return from pi in t.GetProperties()
select pi;
}
public static IEnumerable<PropertyInfo> GetProperties<T>()
{
return typeof(T).GetSortedProperties();
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Reflection;
namespace Mvc.JQuery.Datatables
{
public static class TypeExtensions
{
public static IEnumerable<PropertyInfo> GetSortedProperties(this Type t)
{
return from pi in t.GetProperties()
let da = (DisplayAttribute)pi.GetCustomAttributes(typeof(DisplayAttribute), false).SingleOrDefault()
let order = ((da != null && da.GetOrder() != null && da.GetOrder() >= 0) ? da.Order : int.MaxValue)
orderby order
select pi;
}
public static IEnumerable<PropertyInfo> GetSortedProperties<T>()
{
return typeof(T).GetSortedProperties();
}
public static IEnumerable<PropertyInfo> GetProperties(this Type t)
{
return from pi in t.GetProperties()
select pi;
}
public static IEnumerable<PropertyInfo> GetProperties<T>()
{
return typeof(T).GetSortedProperties();
}
}
}
|
Add namespace and fix DisplayAttribute.Order evaluation to avoid exception when Order is not set.
|
Add namespace and fix DisplayAttribute.Order evaluation to avoid exception
when Order is not set.
|
C#
|
mit
|
Sohra/mvc.jquery.datatables,mcintyre321/mvc.jquery.datatables,seguemark/mvc.jquery.datatables,offspringer/mvc.jquery.datatables,Sohra/mvc.jquery.datatables,offspringer/mvc.jquery.datatables,mcintyre321/mvc.jquery.datatables,mcintyre321/mvc.jquery.datatables,seguemark/mvc.jquery.datatables
|
288a6b9b8d301bded0a14f4238a9bd82f47f044f
|
PixelPet/CLI/Commands/PadPalettesCmd.cs
|
PixelPet/CLI/Commands/PadPalettesCmd.cs
|
using LibPixelPet;
using System;
namespace PixelPet.CLI.Commands {
internal class PadPalettesCmd : CliCommand {
public PadPalettesCmd()
: base("Pad-Palettes",
new Parameter(true, new ParameterValue("width", "0"))
) { }
public override void Run(Workbench workbench, ILogger logger) {
int width = FindUnnamedParameter(0).Values[0].ToInt32();
if (width < 1) {
logger?.Log("Invalid palette width.", LogLevel.Error);
return;
}
if (workbench.PaletteSet.Count == 0) {
logger?.Log("No palettes to pad. Creating 1 palette based on current bitmap format.", LogLevel.Information);
Palette pal = new Palette(workbench.BitmapFormat, -1);
workbench.PaletteSet.Add(pal);
}
int addedColors = 0;
foreach (PaletteEntry pe in workbench.PaletteSet) {
while (pe.Palette.Count < width) {
pe.Palette.Add(0);
addedColors++;
}
}
logger?.Log("Padded palettes to width " + width + " (added " + addedColors + " colors).", LogLevel.Information);
}
}
}
|
using LibPixelPet;
using System;
namespace PixelPet.CLI.Commands {
internal class PadPalettesCmd : CliCommand {
public PadPalettesCmd()
: base("Pad-Palettes",
new Parameter(true, new ParameterValue("width", "0")),
new Parameter("color", "c", false, new ParameterValue("value", "0"))
) { }
public override void Run(Workbench workbench, ILogger logger) {
int width = FindUnnamedParameter(0).Values[0].ToInt32();
int color = FindNamedParameter("--color").Values[0].ToInt32();
if (width < 1) {
logger?.Log("Invalid palette width.", LogLevel.Error);
return;
}
if (workbench.PaletteSet.Count == 0) {
logger?.Log("No palettes to pad. Creating 1 palette based on current bitmap format.", LogLevel.Information);
Palette pal = new Palette(workbench.BitmapFormat, -1);
workbench.PaletteSet.Add(pal);
}
int addedColors = 0;
foreach (PaletteEntry pe in workbench.PaletteSet) {
while (pe.Palette.Count < width) {
pe.Palette.Add(color);
addedColors++;
}
}
logger?.Log("Padded palettes to width " + width + " (added " + addedColors + " colors).", LogLevel.Information);
}
}
}
|
Add parameter specifying color to pad with.
|
Pad-Palettes: Add parameter specifying color to pad with.
|
C#
|
mit
|
Prof9/PixelPet
|
12637321950c4eec9ced71f271d4d927f42e43e8
|
Deploy/Program.cs
|
Deploy/Program.cs
|
using System;
using System.Diagnostics;
[assembly: CLSCompliant(true)]
namespace IronAHK.Setup
{
static partial class Program
{
static void Main(string[] args)
{
TransformDocs();
PackageZip();
AppBundle();
BuildMsi();
}
[Conditional("DEBUG")]
static void Cleanup()
{
Console.Read();
}
}
}
|
using System;
using System.Diagnostics;
[assembly: CLSCompliant(true)]
namespace IronAHK.Setup
{
static partial class Program
{
static void Main(string[] args)
{
TransformDocs();
PackageZip();
AppBundle();
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
BuildMsi();
Cleanup();
}
[Conditional("DEBUG")]
static void Cleanup()
{
Console.Read();
}
}
}
|
Build MSI only on Windows.
|
Build MSI only on Windows.
|
C#
|
bsd-2-clause
|
michaltakac/IronAHK,michaltakac/IronAHK,yatsek/IronAHK,michaltakac/IronAHK,yatsek/IronAHK,yatsek/IronAHK,polyethene/IronAHK,polyethene/IronAHK,yatsek/IronAHK,polyethene/IronAHK,polyethene/IronAHK,michaltakac/IronAHK,michaltakac/IronAHK,yatsek/IronAHK
|
23c7fd9409424939a24f3bfeda93d127d872d198
|
Properties/VersionAssemblyInfo.cs
|
Properties/VersionAssemblyInfo.cs
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyConfiguration("Release built on 2013-02-22 14:39")]
[assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyConfiguration("Release built on 2013-02-28 02:03")]
[assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]
|
Build script now creates individual zip file packages to align with the NuGet packages and semantic versioning.
|
Build script now creates individual zip file packages to align with the NuGet packages and semantic versioning.
|
C#
|
mit
|
autofac/Autofac.Extras.CommonServiceLocator
|
4e88456fd6d9af5ed6d0047b3ce92967ed62ea5b
|
cardio/cardio/Ext/ButtonExt.cs
|
cardio/cardio/Ext/ButtonExt.cs
|
using System;
using System.Windows.Controls;
using static System.Reactive.Linq.Observable;
namespace cardio.Ext
{
/// <summary>
/// Represents Button Extension
/// </summary>
static class ButtonExt
{
/// <summary>
/// Disables the button
/// </summary>
/// <param name="button">Given button to be disbaled</param>
/// <returns>button</returns>
internal static Button Disable (this Button button)
{
if ( !button.IsEnabled ) return button;
button.IsEnabled = false;
return button;
}
/// <summary>
/// Enables the button
/// </summary>
/// <param name="button">Given button to enabled</param>
/// <returns>button</returns>
internal static Button Enable (this Button button)
{
if ( button.IsEnabled ) return button;
button.IsEnabled = true;
return button;
}
/// <summary>
/// Converts Button Click to Stream of Button
/// </summary>
/// <param name="button">The given button</param>
/// <returns>The sender button</returns>
internal static IObservable<Button> StreamButtonClick(this Button button)
{
return from evt in FromEventPattern(button, "Click") select evt.Sender as Button;
}
}
}
|
using System;
using System.Windows.Controls;
using static System.Reactive.Linq.Observable;
using static System.Diagnostics.Contracts.Contract;
namespace cardio.Ext
{
/// <summary>
/// Represents Button Extension
/// </summary>
static class ButtonExt
{
/// <summary>
/// Disables the button
/// </summary>
/// <param name="button">Given button to be disbaled</param>
/// <returns>button</returns>
internal static Button Disable (this Button button)
{
Requires(button != null);
if ( !button.IsEnabled ) return button;
button.IsEnabled = false;
return button;
}
/// <summary>
/// Enables the button
/// </summary>
/// <param name="button">Given button to enabled</param>
/// <returns>button</returns>
internal static Button Enable (this Button button)
{
Requires(button != null);
if ( button.IsEnabled ) return button;
button.IsEnabled = true;
return button;
}
/// <summary>
/// Converts Button Click to Stream of Button
/// </summary>
/// <param name="button">The given button</param>
/// <returns>The sender button</returns>
internal static IObservable<Button> StreamButtonClick(this Button button)
{
Requires(button != null);
return from evt in FromEventPattern(button, "Click") select evt.Sender as Button;
}
}
}
|
Add Code Contracts in ButonExt
|
Add Code Contracts in ButonExt
The three methods here has added code contracts:
- Disable
- Enable
- StreamButtonClick
|
C#
|
mit
|
ronnelreposo/cardiotocography
|
4668fe4e2e6c0d79f8aab34c36af46fac59f86b8
|
TeamCityBuildChanges/Program.cs
|
TeamCityBuildChanges/Program.cs
|
using System;
using System.Collections.Generic;
using ManyConsole;
namespace TeamCityBuildChanges
{
class Program
{
static int Main(string[] args)
{
var commands = GetCommands();
return ConsoleCommandDispatcher.DispatchCommand(commands, args, Console.Out);
}
static IEnumerable<ConsoleCommand> GetCommands()
{
return ConsoleCommandDispatcher.FindCommandsInSameAssemblyAs(typeof(Program));
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using ManyConsole;
namespace TeamCityBuildChanges
{
class Program
{
static int Main(string[] args)
{
var commands = GetCommands();
return ConsoleCommandDispatcher.DispatchCommand(commands, args, Console.Out);
}
static IEnumerable<ConsoleCommand> GetCommands()
{
return ConsoleCommandDispatcher.FindCommandsInSameAssemblyAs(typeof(Program)).Where(c => !string.IsNullOrEmpty(c.Command));
}
}
}
|
Fix for base command being shown as command on command line.
|
Fix for base command being shown as command on command line.
|
C#
|
mit
|
TicketSolutionsPtyLtd/TeamCityBuildChanges,BenPhegan/TeamCityBuildChanges
|
0d612efb38c83ecd71b89c83b10003947966e768
|
Tests/DisplayTests/FullScreen.cs
|
Tests/DisplayTests/FullScreen.cs
|
using System;
using System.Collections.Generic;
using AgateLib;
using AgateLib.DisplayLib;
using AgateLib.Geometry;
using AgateLib.InputLib;
namespace Tests.DisplayTests
{
class HelloWorldProgram : IAgateTest
{
public string Name
{
get { return "Full Screen"; }
}
public string Category
{
get { return "Display"; }
}
public void Main(string[] args)
{
using (AgateSetup setup = new AgateSetup(args))
{
setup.InitializeAll();
if (setup.WasCanceled)
return;
DisplayWindow wind = DisplayWindow.CreateFullScreen("Hello World", 640, 480);
Surface mySurface = new Surface("jellybean.png");
// Run the program while the window is open.
while (Display.CurrentWindow.IsClosed == false &&
Keyboard.Keys[KeyCode.Escape] == false)
{
Display.BeginFrame();
Display.Clear(Color.DarkGreen);
mySurface.Draw(Mouse.X, Mouse.Y);
Display.EndFrame();
Core.KeepAlive();
}
}
}
}
}
|
using System;
using System.Collections.Generic;
using AgateLib;
using AgateLib.DisplayLib;
using AgateLib.Geometry;
using AgateLib.InputLib;
namespace Tests.DisplayTests
{
class FullscreenTest : IAgateTest
{
public string Name
{
get { return "Full Screen"; }
}
public string Category
{
get { return "Display"; }
}
public void Main(string[] args)
{
using (AgateSetup setup = new AgateSetup(args))
{
setup.InitializeAll();
if (setup.WasCanceled)
return;
DisplayWindow wind = DisplayWindow.CreateFullScreen("Hello World", 640, 480);
Surface mySurface = new Surface("jellybean.png");
// Run the program while the window is open.
while (Display.CurrentWindow.IsClosed == false &&
Keyboard.Keys[KeyCode.Escape] == false)
{
Display.BeginFrame();
Display.Clear(Color.DarkGreen);
mySurface.Draw(Mouse.X, Mouse.Y);
Display.EndFrame();
Core.KeepAlive();
}
}
}
}
}
|
Correct full screen test class name.
|
Correct full screen test class name.
|
C#
|
mit
|
eylvisaker/AgateLib
|
23bad1be56b37247dec5cda367627186152d0d39
|
PluginLoader/Plugins.cs
|
PluginLoader/Plugins.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
namespace PluginLoader
{
public static class Plugins<T> where T : class
{
/// <summary>
/// Loads interface plugins from the specified location.
/// </summary>
/// <param name="path">Load path</param>
/// <returns></returns>
public static ICollection<T> Load(string path)
{
var plugins = new List<T>();
if (Directory.Exists(path))
{
Type pluginType = typeof(T);
// All interface plugins have "if_" prefix
var assemblies = Directory.GetFiles(path, "if_*.dll");
foreach (var assemblyPath in assemblies)
{
var assembly = Assembly.LoadFrom(assemblyPath);
foreach (var type in assembly.GetTypes())
{
var typeInfo = type.GetTypeInfo();
if (typeInfo.GetInterface(pluginType.FullName) != null)
{
T plugin = Activator.CreateInstance(type) as T;
plugins.Add(plugin);
}
}
}
}
return plugins;
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
namespace PluginLoader
{
public static class Plugins<T> where T : class
{
/// <summary>
/// Loads interface plugins from the specified location.
/// </summary>
/// <param name="path">Load path</param>
/// <param name="searchPattern">Plugin file search pattern, default "if_*.dll"</param>
/// <returns></returns>
public static ICollection<T> Load(string path, string searchPattern = "if_*.dll")
{
var plugins = new List<T>();
if (Directory.Exists(path))
{
Type pluginType = typeof(T);
var assemblies = Directory.GetFiles(path, searchPattern);
foreach (var assemblyPath in assemblies)
{
var assembly = Assembly.LoadFrom(assemblyPath);
foreach (var type in assembly.GetTypes())
{
var typeInfo = type.GetTypeInfo();
if (typeInfo.GetInterface(pluginType.FullName) != null)
{
T plugin = Activator.CreateInstance(type) as T;
plugins.Add(plugin);
}
}
}
}
return plugins;
}
}
}
|
Add possibility to customize plugin search pattern
|
Add possibility to customize plugin search pattern
This changes the generic plugin load method in a way that now instead of hard coding plugin search file pattern the search pattern is now optional argument for the method.
The default is still "if_*.dll" but now the caller can change that if needed.
|
C#
|
mit
|
tparviainen/oscilloscope
|
5e785212abcf0ab12a277fe598f27ef56f597ba0
|
ClrSpy/Jobs/DumpMemoryJob.cs
|
ClrSpy/Jobs/DumpMemoryJob.cs
|
using System.IO;
using ClrSpy.CliSupport;
using ClrSpy.Debugger;
using Microsoft.Diagnostics.Runtime.Interop;
namespace ClrSpy.Jobs
{
public class DumpMemoryJob : IDebugJob
{
private readonly DebugRunningProcess target;
public int Pid => target.Process.Pid;
public string DumpFilePath { get; }
public bool OverwriteDumpFileIfExists { get; set; }
public DumpMemoryJob(DebugRunningProcess target, string dumpFilePath)
{
DumpFilePath = dumpFilePath;
this.target = target;
}
public void Run(TextWriter output, ConsoleLog console)
{
using (var session = target.CreateSession())
{
if (File.Exists(DumpFilePath))
{
if (!OverwriteDumpFileIfExists) throw new IOException($"File already exists: {DumpFilePath}");
File.Delete(DumpFilePath);
}
var clientInterface = session.DataTarget.DebuggerInterface as IDebugClient2;
if (clientInterface == null)
{
console.WriteLine("WARNING: API only supports old-style dump? Recording minidump instead.");
session.DataTarget.DebuggerInterface.WriteDumpFile(DumpFilePath, DEBUG_DUMP.SMALL);
return;
}
clientInterface.WriteDumpFile2(DumpFilePath, DEBUG_DUMP.SMALL, DEBUG_FORMAT.USER_SMALL_FULL_MEMORY, "");
}
}
}
}
|
using System.IO;
using ClrSpy.CliSupport;
using ClrSpy.Debugger;
using Microsoft.Diagnostics.Runtime.Interop;
namespace ClrSpy.Jobs
{
public class DumpMemoryJob : IDebugJob
{
private readonly DebugRunningProcess target;
public int Pid => target.Process.Pid;
public string DumpFilePath { get; }
public bool OverwriteDumpFileIfExists { get; set; }
public DumpMemoryJob(DebugRunningProcess target, string dumpFilePath)
{
DumpFilePath = dumpFilePath;
this.target = target;
}
public void Run(TextWriter output, ConsoleLog console)
{
using (var session = target.CreateSession())
{
if (File.Exists(DumpFilePath))
{
if (!OverwriteDumpFileIfExists) throw new IOException($"File already exists: {DumpFilePath}");
File.Delete(DumpFilePath);
}
var clientInterface = session.DataTarget.DebuggerInterface as IDebugClient2;
if (clientInterface == null)
{
console.WriteLine("WARNING: API only supports old-style dump? Recording minidump instead.");
session.DataTarget.DebuggerInterface.WriteDumpFile(DumpFilePath, DEBUG_DUMP.SMALL);
return;
}
clientInterface.WriteDumpFile2(DumpFilePath, DEBUG_DUMP.SMALL, DEBUG_FORMAT.USER_SMALL_FULL_MEMORY | DEBUG_FORMAT.CAB_SECONDARY_ALL_IMAGES, "");
}
}
}
}
|
Include symbols, etc in the memory dump
|
Include symbols, etc in the memory dump
|
C#
|
unlicense
|
alex-davidson/clrspy
|
a0233fd29b7edeac07e4f7d0ec948354b2f07332
|
Battery-Commander.Web/Views/Soldiers/List.cshtml
|
Battery-Commander.Web/Views/Soldiers/List.cshtml
|
@model IEnumerable<Soldier>
<h2>Soldiers @Html.ActionLink("Add New", "New", "Soldiers", null, new { @class = "btn btn-default" })</h2>
<table class="table table-striped">
<thead>
<tr>
<th></th>
<th>@Html.DisplayNameFor(_ => _.FirstOrDefault().Rank)</th>
<th>@Html.DisplayNameFor(_ => _.FirstOrDefault().LastName)</th>
<th>@Html.DisplayNameFor(_ => _.FirstOrDefault().FirstName)</th>
<th>@Html.DisplayNameFor(_ => _.FirstOrDefault().Unit)</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var soldier in Model)
{
<tr>
<td>@Html.ActionLink("Details", "Details", new { soldier.Id })</td>
<td>@Html.DisplayFor(s => soldier.Rank)</td>
<td>@Html.DisplayFor(s => soldier.LastName)</td>
<td>@Html.DisplayFor(s => soldier.FirstName)</td>
<td>@Html.DisplayFor(s => soldier.Unit)</td>
<td>
@Html.ActionLink("Add ABCP", "New", "ABCP", new { soldier = soldier.Id }, new { @class = "btn btn-default" })
@Html.ActionLink("Add APFT", "New", "APFT", new { soldier = soldier.Id }, new { @class = "btn btn-default" })
</td>
</tr>
}
</tbody>
</table>
|
@model IEnumerable<Soldier>
<h2>Soldiers @Html.ActionLink("Add New", "New", "Soldiers", null, new { @class = "btn btn-default" })</h2>
<table class="table table-striped">
<thead>
<tr>
<th></th>
<th>@Html.DisplayNameFor(_ => _.FirstOrDefault().FirstName)</th>
<th>@Html.DisplayNameFor(_ => _.FirstOrDefault().Unit)</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var soldier in Model)
{
<tr>
<td>@Html.ActionLink("Details", "Details", new { soldier.Id })</td>
<td>@Html.DisplayFor(s => soldier)</td>
<td>@Html.DisplayFor(s => soldier.Unit)</td>
<td>
@Html.ActionLink("Add ABCP", "New", "ABCP", new { soldier = soldier.Id }, new { @class = "btn btn-default" })
@Html.ActionLink("Add APFT", "New", "APFT", new { soldier = soldier.Id }, new { @class = "btn btn-default" })
</td>
</tr>
}
</tbody>
</table>
|
Change list display for soldiers
|
Change list display for soldiers
|
C#
|
mit
|
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
|
84d520349a34016317e45cc9f61bb791e9de4f43
|
MessageBird/Json/Converters/RFC3339DateTimeConverter.cs
|
MessageBird/Json/Converters/RFC3339DateTimeConverter.cs
|
using System;
using MessageBird.Utilities;
using Newtonsoft.Json;
using System.Globalization;
namespace MessageBird.Json.Converters
{
public class RFC3339DateTimeConverter : JsonConverter
{
private const string format = "Y-m-d\\TH:i:sP";
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
if (value is DateTime)
{
DateTime dateTime = (DateTime)value;
writer.WriteValue(dateTime.ToString(format));
}
else
{
throw new JsonSerializationException("Expected value of type 'DateTime'.");
}
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
Type t = (ReflectionUtils.IsNullable(objectType))
? Nullable.GetUnderlyingType(objectType)
: objectType;
if (reader.TokenType == JsonToken.Null)
{
return null;
}
if (reader.TokenType == JsonToken.Date)
{
return reader.Value;
}
else
{
throw new JsonSerializationException(String.Format("Unexpected token '{0}' when parsing date.", reader.TokenType));
}
}
public override bool CanConvert(Type objectType)
{
Type t = (ReflectionUtils.IsNullable(objectType))
? Nullable.GetUnderlyingType(objectType)
: objectType;
return t == typeof(DateTime);
}
}
}
|
using System;
using MessageBird.Utilities;
using Newtonsoft.Json;
using System.Globalization;
namespace MessageBird.Json.Converters
{
public class RFC3339DateTimeConverter : JsonConverter
{
// XXX: Format should be "yyyy-MM-dd'T'THH:mm:ssK".
// However, due to bug the endpoint expects the current used format.
// Need to be changed when the endpoint is updated!
private const string format = "yyyy-MM-dd'T'HH:mm";
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
if (value is DateTime)
{
DateTime dateTime = (DateTime)value;
writer.WriteValue(dateTime.ToString(format));
}
else
{
throw new JsonSerializationException("Expected value of type 'DateTime'.");
}
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
Type t = (ReflectionUtils.IsNullable(objectType))
? Nullable.GetUnderlyingType(objectType)
: objectType;
if (reader.TokenType == JsonToken.Null)
{
return null;
}
if (reader.TokenType == JsonToken.Date)
{
return reader.Value;
}
else
{
throw new JsonSerializationException(String.Format("Unexpected token '{0}' when parsing date.", reader.TokenType));
}
}
public override bool CanConvert(Type objectType)
{
Type t = (ReflectionUtils.IsNullable(objectType))
? Nullable.GetUnderlyingType(objectType)
: objectType;
return t == typeof(DateTime);
}
}
}
|
Use expected, but incorrect, truncated RFC3339 format
|
Use expected, but incorrect, truncated RFC3339 format
The endpoint expects a truncated RFC3339 date & time format.
When this is fixed, change back to RFC3339 format.
|
C#
|
isc
|
messagebird/csharp-rest-api
|
234b3b0a63dce8d08671d17452ce008cb676d1ae
|
Assets/Scripts/HUD_Manager.cs
|
Assets/Scripts/HUD_Manager.cs
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class HUD_Manager : MonoBehaviour
{
// The names of the GUI objects we're editing
public string amountXPElementName;
public string playerHealthElementName;
public string equippedWeaponIconElementName;
// Equipped weapon icons to use
public Sprite equippedMeleeSprite;
public Sprite equippedRangedSprite;
public Sprite equippedMagicSprite;
// The GUI objects we're editing
GUIText amountXPText;
Slider playerHealthSlider;
Image equippedWeaponIcon;
// Use this for initialization
void Start ()
{
// Find and store the things we'll be modifying
amountXPText = GameObject.Find(amountXPElementName).GetComponent<GUIText>();
playerHealthSlider = GameObject.Find(playerHealthElementName).GetComponent<Slider>();
equippedWeaponIcon = GameObject.Find(equippedWeaponIconElementName).GetComponent<Image>();
}
// Update is called once per frame
void Update ()
{
// Update player XP, health and equipped weapon icon
amountXPText.text = Game.thePlayer.XP.ToString();
playerHealthSlider.value = Game.thePlayer.health / Game.thePlayer.maxHealth;
// TODO: equipped weapon
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class HUD_Manager : MonoBehaviour
{
// The names of the GUI objects we're editing
public string amountXPElementName;
public string playerHealthElementName;
public string equippedWeaponIconElementName;
// Equipped weapon icons to use
public Sprite equippedMeleeSprite;
public Sprite equippedRangedSprite;
public Sprite equippedMagicSprite;
// The GUI objects we're editing
Text amountXPText;
Slider playerHealthSlider;
Image equippedWeaponIcon;
// Use this for initialization
void Start ()
{
// Find and store the things we'll be modifying
amountXPText = GameObject.Find(amountXPElementName).GetComponent<Text>();
playerHealthSlider = GameObject.Find(playerHealthElementName).GetComponent<Slider>();
equippedWeaponIcon = GameObject.Find(equippedWeaponIconElementName).GetComponent<Image>();
}
// Update is called once per frame
void Update ()
{
// Update player XP, health and equipped weapon icon
amountXPText.text = Game.thePlayer.XP.ToString();
playerHealthSlider.value = Game.thePlayer.health / Game.thePlayer.maxHealth;
// TODO: equipped weapon
}
}
|
Fix XP text not displaying
|
Fix XP text not displaying
|
C#
|
mit
|
jamioflan/LD38
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.