commit
stringlengths
40
40
subject
stringlengths
4
1.73k
repos
stringlengths
5
127k
old_file
stringlengths
2
751
new_file
stringlengths
2
751
new_contents
stringlengths
1
8.98k
old_contents
stringlengths
0
6.59k
license
stringclasses
13 values
lang
stringclasses
23 values
15b3f2dc1550f9988bf34bbe23e602d0b983eabb
Update Error.cshtml
SyntaxError2015/evoART,SyntaxError2015/evoART
evoART/Views/Shared/Error.cshtml
evoART/Views/Shared/Error.cshtml
@{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>Error</title> </head> <body> <hgroup> <h1>Error.</h1> <h2>An error occurred while processing your request.</h2> </hgroup> </body> </html>
@{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>Error</title> </head> <body> <hgroup> <h1>Error.</h1> <h2>An error occurred while processing your request.CEAVSFAVASVSAVVAS</h2> </hgroup> </body> </html>
mit
C#
81b8a9afbe1108b9f628399b66db6d0903687b02
Remove unnecessary factory resetting
pveller/Sitecore.FakeDb,hermanussen/Sitecore.FakeDb,sergeyshushlyapin/Sitecore.FakeDb
src/Sitecore.FakeDb.Tests/Data/Items/ItemHelperTest.cs
src/Sitecore.FakeDb.Tests/Data/Items/ItemHelperTest.cs
namespace Sitecore.FakeDb.Tests.Data.Items { using FluentAssertions; using Sitecore.Data; using Sitecore.FakeDb.Data.Items; using Sitecore.Globalization; using Xunit; public class ItemHelperTest { private const string Name = "home"; [Fact] public void ShouldSimpleCreateItem() { // arrange var database = Database.GetDatabase("master"); var item = ItemHelper.CreateInstance(database, Name); // assert item.Name.Should().Be(Name); item.ID.Should().NotBeNull(); item.TemplateID.Should().NotBeNull(); item.Database.Should().NotBeNull(); item.Language.Should().Be(Language.Parse("en")); } [Fact] public void ShouldCreateItem() { var id = ID.NewID; var templateId = ID.NewID; var database = Database.GetDatabase("master"); var language = Language.Parse("uk-UA"); // arrange var item = ItemHelper.CreateInstance(database, Name, id, templateId, ID.NewID, new FieldList(), language); // assert item.Name.Should().Be(Name, "name"); item.ID.Should().Be(id, "id"); item.TemplateID.Should().Be(templateId, "templateId"); item.Database.Should().Be(database, "database"); item.Language.Should().Be(language, "language"); } } }
namespace Sitecore.FakeDb.Tests.Data.Items { using System; using FluentAssertions; using Sitecore.Configuration; using Sitecore.Data; using Sitecore.FakeDb.Data.Items; using Sitecore.Globalization; using Xunit; public class ItemHelperTest : IDisposable { private const string Name = "home"; [Fact] public void ShouldSimpleCreateItem() { // arrange var database = Database.GetDatabase("master"); var item = ItemHelper.CreateInstance(database, Name); // assert item.Name.Should().Be(Name); item.ID.Should().NotBeNull(); item.TemplateID.Should().NotBeNull(); item.Database.Should().NotBeNull(); item.Language.Should().Be(Language.Parse("en")); } [Fact] public void ShouldCreateItem() { var id = ID.NewID; var templateId = ID.NewID; var database = Database.GetDatabase("master"); var language = Language.Parse("uk-UA"); // arrange var item = ItemHelper.CreateInstance(database, Name, id, templateId, ID.NewID, new FieldList(), language); // assert item.Name.Should().Be(Name, "name"); item.ID.Should().Be(id, "id"); item.TemplateID.Should().Be(templateId, "templateId"); item.Database.Should().Be(database, "database"); item.Language.Should().Be(language, "language"); } public void Dispose() { Factory.Reset(); } } }
mit
C#
8c9c9f3d2b5d9471f2815c0ab0db32a1617d5614
Fix Repository's `createGitHubDeployments` not being returned in API responses
tgstation/tgstation-server,tgstation/tgstation-server,tgstation/tgstation-server-tools
src/Tgstation.Server.Host/Models/RepositorySettings.cs
src/Tgstation.Server.Host/Models/RepositorySettings.cs
using System.ComponentModel.DataAnnotations; using Tgstation.Server.Api.Models; namespace Tgstation.Server.Host.Models { /// <inheritdoc /> public sealed class RepositorySettings : Api.Models.Internal.RepositorySettings { /// <summary> /// The row Id /// </summary> public long Id { get; set; } /// <summary> /// The instance <see cref="EntityId.Id"/> /// </summary> public long InstanceId { get; set; } /// <summary> /// The parent <see cref="Models.Instance"/> /// </summary> [Required] public Instance Instance { get; set; } /// <summary> /// Convert the <see cref="Repository"/> to it's API form /// </summary> /// <returns>A new <see cref="Repository"/></returns> public Repository ToApi() => new Repository { // AccessToken = AccessToken, // never show this AccessUser = AccessUser, AutoUpdatesKeepTestMerges = AutoUpdatesKeepTestMerges, AutoUpdatesSynchronize = AutoUpdatesSynchronize, CommitterEmail = CommitterEmail, CommitterName = CommitterName, PushTestMergeCommits = PushTestMergeCommits, ShowTestMergeCommitters = ShowTestMergeCommitters, PostTestMergeComment = PostTestMergeComment, CreateGitHubDeployments = CreateGitHubDeployments, // revision information and the rest retrieved by controller }; } }
using System.ComponentModel.DataAnnotations; using Tgstation.Server.Api.Models; namespace Tgstation.Server.Host.Models { /// <inheritdoc /> public sealed class RepositorySettings : Api.Models.Internal.RepositorySettings { /// <summary> /// The row Id /// </summary> public long Id { get; set; } /// <summary> /// The instance <see cref="EntityId.Id"/> /// </summary> public long InstanceId { get; set; } /// <summary> /// The parent <see cref="Models.Instance"/> /// </summary> [Required] public Instance Instance { get; set; } /// <summary> /// Convert the <see cref="Repository"/> to it's API form /// </summary> /// <returns>A new <see cref="Repository"/></returns> public Repository ToApi() => new Repository { // AccessToken = AccessToken, // never show this AccessUser = AccessUser, AutoUpdatesKeepTestMerges = AutoUpdatesKeepTestMerges, AutoUpdatesSynchronize = AutoUpdatesSynchronize, CommitterEmail = CommitterEmail, CommitterName = CommitterName, PushTestMergeCommits = PushTestMergeCommits, ShowTestMergeCommitters = ShowTestMergeCommitters, PostTestMergeComment = PostTestMergeComment // revision information and the rest retrieved by controller }; } }
agpl-3.0
C#
0c58aa0bdba17daa95f132e962421fdb8a03bcd0
Update UpdateTaskInput.cs
fanpan26/aspnetboilerplate-samples,LeonSutedja/aspnetboilerplate-samples,s-takatsu/aspnetboilerplate-samples,chenkaibin/aspnetboilerplate-samples,chenkaibin/aspnetboilerplate-samples,bikaqiou2000/aspnetboilerplate-samples,luchaoshuai/aspnetboilerplate-samples,fanpan26/aspnetboilerplate-samples,liujunhua/aspnetboilerplate-samples,kylin589/aspnetboilerplate-samples,kylin589/aspnetboilerplate-samples,LeonSutedja/aspnetboilerplate-samples,liujunhua/aspnetboilerplate-samples,fanpan26/aspnetboilerplate-samples,GutierrezDev/aspnetboilerplate-samples,Saviio/aspnetboilerplate-samples,GutierrezDev/aspnetboilerplate-samples,lclijingxuan/aspnetboilerplate-samples,bikaqiou2000/aspnetboilerplate-samples,nicklv/aspnetboilerplate-samples,kylin589/aspnetboilerplate-samples,lclijingxuan/aspnetboilerplate-samples,s-takatsu/aspnetboilerplate-samples,nicklv/aspnetboilerplate-samples,aspnetboilerplate/aspnetboilerplate-samples,GutierrezDev/aspnetboilerplate-samples,nicklv/aspnetboilerplate-samples,Saviio/aspnetboilerplate-samples,aspnetboilerplate/aspnetboilerplate-samples,GutierrezDev/aspnetboilerplate-samples,luchaoshuai/aspnetboilerplate-samples,aspnetboilerplate/aspnetboilerplate-samples,luchaoshuai/aspnetboilerplate-samples,aspnetboilerplate/aspnetboilerplate-samples,aspnetboilerplate/aspnetboilerplate-samples,LeonSutedja/aspnetboilerplate-samples,s-takatsu/aspnetboilerplate-samples,lclijingxuan/aspnetboilerplate-samples,liujunhua/aspnetboilerplate-samples,aspnetboilerplate/aspnetboilerplate-samples,Saviio/aspnetboilerplate-samples,chenkaibin/aspnetboilerplate-samples,bikaqiou2000/aspnetboilerplate-samples
SimpleTaskSystem/SimpleTaskSystem.Application/Tasks/Dtos/UpdateTaskInput.cs
SimpleTaskSystem/SimpleTaskSystem.Application/Tasks/Dtos/UpdateTaskInput.cs
using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Abp.Application.Services.Dto; using Abp.Runtime.Validation; namespace SimpleTaskSystem.Tasks.Dtos { /// <summary> /// This DTO class is used to send needed data to <see cref="ITaskAppService.UpdateTask"/> method. /// /// Implements <see cref="IInputDto"/>, thus ABP applies standard input process (like automatic validation) for it. /// Implements <see cref="ICustomValidate"/> for additional custom validation. /// </summary> public class UpdateTaskInput : IInputDto, ICustomValidate { [Range(1, long.MaxValue)] //Data annotation attributes work as expected. public long TaskId { get; set; } public int? AssignedPersonId { get; set; } public TaskState? State { get; set; } //Custom validation method. It's called by ABP after data annotation validations. public void AddValidationErrors(List<ValidationResult> results) { if (AssignedPersonId == null && State == null) { results.Add(new ValidationResult("Both of AssignedPersonId and State can not be null in order to update a Task!", new[] { "AssignedPersonId", "State" })); } } public override string ToString() { return string.Format("[UpdateTaskInput > TaskId = {0}, AssignedPersonId = {1}, State = {2}]", TaskId, AssignedPersonId, State); } } }
using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Abp.Application.Services.Dto; using Abp.Runtime.Validation; namespace SimpleTaskSystem.Tasks.Dtos { /// <summary> /// This DTO class is used to send needed data to <see cref="ITaskAppService.UpdateTask"/> method. /// /// Implements <see cref="IInputDto"/>, thus ABP applies standard input process (like automatic validation) for it. /// Implements <see cref="ICustomValidate"/> for additional custom validation. /// </summary> public class UpdateTaskInput : IInputDto, ICustomValidate { [Range(1, long.MaxValue)] //Data annotation attributes work as expected. public long TaskId { get; set; } public int? AssignedPersonId { get; set; } public TaskState? State { get; set; } //Custom validation method. It's valled by ABP after data annotation validations. public void AddValidationErrors(List<ValidationResult> results) { if (AssignedPersonId == null && State == null) { results.Add(new ValidationResult("Both of AssignedPersonId and State can not be null in order to update a Task!", new[] { "AssignedPersonId", "State" })); } } public override string ToString() { return string.Format("[UpdateTaskInput > TaskId = {0}, AssignedPersonId = {1}, State = {2}]", TaskId, AssignedPersonId, State); } } }
mit
C#
ca3b0fc93877f4cbef8f12568038bbd7f3b41717
Remove workaround for line marker renderer
JetBrains/resharper-unity,JetBrains/resharper-unity,JetBrains/resharper-unity
resharper/resharper-unity/src/CSharp/Daemon/Stages/PerformanceCriticalCodeAnalysis/Highlightings/PerformanceCriticalCodeLineMarker.cs
resharper/resharper-unity/src/CSharp/Daemon/Stages/PerformanceCriticalCodeAnalysis/Highlightings/PerformanceCriticalCodeLineMarker.cs
using JetBrains.Application.UI.Controls.BulbMenu.Items; using JetBrains.DocumentModel; using JetBrains.ReSharper.Feature.Services.Daemon; using JetBrains.ReSharper.Psi.CSharp; using JetBrains.TextControl.DocumentMarkup; using JetBrains.TextControl.DocumentMarkup.LineMarkers; namespace JetBrains.ReSharper.Plugins.Unity.CSharp.Daemon.Stages.PerformanceCriticalCodeAnalysis.Highlightings { [StaticSeverityHighlighting(Severity.INFO, typeof(UnityPerformanceHighlighting), Languages = CSharpLanguage.Name, AttributeId = PerformanceHighlightingAttributeIds.PERFORMANCE_CRITICAL_METHOD_HIGHLIGHTER, ShowToolTipInStatusBar = false, ToolTipFormatString = MESSAGE)] public class UnityPerformanceCriticalCodeLineMarker : UnityPerformanceHighlightingBase, IHighlighting, IActiveLineMarkerInfo { public const string MESSAGE = "Performance critical context"; private readonly DocumentRange myRange; public UnityPerformanceCriticalCodeLineMarker(DocumentRange range) { myRange = range; } public override bool IsValid() => true; public DocumentRange CalculateRange() => myRange; public string ToolTip => "Performance critical context"; public string ErrorStripeToolTip => Tooltip; public string RendererId => null; public int Thickness => 1; public LineMarkerPosition Position => LineMarkerPosition.RIGHT; public ExecutableItem LeftClick() => null; public string Tooltip => "Performance critical context"; } public class UnityPerformanceContextHighlightInfo : HighlightInfo { public UnityPerformanceContextHighlightInfo(DocumentRange documentRange) : base(PerformanceHighlightingAttributeIds.PERFORMANCE_CRITICAL_METHOD_HIGHLIGHTER, documentRange, AreaType.EXACT_RANGE, HighlighterLayer.SYNTAX + 1) { } public override IHighlighter CreateHighlighter(IDocumentMarkup markup) { var highlighter = base.CreateHighlighter(markup); highlighter.UserData = new UnityPerformanceCriticalCodeLineMarker(DocumentRange); return highlighter; } } }
using JetBrains.Application.UI.Controls.BulbMenu.Items; using JetBrains.DocumentModel; using JetBrains.ReSharper.Feature.Services.Daemon; using JetBrains.ReSharper.Psi.CSharp; using JetBrains.TextControl.DocumentMarkup; using JetBrains.TextControl.DocumentMarkup.LineMarkers; namespace JetBrains.ReSharper.Plugins.Unity.CSharp.Daemon.Stages.PerformanceCriticalCodeAnalysis.Highlightings { [StaticSeverityHighlighting(Severity.INFO, typeof(UnityPerformanceHighlighting), Languages = CSharpLanguage.Name, AttributeId = PerformanceHighlightingAttributeIds.PERFORMANCE_CRITICAL_METHOD_HIGHLIGHTER, ShowToolTipInStatusBar = false, ToolTipFormatString = MESSAGE)] public class UnityPerformanceCriticalCodeLineMarker : UnityPerformanceHighlightingBase, IHighlighting, IActiveLineMarkerInfo { public const string MESSAGE = "Performance critical context"; private readonly DocumentRange myRange; public UnityPerformanceCriticalCodeLineMarker(DocumentRange range) { myRange = range; } public override bool IsValid() => true; public DocumentRange CalculateRange() => myRange; public string ToolTip => "Performance critical context"; public string ErrorStripeToolTip => Tooltip; // TODO: Fix SDK to properly treat null as "default" public string RendererId => "DefaultLineMarkerRendererProvider"; public int Thickness => 1; public LineMarkerPosition Position => LineMarkerPosition.RIGHT; public ExecutableItem LeftClick() => null; public string Tooltip => "Performance critical context"; } public class UnityPerformanceContextHighlightInfo : HighlightInfo { public UnityPerformanceContextHighlightInfo(DocumentRange documentRange) : base(PerformanceHighlightingAttributeIds.PERFORMANCE_CRITICAL_METHOD_HIGHLIGHTER, documentRange, AreaType.EXACT_RANGE, HighlighterLayer.SYNTAX + 1) { } public override IHighlighter CreateHighlighter(IDocumentMarkup markup) { var highlighter = base.CreateHighlighter(markup); highlighter.UserData = new UnityPerformanceCriticalCodeLineMarker(DocumentRange); return highlighter; } } }
apache-2.0
C#
02d6ac511e88200f31d7e00074a9128e4eb36879
Remove whitespace
stevenhillcox/voting-application,Generic-Voting-Application/voting-application,JDawes-ScottLogic/voting-application,tpkelly/voting-application,Generic-Voting-Application/voting-application,tpkelly/voting-application,Generic-Voting-Application/voting-application,stevenhillcox/voting-application,tpkelly/voting-application,JDawes-ScottLogic/voting-application,stevenhillcox/voting-application,JDawes-ScottLogic/voting-application
VotingApplication/VotingApplication.Web/Views/Routes/AddChoiceDialog.cshtml
VotingApplication/VotingApplication.Web/Views/Routes/AddChoiceDialog.cshtml
<div class="dialog-box-small dialog-content centered"> <form name="addChoiceForm"> <h2>New Choice</h2> <div class="form-section-block centered"> <label for="name">Name</label> <input autofocus class="form-input" id="name" ng-model="addChoiceForm.name" focus required/> <label for="description">Description</label> <input class="form-input" id="description" ng-model="addChoiceForm.description"> </div> <div> <button class="active-btn" id="add-button" ng-disabled="addChoiceForm.$invalid" ng-click="addChoice(addChoiceForm)" ng-if="addAnotherToggle" type="submit" onclick="addChoiceForm.name.focus()"> Add </button> <button class="active-btn" id="add-button" ng-disabled="addChoiceForm.$invalid" ng-click="addChoiceAndClose(addChoiceForm)" ng-if="!addAnotherToggle" type="submit"> Add </button> <div class="pull-right padded-top-small"> <label for="add-another-checkbox">Add Another</label> <input type="checkbox" id="add-another-checkbox" ng-model="addAnotherToggle" ng-true-value="true" ng-false-value="false" /> </div> </div> </form> </div> <span class="dialog-error-bar-bottom" ng-show="displayError">{{displayError}}</span>
 <div class="dialog-box-small dialog-content centered"> <form name="addChoiceForm"> <h2>New Choice</h2> <div class="form-section-block centered"> <label for="name">Name</label> <input autofocus class="form-input" id="name" ng-model="addChoiceForm.name" focus required> <label for="description">Description</label> <input class="form-input" id="description" ng-model="addChoiceForm.description"> </div> <div> <button class="active-btn" id="add-button" ng-disabled="addChoiceForm.$invalid" ng-click="addChoice(addChoiceForm)" ng-if="addAnotherToggle" type="submit" onclick="addChoiceForm.name.focus()"> Add </button> <button class="active-btn" id="add-button" ng-disabled="addChoiceForm.$invalid" ng-click="addChoiceAndClose(addChoiceForm)" ng-if="!addAnotherToggle" type="submit"> Add </button> <div class="pull-right padded-top-small"> <label for="add-another-checkbox">Add Another</label> <input type="checkbox" id="add-another-checkbox" ng-model="addAnotherToggle" ng-true-value="true" ng-false-value="false" /> </div> </div> </form> </div> <span class="dialog-error-bar-bottom" ng-show="displayError">{{displayError}}</span>
apache-2.0
C#
bcaedf62c1fe2d64fa1a6f59e702274691564a25
build 7.1.20.0
agileharbor/channelAdvisorAccess
src/Global/GlobalAssemblyInfo.cs
src/Global/GlobalAssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.InteropServices; [ assembly : ComVisible( false ) ] [ assembly : AssemblyProduct( "ChannelAdvisorAccess" ) ] [ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ] [ assembly : AssemblyCopyright( "Copyright (C) Agile Harbor, LLC" ) ] [ assembly : AssemblyDescription( "ChannelAdvisor webservices API wrapper." ) ] [ assembly : AssemblyTrademark( "" ) ] [ assembly : AssemblyCulture( "" ) ] [ assembly : CLSCompliant( false ) ] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] // Keep in track with CA API version [ assembly : AssemblyVersion( "7.1.20.0" ) ]
using System; using System.Reflection; using System.Runtime.InteropServices; [ assembly : ComVisible( false ) ] [ assembly : AssemblyProduct( "ChannelAdvisorAccess" ) ] [ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ] [ assembly : AssemblyCopyright( "Copyright (C) Agile Harbor, LLC" ) ] [ assembly : AssemblyDescription( "ChannelAdvisor webservices API wrapper." ) ] [ assembly : AssemblyTrademark( "" ) ] [ assembly : AssemblyCulture( "" ) ] [ assembly : CLSCompliant( false ) ] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] // Keep in track with CA API version [ assembly : AssemblyVersion( "7.1.19.0" ) ]
bsd-3-clause
C#
5a630cbb87935e96ce88b9aff98a54794179934a
Update OData assembly versions to 5.3.1.0
congysu/WebApi,LianwMS/WebApi,yonglehou/WebApi,lungisam/WebApi,congysu/WebApi,lewischeng-ms/WebApi,chimpinano/WebApi,LianwMS/WebApi,chimpinano/WebApi,abkmr/WebApi,scz2011/WebApi,lungisam/WebApi,abkmr/WebApi,scz2011/WebApi,yonglehou/WebApi,lewischeng-ms/WebApi
OData/src/CommonAssemblyInfo.cs
OData/src/CommonAssemblyInfo.cs
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. 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 Open Technologies, Inc.")] [assembly: AssemblyCopyright("© Microsoft Open Technologies, Inc. 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.3.1.0")] // ASPNETODATA [assembly: AssemblyFileVersion("5.3.1.0")] // ASPNETODATA #endif [assembly: AssemblyProduct("Microsoft ASP.NET Web API OData")] #endif
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. 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 Open Technologies, Inc.")] [assembly: AssemblyCopyright("© Microsoft Open Technologies, Inc. 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.3.0.0")] // ASPNETODATA [assembly: AssemblyFileVersion("5.3.0.0")] // ASPNETODATA #endif [assembly: AssemblyProduct("Microsoft ASP.NET Web API OData")] #endif
mit
C#
5cbf265411db570983a0841ee2f7ba3a9ea98c99
Enhance BaseTest
sickboy/JConverter
src/JConverter.Tests/BaseTest.cs
src/JConverter.Tests/BaseTest.cs
using System; using NUnit.Framework; using Ploeh.AutoFixture; using Ploeh.AutoFixture.AutoFakeItEasy; namespace JConverter.Tests { [TestFixture] public abstract class BaseTest { protected Fixture Fixture { get; } = new Fixture(); protected Action ExceptionTest { get; set; } protected BaseTest() { Fixture.Customize(new AutoFakeItEasyCustomization()); } } public abstract class BaseTest<T> : BaseTest { // ReSharper disable once InconsistentNaming public T SUT { get; set; } protected virtual void BuildFixture() => SUT = Fixture.Create<T>(); } }
using NUnit.Framework; using Ploeh.AutoFixture; using Ploeh.AutoFixture.AutoFakeItEasy; namespace JConverter.Tests { [TestFixture] public abstract class BaseTest { protected Fixture Fixture { get; } = new Fixture(); protected BaseTest() { Fixture.Customize(new AutoFakeItEasyCustomization()); } } public abstract class BaseTest<T> : BaseTest { // ReSharper disable once InconsistentNaming public T SUT { get; set; } protected virtual void BuildFixture() => SUT = Fixture.Create<T>(); } }
mit
C#
0316032c552fcedac47dfc568deff56945597858
Update ValuesOut.cs
EricZimmerman/RegistryPlugins
RegistryPlugin.Bam/ValuesOut.cs
RegistryPlugin.Bam/ValuesOut.cs
using System; using RegistryPluginBase.Interfaces; namespace RegistryPlugin.BamDam { public class ValuesOut:IValueOut { public ValuesOut(string program, DateTimeOffset executionTime) { Program = program; ExecutionTime = executionTime; } public string Program { get; } public DateTimeOffset ExecutionTime { get; } public string BatchKeyPath { get; set; } public string BatchValueName { get; set; } public string BatchValueData1 => $"Program: {Program}"; public string BatchValueData2 => $"Execution time: {ExecutionTime.ToUniversalTime():yyyy-MM-dd HH:mm:ss.fffffff})"; public string BatchValueData3 { get; } } }
using System; using RegistryPluginBase.Interfaces; namespace RegistryPlugin.BamDam { public class ValuesOut:IValueOut { public ValuesOut(string program, DateTimeOffset executionTime) { Program = program; ExecutionTime = executionTime; } public string Program { get; } public DateTimeOffset ExecutionTime { get; } public string BatchKeyPath { get; set; } public string BatchValueName { get; set; } public string BatchValueData1 => $"Program: {Program}"; public string BatchValueData2 =>$"Execution time: {ExecutionTime.ToUniversalTime():yyyy-MM-dd HH:mm:ss.fffffff})"; public string BatchValueData3 { get; } } }
mit
C#
ed61f618202c091e8358ae52ae499d6f3ee7aaed
Stop bird animation on drop down
L4fter/CrocoDie
Assets/Birdy.cs
Assets/Birdy.cs
using UnityEngine; using System.Collections; public class Birdy : MonoBehaviour { public bool IsAlive; public float DropDeadTime = 0.5f; public MoveForward Mover; public ScriptSwitch FlyToFallSwitch; public FallDown FallDown; public MonoBehaviour[] Feeders; // Use this for initialization void Start () { FallDown.Time = DropDeadTime; } // Update is called once per frame void Update () { } public void DropDead() { if (!IsAlive) { return; } Mover.Speed = Random.Range(5/DropDeadTime, 10/DropDeadTime); this.GetComponentInChildren<Animator>().enabled = false; FlyToFallSwitch.Switch(); LeanTween.delayedCall(gameObject, DropDeadTime, TurnOffMover); this.transform.GetChild(0).tag = "Food"; IsAlive = false; } private void TurnOffMover() { this.IsDown = true; this.Mover.enabled = false; foreach (var monoBehaviour in this.Feeders) { monoBehaviour.enabled = true; } } public bool IsDown { get; set; } }
using UnityEngine; using System.Collections; public class Birdy : MonoBehaviour { public bool IsAlive; public float DropDeadTime = 0.5f; public MoveForward Mover; public ScriptSwitch FlyToFallSwitch; public FallDown FallDown; public MonoBehaviour[] Feeders; // Use this for initialization void Start () { FallDown.Time = DropDeadTime; } // Update is called once per frame void Update () { } public void DropDead() { if (!IsAlive) { return; } Mover.Speed = Random.Range(5/DropDeadTime, 10/DropDeadTime); FlyToFallSwitch.Switch(); LeanTween.delayedCall(gameObject, DropDeadTime, TurnOffMover); IsAlive = false; } private void TurnOffMover() { this.IsDown = true; this.Mover.enabled = false; foreach (var monoBehaviour in this.Feeders) { monoBehaviour.enabled = true; } } public bool IsDown { get; set; } }
mit
C#
efafcad90920c0e66e9fe20e6dc4106e3e184ed0
Remove using v2's property
sakapon/Tutorials-2016
Leap-v1/LeapTutorials/AirCanvasLeap/AppModel.cs
Leap-v1/LeapTutorials/AirCanvasLeap/AppModel.cs
using System; using System.Collections.Generic; using System.Linq; using System.Reactive.Linq; using System.Windows.Input; using Monsoon.Reactive.Leap; namespace AirCanvasLeap { public class AppModel { const double ScreenWidth = 1920.0; const double ScreenHeight = 1080.0; const double MappingScale = 3.0; public LeapManager LeapManager { get; } = new LeapManager(); public IObservable<Dictionary<int, StylusPoint>> TouchedPositions { get; } public AppModel() { TouchedPositions = LeapManager.FrameArrived .Select(ToTouchedPositions); } static Dictionary<int, StylusPoint> ToTouchedPositions(Leap.Frame frame) => frame.Pointables .Where(p => p.IsValid) .Where(p => p.TipPosition.IsValid() && p.TipPosition.z < 0.0) .ToDictionary(p => p.Id, p => ToStylusPoint(p.TipPosition)); static StylusPoint ToStylusPoint(Leap.Vector v) => new StylusPoint(ScreenWidth / 2 + MappingScale * v.x, ScreenHeight - MappingScale * v.y); } }
using System; using System.Collections.Generic; using System.Linq; using System.Reactive.Linq; using System.Windows.Input; using Monsoon.Reactive.Leap; namespace AirCanvasLeap { public class AppModel { const double ScreenWidth = 1920.0; const double ScreenHeight = 1080.0; const double MappingScale = 3.0; public LeapManager LeapManager { get; } = new LeapManager(); public IObservable<Dictionary<int, StylusPoint>> TouchedPositions { get; } public AppModel() { TouchedPositions = LeapManager.FrameArrived .Select(ToTouchedPositions); } static Dictionary<int, StylusPoint> ToTouchedPositions(Leap.Frame frame) => frame.Pointables .Where(p => p.IsValid && p.IsExtended) .Where(p => p.TipPosition.IsValid() && p.TipPosition.z < 0.0) .ToDictionary(p => p.Id, p => ToStylusPoint(p.TipPosition)); static StylusPoint ToStylusPoint(Leap.Vector v) => new StylusPoint(ScreenWidth / 2 + MappingScale * v.x, ScreenHeight - MappingScale * v.y); } }
mit
C#
47066ade71deb43f6cc60af1579cd3e7692f4b3d
Add NotNull to SpeechManager
asarium/FSOLauncher
Libraries/FSOManagement/Speech/SpeechManager.cs
Libraries/FSOManagement/Speech/SpeechManager.cs
using System; using FSOManagement.Annotations; using FSOManagement.Implementations; using FSOManagement.Interfaces; namespace FSOManagement.Speech { public class SpeechManager { private static ISpeechHandler _speechHandler; [NotNull] public static ISpeechHandler SpeechHandler { get { if (_speechHandler == null) { if (Environment.OSVersion.Platform == PlatformID.Win32NT) { _speechHandler = new WindowsSpeechHandler(); } // FSO doesn't support TTS on other platforms yet... throw new NotSupportedException(); } return _speechHandler; } } } }
using System; using FSOManagement.Implementations; using FSOManagement.Interfaces; namespace FSOManagement.Speech { public class SpeechManager { private static ISpeechHandler _speechHandler; public static ISpeechHandler SpeechHandler { get { if (_speechHandler == null) { if (Environment.OSVersion.Platform == PlatformID.Win32NT) { _speechHandler = new WindowsSpeechHandler(); } // FSO doesn't support TTS on other platforms yet... } return _speechHandler; } } } }
mit
C#
31516a4f7fd55194259514d8be72f7dbba574f67
Update DotNetXmlSerializer.cs
tiksn/TIKSN-Framework
TIKSN.Core/Serialization/DotNetXmlSerializer.cs
TIKSN.Core/Serialization/DotNetXmlSerializer.cs
using System.IO; using System.Xml.Serialization; namespace TIKSN.Serialization { public class DotNetXmlSerializer : SerializerBase<string> { protected override string SerializeInternal(object obj) { var serializer = new XmlSerializer(obj.GetType()); var writer = new StringWriter(); serializer.Serialize(writer, obj); return writer.ToString(); } } }
using System.IO; using System.Xml.Serialization; using TIKSN.Analytics.Telemetry; namespace TIKSN.Serialization { public class DotNetXmlSerializer : SerializerBase<string> { public DotNetXmlSerializer(IExceptionTelemeter exceptionTelemeter) : base(exceptionTelemeter) { } protected override string SerializeInternal(object obj) { var serializer = new XmlSerializer(obj.GetType()); var writer = new StringWriter(); serializer.Serialize(writer, obj); return writer.ToString(); } } }
mit
C#
fb5f45cd83fef1ba3d878fe5304f051e098b6932
Support EnabledConnections in OrganizationCreateRequest (#585)
auth0/auth0.net,auth0/auth0.net
src/Auth0.ManagementApi/Models/OrganizationCreateRequest.cs
src/Auth0.ManagementApi/Models/OrganizationCreateRequest.cs
using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; namespace Auth0.ManagementApi.Models { /// <summary> /// Requests structure for creating a new organization. /// </summary> public class OrganizationCreateRequest : OrganizationBase { /// <summary> /// Support enable connections in organization /// </summary> [JsonProperty("enabled_connections")] public IList<OrganizationConnectionCreateRequest> EnabledConnections { get; set; } } }
using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; namespace Auth0.ManagementApi.Models { /// <summary> /// Requests structure for creating a new organization. /// </summary> public class OrganizationCreateRequest : OrganizationBase { } }
mit
C#
dc746a877bd8f846696fe428077e96de6cecf802
Add IReadonlyDataContext
HighwayFramework/Highway.Data,ericburcham/Highway.Data
src/Highway.Data/Interfaces/IReadonlyDataContext.cs
src/Highway.Data/Interfaces/IReadonlyDataContext.cs
using System; using System.Linq; namespace Highway.Data { /// <summary> /// Contract for a readonly Data Context /// </summary> public interface IReadonlyDataContext : IDisposable { /// <summary> /// This gives a mock-able wrapper around normal Set method that allows for testability /// </summary> /// <typeparam name="T">The Entity being queried</typeparam> /// <returns> /// <see cref="IQueryable{T}" /> /// </returns> IQueryable<T> AsQueryable<T>() where T : class; } }
using System; using System.Linq; namespace Highway.Data { public interface IReadonlyDataContext : IDisposable { /// <summary> /// This gives a mock-able wrapper around normal Set method that allows for testability /// </summary> /// <typeparam name="T">The Entity being queried</typeparam> /// <returns> /// <see cref="IQueryable{T}" /> /// </returns> IQueryable<T> AsQueryable<T>() where T : class; } }
mit
C#
3bf869ab38557cddc4a50840654c0aef91aa83e7
Remove Flags attribute from AggregationTemporality (#3157)
open-telemetry/opentelemetry-dotnet,open-telemetry/opentelemetry-dotnet,open-telemetry/opentelemetry-dotnet
src/OpenTelemetry/Metrics/AggregationTemporality.cs
src/OpenTelemetry/Metrics/AggregationTemporality.cs
// <copyright file="AggregationTemporality.cs" company="OpenTelemetry Authors"> // Copyright The OpenTelemetry Authors // // 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. // </copyright> namespace OpenTelemetry.Metrics { public enum AggregationTemporality : byte { /// <summary> /// Cumulative. /// </summary> Cumulative = 0b1, /// <summary> /// Delta. /// </summary> Delta = 0b10, } }
// <copyright file="AggregationTemporality.cs" company="OpenTelemetry Authors"> // Copyright The OpenTelemetry Authors // // 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. // </copyright> using System; namespace OpenTelemetry.Metrics { [Flags] public enum AggregationTemporality : byte { /// <summary> /// Cumulative. /// </summary> Cumulative = 0b1, /// <summary> /// Delta. /// </summary> Delta = 0b10, } }
apache-2.0
C#
121d75fc76014ec4ba0c7f67b3158c221694bd56
Write BrightstarDB log output if a log file is specified
BrightstarDB/BrightstarDB,BrightstarDB/BrightstarDB,BrightstarDB/BrightstarDB,BrightstarDB/BrightstarDB
src/core/BrightstarDB.ReadWriteBenchmark/Program.cs
src/core/BrightstarDB.ReadWriteBenchmark/Program.cs
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BrightstarDB.ReadWriteBenchmark { internal class Program { public static TraceListener BrightstarListener; private static void Main(string[] args) { var opts = new BenchmarkArgs(); if (CommandLine.Parser.ParseArgumentsWithUsage(args, opts)) { if (!string.IsNullOrEmpty(opts.LogFilePath)) { BenchmarkLogging.EnableFileLogging(opts.LogFilePath); var logStream = new FileStream(opts.LogFilePath + ".bslog", FileMode.Create); BrightstarListener = new TextWriterTraceListener(logStream); BrightstarDB.Logging.BrightstarTraceSource.Listeners.Add(BrightstarListener); BrightstarDB.Logging.BrightstarTraceSource.Switch.Level = SourceLevels.All; } } else { var usage = CommandLine.Parser.ArgumentsUsage(typeof (BenchmarkArgs)); Console.WriteLine(usage); } var runner = new BenchmarkRunner(opts); runner.Run(); BenchmarkLogging.Close(); BrightstarDB.Logging.BrightstarTraceSource.Close(); } } }
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BrightstarDB.ReadWriteBenchmark { internal class Program { private static void Main(string[] args) { var opts = new BenchmarkArgs(); if (CommandLine.Parser.ParseArgumentsWithUsage(args, opts)) { if (!string.IsNullOrEmpty(opts.LogFilePath)) { BenchmarkLogging.EnableFileLogging(opts.LogFilePath); } } else { var usage = CommandLine.Parser.ArgumentsUsage(typeof (BenchmarkArgs)); Console.WriteLine(usage); } var runner = new BenchmarkRunner(opts); runner.Run(); BenchmarkLogging.Close(); } } }
mit
C#
a3928f715cd19c44808639f0cfb6a79993a7dabb
Revert to method LINQ syntax.
structuremap/structuremap.dnx,structuremap/StructureMap.Microsoft.DependencyInjection,khellang/StructureMap.Dnx
src/StructureMap.Microsoft.DependencyInjection/AspNetConstructorSelector.cs
src/StructureMap.Microsoft.DependencyInjection/AspNetConstructorSelector.cs
using System; using System.Linq; using System.Reflection; using StructureMap.Graph; using StructureMap.Pipeline; namespace StructureMap { internal class AspNetConstructorSelector : IConstructorSelector { // ASP.NET expects registered services to be considered when selecting a ctor, SM doesn't by default. public ConstructorInfo Find(Type pluggedType, DependencyCollection dependencies, PluginGraph graph) => pluggedType.GetTypeInfo() .DeclaredConstructors .Select(ctor => new { Constructor = ctor, Parameters = ctor.GetParameters() }) .Where(x => x.Parameters.All(param => graph.HasFamily(param.ParameterType) || dependencies.Any(dep => dep.Type == param.ParameterType))) .OrderByDescending(x => x.Parameters.Length) .Select(x => x.Constructor) .FirstOrDefault(); } }
using System; using System.Linq; using System.Reflection; using StructureMap.Graph; using StructureMap.Pipeline; namespace StructureMap { internal class AspNetConstructorSelector : IConstructorSelector { // ASP.NET expects registered services to be considered when selecting a ctor, SM doesn't by default. public ConstructorInfo Find(Type pluggedType, DependencyCollection dependencies, PluginGraph graph) { var constructors = from constructor in pluggedType.GetConstructors() select new { Constructor = constructor, Parameters = constructor.GetParameters(), }; var satisfiable = from constructor in constructors where constructor.Parameters.All(parameter => ParameterIsRegistered(parameter, dependencies, graph)) orderby constructor.Parameters.Length descending select constructor.Constructor; return satisfiable.FirstOrDefault(); } private static bool ParameterIsRegistered(ParameterInfo parameter, DependencyCollection dependencies, PluginGraph graph) { return graph.HasFamily(parameter.ParameterType) || dependencies.Any(dependency => dependency.Type == parameter.ParameterType); } } }
mit
C#
965b1f5f78c92380b60c088c8fc45dcbaa77be4f
fix ajax method for first time to call web api get methods
Behzadkhosravifar/SaleOnlineReporter,Behzadkhosravifar/SaleOnlineReporter
src/WebSaleDistribute/WebSaleDistribute/Controllers/ReportsApiController.cs
src/WebSaleDistribute/WebSaleDistribute/Controllers/ReportsApiController.cs
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using Dapper; using System.Globalization; using WebSaleDistribute.Core; namespace WebSaleDistribute.Controllers { public class ReportsApiController : ApiController { // GET: api/Reports [Route("Reports/GetOfficerOrderStatisticsChart")] public async Task<IHttpActionResult> GetOfficerOrderStatisticsChart() { var routParams = Request.GetQueryStrings(); var fromDate = routParams.ContainsKey("fromDate") ? routParams["fromDate"] : DateTime.Now.GetPersianDate(); var toDate = routParams.ContainsKey("toDate") ? routParams["toDate"] : fromDate; var sqlConn = AdoManager.ConnectionManager.Find(Properties.Settings.Default.SaleTabriz).SqlConn; var result = await sqlConn.QueryAsync("sp_GetOfficerOrderStatisticsChart", new { FromDate = fromDate, ToDate = toDate }, commandType: System.Data.CommandType.StoredProcedure); return Ok(result); } // GET: api/Reports/GetOrderStatisticsChart/{officerEmployeeId} [Route("Reports/GetOrderStatisticsChart/{officerEmployeeId}")] public async Task<IHttpActionResult> GetOrderStatisticsChart(int officerEmployeeId) { var routParams = Request.GetQueryStrings(); var fromDate = routParams.ContainsKey("fromDate") ? routParams["fromDate"] : DateTime.Now.GetPersianDate(); var toDate = routParams.ContainsKey("toDate") ? routParams["toDate"] : fromDate; var sqlConn = AdoManager.ConnectionManager.Find(Properties.Settings.Default.SaleTabriz).SqlConn; var result = await sqlConn.QueryAsync("sp_GetOrderStatisticsChart", new { FromDate = fromDate, ToDate = toDate, OfficerEmployeeID = officerEmployeeId }, commandType: System.Data.CommandType.StoredProcedure); return Ok(result); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using Dapper; using System.Globalization; using WebSaleDistribute.Core; namespace WebSaleDistribute.Controllers { public class ReportsApiController : ApiController { // GET: api/Reports [Route("Reports/GetOfficerOrderStatisticsChart")] public async Task<IHttpActionResult> GetOfficerOrderStatisticsChart() { var routParams = Request.GetQueryStrings(); var fromDate = routParams["fromDate"] ?? DateTime.Now.GetPersianDate(); var toDate = routParams["fromDate"] ?? fromDate; var sqlConn = AdoManager.ConnectionManager.Find(Properties.Settings.Default.SaleTabriz).SqlConn; var result = await sqlConn.QueryAsync("sp_GetOfficerOrderStatisticsChart", new { FromDate = fromDate, ToDate = toDate }, commandType: System.Data.CommandType.StoredProcedure); return Ok(result); } // GET: api/Reports/GetOrderStatisticsChart/{officerEmployeeId} [Route("Reports/GetOrderStatisticsChart/{officerEmployeeId}")] public async Task<IHttpActionResult> GetOrderStatisticsChart(int officerEmployeeId) { var routParams = Request.GetQueryStrings(); var fromDate = routParams["fromDate"] ?? DateTime.Now.GetPersianDate(); var toDate = routParams["fromDate"] ?? fromDate; var sqlConn = AdoManager.ConnectionManager.Find(Properties.Settings.Default.SaleTabriz).SqlConn; var result = await sqlConn.QueryAsync("sp_GetOrderStatisticsChart", new { FromDate = fromDate, ToDate = toDate, OfficerEmployeeID = officerEmployeeId }, commandType: System.Data.CommandType.StoredProcedure); return Ok(result); } } }
apache-2.0
C#
1e88b8d561888a3a6e2954562476df9972780b27
Fix Aesop layout (#1846)
GProulx/allReady,binaryjanitor/allReady,HamidMosalla/allReady,bcbeatty/allReady,stevejgordon/allReady,dpaquette/allReady,gitChuckD/allReady,HTBox/allReady,HamidMosalla/allReady,dpaquette/allReady,stevejgordon/allReady,arst/allReady,anobleperson/allReady,MisterJames/allReady,stevejgordon/allReady,bcbeatty/allReady,bcbeatty/allReady,dpaquette/allReady,VishalMadhvani/allReady,MisterJames/allReady,arst/allReady,VishalMadhvani/allReady,anobleperson/allReady,HamidMosalla/allReady,BillWagner/allReady,arst/allReady,VishalMadhvani/allReady,binaryjanitor/allReady,GProulx/allReady,c0g1t8/allReady,HTBox/allReady,c0g1t8/allReady,gitChuckD/allReady,mgmccarthy/allReady,anobleperson/allReady,bcbeatty/allReady,jonatwabash/allReady,binaryjanitor/allReady,c0g1t8/allReady,stevejgordon/allReady,gitChuckD/allReady,jonatwabash/allReady,gitChuckD/allReady,BillWagner/allReady,GProulx/allReady,mgmccarthy/allReady,VishalMadhvani/allReady,MisterJames/allReady,binaryjanitor/allReady,arst/allReady,BillWagner/allReady,anobleperson/allReady,HamidMosalla/allReady,c0g1t8/allReady,mgmccarthy/allReady,BillWagner/allReady,HTBox/allReady,GProulx/allReady,jonatwabash/allReady,dpaquette/allReady,jonatwabash/allReady,HTBox/allReady,MisterJames/allReady,mgmccarthy/allReady
AllReadyApp/Web-App/AllReady/Views/Home/Aesop.cshtml
AllReadyApp/Web-App/AllReady/Views/Home/Aesop.cshtml
@{ ViewData["Title"] = "Story"; } <div class="row"> <div class="col-md-3"></div> <div class="col-md-6"> <h1>A Story by Aesop</h1> <div style="background-color: #d58033;"> <img src="~/images/Web-Logo.png" alt="Logo image for the project" class="img-responsive center-block" /> </div> <h2>The Ant and the Grasshopper</h2> In a field one summer's day a Grasshopper was hopping about, chirping and singing to its heart's content. An Ant passed by, bearing along with great toil an ear of corn he was taking to the nest. "Why not come and chat with me," said the Grasshopper, "instead of toiling and moiling in that way?" "I am helping to lay up food for the winter," said the Ant, "and recommend you to do the same." "Why bother about winter?" said the Grasshopper; "We have got plenty of food at present." But the Ant went on its way and continued its toil. When the winter came the Grasshopper had no food and found itself dying of hunger - while it saw the ants distributing every day corn and grain from the stores they had collected in the summer. Then the Grasshopper knew: It is best to prepare for days of need. </div> <div class="col-md-3"></div> </div>
@{ ViewData["Title"] = "Story"; } <div class="row"> <div class="col-md-3"></div> <div class="col-md-6"> <h1>A Story by Aesop</h1> <div class="logo-background"> <img src="~/images/Web-Logo.png" alt="Logo image for the project" class="img-responsive center-block" /> </div> <h2>The Ant and the Grasshopper</h2> In a field one summer's day a Grasshopper was hopping about, chirping and singing to its heart's content. An Ant passed by, bearing along with great toil an ear of corn he was taking to the nest. "Why not come and chat with me," said the Grasshopper, "instead of toiling and moiling in that way?" "I am helping to lay up food for the winter," said the Ant, "and recommend you to do the same." "Why bother about winter?" said the Grasshopper; "We have got plenty of food at present." But the Ant went on its way and continued its toil. When the winter came the Grasshopper had no food and found itself dying of hunger - while it saw the ants distributing every day corn and grain from the stores they had collected in the summer. Then the Grasshopper knew: It is best to prepare for days of need. </div> <div class="col-md-3"></div> </div>
mit
C#
c0bb6c8192f97b6246b95822f991655dfaddc195
Include URI
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
Battery-Commander.Web/Controllers/AdminController.cs
Battery-Commander.Web/Controllers/AdminController.cs
using BatteryCommander.Web.Models; using FluentScheduler; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using System; using System.Linq; using System.Threading.Tasks; namespace BatteryCommander.Web.Controllers { [ApiExplorerSettings(IgnoreApi = true)] public class AdminController : Controller { // Admin Tasks: // Add/Remove Users // Backup SQLite Db // Scrub Soldier Data private readonly Database db; public AdminController(Database db) { this.db = db; } public IActionResult Index() { return View(); } public IActionResult Backup() { var data = System.IO.File.ReadAllBytes("Data.db"); var mimeType = "application/octet-stream"; return File(data, mimeType); } public IActionResult Jobs() { return View(JobManager.AllSchedules); } public async Task<IActionResult> Users() { var soldiers_with_access = await db .Soldiers .Include(soldier => soldier.Unit) .Where(soldier => soldier.CanLogin) .Where(soldier => !String.IsNullOrWhiteSpace(soldier.CivilianEmail)) .Select(soldier => new { Uri = Url.RouteUrl("Soldier.Details", new { soldier.Id }), Unit = soldier.Unit.Name, soldier.FirstName, soldier.LastName, soldier.CivilianEmail }) .ToListAsync(); return Json(soldiers_with_access); } } }
using BatteryCommander.Web.Models; using FluentScheduler; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using System; using System.Linq; using System.Threading.Tasks; namespace BatteryCommander.Web.Controllers { [ApiExplorerSettings(IgnoreApi = true)] public class AdminController : Controller { // Admin Tasks: // Add/Remove Users // Backup SQLite Db // Scrub Soldier Data private readonly Database db; public AdminController(Database db) { this.db = db; } public IActionResult Index() { return View(); } public IActionResult Backup() { var data = System.IO.File.ReadAllBytes("Data.db"); var mimeType = "application/octet-stream"; return File(data, mimeType); } public IActionResult Jobs() { return View(JobManager.AllSchedules); } public async Task<IActionResult> Users() { var soldiers_with_access = await db .Soldiers .Include(soldier => soldier.Unit) .Where(soldier => soldier.CanLogin) .Where(soldier => !String.IsNullOrWhiteSpace(soldier.CivilianEmail)) .Select(soldier => new { Unit = soldier.Unit.Name, soldier.FirstName, soldier.LastName, soldier.CivilianEmail }) .ToListAsync(); return Json(soldiers_with_access); } } }
mit
C#
f8d1d662132d7f3d90910da95be466bc6dc1a42c
Fix seat sum
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
Battery-Commander.Web/Models/VehicleListViewModel.cs
Battery-Commander.Web/Models/VehicleListViewModel.cs
using Microsoft.AspNetCore.Mvc.Rendering; using System.Collections.Generic; using System.Linq; namespace BatteryCommander.Web.Models { public class VehicleListViewModel { public IEnumerable<SelectListItem> Soldiers { get; set; } = Enumerable.Empty<SelectListItem>(); public IEnumerable<Vehicle> Vehicles { get; set; } = Enumerable.Empty<Vehicle>(); private IEnumerable<Vehicle> fmc_vehicles => Vehicles.Where(_ => _.Status == Vehicle.VehicleStatus.FMC); private int drivers => fmc_vehicles.Where(_ => _.DriverId.HasValue).Count(); private int adrivers => fmc_vehicles.Where(_ => _.A_DriverId.HasValue).Count(); public int FMC => fmc_vehicles.Count(); public int PAX => drivers + adrivers; public int Seats => fmc_vehicles.Select(_ => _.Seats).Sum(); } }
using Microsoft.AspNetCore.Mvc.Rendering; using System.Collections.Generic; using System.Linq; namespace BatteryCommander.Web.Models { public class VehicleListViewModel { public IEnumerable<SelectListItem> Soldiers { get; set; } = Enumerable.Empty<SelectListItem>(); public IEnumerable<Vehicle> Vehicles { get; set; } = Enumerable.Empty<Vehicle>(); private IEnumerable<Vehicle> fmc_vehicles => Vehicles.Where(_ => _.Status == Vehicle.VehicleStatus.FMC); private int drivers => fmc_vehicles.Where(_ => _.DriverId.HasValue).Count(); private int adrivers => fmc_vehicles.Where(_ => _.A_DriverId.HasValue).Count(); public int FMC => fmc_vehicles.Count(); public int PAX => drivers + adrivers; public int Seats => fmc_vehicles.Select(_ => _.Seats).Count(); } }
mit
C#
8bfccab6c451770fadb276873277bc5a40b5a5d6
build 0.0.7
rachmann/qboAccess,rachmann/qboAccess,rachmann/qboAccess
src/Global/GlobalAssemblyInfo.cs
src/Global/GlobalAssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.InteropServices; [ assembly : ComVisible( false ) ] [ assembly : AssemblyProduct( "QuickBooksOnlineAccess" ) ] [ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ] [ assembly : AssemblyCopyright( "Copyright (C) 2014 Agile Harbor, LLC" ) ] [ assembly : AssemblyDescription( "QuickBooksOnline webservices API wrapper." ) ] [ assembly : AssemblyTrademark( "" ) ] [ assembly : AssemblyCulture( "" ) ] [ assembly : CLSCompliant( false ) ] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] // Keep in track with CA API version [ assembly : AssemblyVersion( "0.0.7.0" ) ]
using System; using System.Reflection; using System.Runtime.InteropServices; [ assembly : ComVisible( false ) ] [ assembly : AssemblyProduct( "QuickBooksOnlineAccess" ) ] [ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ] [ assembly : AssemblyCopyright( "Copyright (C) 2014 Agile Harbor, LLC" ) ] [ assembly : AssemblyDescription( "QuickBooksOnline webservices API wrapper." ) ] [ assembly : AssemblyTrademark( "" ) ] [ assembly : AssemblyCulture( "" ) ] [ assembly : CLSCompliant( false ) ] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] // Keep in track with CA API version [ assembly : AssemblyVersion( "0.0.6.0" ) ]
bsd-3-clause
C#
760caf86ce9145772e60dfe94eea02e270215664
Bump version
SuperJMN/Avalonia,SuperJMN/Avalonia,AvaloniaUI/Avalonia,SuperJMN/Avalonia,jazzay/Perspex,AvaloniaUI/Avalonia,Perspex/Perspex,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,Perspex/Perspex,wieslawsoltes/Perspex,SuperJMN/Avalonia,jkoritzinsky/Avalonia,wieslawsoltes/Perspex,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,SuperJMN/Avalonia,wieslawsoltes/Perspex,grokys/Perspex,jkoritzinsky/Avalonia,jkoritzinsky/Avalonia,akrisiun/Perspex,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia,MrDaedra/Avalonia,wieslawsoltes/Perspex,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,jkoritzinsky/Avalonia,wieslawsoltes/Perspex,grokys/Perspex,jkoritzinsky/Perspex,SuperJMN/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,MrDaedra/Avalonia,SuperJMN/Avalonia
src/Shared/SharedAssemblyInfo.cs
src/Shared/SharedAssemblyInfo.cs
// Copyright (c) The Avalonia Project. All rights reserved. // Licensed under the MIT license. See licence.md file in the project root for full license information. using System.Reflection; using System.Resources; [assembly: AssemblyCompany("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCopyright("Copyright AvaloniaUI 2016")] [assembly: AssemblyCulture("")] [assembly: AssemblyDescription("")] [assembly: AssemblyProduct("Avalonia")] [assembly: AssemblyTrademark("")] [assembly: NeutralResourcesLanguage("en")] [assembly: AssemblyVersion("0.5.1")] [assembly: AssemblyFileVersion("0.5.1")] [assembly: AssemblyInformationalVersion("0.5.1")]
// Copyright (c) The Avalonia Project. All rights reserved. // Licensed under the MIT license. See licence.md file in the project root for full license information. using System.Reflection; using System.Resources; [assembly: AssemblyCompany("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCopyright("Copyright AvaloniaUI 2016")] [assembly: AssemblyCulture("")] [assembly: AssemblyDescription("")] [assembly: AssemblyProduct("Avalonia")] [assembly: AssemblyTrademark("")] [assembly: NeutralResourcesLanguage("en")] [assembly: AssemblyVersion("0.5.0")] [assembly: AssemblyFileVersion("0.5.0")] [assembly: AssemblyInformationalVersion("0.5.0")]
mit
C#
3f7cf1cf6e376366d3cc438b1d119d23d041f697
Remove logging
CosmosOS/Cosmos,zarlo/Cosmos,zarlo/Cosmos,zarlo/Cosmos,CosmosOS/Cosmos,CosmosOS/Cosmos,CosmosOS/Cosmos,zarlo/Cosmos
source/Cosmos.Core_Asm/ArrayImpl.cs
source/Cosmos.Core_Asm/ArrayImpl.cs
#define COSMOSDEBUG using System; using Cosmos.Debug.Kernel; using IL2CPU.API.Attribs; namespace Cosmos.Core_Asm { [Plug(Target = typeof(Array))] public class ArrayImpl { [PlugMethod(Assembler = typeof(ArrayGetLengthAsm))] public static int get_Length(Array aThis) { throw new NotImplementedException(); } public static void Copy(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) { Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length, false); } [PlugMethod(Assembler = typeof(ArrayInternalCopyAsm))] public static void Copy(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length, bool reliable) { throw new NotImplementedException(); } } }
#define COSMOSDEBUG using System; using Cosmos.Debug.Kernel; using IL2CPU.API.Attribs; namespace Cosmos.Core_Asm { [Plug(Target = typeof(Array))] public class ArrayImpl { [PlugMethod(Assembler = typeof(ArrayGetLengthAsm))] public static int get_Length(Array aThis) { throw new NotImplementedException(); } public static void Copy(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) { Debugger.DoSendNumber(0xC0f7); Debugger.DoSendNumber(length); Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length, false); } [PlugMethod(Assembler = typeof(ArrayInternalCopyAsm))] public static void Copy(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length, bool reliable) { throw new NotImplementedException(); } } }
bsd-3-clause
C#
f2b1ddd1cfab0ebd4e74e664f4901c3b82ea2d1e
Fix formatting TimeSpan.Zero
CruelCow/Twitch2Steam
Twitch2Steam/TimeSpanHelper.cs
Twitch2Steam/TimeSpanHelper.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Twitch2Steam { public static class TimeSpanHelper { //http://stackoverflow.com/questions/842057/how-do-i-convert-a-timespan-to-a-formatted-string public static string ToReadableString( this TimeSpan span ) { string formatted = string.Format("{0}{1}{2}{3}{4}", span.Duration().Days > 0 ? string.Format("{0:0} day{1}, ", span.Days, span.Days == 1 ? String.Empty : "s") : string.Empty, span.Duration().Hours > 0 ? string.Format("{0:0} hour{1}, ", span.Hours, span.Hours == 1 ? String.Empty : "s") : string.Empty, span.Duration().Minutes > 0 ? string.Format("{0:0} minute{1}, ", span.Minutes, span.Minutes == 1 ? String.Empty : "s") : string.Empty, span.Duration().Seconds > 0 ? string.Format("{0:0} second{1}, ", span.Seconds, span.Seconds == 1 ? String.Empty : "s") : string.Empty, span.Duration().Milliseconds > 0 ? string.Format("{0:0} millisecond{1}, ", span.Milliseconds, span.Milliseconds == 1 ? String.Empty : "s") : string.Empty ); if (formatted.EndsWith(", ")) formatted = formatted.Substring(0, formatted.Length - 2); if (string.IsNullOrEmpty(formatted)) formatted = "0 seconds"; return formatted; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Twitch2Steam { public static class TimeSpanHelper { //http://stackoverflow.com/questions/842057/how-do-i-convert-a-timespan-to-a-formatted-string public static string ToReadableString( this TimeSpan span ) { string formatted = string.Format("{0}{1}{2}{3}{4}", span.Duration().Days > 0 ? string.Format("{0:0} day{1}, ", span.Days, span.Days == 1 ? String.Empty : "s") : string.Empty, span.Duration().Hours > 0 ? string.Format("{0:0} hour{1}, ", span.Hours, span.Hours == 1 ? String.Empty : "s") : string.Empty, span.Duration().Minutes > 0 ? string.Format("{0:0} minute{1}, ", span.Minutes, span.Minutes == 1 ? String.Empty : "s") : string.Empty, span.Duration().Seconds > 0 ? string.Format("{0:0} second{1}, ", span.Seconds, span.Seconds == 1 ? String.Empty : "s") : string.Empty, span.Duration().Milliseconds > 0 ? string.Format("{0:0} millisecond{1}, ", span.Milliseconds, span.Milliseconds == 1 ? String.Empty : "s") : string.Empty ); //if (formatted.EndsWith(", ")) formatted = formatted.Substring(0, formatted.Length - 2); if (string.IsNullOrEmpty(formatted)) formatted = "0 seconds"; return formatted; } } }
agpl-3.0
C#
e8d5750e9d4c6974745602332b0722321f948de0
Disable ReSharper warning
whitestone-no/Cambion
src/Cambion/Types/MessageWrapper.cs
src/Cambion/Types/MessageWrapper.cs
using System; // ReSharper disable NonReadonlyMemberInGetHashCode // because ReSharper is a bit over eager namespace Whitestone.Cambion.Types { public class MessageWrapper { public object Data { get; set; } public Type DataType { get; set; } public Type ResponseType { get; set; } public MessageType MessageType { get; set; } public Guid CorrelationId { get; set; } public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return false; } MessageWrapper objWrapper = (MessageWrapper)obj; // Wrap the Data property in "dynamic" to allow for value comparison (i.e. (int)1 == (long)1 will be true) return (dynamic)Data == (dynamic)objWrapper.Data && DataType == objWrapper.DataType && ResponseType == objWrapper.ResponseType && MessageType == objWrapper.MessageType && CorrelationId == objWrapper.CorrelationId; } public override int GetHashCode() { int hash = Data.GetHashCode(); hash = (hash * 397) ^ DataType.GetHashCode(); hash = (hash * 397) ^ ResponseType.GetHashCode(); hash = (hash * 397) ^ MessageType.GetHashCode(); hash = (hash * 397) ^ CorrelationId.GetHashCode(); return hash; } } public enum MessageType { Event, SynchronizedRequest, SynchronizedResponse } }
using System; namespace Whitestone.Cambion.Types { public class MessageWrapper { public object Data { get; set; } public Type DataType { get; set; } public Type ResponseType { get; set; } public MessageType MessageType { get; set; } public Guid CorrelationId { get; set; } public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return false; } MessageWrapper objWrapper = (MessageWrapper)obj; // Wrap the Data property in "dynamic" to allow for value comparison (i.e. (int)1 == (long)1 will be true) return ((dynamic)Data == (dynamic)objWrapper.Data) && DataType == objWrapper.DataType && ResponseType == objWrapper.ResponseType && MessageType == objWrapper.MessageType && CorrelationId == objWrapper.CorrelationId; } public override int GetHashCode() { int hash = Data.GetHashCode(); hash = (hash * 397) ^ DataType.GetHashCode(); hash = (hash * 397) ^ ResponseType.GetHashCode(); hash = (hash * 397) ^ MessageType.GetHashCode(); hash = (hash * 397) ^ CorrelationId.GetHashCode(); return hash; } } public enum MessageType { Event, SynchronizedRequest, SynchronizedResponse } }
mit
C#
15a960dcfe8da6e8b14cc1fd8647f453ca21fe69
Use scriptureforge database to get project data
ermshiperete/LfMerge,sillsdev/LfMerge,ermshiperete/LfMerge,sillsdev/LfMerge,sillsdev/LfMerge,ermshiperete/LfMerge
src/LfMerge/LanguageDepotProject.cs
src/LfMerge/LanguageDepotProject.cs
// Copyright (c) 2015 SIL International // This software is licensed under the MIT license (http://opensource.org/licenses/MIT) using System; using System.Linq; using MongoDB.Bson; using MongoDB.Driver; using MongoDB.Driver.Core.Clusters; namespace LfMerge { public class LanguageDepotProject { public LanguageDepotProject(string lfProjectCode) { var client = new MongoClient("mongodb://" + LfMergeSettings.Current.MongoDbHostNameAndPort); var database = client.GetDatabase("scriptureforge"); var projectCollection = database.GetCollection<BsonDocument>("projects"); //var userCollection = database.GetCollection<BsonDocument>("users"); var projectFilter = new BsonDocument("projectCode", lfProjectCode); var list = projectCollection.Find(projectFilter).ToListAsync(); list.Wait(); var project = list.Result.FirstOrDefault(); if (project == null) throw new ArgumentException("Can't find project code", "lfProjectCode"); BsonValue value; if (project.TryGetValue("ldProjectCode", out value)) ProjectCode = value.AsString; // TODO: need to get S/R server (language depot public, language depot private, custom, etc). // TODO: ldUsername and ldPassword should come from the users collection if (project.TryGetValue("ldUsername", out value)) Username = value.AsString; if (project.TryGetValue("ldPassword", out value)) Password = value.AsString; } public string Username { get; private set; } public string Password { get; private set; } public string ProjectCode { get; private set; } } }
// Copyright (c) 2015 SIL International // This software is licensed under the MIT license (http://opensource.org/licenses/MIT) using System; using System.Linq; using MongoDB.Bson; using MongoDB.Driver; using MongoDB.Driver.Core.Clusters; namespace LfMerge { public class LanguageDepotProject { public LanguageDepotProject(string lfProjectCode) { var client = new MongoClient("mongodb://" + LfMergeSettings.Current.MongoDbHostNameAndPort); var database = client.GetDatabase("languageforge"); var collection = database.GetCollection<BsonDocument>("projects"); var filter = new BsonDocument("projectCode", lfProjectCode); var list = collection.Find(filter).ToListAsync(); list.Wait(); var project = list.Result.FirstOrDefault(); if (project == null) throw new ArgumentException("Can't find project code", "lfProjectCode"); BsonValue value; if (project.TryGetValue("ldUsername", out value)) Username = value.AsString; if (project.TryGetValue("ldPassword", out value)) Password = value.AsString; if (project.TryGetValue("ldProjectCode", out value)) ProjectCode = value.AsString; } public string Username { get; private set; } public string Password { get; private set; } public string ProjectCode { get; private set; } } }
mit
C#
2840b8cef12cca852b566fbd853b1dbd6e1e90ce
Fix incorrect variable name after last rebase
sillsdev/LfMerge,ermshiperete/LfMerge,sillsdev/LfMerge,ermshiperete/LfMerge,ermshiperete/LfMerge,sillsdev/LfMerge
src/LfMerge/LanguageForgeProject.cs
src/LfMerge/LanguageForgeProject.cs
// Copyright (c) 2015 SIL International // This software is licensed under the MIT license (http://opensource.org/licenses/MIT) using System; using System.Collections.Generic; using LfMerge.FieldWorks; namespace LfMerge { public class LanguageForgeProject: ILfProject { private static Dictionary<string, LanguageForgeProject> CachedProjects = new Dictionary<string, LanguageForgeProject>(); /// <summary> /// The prefix prepended to project codes to get the Mongo database name. /// </summary> public const string MongoDatabaseNamePrefix = "sf_"; // TODO: Should this be in the config? private FwProject _fieldWorksProject; private readonly ProcessingState _state; private readonly string _projectCode; private LanguageDepotProject _languageDepotProject; public static LanguageForgeProject Create(string projectCode) { LanguageForgeProject project; if (CachedProjects.TryGetValue(projectCode, out project)) return project; project = new LanguageForgeProject(projectCode); CachedProjects.Add(projectCode, project); return project; } private LanguageForgeProject(string projectCode) { _projectCode = projectCode; _state = ProcessingState.Deserialize(projectCode); } #region ILfProject implementation public string LfProjectCode { get { return _projectCode; } } public string MongoDatabaseName { get { return MongoDatabaseNamePrefix + LfProjectCode; } } public FwProject FieldWorksProject { get { if (_fieldWorksProject == null) { // for now we simply use the language forge project code as name for the fwdata file _fieldWorksProject = new FwProject(LfProjectCode); } return _fieldWorksProject; } } public ProcessingState State { get { return _state; } } public LanguageDepotProject LanguageDepotProject { get { if (_languageDepotProject == null) { _languageDepotProject = new LanguageDepotProject(LfProjectCode); } return _languageDepotProject; } } #endregion } }
// Copyright (c) 2015 SIL International // This software is licensed under the MIT license (http://opensource.org/licenses/MIT) using System; using System.Collections.Generic; using LfMerge.FieldWorks; namespace LfMerge { public class LanguageForgeProject: ILfProject { private static Dictionary<string, LanguageForgeProject> CachedProjects = new Dictionary<string, LanguageForgeProject>(); /// <summary> /// The prefix prepended to project codes to get the Mongo database name. /// </summary> public const string MongoDatabaseNamePrefix = "sf_"; // TODO: Should this be in the config? private FwProject _fieldWorksProject; private readonly ProcessingState _state; private readonly string _projectCode; private LanguageDepotProject _languageDepotProject; public static LanguageForgeProject Create(string projectCode) { LanguageForgeProject project; if (CachedProjects.TryGetValue(projectCode, out project)) return project; project = new LanguageForgeProject(projectCode); CachedProjects.Add(projectCode, project); return project; } private LanguageForgeProject(string projectCode) { _projectCode = projectCode; _state = ProcessingState.Deserialize(projectCode); } #region ILfProject implementation public string LfProjectCode { get { return _projectCode; } } public string MongoDatabaseName { get { return MongoDatabaseNamePrefix + LfProjectCode; } } public FwProject FieldWorksProject { get { if (_fieldWorksProject == null) { // for now we simply use the language forge project code as name for the fwdata file _fieldWorksProject = new FwProject(LfProjectCode); } return _fieldWorksProject; } } public ProcessingState State { get { return _state; } } public LanguageDepotProject LanguageDepotProject { get { if (_languageDepotProject == null) { _languageDepotProject = new LanguageDepotProject(LfProjectName); } return _languageDepotProject; } } #endregion } }
mit
C#
f48d0e98377eb78e4decc06770bcd21ef9cd83a8
Add metric retrieval via HTTP to tester
qed-/prometheus-net,andrasm/prometheus-net,ceepeeuk/prometheus-net
tester/Program.cs
tester/Program.cs
using System; using System.IO; using System.Net; using System.Reactive.Linq; using Prometheus; namespace tester { class Program { static void Main(string[] args) { var metricServer = new MetricServer(hostname:"localhost", port: 1234); metricServer.Start(); var counter = Metrics.CreateCounter("myCounter", "help text", labelNames: new []{ "method", "endpoint"}); counter.Labels("GET", "/").Inc(); counter.Labels("POST", "/cancel").Inc(); var gauge = Metrics.CreateGauge("gauge", "help text"); gauge.Inc(3.4); gauge.Dec(2.1); gauge.Set(5.3); var hist = Metrics.CreateHistogram("myHistogram", "help text", buckets: new[] { 0, 0.2, 0.4, 0.6, 0.8, 0.9 }); hist.Observe(0.4); var summary = Metrics.CreateSummary("mySummary", "help text"); summary.Observe(5.3); var random = new Random(); Observable.Interval(TimeSpan.FromSeconds(0.5)).Subscribe(l => { counter.Inc(); counter.Labels("GET", "/").Inc(2); gauge.Set(random.NextDouble() + 2); hist.Observe(random.NextDouble()); summary.Observe(random.NextDouble()); var httpRequest = (HttpWebRequest) WebRequest.Create("http://localhost:1234/metrics"); httpRequest.Method = "GET"; using (var httpResponse = (HttpWebResponse) httpRequest.GetResponse()) { var text = new StreamReader(httpResponse.GetResponseStream()).ReadToEnd(); Console.WriteLine(text); } Console.WriteLine("ENTER to quit"); }); Console.ReadLine(); metricServer.Stop(); } } }
using System; using System.Reactive.Linq; using Prometheus; namespace tester { class Program { static void Main(string[] args) { var metricServer = new MetricServer(hostname:"localhost", port: 1234); metricServer.Start(); var counter = Metrics.CreateCounter("myCounter", "help text", labelNames: new []{ "method", "endpoint"}); counter.Labels("GET", "/").Inc(); counter.Labels("POST", "/cancel").Inc(); var gauge = Metrics.CreateGauge("gauge", "help text"); gauge.Inc(3.4); gauge.Dec(2.1); gauge.Set(5.3); var hist = Metrics.CreateHistogram("myHistogram", "help text", buckets: new[] { 0, 0.2, 0.4, 0.6, 0.8, 0.9 }); hist.Observe(0.4); var summary = Metrics.CreateSummary("mySummary", "help text"); summary.Observe(5.3); var random = new Random(); Observable.Interval(TimeSpan.FromSeconds(0.5)).Subscribe(l => { counter.Inc(); counter.Labels("GET", "/").Inc(2); gauge.Set(random.NextDouble() + 2); hist.Observe(random.NextDouble()); summary.Observe(random.NextDouble()); }); Console.WriteLine("ENTER to quit"); Console.ReadLine(); metricServer.Stop(); } } }
mit
C#
f12f210261081975e6a8cc54ecd3f673b999d795
make it run again without segfaulting
wfarr/newskit,wfarr/newskit
src/Summa/Summa.Core/Application.cs
src/Summa/Summa.Core/Application.cs
/* Application.cs * * Copyright (C) 2008 Ethan Osten * * This library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see <http://www.gnu.org/licenses/>. * * Author: * Ethan Osten <senoki@gmail.com> */ using System; using Gtk; namespace Summa { namespace Core { public static class Application { public static Summa.Gui.Browser Browser; public static Summa.Gui.StatusIcon StatusIcon; public static Summa.Core.Updater Updater; public static void Main() { Gtk.Application.Init(); Browser = new Summa.Gui.Browser(); StatusIcon = new Summa.Gui.StatusIcon(); Updater = new Summa.Core.Updater(); Browser.ShowAll(); Gtk.Application.Run(); } } } }
/* Application.cs * * Copyright (C) 2008 Ethan Osten * * This library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see <http://www.gnu.org/licenses/>. * * Author: * Ethan Osten <senoki@gmail.com> */ using System; using Gtk; namespace Summa { namespace Core { public static class Application { public static Summa.Gui.Browser Browser = new Summa.Gui.Browser(); public static Summa.Gui.StatusIcon StatusIcon = new Summa.Gui.StatusIcon(); public static void Main() { Gtk.Application.Init(); Browser.ShowAll(); Gtk.Application.Run(); } } } }
mit
C#
bafcc55ab97245bcba228ff9237d938026a645a8
make HttpHanlder public
ITGlobal/cloudpayments-cash
CloudPayments.Cash/HttpHandler.cs
CloudPayments.Cash/HttpHandler.cs
using System; using System.Net.Http; using System.Net.Http.Headers; using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; namespace CloudPayments.Cash { public class HttpHandler : IHttpHandler { private readonly HttpClient _client; private readonly ILogger<IHttpHandler> _logger; public HttpHandler(CashSettings settings, ILogger<IHttpHandler> logger) { _client = new HttpClient { BaseAddress = new Uri(settings.Endpoint) }; _logger = logger; var credentials = Encoding.ASCII.GetBytes($"{settings.PublicId}:{settings.ApiSecret}"); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(credentials)); } /// <summary> /// Make requests idempotent /// </summary> /// <param name="requestId"></param> public void SetupIdempotent(string requestId) { if (requestId != null) { _logger.LogTrace($"request will be idempotent with X-Request-ID = {requestId}"); _client.DefaultRequestHeaders.Remove("X-Request-ID"); _client.DefaultRequestHeaders.Add("X-Request-ID", requestId); } } public Task<HttpResponseMessage> PostAsync(string url, HttpContent content, CancellationToken token) { return _client.PostAsync(url, content, token); } } }
using System; using System.Net.Http; using System.Net.Http.Headers; using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; namespace CloudPayments.Cash { internal class HttpHandler : IHttpHandler { private readonly HttpClient _client; private readonly ILogger<IHttpHandler> _logger; public HttpHandler(CashSettings settings, ILogger<IHttpHandler> logger) { _client = new HttpClient { BaseAddress = new Uri(settings.Endpoint) }; _logger = logger; var credentials = Encoding.ASCII.GetBytes($"{settings.PublicId}:{settings.ApiSecret}"); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(credentials)); } /// <summary> /// Make requests idempotent /// </summary> /// <param name="requestId"></param> public void SetupIdempotent(string requestId) { if (requestId != null) { _logger.LogTrace($"request will be idempotent with X-Request-ID = {requestId}"); _client.DefaultRequestHeaders.Remove("X-Request-ID"); _client.DefaultRequestHeaders.Add("X-Request-ID", requestId); } } public Task<HttpResponseMessage> PostAsync(string url, HttpContent content, CancellationToken token) { return _client.PostAsync(url, content, token); } } }
mit
C#
9e988f15444c26da635a7c219de9c388a1bac108
Configure test controller
richlander/test-repo
foo/Controllers/TestController.cs
foo/Controllers/TestController.cs
using Microsoft.AspNet.Mvc; using System.Collections.Generic; namespace MvcSample.Web { [Route("api/[controller]")] public class TestController : Controller { [HttpGet] public IEnumerable<string> GetAll() { return new string[] {"1", "two", "III"}; } } }
using Microsoft.AspNet.Mvc; using System.Collections.Generic; namespace MvcSample.Web { public class HomeController : Controller { [HttpGet] public IEnumerable<string> GetAll() { return new string[] {"1", "two", "III"}; } } }
mit
C#
169b7826bfb91ab4b2c80e49fc6c8c4859441b37
Improve packet sender seralize codes
insthync/LiteNetLibManager,insthync/LiteNetLibManager
Scripts/LiteNetLibPacketSender.cs
Scripts/LiteNetLibPacketSender.cs
using LiteNetLib; using LiteNetLib.Utils; using LiteNetLibManager; public static class LiteNetLibPacketSender { public static readonly NetDataWriter Writer = new NetDataWriter(); public static void SendPacket(NetDataWriter writer, SendOptions options, NetPeer peer, short msgType, System.Action<NetDataWriter> serializer) { writer.Reset(); writer.Put(msgType); if (serializer != null) serializer(writer); peer.Send(writer, options); } public static void SendPacket(SendOptions options, NetPeer peer, short msgType, System.Action<NetDataWriter> serializer) { SendPacket(Writer, options, peer, msgType, serializer); } public static void SendPacket<T>(NetDataWriter writer, SendOptions options, NetPeer peer, short msgType, T messageData) where T : ILiteNetLibMessage { SendPacket(writer, options, peer, msgType, messageData.Serialize); } public static void SendPacket<T>(SendOptions options, NetPeer peer, short msgType, T messageData) where T : ILiteNetLibMessage { SendPacket(Writer, options, peer, msgType, messageData); } public static void SendPacket(NetDataWriter writer, SendOptions options, NetPeer peer, short msgType) { SendPacket(writer, options, peer, msgType, null); } public static void SendPacket(SendOptions options, NetPeer peer, short msgType) { SendPacket(Writer, options, peer, msgType); } }
using LiteNetLib; using LiteNetLib.Utils; using LiteNetLibManager; public static class LiteNetLibPacketSender { public static readonly NetDataWriter Writer = new NetDataWriter(); public static void SendPacket(NetDataWriter writer, SendOptions options, NetPeer peer, short msgType, System.Action<NetDataWriter> serializer) { writer.Reset(); writer.Put(msgType); serializer(writer); peer.Send(writer, options); } public static void SendPacket(SendOptions options, NetPeer peer, short msgType, System.Action<NetDataWriter> serializer) { SendPacket(Writer, options, peer, msgType, serializer); } public static void SendPacket<T>(NetDataWriter writer, SendOptions options, NetPeer peer, short msgType, T messageData) where T : ILiteNetLibMessage { SendPacket(writer, options, peer, msgType, messageData.Serialize); } public static void SendPacket<T>(SendOptions options, NetPeer peer, short msgType, T messageData) where T : ILiteNetLibMessage { SendPacket(Writer, options, peer, msgType, messageData); } public static void SendPacket(NetDataWriter writer, SendOptions options, NetPeer peer, short msgType) { writer.Reset(); writer.Put(msgType); peer.Send(writer, options); } public static void SendPacket(SendOptions options, NetPeer peer, short msgType) { SendPacket(Writer, options, peer, msgType); } }
mit
C#
03bd613af18f9b3aac24c44e17153383420d073a
Remove stray console.log
Zyrio/ictus,Zyrio/ictus
src/Yio/Views/Home/Comment.cshtml
src/Yio/Views/Home/Comment.cshtml
<html> <head> <title>Comments</title> </head> <body> <div id="disqus_thread"></div> <script> var pageUrl; var fileId = document.location.pathname.split('/')[2]; document.title = fileId; if(!document.location.port) { pageUrl = document.location.protocol + "//" + document.location.hostname + document.location.pathname; } else { pageUrl = document.location.protocol + "//" + document.location.hostname + ":" + document.location.port + document.location.pathname; } if(!window.frameElement) { if(!document.location.port) { window.location = document.location.protocol + "//" + document.location.hostname + "/#/" + fileId; } else { window.location = document.location.protocol + "//" + document.location.hostname + ":" + document.location.port + "/#/" + fileId; } } var disqus_config = function () { this.page.url = pageUrl; this.page.identifier = fileId; }; (function() { // DON'T EDIT BELOW THIS LINE var d = document, s = d.createElement('script'); s.src = '//@(Yio.Data.Constants.AppSettingsConstant.External_DISQUS).disqus.com/embed.js'; s.setAttribute('data-timestamp', +new Date()); (d.head || d.body).appendChild(s); })(); </script> <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> </body> </html>
<html> <head> <title>Comments</title> </head> <body> <div id="disqus_thread"></div> <script> var pageUrl; var fileId = document.location.pathname.split('/')[2]; document.title = fileId; if(!document.location.port) { pageUrl = document.location.protocol + "//" + document.location.hostname + document.location.pathname; } else { pageUrl = document.location.protocol + "//" + document.location.hostname + ":" + document.location.port + document.location.pathname; } console.log(pageUrl); if(!window.frameElement) { if(!document.location.port) { window.location = document.location.protocol + "//" + document.location.hostname + "/#/" + fileId; } else { window.location = document.location.protocol + "//" + document.location.hostname + ":" + document.location.port + "/#/" + fileId; } } var disqus_config = function () { this.page.url = pageUrl; this.page.identifier = fileId; }; (function() { // DON'T EDIT BELOW THIS LINE var d = document, s = d.createElement('script'); s.src = '//@(Yio.Data.Constants.AppSettingsConstant.External_DISQUS).disqus.com/embed.js'; s.setAttribute('data-timestamp', +new Date()); (d.head || d.body).appendChild(s); })(); </script> <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> </body> </html>
mit
C#
c99e6e34471c13d93171a42aa1b8d55e67b6a0ce
update formatting
designsbyjuan/UnityLib
MusicManager.cs
MusicManager.cs
using UnityEngine; using System.Collections; using UnityEngine.UI; public class MusicManager : MonoBehaviour { private AudioSource audioSource; public AudioClip[] levelMusicArray; void Awake() { DontDestroyOnLoad(gameObject); } // Use this for initialization void Start () { audioSource = GetComponent<AudioSource>(); audioSource.clip = levelMusicArray[0]; audioSource.Play(); } public void PlayAudioClip(int audioTrack) { AudioClip audioClip = levelMusicArray[audioTrack]; if (audioClip) { audioSource.Stop(); audioSource.clip = audioClip; audioSource.Play(); } } }
using UnityEngine; using System.Collections; using UnityEngine.UI; public class MusicManager : MonoBehaviour { private AudioSource audioSource; public AudioClip[] levelMusicArray; void Awake() { DontDestroyOnLoad(gameObject); } // Use this for initialization void Start () { audioSource = GetComponent<AudioSource>(); audioSource.clip = levelMusicArray[0]; audioSource.Play(); } public void PlayAudioClip(int audioTrack) { AudioClip audioClip = levelMusicArray[audioTrack]; if (audioClip) { audioSource.Stop(); audioSource.clip = audioClip; audioSource.Play(); } } }
mit
C#
60ef1ab0a21b28085667d00039b76eb96bda3afb
Add version command
anass-b/NuSave
NuSave/Program.cs
NuSave/Program.cs
using Microsoft.Extensions.CommandLineUtils; using NuSave.Core; using System; namespace NuSave.CLI { class Program { const string Version = "1.0.0-preview.1"; static void Main(string[] args) { CommandLineApplication app = new CommandLineApplication(); var packageId = app.Option("-id", "Package ID", CommandOptionType.SingleValue); var outputDirectory = app.Option("-outputDirectory", "Output directory", CommandOptionType.SingleValue); var packageVersion = app.Option("-version", "Package version", CommandOptionType.SingleValue); var allowPreRelease = app.Option("-allowPreRelease", "Allow pre-release packages", CommandOptionType.NoValue); var allowUnlisted = app.Option("-allowUnlisted", "Allow unlisted packages", CommandOptionType.NoValue); var silent = app.Option("-silent", "Don't write anything to stdout", CommandOptionType.NoValue); var noDownload = app.Option("-noDownload", "Don't download packages", CommandOptionType.NoValue); var json = app.Option("-json", "Dependencies list will be printed in json format", CommandOptionType.NoValue); app.Command("version", (target) => { }) .OnExecute(() => { Console.WriteLine(Version); return 0; }); app.HelpOption("-? | --help | -help"); app.OnExecute(() => { string outputDirectoryStr = noDownload.HasValue() ? null : outputDirectory.Value(); var downloader = new Downloader( outputDirectory: outputDirectoryStr, id: packageId.Value(), version: packageVersion.Value(), allowPreRelease: allowPreRelease.HasValue(), allowUnlisted: allowUnlisted.HasValue(), silent: silent.HasValue(), json: json.HasValue()); downloader.ResolveDependencies(); if (!noDownload.HasValue()) { downloader.Download(); } return 0; }); app.Execute(args); } } }
using Microsoft.Extensions.CommandLineUtils; using NuSave.Core; namespace NuSave.CLI { class Program { static void Main(string[] args) { CommandLineApplication app = new CommandLineApplication(); var packageId = app.Option("-id", "Package ID", CommandOptionType.SingleValue); var outputDirectory = app.Option("-outputDirectory", "Output directory", CommandOptionType.SingleValue); var packageVersion = app.Option("-version", "Package version", CommandOptionType.SingleValue); var allowPreRelease = app.Option("-allowPreRelease", "Allow pre-release packages", CommandOptionType.NoValue); var allowUnlisted = app.Option("-allowUnlisted", "Allow unlisted packages", CommandOptionType.NoValue); var silent = app.Option("-silent", "Don't write anything to stdout", CommandOptionType.NoValue); var noDownload = app.Option("-noDownload", "Don't download packages", CommandOptionType.NoValue); var json = app.Option("-json", "Dependencies list will be printed in json format", CommandOptionType.NoValue); app.HelpOption("-? | --help | -help"); app.OnExecute(() => { string outputDirectoryStr = noDownload.HasValue() ? null : outputDirectory.Value(); var downloader = new Downloader( outputDirectory: outputDirectoryStr, id: packageId.Value(), version: packageVersion.Value(), allowPreRelease: allowPreRelease.HasValue(), allowUnlisted: allowUnlisted.HasValue(), silent: silent.HasValue(), json: json.HasValue()); downloader.ResolveDependencies(); if (!noDownload.HasValue()) { downloader.Download(); } return 0; }); app.Execute(args); } } }
mit
C#
de6d6c29e7c5c30a311426006ec16963ad4e63ba
Update Debug.cs
kerzyte/OWLib,overtools/OWLib
OverTool/Debug.cs
OverTool/Debug.cs
using System; using System.Collections.Generic; using System.IO; using CASCExplorer; using OWLib; using OWLib.Types.STUD; namespace OverTool { public class Debug : IOvertool { public string Help => "No additional arguments"; public uint MinimumArgs => 0; public char Opt => '~'; public string Title => "Debug"; public ushort[] Track => new ushort[0]; public bool Display => System.Diagnostics.Debugger.IsAttached; public void Parse(Dictionary<ushort, List<ulong>> track, Dictionary<ulong, Record> map, CASCHandler handler, bool quiet, OverToolFlags flags) { foreach (KeyValuePair<ushort, List<ulong>> pair in track) { Console.Out.WriteLine($"{pair.Key:X3} {pair.Value.Count} entries"); } } } }
using System; using System.Collections.Generic; using System.IO; using CASCExplorer; using OWLib; using OWLib.Types.STUD; namespace OverTool { public class Debug : IOvertool { public string Help => "No additional arguments"; public uint MinimumArgs => 0; public char Opt => '~'; public string Title => "Debug"; public ushort[] Track => new ushort[1] { 0xA6 }; public bool Display => System.Diagnostics.Debugger.IsAttached; public void Parse(Dictionary<ushort, List<ulong>> track, Dictionary<ulong, Record> map, CASCHandler handler, bool quiet, OverToolFlags flags) { foreach (KeyValuePair<ushort, List<ulong>> pair in track) { Console.Out.WriteLine($"{pair.Key:X3} {pair.Value.Count} entries"); } // Code for rapidly finding what zero values are. foreach (ulong key in track[0xA6]) { using (Stream stream = Util.OpenFile(map[key], handler)) { STUD stud = new STUD(stream); if (stud.Instances == null) { continue; } if (stud.Instances[0] is TextureOverride @override) { if (@override.Header.unknown2 > 0 || @override.Header.unknown4 > 0 || @override.Header.unknown7 > 0 || @override.Header.unknown12.key > 0 || @override.Header.unknown13 > 0) { System.Diagnostics.Debugger.Break(); } } } } } } }
mit
C#
771fd8aa02a8c96b07f3c11b22bf927d62a29672
clear luabinder
tenvick/hugular_cstolua,tenvick/hugular_cstolua,tenvick/hugular_cstolua,tenvick/hugular_cstolua,tenvick/hugular_cstolua,tenvick/hugular_cstolua,tenvick/hugular_cstolua
Client/Assets/Source/Base/LuaBinder.cs
Client/Assets/Source/Base/LuaBinder.cs
using System; public static class LuaBinder { public static void Bind(IntPtr L) { } }
using System; public static class LuaBinder { public static void Bind(IntPtr L) { ActivateMonosWrap.Register(L); AnimationBlendModeWrap.Register(L); AnimationClipWrap.Register(L); AnimationStateWrap.Register(L); AnimationWrap.Register(L); ApplicationWrap.Register(L); AssetBundleWrap.Register(L); AsyncOperationWrap.Register(L); AudioClipWrap.Register(L); AudioSourceWrap.Register(L); BehaviourWrap.Register(L); BlendWeightsWrap.Register(L); BoxColliderWrap.Register(L); CameraClearFlagsWrap.Register(L); CameraWrap.Register(L); CEventReceiveWrap.Register(L); CharacterControllerWrap.Register(L); CHighwayWrap.Register(L); ColliderWrap.Register(L); ComponentWrap.Register(L); CRequestWrap.Register(L); CryptographHelperWrap.Register(L); CTransportWrap.Register(L); CUtilsWrap.Register(L); DebuggerWrap.Register(L); DelegateWrap.Register(L); EnumWrap.Register(L); FileHelperWrap.Register(L); GameObjectWrap.Register(L); IEnumeratorWrap.Register(L); InputWrap.Register(L); iTweenWrap.Register(L); KeyCodeWrap.Register(L); LeanTweenTypeWrap.Register(L); LeanTweenWrap.Register(L); LHighwayWrap.Register(L); LightTypeWrap.Register(L); LightWrap.Register(L); LNetWrap.Register(L); LocalizationWrap.Register(L); LRequestWrap.Register(L); LuaHelperWrap.Register(L); MaterialWrap.Register(L); MeshColliderWrap.Register(L); MeshRendererWrap.Register(L); MonoBehaviourWrap.Register(L); MsgWrap.Register(L); NGUIMathWrap.Register(L); NGUIToolsWrap.Register(L); ObjectWrap.Register(L); ParticleAnimatorWrap.Register(L); ParticleEmitterWrap.Register(L); ParticleRendererWrap.Register(L); ParticleSystemWrap.Register(L); PhysicsWrap.Register(L); PlayModeWrap.Register(L); PLuaWrap.Register(L); QualitySettingsWrap.Register(L); QueueModeWrap.Register(L); RendererWrap.Register(L); RenderSettingsWrap.Register(L); RenderTextureWrap.Register(L); RuntimePlatformWrap.Register(L); ScreenWrap.Register(L); ScrollRectItemWrap.Register(L); ScrollRectTableWrap.Register(L); SkinnedMeshRendererWrap.Register(L); SleepTimeoutWrap.Register(L); SpaceWrap.Register(L); SphereColliderWrap.Register(L); stringWrap.Register(L); System_ObjectWrap.Register(L); TextureWrap.Register(L); TimeWrap.Register(L); TouchPhaseWrap.Register(L); TrackedReferenceWrap.Register(L); TransformWrap.Register(L); TypeWrap.Register(L); UGUIEventWrap.Register(L); UGUILocalizeWrap.Register(L); UIEventLuaTriggerWrap.Register(L); UnityEngine_EventSystems_EventSystemWrap.Register(L); UnityEngine_EventSystems_UIBehaviourWrap.Register(L); UnityEngine_Events_UnityEventBaseWrap.Register(L); UnityEngine_Events_UnityEventWrap.Register(L); UnityEngine_UI_ButtonWrap.Register(L); UnityEngine_UI_Button_ButtonClickedEventWrap.Register(L); UnityEngine_UI_GraphicWrap.Register(L); UnityEngine_UI_ImageWrap.Register(L); UnityEngine_UI_InputFieldWrap.Register(L); UnityEngine_UI_MaskableGraphicWrap.Register(L); UnityEngine_UI_ScrollbarWrap.Register(L); UnityEngine_UI_SelectableWrap.Register(L); UnityEngine_UI_SliderWrap.Register(L); UnityEngine_UI_TextWrap.Register(L); Vector3Wrap.Register(L); Vector4Wrap.Register(L); VerticalWrapModeWrap.Register(L); WebCamDeviceWrap.Register(L); WebCamFlagsWrap.Register(L); WebCamTextureWrap.Register(L); WindZoneModeWrap.Register(L); WindZoneWrap.Register(L); WrapModeWrap.Register(L); WWWFormWrap.Register(L); WWWWrap.Register(L); } }
mit
C#
3187737cbbde754f37979c884b3cdfcc34d9c743
Remove XmlFormatter
minato128/Horesase-Web-API,minato128/Horesase-Web-API
Horesase.Web/App_Start/WebApiConfig.cs
Horesase.Web/App_Start/WebApiConfig.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web.Http; namespace Horesase.Web { public static class WebApiConfig { public static void Register(HttpConfiguration config) { config.Formatters.Remove(config.Formatters.XmlFormatter); config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web.Http; namespace Horesase.Web { public static class WebApiConfig { public static void Register(HttpConfiguration config) { // Web API の設定およびサービス // Web API ルート config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); } } }
mit
C#
36e480d9aa571b0fb548a23cd2cd8d44277bfbad
Make the sandbox example even more complex
joelverhagen/SocketToMe
Knapcode.SocketToMe.Sandbox/Program.cs
Knapcode.SocketToMe.Sandbox/Program.cs
using System; using System.Net; using System.Net.Http; using Knapcode.SocketToMe.Http; using Knapcode.SocketToMe.Socks; namespace Knapcode.SocketToMe.Sandbox { public class Program { private static void Main() { var endpoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9150); var client = new Socks5Client(); var socket = client.ConnectToServer(endpoint); socket = client.ConnectToDestination(socket, "icanhazip.com", 443); var httpClient = new HttpClient(new NetworkHandler(socket)); var response = httpClient.GetAsync("https://icanhazip.com/").Result; Console.WriteLine(response.Content.ReadAsStringAsync().Result); } } }
using System; using System.Net; using System.Net.Http; using Knapcode.SocketToMe.Http; using Knapcode.SocketToMe.Socks; namespace Knapcode.SocketToMe.Sandbox { public class Program { private static void Main() { var endpoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9150); var client = new Socks5Client(); var socket = client.ConnectToServer(endpoint); socket = client.ConnectToDestination(socket, "icanhazip.com", 80); var httpClient = new HttpClient(new NetworkHandler(socket)); var response = httpClient.GetAsync("http://icanhazip.com/").Result; Console.WriteLine(response.Content.ReadAsStringAsync().Result); } } }
mit
C#
1147aee96a71b779e70a9fc4ec97f8bb03e0fcaf
test Struct marked as internal.
impworks/lens
Lens.Test/TestClassHierarchy/Struct.cs
Lens.Test/TestClassHierarchy/Struct.cs
namespace Lens.Test.TestClassHierarchy { internal struct Struct { } }
namespace Lens.Test.TestClassHierarchy { struct Struct { } }
mit
C#
3c06979880b4eb6d2a6895097411e9a7b77c936f
Create a non-generic interface for aggregate roots
liemqv/EventFlow,AntoineGa/EventFlow,rasmus/EventFlow
Source/EventFlow/Aggregates/IAggregateRoot.cs
Source/EventFlow/Aggregates/IAggregateRoot.cs
// The MIT License (MIT) // // Copyright (c) 2015 Rasmus Mikkelsen // https://github.com/rasmus/EventFlow // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do so, // subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using EventFlow.EventStores; namespace EventFlow.Aggregates { public interface IAggregateRoot { IAggregateName Name { get; } int Version { get; } IEnumerable<IAggregateEvent> UncommittedEvents { get; } bool IsNew { get; } Task<IReadOnlyCollection<IDomainEvent>> CommitAsync(IEventStore eventStore, CancellationToken cancellationToken); void ApplyEvents(IEnumerable<IAggregateEvent> aggregateEvents); void ApplyEvents(IReadOnlyCollection<IDomainEvent> domainEvents); } public interface IAggregateRoot<out TIdentity> : IAggregateRoot where TIdentity : IIdentity { TIdentity Id { get; } } }
// The MIT License (MIT) // // Copyright (c) 2015 Rasmus Mikkelsen // https://github.com/rasmus/EventFlow // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do so, // subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using EventFlow.EventStores; namespace EventFlow.Aggregates { public interface IAggregateRoot<out TIdentity> where TIdentity : IIdentity { IAggregateName Name { get; } TIdentity Id { get; } int Version { get; } bool IsNew { get; } IEnumerable<IAggregateEvent> UncommittedEvents { get; } Task<IReadOnlyCollection<IDomainEvent>> CommitAsync(IEventStore eventStore, CancellationToken cancellationToken); void ApplyEvents(IEnumerable<IAggregateEvent> aggregateEvents); void ApplyEvents(IReadOnlyCollection<IDomainEvent> domainEvents); } }
mit
C#
10dd13c298472b2e21603e35ee691861db441864
Update AppCenterEventTelemeter.cs
tiksn/TIKSN-Framework
TIKSN.Framework.SharedMobile/Analytics/Telemetry/AppCenterEventTelemeter.cs
TIKSN.Framework.SharedMobile/Analytics/Telemetry/AppCenterEventTelemeter.cs
using System.Collections.Generic; using System.Threading.Tasks; using AppCenterAnalytics = Microsoft.AppCenter.Analytics.Analytics; namespace TIKSN.Analytics.Telemetry { public class AppCenterEventTelemeter : IEventTelemeter { public Task TrackEventAsync(string name) { return TrackEventAsync(name, null); } public Task TrackEventAsync(string name, IDictionary<string, string> properties) { AppCenterAnalytics.TrackEvent(name, properties); return Task.FromResult<object>(null); } } }
using System.Collections.Generic; using System.Threading.Tasks; using AppCenterAnalytics = Microsoft.AppCenter.Analytics.Analytics; namespace TIKSN.Analytics.Telemetry { public class AppCenterEventTelemeter : IEventTelemeter { public Task TrackEvent(string name) { return TrackEvent(name, null); } public Task TrackEvent(string name, IDictionary<string, string> properties) { AppCenterAnalytics.TrackEvent(name, properties); return Task.FromResult<object>(null); } } }
mit
C#
59e9d7e9fc9db87c13dff696f2759d13692b430e
Change middle and right mosue button.
V10lator/Ultimate-Cam
FpsMouse.cs
FpsMouse.cs
using UnityEngine; namespace UltimateCam { internal class FpsMouse : MonoBehaviour { internal enum MOUSEBUTTON { LEFT = 0, MIDDLE = 2, RIGHT = 1 } private const float _sensitivity = 10.0F; private const float _yRad = 180.0f; private const float _xRad = 222.22f; private float yaw = 0.0f; private float pitch = 0.0f; internal void reset() { yaw = pitch = 0.0f; } private float keepInCircle(float f) { while (f > 360) f -= 360; while (f < 0) f += 360; return f; } private float limit(float f, float rad) { float h = rad / 2.0f; if (f > h) f = h; else if (f < -h) f = -h; return f; } void Update() { yaw += Input.GetAxis ("Mouse X") * _sensitivity; pitch -= Input.GetAxis ("Mouse Y") * _sensitivity; // Limit vertical head movement pitch = limit(pitch, _yRad); Vector3 euler; if (UltimateCam.riding) { // Limit horizontal head movement yaw = limit(yaw, _xRad); euler = transform.parent.eulerAngles; euler = new Vector3(keepInCircle(euler.x + pitch), keepInCircle(euler.y + yaw), euler.z); } else { yaw = keepInCircle(yaw); euler = new Vector3(pitch, yaw, 0.0f); } transform.eulerAngles = euler; } } }
using UnityEngine; namespace UltimateCam { internal class FpsMouse : MonoBehaviour { internal enum MOUSEBUTTON { LEFT = 0, MIDDLE = 1, RIGHT = 2 } private const float _sensitivity = 10.0F; private const float _yRad = 180.0f; private const float _xRad = 222.22f; private float yaw = 0.0f; private float pitch = 0.0f; internal void reset() { yaw = pitch = 0.0f; } private float keepInCircle(float f) { while (f > 360) f -= 360; while (f < 0) f += 360; return f; } private float limit(float f, float rad) { float h = rad / 2.0f; if (f > h) f = h; else if (f < -h) f = -h; return f; } void Update() { yaw += Input.GetAxis ("Mouse X") * _sensitivity; pitch -= Input.GetAxis ("Mouse Y") * _sensitivity; // Limit vertical head movement pitch = limit(pitch, _yRad); Vector3 euler; if (UltimateCam.riding) { // Limit horizontal head movement yaw = limit(yaw, _xRad); euler = transform.parent.eulerAngles; euler = new Vector3(keepInCircle(euler.x + pitch), keepInCircle(euler.y + yaw), euler.z); } else { yaw = keepInCircle(yaw); euler = new Vector3(pitch, yaw, 0.0f); } transform.eulerAngles = euler; } } }
mit
C#
57f2556a1b7abd3b7d67ac282c6d86eceee3a42e
Add SerializeTest
runceel/ReactiveProperty,runceel/ReactiveProperty,runceel/ReactiveProperty
Test/ReactiveProperty.Tests/Helpers/SerializeHelperTest.cs
Test/ReactiveProperty.Tests/Helpers/SerializeHelperTest.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Reactive.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using Codeplex.Reactive; using Codeplex.Reactive.Helpers; using System.Runtime.Serialization; using System.IO; using System.Xml.Serialization; namespace ReactiveProperty.Tests.Serialization { [TestClass] public class SerializeHelperTest { [Ignore] // currently not supported recursive serialize [TestMethod] public void RecursiveSerializeTest() { var p = new Parent(); p.Child.Value = new Child(); p.Child.Value.Name.Value = "Tanaka"; var data = SerializeHelper.PackReactivePropertyValue(p); data.IsNotNull(); } [TestMethod] public void FlatClassSerializeTest() { var p = new Person(); p.Name = "tanaka"; p.Age.Value = 10; p.Is(o => o.Name == "tanaka" && o.Age.Value == 10 && o.Profile.Value == "tanaka 10"); var s = new XmlSerializer(typeof(Person)); var ms = new MemoryStream(); // serialize normal property value s.Serialize(ms, p); // serialize rx property value var packedData = SerializeHelper.PackReactivePropertyValue(p); ms.Seek(0, SeekOrigin.Begin); var restored = s.Deserialize(ms) as Person; SerializeHelper.UnpackReactivePropertyValue(restored, packedData); restored.Is(o => o.Name == "tanaka" && o.Age.Value == 10 && o.Profile.Value == "tanaka 10"); } } [DataContract] public class Parent { public Parent() { this.Child = new ReactiveProperty<Child>(); } public ReactiveProperty<Child> Child { get; private set; } } [DataContract] public class Child { public Child() { this.Name = new ReactiveProperty<string>(); } public ReactiveProperty<string> Name { get; private set; } } public class Person { public string Name { get; set; } [XmlIgnore] public ReactiveProperty<int> Age { get; private set; } [XmlIgnore] public ReactiveProperty<string> Profile { get; private set; } public Person() { this.Age = new ReactiveProperty<int>(); this.Profile = this.Age .Select(i => string.Format("{0} {1}", this.Name, i)) .ToReactiveProperty(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; using Codeplex.Reactive; using Codeplex.Reactive.Helpers; using System.Runtime.Serialization; namespace ReactiveProperty.Tests.Serialization { [TestClass] public class SerializeHelperTest { [Ignore] // currently not supported recursive serialize [TestMethod] public void SerializeTest() { var p = new Parent(); p.Child.Value = new Child(); p.Child.Value.Name.Value = "Tanaka"; var data = SerializeHelper.PackReactivePropertyValue(p); data.IsNotNull(); } } [DataContract] public class Parent { public Parent() { this.Child = new ReactiveProperty<Child>(); } public ReactiveProperty<Child> Child { get; private set; } } [DataContract] public class Child { public Child() { this.Name = new ReactiveProperty<string>(); } public ReactiveProperty<string> Name { get; private set; } } }
mit
C#
2c4cf384bf064527a4a07a8ed325755a07eb6dcb
Remove check
stofte/ream-query
tools/ReamQuery.RefDumper/Helper.cs
tools/ReamQuery.RefDumper/Helper.cs
namespace ReamQuery.RefDumper { using System; using System.IO; using System.Reflection; public static class Helper { public static string ApplicationPath { get { return new Uri(Assembly.GetEntryAssembly().CodeBase).LocalPath; } } public static string ProjectFolder { get { var path = Path.GetDirectoryName(ApplicationPath); // assume this is run in the source folder layout return Path.GetFullPath(Path.Combine(path, "..", "..", "..", "..", "..")); } } } }
namespace ReamQuery.RefDumper { using System; using System.IO; using System.Reflection; public static class Helper { public static string ApplicationPath { get { return new Uri(Assembly.GetEntryAssembly().CodeBase).LocalPath; } } public static string ProjectFolder { get { var path = Path.GetDirectoryName(ApplicationPath); if (!path.EndsWith(@"tools\ReamQuery.RefDumper\bin\Debug\netcoreapp2.0")) { throw new InvalidOperationException("Unexpected path"); } return Path.GetFullPath(Path.Combine(path, "..", "..", "..", "..", "..")); } } } }
mit
C#
bc603108ef7d01d78d5d8ba90584d73a9bf0a169
Fix IsActive default when hand preference not explicitly set.
AlexBream/WindowsStateTriggers,dinhchitrung/WindowsStateTriggers,ScottIsAFool/WindowsStateTriggers,onovotny/WindowsStateTriggers,dotMorten/WindowsStateTriggers,Viachaslau-Zinkevich/WindowsStateTriggers,karl-barkmann/WindowsStateTriggers
src/WindowsStateTriggers/UserHandPreferenceStateTrigger.cs
src/WindowsStateTriggers/UserHandPreferenceStateTrigger.cs
// Copyright (c) Morten Nielsen. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using Windows.Foundation.Metadata; using Windows.UI.ViewManagement; using Windows.UI.Xaml; namespace WindowsStateTriggers { /// <summary> /// Trigger for switching UI based on whether the user favours their left or right hand. /// </summary> public class UserHandPreferenceStateTrigger : StateTriggerBase, ITriggerValue { private static HandPreference handPreference; static UserHandPreferenceStateTrigger() { handPreference = new Windows.UI.ViewManagement.UISettings().HandPreference; } /// <summary> /// Initializes a new instance of the <see cref="UserHandPreferenceStateTrigger"/> class. /// </summary> public UserHandPreferenceStateTrigger() { IsActive = (handPreference == HandPreference.RightHanded); } /// <summary> /// Gets or sets the hand preference to trigger on. /// </summary> /// <value>A value from the <see cref="Windows.UI.ViewManagement.HandPreference"/> enum.</value> public HandPreference HandPreference { get { return (HandPreference)GetValue(HandPreferenceProperty); } set { SetValue(HandPreferenceProperty, value); } } /// <summary> /// Identifies the <see cref="HandPreference"/> DependencyProperty /// </summary> public static readonly DependencyProperty HandPreferenceProperty = DependencyProperty.Register("HandPreference", typeof(HandPreference), typeof(UserHandPreferenceStateTrigger), new PropertyMetadata(Windows.UI.ViewManagement.HandPreference.RightHanded, OnHandPreferencePropertyChanged)); private static void OnHandPreferencePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var obj = (UserHandPreferenceStateTrigger)d; var val = (HandPreference)e.NewValue; obj.IsActive = (handPreference == val); } #region ITriggerValue private bool m_IsActive; /// <summary> /// Gets a value indicating whether this trigger is active. /// </summary> /// <value><c>true</c> if this trigger is active; otherwise, <c>false</c>.</value> public bool IsActive { get { return m_IsActive; } private set { if (m_IsActive != value) { m_IsActive = value; base.SetActive(value); if (IsActiveChanged != null) IsActiveChanged(this, EventArgs.Empty); } } } /// <summary> /// Occurs when the <see cref="IsActive" /> property has changed. /// </summary> public event EventHandler IsActiveChanged; #endregion ITriggerValue } }
// Copyright (c) Morten Nielsen. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using Windows.Foundation.Metadata; using Windows.UI.ViewManagement; using Windows.UI.Xaml; namespace WindowsStateTriggers { /// <summary> /// Trigger for switching UI based on whether the user favours their left or right hand. /// </summary> public class UserHandPreferenceStateTrigger : StateTriggerBase, ITriggerValue { private static HandPreference handPreference; static UserHandPreferenceStateTrigger() { handPreference = new Windows.UI.ViewManagement.UISettings().HandPreference; } /// <summary> /// Initializes a new instance of the <see cref="UserHandPreferenceStateTrigger"/> class. /// </summary> public UserHandPreferenceStateTrigger() { IsActive = (this.HandPreference == handPreference); } /// <summary> /// Gets or sets the hand preference to trigger on. /// </summary> /// <value>A value from the <see cref="Windows.UI.ViewManagement.HandPreference"/> enum.</value> public HandPreference HandPreference { get { return (HandPreference)GetValue(HandPreferenceProperty); } set { SetValue(HandPreferenceProperty, value); } } /// <summary> /// Identifies the <see cref="HandPreference"/> DependencyProperty /// </summary> public static readonly DependencyProperty HandPreferenceProperty = DependencyProperty.Register("HandPreference", typeof(HandPreference), typeof(UserHandPreferenceStateTrigger), new PropertyMetadata(Windows.UI.ViewManagement.HandPreference.RightHanded, OnHandPreferencePropertyChanged)); private static void OnHandPreferencePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var obj = (UserHandPreferenceStateTrigger)d; var val = (HandPreference)e.NewValue; obj.IsActive = (handPreference == val); } #region ITriggerValue private bool m_IsActive; /// <summary> /// Gets a value indicating whether this trigger is active. /// </summary> /// <value><c>true</c> if this trigger is active; otherwise, <c>false</c>.</value> public bool IsActive { get { return m_IsActive; } private set { if (m_IsActive != value) { m_IsActive = value; base.SetActive(value); if (IsActiveChanged != null) IsActiveChanged(this, EventArgs.Empty); } } } /// <summary> /// Occurs when the <see cref="IsActive" /> property has changed. /// </summary> public event EventHandler IsActiveChanged; #endregion ITriggerValue } }
mit
C#
e21c61152b8d57471121f0faaaa585d23238c835
Add event method to TraceLogging test.
brianrob/coretests,brianrob/coretests
managed/tracelogging/Program.cs
managed/tracelogging/Program.cs
using System; using System.Diagnostics.Tracing; namespace tracelogging { public sealed class MySource : EventSource { MySource() : base(EventSourceSettings.EtwSelfDescribingEventFormat) { } [Event(1)] public void TestEventMethod(int i, string s) { WriteEvent(1, i, s); } public static MySource Logger = new MySource(); } class Program { static void Main(string[] args) { MySource.Logger.TestEventMethod(1, "Hello World!"); MySource.Logger.Write("TestEvent", new { field1 = "Hello", field2 = 3, field3 = 6 }); MySource.Logger.Write("TestEvent1", new { field1 = "Hello", field2 = 3, }); MySource.Logger.Write("TestEvent2", new { field1 = "Hello" }); MySource.Logger.Write("TestEvent3", new { field1 = new byte[10] }); } } }
using System; using System.Diagnostics.Tracing; namespace tracelogging { public sealed class MySource : EventSource { MySource() : base(EventSourceSettings.EtwSelfDescribingEventFormat) { } public static MySource Logger = new MySource(); } class Program { static void Main(string[] args) { MySource.Logger.Write("TestEvent", new { field1 = "Hello", field2 = 3, field3 = 6 }); MySource.Logger.Write("TestEvent1", new { field1 = "Hello", field2 = 3, }); MySource.Logger.Write("TestEvent2", new { field1 = "Hello" }); MySource.Logger.Write("TestEvent3", new { field1 = new byte[10] }); } } }
mit
C#
4dcdb15f723ad5ca9ada13d4a3958052ecfc95c7
Fix version and update copyright
ofetisov/Xamarin.Auth,LoQIStar/Xamarin.Auth,xamarin/Xamarin.Auth,durandt/Xamarin.Auth,dbelcher/Xamarin.Auth,xamarin/Xamarin.Auth,jorik041/Xamarin.Auth,severino32/Xamarin.Auth,xamarin/Xamarin.Auth,YoupHulsebos/Xamarin.Auth,nachocove/Xamarin.Auth
src/Xamarin.Auth/AssemblyInfo.cs
src/Xamarin.Auth/AssemblyInfo.cs
// // Copyright 2012, Xamarin 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.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("Xamarin.Auth")] [assembly: AssemblyDescription("Cross platform authentication library")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Xamarin Inc.")] [assembly: AssemblyProduct("Xamarin.Auth")] [assembly: AssemblyCopyright("2012-2013 Xamarin Inc.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion("1.0.2.0")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")]
// // Copyright 2012, Xamarin 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.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("Xamarin.Auth")] [assembly: AssemblyDescription("Cross platform authentication library")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Xamarin Inc.")] [assembly: AssemblyProduct("Xamarin.Auth")] [assembly: AssemblyCopyright("2012 Xamarin Inc.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion("1.0.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")]
apache-2.0
C#
2ffc2f7bd8ca3bdd0c22f94bf813d929952f70a6
Update UnitOfWorkBase.cs
tiksn/TIKSN-Framework
TIKSN.Core/Data/UnitOfWorkBase.cs
TIKSN.Core/Data/UnitOfWorkBase.cs
using System; using System.Threading; using System.Threading.Tasks; namespace TIKSN.Data { public abstract class UnitOfWorkBase : IUnitOfWork { public abstract Task CompleteAsync(CancellationToken cancellationToken); public abstract Task DiscardAsync(CancellationToken cancellationToken); public virtual void Dispose() { if (this.IsDirty()) { throw new InvalidOperationException("Unit of work disposed without completion."); } } public async ValueTask DisposeAsync() { if (this.IsDirty()) { await this.DiscardAsync(default); } } protected abstract bool IsDirty(); } }
using System; using System.Threading; using System.Threading.Tasks; namespace TIKSN.Data { public abstract class UnitOfWorkBase : IUnitOfWork { public abstract Task CompleteAsync(CancellationToken cancellationToken); public abstract Task DiscardAsync(CancellationToken cancellationToken); public virtual void Dispose() { if (IsDirty()) { throw new InvalidOperationException("Unit of work disposed without completion."); } } public async ValueTask DisposeAsync() { if (IsDirty()) { await DiscardAsync(default); } } protected abstract bool IsDirty(); } }
mit
C#
47247be4e3d77cf462b0e8b84a5fe4dbcf21796d
Increase max password from 100 to 150 Resolves: https://github.com/zkSNACKs/WalletWasabi/issues/1103
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi/Helpers/Constants.cs
WalletWasabi/Helpers/Constants.cs
using NBitcoin; using NBitcoin.Protocol; using System; using WalletWasabi.Backend.Models.Responses; namespace WalletWasabi.Helpers { public static class Constants { public static readonly Version ClientVersion = new Version(1, 1, 0); public const string BackendMajorVersion = "3"; public static readonly VersionsResponse VersionsResponse = new VersionsResponse { ClientVersion = ClientVersion.ToString(), BackenMajordVersion = BackendMajorVersion }; public const uint ProtocolVersion_WITNESS_VERSION = 70012; public const int MaxPasswordLength = 150; public static readonly NodeRequirement NodeRequirements = new NodeRequirement { RequiredServices = NodeServices.NODE_WITNESS, MinVersion = ProtocolVersion_WITNESS_VERSION, MinProtocolCapabilities = new ProtocolCapabilities { SupportGetBlock = true, SupportWitness = true, SupportMempoolQuery = true } }; public const int P2wpkhInputSizeInBytes = 41; public const int P2pkhInputSizeInBytes = 145; public const int OutputSizeInBytes = 33; // https://en.bitcoin.it/wiki/Bitcoin // There are a maximum of 2,099,999,997,690,000 Bitcoin elements (called satoshis), which are currently most commonly measured in units of 100,000,000 known as BTC. Stated another way, no more than 21 million BTC can ever be created. public const long MaximumNumberOfSatoshis = 2099999997690000; private static readonly BitcoinWitPubKeyAddress MainNetCoordinatorAddress = new BitcoinWitPubKeyAddress("bc1qs604c7jv6amk4cxqlnvuxv26hv3e48cds4m0ew", Network.Main); private static readonly BitcoinWitPubKeyAddress TestNetCoordinatorAddress = new BitcoinWitPubKeyAddress("tb1qecaheev3hjzs9a3w9x33wr8n0ptu7txp359exs", Network.TestNet); private static readonly BitcoinWitPubKeyAddress RegTestCoordinatorAddress = new BitcoinWitPubKeyAddress("bcrt1qangxrwyej05x9mnztkakk29s4yfdv4n586gs8l", Network.RegTest); public static BitcoinWitPubKeyAddress GetCoordinatorAddress(Network network) { Guard.NotNull(nameof(network), network); if (network == Network.Main) { return MainNetCoordinatorAddress; } if (network == Network.TestNet) { return TestNetCoordinatorAddress; } // else regtest return RegTestCoordinatorAddress; } public const string ChangeOfSpecialLabelStart = "change of ("; public const string ChangeOfSpecialLabelEnd = ")"; } }
using NBitcoin; using NBitcoin.Protocol; using System; using WalletWasabi.Backend.Models.Responses; namespace WalletWasabi.Helpers { public static class Constants { public static readonly Version ClientVersion = new Version(1, 1, 0); public const string BackendMajorVersion = "3"; public static readonly VersionsResponse VersionsResponse = new VersionsResponse { ClientVersion = ClientVersion.ToString(), BackenMajordVersion = BackendMajorVersion }; public const uint ProtocolVersion_WITNESS_VERSION = 70012; public const int MaxPasswordLength = 100; public static readonly NodeRequirement NodeRequirements = new NodeRequirement { RequiredServices = NodeServices.NODE_WITNESS, MinVersion = ProtocolVersion_WITNESS_VERSION, MinProtocolCapabilities = new ProtocolCapabilities { SupportGetBlock = true, SupportWitness = true, SupportMempoolQuery = true } }; public const int P2wpkhInputSizeInBytes = 41; public const int P2pkhInputSizeInBytes = 145; public const int OutputSizeInBytes = 33; // https://en.bitcoin.it/wiki/Bitcoin // There are a maximum of 2,099,999,997,690,000 Bitcoin elements (called satoshis), which are currently most commonly measured in units of 100,000,000 known as BTC. Stated another way, no more than 21 million BTC can ever be created. public const long MaximumNumberOfSatoshis = 2099999997690000; private static readonly BitcoinWitPubKeyAddress MainNetCoordinatorAddress = new BitcoinWitPubKeyAddress("bc1qs604c7jv6amk4cxqlnvuxv26hv3e48cds4m0ew", Network.Main); private static readonly BitcoinWitPubKeyAddress TestNetCoordinatorAddress = new BitcoinWitPubKeyAddress("tb1qecaheev3hjzs9a3w9x33wr8n0ptu7txp359exs", Network.TestNet); private static readonly BitcoinWitPubKeyAddress RegTestCoordinatorAddress = new BitcoinWitPubKeyAddress("bcrt1qangxrwyej05x9mnztkakk29s4yfdv4n586gs8l", Network.RegTest); public static BitcoinWitPubKeyAddress GetCoordinatorAddress(Network network) { Guard.NotNull(nameof(network), network); if (network == Network.Main) { return MainNetCoordinatorAddress; } if (network == Network.TestNet) { return TestNetCoordinatorAddress; } // else regtest return RegTestCoordinatorAddress; } public const string ChangeOfSpecialLabelStart = "change of ("; public const string ChangeOfSpecialLabelEnd = ")"; } }
mit
C#
c5f1048e976cfe6c86a7249cdf91030ec07065a8
Disable a warning
WolfspiritM/Colore,CoraleStudios/Colore
Corale.Colore.Tester/Classes/DelegateCommand.cs
Corale.Colore.Tester/Classes/DelegateCommand.cs
 namespace Corale.Colore.Tester.Classes { using System; using System.Windows.Input; public class DelegateCommand : ICommand { public DelegateCommand(Action action) { this.CommandAction = action; } #pragma warning disable CS0067 public event EventHandler CanExecuteChanged; #pragma warning restore CS0067 public Action CommandAction { get; } public void Execute(object parameter) { this.CommandAction(); } public bool CanExecute(object parameter) { return true; } } }
 namespace Corale.Colore.Tester.Classes { using System; using System.Windows.Input; public class DelegateCommand : ICommand { public DelegateCommand(Action action) { this.CommandAction = action; } public event EventHandler CanExecuteChanged; public Action CommandAction { get; } public void Execute(object parameter) { this.CommandAction(); } public bool CanExecute(object parameter) { return true; } } }
mit
C#
3736083da8e887e52ae98587d06311305635cfcd
Update benchmark and add worst case scenario
smoogipooo/osu-framework,ppy/osu-framework,ppy/osu-framework,peppy/osu-framework,peppy/osu-framework,ZLima12/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,ppy/osu-framework,ZLima12/osu-framework
osu.Framework.Benchmarks/BenchmarkTextBuilder.cs
osu.Framework.Benchmarks/BenchmarkTextBuilder.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Threading.Tasks; using BenchmarkDotNet.Attributes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Framework.Text; namespace osu.Framework.Benchmarks { public class BenchmarkTextBuilder { private readonly ITexturedGlyphLookupStore store = new TestStore(); private TextBuilder textBuilder; [Benchmark] public void AddCharacters() => initialiseBuilder(false); [Benchmark] public void AddCharactersWithDifferentBaselines() => initialiseBuilder(true); [Benchmark] public void RemoveLastCharacter() { initialiseBuilder(false); textBuilder.RemoveLastCharacter(); } [Benchmark] public void RemoveLastCharacterWithDifferentBaselines() { initialiseBuilder(true); textBuilder.RemoveLastCharacter(); } private void initialiseBuilder(bool withDifferentBaselines) { textBuilder = new TextBuilder(store, FontUsage.Default); char different = 'B'; for (int i = 0; i < 100; i++) textBuilder.AddCharacter(withDifferentBaselines && (i % 10 == 0) ? different++ : 'A'); } private class TestStore : ITexturedGlyphLookupStore { public ITexturedCharacterGlyph Get(string fontName, char character) => new TexturedCharacterGlyph(new CharacterGlyph(character, character, character, character, character, null), Texture.WhitePixel); public Task<ITexturedCharacterGlyph> GetAsync(string fontName, char character) => Task.Run(() => Get(fontName, character)); } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Threading.Tasks; using BenchmarkDotNet.Attributes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Framework.Text; namespace osu.Framework.Benchmarks { public class BenchmarkTextBuilder { private readonly ITexturedGlyphLookupStore store = new TestStore(); private TextBuilder textBuilder; [Benchmark] public void AddCharacters() => initialiseBuilder(false); [Benchmark] public void RemoveLastCharacter() { initialiseBuilder(false); textBuilder.RemoveLastCharacter(); } private void initialiseBuilder(bool allDifferentBaselines) { textBuilder = new TextBuilder(store, FontUsage.Default); char different = 'B'; for (int i = 0; i < 100; i++) textBuilder.AddCharacter(i % (allDifferentBaselines ? 1 : 10) == 0 ? different++ : 'A'); } private class TestStore : ITexturedGlyphLookupStore { public ITexturedCharacterGlyph Get(string fontName, char character) => new TexturedCharacterGlyph(new CharacterGlyph(character, character, character, character, null), Texture.WhitePixel); public Task<ITexturedCharacterGlyph> GetAsync(string fontName, char character) => Task.Run(() => Get(fontName, character)); } } }
mit
C#
47c4beaabbc0b25b1388bd366c56cb82e15154a3
Update LazyAsyncTest
yufeih/Common
test/LazyAsyncTest.cs
test/LazyAsyncTest.cs
namespace System { using System; using System.Collections.Concurrent; using System.Threading; using System.Threading.Tasks; using Xunit; public class LazyAsyncTest { [Fact] public async Task concurrent_lazy_requests() { for (var i = 0; i < 100; i++) { var n = 0; var lazy = new Lazy<Task<int>>(async () => { await Task.Delay(10); return Interlocked.Increment(ref n); }); var bag = new ConcurrentBag<Task<int>>(); Parallel.For(0, 1000, j => { bag.Add(lazy.Value); }); var results = await Task.WhenAll(bag); for (int nn = 0; nn < 1000; nn++) { Assert.Equal(1, results[nn]); } } } [Fact] public async Task retry_on_failure() { var n = 0; var lazy = new Lazy<Task<int>>(() => { n++; throw new NotImplementedException(); }); try { await lazy.Value; } catch (NotImplementedException) { } try { await lazy.Value; } catch (NotImplementedException) { } Assert.Equal(1, n); } } }
namespace System { using System; using System.Collections.Concurrent; using System.Threading; using System.Threading.Tasks; using Xunit; public class LazyAsyncTest { [Fact] public async Task concurrent_lazy_requests() { for (var i = 0; i < 100; i++) { var n = 0; var lazy = new LazyAsync<int>(async () => { await Task.Delay(10); return Interlocked.Increment(ref n); }); var bag = new ConcurrentBag<Task<int>>(); Parallel.For(0, 1000, j => { bag.Add(lazy.GetValueAsync()); }); var results = await Task.WhenAll(bag); for (int nn = 0; nn < 1000; nn++) { Assert.Equal(1, results[nn]); } } } [Theory] [InlineData(true)] [InlineData(false)] public async Task retry_on_failure(bool retry) { var n = 0; var lazy = new LazyAsync<int>(() => { n++; throw new NotImplementedException(); }, retry); try { await lazy.GetValueAsync(); } catch (NotImplementedException) { } try { await lazy.GetValueAsync(); } catch (NotImplementedException) { } Assert.Equal(retry ? 2 : 1, n); } } }
mit
C#
cd065b8ff31ce97931cd6e560bf27763290fdccc
Add back GetHashCode.
Nabile-Rahmani/osu,NeoAdonis/osu,tacchinotacchi/osu,johnneijzen/osu,naoey/osu,ppy/osu,peppy/osu,smoogipoo/osu,DrabWeb/osu,2yangk23/osu,johnneijzen/osu,ppy/osu,peppy/osu,UselessToucan/osu,smoogipoo/osu,peppy/osu,peppy/osu-new,smoogipoo/osu,naoey/osu,EVAST9919/osu,ZLima12/osu,ppy/osu,NeoAdonis/osu,Frontear/osuKyzer,osu-RP/osu-RP,Drezi126/osu,naoey/osu,smoogipooo/osu,UselessToucan/osu,EVAST9919/osu,Damnae/osu,NeoAdonis/osu,DrabWeb/osu,UselessToucan/osu,ZLima12/osu,2yangk23/osu,DrabWeb/osu
osu.Game/Online/Chat/Message.cs
osu.Game/Online/Chat/Message.cs
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using System.ComponentModel; using Newtonsoft.Json; using osu.Game.Users; namespace osu.Game.Online.Chat { public class Message : IComparable<Message>, IEquatable<Message> { [JsonProperty(@"message_id")] public readonly long Id; //todo: this should be inside sender. [JsonProperty(@"sender_id")] public int UserId; [JsonProperty(@"target_type")] public TargetType TargetType; [JsonProperty(@"target_id")] public int TargetId; [JsonProperty(@"timestamp")] public DateTimeOffset Timestamp; [JsonProperty(@"content")] public string Content; [JsonProperty(@"sender")] public User Sender; [JsonConstructor] public Message() { } public Message(long id) { Id = id; } public int CompareTo(Message other) => Id.CompareTo(other.Id); public bool Equals(Message other) => Id == other?.Id; public override int GetHashCode() => Id.GetHashCode(); } public enum TargetType { [Description(@"channel")] Channel, [Description(@"user")] User } }
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using System.ComponentModel; using Newtonsoft.Json; using osu.Game.Users; namespace osu.Game.Online.Chat { public class Message : IComparable<Message>, IEquatable<Message> { [JsonProperty(@"message_id")] public readonly long Id; //todo: this should be inside sender. [JsonProperty(@"sender_id")] public int UserId; [JsonProperty(@"target_type")] public TargetType TargetType; [JsonProperty(@"target_id")] public int TargetId; [JsonProperty(@"timestamp")] public DateTimeOffset Timestamp; [JsonProperty(@"content")] public string Content; [JsonProperty(@"sender")] public User Sender; [JsonConstructor] public Message() { } public Message(long id) { Id = id; } public int CompareTo(Message other) => Id.CompareTo(other.Id); public bool Equals(Message other) => Id == other?.Id; } public enum TargetType { [Description(@"channel")] Channel, [Description(@"user")] User } }
mit
C#
9310dde83bacdacdc8af57447f2949bd2d2213c1
Rearrange the conditionals so that I always perform the Free if I got back a non-zero pointer, but only perform the Marshal if I got back a valid pointer and a good status code.
antiduh/nsspi
PackageSupport.cs
PackageSupport.cs
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace NSspi { internal static class PackageSupport { internal static SecPkgInfo GetPackageCapabilities( string packageName ) { SecPkgInfo info; SecurityStatus status; SecurityStatus freeStatus; IntPtr rawInfoPtr; rawInfoPtr = new IntPtr(); info = new SecPkgInfo(); RuntimeHelpers.PrepareConstrainedRegions(); try { } finally { status = NativeMethods.QuerySecurityPackageInfo( packageName, ref rawInfoPtr ); if ( rawInfoPtr != IntPtr.Zero ) { try { if ( status == SecurityStatus.OK ) { // This performs allocations as it makes room for the strings contained in the SecPkgInfo class. Marshal.PtrToStructure( rawInfoPtr, info ); } } finally { freeStatus = NativeMethods.FreeContextBuffer( rawInfoPtr ); } } } return info; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace NSspi { internal static class PackageSupport { internal static SecPkgInfo GetPackageCapabilities( string packageName ) { SecPkgInfo info; SecurityStatus status; SecurityStatus freeStatus; IntPtr rawInfoPtr; rawInfoPtr = new IntPtr(); info = new SecPkgInfo(); RuntimeHelpers.PrepareConstrainedRegions(); try { } finally { status = NativeMethods.QuerySecurityPackageInfo( packageName, ref rawInfoPtr ); if( status == SecurityStatus.OK && rawInfoPtr != IntPtr.Zero ) { try { // This performs allocations as it makes room for the strings contained in the SecPkgInfo class. Marshal.PtrToStructure( rawInfoPtr, info ); } finally { freeStatus = NativeMethods.FreeContextBuffer( rawInfoPtr ); } } } return info; } } }
bsd-2-clause
C#
bab1b750087f7efd290bd906aeeaa0a4e167f5d4
Change private setter to public.
boumenot/lezen,boumenot/lezen
src/Lezen.Core/Entity/Document.cs
src/Lezen.Core/Entity/Document.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Lezen.Core.Entity { public class Document { public Document() { this.Authors = new HashSet<Author>(); } public int ID { get; set; } public string Title { get; set; } public virtual ICollection<Author> Authors { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Lezen.Core.Entity { public class Document { public Document() { this.Authors = new HashSet<Author>(); } public int ID { get; set; } public string Title { get; set; } public virtual ICollection<Author> Authors { get; private set; } } }
apache-2.0
C#
22962b0145875e787f98c5a882aa838dc7008199
Use injected cancellation token in GetGitInfo
twsouthwick/poshgit2
src/PoshGit2.Cmdlet/GetGitInfo.cs
src/PoshGit2.Cmdlet/GetGitInfo.cs
using System; using System.Management.Automation; using System.Threading; namespace PoshGit2 { [Cmdlet(VerbsCommon.Get, "GitStatus")] public class GetGitInfo : AutofacCmdlet { public IRepositoryCache RepositoryCache { get; set; } public ICurrentWorkingDirectory WorkingDirectory { get; set; } public CancellationToken Token { get; set; } public ILogger Log { get; set; } protected override void ProcessRecord() { base.ProcessRecord(); try { var repo = RepositoryCache.FindRepoAsync(WorkingDirectory, Token).Result; if (repo != null) { WriteObject(repo); } } catch (OperationCanceledException) { Log.Error("GetGitInfo timedout"); } } } }
using System; using System.Management.Automation; using System.Threading; namespace PoshGit2 { [Cmdlet(VerbsCommon.Get, "GitStatus")] public class GetGitInfo : AutofacCmdlet { public IRepositoryCache RepositoryCache { get; set; } public ICurrentWorkingDirectory WorkingDirectory { get; set; } protected override void ProcessRecord() { base.ProcessRecord(); try { var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(1)); var repo = RepositoryCache.FindRepoAsync(WorkingDirectory, cancellationTokenSource.Token).Result; if (repo != null) { WriteObject(repo); } } catch (OperationCanceledException) { } } } }
mit
C#
f1dc8bdeed03ecbd6b51158f027373a58717e41d
Fix to prevent IndexOutOfRangeException as per #352.
engagementgamelab/hygiene-with-chhota-bheem,engagementgamelab/hygiene-with-chhota-bheem,engagementgamelab/hygiene-with-chhota-bheem
Assets/Scripts/PowerUpUnderlay.cs
Assets/Scripts/PowerUpUnderlay.cs
using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; public class PowerUpUnderlay : MonoBehaviour { public GameObject BlueSpellParent; public GameObject RedSpellParent; public GameObject YellowSpellParent; private SpriteRenderer[] _underlayRings; private int _ringIndex = -1; public void Setup(Spells type) { GameObject activeParent = BlueSpellParent; switch (type) { case Spells.SpeedShoot: activeParent = RedSpellParent; break; case Spells.ScatterShoot: activeParent = YellowSpellParent; break; } activeParent.SetActive(true); _underlayRings = activeParent.GetComponentsInChildren<SpriteRenderer>().ToArray(); foreach(var ring in _underlayRings) ring.gameObject.SetActive(false); } public void Add() { if(_ringIndex < _underlayRings.Length-1) { _ringIndex++; SpriteRenderer ring = _underlayRings[_ringIndex]; ring.transform.localScale = Vector3.zero; ring.gameObject.SetActive(true); int rotAmount = _ringIndex % 2 == 0 ? 2 : -2; iTween.ScaleTo(ring.gameObject, iTween.Hash("name", "scale"+_ringIndex, "scale", Vector3.one * 1.42f, "time", 2, "easetype", iTween.EaseType.easeOutElastic)); iTween.RotateBy(ring.gameObject, iTween.Hash("z", rotAmount, "time", 50, "easetype", iTween.EaseType.linear, "looptype", iTween.LoopType.loop)); } } public void Subtract() { if(_ringIndex >= 0 && _ringIndex < _underlayRings.Length) { iTween.Stop(_underlayRings[_ringIndex].gameObject); iTween.ScaleTo(_underlayRings[_ringIndex].gameObject, iTween.Hash("scale", Vector3.zero, "time", 1, "easetype", iTween.EaseType.easeInElastic)); _ringIndex--; } } }
using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; public class PowerUpUnderlay : MonoBehaviour { public GameObject BlueSpellParent; public GameObject RedSpellParent; public GameObject YellowSpellParent; private SpriteRenderer[] _underlayRings; private int _ringIndex = -1; public void Setup(Spells type) { GameObject activeParent = BlueSpellParent; switch (type) { case Spells.SpeedShoot: activeParent = RedSpellParent; break; case Spells.ScatterShoot: activeParent = YellowSpellParent; break; } activeParent.SetActive(true); _underlayRings = activeParent.GetComponentsInChildren<SpriteRenderer>().ToArray(); foreach(var ring in _underlayRings) ring.gameObject.SetActive(false); } public void Add() { if(_ringIndex < 4) { _ringIndex++; SpriteRenderer ring = _underlayRings[_ringIndex]; ring.transform.localScale = Vector3.zero; ring.gameObject.SetActive(true); int rotAmount = _ringIndex % 2 == 0 ? 2 : -2; iTween.ScaleTo(ring.gameObject, iTween.Hash("name", "scale"+_ringIndex, "scale", Vector3.one * 1.42f, "time", 2, "easetype", iTween.EaseType.easeOutElastic)); iTween.RotateBy(ring.gameObject, iTween.Hash("z", rotAmount, "time", 50, "easetype", iTween.EaseType.linear, "looptype", iTween.LoopType.loop)); } } public void Subtract() { if(_ringIndex >= 0 && _ringIndex < _underlayRings.Length) { iTween.Stop(_underlayRings[_ringIndex].gameObject); iTween.ScaleTo(_underlayRings[_ringIndex].gameObject, iTween.Hash("scale", Vector3.zero, "time", 1, "easetype", iTween.EaseType.easeInElastic)); _ringIndex--; } } }
mit
C#
4553eb92e864a43028e725b147a88f6c244a054d
Handle null values for EU rate attributes. Resolves #25
taxjar/taxjar.net
src/Taxjar/Entities/TaxjarRate.cs
src/Taxjar/Entities/TaxjarRate.cs
using Newtonsoft.Json; namespace Taxjar { public class RateResponse { [JsonProperty("rate")] public RateResponseAttributes Rate { get; set; } } public class RateResponseAttributes { [JsonProperty("zip")] public string Zip { get; set; } [JsonProperty("state")] public string State { get; set; } [JsonProperty("state_rate")] public decimal StateRate { get; set; } [JsonProperty("county")] public string County { get; set; } [JsonProperty("county_rate")] public decimal CountyRate { get; set; } [JsonProperty("city")] public string City { get; set; } [JsonProperty("city_rate")] public decimal CityRate { get; set; } [JsonProperty("combined_district_rate")] public decimal CombinedDistrictRate { get; set; } [JsonProperty("combined_rate")] public decimal CombinedRate { get; set; } [JsonProperty("freight_taxable")] public bool FreightTaxable { get; set; } // International [JsonProperty("country")] public string Country { get; set; } [JsonProperty("name")] public string Name { get; set; } // Australia / SST States [JsonProperty("country_rate")] public decimal CountryRate { get; set; } // European Union [JsonProperty("standard_rate")] public decimal StandardRate { get; set; } [JsonProperty("reduced_rate", NullValueHandling = NullValueHandling.Ignore)] public decimal ReducedRate { get; set; } [JsonProperty("super_reduced_rate", NullValueHandling = NullValueHandling.Ignore)] public decimal SuperReducedRate { get; set; } [JsonProperty("parking_rate", NullValueHandling = NullValueHandling.Ignore)] public decimal ParkingRate { get; set; } [JsonProperty("distance_sale_threshold", NullValueHandling = NullValueHandling.Ignore)] public decimal DistanceSaleThreshold { get; set; } } public class Rate { [JsonProperty("country")] public string Country { get; set; } [JsonProperty("zip")] public string Zip { get; set; } [JsonProperty("state")] public string State { get; set; } [JsonProperty("city")] public string City { get; set; } [JsonProperty("street")] public string Street { get; set; } } }
using Newtonsoft.Json; namespace Taxjar { public class RateResponse { [JsonProperty("rate")] public RateResponseAttributes Rate { get; set; } } public class RateResponseAttributes { [JsonProperty("zip")] public string Zip { get; set; } [JsonProperty("state")] public string State { get; set; } [JsonProperty("state_rate")] public decimal StateRate { get; set; } [JsonProperty("county")] public string County { get; set; } [JsonProperty("county_rate")] public decimal CountyRate { get; set; } [JsonProperty("city")] public string City { get; set; } [JsonProperty("city_rate")] public decimal CityRate { get; set; } [JsonProperty("combined_district_rate")] public decimal CombinedDistrictRate { get; set; } [JsonProperty("combined_rate")] public decimal CombinedRate { get; set; } [JsonProperty("freight_taxable")] public bool FreightTaxable { get; set; } // International [JsonProperty("country")] public string Country { get; set; } [JsonProperty("name")] public string Name { get; set; } // Australia / SST States [JsonProperty("country_rate")] public decimal CountryRate { get; set; } // European Union [JsonProperty("standard_rate")] public decimal StandardRate { get; set; } [JsonProperty("reduced_rate")] public decimal ReducedRate { get; set; } [JsonProperty("super_reduced_rate")] public decimal SuperReducedRate { get; set; } [JsonProperty("parking_rate")] public decimal ParkingRate { get; set; } [JsonProperty("distance_sale_threshold")] public decimal DistanceSaleThreshold { get; set; } } public class Rate { [JsonProperty("country")] public string Country { get; set; } [JsonProperty("zip")] public string Zip { get; set; } [JsonProperty("state")] public string State { get; set; } [JsonProperty("city")] public string City { get; set; } [JsonProperty("street")] public string Street { get; set; } } }
mit
C#
dc70d091eb8d84ac3342c7f261dc3e3cea32db67
build version number bump
scratch-net/EasyNetQ,chinaboard/EasyNetQ,zidad/EasyNetQ,nicklv/EasyNetQ,Roysvork/AzureNetQ,lukasz-lysik/EasyNetQ,beyond-code-github/AzureNetQ,mleenhardt/EasyNetQ,alexwiese/EasyNetQ,sanjaysingh/EasyNetQ,sanjaysingh/EasyNetQ,ar7z1/EasyNetQ,GeckoInformasjonssystemerAS/EasyNetQ,danbarua/EasyNetQ,tkirill/EasyNetQ,maverix/EasyNetQ,micdenny/EasyNetQ,maverix/EasyNetQ,mcthuesen/EasyNetQ,GeckoInformasjonssystemerAS/EasyNetQ,mcthuesen/EasyNetQ,reisenberger/EasyNetQ,alexwiese/EasyNetQ,fpommerening/EasyNetQ,Ascendon/EasyNetQ,alexwiese/EasyNetQ,blackcow02/EasyNetQ,Pliner/EasyNetQ,chinaboard/EasyNetQ,EIrwin/EasyNetQ,fpommerening/EasyNetQ,tkirill/EasyNetQ,mleenhardt/EasyNetQ,mcthuesen/EasyNetQ,lukasz-lysik/EasyNetQ,reisenberger/EasyNetQ,nicklv/EasyNetQ,zidad/EasyNetQ,EasyNetQ/EasyNetQ,blackcow02/EasyNetQ,scratch-net/EasyNetQ,ar7z1/EasyNetQ,danbarua/EasyNetQ,Pliner/EasyNetQ,EIrwin/EasyNetQ,Ascendon/EasyNetQ
Source/Version.cs
Source/Version.cs
using System.Reflection; // EasyNetQ verion number: <major>.<minor>.0.<build> [assembly: AssemblyVersion("0.2.0.1")] // 0.2 Updgrade to RabbitMQ.Client 2.7.0.0 // 0.1 Initial
using System.Reflection; // EasyNetQ verion number: <major>.<minor>.0.<build> [assembly: AssemblyVersion("0.2.0.0")] // 0.2 Updgrade to RabbitMQ.Client 2.7.0.0 // 0.1 Initial
mit
C#
fe559951274a595b484346d6b5e4726b9492ae37
update version
gaochundong/Cowboy
SolutionVersion.cs
SolutionVersion.cs
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyDescription("Cowboy is a library for building Sockets/HTTP based services.")] [assembly: AssemblyCompany("Dennis Gao")] [assembly: AssemblyProduct("Cowboy")] [assembly: AssemblyCopyright("Copyright © 2015-2016 Dennis Gao.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("1.1.14.0")] [assembly: AssemblyFileVersion("1.1.14.0")] [assembly: ComVisible(false)]
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyDescription("Cowboy is a library for building Sockets/HTTP based services.")] [assembly: AssemblyCompany("Dennis Gao")] [assembly: AssemblyProduct("Cowboy")] [assembly: AssemblyCopyright("Copyright © 2015-2016 Dennis Gao.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("1.1.13.0")] [assembly: AssemblyFileVersion("1.1.13.0")] [assembly: ComVisible(false)]
mit
C#
5f1c8b0f21971618abd619b193c2def477aa80e7
Add a point.
ForNeVeR/fornever.me,ForNeVeR/fornever.me,ForNeVeR/fornever.me
ForneverMind/views/Contact.cshtml
ForneverMind/views/Contact.cshtml
@using RazorEngine.Templating @inherits TemplateBase @{ Layout = "_Layout.cshtml"; ViewBag.Title = "Контакты"; } <p> <a class="so-badge" href="http://stackoverflow.com/users/2684760/fornever"> <img src="http://stackoverflow.com/users/flair/2684760.png" width="208" height="58" alt="мой профиль на Stack Overflow" title="мой профиль на Stack Overflow" /> </a> </p> <p>Я в “социальных” сетях:</p> <ul> <li><a href="https://github.com/ForNeVeR">GitHub</a></li> <li><a href="https://bitbucket.org/ForNeVeR">Bitbucket</a></li> <li><a href="https://twitter.com/fvnever">Twitter</a></li> </ul> <p>На Хабрахабре: <a href="http://habrahabr.ru/users/ForNeVeR/">ForNeVeR</a>.</p> <p> Пишите мне по почте (<a href="mailto:friedrich@fornever.me" class="email">friedrich@fornever.me</a>) или в Jabber (<a href="xmpp:fornever@codingteam.org.ru">fornever@codingteam.org.ru</a>). </p> <p> Приходите в наше XMPP-сообщество: <a href="xmpp:codingteam@conference.jabber.ru">codingteam@conference.jabber.ru</a>. </p>
@using RazorEngine.Templating @inherits TemplateBase @{ Layout = "_Layout.cshtml"; ViewBag.Title = "Контакты"; } <p> <a class="so-badge" href="http://stackoverflow.com/users/2684760/fornever"> <img src="http://stackoverflow.com/users/flair/2684760.png" width="208" height="58" alt="мой профиль на Stack Overflow" title="мой профиль на Stack Overflow" /> </a> </p> <p>Я в “социальных” сетях:</p> <ul> <li><a href="https://github.com/ForNeVeR">GitHub</a></li> <li><a href="https://bitbucket.org/ForNeVeR">Bitbucket</a></li> <li><a href="https://twitter.com/fvnever">Twitter</a></li> </ul> <p>На Хабрахабре: <a href="http://habrahabr.ru/users/ForNeVeR/">ForNeVeR</a></p> <p> Пишите мне по почте (<a href="mailto:friedrich@fornever.me" class="email">friedrich@fornever.me</a>) или в Jabber (<a href="xmpp:fornever@codingteam.org.ru">fornever@codingteam.org.ru</a>). </p> <p> Приходите в наше XMPP-сообщество: <a href="xmpp:codingteam@conference.jabber.ru">codingteam@conference.jabber.ru</a>. </p>
mit
C#
b852aa3b4fe98c7310dbe8157a6b74e1132a84d9
Fix wrong method name, causing a build error
puckipedia/CardsAgainstIRC
CardsAgainstIRC3/Game/Bots/Rando.cs
CardsAgainstIRC3/Game/Bots/Rando.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CardsAgainstIRC3.Game.Bots { [Bot("rando")] public class Rando : IBot { public GameManager Manager { get; private set; } public GameUser User { get; private set; } public Rando(GameManager manager) { Manager = manager; } public void LinkedToUser(GameUser user) { User = user; } public Card[] ResponseToCard(Card blackCard) { return Manager.TakeWhiteCards(blackCard.Parts.Length - 1).ToArray(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CardsAgainstIRC3.Game.Bots { [Bot("rando")] public class Rando : IBot { public GameManager Manager { get; private set; } public GameUser User { get; private set; } public Rando(GameManager manager) { Manager = manager; } public void RegisteredToUser(GameUser user) { User = user; } public Card[] ResponseToCard(Card blackCard) { return Manager.TakeWhiteCards(blackCard.Parts.Length - 1).ToArray(); } } }
mit
C#
6291c3b300367164a7931545b3aa197978c71f7e
Fix divide by 0
muntashir/Pingo
Pingo/Classes/ProgressBarUpdater.cs
Pingo/Classes/ProgressBarUpdater.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Media.Animation; using System.Windows.Shell; namespace Pingo.Classes { public class ProgressBarUpdater { ProgressBar progressBar; MainWindow mainWindow; public ProgressBarUpdater(ProgressBar progressBar, MainWindow mainWindow) { this.progressBar = progressBar; this.mainWindow = mainWindow; } public void UpdateProgressBar(double numerator, double denominator) { Duration duration = new Duration(TimeSpan.FromSeconds(0.5)); if (numerator != 0 && denominator != 0) { DoubleAnimation doubleanimation = new DoubleAnimation((numerator / denominator) * 100.0, duration); progressBar.BeginAnimation(ProgressBar.ValueProperty, doubleanimation); } mainWindow.TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Normal; mainWindow.TaskbarItemInfo.ProgressValue = numerator / denominator; } public void ResetProgressBar() { progressBar.BeginAnimation(ProgressBar.ValueProperty, null); progressBar.Value = 0; mainWindow.TaskbarItemInfo.ProgressState = TaskbarItemProgressState.None; mainWindow.TaskbarItemInfo.ProgressValue = 0; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Media.Animation; using System.Windows.Shell; namespace Pingo.Classes { public class ProgressBarUpdater { ProgressBar progressBar; MainWindow mainWindow; public ProgressBarUpdater(ProgressBar progressBar, MainWindow mainWindow) { this.progressBar = progressBar; this.mainWindow = mainWindow; } public void UpdateProgressBar(double numerator, double denominator) { Duration duration = new Duration(TimeSpan.FromSeconds(0.5)); DoubleAnimation doubleanimation = new DoubleAnimation((numerator / denominator) * 100.0, duration); progressBar.BeginAnimation(ProgressBar.ValueProperty, doubleanimation); mainWindow.TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Normal; mainWindow.TaskbarItemInfo.ProgressValue = numerator / denominator; } public void ResetProgressBar() { progressBar.BeginAnimation(ProgressBar.ValueProperty, null); progressBar.Value = 0; mainWindow.TaskbarItemInfo.ProgressState = TaskbarItemProgressState.None;; mainWindow.TaskbarItemInfo.ProgressValue = 0; } } }
mit
C#
2b8c120302f86a28ec8c68c0dc4db4fc8935e8b1
Update assembly version to 1.2.
Loris156/LCrypt
LCrypt/Properties/AssemblyInfo.cs
LCrypt/Properties/AssemblyInfo.cs
using System.Reflection; using System.Resources; using System.Runtime.InteropServices; using System.Windows; // 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("LCrypt")] [assembly: AssemblyDescription("Easy-to-use encryption software.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Loris Leitner")] [assembly: AssemblyProduct("LCrypt")] [assembly: AssemblyCopyright("Copyright © Loris Leitner 2017. All rights reserved.")] [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)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // 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.2.0.0")] [assembly: AssemblyFileVersion("1.2.0.0")] [assembly: NeutralResourcesLanguage("")]
using System.Reflection; using System.Resources; using System.Runtime.InteropServices; using System.Windows; // 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("LCrypt")] [assembly: AssemblyDescription("Easy-to-use encryption software.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Loris Leitner")] [assembly: AssemblyProduct("LCrypt")] [assembly: AssemblyCopyright("Copyright © Loris Leitner 2017. All rights reserved.")] [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)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // 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.1.0.0")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: NeutralResourcesLanguage("")]
mit
C#
fb6871b8b1dc8994baff126ccf219288c4591782
Make ball drag match pointer position
andrew-vant/dragalt
dragnavball.cs
dragnavball.cs
using KSP.UI.Screens.Flight; using UnityEngine; using UnityEngine.UI; using UnityEngine.EventSystems; [KSPAddon(KSPAddon.Startup.Flight, false)] public class NavBallAttacher : MonoBehaviour { void Start() { print("Starting draggable navball"); GameObject ball = FindObjectOfType<NavBall>().gameObject; GameObject frame = ball.transform.parent.gameObject.transform.parent.gameObject; // Not sure which of these is actually doing the work. // ball.AddComponent<NavBallDrag>(); frame.AddComponent<NavBallDrag>(); // Show the object tree while I work out which object actually // needs to be dragged... string path = "/"; for (GameObject obj = ball.gameObject; obj != null; obj = obj.transform.parent.gameObject) { print(obj.GetType().Name + ":" + obj.name); path = "/" + obj.GetType().Name + ":" + obj.name + path; } print("Done"); } } public class NavBallDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler, IDropHandler { float ptrstart; float ballstart; public void OnBeginDrag(PointerEventData evtdata) { print("Navball drag start"); print(transform.position); ptrstart = evtdata.position.x; ballstart = transform.position.x; } public void OnDrag(PointerEventData evtdata) { float x = ballstart + (evtdata.position.x - ptrstart); float y = transform.position.y; float z = transform.position.z; transform.position = new Vector3(x, y, z); print(transform.position); } public void OnEndDrag(PointerEventData evtdata) { print("Drag finished"); print(transform.position); } public void OnDrop(PointerEventData evtdata) { print("Navball dropped"); print(transform.position); } }
using KSP.UI.Screens.Flight; using UnityEngine; using UnityEngine.UI; using UnityEngine.EventSystems; [KSPAddon(KSPAddon.Startup.Flight, false)] public class NavBallAttacher : MonoBehaviour { void Start() { print("Starting draggable navball"); GameObject ball = FindObjectOfType<NavBall>().gameObject; GameObject frame = ball.transform.parent.gameObject.transform.parent.gameObject; // Not sure which of these is actually doing the work. ball.AddComponent<NavBallDrag>(); frame.AddComponent<NavBallDrag>(); // Show the object tree while I work out which object actually // needs to be dragged... string path = "/"; for (GameObject obj = ball.gameObject; obj != null; obj = obj.transform.parent.gameObject) { print(obj.GetType().Name + ":" + obj.name); path = "/" + obj.GetType().Name + ":" + obj.name + path; } print("Done"); } } public class NavBallDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler, IDropHandler { public void OnBeginDrag(PointerEventData evtdata) { print("Navball got begindrag"); } public void OnDrag(PointerEventData evtdata) { transform.position = evtdata.position; } public void OnEndDrag(PointerEventData evtdata) { print("Drag finished"); } public void OnDrop(PointerEventData evtdata) { print("Navball dropped"); } }
mit
C#
f7f43a68d92f3ac158b508e264e6642d97fb9b59
Update ValuesOut.cs
EricZimmerman/RegistryPlugins
RegistryPlugin.Adobe/ValuesOut.cs
RegistryPlugin.Adobe/ValuesOut.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using RegistryPluginBase.Interfaces; namespace RegistryPlugin.Adobe { public class ValuesOut:IValueOut { public ValuesOut(string productName, string productVersion, string fullPath, DateTimeOffset lastOpened, string fileName, int fileSize, string fileSource, int pageCount) { ProductName = productName; ProductVersion = productVersion; FullPath = fullPath; LastOpened = lastOpened; FileName = fileName; FileSize = fileSize; FileSource = fileSource; PageCount = pageCount; } public string ProductName { get; } public string ProductVersion { get; } public string FullPath { get; } public DateTimeOffset LastOpened { get; } public string FileName { get; } public int FileSize { get; } public string FileSource { get; } public int PageCount { get; } public string BatchKeyPath { get; set; } public string BatchValueName { get; set; } public string BatchValueData1 => $"Product: {ProductName} {ProductVersion}"; public string BatchValueData2 => $"FullPath: {FullPath}"; public string BatchValueData3 => $"LastOpened: {LastOpened?.ToUniversalTime():yyyy-MM-dd HH:mm:ss.fffffff})";} } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using RegistryPluginBase.Interfaces; namespace RegistryPlugin.Adobe { public class ValuesOut:IValueOut { public ValuesOut(string productName, string productVersion, string fullPath, DateTimeOffset lastOpened, string fileName, int fileSize, string fileSource, int pageCount) { ProductName = productName; ProductVersion = productVersion; FullPath = fullPath; LastOpened = lastOpened; FileName = fileName; FileSize = fileSize; FileSource = fileSource; PageCount = pageCount; } public string ProductName { get; } public string ProductVersion { get; } public string FullPath { get; } public DateTimeOffset LastOpened { get; } public string FileName { get; } public int FileSize { get; } public string FileSource { get; } public int PageCount { get; } public string BatchKeyPath { get; set; } public string BatchValueName { get; set; } public string BatchValueData1 => $"Product: {ProductName} {ProductVersion}"; public string BatchValueData2 => $"FullPath: {FullPath}"; public string BatchValueData3 => $"LastOpened: {LastOpened}"; } }
mit
C#
020f794b1cdb90dae350c74fe3cad1b8a8bb05e5
Correct default paste behaviour for IMDb textbox
tvdburgt/subtle
Subtle.UI/Controls/ImdbTextBox.cs
Subtle.UI/Controls/ImdbTextBox.cs
using System.Text.RegularExpressions; using System.Windows.Forms; namespace Subtle.UI.Controls { public class ImdbTextBox : TextBox { // ReSharper disable once InconsistentNaming private const int WM_PASTE = 0x0302; private static readonly Regex ImdbRegex = new Regex(@"tt(\d{7})"); /// <summary> /// Handles paste event and tries to extract IMDb ID. /// </summary> /// <param name="m"></param> protected override void WndProc(ref Message m) { if (m.Msg != WM_PASTE) { base.WndProc(ref m); return; } var match = ImdbRegex.Match(Clipboard.GetText()); if (match.Success) { Text = match.Groups[1].Value; } else { base.WndProc(ref m); } } } }
using System.Text.RegularExpressions; using System.Windows.Forms; namespace Subtle.UI.Controls { public class ImdbTextBox : TextBox { // ReSharper disable once InconsistentNaming private const int WM_PASTE = 0x0302; private static readonly Regex ImdbRegex = new Regex(@"tt(\d{7})"); /// <summary> /// Handles paste event and tries to extract IMDb ID. /// </summary> /// <param name="m"></param> protected override void WndProc(ref Message m) { if (m.Msg != WM_PASTE) { base.WndProc(ref m); return; } var match = ImdbRegex.Match(Clipboard.GetText()); if (match.Success) { Text = match.Groups[1].Value; } } } }
mit
C#
8305f4db36badd72d60954953796dfe28652a6c9
Fix baseAccess
CalinoursIncorporated/8INF830
Assets/Scripts/Base/BaseAccess.cs
Assets/Scripts/Base/BaseAccess.cs
//using System.Collections; //using System.Collections.Generic; //using UnityEngine; //using UnityEngine.UI; //using UnityEngine.SceneManagement; //public class BaseAccess : MonoBehaviour { // public Text Button_Prompt; // private void Start() // { // Button_Prompt.enabled = false; // } // private void OnTriggerEnter(Collider other) // { // Button_Prompt.enabled = true; // Debug.Log("Possible de rentrer dans la base."); // } // private void OnTriggerStay(Collider other) // { // if (Input.GetButtonDown("Interact")) // { // Cursor.visible = true; // Debug.Log("Scene loading..."); // SceneManager.LoadScene("Hangar", LoadSceneMode.Single); // } // } // private void OnTriggerExit(Collider other) // { // Button_Prompt.enabled = false; // } //} using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement; public class BaseAccess : MonoBehaviour { public Text Button_Prompt; private void OnTriggerEnter(Collider other) { Button_Prompt.gameObject.SetActive(true); } private void OnTriggerStay(Collider other) { if (Input.GetAxis("Submit") > 0) { Cursor.visible = true; SceneManager.LoadSceneAsync("Bridge", LoadSceneMode.Single); } } private void OnTriggerExit(Collider other) { Button_Prompt.gameObject.SetActive(false); } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement; public class BaseAccess : MonoBehaviour { public Text Button_Prompt; private void Start() { Button_Prompt.enabled = false; } private void OnTriggerEnter(Collider other) { Button_Prompt.enabled = true; Debug.Log("Possible de rentrer dans la base."); } private void OnTriggerStay(Collider other) { if (Input.GetButtonDown("Interact")) { Cursor.visible = true; Debug.Log("Scene loading..."); SceneManager.LoadScene("Hangar", LoadSceneMode.Single); } } private void OnTriggerExit(Collider other) { Button_Prompt.enabled = false; } } //using System.Collections; //using System.Collections.Generic; //using UnityEngine; //using UnityEngine.UI; //using UnityEngine.SceneManagement; //public class BaseAccess : MonoBehaviour { // public Text Button_Prompt; // private void OnTriggerEnter(Collider other) // { // Button_Prompt.gameObject.SetActive(true); // } // private void OnTriggerStay(Collider other) // { // if (Input.GetAxis("Submit")>0) // { // Cursor.visible = true; // SceneManager.LoadSceneAsync("Bridge", LoadSceneMode.Single); // } // } // private void OnTriggerExit(Collider other) // { // Button_Prompt.gameObject.SetActive(false); // } //}
apache-2.0
C#
070e19b903a2813fb7a2677a05cc73bdaa7eb0b3
Fix editor resource mode
GarfieldJiang/UGFWithToLua
Assets/Scripts/ProcedureLaunch.cs
Assets/Scripts/ProcedureLaunch.cs
using GameFramework.Event; using GameFramework.Procedure; using UnityEngine; using UnityGameFramework.Runtime; using ProcedureOwner = GameFramework.Fsm.IFsm<GameFramework.Procedure.IProcedureManager>; namespace Game { public class ProcedureLaunch : ProcedureBase { private bool m_HasStartedInitRes = false; private bool m_InitResComplete = false; protected override void OnInit(ProcedureOwner procedureOwner) { base.OnInit(procedureOwner); } protected override void OnEnter(ProcedureOwner procedureOwner) { base.OnEnter(procedureOwner); m_HasStartedInitRes = false; m_InitResComplete = false; } protected override void OnUpdate(ProcedureOwner procedureOwner, float elapseSeconds, float realElapseSeconds) { base.OnUpdate(procedureOwner, elapseSeconds, realElapseSeconds); if (Application.isEditor && GameEntry.GetComponent<BaseComponent>().EditorResourceMode) { ChangeState<ProcedureLoadLuaScripts>(procedureOwner); return; } if (!m_HasStartedInitRes) { m_HasStartedInitRes = true; GameEntry.GetComponent<EventComponent>().Subscribe(EventId.ResourceInitComplete, OnResourceInitComplete); GameEntry.GetComponent<ResourceComponent>().InitResources(); } if (m_InitResComplete) { GameEntry.GetComponent<EventComponent>().Unsubscribe(EventId.ResourceInitComplete, OnResourceInitComplete); ChangeState<ProcedureLoadLuaScripts>(procedureOwner); } } protected override void OnLeave(ProcedureOwner procedureOwner, bool isShutdown) { base.OnLeave(procedureOwner, isShutdown); } protected override void OnDestroy(ProcedureOwner procedureOwner) { base.OnDestroy(procedureOwner); } private void OnResourceInitComplete(object sender, GameEventArgs e) { m_InitResComplete = true; } } }
using GameFramework.Event; using GameFramework.Procedure; using UnityGameFramework.Runtime; using ProcedureOwner = GameFramework.Fsm.IFsm<GameFramework.Procedure.IProcedureManager>; namespace Game { public class ProcedureLaunch : ProcedureBase { private bool m_HasStartedInitRes = false; private bool m_InitResComplete = false; protected override void OnInit(ProcedureOwner procedureOwner) { base.OnInit(procedureOwner); } protected override void OnEnter(ProcedureOwner procedureOwner) { base.OnEnter(procedureOwner); m_HasStartedInitRes = false; m_InitResComplete = false; } protected override void OnUpdate(ProcedureOwner procedureOwner, float elapseSeconds, float realElapseSeconds) { base.OnUpdate(procedureOwner, elapseSeconds, realElapseSeconds); if (!m_HasStartedInitRes) { m_HasStartedInitRes = true; GameEntry.GetComponent<EventComponent>().Subscribe(EventId.ResourceInitComplete, OnResourceInitComplete); GameEntry.GetComponent<ResourceComponent>().InitResources(); } if (m_InitResComplete) { GameEntry.GetComponent<EventComponent>().Unsubscribe(EventId.ResourceInitComplete, OnResourceInitComplete); ChangeState<ProcedureLoadLuaScripts>(procedureOwner); } } protected override void OnLeave(ProcedureOwner procedureOwner, bool isShutdown) { base.OnLeave(procedureOwner, isShutdown); } protected override void OnDestroy(ProcedureOwner procedureOwner) { base.OnDestroy(procedureOwner); } private void OnResourceInitComplete(object sender, GameEventArgs e) { m_InitResComplete = true; } } }
mit
C#
a5d606416301132db5d74216bb26a4651776ff18
Remove unused code
risq/anamorph-unity,risq/anamorph-unity
Assets/Scripts/WebSocketClient.cs
Assets/Scripts/WebSocketClient.cs
using UnityEngine; using System.Collections; using SocketIO; using System.Collections.Generic; public class WebSocketClient : MonoBehaviour { SocketIOComponent socket; bool registered = false; // Use this for initialization void Start () { Debug.Log("Start webSocketClient"); socket = GetComponent<SocketIOComponent>(); socket.On("connect", OnSocketOpen); socket.On("state", OnState); } public void OnSocketOpen(SocketIOEvent e) { Register(); } public void OnClientRegisterStatus(SocketIOEvent e) { Debug.Log("OnClientRegisterStatus"); if (!e.data.GetField("err")) { OnSucessfulRegister(); } } public void OnClientValidConnection(SocketIOEvent e) { Debug.Log("OnClientValidConnection"); Debug.Log(e.data); } private void OnSucessfulRegister() { Debug.Log("OnSucessfulRegister"); registered = true; } private void OnState(SocketIOEvent e) { Debug.Log("OnState"); Debug.Log(e.data["auth"]); } private void OnSocialData(SocketIOEvent e) { Debug.Log("OnSocialData"); Debug.Log(e.data); } private void Register() { if (!registered) { Debug.Log("Registering..."); Dictionary<string, string> data = new Dictionary<string, string>(); data["id"] = "12"; socket.On("client:register:status", OnClientRegisterStatus); socket.Emit("client:register", new JSONObject(data)); socket.On("socialData", OnSocialData); } } // Update is called once per frame void Update () { } }
using UnityEngine; using System.Collections; using SocketIO; using System.Collections.Generic; public class WebSocketClient : MonoBehaviour { SocketIOComponent socket; bool registered = false; // Use this for initialization void Start () { Debug.Log("Start webSocketClient"); socket = GetComponent<SocketIOComponent>(); socket.On("connect", OnSocketOpen); socket.On("state", OnState); } public void OnSocketOpen(SocketIOEvent e) { Register(); } public void OnClientRegisterStatus(SocketIOEvent e) { Debug.Log("OnClientRegisterStatus"); if (!e.data.GetField("err")) { OnSucessfulRegister(); } } public void OnClientValidConnection(SocketIOEvent e) { Debug.Log("OnClientValidConnection"); Debug.Log(e.data); } private void OnSucessfulRegister() { Debug.Log("OnSucessfulRegister"); registered = true; } private void OnState(SocketIOEvent e) { Debug.Log("OnState"); Debug.Log(e.data["auth"]); //here we get the urls to connect social networks //string facebookUrl = e.data["auth"]["facebookUrl"].ToString(); //string twitterUrl = e.data["auth"]["twitterUrl"].ToString(); //string linkedinUrl = e.data["auth"]["linkedinUrl"].ToString(); //string instagramUrl = e.data["auth"]["instagramUrl"].ToString(); //Application.OpenURL(e.data["auth"]["facebookUrl"].ToString()); //Open facebook url link and set datas in server //Valid social connections and retrieve all the datas //Application.OpenURL(e.data["auth"]["rootUrl"].ToString().Trim('"') + "/validConnections?clientId=12"); } private void OnSocialData(SocketIOEvent e) { Debug.Log("OnSocialData"); Debug.Log(e.data); } private void Register() { if (!registered) { Debug.Log("Registering..."); Dictionary<string, string> data = new Dictionary<string, string>(); data["id"] = "12"; socket.On("client:register:status", OnClientRegisterStatus); socket.Emit("client:register", new JSONObject(data)); socket.On("socialData", OnSocialData); } } // Update is called once per frame void Update () { } }
mit
C#
61c72da27ba88af90e235487d8e61e9b4e29c31d
Add SolidColorBrush.ToString for easier debugging.
grokys/Avalonia
Avalonia/Media/SolidColorBrush.cs
Avalonia/Media/SolidColorBrush.cs
// ----------------------------------------------------------------------- // <copyright file="SolidColorBrush.cs" company="Steven Kirk"> // Copyright 2013 MIT Licence. See licence.md for more information. // </copyright> // ----------------------------------------------------------------------- namespace Avalonia.Media { using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; public class SolidColorBrush : Brush { public SolidColorBrush() { } public SolidColorBrush(Color color) { this.Color = color; } public Color Color { get; set; } public override string ToString() { return this.Color.ToString(); } } }
// ----------------------------------------------------------------------- // <copyright file="SolidColorBrush.cs" company="Steven Kirk"> // Copyright 2013 MIT Licence. See licence.md for more information. // </copyright> // ----------------------------------------------------------------------- namespace Avalonia.Media { using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; public class SolidColorBrush : Brush { public SolidColorBrush() { } public SolidColorBrush(Color color) { this.Color = color; } public Color Color { get; set; } } }
mit
C#
22cde24e95d33e569ef371985e17104062b8aafa
add more predefined units
mnadel/Metrics.NET,etishor/Metrics.NET,etishor/Metrics.NET,cvent/Metrics.NET,Liwoj/Metrics.NET,ntent-ad/Metrics.NET,cvent/Metrics.NET,DeonHeyns/Metrics.NET,ntent-ad/Metrics.NET,huoxudong125/Metrics.NET,MetaG8/Metrics.NET,Liwoj/Metrics.NET,Recognos/Metrics.NET,MetaG8/Metrics.NET,MetaG8/Metrics.NET,huoxudong125/Metrics.NET,DeonHeyns/Metrics.NET,alhardy/Metrics.NET,Recognos/Metrics.NET,alhardy/Metrics.NET,mnadel/Metrics.NET
Src/Metrics/Unit.cs
Src/Metrics/Unit.cs
 using System; using Metrics.Utils; namespace Metrics { public struct Unit : IHideObjectMembers { public static readonly Unit None = new Unit(string.Empty); public static readonly Unit Requests = new Unit("Requests"); public static readonly Unit Commands = new Unit("Commands"); public static readonly Unit Calls = new Unit("Calls"); public static readonly Unit Events = new Unit("Events"); public static readonly Unit Errors = new Unit("Errors"); public static readonly Unit Results = new Unit("Results"); public static readonly Unit Items = new Unit("Items"); public static readonly Unit MegaBytes = new Unit("Mb"); public static readonly Unit KiloBytes = new Unit("Kb"); public static readonly Unit Bytes = new Unit("bytes"); public static readonly Unit Percent = new Unit("%"); public static readonly Unit Threads = new Unit("Threads"); public static Unit Custom(string name) { return new Unit(name); } public static implicit operator Unit(string name) { return Unit.Custom(name); } public readonly string Name; public Unit(string name) { if (name == null) { throw new ArgumentNullException("name"); } this.Name = name; } public string FormatCount(long value) { if (!string.IsNullOrEmpty(this.Name)) { return string.Format("{0} {1}", value, this.Name); } return value.ToString(); } public string FormatValue(double value) { if (!string.IsNullOrEmpty(this.Name)) { return string.Format("{0:F2} {1}", value, this.Name); } return value.ToString("F2"); } public string FormatRate(double value, TimeUnit timeUnit) { return string.Format("{0:F2} {1}/{2}", value, this.Name, timeUnit.Unit()); } public string FormatDuration(double value, TimeUnit? timeUnit) { return string.Format("{0:F2} {1}", value, timeUnit.HasValue ? timeUnit.Value.Unit() : this.Name); } } }
 using System; using Metrics.Utils; namespace Metrics { public struct Unit : IHideObjectMembers { public static readonly Unit None = new Unit(string.Empty); public static readonly Unit Requests = new Unit("Requests"); public static readonly Unit Errors = new Unit("Errors"); public static readonly Unit Results = new Unit("Results"); public static readonly Unit Calls = new Unit("Calls"); public static readonly Unit Items = new Unit("Items"); public static readonly Unit MegaBytes = new Unit("Mb"); public static readonly Unit KiloBytes = new Unit("Kb"); public static readonly Unit Bytes = new Unit("bytes"); public static readonly Unit Threads = new Unit("Threads"); public static Unit Custom(string name) { return new Unit(name); } public static implicit operator Unit(string name) { return Unit.Custom(name); } public readonly string Name; public Unit(string name) { if (name == null) { throw new ArgumentNullException("name"); } this.Name = name; } public string FormatCount(long value) { if (!string.IsNullOrEmpty(this.Name)) { return string.Format("{0} {1}", value, this.Name); } return value.ToString(); } public string FormatValue(double value) { if (!string.IsNullOrEmpty(this.Name)) { return string.Format("{0:F2} {1}", value, this.Name); } return value.ToString("F2"); } public string FormatRate(double value, TimeUnit timeUnit) { return string.Format("{0:F2} {1}/{2}", value, this.Name, timeUnit.Unit()); } public string FormatDuration(double value, TimeUnit? timeUnit) { return string.Format("{0:F2} {1}", value, timeUnit.HasValue ? timeUnit.Value.Unit() : this.Name); } } }
apache-2.0
C#
2313bb041b0430129467bb4b1cc666af7dca44a2
change name for FlowDock
countersoft/App-FlowdockConnector,countersoft/App-FlowdockConnector
views/Settings.cshtml
views/Settings.cshtml
@using System.Web.Mvc.Html; @model System.String <div id="cs-adhoc-page"> <form id="flowdock-form" action="" method="post" autocomplete="off"> <table class="data-entry-box"> <tr> <td>FlowDock API Token</td> <td>@Html.TextBox("Token", Model, new { @class = "input-size9" })</td> </tr> <tr><td colspan="2"><div class="divider"></div></td></tr> <tr> <td colspan="2" align="right"> <input id="flowdock-save" type="button" value='@GetResource(Countersoft.Gemini.ResourceKeys.Save)' class='button-primary' /> </td> </tr> </table> </form> </div> <script type="text/javascript"> $(document).ready(function () { $("#flowdock-save").click(function (e) { gemini_commons.stopClick(e); var formData = $("#flowdock-form").serialize(); gemini_ui.startBusy('#cs-adhoc-page .data-entry-box #flowdock-save'); gemini_ajax.postCall("apps/flowdock", "configure", function () { gemini_popup.toast("Saved"); gemini_ui.stopBusy('#cs-adhoc-page .data-entry-box #flowdock-save'); }, function () { gemini_ui.stopBusy('#cs-adhoc-page .data-entry-box #flowdock-save'); }, formData, null, true); }); }); </script>
@using System.Web.Mvc.Html; @model System.String <div id="cs-adhoc-page"> <form id="flowdock-form" action="" method="post" autocomplete="off"> <table class="data-entry-box"> <tr> <td>Flow API Token</td> <td>@Html.TextBox("Token", Model, new { @class = "input-size9" })</td> </tr> <tr><td colspan="2"><div class="divider"></div></td></tr> <tr> <td colspan="2" align="right"> <input id="flowdock-save" type="button" value='@GetResource(Countersoft.Gemini.ResourceKeys.Save)' class='button-primary' /> </td> </tr> </table> </form> </div> <script type="text/javascript"> $(document).ready(function () { $("#flowdock-save").click(function (e) { gemini_commons.stopClick(e); var formData = $("#flowdock-form").serialize(); gemini_ui.startBusy('#cs-adhoc-page .data-entry-box #flowdock-save'); gemini_ajax.postCall("apps/flowdock", "configure", function () { gemini_popup.toast("Saved"); gemini_ui.stopBusy('#cs-adhoc-page .data-entry-box #flowdock-save'); }, function () { gemini_ui.stopBusy('#cs-adhoc-page .data-entry-box #flowdock-save'); }, formData, null, true); }); }); </script>
mit
C#
1425d8351c374ab9eee7f560f72f4f443ab71e5d
Tidy up UI
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
src/SFA.DAS.EmployerApprenticeshipsService.Web/Views/Invitation/Index.cshtml
src/SFA.DAS.EmployerApprenticeshipsService.Web/Views/Invitation/Index.cshtml
@model SFA.DAS.EmployerApprenticeshipsService.Domain.InvitationView <div class="grid-row"> <div class="column-two-thirds"> <h2 class="heading-medium">Accept invitation</h2> <form method="POST" action="@Url.Action("Accept")"> <div class="form-group"> <label class="form-label" for="Email">Email</label> <input class="form-control form-control-3-4" id="Email" name="Email" type="text" aria-required="true" value="@Model.Email"/> </div> <div class="form-group"> <label class="form-label" for="Email">Account</label> <input class="form-control form-control-3-4" id="Account" name="Account" type="text" aria-required="true" value="@Model.AccountName" /> </div> <div class="form-group"> <label class="form-label" for="Email">Role</label> <input class="form-control form-control-3-4" id="Role" name="Role" type="text" aria-required="true" value="@Model.RoleName" /> </div> <input type="hidden" id="invitationId" name="invitationId" value="@Model.Id"/> <button type="submit" class="button">Accept</button> <p></p> </form> </div> </div>
@model SFA.DAS.EmployerApprenticeshipsService.Domain.InvitationView <div class="grid-row"> <div class="column-two-thirds"> <h2 class="heading-medium">Invitations</h2> </div> </div> <div class="grid-row"> <div class="column-two-thirds"> <h2 class="heading-medium">Accept invitation</h2> <form method="POST" action="@Url.Action("Accept")"> <div class="form-group"> <label class="form-label"> <input type="text" name="Email" value="@Model.Email"/> </label> </div> <input type="hidden" id="invitationId" name="invitationId" value="@Model.Id"/> <button type="submit" class="button">Accept</button> <p></p> </form> </div> </div>
mit
C#
a9e39bbd07d0ae077fb1f7e1e12099beee07fe33
Check status
SashaKazyrevich/Emigrace,SashaKazyrevich/Emigrace,SashaKazyrevich/Emigrace
Emigrace/Views/Archives/Index.cshtml
Emigrace/Views/Archives/Index.cshtml
@model IEnumerable <Emigrace.Models.ArchiveViewModel> @{ ViewBag.Title = "Archives list"; } <div class="container"> <section class="row"> </section> <section class="row row-table"> <div class="col-sm-12 col-md-4 search-form"> <h4>Add new archive</h4> <div class="form-btn"> <a href="@Url.Action("Create")" class="btn btn-primary btn-block">New archive</a> </div> </div> <div class="col-sm-12 col-md-8"> <div class="result-form"> <ul> <li> @foreach(var archive in Model) { <p>Hello, git</p> /**archive.Name**/ } </li> </ul> </div> </div> </section> </div>
@model IEnumerable <Emigrace.Models.ArchiveViewModel> @{ ViewBag.Title = "Archives list"; } <div class="container"> <section class="row"> </section> <section class="row row-table"> <div class="col-sm-12 col-md-4 search-form"> <h4>Add new archive</h4> <div class="form-btn"> <a href="@Url.Action("Create")" class="btn btn-primary btn-block">New archive</a> </div> </div> <div class="col-sm-12 col-md-8"> <div class="result-form"> <ul> <li> @foreach(var archive in Model) { <p>Hello</p> /**archive.Name**/ } </li> </ul> </div> </div> </section> </div>
mit
C#
10f6ea46f5ecc2d17c0470cc4817e4fefac59eab
update portal template
Appleseed/portal,Appleseed/portal,Appleseed/portal,Appleseed/portal,Appleseed/portal,Appleseed/portal,Appleseed/portal
Master/Appleseed/Projects/Appleseed.PortalTemplate/Properties/AssemblyInfo.cs
Master/Appleseed/Projects/Appleseed.PortalTemplate/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("Appleseed.PortalTemplate")] [assembly: AssemblyDescription("Appleseed Portal and Content Management System")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ANANT Corporation")] [assembly: AssemblyProduct("Appleseed.PortalTemplate")] [assembly: AssemblyCopyright("Copyright © ANANT Corporation 2010-2017")] [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("ffe59a6a-e2ab-4ea5-8eec-39b791c8f302")] // 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.4.98.383")] [assembly: AssemblyFileVersion("1.4.98.383")]
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("Appleseed.PortalTemplate")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ANANT Corporation")] [assembly: AssemblyProduct("Appleseed.PortalTemplate")] [assembly: AssemblyCopyright("Copyright © ANANT Corporation 2010-2017")] [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("ffe59a6a-e2ab-4ea5-8eec-39b791c8f302")] // 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.4.98.383")] [assembly: AssemblyFileVersion("1.4.98.383")]
apache-2.0
C#
3f6fbf9d2c755be1d9a700ced81f295ff0eb164a
Split cell text into many lines
12joan/hangman
cell.cs
cell.cs
using System; namespace Hangman { public class Cell { public const int RightAlign = 0; public const int CentreAlign = 1; public const int LeftAlign = 2; public string Text; public int Align; public Cell(string text) { Text = text; Align = LeftAlign; } public Cell(string text, int align) { Text = text; Align = align; } public string[] Lines() { return Text.Split('\n'); } } }
using System; namespace Hangman { public class Cell { public const int RightAlign = 0; public const int CentreAlign = 1; public const int LeftAlign = 2; public string Text; public int Align; public Cell(string text) { Text = text; Align = LeftAlign; } public Cell(string text, int align) { Text = text; Align = align; } } }
unlicense
C#
1b179c62e1c37e95fa3e04331c32e2319c6091e7
add data protection to service collection
ccccccmd/IdentityServer3.Samples,nicklv/IdentityServer3.Samples,kouweizhong/IdentityServer3.Samples,ryanvgates/IdentityServer3.Samples,MartinKip/IdentityServer3.Samples,daptiv/IdentityServer3.Samples,nicklv/IdentityServer3.Samples,jmalca14/IdentityServer3.Samples,codehedgehog/IdentityServer3.Samples,ccccccmd/IdentityServer3.Samples,gavinbarron/IdentityServer3.Samples,daptiv/IdentityServer3.Samples,pirumpi/IdentityServer3.Samples,vebin/IdentityServer3.Samples,EternalXw/IdentityServer3.Samples,JaonDong/IdentityServer3.Samples,feanz/Thinktecture.IdentityServer3.Samples,atul221282/IdentityServer3.Samples,ryanvgates/IdentityServer3.Samples,nguyentk90/IdentityServer3.Samples,codedecay/IdentityServer3.Samples,IdentityServer/IdentityServer3.Samples,geffzhang/Thinktecture.IdentityServer.v3.Samples,ccccccmd/IdentityServer3.Samples,feanz/Thinktecture.IdentityServer3.Samples,sumedhmeshram/IdentityServer3.Samples,18098924759/IdentityServer3.Samples,tuyndv/IdentityServer3.Samples,daptiv/IdentityServer3.Samples,codeice/IdentityServer3.Samples,18098924759/IdentityServer3.Samples,TomKearney/IdentityServer3.Samples,codedecay/IdentityServer3.Samples,EternalXw/IdentityServer3.Samples,vebin/IdentityServer3.Samples,sumedhmeshram/IdentityServer3.Samples,lvjunlei/IdentityServer3.Samples,jmalca14/IdentityServer3.Samples,stombeur/IdentityServer3.Samples,andyshao/IdentityServer3.Samples,ravibisht27/IdentityServer3.Samples,sumedhmeshram/IdentityServer3.Samples,TomKearney/IdentityServer3.Samples,andyshao/IdentityServer3.Samples,codeice/IdentityServer3.Samples,yanjustino/IdentityServer3.Samples,carlos-sarmiento/IdentityServer3.Samples,eric-swann-q2/IdentityServer3.Samples,MartinKip/IdentityServer3.Samples,JaonDong/IdentityServer3.Samples,IdentityServer/IdentityServer3.Samples,MetSystem/IdentityServer3.Samples,feanz/Thinktecture.IdentityServer3.Samples,codedecay/IdentityServer3.Samples,andyshao/IdentityServer3.Samples,gavinbarron/IdentityServer3.Samples,eric-swann-q2/IdentityServer3.Samples,jhoerr/IdentityServer3.Samples,nguyentk90/IdentityServer3.Samples,gavinbarron/IdentityServer3.Samples,atul221282/IdentityServer3.Samples,DosGuru/IdentityServer3.Samples,stombeur/IdentityServer3.Samples,ravibisht27/IdentityServer3.Samples,faithword/IdentityServer3.Samples,carlos-sarmiento/IdentityServer3.Samples,lvjunlei/IdentityServer3.Samples,eric-swann-q2/IdentityServer3.Samples,yanjustino/IdentityServer3.Samples,codehedgehog/IdentityServer3.Samples,TomKearney/IdentityServer3.Samples,atul221282/IdentityServer3.Samples,nicklv/IdentityServer3.Samples,DosGuru/IdentityServer3.Samples,MetSystem/IdentityServer3.Samples,yanjustino/IdentityServer3.Samples,ryanvgates/IdentityServer3.Samples,faithword/IdentityServer3.Samples,geffzhang/Thinktecture.IdentityServer.v3.Samples,MetSystem/IdentityServer3.Samples,kouweizhong/IdentityServer3.Samples,DosGuru/IdentityServer3.Samples,kouweizhong/IdentityServer3.Samples,pirumpi/IdentityServer3.Samples,codeice/IdentityServer3.Samples,JaonDong/IdentityServer3.Samples,18098924759/IdentityServer3.Samples,MartinKip/IdentityServer3.Samples,lvjunlei/IdentityServer3.Samples,geffzhang/Thinktecture.IdentityServer.v3.Samples,tuyndv/IdentityServer3.Samples,vebin/IdentityServer3.Samples,IdentityServer/IdentityServer3.Samples,EternalXw/IdentityServer3.Samples,tuyndv/IdentityServer3.Samples,stombeur/IdentityServer3.Samples,ravibisht27/IdentityServer3.Samples,carlos-sarmiento/IdentityServer3.Samples,pirumpi/IdentityServer3.Samples,jmalca14/IdentityServer3.Samples,jhoerr/IdentityServer3.Samples,faithword/IdentityServer3.Samples,nguyentk90/IdentityServer3.Samples,codehedgehog/IdentityServer3.Samples,jhoerr/IdentityServer3.Samples,stombeur/IdentityServer3.Samples
source/AspNet5Host/src/IdentityServer3/Startup.cs
source/AspNet5Host/src/IdentityServer3/Startup.cs
using System; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; using Microsoft.Framework.DependencyInjection; using Thinktecture.IdentityServer.Core.Configuration; using AspNet5Host.Configuration; using System.Security.Cryptography.X509Certificates; using System.IO; namespace AspNet5Host { public class Startup { // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { services.AddDataProtection(); } public void Configure(IApplicationBuilder app) { var certFile = AppDomain.CurrentDomain.BaseDirectory + "\\idsrv3test.pfx"; app.Map("/core", core => { var factory = InMemoryFactory.Create( users: Users.Get(), clients: Clients.Get(), scopes: Scopes.Get()); var idsrvOptions = new IdentityServerOptions { Factory = factory, RequireSsl = false, SigningCertificate = new X509Certificate2(certFile, "idsrv3test") }; core.UseIdentityServer(idsrvOptions); }); } } }
using System; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; using Microsoft.Framework.DependencyInjection; using Thinktecture.IdentityServer.Core.Configuration; using AspNet5Host.Configuration; using System.Security.Cryptography.X509Certificates; using System.IO; namespace AspNet5Host { public class Startup { // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { } public void Configure(IApplicationBuilder app) { var certFile = AppDomain.CurrentDomain.BaseDirectory + "\\idsrv3test.pfx"; app.Map("/core", core => { var factory = InMemoryFactory.Create( users: Users.Get(), clients: Clients.Get(), scopes: Scopes.Get()); var idsrvOptions = new IdentityServerOptions { Factory = factory, RequireSsl = false, SigningCertificate = new X509Certificate2(certFile, "idsrv3test") }; core.UseIdentityServer(idsrvOptions); }); } } }
apache-2.0
C#
ae20de1a493f901983cf81835af858a793a4d658
Rename test
appharbor/appharbor-cli
src/AppHarbor.Tests/Commands/CreateCommandTest.cs
src/AppHarbor.Tests/Commands/CreateCommandTest.cs
using System; using System.Collections.Generic; using System.Linq; using AppHarbor.Commands; using Moq; using Ploeh.AutoFixture; using Ploeh.AutoFixture.Xunit; using Xunit; using Xunit.Extensions; namespace AppHarbor.Tests.Commands { public class CreateCommandTest { [Theory, AutoCommandData] public void ShouldThrowWhenNoArguments(CreateCommand command) { var exception = Assert.Throws<CommandException>(() => command.Execute(new string[0])); Assert.Equal("An application name must be provided to create an application", exception.Message); } [Theory, AutoCommandData] public void ShouldCreateApplicationWithOnlyName(CreateCommand command, Fixture fixture) { command.Execute(new string[] { "foo" }); } [Theory, AutoCommandData] public void ShouldCreateApplicationWithRegion([Frozen]Mock<IAppHarborClient> client, CreateCommand command, string[] arguments) { command.Execute(arguments); client.Verify(x => x.CreateApplication(arguments.First(), arguments.Skip(1).FirstOrDefault()), Times.Once()); } } }
using System.Linq; using AppHarbor.Commands; using Moq; using Ploeh.AutoFixture.Xunit; using Xunit; using Xunit.Extensions; namespace AppHarbor.Tests.Commands { public class CreateCommandTest { [Theory, AutoCommandData] public void ShouldThrowWhenNoArguments(CreateCommand command) { var exception = Assert.Throws<CommandException>(() => command.Execute(new string[0])); Assert.Equal("An application name must be provided to create an application", exception.Message); } [Theory, AutoCommandData] public void ShouldCreateApplication([Frozen]Mock<IAppHarborClient> client, CreateCommand command, string[] arguments) { command.Execute(arguments); client.Verify(x => x.CreateApplication(arguments.First(), arguments.Skip(1).FirstOrDefault()), Times.Once()); } } }
mit
C#
5d11512ec8d8383ce3e71fe8607e5dd21737569d
Update IProjectEditorPlatform.cs
wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D
src/Core2D/Model/Editor/IProjectEditorPlatform.cs
src/Core2D/Model/Editor/IProjectEditorPlatform.cs
#nullable enable namespace Core2D.Model.Editor; public interface IProjectEditorPlatform { void OnOpen(); void OnSave(); void OnSaveAs(); void OnClose(); void OnImportJson(object? param); void OnImportSvg(object? param); void OnImportObject(object? param); void OnExportJson(object? param); void OnExportObject(object? param); void OnExport(object? param); void OnExecuteScriptFile(object? param); void OnExecuteScriptFile(); void OnExit(); void OnCopyAsXaml(object? param); void OnCopyAsSvg(object? param); void OnPasteSvg(); void OnCopyAsEmf(object? param); void OnCopyAsPathData(object? param); void OnPastePathDataStroked(); void OnPastePathDataFilled(); void OnImportData(object? param); void OnExportData(object? param); void OnUpdateData(object? param); void OnAboutDialog(); void OnZoomReset(); void OnZoomFill(); void OnZoomUniform(); void OnZoomUniformToFill(); void OnZoomAutoFit(); void OnZoomIn(); void OnZoomOut(); }
#nullable enable using Core2D.ViewModels.Containers; using Core2D.ViewModels.Data; namespace Core2D.Model.Editor; public interface IProjectEditorPlatform { void OnOpen(); void OnSave(); void OnSaveAs(); void OnClose(); void OnImportJson(object? param); void OnImportSvg(object? param); void OnImportObject(object? param); void OnExportJson(object? param); void OnExportObject(object? param); void OnExport(object? param); void OnExecuteScriptFile(object? param); void OnExecuteScriptFile(); void OnExit(); void OnCopyAsXaml(object? param); void OnCopyAsSvg(object? param); void OnPasteSvg(); void OnCopyAsEmf(object? param); void OnCopyAsPathData(object? param); void OnPastePathDataStroked(); void OnPastePathDataFilled(); void OnImportData(object? param); void OnExportData(object? param); void OnUpdateData(object? param); void OnAboutDialog(); void OnZoomReset(); void OnZoomFill(); void OnZoomUniform(); void OnZoomUniformToFill(); void OnZoomAutoFit(); void OnZoomIn(); void OnZoomOut(); }
mit
C#
9b939866c9beb877f0a7c0a62ca3da90c9bfff5d
Set version 0.10.0
jaenyph/DelegateDecompiler,morgen2009/DelegateDecompiler,hazzik/DelegateDecompiler
src/DelegateDecompiler/Properties/AssemblyInfo.cs
src/DelegateDecompiler/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("DelegateDecompiler")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DelegateDecompiler")] [assembly: AssemblyCopyright("Copyright © hazzik 2012 - 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("cec0a257-502b-4718-91c3-9e67555c5e1b")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.10.0.0")] [assembly: AssemblyFileVersion("0.10.0.0")] [assembly: InternalsVisibleTo("DelegateDecompiler.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c96a47f445d38b9b23cbf52e405743481cb9bd2df4672ad6494abcdeb9daf5588eb6159cc88af5fd5a18cece1f05ecb3ddba4b6329535438f4d173f2b769c4715c136ce65c2f25e7360916737056bca40bee22ab2f178af4c5fdc0e5051a6b2630f31447885eb4f5273271c56bd7b8fb240ab453635a79ec2d8aae4a58a6439f")]
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("DelegateDecompiler")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DelegateDecompiler")] [assembly: AssemblyCopyright("Copyright © hazzik 2012 - 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("cec0a257-502b-4718-91c3-9e67555c5e1b")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.9.1.0")] [assembly: AssemblyFileVersion("0.9.1.0")] [assembly: InternalsVisibleTo("DelegateDecompiler.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c96a47f445d38b9b23cbf52e405743481cb9bd2df4672ad6494abcdeb9daf5588eb6159cc88af5fd5a18cece1f05ecb3ddba4b6329535438f4d173f2b769c4715c136ce65c2f25e7360916737056bca40bee22ab2f178af4c5fdc0e5051a6b2630f31447885eb4f5273271c56bd7b8fb240ab453635a79ec2d8aae4a58a6439f")]
mit
C#
1d49e36ea9ded05610bf665a6e7ea0207e2d8d0c
Replace ffmpeg.exe with ffmpeg.
dlemstra/Magick.NET,dlemstra/Magick.NET
src/Magick.NET/Configuration/ConfigurationFile.cs
src/Magick.NET/Configuration/ConfigurationFile.cs
// Copyright 2013-2021 Dirk Lemstra <https://github.com/dlemstra/Magick.NET/> // // Licensed under the ImageMagick License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // // https://www.imagemagick.org/script/license.php // // Unless required by applicable law or agreed to in writing, software distributed under the // License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, // either express or implied. See the License for the specific language governing permissions // and limitations under the License. using System.IO; namespace ImageMagick.Configuration { internal sealed class ConfigurationFile : IConfigurationFile { public ConfigurationFile(string fileName) { FileName = fileName; Data = LoadData(); } public string FileName { get; } public string Data { get; set; } private string LoadData() { using (Stream stream = TypeHelper.GetManifestResourceStream(typeof(ConfigurationFile), "ImageMagick.Resources.Xml", FileName)) { using (var reader = new StreamReader(stream)) { var data = reader.ReadToEnd(); data = UpdateDelegatesXml(data); return data; } } } private string UpdateDelegatesXml(string data) { if (OperatingSystem.IsWindows || FileName != "delegates.xml") return data; data = data.Replace("@PSDelegate@", "gs"); data = data.Replace("ffmpeg.exe", "ffmpeg"); return data; } } }
// Copyright 2013-2021 Dirk Lemstra <https://github.com/dlemstra/Magick.NET/> // // Licensed under the ImageMagick License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // // https://www.imagemagick.org/script/license.php // // Unless required by applicable law or agreed to in writing, software distributed under the // License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, // either express or implied. See the License for the specific language governing permissions // and limitations under the License. using System.IO; namespace ImageMagick.Configuration { internal sealed class ConfigurationFile : IConfigurationFile { public ConfigurationFile(string fileName) { FileName = fileName; Data = LoadData(); } public string FileName { get; } public string Data { get; set; } private string LoadData() { using (Stream stream = TypeHelper.GetManifestResourceStream(typeof(ConfigurationFile), "ImageMagick.Resources.Xml", FileName)) { using (var reader = new StreamReader(stream)) { var data = reader.ReadToEnd(); data = UpdateDelegatesXml(data); return data; } } } private string UpdateDelegatesXml(string data) { if (OperatingSystem.IsWindows || FileName != "delegates.xml") return data; return data.Replace("@PSDelegate@", "gs"); } } }
apache-2.0
C#
7ab23f0a23e595678b8ae72377b55c89b9fe5456
fix controller return types
falquan/NTachyon,falquan/NTachyon,falquan/NTachyon,falquan/NTachyon,falquan/NTachyon
src/NTachyon.Api/Controllers/CrontabController.cs
src/NTachyon.Api/Controllers/CrontabController.cs
using System; using Microsoft.AspNetCore.Mvc; using NTachyon.Api.Crontab; using NTachyon.Api.Model; namespace NTachyon.Api.Controllers { [Route("api/[controller]")] public class CrontabController : Controller { private readonly ICrontab crontab; public CrontabController(ICrontab crontab) { this.crontab = crontab; } // GET api/crontab/0 0 0 * 0 0 [HttpGet("{expression}")] public IActionResult Get(string expression) { var decodedExpression = Uri.UnescapeDataString(expression); if (crontab.IsValid(decodedExpression)) { return Ok(crontab.Get(decodedExpression)); } return BadRequest(decodedExpression); } [HttpPost] public IActionResult Post([FromBody] CrontabRequest request) { if (crontab.IsValid(request.Expression)) { return Ok(crontab.Get(request.Expression)); } return BadRequest(request); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Mvc; using NTachyon.Api.Crontab; using NTachyon.Api.Model; namespace NTachyon.Api.Controllers { [Route("api/[controller]")] public class CrontabController : Controller { private readonly ICrontab crontab; public CrontabController(ICrontab crontab) { this.crontab = new NTachyon.Api.Crontab.NCrontab(); } // GET api/crontab/0 0 0 * 0 0 [HttpGet("{expression}")] public IActionResult Get(string expression) { var decodedExpression = Uri.UnescapeDataString(expression); if (crontab.IsValid(decodedExpression)) { return new ObjectResult(crontab.Get(decodedExpression)); } return BadRequest(decodedExpression); } [HttpPost] public IActionResult Post([FromBody] CrontabRequest request) { if (crontab.IsValid(request.Expression)) { return new ObjectResult(crontab.Get(request.Expression)); } return BadRequest(request); } } }
mit
C#
561c12a3a3e705851df2a98b264555ab6e4fe6ff
Remove recipe from core
Evorlor/Wok-n-Roll
Assets/Scripts/Core.cs
Assets/Scripts/Core.cs
using UnityEngine; using System.Collections; using System; public class Core : MonoBehaviour { private static Core instance; public static Core GetInstance() { return instance; } private bool EnableShackingStyle = false; private int ShackingTimes = 2; private int currentShackingTime = 0; private bool debounced = false; private bool started = true; public float TimeToSkip = -1.0f; private float timeDuration = 0.0f; private float ScoreValue = 0.1f; public float Score = 0.0f; // Use this for initialization void Start () { instance = this; } // Update is called once per frame void Update () { if (started) { Action action = InstructionManager.Instance.GetCurrentInstruction().action; if (TimeToSkip >= 0.0f) { timeDuration += Time.deltaTime; if (timeDuration >= TimeToSkip) { started = nextStep(); return; } } if (Control.GetInstance().GetInput(action)) { if (action == Action.Jump) { for (int i = (int)Action.BEGIN + 1; i < (int)Action.SIZE; i++) { if (i == (int)Action.Jump) continue; if (Control.GetInstance().GetInput((Action)i)) return; } Score += ScoreValue; started = nextStep(); } else { if (debounced || !EnableShackingStyle) { debounced = false; currentShackingTime++; if ((currentShackingTime >= ShackingTimes) || !EnableShackingStyle) { currentShackingTime = 0; Score += ScoreValue; started = nextStep(); Debug.Log(Score); } } } } else { debounced = true; } } } public bool IsStarted() { return started; } private bool nextStep() { bool valid = true; try { InstructionManager.Instance.NextInstruction(); } catch (InvalidOperationException) { valid = false; } return valid; } public void StartCooking() { started = true; } }
using UnityEngine; using System.Collections; using System; public class Core : MonoBehaviour { private static Core instance; public static Core GetInstance() { return instance; } private bool EnableShackingStyle = false; private int ShackingTimes = 2; private int currentShackingTime = 0; private bool debounced = false; private IRecipe mRecipe; private bool started = true; public float TimeToSkip = -1.0f; private float timeDuration = 0.0f; private float ScoreValue = 0.1f; public float Score = 0.0f; // Use this for initialization void Start () { instance = this; // TODO: Testing mRecipe = new RandomRecipe(); } // Update is called once per frame void Update () { if (started && mRecipe != null) { Action action = mRecipe.CurrentStep(); if (TimeToSkip >= 0.0f) { timeDuration += Time.deltaTime; if (timeDuration >= TimeToSkip) { started = nextStep(); return; } } if (Control.GetInstance().GetInput(action)) { if (action == Action.Jump) { for (int i = (int)Action.BEGIN + 1; i < (int)Action.SIZE; i++) { if (i == (int)Action.Jump) continue; if (Control.GetInstance().GetInput((Action)i)) return; } Score += ScoreValue; started = nextStep(); } else { if (debounced || !EnableShackingStyle) { debounced = false; currentShackingTime++; if ((currentShackingTime >= ShackingTimes) || !EnableShackingStyle) { currentShackingTime = 0; Score += ScoreValue; started = nextStep(); Debug.Log(Score); } } } } else { debounced = true; } } } public bool IsStarted() { return started; } private bool nextStep() { bool valid = true; try { mRecipe.NextStep(); } catch (InvalidOperationException) { valid = false; } return valid; } private bool preStep() { bool valid = true; try { mRecipe.PreStep(); } catch (InvalidOperationException) { valid = false; } return valid; } public void SetRecipe(IRecipe recipe) { mRecipe = recipe; } public void StartCooking() { started = true; } }
mit
C#
f9b111c392898188c188a8ea6f43657275e7be21
Format MainActivity
SolidNerd/TwitterMonkey
TwitterMonkey.Android/MainActivity.cs
TwitterMonkey.Android/MainActivity.cs
using System; using System.IO; using System.Net; using System.Threading.Tasks; using Android.App; using Android.OS; using Android.Widget; using TwitterMonkey.Portable.Twitter; using TwitterMonkey.Portable; using Squareup.Picasso; using Android.Util; using System.Collections.Generic; namespace TwitterMonkey { [Activity(Label = "TwitterMonkey", MainLauncher = true, Icon = "@drawable/icon")] public class MainActivity : Activity { private const string TAG = "TwitterMonkey"; protected override async void OnCreate (Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); var listView = FindViewById<ListView>(Resource.Id.listView1); // populate the listview with data var jsonString = await fetchJsonAsync(new Uri(Constants.JSON_URI)); var tweets = TweetConverter.ConvertAll(jsonString); listView.Adapter = new TwitterAdapter(this, tweets); } private async Task<string> fetchJsonAsync (Uri uri) { HttpWebRequest request = new HttpWebRequest(uri); var resp = await request.GetResponseAsync(); StreamReader reader = new StreamReader (resp.GetResponseStream()); return await reader.ReadToEndAsync(); } } }
using System; using System.IO; using System.Net; using System.Threading.Tasks; using Android.App; using Android.OS; using Android.Widget; using TwitterMonkey.Portable.Twitter; using TwitterMonkey.Portable; using Squareup.Picasso; using Android.Util; using System.Collections.Generic; namespace TwitterMonkey { [Activity(Label = "TwitterMonkey",MainLauncher=true, Icon = "@drawable/icon")] public class MainActivity : Activity { private const string TAG = "TwitterMonkey"; private ListView listView; protected override async void OnCreate (Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); listView = FindViewById<ListView>(Resource.Id.listView1); // get reference to the ListView in the layout // populate the listview with data var jsonString = await fetchJsonAsync(new Uri(Constants.JSON_URI)); var tweets = TweetConverter.ConvertAll(jsonString); listView.Adapter = new TwitterAdapter(this, tweets); } private async Task<string> fetchJsonAsync (Uri uri) { HttpWebRequest request = new HttpWebRequest(uri); var resp = await request.GetResponseAsync(); StreamReader reader = new StreamReader (resp.GetResponseStream()); return await reader.ReadToEndAsync(); } } }
mit
C#
8ec3844ea79e8872e4258f7269e7dfeb3a5a6fc2
fix login bug
phongtlse61770/TakeCoffee_ASS_SE1065,phongtlse61770/TakeCoffee_ASS_SE1065,phongtlse61770/TakeCoffee_ASS_SE1065
API/Security/AuthenticationFilter.cs
API/Security/AuthenticationFilter.cs
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Security.Claims; using System.Threading; using System.Threading.Tasks; using System.Web; using System.Web.Http.Controllers; using System.Web.Http.Filters; using System.Web.Http.Results; using System.Web.Mvc; using System.Web.Mvc.Filters; using Entity.Helper; using ActionFilterAttribute = System.Web.Http.Filters.ActionFilterAttribute; namespace API.Security { public class AuthenticationFilter : ActionFilterAttribute { public override void OnActionExecuting(HttpActionContext actionContext) { HttpRequestHeaders headers = actionContext.Request.Headers; String username = null; String password = null; bool isAllow = false; try { String action = actionContext.Request.RequestUri.Segments.Last(); if (action.ToUpper().Equals("CheckLogin".ToUpper())) { isAllow = true; } else { username = headers.GetValues("username").First(); password = headers.GetValues("password").First(); using (UserHelper userHelper = new UserHelper()) { isAllow = userHelper.Authenticate(username, password); } } } catch (Exception) { //Do nothing } if (!isAllow) { actionContext.Response = new HttpResponseMessage(HttpStatusCode.Forbidden); } base.OnActionExecuting(actionContext); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Security.Claims; using System.Threading; using System.Threading.Tasks; using System.Web; using System.Web.Http.Controllers; using System.Web.Http.Filters; using System.Web.Http.Results; using System.Web.Mvc; using System.Web.Mvc.Filters; using Entity.Helper; using ActionFilterAttribute = System.Web.Http.Filters.ActionFilterAttribute; namespace API.Security { public class AuthenticationFilter : ActionFilterAttribute { public override void OnActionExecuting(HttpActionContext actionContext) { HttpRequestHeaders headers = actionContext.Request.Headers; String username = null; String password = null; bool isAllow = false; try { String action = actionContext.Request.RequestUri.Segments.Last(); if (action.Equals("CheckLogin")) { isAllow = true; } else { username = headers.GetValues("username").First(); password = headers.GetValues("password").First(); using (UserHelper userHelper = new UserHelper()) { isAllow = userHelper.Authenticate(username, password); } } } catch (Exception) { //Do nothing } if (!isAllow) { actionContext.Response = new HttpResponseMessage(HttpStatusCode.Forbidden); } base.OnActionExecuting(actionContext); } } }
mit
C#
cd9a8643ce693f4f966b4a80b8284577089260c7
Bump minor version
kdelmonte/active-directory-utilities
Properties/AssemblyInfo.cs
Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("ActiveDirectoryUtilities")] [assembly: AssemblyDescription("Perform common Active Directory tasks easily...")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Kelvin Del Monte")] [assembly: AssemblyProduct("ActiveDirectoryUtilities")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("cca928ea-b1a2-494a-b59f-1ede3364cd8b")] // 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.1.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("ActiveDirectoryUtilities")] [assembly: AssemblyDescription("Perform common Active Directory tasks easily...")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Kelvin Del Monte")] [assembly: AssemblyProduct("ActiveDirectoryUtilities")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("cca928ea-b1a2-494a-b59f-1ede3364cd8b")] // 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")]
mit
C#
05c182a3fb9ee38766a63c6ecc910e9822afdc2c
Remove INetworkEntityRegistery from BlockOtherPLayerLeaveGameEventPayloadHandler
HelloKitty/Booma.Proxy
src/Booma.Proxy.Client.Unity.Ship/Handlers/Payload/BlockOtherPlayerLeaveGameEventPayloadHandler.cs
src/Booma.Proxy.Client.Unity.Ship/Handlers/Payload/BlockOtherPlayerLeaveGameEventPayloadHandler.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Common.Logging; using GladNet; using SceneJect.Common; namespace Booma.Proxy { [AdditionalRegisterationAs(typeof(IRemotePlayerLeaveLobbyEventSubscribable))] [SceneTypeCreate(GameSceneType.Pioneer2)] [SceneTypeCreate(GameSceneType.RagolDefault)] public sealed class BlockOtherPlayerLeaveGameEventPayloadHandler : GameMessageHandler<BlockOtherPlayerLeaveGameEventPayload>, IRemotePlayerLeaveLobbyEventSubscribable { /// <inheritdoc /> public event EventHandler<RemotePlayerLeaveLobbyEventArgs> OnRemotePlayerLeftLobby; /// <inheritdoc /> public BlockOtherPlayerLeaveGameEventPayloadHandler(ILog logger) : base(logger) { } /// <inheritdoc /> public override Task HandleMessage(IPeerMessageContext<PSOBBGamePacketPayloadClient> context, BlockOtherPlayerLeaveGameEventPayload payload) { if(Logger.IsInfoEnabled) Logger.Warn($"Recieved Player GameLeave From EntityId: {payload.Identifier}."); //We should just broadcast that a player left the lobby. OnRemotePlayerLeftLobby?.Invoke(this, new RemotePlayerLeaveLobbyEventArgs(EntityGuid.ComputeEntityGuid(EntityType.Player, payload.Identifier))); return Task.CompletedTask; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Common.Logging; using GladNet; using SceneJect.Common; namespace Booma.Proxy { [AdditionalRegisterationAs(typeof(IRemotePlayerLeaveLobbyEventSubscribable))] [SceneTypeCreate(GameSceneType.Pioneer2)] [SceneTypeCreate(GameSceneType.RagolDefault)] public sealed class BlockOtherPlayerLeaveGameEventPayloadHandler : GameMessageHandler<BlockOtherPlayerLeaveGameEventPayload>, IRemotePlayerLeaveLobbyEventSubscribable { /// <inheritdoc /> public event EventHandler<RemotePlayerLeaveLobbyEventArgs> OnRemotePlayerLeftLobby; /// <inheritdoc /> public BlockOtherPlayerLeaveGameEventPayloadHandler([NotNull] INetworkEntityRegistery<INetworkPlayer> playerRegistry, ILog logger) : base(logger) { } /// <inheritdoc /> public override Task HandleMessage(IPeerMessageContext<PSOBBGamePacketPayloadClient> context, BlockOtherPlayerLeaveGameEventPayload payload) { if(Logger.IsInfoEnabled) Logger.Warn($"Recieved Player GameLeave From EntityId: {payload.Identifier}."); //We should just broadcast that a player left the lobby. OnRemotePlayerLeftLobby?.Invoke(this, new RemotePlayerLeaveLobbyEventArgs(EntityGuid.ComputeEntityGuid(EntityType.Player, payload.Identifier))); return Task.CompletedTask; } } }
agpl-3.0
C#
9deaa8f120ea37054ea36e7655acd09a18ac15b7
Remove unused directive
dotnet/roslyn-analyzers,mavasani/roslyn-analyzers,mavasani/roslyn-analyzers,dotnet/roslyn-analyzers
src/Microsoft.CodeAnalysis.Analyzers/CSharp/MetaAnalyzers/Fixers/CSharpCompareSymbolsCorrectlyFix.cs
src/Microsoft.CodeAnalysis.Analyzers/CSharp/MetaAnalyzers/Fixers/CSharpCompareSymbolsCorrectlyFix.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.Composition; using Microsoft.CodeAnalysis.Analyzers.MetaAnalyzers.Fixers; using Microsoft.CodeAnalysis.CodeFixes; using Microsoft.CodeAnalysis.CSharp.Syntax; namespace Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.Fixers { [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(CompareSymbolsCorrectlyFix)), Shared] public sealed class CSharpCompareSymbolsCorrectlyFix : CompareSymbolsCorrectlyFix { protected override SyntaxNode CreateConditionalAccessExpression(SyntaxNode expression, SyntaxNode whenNotNull) => SyntaxFactory.ConditionalAccessExpression((ExpressionSyntax)expression, (ExpressionSyntax)whenNotNull); } }
// 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.Linq; using Microsoft.CodeAnalysis.Analyzers.MetaAnalyzers.Fixers; using Microsoft.CodeAnalysis.CodeFixes; using Microsoft.CodeAnalysis.CSharp.Syntax; namespace Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.Fixers { [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(CompareSymbolsCorrectlyFix)), Shared] public sealed class CSharpCompareSymbolsCorrectlyFix : CompareSymbolsCorrectlyFix { protected override SyntaxNode CreateConditionalAccessExpression(SyntaxNode expression, SyntaxNode whenNotNull) => SyntaxFactory.ConditionalAccessExpression((ExpressionSyntax)expression, (ExpressionSyntax)whenNotNull); } }
mit
C#
14473b545889539151d7cf5d8c2a58ade870af2d
Return IServiceCollection from AddSession extension methods
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
src/Microsoft.AspNetCore.Session/SessionServiceCollectionExtensions.cs
src/Microsoft.AspNetCore.Session/SessionServiceCollectionExtensions.cs
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Session; namespace Microsoft.Extensions.DependencyInjection { /// <summary> /// Extension methods for adding session services to the DI container. /// </summary> public static class SessionServiceCollectionExtensions { /// <summary> /// Adds services required for application session state. /// </summary> /// <param name="services">The <see cref="IServiceCollection"/> to add the services to.</param> /// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns> public static IServiceCollection AddSession(this IServiceCollection services) { if (services == null) { throw new ArgumentNullException(nameof(services)); } services.AddTransient<ISessionStore, DistributedSessionStore>(); return services; } /// <summary> /// Adds services required for application session state. /// </summary> /// <param name="services">The <see cref="IServiceCollection"/> to add the services to.</param> /// <param name="configure">The session options to configure the middleware with.</param> /// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns> public static IServiceCollection AddSession(this IServiceCollection services, Action<SessionOptions> configure) { if (services == null) { throw new ArgumentNullException(nameof(services)); } if (configure == null) { throw new ArgumentNullException(nameof(configure)); } services.Configure(configure); services.AddSession(); return services; } } }
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Session; namespace Microsoft.Extensions.DependencyInjection { /// <summary> /// Extension methods for adding session services to the DI container. /// </summary> public static class SessionServiceCollectionExtensions { /// <summary> /// Adds services required for application session state. /// </summary> /// <param name="services">The <see cref="IServiceCollection"/> to add the services to.</param> public static void AddSession(this IServiceCollection services) { if (services == null) { throw new ArgumentNullException(nameof(services)); } services.AddTransient<ISessionStore, DistributedSessionStore>(); } /// <summary> /// Adds services required for application session state. /// </summary> /// <param name="services">The <see cref="IServiceCollection"/> to add the services to.</param> /// <param name="configure">The session options to configure the middleware with.</param> public static void AddSession(this IServiceCollection services, Action<SessionOptions> configure) { if (services == null) { throw new ArgumentNullException(nameof(services)); } if (configure == null) { throw new ArgumentNullException(nameof(configure)); } services.Configure(configure); services.AddSession(); } } }
apache-2.0
C#
bb560fd00d552b055e6de1fa3c7613110a0c1ffd
Make AutofacViewModelFactory resolve operation 'optional', so we don't throw
Velir/Jabberwocky
Jabberwocky.Glass.Autofac.Mvc/Models/Factory/AutofacViewModelFactory.cs
Jabberwocky.Glass.Autofac.Mvc/Models/Factory/AutofacViewModelFactory.cs
using System; using Autofac; using Glass.Mapper.Sc; using Jabberwocky.Glass.Autofac.Mvc.Services; using Jabberwocky.Glass.Models; namespace Jabberwocky.Glass.Autofac.Mvc.Models.Factory { public class AutofacViewModelFactory : IViewModelFactory { private readonly IComponentContext _resolver; private readonly ISitecoreContext _context; private readonly IRenderingContextService _renderingContextService; public AutofacViewModelFactory(IComponentContext resolver, IRenderingContextService renderingContextService, ISitecoreContext context) { if (resolver == null) throw new ArgumentNullException("resolver"); if (renderingContextService == null) throw new ArgumentNullException("renderingContextService"); if (context == null) throw new ArgumentNullException("context"); _resolver = resolver; _renderingContextService = renderingContextService; _context = context; } public TModel Create<TModel>() where TModel : class { return Create(typeof (TModel)) as TModel; } public object Create(Type model) { var viewModel = _resolver.ResolveOptional(model); var glassViewModel = viewModel as InjectableGlassViewModelBase; if (glassViewModel != null) { glassViewModel.InternalModel = GetGlassModel(); } return viewModel; } private IGlassBase GetGlassModel() { var rendering = _renderingContextService.GetCurrentRendering(); if (rendering == null || string.IsNullOrEmpty(rendering.DataSource)) { return _context.GetCurrentItem<IGlassBase>(inferType: true); } // Depending on if the datasource is a GUID vs Path, use the correct overload Guid dataSourceGuid; return Guid.TryParse(rendering.DataSource, out dataSourceGuid) ? _context.GetItem<IGlassBase>(dataSourceGuid, inferType: true) : _context.GetItem<IGlassBase>(rendering.DataSource, inferType: true); } } }
using System; using Autofac; using Glass.Mapper.Sc; using Jabberwocky.Glass.Autofac.Mvc.Services; using Jabberwocky.Glass.Models; namespace Jabberwocky.Glass.Autofac.Mvc.Models.Factory { public class AutofacViewModelFactory : IViewModelFactory { private readonly IComponentContext _resolver; private readonly ISitecoreContext _context; private readonly IRenderingContextService _renderingContextService; public AutofacViewModelFactory(IComponentContext resolver, IRenderingContextService renderingContextService, ISitecoreContext context) { if (resolver == null) throw new ArgumentNullException("resolver"); if (renderingContextService == null) throw new ArgumentNullException("renderingContextService"); if (context == null) throw new ArgumentNullException("context"); _resolver = resolver; _renderingContextService = renderingContextService; _context = context; } public TModel Create<TModel>() where TModel : class { return Create(typeof (TModel)) as TModel; } public object Create(Type model) { var viewModel = _resolver.Resolve(model); var glassViewModel = viewModel as InjectableGlassViewModelBase; if (glassViewModel != null) { glassViewModel.InternalModel = GetGlassModel(); } return viewModel; } private IGlassBase GetGlassModel() { var rendering = _renderingContextService.GetCurrentRendering(); if (rendering == null || string.IsNullOrEmpty(rendering.DataSource)) { return _context.GetCurrentItem<IGlassBase>(inferType: true); } // Depending on if the datasource is a GUID vs Path, use the correct overload Guid dataSourceGuid; return Guid.TryParse(rendering.DataSource, out dataSourceGuid) ? _context.GetItem<IGlassBase>(dataSourceGuid, inferType: true) : _context.GetItem<IGlassBase>(rendering.DataSource, inferType: true); } } }
mit
C#
4bbda41cbf00c8194b3b44d9455a6a71d58ef752
upgrade versio to 0.1.0.1
icsharp/log4net.Kafka
log4net.Kafka/Properties/AssemblyInfo.cs
log4net.Kafka/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("log4net.Kafka")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("log4net.Kafka")] [assembly: AssemblyCopyright("Copyright © 2016")] [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("ecad735b-e4d0-479a-b9ab-1f162f192c33")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.1.0.1")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("log4net.Kafka")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("log4net.Kafka")] [assembly: AssemblyCopyright("Copyright © 2016")] [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("ecad735b-e4d0-479a-b9ab-1f162f192c33")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.1.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
apache-2.0
C#
4e08a5c4c48f660a258d96adadbd9839e2dd3c97
Update CryptoMethods.cs
fredatgithub/Crypto
CryptoLibrary/CryptoMethods.cs
CryptoLibrary/CryptoMethods.cs
using System.Security.Cryptography.X509Certificates; namespace CryptoLibrary { public static class CryptoMethods { public static readonly char[] PossibleCharacters = {'0','1','2','3','4','5','6','7','8','9', 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z', '~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '-', '_', '=', '+', '[', ']', '{', '}', ';', ':', ',', '.', '<', '>', '/', '?' }; public static char[] SortPossibleCharacters(Language selectedLanguage) { char[] result; result = PossibleCharacters; // TODO write code to implement sorting according to selectedLanguage letter frequencies return result; } } public enum Language { NoLanguageSpecified, English, DefaultLanguage = English, French, OtherLanguage } }
/* The MIT License(MIT) Copyright(c) 2015 Freddy Juhel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.Security.Cryptography.X509Certificates; namespace CryptoLibrary { public static class CryptoMethods { public static readonly char[] PossibleCharacters = {'0','1','2','3','4','5','6','7','8','9', 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z', '~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '-', '_', '=', '+', '[', ']', '{', '}', ';', ':', ',', '.', '<', '>', '/', '?' }; public static char[] SortPossibleCharacters(Language selectedLanguage) { char[] result; result = PossibleCharacters; // TODO write code to implement sorting according to selectedLanguage letter frequencies return result; } } public enum Language { NoLanguageSpecified, English, DefaultLanguage = English, French, OtherLanguage } }
mit
C#
b63b90df61337254541a68ba54333981943f48b5
Update CollectionItemValidatorTests.cs
Squidex/squidex,Squidex/squidex,pushrbx/squidex,pushrbx/squidex,Squidex/squidex,pushrbx/squidex,Squidex/squidex,pushrbx/squidex,Squidex/squidex,pushrbx/squidex
tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/CollectionItemValidatorTests.cs
tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/CollectionItemValidatorTests.cs
// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschränkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using System.Collections.Generic; using System.Threading.Tasks; using FluentAssertions; using Squidex.Domain.Apps.Core.ValidateContent.Validators; using Xunit; namespace Squidex.Domain.Apps.Core.Operations.ValidateContent.Validators { public class CollectionItemValidatorTests { private readonly List<string> errors = new List<string>(); [Fact] public async Task Should_not_add_error_if_value_is_wrong_type() { var sut = new CollectionItemValidator(new RangeValidator<int>(2, 4)); await sut.ValidateAsync(true, errors); Assert.Empty(errors); } [Fact] public async Task Should_not_add_error_if_all_values_are_valid() { var sut = new CollectionItemValidator(new RangeValidator<int>(2, 4)); await sut.ValidateAsync(new List<int> { 2, 3, 4 }, errors); Assert.Empty(errors); } [Fact] public async Task Should_add_error_if_at_least_one_item_is_not_valid() { var sut = new CollectionItemValidator(new RangeValidator<int>(2, 4)); await sut.ValidateAsync(new List<int> { 2, 1, 4, 5 }, errors); errors.Should().BeEquivalentTo( new[] { "[2]: Must be greater than or equal to '2'.", "[4]: Must be less than or equal to '4'." }); } } }
// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschränkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using System.Collections.Generic; using System.Threading.Tasks; using FluentAssertions; using Squidex.Domain.Apps.Core.ValidateContent.Validators; using Xunit; namespace Squidex.Domain.Apps.Core.Operations.ValidateContent.Validators { public class CollectionItemValidatorTests { private readonly List<string> errors = new List<string>(); [Fact] public async Task Should_not_add_error_if_value_is_wrong_type() { var sut = new CollectionItemValidator(new RangeValidator<int>(2, 4)); await sut.ValidateAsync(true, errors); Assert.Empty(errors); } [Fact] public async Task Should_not_add_error_if_all_values_are_valid() { var sut = new CollectionItemValidator(new RangeValidator<int>(2, 4)); await sut.ValidateAsync(new List<int> { 2, 3, 4 }, errors); Assert.Empty(errors); } [Fact] public async Task Should_add_error_if_at_least_one_item_is_not_valid() { var sut = new CollectionItemValidator(new RangeValidator<int>(2, 4)); await sut.ValidateAsync(new List<int> { 2, 1, 4, 5 }, errors); errors.Should().BeEquivalentTo( new[] { "[2]: Must be greater or equals than '2'.", "[4]: Must be less or equals than '4'." }); } } }
mit
C#
372a09161248da2b2f828a62a1bf8c586bb3d43b
Bump version
canton7/SyncTrayzor,canton7/SyncTrayzor,canton7/SyncTrayzor
src/SyncTrayzor/Properties/AssemblyInfo.cs
src/SyncTrayzor/Properties/AssemblyInfo.cs
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // 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("SyncTrayzor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SyncTrayzor")] [assembly: AssemblyCopyright("Copyright © Antony Male 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // 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.4.0")] [assembly: AssemblyFileVersion("1.0.4.0")]
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // 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("SyncTrayzor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SyncTrayzor")] [assembly: AssemblyCopyright("Copyright © Antony Male 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // 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.3.0")] [assembly: AssemblyFileVersion("1.0.3.0")]
mit
C#
dc0fa394f057bb9db880ceaeeaf08268a0d774bb
Increment version to v1.1.0.19
XeroAPI/XeroAPI.Net,TDaphneB/XeroAPI.Net,MatthewSteeples/XeroAPI.Net,jcvandan/XeroAPI.Net
source/XeroApi/Properties/AssemblyInfo.cs
source/XeroApi/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("XeroApi")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Xero")] [assembly: AssemblyProduct("XeroApi")] [assembly: AssemblyCopyright("Copyright © Xero 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("e18a84e7-ba04-4368-b4c9-0ea0cc78ddef")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.1.0.19")] [assembly: AssemblyFileVersion("1.1.0.19")]
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("XeroApi")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Xero")] [assembly: AssemblyProduct("XeroApi")] [assembly: AssemblyCopyright("Copyright © Xero 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("e18a84e7-ba04-4368-b4c9-0ea0cc78ddef")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.1.0.18")] [assembly: AssemblyFileVersion("1.1.0.18")]
mit
C#