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
4a316fad2fedf334db9761764a46d59fb9e18e3a
Add audio feedback for rearranging list items
ppy/osu,ppy/osu,ppy/osu,peppy/osu,peppy/osu,peppy/osu
osu.Game/Graphics/Containers/OsuRearrangeableListContainer.cs
osu.Game/Graphics/Containers/OsuRearrangeableListContainer.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable disable using System.Collections.Specialized; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Sample; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Utils; namespace osu.Game.Graphics.Containers { public abstract class OsuRearrangeableListContainer<TModel> : RearrangeableListContainer<TModel> { /// <summary> /// Whether any item is currently being dragged. Used to hide other items' drag handles. /// </summary> protected readonly BindableBool DragActive = new BindableBool(); protected override ScrollContainer<Drawable> CreateScrollContainer() => new OsuScrollContainer(); private Sample sampleSwap; private double sampleLastPlaybackTime; protected sealed override RearrangeableListItem<TModel> CreateDrawable(TModel item) => CreateOsuDrawable(item).With(d => { d.DragActive.BindTo(DragActive); }); protected abstract OsuRearrangeableListItem<TModel> CreateOsuDrawable(TModel item); protected OsuRearrangeableListContainer() { Items.CollectionChanged += (_, args) => { if (args.Action == NotifyCollectionChangedAction.Move) playSwapSample(); }; } private void playSwapSample() { if (Time.Current - sampleLastPlaybackTime <= 35) return; var channel = sampleSwap?.GetChannel(); if (channel == null) return; channel.Frequency.Value = 0.96 + RNG.NextDouble(0.08); channel.Play(); sampleLastPlaybackTime = Time.Current; } [BackgroundDependencyLoader] private void load(AudioManager audio) { sampleSwap = audio.Samples.Get(@"UI/item-swap"); sampleLastPlaybackTime = Time.Current; } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable disable using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; namespace osu.Game.Graphics.Containers { public abstract class OsuRearrangeableListContainer<TModel> : RearrangeableListContainer<TModel> { /// <summary> /// Whether any item is currently being dragged. Used to hide other items' drag handles. /// </summary> protected readonly BindableBool DragActive = new BindableBool(); protected override ScrollContainer<Drawable> CreateScrollContainer() => new OsuScrollContainer(); protected sealed override RearrangeableListItem<TModel> CreateDrawable(TModel item) => CreateOsuDrawable(item).With(d => { d.DragActive.BindTo(DragActive); }); protected abstract OsuRearrangeableListItem<TModel> CreateOsuDrawable(TModel item); } }
mit
C#
4bf26c24c8f692a9cb186fb3c731a9ec0affa797
Update benchmarks to new format
ianhays/xunit-performance,ericeil/xunit-performance,mmitche/xunit-performance,visia/xunit-performance,Microsoft/xunit-performance,pharring/xunit-performance,Microsoft/xunit-performance
samples/DNXLibrary/SampleTests.cs
samples/DNXLibrary/SampleTests.cs
using Microsoft.Xunit.Performance; using Xunit; namespace DNXLibrary { // This project can output the Class library as a NuGet Package. // To enable this option, right-click on the project and select the Properties menu item. In the Build tab select "Produce outputs on build". public class DNXSampleTests { [Fact] public void AlwaysPass() { Assert.True(true); } [Fact] public void AlwaysFail() { Assert.True(false); } [Benchmark] public void Benchmark1() { Benchmark.Iterate(() => { }); } [Benchmark] [InlineData(1)] [InlineData(2)] [InlineData(3)] public void Benchmark2(int x) { Benchmark.Iterate(() => { }); } } }
using Microsoft.Xunit.Performance; using Xunit; namespace DNXLibrary { // This project can output the Class library as a NuGet Package. // To enable this option, right-click on the project and select the Properties menu item. In the Build tab select "Produce outputs on build". public class DNXSampleTests { [Fact] public void AlwaysPass() { Assert.True(true); } [Fact] public void AlwaysFail() { Assert.True(false); } [Benchmark] public void Benchmark1() { } [Benchmark] [InlineData(1)] [InlineData(2)] [InlineData(3)] public void Benchmark2(int x) { } } }
mit
C#
2196b52d4b3409ab8c81532203aba26d0cc2094a
Make Markdown help open in another window
kirillkos/joinrpg-net,leotsarev/joinrpg-net,kirillkos/joinrpg-net,joinrpg/joinrpg-net,joinrpg/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net,leotsarev/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net
Joinrpg/Views/Shared/EditorTemplates/MarkdownString.cshtml
Joinrpg/Views/Shared/EditorTemplates/MarkdownString.cshtml
@model JoinRpg.DataModel.MarkdownString @{ var requiredMsg = new MvcHtmlString(""); var validation = false; foreach (var attr in @Html.GetUnobtrusiveValidationAttributes(@ViewData.TemplateInfo.HtmlFieldPrefix, @ViewData.ModelMetadata)) { if (attr.Key == "data-val-required") { requiredMsg = new MvcHtmlString("data-val-required='" + HttpUtility.HtmlAttributeEncode((string) attr.Value) + "'"); validation = true; } } } <div> Можно использовать <a href="http://daringfireball.net/projects/markdown/syntax" target="_blank">MarkDown</a> (**<b>полужирный</b>**, _<i>курсив</i>_) <br/> <textarea class="form-control" cols="100" id="@(ViewData.TemplateInfo.HtmlFieldPrefix)_Contents" name="@(ViewData.TemplateInfo.HtmlFieldPrefix).Contents" @requiredMsg @(validation ? "data-val=true" : "") rows="4">@(Model == null ? "" : Model.Contents)</textarea> </div> @if (validation) { @Html.ValidationMessageFor(model => Model.Contents, "", new { @class = "text-danger" }) }
@model JoinRpg.DataModel.MarkdownString @{ var requiredMsg = new MvcHtmlString(""); var validation = false; foreach (var attr in @Html.GetUnobtrusiveValidationAttributes(@ViewData.TemplateInfo.HtmlFieldPrefix, @ViewData.ModelMetadata)) { if (attr.Key == "data-val-required") { requiredMsg = new MvcHtmlString("data-val-required='" + HttpUtility.HtmlAttributeEncode((string) attr.Value) + "'"); validation = true; } } } <div> Можно использовать <a href="http://daringfireball.net/projects/markdown/syntax">MarkDown</a> (**<b>полужирный</b>**, _<i>курсив</i>_) <br/> <textarea class="form-control" cols="100" id="@(ViewData.TemplateInfo.HtmlFieldPrefix)_Contents" name="@(ViewData.TemplateInfo.HtmlFieldPrefix).Contents" @requiredMsg @(validation ? "data-val=true" : "") rows="4">@(Model == null ? "" : Model.Contents)</textarea> </div> @if (validation) { @Html.ValidationMessageFor(model => Model.Contents, "", new { @class = "text-danger" }) }
mit
C#
382ab41fb58434b13df6dac84e219e905b8baa7f
Replace Apache with MIT.
ptoonen/corefx,stone-li/corefx,Petermarcu/corefx,shimingsg/corefx,vidhya-bv/corefx-sorting,benpye/corefx,SGuyGe/corefx,jeremymeng/corefx,tijoytom/corefx,shmao/corefx,josguil/corefx,josguil/corefx,mellinoe/corefx,bitcrazed/corefx,Priya91/corefx-1,richlander/corefx,elijah6/corefx,parjong/corefx,khdang/corefx,alexandrnikitin/corefx,pgavlin/corefx,stephenmichaelf/corefx,lggomez/corefx,gregg-miskelly/corefx,jcme/corefx,gkhanna79/corefx,weltkante/corefx,comdiv/corefx,jlin177/corefx,manu-silicon/corefx,shahid-pk/corefx,jeremymeng/corefx,marksmeltzer/corefx,JosephTremoulet/corefx,cartermp/corefx,SGuyGe/corefx,fgreinacher/corefx,axelheer/corefx,gkhanna79/corefx,billwert/corefx,tstringer/corefx,Priya91/corefx-1,twsouthwick/corefx,mokchhya/corefx,ellismg/corefx,YoupHulsebos/corefx,the-dwyer/corefx,Chrisboh/corefx,seanshpark/corefx,heXelium/corefx,janhenke/corefx,parjong/corefx,ptoonen/corefx,krk/corefx,Ermiar/corefx,krk/corefx,YoupHulsebos/corefx,richlander/corefx,MaggieTsang/corefx,shahid-pk/corefx,ellismg/corefx,akivafr123/corefx,adamralph/corefx,billwert/corefx,stephenmichaelf/corefx,n1ghtmare/corefx,mmitche/corefx,ptoonen/corefx,yizhang82/corefx,tijoytom/corefx,pgavlin/corefx,nchikanov/corefx,dotnet-bot/corefx,jeremymeng/corefx,cartermp/corefx,rjxby/corefx,iamjasonp/corefx,iamjasonp/corefx,MaggieTsang/corefx,dhoehna/corefx,mazong1123/corefx,ViktorHofer/corefx,manu-silicon/corefx,cartermp/corefx,billwert/corefx,parjong/corefx,janhenke/corefx,shimingsg/corefx,lggomez/corefx,manu-silicon/corefx,Chrisboh/corefx,benpye/corefx,khdang/corefx,weltkante/corefx,heXelium/corefx,JosephTremoulet/corefx,tijoytom/corefx,tijoytom/corefx,iamjasonp/corefx,mafiya69/corefx,DnlHarvey/corefx,billwert/corefx,JosephTremoulet/corefx,gkhanna79/corefx,Chrisboh/corefx,gregg-miskelly/corefx,gregg-miskelly/corefx,alphonsekurian/corefx,ViktorHofer/corefx,dotnet-bot/corefx,nchikanov/corefx,rahku/corefx,cydhaselton/corefx,Jiayili1/corefx,weltkante/corefx,Yanjing123/corefx,parjong/corefx,wtgodbe/corefx,shahid-pk/corefx,manu-silicon/corefx,khdang/corefx,Ermiar/corefx,pallavit/corefx,tstringer/corefx,Priya91/corefx-1,richlander/corefx,ravimeda/corefx,Petermarcu/corefx,richlander/corefx,Yanjing123/corefx,seanshpark/corefx,josguil/corefx,tijoytom/corefx,JosephTremoulet/corefx,wtgodbe/corefx,Petermarcu/corefx,khdang/corefx,Jiayili1/corefx,alexandrnikitin/corefx,stephenmichaelf/corefx,akivafr123/corefx,jcme/corefx,nchikanov/corefx,mmitche/corefx,stone-li/corefx,dhoehna/corefx,lggomez/corefx,n1ghtmare/corefx,jhendrixMSFT/corefx,alphonsekurian/corefx,bitcrazed/corefx,the-dwyer/corefx,iamjasonp/corefx,690486439/corefx,wtgodbe/corefx,benpye/corefx,stone-li/corefx,weltkante/corefx,twsouthwick/corefx,ellismg/corefx,shahid-pk/corefx,alexperovich/corefx,benjamin-bader/corefx,zhenlan/corefx,dotnet-bot/corefx,rjxby/corefx,cydhaselton/corefx,janhenke/corefx,jhendrixMSFT/corefx,vidhya-bv/corefx-sorting,zhenlan/corefx,vidhya-bv/corefx-sorting,bitcrazed/corefx,gregg-miskelly/corefx,ericstj/corefx,gkhanna79/corefx,DnlHarvey/corefx,shrutigarg/corefx,rahku/corefx,mazong1123/corefx,BrennanConroy/corefx,Yanjing123/corefx,gkhanna79/corefx,lggomez/corefx,nchikanov/corefx,tstringer/corefx,yizhang82/corefx,mellinoe/corefx,alexperovich/corefx,stone-li/corefx,yizhang82/corefx,axelheer/corefx,jcme/corefx,mafiya69/corefx,shahid-pk/corefx,PatrickMcDonald/corefx,dhoehna/corefx,dhoehna/corefx,yizhang82/corefx,Chrisboh/corefx,rajansingh10/corefx,seanshpark/corefx,nchikanov/corefx,jhendrixMSFT/corefx,alphonsekurian/corefx,Jiayili1/corefx,mokchhya/corefx,seanshpark/corefx,benpye/corefx,weltkante/corefx,twsouthwick/corefx,nbarbettini/corefx,krytarowski/corefx,YoupHulsebos/corefx,Petermarcu/corefx,jlin177/corefx,YoupHulsebos/corefx,benjamin-bader/corefx,yizhang82/corefx,alphonsekurian/corefx,rjxby/corefx,ravimeda/corefx,Yanjing123/corefx,dsplaisted/corefx,ericstj/corefx,n1ghtmare/corefx,elijah6/corefx,marksmeltzer/corefx,billwert/corefx,khdang/corefx,Ermiar/corefx,stephenmichaelf/corefx,rjxby/corefx,manu-silicon/corefx,DnlHarvey/corefx,bitcrazed/corefx,shmao/corefx,zhenlan/corefx,wtgodbe/corefx,krk/corefx,shimingsg/corefx,krk/corefx,rahku/corefx,mellinoe/corefx,the-dwyer/corefx,Jiayili1/corefx,richlander/corefx,alphonsekurian/corefx,shmao/corefx,jhendrixMSFT/corefx,dsplaisted/corefx,fgreinacher/corefx,ellismg/corefx,axelheer/corefx,dhoehna/corefx,MaggieTsang/corefx,ravimeda/corefx,nbarbettini/corefx,alphonsekurian/corefx,zhenlan/corefx,billwert/corefx,ViktorHofer/corefx,MaggieTsang/corefx,jeremymeng/corefx,parjong/corefx,krytarowski/corefx,tstringer/corefx,elijah6/corefx,axelheer/corefx,benjamin-bader/corefx,mokchhya/corefx,SGuyGe/corefx,comdiv/corefx,comdiv/corefx,akivafr123/corefx,SGuyGe/corefx,ericstj/corefx,krytarowski/corefx,elijah6/corefx,marksmeltzer/corefx,twsouthwick/corefx,parjong/corefx,ViktorHofer/corefx,pgavlin/corefx,the-dwyer/corefx,kkurni/corefx,shrutigarg/corefx,rahku/corefx,ravimeda/corefx,krytarowski/corefx,marksmeltzer/corefx,krytarowski/corefx,richlander/corefx,marksmeltzer/corefx,janhenke/corefx,wtgodbe/corefx,ViktorHofer/corefx,alexandrnikitin/corefx,stone-li/corefx,rubo/corefx,ptoonen/corefx,khdang/corefx,josguil/corefx,MaggieTsang/corefx,janhenke/corefx,krytarowski/corefx,Priya91/corefx-1,krk/corefx,rahku/corefx,alexperovich/corefx,kkurni/corefx,nchikanov/corefx,cydhaselton/corefx,shimingsg/corefx,twsouthwick/corefx,rahku/corefx,stone-li/corefx,SGuyGe/corefx,690486439/corefx,rubo/corefx,jlin177/corefx,mazong1123/corefx,PatrickMcDonald/corefx,heXelium/corefx,iamjasonp/corefx,JosephTremoulet/corefx,seanshpark/corefx,nbarbettini/corefx,janhenke/corefx,dhoehna/corefx,mmitche/corefx,vidhya-bv/corefx-sorting,benjamin-bader/corefx,BrennanConroy/corefx,rubo/corefx,kkurni/corefx,mokchhya/corefx,ViktorHofer/corefx,jcme/corefx,mokchhya/corefx,alexandrnikitin/corefx,cartermp/corefx,cartermp/corefx,ptoonen/corefx,mellinoe/corefx,benpye/corefx,krk/corefx,rjxby/corefx,MaggieTsang/corefx,Jiayili1/corefx,shmao/corefx,mmitche/corefx,690486439/corefx,Yanjing123/corefx,twsouthwick/corefx,stephenmichaelf/corefx,ravimeda/corefx,PatrickMcDonald/corefx,dsplaisted/corefx,Chrisboh/corefx,ericstj/corefx,PatrickMcDonald/corefx,gkhanna79/corefx,rjxby/corefx,mokchhya/corefx,shimingsg/corefx,akivafr123/corefx,alexperovich/corefx,jcme/corefx,Jiayili1/corefx,ptoonen/corefx,DnlHarvey/corefx,vidhya-bv/corefx-sorting,pallavit/corefx,richlander/corefx,cartermp/corefx,wtgodbe/corefx,jhendrixMSFT/corefx,pallavit/corefx,DnlHarvey/corefx,YoupHulsebos/corefx,dotnet-bot/corefx,pallavit/corefx,shmao/corefx,tijoytom/corefx,ravimeda/corefx,jlin177/corefx,alexperovich/corefx,pallavit/corefx,YoupHulsebos/corefx,jeremymeng/corefx,benjamin-bader/corefx,JosephTremoulet/corefx,Petermarcu/corefx,seanshpark/corefx,ravimeda/corefx,PatrickMcDonald/corefx,heXelium/corefx,cydhaselton/corefx,elijah6/corefx,shrutigarg/corefx,ptoonen/corefx,zhenlan/corefx,lggomez/corefx,yizhang82/corefx,JosephTremoulet/corefx,nchikanov/corefx,pgavlin/corefx,mmitche/corefx,shahid-pk/corefx,the-dwyer/corefx,alexandrnikitin/corefx,Ermiar/corefx,fgreinacher/corefx,the-dwyer/corefx,seanshpark/corefx,stone-li/corefx,ellismg/corefx,benpye/corefx,iamjasonp/corefx,billwert/corefx,manu-silicon/corefx,tstringer/corefx,nbarbettini/corefx,ericstj/corefx,mmitche/corefx,kkurni/corefx,mazong1123/corefx,dhoehna/corefx,jcme/corefx,shmao/corefx,dotnet-bot/corefx,lggomez/corefx,Priya91/corefx-1,nbarbettini/corefx,shrutigarg/corefx,690486439/corefx,Ermiar/corefx,axelheer/corefx,Ermiar/corefx,mafiya69/corefx,jlin177/corefx,marksmeltzer/corefx,twsouthwick/corefx,manu-silicon/corefx,adamralph/corefx,tijoytom/corefx,tstringer/corefx,YoupHulsebos/corefx,shmao/corefx,Petermarcu/corefx,ericstj/corefx,elijah6/corefx,DnlHarvey/corefx,cydhaselton/corefx,lggomez/corefx,mazong1123/corefx,ellismg/corefx,rajansingh10/corefx,benjamin-bader/corefx,iamjasonp/corefx,alexperovich/corefx,Chrisboh/corefx,rajansingh10/corefx,comdiv/corefx,jhendrixMSFT/corefx,adamralph/corefx,stephenmichaelf/corefx,yizhang82/corefx,akivafr123/corefx,stephenmichaelf/corefx,DnlHarvey/corefx,jhendrixMSFT/corefx,josguil/corefx,690486439/corefx,fgreinacher/corefx,weltkante/corefx,cydhaselton/corefx,ViktorHofer/corefx,Jiayili1/corefx,Priya91/corefx-1,marksmeltzer/corefx,ericstj/corefx,axelheer/corefx,shimingsg/corefx,SGuyGe/corefx,rubo/corefx,wtgodbe/corefx,weltkante/corefx,elijah6/corefx,rajansingh10/corefx,mazong1123/corefx,zhenlan/corefx,mafiya69/corefx,the-dwyer/corefx,mafiya69/corefx,krk/corefx,mellinoe/corefx,krytarowski/corefx,mellinoe/corefx,pallavit/corefx,nbarbettini/corefx,dotnet-bot/corefx,rjxby/corefx,bitcrazed/corefx,josguil/corefx,MaggieTsang/corefx,parjong/corefx,n1ghtmare/corefx,nbarbettini/corefx,rahku/corefx,BrennanConroy/corefx,kkurni/corefx,Ermiar/corefx,cydhaselton/corefx,jlin177/corefx,mafiya69/corefx,alphonsekurian/corefx,shimingsg/corefx,jlin177/corefx,Petermarcu/corefx,n1ghtmare/corefx,mmitche/corefx,alexperovich/corefx,dotnet-bot/corefx,rubo/corefx,zhenlan/corefx,kkurni/corefx,mazong1123/corefx,gkhanna79/corefx
src/System.Text.Encodings.Web/tests/EncoderExtensionsTests.cs
src/System.Text.Encodings.Web/tests/EncoderExtensionsTests.cs
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Framework.WebEncoders; using System; using System.IO; using Xunit; using System.Text.Unicode; namespace System.Text.Encodings.Web { public class EncoderExtensionsTests { [Fact] public void HtmlEncode_ParameterChecks() { Assert.Throws<ArgumentNullException>(() => EncoderExtensions.HtmlEncode(null, "Hello!", new StringWriter())); } [Fact] public void HtmlEncode_PositiveTestCase() { // Arrange HtmlEncoder encoder = HtmlEncoder.Create(UnicodeRanges.All); StringWriter writer = new StringWriter(); // Act encoder.Encode(writer, "Hello+there!"); // Assert Assert.Equal("Hello&#x2B;there!", writer.ToString()); } [Fact] public void JavaScriptStringEncode_ParameterChecks() { Assert.Throws<ArgumentNullException>(() => EncoderExtensions.JavaScriptStringEncode(null, "Hello!", new StringWriter())); } [Fact] public void JavaScriptStringEncode_PositiveTestCase() { // Arrange IJavaScriptStringEncoder encoder = new JavaScriptStringEncoder(UnicodeRanges.All); StringWriter writer = new StringWriter(); // Act encoder.JavaScriptStringEncode("Hello+there!", writer); // Assert Assert.Equal(@"Hello\u002Bthere!", writer.ToString()); } [Fact] public void UrlEncode_ParameterChecks() { Assert.Throws<ArgumentNullException>(() => EncoderExtensions.UrlEncode(null, "Hello!", new StringWriter())); } [Fact] public void UrlEncode_PositiveTestCase() { // Arrange UrlEncoder encoder = UrlEncoder.Create(UnicodeRanges.All); StringWriter writer = new StringWriter(); // Act encoder.Encode(writer, "Hello+there!"); // Assert Assert.Equal("Hello%2Bthere!", writer.ToString()); } } }
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.Framework.WebEncoders; using System; using System.IO; using Xunit; using System.Text.Unicode; namespace System.Text.Encodings.Web { public class EncoderExtensionsTests { [Fact] public void HtmlEncode_ParameterChecks() { Assert.Throws<ArgumentNullException>(() => EncoderExtensions.HtmlEncode(null, "Hello!", new StringWriter())); } [Fact] public void HtmlEncode_PositiveTestCase() { // Arrange HtmlEncoder encoder = HtmlEncoder.Create(UnicodeRanges.All); StringWriter writer = new StringWriter(); // Act encoder.Encode(writer, "Hello+there!"); // Assert Assert.Equal("Hello&#x2B;there!", writer.ToString()); } [Fact] public void JavaScriptStringEncode_ParameterChecks() { Assert.Throws<ArgumentNullException>(() => EncoderExtensions.JavaScriptStringEncode(null, "Hello!", new StringWriter())); } [Fact] public void JavaScriptStringEncode_PositiveTestCase() { // Arrange IJavaScriptStringEncoder encoder = new JavaScriptStringEncoder(UnicodeRanges.All); StringWriter writer = new StringWriter(); // Act encoder.JavaScriptStringEncode("Hello+there!", writer); // Assert Assert.Equal(@"Hello\u002Bthere!", writer.ToString()); } [Fact] public void UrlEncode_ParameterChecks() { Assert.Throws<ArgumentNullException>(() => EncoderExtensions.UrlEncode(null, "Hello!", new StringWriter())); } [Fact] public void UrlEncode_PositiveTestCase() { // Arrange UrlEncoder encoder = UrlEncoder.Create(UnicodeRanges.All); StringWriter writer = new StringWriter(); // Act encoder.Encode(writer, "Hello+there!"); // Assert Assert.Equal("Hello%2Bthere!", writer.ToString()); } } }
mit
C#
b02ad2be485451127e197bd285c3854cf6c59390
Fix failing tests.
jkoritzinsky/Avalonia,SuperJMN/Avalonia,wieslawsoltes/Perspex,SuperJMN/Avalonia,grokys/Perspex,wieslawsoltes/Perspex,AvaloniaUI/Avalonia,jkoritzinsky/Perspex,jkoritzinsky/Avalonia,SuperJMN/Avalonia,AvaloniaUI/Avalonia,wieslawsoltes/Perspex,Perspex/Perspex,AvaloniaUI/Avalonia,akrisiun/Perspex,MrDaedra/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia,MrDaedra/Avalonia,wieslawsoltes/Perspex,grokys/Perspex,wieslawsoltes/Perspex,SuperJMN/Avalonia,wieslawsoltes/Perspex,SuperJMN/Avalonia,SuperJMN/Avalonia,Perspex/Perspex,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia,jkoritzinsky/Avalonia,SuperJMN/Avalonia,jkoritzinsky/Avalonia,AvaloniaUI/Avalonia
tests/Avalonia.Base.UnitTests/AvaloniaObjectTests_Attached.cs
tests/Avalonia.Base.UnitTests/AvaloniaObjectTests_Attached.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; using Xunit; namespace Avalonia.Base.UnitTests { public class AvaloniaObjectTests_Attached { [Fact] public void AddOwnered_Property_Retains_Default_Value() { var target = new Class2(); Assert.Equal("foodefault", target.GetValue(Class2.FooProperty)); } [Fact] public void AddOwnered_Property_Retains_Validation() { var target = new Class2(); Assert.Throws<IndexOutOfRangeException>(() => target.SetValue(Class2.FooProperty, "throw")); } private class Class1 : AvaloniaObject { public static readonly AttachedProperty<string> FooProperty = AvaloniaProperty.RegisterAttached<Class1, Class2, string>( "Foo", "foodefault", validate: ValidateFoo); private static string ValidateFoo(AvaloniaObject arg1, string arg2) { if (arg2 == "throw") { throw new IndexOutOfRangeException(); } return arg2; } } private class Class2 : AvaloniaObject { public static readonly AttachedProperty<string> FooProperty = Class1.FooProperty.AddOwner<Class2>(); } } }
// 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; using Xunit; namespace Avalonia.Base.UnitTests { public class AvaloniaObjectTests_Attached { [Fact] public void AddOwnered_Property_Retains_Default_Value() { var target = new Class2(); Assert.Equal("foodefault", target.GetValue(Class2.FooProperty)); } [Fact] public void AddOwnered_Property_Retains_Validation() { var target = new Class2(); Assert.Throws<IndexOutOfRangeException>(() => target.SetValue(Class2.FooProperty, "throw")); } private class Class1 : AvaloniaObject { public static readonly AttachedProperty<string> FooProperty = AvaloniaProperty.RegisterAttached<Class1, AvaloniaObject, string>( "Foo", "foodefault", validate: ValidateFoo); private static string ValidateFoo(AvaloniaObject arg1, string arg2) { if (arg2 == "throw") { throw new IndexOutOfRangeException(); } return arg2; } } private class Class2 : AvaloniaObject { public static readonly AttachedProperty<string> FooProperty = Class1.FooProperty.AddOwner<Class2>(); } } }
mit
C#
999f4584635186c4c7b9091a3cd3adcd94707867
fix - non si può trasferire la chiamata alla stessa sede di provenienza
vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf
src/backend/SO115App.Models/Servizi/CQRS/Commands/GestioneSoccorso/GestioneTrasferimentiChiamate/AddTrasferimento/AddTrasferimentoValidator.cs
src/backend/SO115App.Models/Servizi/CQRS/Commands/GestioneSoccorso/GestioneTrasferimentiChiamate/AddTrasferimento/AddTrasferimentoValidator.cs
using CQRS.Commands.Validators; using CQRS.Validation; using SO115App.Models.Classi.Utility; using System.Collections.Generic; namespace SO115App.Models.Servizi.CQRS.Commands.GestioneSoccorso.GestioneTrasferimentiChiamate.AddTrasferimento { public class AddTrasferimentoValidator : ICommandValidator<AddTrasferimentoCommand> { public IEnumerable<ValidationResult> Validate(AddTrasferimentoCommand command) { if (command.TrasferimentoChiamata == null || command.TrasferimentoChiamata == default) yield return new ValidationResult(Costanti.IdRichiestaNonValida); else { if (command.TrasferimentoChiamata.CodRichiesta == null || command.TrasferimentoChiamata.CodRichiesta == "") yield return new ValidationResult("Nessun codice richiesta"); if (command.TrasferimentoChiamata.CodSedeA == null || command.TrasferimentoChiamata.CodSedeA == "") yield return new ValidationResult("Nessun codice sede a"); if (command.TrasferimentoChiamata.CodSedeA == command.CodiceSede) yield return new ValidationResult("Non puoi trasferire la chiamata alla stassa sede di provenienza"); } } } }
using CQRS.Commands.Validators; using CQRS.Validation; using SO115App.Models.Classi.Utility; using System.Collections.Generic; using System.Linq; namespace SO115App.Models.Servizi.CQRS.Commands.GestioneSoccorso.GestioneTrasferimentiChiamate.AddTrasferimento { public class AddTrasferimentoValidator : ICommandValidator<AddTrasferimentoCommand> { public IEnumerable<ValidationResult> Validate(AddTrasferimentoCommand command) { if (command.TrasferimentoChiamata == null || command.TrasferimentoChiamata == default) yield return new ValidationResult(Costanti.IdRichiestaNonValida); else { if (command.TrasferimentoChiamata.CodRichiesta == null || command.TrasferimentoChiamata.CodRichiesta == "") yield return new ValidationResult("Nessun codice richiesta"); if (command.TrasferimentoChiamata.CodSedeA == null || command.TrasferimentoChiamata.CodSedeA == "") yield return new ValidationResult("Nessun codice sede a"); } } } }
agpl-3.0
C#
79cbbdbedd45908ed9935f3b4cce75c5dfd24ec8
fix permission issues
mooware/ReplaceExe
ReplaceExe/Program.cs
ReplaceExe/Program.cs
using Microsoft.Win32; using System; using System.Diagnostics; using System.Linq; using System.Reflection; namespace ReplaceExe { class Program { const string regBasePath = @"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options"; const string regValueName = "Debugger"; static void Main(string[] args) { try { if (args.Length > 2 && args[0] == "-i") // -i <orig exe> <command args...> Install(args[1], args.Skip(2).ToArray()); else if (args.Length > 1 && args[0] == "-u") // -u <orig exe> Uninstall(args[1]); else if (args.Length > 2) // <args> <command args...> <orig exe> file1 file2 ... Run(args); else PrintHelp(); } catch (Exception ex) { System.Console.Error.WriteLine(string.Join(" ", args)); // just catch and print anything System.Console.Error.WriteLine(ex.ToString()); } } static void Install(string image, string[] command) { string myPath = new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath; // <this exe> <number of following args> <args...> string fullCommand = string.Format("\"{0}\" {1} {2}", myPath, command.Length, string.Join(" ", command)); var baseKey = Registry.LocalMachine.OpenSubKey(regBasePath, true); var key = baseKey.CreateSubKey(image); key.SetValue(regValueName, fullCommand); } static void Uninstall(string image) { var baseKey = Registry.LocalMachine.OpenSubKey(regBasePath, true); var key = baseKey.OpenSubKey(image, true); if (key != null) key.DeleteValue(regValueName, false); } static void Run(string[] args) { int len = int.Parse(args[0]); string command = args[1]; string[] commandArgs = args.Skip(2).Take(len - 1).ToArray(); string[] replaceArgs = args.Skip(2 + len).Select(a => '"' + a + '"').ToArray(); string joinedArgs = string.Join(" ", commandArgs) + ' ' + string.Join(" ", replaceArgs); Process proc = Process.Start(command, joinedArgs); // stop when the other process stops, to allow waiting on the replaced exe proc.WaitForExit(); } static void PrintHelp() { System.Console.WriteLine("usage:"); System.Console.WriteLine(); System.Console.WriteLine("install:"); System.Console.WriteLine(" -i <image to replace> <command> <args...>"); System.Console.WriteLine("uninstall:"); System.Console.WriteLine(" -u <image to replace>"); } } }
using Microsoft.Win32; using System; using System.Diagnostics; using System.Linq; using System.Reflection; namespace ReplaceExe { class Program { const string regBasePath = @"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options"; const string regValueName = "Debugger"; static void Main(string[] args) { try { if (args.Length > 2 && args[0] == "-i") // -i <orig exe> <command args...> Install(args[1], args.Skip(2).ToArray()); else if (args.Length > 1 && args[0] == "-u") // -u <orig exe> Uninstall(args[1]); else if (args.Length > 2) // <args> <command args...> <orig exe> file1 file2 ... Run(args); else PrintHelp(); } catch (Exception ex) { System.Console.Error.WriteLine(string.Join(" ", args)); // just catch and print anything System.Console.Error.WriteLine(ex.ToString()); } } static void Install(string image, string[] command) { string myPath = new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath; // <this exe> <number of following args> <args...> string fullCommand = string.Format("\"{0}\" {1} {2}", myPath, command.Length, string.Join(" ", command)); var baseKey = Registry.LocalMachine.OpenSubKey(regBasePath, true); var key = baseKey.CreateSubKey(image); key.SetValue(regValueName, fullCommand); } static void Uninstall(string image) { var baseKey = Registry.LocalMachine.OpenSubKey(regBasePath); var key = baseKey.OpenSubKey(image); if (key != null) key.DeleteValue(regValueName, false); } static void Run(string[] args) { int len = int.Parse(args[0]); string command = args[1]; string[] commandArgs = args.Skip(2).Take(len - 1).ToArray(); string[] replaceArgs = args.Skip(2 + len).Select(a => '"' + a + '"').ToArray(); string joinedArgs = string.Join(" ", commandArgs) + ' ' + string.Join(" ", replaceArgs); Process proc = Process.Start(command, joinedArgs); // stop when the other process stops, to allow waiting on the replaced exe proc.WaitForExit(); } static void PrintHelp() { System.Console.WriteLine("usage:"); System.Console.WriteLine(); System.Console.WriteLine("install:"); System.Console.WriteLine(" -i <image to replace> <command> <args...>"); System.Console.WriteLine("uninstall:"); System.Console.WriteLine(" -u <image to replace>"); } } }
mit
C#
adf0b5cea4c5600522de497fc9fff7deb25a0f9f
fix ui freeze
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi.Fluent/ViewModels/Login/LoginViewModel.cs
WalletWasabi.Fluent/ViewModels/Login/LoginViewModel.cs
using System.Threading.Tasks; using System.Windows.Input; using ReactiveUI; using WalletWasabi.Blockchain.Keys; using WalletWasabi.Fluent.ViewModels.Navigation; using WalletWasabi.Fluent.ViewModels.Wallets; using WalletWasabi.Userfacing; using WalletWasabi.Wallets; namespace WalletWasabi.Fluent.ViewModels.Login { public partial class LoginViewModel : RoutableViewModel { [AutoNotify] private string _password; [AutoNotify] private bool _isPasswordIncorrect; [AutoNotify] private bool _isPasswordNeeded; [AutoNotify] private string _walletName; public LoginViewModel(WalletViewModelBase walletViewModelBase, WalletManager walletManager) { Title = "Login"; KeyManager = walletViewModelBase.Wallet.KeyManager; IsPasswordNeeded = !KeyManager.IsWatchOnly; _walletName = walletViewModelBase.WalletName; _password = ""; NextCommand = ReactiveCommand.CreateFromTask(async () => { IsBusy = true; var wallet = walletViewModelBase.Wallet; IsPasswordIncorrect = await Task.Run(async () => { if (!IsPasswordNeeded) { return false; } if (PasswordHelper.TryPassword(KeyManager, Password, out var compatibilityPasswordUsed)) { if (compatibilityPasswordUsed is { }) { await ShowErrorAsync(PasswordHelper.CompatibilityPasswordWarnMessage, "Compatibility password was used"); } return false; } return true; }); if (!IsPasswordIncorrect) { wallet.Login(); // TODO: navigate to the wallet welcome page Navigate().To(walletViewModelBase, NavigationMode.Clear); } IsBusy = false; }); OkCommand = ReactiveCommand.Create(() => { Password = ""; IsPasswordIncorrect = false; }); } public ICommand OkCommand { get; } public KeyManager KeyManager { get; } } }
using System.Threading.Tasks; using System.Windows.Input; using ReactiveUI; using WalletWasabi.Blockchain.Keys; using WalletWasabi.Fluent.ViewModels.Navigation; using WalletWasabi.Fluent.ViewModels.Wallets; using WalletWasabi.Userfacing; using WalletWasabi.Wallets; namespace WalletWasabi.Fluent.ViewModels.Login { public partial class LoginViewModel : RoutableViewModel { [AutoNotify] private string _password; [AutoNotify] private bool _isPasswordIncorrect; [AutoNotify] private bool _isPasswordNeeded; [AutoNotify] private string _walletName; public LoginViewModel(WalletViewModelBase walletViewModelBase, WalletManager walletManager) { Title = "Login"; KeyManager = walletViewModelBase.Wallet.KeyManager; IsPasswordNeeded = !KeyManager.IsWatchOnly; _walletName = walletViewModelBase.WalletName; _password = ""; NextCommand = ReactiveCommand.CreateFromTask(async () => { IsBusy = true; var wallet = walletViewModelBase.Wallet; IsPasswordIncorrect = await CheckPassword(KeyManager, Password); if (!IsPasswordIncorrect) { wallet.Login(); // TODO: navigate to the wallet welcome page Navigate().To(walletViewModelBase, NavigationMode.Clear); } IsBusy = false; }); OkCommand = ReactiveCommand.Create(() => { Password = ""; IsPasswordIncorrect = false; }); } public ICommand OkCommand { get; } public KeyManager KeyManager { get; } private async Task<bool> CheckPassword(KeyManager km, string password) { if (!IsPasswordNeeded) { return false; } if (PasswordHelper.TryPassword(km, password, out var compatibilityPasswordUsed)) { if (compatibilityPasswordUsed is { }) { await ShowErrorAsync(PasswordHelper.CompatibilityPasswordWarnMessage, "Compatibility password was used"); } return false; } return true; } } }
mit
C#
3ccc04cb816399d7ca583dcf4b97dd8dd6de737f
Add english as well as german
ashfordl/cards
ConsoleTesting/WhistTest.cs
ConsoleTesting/WhistTest.cs
// WhistTest.cs // <copyright file="WhistTest.cs"> This code is protected under the MIT License. </copyright> using System; using CardGames.Whist; namespace ConsoleTesting { /// <summary> /// The whist test class /// </summary> public class WhistTest : IGameTest { /// <summary> /// Run the test /// </summary> public void RunTest() { Whist whist = new Whist(); ConsolePlayer p1 = new ConsolePlayer(); ConsolePlayer p2 = new ConsolePlayer(); ConsolePlayer p3 = new ConsolePlayer(); whist.AddPlayer(p1); whist.AddPlayer(p2); whist.AddPlayer(p3); whist.Start(); } public void RunWithAi() { Console.WriteLine("Es gibt kein AI"); Console.WriteLine("There is no AI") } } }
// WhistTest.cs // <copyright file="WhistTest.cs"> This code is protected under the MIT License. </copyright> using System; using CardGames.Whist; namespace ConsoleTesting { /// <summary> /// The whist test class /// </summary> public class WhistTest : IGameTest { /// <summary> /// Run the test /// </summary> public void RunTest() { Whist whist = new Whist(); ConsolePlayer p1 = new ConsolePlayer(); ConsolePlayer p2 = new ConsolePlayer(); ConsolePlayer p3 = new ConsolePlayer(); whist.AddPlayer(p1); whist.AddPlayer(p2); whist.AddPlayer(p3); whist.Start(); } public void RunWithAi() { Console.WriteLine("Es gibt kein AI"); } } }
mit
C#
d27cdcac94bd5de3f1e2543eb1a080159d7cfc0a
Update version to 2.4.0
TheOtherTimDuncan/TOTD
SharedAssemblyInfo.cs
SharedAssemblyInfo.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: AssemblyConfiguration("")] [assembly: AssemblyCompany("The Other Tim Duncan")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] // 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("2.4.0.0")] [assembly: AssemblyFileVersion("2.4.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: AssemblyConfiguration("")] [assembly: AssemblyCompany("The Other Tim Duncan")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] // 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("2.3.0.0")] [assembly: AssemblyFileVersion("2.3.0.0")]
mit
C#
8425191aa434afa48ec6c658deeec8d616a87918
Consolidate IfExists overloads into single method with optional param
aranasoft/cobweb
src/Core/Extentions/ObjectExtentions/WithObject.cs
src/Core/Extentions/ObjectExtentions/WithObject.cs
using System; namespace Cobweb.Extentions.ObjectExtentions { public static class WithObject { /// <summary> /// Returns the result of <paramref name="delegate" /> if <paramref name="object" /> is not null. /// Otherwise, <paramref name="default" /> is returned. /// </summary> /// <example> /// This method may be chained to reduce subsequent null checks. /// <code> parentObject.IfExists(parent => parent.Children).IfExists(children => children.Count(), 0) </code> /// </example> /// <typeparam name="T">The type of the <paramref name="object" />.</typeparam> /// <typeparam name="TResult">The return type of the <paramref name="delegate" />.</typeparam> /// <param name="object">The object that may be null</param> /// <param name="delegate">The delegate to execute on the object if the object is not null.</param> /// <param name="default">The value to return if <paramref name="object" /> is null.</param> /// <returns> /// The result of the <paramref name="delegate" /> or, if the <paramref name="object" /> is null, /// <paramref name="default" />. /// </returns> public static TResult IfExists<T, TResult>(this T @object, Func<T, TResult> @delegate, TResult @default = default(TResult)) where T : class { return @object != null ? @delegate(@object) : @default; } } }
using System; namespace Cobweb.Extentions.ObjectExtentions { public static class WithObject { /// <summary> /// Returns the result of a <paramref name="delegate" /> if the <paramref name="object" /> is not null. /// </summary> /// <example> /// This method may be chained to reduce subsequent null checks. /// <code> parentObject.IfExists(parent => parent.Children).IfExists(children => children.Count()) </code> /// </example> /// <typeparam name="T">The type of the <paramref name="object" />.</typeparam> /// <typeparam name="TResult">The return type of the <paramref name="delegate" />.</typeparam> /// <param name="object">The object that may be null.</param> /// <param name="delegate">The delegate to execute on the object if the object is not null.</param> /// <returns> /// The result of the <paramref name="delegate" /> or, if the <paramref name="object" /> is null, the default /// value of <typeparamref name="TResult" />. /// </returns> public static TResult IfExists<T, TResult>(this T @object, Func<T, TResult> @delegate) where T : class { return IfExists(@object, @delegate, default(TResult)); } /// <summary> /// Returns the result of <paramref name="delegate" /> if <paramref name="object" /> is not null. /// Otherwise, <paramref name="default" /> is returned. /// </summary> /// <example> /// This method may be chained to reduce subsequent null checks. /// <code> parentObject.IfExists(parent => parent.Children).IfExists(children => children.Count(), 0) </code> /// </example> /// <typeparam name="T">The type of the <paramref name="object" />.</typeparam> /// <typeparam name="TResult">The return type of the <paramref name="delegate" />.</typeparam> /// <param name="object">The object that may be null</param> /// <param name="delegate">The delegate to execute on the object if the object is not null.</param> /// <param name="default">The value to return if <paramref name="object" /> is null.</param> /// <returns> /// The result of the <paramref name="delegate" /> or, if the <paramref name="object" /> is null, /// <paramref name="default" />. /// </returns> public static TResult IfExists<T, TResult>(this T @object, Func<T, TResult> @delegate, TResult @default) where T : class { return @object != null ? @delegate(@object) : @default; } } }
bsd-3-clause
C#
1a6b36a0f5e1c07e50564b9a74195c047642e205
Allow AssemblyMigrationProvider to take a namespace
canton7/Simple.Migrations,canton7/SimpleMigrations,canton7/SimpleMigrations,canton7/Simple.Migrations
src/Simple.Migrations/AssemblyMigrationProvider.cs
src/Simple.Migrations/AssemblyMigrationProvider.cs
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using SimpleMigrations.Platform; namespace SimpleMigrations { /// <summary> /// <see cref="IMigrationProvider"/> which finds migrations by scanning an assembly, optionally /// filtering by namespace. /// </summary> public class AssemblyMigrationProvider : IMigrationProvider { private readonly Assembly migrationAssembly; private readonly string migrationNamespace; /// <summary> /// Instantiates a new instance of the <see cref="AssemblyMigrationProvider"/> class /// </summary> /// <param name="migrationAssembly">Assembly to scan for migrations</param> /// <param name="migrationNamespace">Optional namespace. If specified, only finds migrations in that namespace</param> public AssemblyMigrationProvider(Assembly migrationAssembly, string migrationNamespace = null) { if (migrationAssembly == null) throw new ArgumentNullException(nameof(migrationAssembly)); this.migrationAssembly = migrationAssembly; this.migrationNamespace = migrationNamespace; } /// <summary> /// Load all migration info. These can be in any order /// </summary> /// <returns>All migration info</returns> public IEnumerable<MigrationData> LoadMigrations() { var migrations = from type in this.migrationAssembly.GetDefinedTypes() let attribute = type.GetCustomAttribute<MigrationAttribute>() where attribute != null where this.migrationNamespace == null || type.Namespace == this.migrationNamespace select new MigrationData(attribute.Version, attribute.Description, type.AsType()); if (!migrations.Any()) throw new MigrationException($"Could not find any migrations in the assembly you provided ({this.migrationAssembly.GetName().Name}). Migrations must be decorated with [Migration]"); return migrations; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using SimpleMigrations.Platform; namespace SimpleMigrations { /// <summary> /// <see cref="IMigrationProvider"/> which finds migrations by scanning an assembly /// </summary> public class AssemblyMigrationProvider : IMigrationProvider { private readonly Assembly migrationAssembly; /// <summary> /// Instantiates a new instance of the <see cref="AssemblyMigrationProvider"/> class /// </summary> /// <param name="migrationAssembly">Assembly to scan for migrations</param> public AssemblyMigrationProvider(Assembly migrationAssembly) { if (migrationAssembly == null) throw new ArgumentNullException(nameof(migrationAssembly)); this.migrationAssembly = migrationAssembly; } /// <summary> /// Load all migration info. These can be in any order /// </summary> /// <returns>All migration info</returns> public IEnumerable<MigrationData> LoadMigrations() { var migrations = from type in this.migrationAssembly.GetDefinedTypes() let attribute = type.GetCustomAttribute<MigrationAttribute>() where attribute != null select new MigrationData(attribute.Version, attribute.Description, type.AsType()); if (!migrations.Any()) throw new MigrationException($"Could not find any migrations in the assembly you provided ({this.migrationAssembly.GetName().Name}). Migrations must be decorated with [Migration]"); return migrations; } } }
mit
C#
a32f5667fa65e09e3af126a990550c4e84a4c9c9
Fix issue #296: Read data in a loop. The first read does not ensure all data is read.
SixLabors/Fonts
src/SixLabors.Fonts/Tables/Woff/WoffTableHeader.cs
src/SixLabors.Fonts/Tables/Woff/WoffTableHeader.cs
// Copyright (c) Six Labors. // Licensed under the Apache License, Version 2.0. using System.IO; namespace SixLabors.Fonts.Tables.Woff { internal sealed class WoffTableHeader : TableHeader { public WoffTableHeader(string tag, uint offset, uint compressedLength, uint origLength, uint checkSum) : base(tag, checkSum, offset, origLength) => this.CompressedLength = compressedLength; public uint CompressedLength { get; } public override BigEndianBinaryReader CreateReader(Stream stream) { // Stream is not compressed. if (this.Length == this.CompressedLength) { return base.CreateReader(stream); } // Read all data from the compressed stream. stream.Seek(this.Offset, SeekOrigin.Begin); using var compressedStream = new IO.ZlibInflateStream(stream); byte[] uncompressedBytes = new byte[this.Length]; int totalBytesRead = 0; while (totalBytesRead < this.Length) { int bytesRead = compressedStream.Read(uncompressedBytes, 0, uncompressedBytes.Length); if (bytesRead <= 0) { throw new InvalidFontFileException($"Could not read compressed data! Expected bytes: {this.Length}, bytes read: {totalBytesRead}"); } totalBytesRead += bytesRead; } var memoryStream = new MemoryStream(uncompressedBytes); return new BigEndianBinaryReader(memoryStream, false); } // WOFF TableDirectoryEntry // UInt32 | tag | 4-byte sfnt table identifier. // UInt32 | offset | Offset to the data, from beginning of WOFF file. // UInt32 | compLength | Length of the compressed data, excluding padding. // UInt32 | origLength | Length of the uncompressed table, excluding padding. // UInt32 | origChecksum | Checksum of the uncompressed table. public static new WoffTableHeader Read(BigEndianBinaryReader reader) => new WoffTableHeader( reader.ReadTag(), reader.ReadUInt32(), reader.ReadUInt32(), reader.ReadUInt32(), reader.ReadUInt32()); } }
// Copyright (c) Six Labors. // Licensed under the Apache License, Version 2.0. using System.IO; namespace SixLabors.Fonts.Tables.Woff { internal sealed class WoffTableHeader : TableHeader { public WoffTableHeader(string tag, uint offset, uint compressedLength, uint origLength, uint checkSum) : base(tag, checkSum, offset, origLength) => this.CompressedLength = compressedLength; public uint CompressedLength { get; } public override BigEndianBinaryReader CreateReader(Stream stream) { // Stream is not compressed. if (this.Length == this.CompressedLength) { return base.CreateReader(stream); } // Read all data from the compressed stream. stream.Seek(this.Offset, SeekOrigin.Begin); using var compressedStream = new IO.ZlibInflateStream(stream); byte[] uncompressedBytes = new byte[this.Length]; int bytesRead = compressedStream.Read(uncompressedBytes, 0, uncompressedBytes.Length); if (bytesRead < this.Length) { throw new InvalidFontFileException($"Could not read compressed data! Expected bytes: {this.Length}, bytes read: {bytesRead}"); } var memoryStream = new MemoryStream(uncompressedBytes); return new BigEndianBinaryReader(memoryStream, false); } // WOFF TableDirectoryEntry // UInt32 | tag | 4-byte sfnt table identifier. // UInt32 | offset | Offset to the data, from beginning of WOFF file. // UInt32 | compLength | Length of the compressed data, excluding padding. // UInt32 | origLength | Length of the uncompressed table, excluding padding. // UInt32 | origChecksum | Checksum of the uncompressed table. public static new WoffTableHeader Read(BigEndianBinaryReader reader) => new WoffTableHeader( reader.ReadTag(), reader.ReadUInt32(), reader.ReadUInt32(), reader.ReadUInt32(), reader.ReadUInt32()); } }
apache-2.0
C#
ba79301e0f3a3deacf960c930a53c36995574d08
Remove a stray comment
scottmeyer/braintree_dotnet,ronin1/braintree_dotnet,scottmeyer/braintree_dotnet,braintree/braintree_dotnet,ronin1/braintree_dotnet,braintree/braintree_dotnet,scottmeyer/braintree_dotnet,scottmeyer/braintree_dotnet,ronin1/braintree_dotnet
Braintree/SandboxValues.cs
Braintree/SandboxValues.cs
#pragma warning disable 1591 using System; using System.Collections.Generic; using System.Text; namespace Braintree { public class SandboxValues { public class CreditCardNumber { public const String VISA = "4111111111111111"; } public class TransactionAmount { public const Decimal AUTHORIZE = 1000; public const Decimal DECLINE = 2000; public const Decimal FAILED = 3000; } public class VenmoSdk { public const String VISA_PAYMENT_METHOD_CODE = "stub-4111111111111111"; public static String GenerateStubPaymentMethodCode(String creditCardNumber) { return "stub-" + creditCardNumber; } } } }
#pragma warning disable 1591 using System; using System.Collections.Generic; using System.Text; namespace Braintree { public class SandboxValues { public class CreditCardNumber { public const String VISA = "4111111111111111"; } public class TransactionAmount { public const Decimal AUTHORIZE = 1000; public const Decimal DECLINE = 2000; public const Decimal FAILED = 3000; } public class VenmoSdk { // public const String VISA_PAYMENT_METHOD_CODE = GenerateStubPaymentMethodCode("4111111111111111"); public const String VISA_PAYMENT_METHOD_CODE = "stub-4111111111111111"; public static String GenerateStubPaymentMethodCode(String creditCardNumber) { return "stub-" + creditCardNumber; } } } }
mit
C#
d2d5bd5b804024646fa27c7f30df71e4f4791969
Update for editor compilation
DDReaper/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity
Assets/MixedRealityToolkit/Extensions/UnityObjectExtensions.cs
Assets/MixedRealityToolkit/Extensions/UnityObjectExtensions.cs
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; using Object = UnityEngine.Object; namespace Microsoft.MixedReality.Toolkit { /// <summary> /// Extension methods for Unity's Object class /// </summary> public static class UnityObjectExtensions { /// <summary> /// Enable Unity objects to skip "DontDestroyOnLoad" when editor isn't playing so test runner passes. /// </summary> public static void DontDestroyOnLoad(this Object target) { #if UNITY_EDITOR if (UnityEditor.EditorApplication.isPlaying) #endif Object.DontDestroyOnLoad(target); } /// <summary> /// Destroys a Unity object appropriately depending if running in in edit or play mode. /// </summary> /// <param name="obj">Unity object to destroy</param> /// <param name="t">Time in seconds at which to destroy the object, if applicable.</param> public static void DestroyObject(Object obj, float t = 0.0f) { if (Application.isPlaying) { Object.Destroy(obj, t); } else { #if UNITY_EDITOR // Must use DestroyImmediate in edit mode but it is not allowed when called from // trigger/contact, animation event callbacks or OnValidate. Must use Destroy instead. // Delay call to counter this issue in editor UnityEditor.EditorApplication.delayCall += () => { Object.DestroyImmediate(obj); }; #else Object.DestroyImmediate(obj); #endif } } /// <summary> /// Tests if the Unity object is null. Checks both the managed object and the underly Unity-managed native object /// </summary> /// <returns>True if either the managed or native object is null, false otherwise</returns> public static bool IsNull(Object obj) { return obj == null || obj.Equals(null); } } }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; using Object = UnityEngine.Object; namespace Microsoft.MixedReality.Toolkit { /// <summary> /// Extension methods for Unity's Object class /// </summary> public static class UnityObjectExtensions { /// <summary> /// Enable Unity objects to skip "DontDestroyOnLoad" when editor isn't playing so test runner passes. /// </summary> public static void DontDestroyOnLoad(this Object target) { #if UNITY_EDITOR if (UnityEditor.EditorApplication.isPlaying) #endif Object.DontDestroyOnLoad(target); } /// <summary> /// Destroys a Unity object appropriately depending if running in in edit or play mode. /// </summary> /// <param name="obj">Unity object to destroy</param> /// <param name="t">Time in seconds at which to destroy the object, if applicable.</param> public static void DestroyObject(Object obj, float t = 0.0f) { if (Application.isPlaying) { Object.Destroy(obj, t); } else { // Must use DestroyImmediate in edit mode but it is not allowed when called from // trigger/contact, animation event callbacks or OnValidate. Must use Destroy instead. // Delay call to counter this issue in editor UnityEditor.EditorApplication.delayCall += () => { Object.DestroyImmediate(obj); }; } } /// <summary> /// Tests if the Unity object is null. Checks both the managed object and the underly Unity-managed native object /// </summary> /// <returns>True if either the managed or native object is null, false otherwise</returns> public static bool IsNull(Object obj) { return obj == null || obj.Equals(null); } } }
mit
C#
816e5d63aa59416bc4e6ac132959b7f2ff57b5fb
fix navigation
AzureDay/2016-WebSite,AzureDay/2016-WebSite
TeamSpark.AzureDay.WebSite.Host/Views/Shared/_MenuItems.cshtml
TeamSpark.AzureDay.WebSite.Host/Views/Shared/_MenuItems.cshtml
<li><a href="/">Главная</a></li> <li><a href="/schedule">Расписание</a></li> @if (Request.IsAuthenticated) { <li><a href="/profile/my">Личный кабинет</a></li> <li><a href="/profile/logout">Выйти</a></li> } else { <li><a style="font-weight: bold; color: #f90; font-size: 1.2em;" href="/profile/registration">Регистрация</a></li> <li><a href="/profile/login">Войти</a></li> }
<li><a href="/">Главная</a></li> <li><a href="/schedule">Расписание</a></li> @if (Request.IsAuthenticated) { <li><a href="/profile/logout">Личный кабинет</a></li> <li><a href="/profile/logout">Выйти</a></li> } else { <li><a style="font-weight: bold; color: #f90; font-size: 1.2em;" href="/profile/registration">Регистрация</a></li> <li><a href="/profile/login">Войти</a></li> }
mit
C#
5da2faa7fb0cc28547eb14293886392c9d983130
Remove PathUtility.Combine method
johnkors/azure-sdk-tools,DinoV/azure-sdk-tools,Madhukarc/azure-sdk-tools,DinoV/azure-sdk-tools,antonba/azure-sdk-tools,akromm/azure-sdk-tools,Madhukarc/azure-sdk-tools,johnkors/azure-sdk-tools,Madhukarc/azure-sdk-tools,markcowl/azure-sdk-tools,akromm/azure-sdk-tools,johnkors/azure-sdk-tools,DinoV/azure-sdk-tools,akromm/azure-sdk-tools,johnkors/azure-sdk-tools,DinoV/azure-sdk-tools,markcowl/azure-sdk-tools,antonba/azure-sdk-tools,markcowl/azure-sdk-tools,akromm/azure-sdk-tools,antonba/azure-sdk-tools,akromm/azure-sdk-tools,antonba/azure-sdk-tools,markcowl/azure-sdk-tools,antonba/azure-sdk-tools,Madhukarc/azure-sdk-tools,johnkors/azure-sdk-tools,markcowl/azure-sdk-tools,Madhukarc/azure-sdk-tools,DinoV/azure-sdk-tools
WindowsAzurePowershell/src/Management/Utilities/PathUtility.cs
WindowsAzurePowershell/src/Management/Utilities/PathUtility.cs
// ---------------------------------------------------------------------------------- // // Copyright 2011 Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ---------------------------------------------------------------------------------- namespace Microsoft.WindowsAzure.Management.Utilities { using System; using System.IO; using Properties; public static class PathUtility { public static string GetServicePath(string path) { if (string.IsNullOrEmpty(path)) { throw new ArgumentNullException("path"); } // Get the service path var servicePath = FindServiceRootDirectory(path); // Was the service path found? if (servicePath == null) { throw new InvalidOperationException(Resources.CannotFindServiceRoot); } return servicePath; } public static string FindServiceRootDirectory(string path) { // Is the csdef file present in the folder bool found = Directory.GetFiles(path, Resources.ServiceDefinitionFileName).Length == 1; if (found) { return path; //return it } // Find the last slash int slash = path.LastIndexOf('\\'); if (slash > 0) { // Slash found trim off the last path path = path.Substring(0, slash); // Recurse return FindServiceRootDirectory(path); } // Couldn't locate the service root, exit return null; } } }
// ---------------------------------------------------------------------------------- // // Copyright 2011 Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ---------------------------------------------------------------------------------- namespace Microsoft.WindowsAzure.Management.Utilities { using System; using System.IO; using Properties; public static class PathUtility { public static string GetServicePath(string path) { if (string.IsNullOrEmpty(path)) { throw new ArgumentNullException("path"); } // Get the service path var servicePath = FindServiceRootDirectory(path); // Was the service path found? if (servicePath == null) { throw new InvalidOperationException(Resources.CannotFindServiceRoot); } return servicePath; } public static string FindServiceRootDirectory(string path) { // Is the csdef file present in the folder bool found = Directory.GetFiles(path, Resources.ServiceDefinitionFileName).Length == 1; if (found) { return path; //return it } // Find the last slash int slash = path.LastIndexOf('\\'); if (slash > 0) { // Slash found trim off the last path path = path.Substring(0, slash); // Recurse return FindServiceRootDirectory(path); } // Couldn't locate the service root, exit return null; } public static string Combine(params string[] paths) { string combinedPath = string.Empty; foreach (string path in paths) { combinedPath = Path.Combine(combinedPath, path); } return combinedPath; } } }
apache-2.0
C#
e185e21115e28010d221435afefc9d2f53701c2d
Fix board Y scale
thijser/ARGAME,thijser/ARGAME,thijser/ARGAME
ARGame/Assets/Scripts/Core/BoardResizer.cs
ARGame/Assets/Scripts/Core/BoardResizer.cs
//---------------------------------------------------------------------------- // <copyright file="BoardResizer.cs" company="Delft University of Technology"> // Copyright 2015, Delft University of Technology // // This software is licensed under the terms of the MIT License. // A copy of the license should be included with this software. If not, // see http://opensource.org/licenses/MIT for the full license. // </copyright> //---------------------------------------------------------------------------- namespace Core { using System.Linq; using Network; using UnityEngine; /// <summary> /// Resizes the board when a level update is received with a new board size. /// </summary> public class BoardResizer : MonoBehaviour { /// <summary> /// Updates the board size with the size in the argument /// if the argument is a LevelUpdate instance. /// <para> /// If the argument is not a LevelUpdate instance, this method /// does nothing. /// </para> /// </summary> /// <param name="update">The server update.</param> public void OnServerUpdate(AbstractUpdate update) { LevelUpdate level = update as LevelUpdate; if (level != null) { Debug.Log("Applying Board Size: " + level.Size); this.UpdateBoardSize(level.Size); } } /// <summary> /// Updates the size of the playing board. /// </summary> /// <param name="size">The new board size.</param> /// <returns>True if the board size was updated, false if no board was found.</returns> public bool UpdateBoardSize(Vector2 size) { Transform board = GetComponentsInChildren<Transform>() .FirstOrDefault(t => t.gameObject.tag == "PlayingBoard"); if (board != null) { Vector3 scale = new Vector3(-size.x, board.localScale.y, size.y); board.localScale = scale; return true; } return false; } } }
//---------------------------------------------------------------------------- // <copyright file="BoardResizer.cs" company="Delft University of Technology"> // Copyright 2015, Delft University of Technology // // This software is licensed under the terms of the MIT License. // A copy of the license should be included with this software. If not, // see http://opensource.org/licenses/MIT for the full license. // </copyright> //---------------------------------------------------------------------------- namespace Core { using System.Linq; using Network; using UnityEngine; /// <summary> /// Resizes the board when a level update is received with a new board size. /// </summary> public class BoardResizer : MonoBehaviour { /// <summary> /// Updates the board size with the size in the argument /// if the argument is a LevelUpdate instance. /// <para> /// If the argument is not a LevelUpdate instance, this method /// does nothing. /// </para> /// </summary> /// <param name="update">The server update.</param> public void OnServerUpdate(AbstractUpdate update) { LevelUpdate level = update as LevelUpdate; if (level != null) { Debug.Log("Applying Board Size: " + level.Size); this.UpdateBoardSize(level.Size); } } /// <summary> /// Updates the size of the playing board. /// </summary> /// <param name="size">The new board size.</param> /// <returns>True if the board size was updated, false if no board was found.</returns> public bool UpdateBoardSize(Vector2 size) { Transform board = GetComponentsInChildren<Transform>() .FirstOrDefault(t => t.gameObject.tag == "PlayingBoard"); if (board != null) { Vector3 scale = new Vector3(-size.x, (size.x+size.y)/2, size.y); board.localScale = scale; return true; } return false; } } }
mit
C#
b8ad8808182e47c92fd9be0a2cd551689701d07c
Update GameState
Synpheros/h4g2017
Assets/Generic/Chat/GameState.cs
Assets/Generic/Chat/GameState.cs
using UnityEngine; using System.Collections; using System.Collections.Generic; namespace h4g2 { public class GameState { private static GameState instance; public static GameState S { get { if (instance == null) instance = new GameState(); return instance; } } public class SceneDef { public string title; public string subtitle; public string next_scene; public SceneDef(string title, string subtitle, string next_scene) { this.title = title; this.subtitle = subtitle; this.next_scene = next_scene; } } private List<SceneDef> scenes; private GameState() { scenes = new List<SceneDef>(); } SceneDef nextscene; public void setNext(string tittle, string subtittle, string next) { this.nextscene = new SceneDef(tittle, subtittle, next); } public SceneDef nextScene() { return nextscene; } } }
using UnityEngine; using System.Collections; using System.Collections.Generic; namespace h4g2 { public class GameState { private static GameState instance; public static GameState S { get { if (instance == null) instance = new GameState(); return instance; } } public class SceneDef { public string title; public string subtitle; public string next_scene; public SceneDef(string title, string subtitle, string next_scene) { this.title = title; this.subtitle = subtitle; this.next_scene = next_scene; } } private List<SceneDef> scenes; private GameState() { scenes = new List<SceneDef>(); } SceneDef nextscene; public void setNext(string tittle, string subtittle, string next) { this.nextscene = new SceneDef(tittle, subtittle, next); } public SceneDef nextScene() { SceneDef ret = scenes[0]; scenes.Remove(ret); return ret; } } }
apache-2.0
C#
645ad873c2baf6a22fbf949173f689a0b93ce156
Fix "Search" widget ignoring search errors
danielchalmers/DesktopWidgets
DesktopWidgets/Widgets/Search/ViewModel.cs
DesktopWidgets/Widgets/Search/ViewModel.cs
using System.Diagnostics; using System.Windows.Input; using DesktopWidgets.Classes; using DesktopWidgets.Helpers; using DesktopWidgets.ViewModelBase; using GalaSoft.MvvmLight.Command; namespace DesktopWidgets.Widgets.Search { public class ViewModel : WidgetViewModelBase { private string _searchText; public ViewModel(WidgetId id) : base(id) { Settings = id.GetSettings() as Settings; if (Settings == null) return; Go = new RelayCommand(GoExecute); OnKeyUp = new RelayCommand<KeyEventArgs>(OnKeyUpExecute); } public Settings Settings { get; } public ICommand Go { get; set; } public ICommand OnKeyUp { get; set; } public string SearchText { get { return _searchText; } set { if (_searchText != value) { _searchText = value; RaisePropertyChanged(nameof(SearchText)); } } } private void GoExecute() { var searchText = SearchText; SearchText = string.Empty; Process.Start($"{Settings.BaseUrl}{searchText}{Settings.URLSuffix}"); if (Settings.HideOnSearch) _id.GetView()?.HideUI(); } private void OnKeyUpExecute(KeyEventArgs args) { if (args.Key == Key.Enter) GoExecute(); } } }
using System.Diagnostics; using System.Windows.Input; using DesktopWidgets.Classes; using DesktopWidgets.Helpers; using DesktopWidgets.ViewModelBase; using GalaSoft.MvvmLight.Command; namespace DesktopWidgets.Widgets.Search { public class ViewModel : WidgetViewModelBase { private string _searchText; public ViewModel(WidgetId id) : base(id) { Settings = id.GetSettings() as Settings; if (Settings == null) return; Go = new RelayCommand(GoExecute); OnKeyUp = new RelayCommand<KeyEventArgs>(OnKeyUpExecute); } public Settings Settings { get; } public ICommand Go { get; set; } public ICommand OnKeyUp { get; set; } public string SearchText { get { return _searchText; } set { if (_searchText != value) { _searchText = value; RaisePropertyChanged(nameof(SearchText)); } } } private void GoExecute() { var searchText = SearchText; SearchText = string.Empty; try { Process.Start($"{Settings.BaseUrl}{searchText}{Settings.URLSuffix}"); } catch { // ignored } if (Settings.HideOnSearch) _id.GetView()?.HideUI(); } private void OnKeyUpExecute(KeyEventArgs args) { if (args.Key == Key.Enter) GoExecute(); } } }
apache-2.0
C#
76f49e43f8a9c2b40f4f5777eb081b5e6eb9f9ae
Remove redundant blank line
mysticfall/Alensia
Assets/Alensia/Core/Control/PlayerController.cs
Assets/Alensia/Core/Control/PlayerController.cs
using System.Collections.Generic; using System.Linq; using Alensia.Core.Character; using Alensia.Core.Common; using UniRx; using UnityEngine.Assertions; using Zenject; namespace Alensia.Core.Control { public class PlayerController : Controller, IPlayerController { public const string PlayerAliasName = "Player"; public IHumanoid Player => PlayerAlias.Reference; public IReferenceAlias<IHumanoid> PlayerAlias { get; } public IReadOnlyList<IPlayerControl> PlayerControls => Controls.Select(c => c as IPlayerControl).Where(c => c != null).ToList(); public bool PlayerControlEnabled { get { return _enabled.Value; } set { _enabled.Value = value; } } public IObservable<Unit> OnEnablePlayerControl => _enabled.Where(s => s).AsUnitObservable(); public IObservable<Unit> OnDisablePlayerControl => _enabled.Where(s => !s).AsUnitObservable(); public IObservable<bool> OnPlayerControlStateChange => _enabled; private readonly IReactiveProperty<bool> _enabled; public PlayerController( [Inject(Id = PlayerAliasName)] IReferenceAlias<IHumanoid> player, List<IControl> controls) : base(controls) { Assert.IsNotNull(player, "player != null"); _enabled = new ReactiveProperty<bool>(true); PlayerAlias = player; PlayerAlias.OnChange.Subscribe(OnPlayerChange).AddTo(this); } public virtual void EnablePlayerControl() { foreach (var control in PlayerControls) { control.Activate(); } } public virtual void DisablePlayerControl() { foreach (var control in PlayerControls) { control.Deactivate(); } } protected virtual void OnPlayerChange(IHumanoid player) { foreach (var control in PlayerControls) { control.Player = player; } } } }
using System.Collections.Generic; using System.Linq; using Alensia.Core.Character; using Alensia.Core.Common; using UniRx; using UnityEngine.Assertions; using Zenject; namespace Alensia.Core.Control { public class PlayerController : Controller, IPlayerController { public const string PlayerAliasName = "Player"; public IHumanoid Player => PlayerAlias.Reference; public IReferenceAlias<IHumanoid> PlayerAlias { get; } public IReadOnlyList<IPlayerControl> PlayerControls => Controls.Select(c => c as IPlayerControl).Where(c => c != null).ToList(); public bool PlayerControlEnabled { get { return _enabled.Value; } set { _enabled.Value = value; } } public IObservable<Unit> OnEnablePlayerControl => _enabled.Where(s => s).AsUnitObservable(); public IObservable<Unit> OnDisablePlayerControl => _enabled.Where(s => !s).AsUnitObservable(); public IObservable<bool> OnPlayerControlStateChange => _enabled; private readonly IReactiveProperty<bool> _enabled; public PlayerController( [Inject(Id = PlayerAliasName)] IReferenceAlias<IHumanoid> player, List<IControl> controls) : base(controls) { Assert.IsNotNull(player, "player != null"); _enabled = new ReactiveProperty<bool>(true); PlayerAlias = player; PlayerAlias.OnChange.Subscribe(OnPlayerChange).AddTo(this); } public virtual void EnablePlayerControl() { foreach (var control in PlayerControls) { control.Activate(); } } public virtual void DisablePlayerControl() { foreach (var control in PlayerControls) { control.Deactivate(); } } protected virtual void OnPlayerChange(IHumanoid player) { foreach (var control in PlayerControls) { control.Player = player; } } } }
apache-2.0
C#
514e6184431868652f76691a00b9006ad3a7ad41
Set TableDependency version number
christiandelbianco/monitor-table-change-with-sqltabledependency
TableDependency/Properties/AssemblyInfo.cs
TableDependency/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("TableDependency")] [assembly: AssemblyDescription("TableDependency is the C# base component for TableDependency.SqlClient and TableDependency.OracleClient, used to receive notifications when a table's contents has been changed.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Christian Del Bianco")] [assembly: AssemblyProduct("TableDependency")] [assembly: AssemblyTrademark("Christian Del Bianco")] [assembly: AssemblyCopyright("Copyright Christian Del Bianco © 2015-2016")] [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("1aa8ea22-ca51-4ab8-aaff-7909825f7f09")] // 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("4.5.2.0")] [assembly: AssemblyFileVersion("4.5.2.0")] [assembly: InternalsVisibleTo("TableDependency.OracleClient")] [assembly: InternalsVisibleTo("TableDependency.SqlClient")]
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("TableDependency")] [assembly: AssemblyDescription("TableDependency is the C# base component for TableDependency.SqlClient and TableDependency.OracleClient, used to receive notifications when a table's contents has been changed.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Christian Del Bianco")] [assembly: AssemblyProduct("TableDependency")] [assembly: AssemblyTrademark("Christian Del Bianco")] [assembly: AssemblyCopyright("Copyright Christian Del Bianco © 2015-2016")] [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("1aa8ea22-ca51-4ab8-aaff-7909825f7f09")] // 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("4.5.1.0")] [assembly: AssemblyFileVersion("4.5.1.0")] [assembly: InternalsVisibleTo("TableDependency.OracleClient")] [assembly: InternalsVisibleTo("TableDependency.SqlClient")]
mit
C#
2bf9a119549d0f3bbaf8bb49fc9201e3505cf165
Mark NonAspect attribute at the IAspectContextDataProvider interface
AspectCore/Lite,AspectCore/AspectCore-Framework,AspectCore/AspectCore-Framework,AspectCore/Abstractions
src/AspectCore.Abstractions/Aspect/IAspectContextDataProvider.cs
src/AspectCore.Abstractions/Aspect/IAspectContextDataProvider.cs
using System.Collections.Generic; namespace AspectCore.Abstractions { [NonAspect] public interface IAspectContextDataProvider { IDictionary<string, object> Items { get; } } }
using System.Collections.Generic; namespace AspectCore.Abstractions { public interface IAspectContextDataProvider { IDictionary<string, object> Items { get; } } }
mit
C#
d12e93bfc67598007192899b440726396b8e202e
Add skin traget resetting on setup/teardown steps
NeoAdonis/osu,smoogipoo/osu,ppy/osu,peppy/osu,peppy/osu,UselessToucan/osu,smoogipooo/osu,UselessToucan/osu,peppy/osu,smoogipoo/osu,ppy/osu,UselessToucan/osu,ppy/osu,peppy/osu-new,NeoAdonis/osu,NeoAdonis/osu,smoogipoo/osu
osu.Game/Tests/Visual/LegacySkinPlayerTestScene.cs
osu.Game/Tests/Visual/LegacySkinPlayerTestScene.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.IO.Stores; using osu.Framework.Testing; using osu.Game.Rulesets; using osu.Game.Skinning; namespace osu.Game.Tests.Visual { [TestFixture] public abstract class LegacySkinPlayerTestScene : PlayerTestScene { protected LegacySkin LegacySkin { get; private set; } private ISkinSource legacySkinSource; protected override TestPlayer CreatePlayer(Ruleset ruleset) => new SkinProvidingPlayer(legacySkinSource); [BackgroundDependencyLoader] private void load(OsuGameBase game, SkinManager skins) { LegacySkin = new DefaultLegacySkin(new NamespacedResourceStore<byte[]>(game.Resources, "Skins/Legacy"), skins); legacySkinSource = new SkinProvidingContainer(LegacySkin); } [SetUpSteps] public override void SetUpSteps() { base.SetUpSteps(); addResetTargetsStep(); } [TearDownSteps] public override void TearDownSteps() { addResetTargetsStep(); base.TearDownSteps(); } private void addResetTargetsStep() { AddStep("reset targets", () => this.ChildrenOfType<SkinnableTargetContainer>().ForEach(t => { LegacySkin.ResetDrawableTarget(t); t.Reload(); })); } public class SkinProvidingPlayer : TestPlayer { [Cached(typeof(ISkinSource))] private readonly ISkinSource skinSource; public SkinProvidingPlayer(ISkinSource skinSource) { this.skinSource = skinSource; } } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.IO.Stores; using osu.Game.Rulesets; using osu.Game.Skinning; namespace osu.Game.Tests.Visual { [TestFixture] public abstract class LegacySkinPlayerTestScene : PlayerTestScene { protected LegacySkin LegacySkin { get; private set; } private ISkinSource legacySkinSource; protected override TestPlayer CreatePlayer(Ruleset ruleset) => new SkinProvidingPlayer(legacySkinSource); [BackgroundDependencyLoader] private void load(OsuGameBase game, SkinManager skins) { LegacySkin = new DefaultLegacySkin(new NamespacedResourceStore<byte[]>(game.Resources, "Skins/Legacy"), skins); legacySkinSource = new SkinProvidingContainer(LegacySkin); } public class SkinProvidingPlayer : TestPlayer { [Cached(typeof(ISkinSource))] private readonly ISkinSource skinSource; public SkinProvidingPlayer(ISkinSource skinSource) { this.skinSource = skinSource; } } } }
mit
C#
9ee572de4a681452d763ba76564c92ac435602d9
Implement last update model, had forgotten, hehe
shrayasr/pinboard.net
pinboard.net/Models/LastUpdate.cs
pinboard.net/Models/LastUpdate.cs
using Newtonsoft.Json; using System; namespace pinboard.net.Models { public class LastUpdate { [JsonProperty("update_time")] public DateTimeOffset UpdateTime { get; set; } } }
namespace pinboard.net.Models { public class LastUpdate { } }
mit
C#
ce5b3e3c6d472670875a982b26819307cd0f9c13
Add comment
60071jimmy/UartOscilloscope,60071jimmy/UartOscilloscope
QueueDataGraphic/QueueDataGraphic/CSharpFiles/QueueDataGraphic.cs
QueueDataGraphic/QueueDataGraphic/CSharpFiles/QueueDataGraphic.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace QueueDataGraphic.CSharpFiles { // namespace start, 進入命名空間 class QueueDataGraphic // QueueDataGraphic class, QueueDataGraphic類別 { // QueueDataGraphic class start, 進入QueueDataGraphic類別 } // QueueDataGraphic class end, 結束QueueDataGraphic類別 } // namespace end, 結束命名空間
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace QueueDataGraphic.CSharpFiles { class QueueDataGraphic // QueueDataGraphic class, QueueDataGraphic類別 { // QueueDataGraphic class start, 進入QueueDataGraphic類別 } // QueueDataGraphic class end, 結束QueueDataGraphic類別 }
apache-2.0
C#
fb7e97fa89d604aaf8371895eeb5c386610997e1
Update EntityRepository.cs
tiksn/TIKSN-Framework
TIKSN.Framework.Core/Data/EntityFrameworkCore/EntityRepository.cs
TIKSN.Framework.Core/Data/EntityFrameworkCore/EntityRepository.cs
using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace TIKSN.Data.EntityFrameworkCore { public class EntityRepository<TContext, TEntity> : IRepository<TEntity> where TContext : DbContext where TEntity : class, new() { protected readonly TContext dbContext; public EntityRepository(TContext dbContext) { this.dbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext)); } public Task AddAsync(TEntity entity, CancellationToken cancellationToken) { if (entity == null) throw new ArgumentNullException(nameof(entity)); dbContext.Add(entity); return Task.CompletedTask; } public Task AddRangeAsync(IEnumerable<TEntity> entities, CancellationToken cancellationToken) { if (entities == null) throw new ArgumentNullException(nameof(entities)); dbContext.AddRange(entities); return Task.CompletedTask; } public Task RemoveAsync(TEntity entity, CancellationToken cancellationToken) { if (entity == null) throw new ArgumentNullException(nameof(entity)); dbContext.Entry(entity).State = EntityState.Deleted; return Task.CompletedTask; } public Task RemoveRangeAsync(IEnumerable<TEntity> entities, CancellationToken cancellationToken) { if (entities == null) throw new ArgumentNullException(nameof(entities)); foreach (var entity in entities) dbContext.Entry(entity).State = EntityState.Deleted; return Task.CompletedTask; } public Task UpdateAsync(TEntity entity, CancellationToken cancellationToken) { if (entity == null) throw new ArgumentNullException(nameof(entity)); dbContext.Entry(entity).State = EntityState.Modified; return Task.CompletedTask; } public Task UpdateRangeAsync(IEnumerable<TEntity> entities, CancellationToken cancellationToken) { if (entities == null) throw new ArgumentNullException(nameof(entities)); foreach (var entity in entities) dbContext.Entry(entity).State = EntityState.Modified; return Task.CompletedTask; } } }
using Microsoft.EntityFrameworkCore; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace TIKSN.Data.EntityFrameworkCore { public class EntityRepository<TContext, TEntity> : IRepository<TEntity> where TContext : DbContext where TEntity : class, new() { protected readonly TContext dbContext; public EntityRepository(TContext dbContext) { this.dbContext = dbContext; } public Task AddAsync(TEntity entity, CancellationToken cancellationToken) { dbContext.Add(entity); return Task.FromResult<object>(null); } public Task AddRangeAsync(IEnumerable<TEntity> entities, CancellationToken cancellationToken) { dbContext.AddRange(entities); return Task.FromResult<object>(null); } public Task RemoveAsync(TEntity entity, CancellationToken cancellationToken) { dbContext.Entry(entity).State = EntityState.Deleted; return Task.FromResult<object>(null); } public Task RemoveRangeAsync(IEnumerable<TEntity> entities, CancellationToken cancellationToken) { foreach (var entity in entities) dbContext.Entry(entity).State = EntityState.Deleted; return Task.FromResult<object>(null); } public Task UpdateAsync(TEntity entity, CancellationToken cancellationToken) { dbContext.Entry(entity).State = EntityState.Modified; return Task.FromResult<object>(null); } public Task UpdateRangeAsync(IEnumerable<TEntity> entities, CancellationToken cancellationToken) { foreach (var entity in entities) dbContext.Entry(entity).State = EntityState.Modified; return Task.FromResult<object>(null); } } }
mit
C#
04358ef8a008608b12e377523e24ecb302262750
Adjust naming
smoogipooo/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,ZLima12/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,ppy/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,peppy/osu-framework
osu.Framework/Graphics/Containers/Markdown/MarkdownLinkText.cs
osu.Framework/Graphics/Containers/Markdown/MarkdownLinkText.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 Markdig.Syntax.Inlines; using osu.Framework.Allocation; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Sprites; using osu.Framework.Platform; using osuTK.Graphics; namespace osu.Framework.Graphics.Containers.Markdown { /// <summary> /// Visualises a link. /// </summary> /// <code> /// [link text](url) /// </code> public class MarkdownLinkText : CompositeDrawable, IHasTooltip, IMarkdownTextComponent { public string TooltipText => Url; [Resolved] private IMarkdownTextComponent parentTextComponent { get; set; } [Resolved] private GameHost host { get; set; } private readonly string text; protected readonly string Url; public MarkdownLinkText(string text, LinkInline linkInline) { this.text = text; Url = linkInline.Url ?? string.Empty; AutoSizeAxes = Axes.Both; } protected override void LoadComplete() { base.LoadComplete(); SpriteText spriteText; InternalChildren = new Drawable[] { new ClickableContainer { AutoSizeAxes = Axes.Both, Child = spriteText = CreateSpriteText(), Action = OnLinkPressed, } }; spriteText.Text = text; } protected virtual void OnLinkPressed() => host.OpenUrlExternally(Url); public virtual SpriteText CreateSpriteText() { var spriteText = parentTextComponent.CreateSpriteText(); spriteText.Colour = Color4.DodgerBlue; return spriteText; } } }
// 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 Markdig.Syntax.Inlines; using osu.Framework.Allocation; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Sprites; using osu.Framework.Platform; using osuTK.Graphics; namespace osu.Framework.Graphics.Containers.Markdown { /// <summary> /// Visualises a link. /// </summary> /// <code> /// [link text](url) /// </code> public class MarkdownLinkText : CompositeDrawable, IHasTooltip, IMarkdownTextComponent { public string TooltipText => Url; [Resolved] private IMarkdownTextComponent parentTextComponent { get; set; } [Resolved] private GameHost host { get; set; } private readonly string text; protected readonly string Url; public MarkdownLinkText(string text, LinkInline linkInline) { this.text = text; Url = linkInline.Url ?? string.Empty; AutoSizeAxes = Axes.Both; } protected override void LoadComplete() { base.LoadComplete(); SpriteText spriteText; InternalChildren = new Drawable[] { new ClickableContainer { AutoSizeAxes = Axes.Both, Child = spriteText = CreateSpriteText(), Action = ClickAction, } }; spriteText.Text = text; } protected virtual void ClickAction() => host.OpenUrlExternally(Url); public virtual SpriteText CreateSpriteText() { var spriteText = parentTextComponent.CreateSpriteText(); spriteText.Colour = Color4.DodgerBlue; return spriteText; } } }
mit
C#
eef9e76c3466c50ff9c0ae3af13612388dca79a3
Comment unused variable
wieslawsoltes/Draw2D,wieslawsoltes/Draw2D,wieslawsoltes/Draw2D
src/Core2D.Avalonia/Program.cs
src/Core2D.Avalonia/Program.cs
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.IO; using Avalonia; using Avalonia.Logging.Serilog; using Core2D.Avalonia.Renderers; using Core2D.ViewModels; using Core2D.ViewModels.Containers; namespace Core2D.Avalonia { class Program { static void Print(Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); if (ex.InnerException != null) { Print(ex.InnerException); } } static void Main(string[] args) { try { //var file = "vm.json"; var bootstrapper = new Bootstrapper(); LayerContainerViewModel vm; //if (File.Exists(file)) // vm = LayerContainerViewModel.Load(file); //else vm = bootstrapper.CreateDemoViewModel(); bootstrapper.CreateDemoContainer(vm); vm.Renderer = new AvaloniaShapeRenderer(); vm.Selected = vm.Renderer.Selected; BuildAvaloniaApp().Start<MainWindow>(() => vm); //LayerContainerViewModel.Save(file, vm); } catch (Exception ex) { Print(ex); } } public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure<App>() .UsePlatformDetect() //.UseDirect2D1() //.UseSkia() .LogToDebug(); } }
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.IO; using Avalonia; using Avalonia.Logging.Serilog; using Core2D.Avalonia.Renderers; using Core2D.ViewModels; using Core2D.ViewModels.Containers; namespace Core2D.Avalonia { class Program { static void Print(Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); if (ex.InnerException != null) { Print(ex.InnerException); } } static void Main(string[] args) { try { var file = "vm.json"; var bootstrapper = new Bootstrapper(); LayerContainerViewModel vm; //if (File.Exists(file)) // vm = LayerContainerViewModel.Load(file); //else vm = bootstrapper.CreateDemoViewModel(); bootstrapper.CreateDemoContainer(vm); vm.Renderer = new AvaloniaShapeRenderer(); vm.Selected = vm.Renderer.Selected; BuildAvaloniaApp().Start<MainWindow>(() => vm); //LayerContainerViewModel.Save(file, vm); } catch (Exception ex) { Print(ex); } } public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure<App>() .UsePlatformDetect() //.UseDirect2D1() //.UseSkia() .LogToDebug(); } }
mit
C#
bb105b31ac83c9ce4ce10f5bf65eddbc656f9ba3
add MachineName to Logger error messages
mvbalaw/MvbaCore
src/MvbaCore/Logging/Logger.cs
src/MvbaCore/Logging/Logger.cs
// * ************************************************************************** // * Copyright (c) McCreary, Veselka, Bragg & Allen, P.C. // * This source code is subject to terms and conditions of the MIT License. // * A copy of the license can be found in the License.txt file // * at the root of this distribution. // * By using this source code in any fashion, you are agreeing to be bound by // * the terms of the MIT License. // * You must not remove this notice from this software. // * ************************************************************************** using System; namespace MvbaCore.Logging { public static class Logger { public static void Log(NotificationSeverity severity, string text, Exception exception = null) { var textWriter = Console.Out; if (severity == NotificationSeverity.Error) { textWriter = Console.Error; } var description = severity + " on " +Environment.MachineName+": "+ text; if (exception != null) { description += Environment.NewLine + exception; } textWriter.WriteLine(description); } } }
// * ************************************************************************** // * Copyright (c) McCreary, Veselka, Bragg & Allen, P.C. // * This source code is subject to terms and conditions of the MIT License. // * A copy of the license can be found in the License.txt file // * at the root of this distribution. // * By using this source code in any fashion, you are agreeing to be bound by // * the terms of the MIT License. // * You must not remove this notice from this software. // * ************************************************************************** using System; namespace MvbaCore.Logging { public static class Logger { public static void Log(NotificationSeverity severity, string text, Exception exception = null) { var textWriter = Console.Out; if (severity == NotificationSeverity.Error) { textWriter = Console.Error; } var description = severity.ToString() + ": " + text; if (exception != null) { description += Environment.NewLine + exception; } textWriter.WriteLine(description); } } }
mit
C#
13a7c617e00f70260ad8d696e20a3332c9ef8fb3
Adjust assembly version numbers
ZEISS-PiWeb/PiWeb-Api
src/Properties/AssemblyInfo.cs
src/Properties/AssemblyInfo.cs
using System.Reflection; using System.Resources; [assembly: AssemblyCompany( "Carl Zeiss Innovationszentrum für Messtechnik GmbH" )] [assembly: AssemblyProduct( "ZEISS PiWeb Api" )] [assembly: AssemblyCopyright( "Copyright © 2018 Carl Zeiss Innovationszentrum für Messtechnik GmbH" )] [assembly: AssemblyTrademark( "PiWeb" )] [assembly: NeutralResourcesLanguage( "en" )] [assembly: AssemblyVersion( "2.0.0" )] [assembly: AssemblyInformationalVersion("2.0.0")] [assembly: AssemblyFileVersion( "2.0.0" )]
using System.Reflection; using System.Resources; [assembly: AssemblyCompany( "Carl Zeiss Innovationszentrum für Messtechnik GmbH" )] [assembly: AssemblyProduct( "ZEISS PiWeb Api" )] [assembly: AssemblyCopyright( "Copyright © 2018 Carl Zeiss Innovationszentrum für Messtechnik GmbH" )] [assembly: AssemblyTrademark( "PiWeb" )] [assembly: NeutralResourcesLanguage( "en" )] [assembly: AssemblyVersion("1.99.3.0")] [assembly: AssemblyInformationalVersion("2.0.0-beta1")] [assembly: AssemblyFileVersion( "1.99.3.0" )]
bsd-3-clause
C#
6ea419cbb113ec1e882714006362f52673b9bc3c
Update Program.cs
iotjack/vsdemo
helloGitFromVS/helloGitFromVS/Program.cs
helloGitFromVS/helloGitFromVS/Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace helloGitFromVS { class Program { static void Main(string[] args) { Console.WriteLine("Hello Git, edited..."); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace helloGitFromVS { class Program { static void Main(string[] args) { Console.WriteLine("Hello Git"); } } }
mit
C#
cc0110aa5267262a1dfea8185af8d423227e742b
Add doc comment to `VertexState`
peppy/osu,UselessToucan/osu,peppy/osu,UselessToucan/osu,ppy/osu,smoogipoo/osu,peppy/osu,NeoAdonis/osu,UselessToucan/osu,smoogipoo/osu,NeoAdonis/osu,ppy/osu,peppy/osu-new,smoogipooo/osu,smoogipoo/osu,ppy/osu,NeoAdonis/osu
osu.Game.Rulesets.Catch/Edit/Blueprints/Components/VertexState.cs
osu.Game.Rulesets.Catch/Edit/Blueprints/Components/VertexState.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Game.Rulesets.Catch.Objects; #nullable enable namespace osu.Game.Rulesets.Catch.Edit.Blueprints.Components { /// <summary> /// Holds the state of a vertex in the path of a <see cref="EditablePath"/>. /// </summary> public class VertexState { /// <summary> /// Whether the vertex is selected. /// </summary> public bool IsSelected { get; set; } /// <summary> /// Whether the vertex can be moved or deleted. /// </summary> public bool IsFixed { get; set; } /// <summary> /// The position of the vertex before a vertex moving operation starts. /// This is used to implement "memory-less" moving operations (only the final position matters) to improve UX. /// </summary> public JuiceStreamPathVertex VertexBeforeChange { get; set; } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Game.Rulesets.Catch.Objects; #nullable enable namespace osu.Game.Rulesets.Catch.Edit.Blueprints.Components { public class VertexState { public bool IsSelected { get; set; } public bool IsFixed { get; set; } public JuiceStreamPathVertex VertexBeforeChange { get; set; } } }
mit
C#
46068e7addccd6a2beb26e636476a0287da74d5d
Remove unused field in Constant class
openmedicus/gtk-sharp,antoniusriha/gtk-sharp,antoniusriha/gtk-sharp,openmedicus/gtk-sharp,Gankov/gtk-sharp,orion75/gtk-sharp,akrisiun/gtk-sharp,orion75/gtk-sharp,openmedicus/gtk-sharp,Gankov/gtk-sharp,orion75/gtk-sharp,sillsdev/gtk-sharp,Gankov/gtk-sharp,openmedicus/gtk-sharp,Gankov/gtk-sharp,sillsdev/gtk-sharp,orion75/gtk-sharp,akrisiun/gtk-sharp,akrisiun/gtk-sharp,sillsdev/gtk-sharp,akrisiun/gtk-sharp,openmedicus/gtk-sharp,openmedicus/gtk-sharp,Gankov/gtk-sharp,antoniusriha/gtk-sharp,openmedicus/gtk-sharp,Gankov/gtk-sharp,antoniusriha/gtk-sharp,sillsdev/gtk-sharp,akrisiun/gtk-sharp,antoniusriha/gtk-sharp,sillsdev/gtk-sharp,orion75/gtk-sharp
generator/Constant.cs
generator/Constant.cs
// Authors: // Stephan Sundermann <stephansundermann@gmail.com> // // Copyright (c) 2013 Stephan Sundermann // // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the GNU General Public // License as published by the Free Software Foundation. // // This program 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 // General Public License for more details. // // You should have received a copy of the GNU General Public // License along with this program; if not, write to the // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. using System; using System.Xml; using System.IO; namespace GtkSharp.Generation { public class Constant { private readonly string name; private readonly string value; private readonly string ctype; public Constant (XmlElement elem) { this.name = elem.GetAttribute ("name"); this.value = elem.GetAttribute ("value"); this.ctype = elem.GetAttribute ("ctype"); } public string Name { get { return this.name; } } public string ConstType { get { if (IsString) return "string"; // gir registers all integer values as gint even for numbers which do not fit into a gint // if the number is too big for an int, try to fit it into a long if (SymbolTable.Table.GetMarshalType (ctype) == "int" && value.Length < 20 && long.Parse (value) > Int32.MaxValue) return "long"; return SymbolTable.Table.GetMarshalType (ctype); } } public bool IsString { get { return (SymbolTable.Table.GetCSType (ctype) == "string"); } } public virtual bool Validate (LogWriter log) { if (ConstType == String.Empty) { log.Warn ("{0} type is missing or wrong", Name); return false; } if (SymbolTable.Table.GetMarshalType (ctype) == "int" && value.Length >= 20) { return false; } return true; } public virtual void Generate (GenerationInfo gen_info, string indent) { StreamWriter sw = gen_info.Writer; sw.WriteLine ("{0}public const {1} {2} = {3}{4}{5};", indent, ConstType, Name, IsString ? "@\"": String.Empty, value, IsString ? "\"": String.Empty); } } }
// Authors: // Stephan Sundermann <stephansundermann@gmail.com> // // Copyright (c) 2013 Stephan Sundermann // // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the GNU General Public // License as published by the Free Software Foundation. // // This program 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 // General Public License for more details. // // You should have received a copy of the GNU General Public // License along with this program; if not, write to the // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. using System; using System.Xml; using System.IO; namespace GtkSharp.Generation { public class Constant { private readonly XmlElement elem; private readonly string name; private readonly string value; private readonly string ctype; public Constant (XmlElement elem) { this.elem = elem; this.name = elem.GetAttribute ("name"); this.value = elem.GetAttribute ("value"); this.ctype = elem.GetAttribute ("ctype"); } public string Name { get { return this.name; } } public string ConstType { get { if (IsString) return "string"; // gir registers all integer values as gint even for numbers which do not fit into a gint // if the number is too big for an int, try to fit it into a long if (SymbolTable.Table.GetMarshalType (ctype) == "int" && value.Length < 20 && long.Parse (value) > Int32.MaxValue) return "long"; return SymbolTable.Table.GetMarshalType (ctype); } } public bool IsString { get { return (SymbolTable.Table.GetCSType (ctype) == "string"); } } public virtual bool Validate (LogWriter log) { if (ConstType == String.Empty) { log.Warn ("{0} type is missing or wrong", Name); return false; } if (SymbolTable.Table.GetMarshalType (ctype) == "int" && value.Length >= 20) { return false; } return true; } public virtual void Generate (GenerationInfo gen_info, string indent) { StreamWriter sw = gen_info.Writer; sw.WriteLine ("{0}public const {1} {2} = {3}{4}{5};", indent, ConstType, Name, IsString ? "@\"": String.Empty, value, IsString ? "\"": String.Empty); } } }
lgpl-2.1
C#
8eb9b2071cbb0f4d0efaff4b578c484a68f1dc41
Set hasHeader in SodiumEncrypt
AntiTcb/Discord.Net,Confruggy/Discord.Net,RogueException/Discord.Net
src/Discord.Net.WebSocket/Audio/Streams/SodiumEncryptStream.cs
src/Discord.Net.WebSocket/Audio/Streams/SodiumEncryptStream.cs
using System; using System.Threading; using System.Threading.Tasks; namespace Discord.Audio.Streams { ///<summary> Encrypts an RTP frame using libsodium </summary> public class SodiumEncryptStream : AudioOutStream { private readonly AudioClient _client; private readonly AudioStream _next; private readonly byte[] _nonce; private bool _hasHeader; private ushort _nextSeq; private uint _nextTimestamp; public SodiumEncryptStream(AudioStream next, IAudioClient client) { _next = next; _client = (AudioClient)client; _nonce = new byte[24]; } public override void WriteHeader(ushort seq, uint timestamp, bool missed) { if (_hasHeader) throw new InvalidOperationException("Header received with no payload"); _nextSeq = seq; _nextTimestamp = timestamp; _hasHeader = true; } public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancelToken) { cancelToken.ThrowIfCancellationRequested(); if (!_hasHeader) throw new InvalidOperationException("Received payload without an RTP header"); _hasHeader = false; if (_client.SecretKey == null) return; Buffer.BlockCopy(buffer, offset, _nonce, 0, 12); //Copy nonce from RTP header count = SecretBox.Encrypt(buffer, offset + 12, count - 12, buffer, 12, _nonce, _client.SecretKey); _next.WriteHeader(_nextSeq, _nextTimestamp, false); await _next.WriteAsync(buffer, 0, count + 12, cancelToken).ConfigureAwait(false); } public override async Task FlushAsync(CancellationToken cancelToken) { await _next.FlushAsync(cancelToken).ConfigureAwait(false); } public override async Task ClearAsync(CancellationToken cancelToken) { await _next.ClearAsync(cancelToken).ConfigureAwait(false); } } }
using System; using System.Threading; using System.Threading.Tasks; namespace Discord.Audio.Streams { ///<summary> Encrypts an RTP frame using libsodium </summary> public class SodiumEncryptStream : AudioOutStream { private readonly AudioClient _client; private readonly AudioStream _next; private readonly byte[] _nonce; private bool _hasHeader; private ushort _nextSeq; private uint _nextTimestamp; public SodiumEncryptStream(AudioStream next, IAudioClient client) { _next = next; _client = (AudioClient)client; _nonce = new byte[24]; } public override void WriteHeader(ushort seq, uint timestamp, bool missed) { if (_hasHeader) throw new InvalidOperationException("Header received with no payload"); _nextSeq = seq; _nextTimestamp = timestamp; } public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancelToken) { cancelToken.ThrowIfCancellationRequested(); if (!_hasHeader) throw new InvalidOperationException("Received payload without an RTP header"); _hasHeader = false; if (_client.SecretKey == null) return; Buffer.BlockCopy(buffer, offset, _nonce, 0, 12); //Copy nonce from RTP header count = SecretBox.Encrypt(buffer, offset + 12, count - 12, buffer, 12, _nonce, _client.SecretKey); _next.WriteHeader(_nextSeq, _nextTimestamp, false); await _next.WriteAsync(buffer, 0, count + 12, cancelToken).ConfigureAwait(false); } public override async Task FlushAsync(CancellationToken cancelToken) { await _next.FlushAsync(cancelToken).ConfigureAwait(false); } public override async Task ClearAsync(CancellationToken cancelToken) { await _next.ClearAsync(cancelToken).ConfigureAwait(false); } } }
mit
C#
5f73c11b49eadee0a1af411b733bffe62a3b1f6a
fix http method
IdentityModel/IdentityModelv2,IdentityModel/IdentityModel,IdentityModel/IdentityModel2,IdentityModel/IdentityModelv2,IdentityModel/IdentityModel2,IdentityModel/IdentityModel
src/IdentityModel/Client/New/HttpClientDeviceFlowExtensions.cs
src/IdentityModel/Client/New/HttpClientDeviceFlowExtensions.cs
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using IdentityModel.Internal; using System; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Threading; using System.Threading.Tasks; namespace IdentityModel.Client { /// <summary> /// HttpClient extensions for OIDC userinfo /// </summary> public static class HttpClientDeviceFlowExtensions { /// <summary> /// Sends a userinfo request. /// </summary> /// <param name="client">The client.</param> /// <param name="request">The request.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns></returns> public static async Task<DeviceAuthorizationResponse> RequestDeviceAuthorizationAsync(this HttpMessageInvoker client, DeviceAuthorizationRequest request, CancellationToken cancellationToken = default) { request.Parameters.AddRequired(OidcConstants.AuthorizeRequest.ClientId, request.ClientId); request.Parameters.AddOptional(OidcConstants.AuthorizeRequest.Scope, request.Scope); var httpRequest = new HttpRequestMessage(HttpMethod.Post, request.Address) { Content = new FormUrlEncodedContent(request.Parameters) }; httpRequest.Headers.Accept.Clear(); httpRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); HttpResponseMessage response; try { response = await client.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false); } catch (Exception ex) { return new DeviceAuthorizationResponse(ex); } string content = null; if (response.Content != null) { content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); } if (response.StatusCode == HttpStatusCode.OK || response.StatusCode == HttpStatusCode.BadRequest) { return new DeviceAuthorizationResponse(content); } else { return new DeviceAuthorizationResponse(response.StatusCode, response.ReasonPhrase, content); } } } }
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using IdentityModel.Internal; using System; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Threading; using System.Threading.Tasks; namespace IdentityModel.Client { /// <summary> /// HttpClient extensions for OIDC userinfo /// </summary> public static class HttpClientDeviceFlowExtensions { /// <summary> /// Sends a userinfo request. /// </summary> /// <param name="client">The client.</param> /// <param name="request">The request.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns></returns> public static async Task<DeviceAuthorizationResponse> RequestDeviceAuthorizationAsync(this HttpMessageInvoker client, DeviceAuthorizationRequest request, CancellationToken cancellationToken = default) { request.Parameters.AddRequired(OidcConstants.AuthorizeRequest.ClientId, request.ClientId); request.Parameters.AddOptional(OidcConstants.AuthorizeRequest.Scope, request.Scope); var httpRequest = new HttpRequestMessage(HttpMethod.Get, request.Address) { Content = new FormUrlEncodedContent(request.Parameters) }; httpRequest.Headers.Accept.Clear(); httpRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); HttpResponseMessage response; try { response = await client.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false); } catch (Exception ex) { return new DeviceAuthorizationResponse(ex); } string content = null; if (response.Content != null) { content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); } if (response.StatusCode == HttpStatusCode.OK || response.StatusCode == HttpStatusCode.BadRequest) { return new DeviceAuthorizationResponse(content); } else { return new DeviceAuthorizationResponse(response.StatusCode, response.ReasonPhrase, content); } } } }
apache-2.0
C#
f3ca8a4813a0d1db35a9181fd1c3b8fe6dedc052
Fix Sepa descriptor
mrklintscher/libfintx
src/libfintx/Segments/HKCSB.cs
src/libfintx/Segments/HKCSB.cs
/* * * This file is part of libfintx. * * Copyright (c) 2016 - 2020 Torsten Klinger * E-Mail: torsten.klinger@googlemail.com * * libfintx 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. * * libfintx 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 libfintx; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ using System; using System.Threading.Tasks; namespace libfintx { public static class HKCSB { /// <summary> /// Get terminated transfers /// </summary> public static async Task<String> Init_HKCSB(FinTsClient client) { Log.Write("Starting job HKCSB: Get terminated transfers"); client.SEGNUM = SEGNUM.SETInt(3); var connectionDetails = client.ConnectionDetails; string segments = "HKCSB:" + client.SEGNUM + ":1+" + connectionDetails.Iban + ":" + connectionDetails.Bic + "+urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.001.001.03'"; if (Helper.IsTANRequired("HKCSB")) { client.SEGNUM = SEGNUM.SETInt(4); segments = HKTAN.Init_HKTAN(client, segments); } string message = FinTSMessage.Create(client, client.HNHBS, client.HNHBK, segments, client.HIRMS); string response = await FinTSMessage.Send(client, message); Helper.Parse_Message(client, response); return response; } } }
/* * * This file is part of libfintx. * * Copyright (c) 2016 - 2020 Torsten Klinger * E-Mail: torsten.klinger@googlemail.com * * libfintx 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. * * libfintx 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 libfintx; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ using System; using System.Threading.Tasks; namespace libfintx { public static class HKCSB { /// <summary> /// Get terminated transfers /// </summary> public static async Task<String> Init_HKCSB(FinTsClient client) { Log.Write("Starting job HKCSB: Get terminated transfers"); client.SEGNUM = SEGNUM.SETInt(3); var connectionDetails = client.ConnectionDetails; string segments = "HKCSB:" + client.SEGNUM + ":1+" + connectionDetails.Iban + ":" + connectionDetails.Bic + "+sepade?:xsd?:pain.001.001.03.xsd'"; if (Helper.IsTANRequired("HKCSB")) { client.SEGNUM = SEGNUM.SETInt(4); segments = HKTAN.Init_HKTAN(client, segments); } string message = FinTSMessage.Create(client, client.HNHBS, client.HNHBK, segments, client.HIRMS); string response = await FinTSMessage.Send(client, message); Helper.Parse_Message(client, response); return response; } } }
lgpl-2.1
C#
b3cbd40a8c8e0aa663133b1e9c32d7c81d157d02
Update AboutWindow.xaml.cs
Core2D/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,Core2D/Core2D,wieslawsoltes/Core2D
src/Core2D/UI/Avalonia/Windows/AboutWindow.xaml.cs
src/Core2D/UI/Avalonia/Windows/AboutWindow.xaml.cs
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Avalonia; using Avalonia.Markup.Xaml; using Dock.Avalonia.Controls; namespace Core2D.UI.Avalonia.Windows { /// <summary> /// Interaction logic for <see cref="AboutWindow"/> xaml. /// </summary> public class AboutWindow : MetroWindow { /// <summary> /// Initializes a new instance of the <see cref="AboutWindow"/> class. /// </summary> public AboutWindow() { InitializeComponent(); this.AttachDevTools(); } /// <summary> /// Initialize the Xaml components. /// </summary> private void InitializeComponent() { AvaloniaXamlLoader.Load(this); App.Selector.EnableThemes(this); } } }
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Avalonia; using Avalonia.Controls; using Avalonia.Markup.Xaml; using Avalonia.ThemeManager; using Dock.Avalonia.Controls; namespace Core2D.UI.Avalonia.Windows { /// <summary> /// Interaction logic for <see cref="AboutWindow"/> xaml. /// </summary> public class AboutWindow : MetroWindow { /// <summary> /// Initializes a new instance of the <see cref="AboutWindow"/> class. /// </summary> public AboutWindow() { InitializeComponent(); this.AttachDevTools(); } /// <summary> /// Initialize the Xaml components. /// </summary> private void InitializeComponent() { AvaloniaXamlLoader.Load(this); App.Selector.EnableThemes(this); } } }
mit
C#
cbd76013e6f84de076ab79f5c816fa0dc3346e6e
Remove unnecessary argument
ludwigjossieaux/pickles,ludwigjossieaux/pickles,magicmonty/pickles,dirkrombauts/pickles,blorgbeard/pickles,dirkrombauts/pickles,magicmonty/pickles,ludwigjossieaux/pickles,dirkrombauts/pickles,blorgbeard/pickles,blorgbeard/pickles,picklesdoc/pickles,magicmonty/pickles,magicmonty/pickles,picklesdoc/pickles,picklesdoc/pickles,blorgbeard/pickles,picklesdoc/pickles,dirkrombauts/pickles
src/Pickles/Pickles/ObjectModel/KeywordResolver.cs
src/Pickles/Pickles/ObjectModel/KeywordResolver.cs
using System; using System.Linq; using AutoMapper; namespace PicklesDoc.Pickles.ObjectModel { public class KeywordResolver : ITypeConverter<string, Keyword> { private readonly string language; public KeywordResolver(string language) { this.language = language; } public Keyword Convert(ResolutionContext context) { string source = (string) context.SourceValue; return this.MapToKeyword(source); } private Keyword MapToKeyword(string keyword) { keyword = keyword.Trim(); var dialectProvider = new Gherkin3.GherkinDialectProvider(); if (dialectProvider.GetDialect(this.language, null).WhenStepKeywords.Select(s => s.Trim()).Contains(keyword)) { return Keyword.When; } if (dialectProvider.GetDialect(this.language, null).GivenStepKeywords.Select(s => s.Trim()).Contains(keyword)) { return Keyword.Given; } if (dialectProvider.GetDialect(this.language, null).ThenStepKeywords.Select(s => s.Trim()).Contains(keyword)) { return Keyword.Then; } if (dialectProvider.GetDialect(this.language, null).AndStepKeywords.Select(s => s.Trim()).Contains(keyword)) { return Keyword.And; } if (dialectProvider.GetDialect(this.language, null).ButStepKeywords.Select(s => s.Trim()).Contains(keyword)) { return Keyword.But; } throw new ArgumentOutOfRangeException("keyword"); } } }
using System; using System.Linq; using AutoMapper; namespace PicklesDoc.Pickles.ObjectModel { public class KeywordResolver : ITypeConverter<string, Keyword> { private readonly string language; public KeywordResolver(string language) { this.language = language; } public Keyword Convert(ResolutionContext context) { string source = (string) context.SourceValue; return this.MapToKeyword(source); } private Keyword MapToKeyword(string keyword) { keyword = keyword.Trim(); var dialectProvider = new Gherkin3.GherkinDialectProvider(this.language); if (dialectProvider.GetDialect(this.language, null).WhenStepKeywords.Select(s => s.Trim()).Contains(keyword)) { return Keyword.When; } if (dialectProvider.GetDialect(this.language, null).GivenStepKeywords.Select(s => s.Trim()).Contains(keyword)) { return Keyword.Given; } if (dialectProvider.GetDialect(this.language, null).ThenStepKeywords.Select(s => s.Trim()).Contains(keyword)) { return Keyword.Then; } if (dialectProvider.GetDialect(this.language, null).AndStepKeywords.Select(s => s.Trim()).Contains(keyword)) { return Keyword.And; } if (dialectProvider.GetDialect(this.language, null).ButStepKeywords.Select(s => s.Trim()).Contains(keyword)) { return Keyword.But; } throw new ArgumentOutOfRangeException("keyword"); } } }
apache-2.0
C#
1a21c7a96fbc593cdc5c201c1862f0d28db008e6
update version
arkoc/EntityFramework.Guardian
EntityFramework.Guardian.Core/Properties/AssemblyInfo.cs
EntityFramework.Guardian.Core/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("EntityFramework.Guardian")] [assembly: AssemblyDescription("EntityFramework plugin for implementing database security including row-Level and column-level permissions.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Aram Kocharyan")] [assembly: AssemblyProduct("EntityFramework.Guardian")] [assembly: AssemblyCopyright("Copyright © Aram Kocharyan 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("44b106f0-deb2-4121-8af7-45b499b784f3")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // [assembly: AssemblyVersion("1.1.4.0")]
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("EntityFramework.Guardian")] [assembly: AssemblyDescription("EntityFramework plugin for implementing database security including row-Level and column-level permissions.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Aram Kocharyan")] [assembly: AssemblyProduct("EntityFramework.Guardian")] [assembly: AssemblyCopyright("Copyright © Aram Kocharyan 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("44b106f0-deb2-4121-8af7-45b499b784f3")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // [assembly: AssemblyVersion("1.1.3.0")]
mit
C#
1698d4ba46799711d6260eb13091a91b83b63328
Initialize SQLitePCL in xunit
villermen/runescape-cache-tools,villermen/runescape-cache-tools
RuneScapeCacheToolsTest/Test/Fixture/TestCacheFixture.cs
RuneScapeCacheToolsTest/Test/Fixture/TestCacheFixture.cs
using System; using System.Collections.Generic; using Villermen.RuneScapeCacheTools.Cache; using Villermen.RuneScapeCacheTools.Utility; namespace Villermen.RuneScapeCacheTools.Test.Fixture { /// <summary> /// Provides cache related properties that can be re-used among tests. /// </summary> public class TestCacheFixture : IDisposable { public JavaClientCache JavaClientCache { get; } public NxtClientCache NxtClientCache { get; } public DownloaderCache DownloaderCache { get; } public FlatFileCache FlatFileCache { get; } public readonly Dictionary<Type, ICache> Caches = new Dictionary<Type, ICache>(); public SoundtrackExtractor SoundtrackExtractor { get; } public TestCacheFixture() { SQLitePCL.Batteries.Init(); this.JavaClientCache = new JavaClientCache("testcache/java", false); this.Caches[typeof(JavaClientCache)] = this.JavaClientCache; this.NxtClientCache = new NxtClientCache("testcache/nxt", false); this.Caches[typeof(NxtClientCache)] = this.NxtClientCache; this.DownloaderCache = new DownloaderCache(); this.Caches[typeof(DownloaderCache)] = this.DownloaderCache; this.FlatFileCache = new FlatFileCache("testcache/file"); this.Caches[typeof(FlatFileCache)] = this.FlatFileCache; this.SoundtrackExtractor = new SoundtrackExtractor(this.JavaClientCache, "soundtrack"); } public void Dispose() { this.JavaClientCache.Dispose(); this.NxtClientCache.Dispose(); this.DownloaderCache.Dispose(); this.FlatFileCache.Dispose(); } } }
using System; using System.Collections.Generic; using Villermen.RuneScapeCacheTools.Cache; using Villermen.RuneScapeCacheTools.Utility; namespace Villermen.RuneScapeCacheTools.Test.Fixture { /// <summary> /// Provides cache related properties that can be re-used among tests. /// </summary> public class TestCacheFixture : IDisposable { public JavaClientCache JavaClientCache { get; } public NxtClientCache NxtClientCache { get; } public DownloaderCache DownloaderCache { get; } public FlatFileCache FlatFileCache { get; } public readonly Dictionary<Type, ICache> Caches = new Dictionary<Type, ICache>(); public SoundtrackExtractor SoundtrackExtractor { get; } public TestCacheFixture() { this.JavaClientCache = new JavaClientCache("testcache/java", false); this.Caches[typeof(JavaClientCache)] = this.JavaClientCache; this.NxtClientCache = new NxtClientCache("testcache/nxt", false); this.Caches[typeof(NxtClientCache)] = this.NxtClientCache; this.DownloaderCache = new DownloaderCache(); this.Caches[typeof(DownloaderCache)] = this.DownloaderCache; this.FlatFileCache = new FlatFileCache("testcache/file"); this.Caches[typeof(FlatFileCache)] = this.FlatFileCache; this.SoundtrackExtractor = new SoundtrackExtractor(this.JavaClientCache, "soundtrack"); } public void Dispose() { this.JavaClientCache.Dispose(); this.NxtClientCache.Dispose(); this.DownloaderCache.Dispose(); this.FlatFileCache.Dispose(); } } }
mit
C#
687c88215c5f8fc0c2c10af08bd8701fabe1699e
Update index.cshtml
reactiveui/website,reactiveui/website,reactiveui/website,reactiveui/website
input/contribute/operations/index.cshtml
input/contribute/operations/index.cshtml
Order: 100 --- @Html.Partial("_ChildPages") https://medium.com/@@mikeal/community-imbalance-theory-c5f8688ae352 <script async class="speakerdeck-embed" data-slide="4" data-id="880cb5d4ec364909a1db5b5655aa9d37" data-ratio="1.33333333333333" src="//speakerdeck.com/assets/embed.js"></script>
Order: 100 --- @Html.Partial("_ChildPages") https://medium.com/@mikeal/community-imbalance-theory-c5f8688ae352 <script async class="speakerdeck-embed" data-slide="4" data-id="880cb5d4ec364909a1db5b5655aa9d37" data-ratio="1.33333333333333" src="//speakerdeck.com/assets/embed.js"></script>
mit
C#
441204048586fa7628ab133181caf2a1ffeab53b
Update MainControl.xaml.cs
wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,Core2D/Core2D,Core2D/Core2D,wieslawsoltes/Core2D
src/Core2D.UI/Views/MainControl.xaml.cs
src/Core2D.UI/Views/MainControl.xaml.cs
using System; using Avalonia; using Avalonia.Controls; using Avalonia.Input; using Avalonia.Interactivity; using Avalonia.Markup.Xaml; using Avalonia.Media; namespace Core2D.UI.Views { /// <summary> /// Interaction logic for <see cref="MainControl"/> xaml. /// </summary> public class MainControl : UserControl { private SplitView _splitView; private Button _pinButton; private TextBlock _pinTextBlock; private LayoutTransformControl _layoutTransform; /// <summary> /// Initializes a new instance of the <see cref="MainControl"/> class. /// </summary> public MainControl() { InitializeComponent(); #if false _splitView = this.FindControl<SplitView>("SplitView"); _pinButton = this.FindControl<Button>("PinButton"); _pinTextBlock = this.FindControl<TextBlock>("PinTextBlock"); _layoutTransform = this.FindControl<LayoutTransformControl>("LayoutTransform"); _splitView.GetObservable(SplitView.IsPaneOpenProperty).Subscribe((isPaneOpen) => { if (_layoutTransform.LayoutTransform is RotateTransform rotateTransform) { rotateTransform.Angle = isPaneOpen ? 0 : 90; } }); _splitView.GetObservable(SplitView.DisplayModeProperty).Subscribe((displayMode) => { if (_splitView.DisplayMode == SplitViewDisplayMode.Inline) { _pinButton.Content = _splitView.Resources["PinIcon"]; } else if (_splitView.DisplayMode == SplitViewDisplayMode.CompactOverlay) { _pinButton.Content = _splitView.Resources["PinOffIcon"]; } }); _pinButton.Click += (sender, e) => { if (_splitView.DisplayMode == SplitViewDisplayMode.Inline) { _splitView.DisplayMode = SplitViewDisplayMode.CompactOverlay; _splitView.IsPaneOpen = false; } else if (_splitView.DisplayMode == SplitViewDisplayMode.CompactOverlay) { _splitView.DisplayMode = SplitViewDisplayMode.Inline; _splitView.IsPaneOpen = true; } }; _pinTextBlock.PointerPressed += (sender, e) => { if (_splitView.DisplayMode == SplitViewDisplayMode.CompactOverlay) { _splitView.IsPaneOpen = !_splitView.IsPaneOpen; } }; #endif } /// <summary> /// Initialize the Xaml components. /// </summary> private void InitializeComponent() => AvaloniaXamlLoader.Load(this); } }
using Avalonia.Controls; using Avalonia.Markup.Xaml; namespace Core2D.UI.Views { /// <summary> /// Interaction logic for <see cref="MainControl"/> xaml. /// </summary> public class MainControl : UserControl { /// <summary> /// Initializes a new instance of the <see cref="MainControl"/> class. /// </summary> public MainControl() { InitializeComponent(); } /// <summary> /// Initialize the Xaml components. /// </summary> private void InitializeComponent() { AvaloniaXamlLoader.Load(this); } } }
mit
C#
ca8438d9bea476d20e63823cce98fedf9fbe91e1
Update StephenOwen.cs
planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell
src/Firehose.Web/Authors/StephenOwen.cs
src/Firehose.Web/Authors/StephenOwen.cs
using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel.Syndication; using System.Web; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class StephenOwen : IAmAMicrosoftMVP { public string FirstName => "Stephen"; public string LastName => "Owen"; public string ShortBioOrTagLine => "FoxDeploy.SubjectMatter = writes about PowerShell"; public string StateOrRegion => "Atlanta"; public string EmailAddress => "Stephen@foxdeploy.com"; public string TwitterHandle => "FoxDeploy"; public string GitHubHandle => "1RedOne"; public GeoPosition Position => new GeoPosition(33.862100, -84.687900); public Uri WebSite => new Uri("http://www.FoxDeploy.com"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://foxdeploy.com/tag/powershell/feed/"); } } public string GravatarHash => "3dd39b0d646f3b959b741eb0196c4c21"; } }
using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel.Syndication; using System.Web; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class StephenOwen : IAmAMicrosoftMVP, IFilterMyBlogPosts { public string FirstName => "Stephen"; public string LastName => "Owen"; public string ShortBioOrTagLine => "FoxDeploy.SubjectMatter = writes about PowerShell"; public string StateOrRegion => "Atlanta"; public string EmailAddress => "Stephen@foxdeploy.com"; public string TwitterHandle => "FoxDeploy"; public string GitHubHandle => "1RedOne"; public GeoPosition Position => new GeoPosition(33.862100, -84.687900); public Uri WebSite => new Uri("http://www.FoxDeploy.com"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://foxdeploy.com/tag/powershell/feed/"); } } public string GravatarHash => "3dd39b0d646f3b959b741eb0196c4c21"; } }
mit
C#
4025ea3675b39bf631e4ac7ffdedfc9bc42900bb
Set version to 0.6.
strayfatty/ShowFeed,strayfatty/ShowFeed
src/ShowFeed/Properties/AssemblyInfo.cs
src/ShowFeed/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("ShowFeed")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ShowFeed")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("3b3f205e-4800-4725-bfa1-a68a4b1527bd")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("0.6.0.0")] [assembly: AssemblyFileVersion("0.6.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("ShowFeed")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ShowFeed")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("3b3f205e-4800-4725-bfa1-a68a4b1527bd")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("0.5.0.0")] [assembly: AssemblyFileVersion("0.5.0.0")]
mit
C#
c387e209dbdb08b6d701fbf586dfdbfba46d6854
Bump to v1.3.0
danielwertheim/requester
buildconfig.cake
buildconfig.cake
public class BuildConfig { private const string Version = "1.3.0"; private const bool IsPreRelease = false; public readonly string SrcDir = "./src/"; public readonly string OutDir = "./build/"; public string Target { get; private set; } public string SemVer { get; private set; } public string BuildVersion { get; private set; } public string BuildProfile { get; private set; } public bool IsTeamCityBuild { get; private set; } public static BuildConfig Create( ICakeContext context, BuildSystem buildSystem) { if (context == null) throw new ArgumentNullException("context"); var target = context.Argument("target", "Default"); var buildRevision = context.Argument("buildrevision", "0"); return new BuildConfig { Target = target, SemVer = Version + (IsPreRelease ? "-b" + buildRevision : string.Empty), BuildVersion = Version + "." + buildRevision, BuildProfile = context.Argument("configuration", "Release"), IsTeamCityBuild = buildSystem.TeamCity.IsRunningOnTeamCity }; } }
public class BuildConfig { private const string Version = "0.1.0"; private const bool IsPreRelease = false; public readonly string SrcDir = "./src/"; public readonly string OutDir = "./build/"; public string Target { get; private set; } public string SemVer { get; private set; } public string BuildVersion { get; private set; } public string BuildProfile { get; private set; } public bool IsTeamCityBuild { get; private set; } public static BuildConfig Create( ICakeContext context, BuildSystem buildSystem) { if (context == null) throw new ArgumentNullException("context"); var target = context.Argument("target", "Default"); var buildRevision = context.Argument("buildrevision", "0"); return new BuildConfig { Target = target, SemVer = Version + (IsPreRelease ? "-b" + buildRevision : string.Empty), BuildVersion = Version + "." + buildRevision, BuildProfile = context.Argument("configuration", "Release"), IsTeamCityBuild = buildSystem.TeamCity.IsRunningOnTeamCity }; } }
mit
C#
2106f12c959484cc0c0b6dc896dcd56b69e0f40d
Change port
mvno/Okanshi.Dashboard,mvno/Okanshi.Dashboard,mvno/Okanshi.Dashboard,mvno/Okanshi.Dashboard
src/Okanshi.Dashboard/Program.cs
src/Okanshi.Dashboard/Program.cs
using System; using Microsoft.Owin.Hosting; namespace Okanshi.Dashboard { public class Program { public static void Main(string[] args) { var url = "http://+:13016"; using (WebApp.Start<Startup>(url)) { Console.WriteLine("Running on {0}", url); Console.WriteLine("Press enter to exit..."); Console.ReadLine(); } } } }
using System; using Microsoft.Owin.Hosting; namespace Okanshi.Dashboard { public class Program { public static void Main(string[] args) { var url = "http://+:13004"; using (WebApp.Start<Startup>(url)) { Console.WriteLine("Running on {0}", url); Console.WriteLine("Press enter to exit..."); Console.ReadLine(); } } } }
mit
C#
276ab32f4f96e3b04acac87f95d60e59d570832e
整理代码。
renyh1013/chord,renyh1013/chord,renyh1013/chord,DigitalPlatform/chord,DigitalPlatform/chord,DigitalPlatform/chord
dp2Capo/Properties/AssemblyInfo.cs
dp2Capo/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的常规信息通过以下 // 特性集控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("dp2Capo")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("dp2Capo")] [assembly: AssemblyCopyright("Copyright © 数字平台(北京)软件有限责任公司 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 使此程序集中的类型 // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, // 则将该类型上的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("e6066657-9063-44ea-b3a8-cb7bb604d2cf")] // 程序集的版本信息由下面四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.7.*")] [assembly: AssemblyFileVersion("1.7.0.0")] // 1.1 (2016/6/26) 首次使用了版本号 // 1.2 (2016/9/14) 管理线程中会不断重试连接 dp2mserver,并将此情况写入日志 // 1.3 (2016/9/15) 修正连接 dp2mserver 时重叠调用 BeginConnect() 的问题 // 1.4 (2016/10/10) 增加 _cancel, 让退出更敏捷 // 1.5 (2016/10/12) 增加了防止 MessageConnection.CloseConnection() 函数重入的机制 // 1.6 (2016/10/13) 为后台线程增加了 echo 机制,并详细化了日志信息 // 1.7 (2016/10/14) 增加了 ping 机制
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的常规信息通过以下 // 特性集控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("dp2Capo")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("dp2Capo")] [assembly: AssemblyCopyright("Copyright © 数字平台(北京)软件有限责任公司 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 使此程序集中的类型 // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, // 则将该类型上的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("e6066657-9063-44ea-b3a8-cb7bb604d2cf")] // 程序集的版本信息由下面四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.6.*")] [assembly: AssemblyFileVersion("1.6.0.0")] // 1.1 (2016/6/26) 首次使用了版本号 // 1.2 (2016/9/14) 管理线程中会不断重试连接 dp2mserver,并将此情况写入日志 // 1.3 (2016/9/15) 修正连接 dp2mserver 时重叠调用 BeginConnect() 的问题 // 1.4 (2016/10/10) 增加 _cancel, 让退出更敏捷 // 1.5 (2016/10/12) 增加了防止 MessageConnection.CloseConnection() 函数重入的机制 // 1.6 (2016/10/13) 为后台线程增加了 echo 机制,并详细化了日志信息
apache-2.0
C#
5beb3688577544abcf2f847e49bbe1c3f698e3b1
replace regex lexer with generic lexer for EBNF rules parsing
b3b00/sly,b3b00/csly
sly/parser/generator/EbnfToken.cs
sly/parser/generator/EbnfToken.cs
using sly.lexer; namespace sly.parser.generator { public enum EbnfToken { [Lexeme("^[A-Za-z][A-Za-z0-9_]*")] IDENTIFIER = 1, [Lexeme(":")] COLON = 2, [Lexeme("\\*")] ZEROORMORE = 3, [Lexeme("\\+")] ONEORMORE = 4, [Lexeme("[ \\t]+", true)] WS = 5, [Lexeme("^\\?")] OPTION = 6, [Lexeme("^\\[d\\]")] DISCARD = 7, [Lexeme("^\\(")] LPAREN = 8, [Lexeme("^\\)")] RPAREN = 9, [Lexeme("[\\n\\r]+", true, true)] EOL = 10 } public enum EbnfTokenGeneric { [Lexeme(GenericToken.Identifier,IdentifierType.AlphaNumericDash)] IDENTIFIER = 1, [Lexeme(GenericToken.SugarToken,":")] COLON = 2, [Lexeme(GenericToken.SugarToken,"*")] ZEROORMORE = 3, [Lexeme(GenericToken.SugarToken,"+")] ONEORMORE = 4, [Lexeme(GenericToken.SugarToken,"?")] OPTION = 6, [Lexeme(GenericToken.SugarToken,"[d]")] DISCARD = 7, [Lexeme(GenericToken.SugarToken,"(")] LPAREN = 8, [Lexeme(GenericToken.SugarToken,")")] RPAREN = 9, } }
using sly.lexer; namespace sly.parser.generator { public enum EbnfToken { [Lexeme("^[A-Za-z][A-Za-z0-9_]*")] IDENTIFIER = 1, [Lexeme(":")] COLON = 2, [Lexeme("\\*")] ZEROORMORE = 3, [Lexeme("\\+")] ONEORMORE = 4, [Lexeme("[ \\t]+", true)] WS = 5, [Lexeme("^\\?")] OPTION = 6, [Lexeme("^\\[d\\]")] DISCARD = 7, [Lexeme("^\\(")] LPAREN = 8, [Lexeme("^\\)")] RPAREN = 9, [Lexeme("[\\n\\r]+", true, true)] EOL = 10 } public enum EbnfTokenGeneric { [Lexeme(GenericToken.Identifier,IdentifierType.AlphaNumeric)] IDENTIFIER = 1, [Lexeme(GenericToken.SugarToken,":")] COLON = 2, [Lexeme(GenericToken.SugarToken,"*")] ZEROORMORE = 3, [Lexeme(GenericToken.SugarToken,"+")] ONEORMORE = 4, [Lexeme(GenericToken.SugarToken,"?")] OPTION = 6, [Lexeme(GenericToken.SugarToken,"[d]")] DISCARD = 7, [Lexeme(GenericToken.SugarToken,"(")] LPAREN = 8, [Lexeme(GenericToken.SugarToken,")")] RPAREN = 9, } }
mit
C#
256fbf6412368135476927965fded32943b17925
Update RunPoolingSystem.cs
cdrandin/Simple-Object-Pooling
PoolingSystem_Demo/Assets/Demo/Scripts/RunPoolingSystem.cs
PoolingSystem_Demo/Assets/Demo/Scripts/RunPoolingSystem.cs
using UnityEngine; using System.Collections; using System.Collections.Generic; public class RunPoolingSystem : MonoBehaviour { public bool test; public List<GameObject> objects_to_pool; public List<GameObject> objects_in_the_pool; // Use this for initialization void Start () { } // Update is called once per frame void Update () { if(Input.GetKeyDown(KeyCode.Space)) { GameObject obj = PoolingSystem.instance.PS_Instantiate(objects_to_pool[Random.Range(0, objects_to_pool.Count)], new Vector3(Random.Range(-5.0f, 5.0f), 3.0f, Random.Range(-5.0f, 5.0f)), Quaternion.identity); if(obj == null) return; objects_in_the_pool.Add(obj); } else if(Input.GetKeyDown(KeyCode.Backspace)) { if(objects_in_the_pool.Count > 0) { int i = Random.Range(0, objects_in_the_pool.Count); PoolingSystem.instance.PS_Destroy(objects_in_the_pool[i]); objects_in_the_pool.RemoveAt(i); } } } }
using UnityEngine; using System.Collections; using System.Collections.Generic; public class RunPoolingSystem : MonoBehaviour { public bool test; public List<GameObject> objects_to_pool; public List<GameObject> objects_in_the_pool; // Use this for initialization void Start () { } // Update is called once per frame void Update () { if(Input.GetKeyDown(KeyCode.Space)) { GameObject obj = null; obj = PoolingSystem.instance.PS_Instantiate(objects_to_pool[Random.Range(0, objects_to_pool.Count)], new Vector3(Random.Range(-5.0f, 5.0f), 3.0f, Random.Range(-5.0f, 5.0f)), Quaternion.identity); if(obj == null) return; objects_in_the_pool.Add(obj); } else if(Input.GetKeyDown(KeyCode.Backspace)) { if(objects_in_the_pool.Count > 0) { int i = Random.Range(0, objects_in_the_pool.Count); if(!test) { PoolingSystem.instance.PS_Destroy(objects_in_the_pool[i]); } else { PoolingSystem.instance.PS_Destroy(objects_in_the_pool[i]); } objects_in_the_pool.RemoveAt(i); } } } }
mit
C#
d01aa9eedc69662562082e6afb2133d87ae20df0
Update IInline.cs
yasinkuyu/Localization
src/IInline.cs
src/IInline.cs
// @yasinkuyu // 05/08/2014 namespace Insya.Localization { interface IInline { string de_DE { get; set; } string en_CA { get; set; } string en_US { get; set; } string en_GB { get; set; } string es_ES { get; set; } string es_MX { get; set; } string fr_FR { get; set; } string it_IT { get; set; } string ja_JP { get; set; } string pt_BR { get; set; } string ru_RU { get; set; } string tr_TR { get; set; } string zh_CN { get; set; } string ar_SA { get; set; } } }
// @yasinkuyu // 05/08/2014 namespace Insya.Localization { interface IInline { string de_DE { get; set; } string en_CA { get; set; } string en_US { get; set; } string en_GB { get; set; } string es_ES { get; set; } string es_MX { get; set; } string fr_FR { get; set; } string it_IT { get; set; } string ja_JP { get; set; } string pt_BR { get; set; } string ru_RU { get; set; } string tr_TR { get; set; } string zh_CN { get; set; } } }
mit
C#
b07fce5a6ea60dd6dccf4b81a4fff97aef57acd6
Fix android device-level "back" button closing the game (#2877)
ppy/osu-framework,smoogipooo/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,ppy/osu-framework,ppy/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,peppy/osu-framework
osu.Framework.Android/AndroidGameActivity.cs
osu.Framework.Android/AndroidGameActivity.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using Android.App; using Android.Content; using Android.OS; using Android.Runtime; using Android.Views; namespace osu.Framework.Android { public abstract class AndroidGameActivity : Activity { protected abstract Game CreateGame(); private AndroidGameView gameView; public override void OnTrimMemory([GeneratedEnum] TrimMemory level) { base.OnTrimMemory(level); gameView.Host?.Collect(); } protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(gameView = new AndroidGameView(this, CreateGame())); } protected override void OnPause() { base.OnPause(); // Because Android is not playing nice with Background - we just kill it System.Diagnostics.Process.GetCurrentProcess().Kill(); } public override void OnBackPressed() { // Avoid the default implementation that does close the app. // This only happens when the back button could not be captured from OnKeyDown. } // On some devices and keyboard combinations the OnKeyDown event does not propagate the key event to the view. // Here it is done manually to ensure that the keys actually land in the view. public override bool OnKeyDown([GeneratedEnum] Keycode keyCode, KeyEvent e) { return gameView.OnKeyDown(keyCode, e); } public override bool OnKeyUp([GeneratedEnum] Keycode keyCode, KeyEvent e) { return gameView.OnKeyUp(keyCode, e); } public override bool OnKeyLongPress([GeneratedEnum] Keycode keyCode, KeyEvent e) { return gameView.OnKeyLongPress(keyCode, e); } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using Android.App; using Android.Content; using Android.OS; using Android.Runtime; namespace osu.Framework.Android { public abstract class AndroidGameActivity : Activity { protected abstract Game CreateGame(); private AndroidGameView gameView; public override void OnTrimMemory([GeneratedEnum] TrimMemory level) { base.OnTrimMemory(level); gameView.Host?.Collect(); } protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(gameView = new AndroidGameView(this, CreateGame())); } protected override void OnPause() { base.OnPause(); // Because Android is not playing nice with Background - we just kill it System.Diagnostics.Process.GetCurrentProcess().Kill(); } } }
mit
C#
687b634fb330594466779c3293aaa9905e6d0227
Adjust button font size.
peppy/osu,nyaamara/osu,EVAST9919/osu,osu-RP/osu-RP,2yangk23/osu,johnneijzen/osu,smoogipoo/osu,ZLima12/osu,RedNesto/osu,smoogipoo/osu,default0/osu,naoey/osu,peppy/osu,NeoAdonis/osu,UselessToucan/osu,Frontear/osuKyzer,naoey/osu,NotKyon/lolisu,DrabWeb/osu,Drezi126/osu,peppy/osu,peppy/osu-new,DrabWeb/osu,EVAST9919/osu,Damnae/osu,smoogipoo/osu,UselessToucan/osu,naoey/osu,theguii/osu,ZLima12/osu,johnneijzen/osu,NeoAdonis/osu,DrabWeb/osu,UselessToucan/osu,tacchinotacchi/osu,smoogipooo/osu,ppy/osu,ppy/osu,Nabile-Rahmani/osu,ppy/osu,2yangk23/osu,NeoAdonis/osu
osu.Game/Graphics/UserInterface/OsuButton.cs
osu.Game/Graphics/UserInterface/OsuButton.cs
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.Backgrounds; using osu.Game.Overlays; namespace osu.Game.Graphics.UserInterface { public class OsuButton : Button { public OsuButton() { Height = 40; SpriteText.TextSize = OptionsOverlay.FONT_SIZE; } [BackgroundDependencyLoader] private void load(OsuColour colours) { Colour = colours.BlueDark; Masking = true; CornerRadius = 5; Add(new Triangles { RelativeSizeAxes = Axes.Both, ColourDark = colours.BlueDarker, ColourLight = colours.Blue, }); } } }
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.Backgrounds; namespace osu.Game.Graphics.UserInterface { public class OsuButton : Button { public OsuButton() { Height = 40; } [BackgroundDependencyLoader] private void load(OsuColour colours) { Colour = colours.BlueDark; Masking = true; CornerRadius = 5; Add(new Triangles { RelativeSizeAxes = Axes.Both, ColourDark = colours.BlueDarker, ColourLight = colours.Blue, }); } } }
mit
C#
e95d7c14a857965c1d2b6c819ed2023d66cb7ef4
Update AddImageToComment.cs
asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET
Examples/CSharp/DrawingObjects/Comments/AddImageToComment.cs
Examples/CSharp/DrawingObjects/Comments/AddImageToComment.cs
using System.IO; using Aspose.Cells; using System.Drawing; namespace Aspose.Cells.Examples.DrawingObjects.Comments { public class AddImageToComment { public static void Main(string[] args) { //ExStart:1 // The path to the documents directory. string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); // Create directory if it is not already present. bool IsExists = System.IO.Directory.Exists(dataDir); if (!IsExists) System.IO.Directory.CreateDirectory(dataDir); //Instantiate a Workbook Workbook workbook = new Workbook(); //Get a reference of comments collection with the first sheet CommentCollection comments = workbook.Worksheets[0].Comments; //Add a comment to cell A1 int commentIndex = comments.Add(0, 0); Comment comment = comments[commentIndex]; comment.Note = "First note."; comment.Font.Name = "Times New Roman"; //Load an image into stream Bitmap bmp = new Bitmap(dataDir + "logo.jpg"); MemoryStream ms = new MemoryStream(); bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Png); //Set image data to the shape associated with the comment comment.CommentShape.FillFormat.ImageData = ms.ToArray(); //Save the workbook workbook.Save(dataDir + "book1.out.xlsx", Aspose.Cells.SaveFormat.Xlsx); //ExEnd:1 } } }
using System.IO; using Aspose.Cells; using System.Drawing; namespace Aspose.Cells.Examples.DrawingObjects.Comments { public class AddImageToComment { public static void Main(string[] args) { // The path to the documents directory. string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); // Create directory if it is not already present. bool IsExists = System.IO.Directory.Exists(dataDir); if (!IsExists) System.IO.Directory.CreateDirectory(dataDir); //Instantiate a Workbook Workbook workbook = new Workbook(); //Get a reference of comments collection with the first sheet CommentCollection comments = workbook.Worksheets[0].Comments; //Add a comment to cell A1 int commentIndex = comments.Add(0, 0); Comment comment = comments[commentIndex]; comment.Note = "First note."; comment.Font.Name = "Times New Roman"; //Load an image into stream Bitmap bmp = new Bitmap(dataDir + "logo.jpg"); MemoryStream ms = new MemoryStream(); bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Png); //Set image data to the shape associated with the comment comment.CommentShape.FillFormat.ImageData = ms.ToArray(); //Save the workbook workbook.Save(dataDir + "book1.out.xlsx", Aspose.Cells.SaveFormat.Xlsx); } } }
mit
C#
684dec4a1227910c3b66372d7275825a2151a7af
Add and remove relevant file execs for the new weapon fx usage in previous commit, pull request #312
Torque3D-GameEngine/Torque3D,Phantom139/Torque3D,Bloodknight/Torque3D,Duion/Torque3D,GarageGames/Torque3D,FITTeamIndecisive/Torque3D,Azaezel/Torque3D,elfprince13/Torque3D,Azaezel/Torque3D,John3/Torque3D,Will-of-the-Wisp/Torque3D,Will-of-the-Wisp/Torque3D,Bloodknight/Torque3D,Bloodknight/Torque3D,rextimmy/Torque3D,rextimmy/Torque3D,elfprince13/Torque3D,lukaspj/Speciality,Duion/Torque3D,lukaspj/Speciality,lukaspj/Speciality,Azaezel/Torque3D,ValtoGameEngines/Torque3D,Torque3D-GameEngine/Torque3D,Torque3D-GameEngine/Torque3D,rextimmy/Torque3D,chaigler/Torque3D,GarageGames/Torque3D,Will-of-the-Wisp/Torque3D,elfprince13/Torque3D,FITTeamIndecisive/Torque3D,JeffProgrammer/Torque3D,chaigler/Torque3D,elfprince13/Torque3D,Torque3D-GameEngine/Torque3D,lukaspj/Speciality,ValtoGameEngines/Torque3D,FITTeamIndecisive/Torque3D,rextimmy/Torque3D,JeffProgrammer/Torque3D,Will-of-the-Wisp/Torque3D,chaigler/Torque3D,Bloodknight/Torque3D,Torque3D-GameEngine/Torque3D,John3/Torque3D,Phantom139/Torque3D,lukaspj/Speciality,John3/Torque3D,GarageGames/Torque3D,JeffProgrammer/Torque3D,rextimmy/Torque3D,Azaezel/Torque3D,Duion/Torque3D,ValtoGameEngines/Torque3D,Torque3D-GameEngine/Torque3D,Bloodknight/Torque3D,chaigler/Torque3D,aaravamudan2014/Torque3D,chaigler/Torque3D,John3/Torque3D,Will-of-the-Wisp/Torque3D,aaravamudan2014/Torque3D,lukaspj/Speciality,chaigler/Torque3D,Duion/Torque3D,John3/Torque3D,chaigler/Torque3D,Bloodknight/Torque3D,John3/Torque3D,rextimmy/Torque3D,Bloodknight/Torque3D,Duion/Torque3D,ValtoGameEngines/Torque3D,GarageGames/Torque3D,Azaezel/Torque3D,GarageGames/Torque3D,John3/Torque3D,Torque3D-GameEngine/Torque3D,aaravamudan2014/Torque3D,GarageGames/Torque3D,FITTeamIndecisive/Torque3D,Phantom139/Torque3D,Duion/Torque3D,ValtoGameEngines/Torque3D,Will-of-the-Wisp/Torque3D,rextimmy/Torque3D,FITTeamIndecisive/Torque3D,Phantom139/Torque3D,Phantom139/Torque3D,ValtoGameEngines/Torque3D,Torque3D-GameEngine/Torque3D,ValtoGameEngines/Torque3D,JeffProgrammer/Torque3D,Will-of-the-Wisp/Torque3D,aaravamudan2014/Torque3D,John3/Torque3D,Azaezel/Torque3D,lukaspj/Speciality,elfprince13/Torque3D,lukaspj/Speciality,Azaezel/Torque3D,FITTeamIndecisive/Torque3D,John3/Torque3D,elfprince13/Torque3D,ValtoGameEngines/Torque3D,FITTeamIndecisive/Torque3D,Will-of-the-Wisp/Torque3D,FITTeamIndecisive/Torque3D,GarageGames/Torque3D,Phantom139/Torque3D,elfprince13/Torque3D,GarageGames/Torque3D,rextimmy/Torque3D,Duion/Torque3D,ValtoGameEngines/Torque3D,lukaspj/Speciality,Duion/Torque3D,Duion/Torque3D,JeffProgrammer/Torque3D,rextimmy/Torque3D,FITTeamIndecisive/Torque3D,aaravamudan2014/Torque3D,rextimmy/Torque3D,Phantom139/Torque3D,JeffProgrammer/Torque3D,lukaspj/Speciality,elfprince13/Torque3D,John3/Torque3D,Azaezel/Torque3D,Phantom139/Torque3D,elfprince13/Torque3D,Will-of-the-Wisp/Torque3D,Will-of-the-Wisp/Torque3D,Phantom139/Torque3D,JeffProgrammer/Torque3D,Azaezel/Torque3D,aaravamudan2014/Torque3D,ValtoGameEngines/Torque3D,chaigler/Torque3D,Phantom139/Torque3D,Bloodknight/Torque3D,Bloodknight/Torque3D,aaravamudan2014/Torque3D,Torque3D-GameEngine/Torque3D,elfprince13/Torque3D,Torque3D-GameEngine/Torque3D,aaravamudan2014/Torque3D,Will-of-the-Wisp/Torque3D,FITTeamIndecisive/Torque3D,Azaezel/Torque3D,chaigler/Torque3D,aaravamudan2014/Torque3D,Duion/Torque3D,aaravamudan2014/Torque3D,GarageGames/Torque3D,JeffProgrammer/Torque3D
Templates/Full/game/art/datablocks/datablockExec.cs
Templates/Full/game/art/datablocks/datablockExec.cs
//----------------------------------------------------------------------------- // Copyright (c) 2012 GarageGames, LLC // // 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. //----------------------------------------------------------------------------- // Load up all datablocks. This function is called when // a server is constructed. // Do the sounds first -- later scripts/datablocks may need them exec("./audioProfiles.cs"); // LightFlareData and LightAnimData(s) exec("./lights.cs"); // Do the various effects next -- later scripts/datablocks may need them exec("./particles.cs"); exec("./environment.cs"); exec("./triggers.cs"); // Add a rigid example exec("./rigidShape.cs"); exec("./health.cs"); // Load our supporting weapon datablocks, effects and such. They must be // loaded before any weapon that uses them. exec("./weapon.cs"); exec("./weapons/grenadefx.cs"); exec("./weapons/rocketfx.cs"); // Load the weapon datablocks exec("./weapons/Lurker.cs"); exec("./weapons/Ryder.cs"); exec("./weapons/ProxMine.cs"); exec("./weapons/Turret.cs"); exec("./teleporter.cs"); // Load the default player datablocks exec("./player.cs"); // Load our other player datablocks exec("./aiPlayer.cs"); // Load the vehicle datablocks exec("./vehicles/cheetahCar.cs");
//----------------------------------------------------------------------------- // Copyright (c) 2012 GarageGames, LLC // // 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. //----------------------------------------------------------------------------- // Load up all datablocks. This function is called when // a server is constructed. // Do the sounds first -- later scripts/datablocks may need them exec("./audioProfiles.cs"); // LightFlareData and LightAnimData(s) exec("./lights.cs"); // Do the various effects next -- later scripts/datablocks may need them exec("./particles.cs"); exec("./environment.cs"); exec("./triggers.cs"); // Add a rigid example exec("./rigidShape.cs"); exec("./health.cs"); // Load our supporting weapon datablocks exec("./weapon.cs"); // Load the weapon datablocks exec("./weapons/grenadeLauncher.cs"); exec("./weapons/grenade.cs"); exec("./weapons/rocketLauncher.cs"); exec("./weapons/Lurker.cs"); exec("./weapons/Ryder.cs"); exec("./weapons/ProxMine.cs"); exec("./weapons/Turret.cs"); exec("./teleporter.cs"); // Load the default player datablocks exec("./player.cs"); // Load our other player datablocks exec("./aiPlayer.cs"); // Load the vehicle datablocks exec("./vehicles/cheetahCar.cs");
mit
C#
a4f296690179e044ae6e5bfa8d078d76a37dde76
Make Selection class internal
Domysee/Pather.CSharp
src/Pather.CSharp/Selection.cs
src/Pather.CSharp/Selection.cs
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Pather.CSharp { internal class Selection { public IReadOnlyCollection<object> Entries { get; } public Selection(IEnumerable entries) { var list = new List<object>(); foreach (var entry in entries) list.Add(entry); Entries = list; } } }
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Pather.CSharp { public class Selection { public IReadOnlyCollection<object> Entries { get; } public Selection(IEnumerable entries) { var list = new List<object>(); foreach (var entry in entries) list.Add(entry); Entries = list; } } }
mit
C#
8b021ce07acd824c5af9d9539d6d8b388231f7da
Correct assembly version in AssemblyInfo.cs
ZEISS-PiWeb/PiWeb-Api
src/Properties/AssemblyInfo.cs
src/Properties/AssemblyInfo.cs
using System.Reflection; using System.Resources; [assembly: AssemblyCompany( "Carl Zeiss Innovationszentrum für Messtechnik GmbH" )] [assembly: AssemblyProduct( "ZEISS PiWeb Api" )] [assembly: AssemblyCopyright( "Copyright © 2018 Carl Zeiss Innovationszentrum für Messtechnik GmbH" )] [assembly: AssemblyTrademark( "PiWeb" )] [assembly: NeutralResourcesLanguage( "en" )] [assembly: AssemblyVersion( "2.0.3" )] [assembly: AssemblyInformationalVersion("2.0.3")] [assembly: AssemblyFileVersion( "2.0.3" )]
using System.Reflection; using System.Resources; [assembly: AssemblyCompany( "Carl Zeiss Innovationszentrum für Messtechnik GmbH" )] [assembly: AssemblyProduct( "ZEISS PiWeb Api" )] [assembly: AssemblyCopyright( "Copyright © 2018 Carl Zeiss Innovationszentrum für Messtechnik GmbH" )] [assembly: AssemblyTrademark( "PiWeb" )] [assembly: NeutralResourcesLanguage( "en" )] [assembly: AssemblyVersion( "2.0.0" )] [assembly: AssemblyInformationalVersion("2.0.0")] [assembly: AssemblyFileVersion( "2.0.0" )]
bsd-3-clause
C#
099a910a1d6d0b9eb1ebd595c8057f0cde64bba3
use stdout for logging code path
christopheranderson/feedbackengine
QuestionProcessor/QuestionProcessor/QuestionProcessorConfig.cs
QuestionProcessor/QuestionProcessor/QuestionProcessorConfig.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; using System.IO; namespace QuestionProcessor { class QuestionProcessorConfig { } public class listConfigs { public IList<ConfigProfile> Configs { get; set;} } public class ConfigList { public listConfigs Configs { get; set; } public ConfigProfile Config { get; set; } public string ConfigFilePath { get; set; } private void loadCFG() { //load config Console.Out.WriteLine("Loading congif: private void loadCFG()"); if (ConfigFilePath.Length == 0) return; try { string fJson = File.OpenText(ConfigFilePath).ReadToEnd(); Configs = (JsonConvert.DeserializeObject<listConfigs>(fJson)); Config = Configs.Configs[0]; } catch (Exception ex) { Console.Out.WriteLine("Error loading config: " + ex.Message); } return; } } public class ActionItem { public string Name { get; set; } public string Type { get; set; } public string ActionText { get; set; } } public class ConfigProfile { public string ProfileName { get; set; } public string LogDB { get; set; } public string DestinationDB { get; set; } public IList<ActionItem> Sources { get; set; } public IList<ActionItem> Commands { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; using System.IO; namespace QuestionProcessor { class QuestionProcessorConfig { } public class listConfigs { public IList<ConfigProfile> Configs { get; set;} } public class ConfigList { public listConfigs Configs { get; set; } public ConfigProfile Config { get; set; } public string ConfigFilePath { get; set; } private void loadCFG() { //load config Console.WriteLine("Loading congif: private void loadCFG()"); if (ConfigFilePath.Length == 0) return; try { string fJson = File.OpenText(ConfigFilePath).ReadToEnd(); Configs = (JsonConvert.DeserializeObject<listConfigs>(fJson)); Config = Configs.Configs[0]; } catch (Exception ex) { Console.WriteLine("Error loading config: " + ex.Message); } return; } } public class ActionItem { public string Name { get; set; } public string Type { get; set; } public string ActionText { get; set; } } public class ConfigProfile { public string ProfileName { get; set; } public string LogDB { get; set; } public string DestinationDB { get; set; } public IList<ActionItem> Sources { get; set; } public IList<ActionItem> Commands { get; set; } } }
mit
C#
b9b8f964d6d23b8810a69ea91befb918cf63d207
Update LevelUpSettings.cs
00christian00/unity3d-levelup,00christian00/unity3d-levelup,00christian00/unity3d-levelup,vedi/unity3d-levelup,vedi/unity3d-levelup,vedi/unity3d-levelup,00christian00/unity3d-levelup,00christian00/unity3d-levelup,vedi/unity3d-levelup,vedi/unity3d-levelup
Soomla/Assets/Plugins/Soomla/Levelup/Config/LevelUpSettings.cs
Soomla/Assets/Plugins/Soomla/Levelup/Config/LevelUpSettings.cs
/// Copyright (C) 2012-2014 Soomla 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 UnityEngine; using System.IO; using System; using System.Collections.Generic; using System.Linq; #if UNITY_EDITOR using UnityEditor; #endif namespace Soomla.Levelup { #if UNITY_EDITOR [InitializeOnLoad] #endif /// <summary> /// This class holds the levelup's configurations. /// </summary> public class LevelUpSettings : ISoomlaSettings { #if UNITY_EDITOR static LevelUpSettings instance = new LevelUpSettings(); static LevelUpSettings() { SoomlaEditorScript.addSettings(instance); } // BuildTargetGroup[] supportedPlatforms = { BuildTargetGroup.Android, BuildTargetGroup.iPhone, // BuildTargetGroup.WebPlayer, BuildTargetGroup.Standalone}; GUIContent profileVersion = new GUIContent("LevelUp Version [?]", "The SOOMLA LevelUp version. "); GUIContent profileBuildVersion = new GUIContent("LevelUp Build [?]", "The SOOMLA LevelUp build."); private LevelUpSettings() { } public void OnEnable() { // Generating AndroidManifest.xml // ManifestTools.GenerateManifest(); } public void OnModuleGUI() { // AndroidGUI(); // EditorGUILayout.Space(); // IOSGUI(); } public void OnInfoGUI() { SoomlaEditorScript.SelectableLabelField(profileVersion, "1.0.1"); SoomlaEditorScript.SelectableLabelField(profileBuildVersion, "1"); EditorGUILayout.Space(); } public void OnSoomlaGUI() { } #endif /** LevelUp Specific Variables **/ } }
/// Copyright (C) 2012-2014 Soomla 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 UnityEngine; using System.IO; using System; using System.Collections.Generic; using System.Linq; #if UNITY_EDITOR using UnityEditor; #endif namespace Soomla.Levelupd { #if UNITY_EDITOR [InitializeOnLoad] #endif /// <summary> /// This class holds the levelup's configurations. /// </summary> public class LevelUpSettings : ISoomlaSettings { #if UNITY_EDITOR static LevelUpSettings instance = new LevelUpSettings(); static LevelUpSettings() { SoomlaEditorScript.addSettings(instance); } // BuildTargetGroup[] supportedPlatforms = { BuildTargetGroup.Android, BuildTargetGroup.iPhone, // BuildTargetGroup.WebPlayer, BuildTargetGroup.Standalone}; GUIContent profileVersion = new GUIContent("LevelUp Version [?]", "The SOOMLA LevelUp version. "); GUIContent profileBuildVersion = new GUIContent("LevelUp Build [?]", "The SOOMLA LevelUp build."); private LevelUpSettings() { } public void OnEnable() { // Generating AndroidManifest.xml // ManifestTools.GenerateManifest(); } public void OnModuleGUI() { // AndroidGUI(); // EditorGUILayout.Space(); // IOSGUI(); } public void OnInfoGUI() { SoomlaEditorScript.SelectableLabelField(profileVersion, "1.0.1"); SoomlaEditorScript.SelectableLabelField(profileBuildVersion, "1"); EditorGUILayout.Space(); } public void OnSoomlaGUI() { } #endif /** LevelUp Specific Variables **/ } }
apache-2.0
C#
b2d6133d5a208f7d8ff50a1801203910653b2958
Change private property name to prevent hiding of inherited member RenderContent.Xml.
mcneel/RhinoCycles
Environments/XmlEnvironment.cs
Environments/XmlEnvironment.cs
/** Copyright 2014-2017 Robert McNeel and Associates Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **/ using System.Runtime.InteropServices; using RhinoCyclesCore.Materials; using Rhino.Render; namespace RhinoCyclesCore.Environments { [Guid("8D42AAEC-DB00-4EE3-81A1-54BBCD79E925")] [CustomRenderContent(IsPrivate=true)] public class XmlEnvironment: RenderEnvironment, ICyclesMaterial { public override string TypeName => "Cycles XML Environment"; public override string TypeDescription => "Grasshopper/XML environment"; public float Gamma { get; set; } private string XmlString { get; set; } public XmlEnvironment() { XmlString = "<background color=\"0 1 0\" name=\"bg\" strength=\"1\" />" + "<connect from=\"bg background\" to=\"output surface\" />"; Fields.Add("xmlcode", XmlString, "XML definition"); } public void BakeParameters() { string xml; if (Fields.TryGetValue("xmlcode", out xml)) { XmlString = xml; } } protected override void OnAddUserInterfaceSections() { AddAutomaticUserInterfaceSection("Parameters", 0); } public string MaterialXml { get { return XmlString; } } public ShaderBody.CyclesMaterial MaterialType => ShaderBody.CyclesMaterial.XmlEnvironment; } }
/** Copyright 2014-2017 Robert McNeel and Associates Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **/ using System.Runtime.InteropServices; using RhinoCyclesCore.Materials; using Rhino.Render; namespace RhinoCyclesCore.Environments { [Guid("8D42AAEC-DB00-4EE3-81A1-54BBCD79E925")] [CustomRenderContent(IsPrivate=true)] public class XmlEnvironment: RenderEnvironment, ICyclesMaterial { public override string TypeName => "Cycles XML Environment"; public override string TypeDescription => "Grasshopper/XML environment"; public float Gamma { get; set; } private string Xml { get; set; } public XmlEnvironment() { Xml = "<background color=\"0 1 0\" name=\"bg\" strength=\"1\" />" + "<connect from=\"bg background\" to=\"output surface\" />"; Fields.Add("xmlcode", Xml, "XML definition"); } public void BakeParameters() { string xml; if (Fields.TryGetValue("xmlcode", out xml)) { Xml = xml; } } protected override void OnAddUserInterfaceSections() { AddAutomaticUserInterfaceSection("Parameters", 0); } public string MaterialXml { get { return Xml; } } public ShaderBody.CyclesMaterial MaterialType => ShaderBody.CyclesMaterial.XmlEnvironment; } }
apache-2.0
C#
3fc0b967831108ba6e2f830c01108caaa0218350
Align assembly version with package version
nicolaiarocci/Eve.NET
Eve/Properties/AssemblyInfo.cs
Eve/Properties/AssemblyInfo.cs
using System.Resources; 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("Eve")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("CIR 2000")] [assembly: AssemblyProduct("Eve")] [assembly: AssemblyCopyright("Copyright © CIR 2000 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // 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.1.0")] [assembly: AssemblyFileVersion("0.1.1.0")]
using System.Resources; 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("Eve")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("CIR 2000")] [assembly: AssemblyProduct("Eve")] [assembly: AssemblyCopyright("Copyright © CIR 2000 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // 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")]
bsd-3-clause
C#
f3bd58dd8de62c77b05bc70859626e3c8769c39c
Build and publish nuget package
bfriesen/Rock.StaticDependencyInjection,RockFramework/Rock.StaticDependencyInjection
src/Properties/AssemblyInfo.cs
src/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("Rock.StaticDependencyInjection")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Rock.StaticDependencyInjection")] [assembly: AssemblyCopyright("Copyright © Quicken Loans 2014-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("6ce9fe22-010d-441a-b954-7c924537a503")] // 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.1.3")] [assembly: AssemblyInformationalVersion("1.1.3")]
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("Rock.StaticDependencyInjection")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Rock.StaticDependencyInjection")] [assembly: AssemblyCopyright("Copyright © Quicken Loans 2014-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("6ce9fe22-010d-441a-b954-7c924537a503")] // 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.1.2")] [assembly: AssemblyInformationalVersion("1.1.2")]
mit
C#
f4b69ceb8ae23ba438fd3230738b3b6e5469e0a1
Remove unused using embedded in reverted changes
smoogipoo/osu,NeoAdonis/osu,peppy/osu,peppy/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu,smoogipoo/osu,smoogipooo/osu,NeoAdonis/osu,ppy/osu,ppy/osu,peppy/osu-new
osu.Game/Overlays/BeatmapSet/BeatmapRulesetSelector.cs
osu.Game/Overlays/BeatmapSet/BeatmapRulesetSelector.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Bindables; using osu.Framework.Graphics.UserInterface; using osu.Game.Beatmaps; using osu.Game.Rulesets; using System.Linq; namespace osu.Game.Overlays.BeatmapSet { public class BeatmapRulesetSelector : OverlayRulesetSelector { protected override bool SelectInitialRuleset => false; private readonly Bindable<BeatmapSetInfo> beatmapSet = new Bindable<BeatmapSetInfo>(); public BeatmapSetInfo BeatmapSet { get => beatmapSet.Value; set { // propagate value to tab items first to enable only available rulesets. beatmapSet.Value = value; SelectTab(TabContainer.TabItems.FirstOrDefault(t => t.Enabled.Value)); } } protected override TabItem<RulesetInfo> CreateTabItem(RulesetInfo value) => new BeatmapRulesetTabItem(value) { BeatmapSet = { BindTarget = beatmapSet } }; } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Bindables; using osu.Framework.Graphics.UserInterface; using osu.Game.Beatmaps; using osu.Game.Rulesets; using System.Linq; using osu.Framework.Allocation; namespace osu.Game.Overlays.BeatmapSet { public class BeatmapRulesetSelector : OverlayRulesetSelector { protected override bool SelectInitialRuleset => false; private readonly Bindable<BeatmapSetInfo> beatmapSet = new Bindable<BeatmapSetInfo>(); public BeatmapSetInfo BeatmapSet { get => beatmapSet.Value; set { // propagate value to tab items first to enable only available rulesets. beatmapSet.Value = value; SelectTab(TabContainer.TabItems.FirstOrDefault(t => t.Enabled.Value)); } } protected override TabItem<RulesetInfo> CreateTabItem(RulesetInfo value) => new BeatmapRulesetTabItem(value) { BeatmapSet = { BindTarget = beatmapSet } }; } }
mit
C#
c271e0d4f1504a3b0fe65471cbeee6ca9fa7522a
Add ability to set or change the order of columns in markup
simonray/Acme.Helpers,simonray/Acme.Helpers
src/Acme.Helpers.Table/TagHelpers/Table/TableColumn.cs
src/Acme.Helpers.Table/TagHelpers/Table/TableColumn.cs
using Acme.Helpers.Core.Extensions; using Microsoft.AspNet.Mvc.ModelBinding; using System.Diagnostics; namespace Acme.Helpers.TagHelpers { [DebuggerDisplayAttribute("{Id}")] internal class TableColumn { public string Id { get; set; } public string For { get; set; } public int Order { get; set; } public string Title { get; set; } public string Style { get; set; } public string Width { get; set; } public string CellContent { get; set; } public string CellDisplayFormat { get; set; } public string CellNullDisplayText { get; set; } public string CellUihint { get; set; } public bool CellVisible { get; set; } public TableColumn() { CellVisible = true; } public TableColumn(ModelMetadata meta) : this() { Id = meta.PropertyName; For = meta.PropertyName; Order = meta.Order; Title = meta.DisplayName ?? meta.PropertyName.SplitCamelCase(); CellDisplayFormat = meta.DisplayFormatString; CellNullDisplayText = meta.NullDisplayText; CellUihint = meta.TemplateHint; CellVisible = !meta.HideSurroundingHtml; } public TableColumn(ISupportTableHeader th) : this() { Id = th.HeaderId ?? th.AspFor; For = th.AspFor; Order = th.HeaderOrder; Title = th.HeaderTitle ?? Id.SplitCamelCase(); Style = th.Style; Width = th.Width; CellDisplayFormat = th.CellDisplayFormat; CellNullDisplayText = th.CellNullDisplayText; CellUihint = th.CellUihint; CellVisible = th.CellVisible ?? true; CellContent = th.CellContent; } internal void Merge(TableColumn col) { Title = col.Title ?? Title; CellDisplayFormat = col.CellDisplayFormat ?? CellDisplayFormat; CellNullDisplayText = col.CellNullDisplayText ?? CellNullDisplayText; CellUihint = col.CellUihint ?? CellUihint; CellVisible = col.CellVisible; CellContent = col.CellContent; } } }
using Acme.Helpers.Core.Extensions; using Microsoft.AspNet.Mvc.ModelBinding; using System.Diagnostics; namespace Acme.Helpers.TagHelpers { [DebuggerDisplayAttribute("{Id}")] internal class TableColumn { public string Id { get; set; } public string For { get; set; } public string Title { get; set; } public string Style { get; set; } public string Width { get; set; } public string CellDisplayFormat { get; set; } public string CellNullDisplayText { get; set; } public string CellUihint { get; set; } public bool CellVisible { get; set; } public string CellContent { get; set; } public TableColumn() { CellVisible = true; } public TableColumn(ModelMetadata meta) : this() { Id = meta.PropertyName; For = meta.PropertyName; Title = meta.DisplayName ?? meta.PropertyName.SplitCamelCase(); CellDisplayFormat = meta.DisplayFormatString; CellNullDisplayText = meta.NullDisplayText; CellUihint = meta.TemplateHint; CellVisible = !meta.HideSurroundingHtml; } public TableColumn(ISupportTableHeader th) : this() { Id = th.HeaderId ?? th.AspFor; For = th.AspFor; Title = th.HeaderTitle ?? Id.SplitCamelCase(); Style = th.Style; Width = th.Width; CellDisplayFormat = th.CellDisplayFormat; CellNullDisplayText = th.CellNullDisplayText; CellUihint = th.CellUihint; CellVisible = th.CellVisible ?? true; CellContent = th.CellContent; } internal void Merge(TableColumn col) { Title = col.Title ?? Title; CellDisplayFormat = col.CellDisplayFormat ?? CellDisplayFormat; CellNullDisplayText = col.CellNullDisplayText ?? CellNullDisplayText; CellUihint = col.CellUihint ?? CellUihint; CellVisible = col.CellVisible; CellContent = col.CellContent; } } }
mit
C#
250ceae9862c10d18c254b50732901aca779b2ac
Change zone (fixes #15)
aelij/ConfigureAwaitChecker
src/Arbel.ReSharper.ConfigureAwaitPlugin/ZoneMarker.cs
src/Arbel.ReSharper.ConfigureAwaitPlugin/ZoneMarker.cs
using JetBrains.Application.BuildScript.Application.Zones; using JetBrains.ReSharper.Feature.Services.Daemon; using JetBrains.ReSharper.Psi.CSharp; namespace Arbel.ReSharper.ConfigureAwaitPlugin { [ZoneMarker] public class ZoneMarker : IRequire<ILanguageCSharpZone>, IRequire<DaemonEngineZone> { } }
using JetBrains.Application.BuildScript.Application.Zones; using JetBrains.ReSharper.Feature.Services; using JetBrains.ReSharper.Psi.CSharp; namespace Arbel.ReSharper.ConfigureAwaitPlugin { [ZoneMarker] public class ZoneMarker : IRequire<ICodeEditingZone>, IRequire<ILanguageCSharpZone> { } }
apache-2.0
C#
00112828a0224bdebae23f697c0b5314d72c183f
Fix for navigating to external content
gonzalocasas/NetMetrixSDK
NetMetrix.cs
NetMetrix.cs
using System; using System.Diagnostics; using System.Xml.Linq; using Microsoft.Phone.Controls; namespace NetMetrixSdk { public static class NetMetrix { private static readonly Tracker tracker = new Tracker { CookieStore = new CookieStore() }; public static string Host { get; set; } public static string OfferId { get; set; } public static string AppId { get; set; } static NetMetrix() { Host = Debugger.IsAttached ? "wemfbox-test.ch" : "wemfbox.ch"; var root = XDocument.Load(@"Properties\NetMetrix.xml").Root; if (root == null) throw new InvalidOperationException("No NetMetrix.xml configuration file found"); var offer = root.Element("OfferID"); if (offer == null || string.IsNullOrWhiteSpace(offer.Value)) throw new InvalidOperationException("OfferID missing in NetMetrix.xml"); OfferId = offer.Value; var app = root.Element("AppID"); if (app == null || string.IsNullOrWhiteSpace(app.Value)) throw new InvalidOperationException("AppID missing in NetMetrix.xml"); AppId = app.Value; } public static Tracker Tracker { get { return tracker; } } public static void EnableNavigationTracker(PhoneApplicationFrame appFrame) { appFrame.Navigated += (sender, args) => { // Content is null when navigating outside the app if (args.Content == null) return; var section = GetSectionName(args.Content); Tracker.Track(section); }; } private static string GetSectionName(object content) { var attribute = (NetMetrixAttribute)Attribute.GetCustomAttribute(content.GetType(), typeof(NetMetrixAttribute)); return attribute != null ? attribute.Section : Tracker.DefaultSection; } } }
using System; using System.Diagnostics; using System.Xml.Linq; using Microsoft.Phone.Controls; namespace NetMetrixSdk { public static class NetMetrix { private static readonly Tracker tracker = new Tracker { CookieStore = new CookieStore() }; public static string Host { get; set; } public static string OfferId { get; set; } public static string AppId { get; set; } static NetMetrix() { Host = Debugger.IsAttached ? "wemfbox-test.ch" : "wemfbox.ch"; var root = XDocument.Load(@"Properties\NetMetrix.xml").Root; if (root == null) throw new InvalidOperationException("No NetMetrix.xml configuration file found"); var offer = root.Element("OfferID"); if (offer == null || string.IsNullOrWhiteSpace(offer.Value)) throw new InvalidOperationException("OfferID missing in NetMetrix.xml"); OfferId = offer.Value; var app = root.Element("AppID"); if (app == null || string.IsNullOrWhiteSpace(app.Value)) throw new InvalidOperationException("AppID missing in NetMetrix.xml"); AppId = app.Value; } public static Tracker Tracker { get { return tracker; } } public static void EnableNavigationTracker(PhoneApplicationFrame appFrame) { appFrame.Navigated += (sender, args) => { var section = GetSectionName(args.Content); Tracker.Track(section); }; } private static string GetSectionName(object content) { var attribute = (NetMetrixAttribute)Attribute.GetCustomAttribute(content.GetType(), typeof(NetMetrixAttribute)); return attribute != null ? attribute.Section : Tracker.DefaultSection; } } }
mit
C#
57ebcc03c238b6075c5a2637aaddf86734acfeae
Update VerifyContentMatchesAttribute to use new verification functionality
atata-framework/atata,atata-framework/atata,YevgeniyShunevych/Atata,YevgeniyShunevych/Atata
src/Atata/Attributes/Triggers/VerifyContentMatchesAttribute.cs
src/Atata/Attributes/Triggers/VerifyContentMatchesAttribute.cs
namespace Atata { public class VerifyContentMatchesAttribute : TriggerAttribute { public VerifyContentMatchesAttribute(TermMatch match, params string[] values) : base(TriggerEvents.OnPageObjectInit) { Values = values; Match = match; } public new TermMatch Match { get; set; } public string[] Values { get; private set; } public override void Execute<TOwner>(TriggerContext<TOwner> context) { context.Component.Content.Should.WithRetry.MatchAny(Match, Values); } } }
namespace Atata { public class VerifyContentMatchesAttribute : TriggerAttribute { public VerifyContentMatchesAttribute(TermMatch match, params string[] values) : base(TriggerEvents.OnPageObjectInit) { Values = values; Match = match; } public new TermMatch Match { get; set; } public string[] Values { get; private set; } public override void Execute<TOwner>(TriggerContext<TOwner> context) { context.Component.Content.VerifyUntilMatchesAny(Match, Values); } } }
apache-2.0
C#
f0568150e1c14743d86e119591f54a7531be1b42
Add mapping for instance to Singleton<T, U>
ethanmoffat/XNAControls
Singleton.cs
Singleton.cs
// Original Work Copyright (c) Ethan Moffat 2014-2016 // This file is subject to the GPL v2 License // For additional details, see the LICENSE file using System; using System.Collections.Generic; namespace XNAControls { internal class Singleton<T> : Singleton where T : class { public static T Instance => (T)_typeMap[typeof(T)]; public static void Map(T instance) { var typeKey = typeof(T); if (_typeMap.ContainsKey(typeKey)) _typeMap.Remove(typeKey); _typeMap.Add(typeKey, instance); } public static void MapIfMissing(T instance) { if (!_typeMap.ContainsKey(typeof(T))) Map(instance); } } internal class Singleton<T, U> : Singleton where U : class, T, new() { public static void Map() { Map(new U()); } internal static void Map(U instance) { var typeKey = typeof(T); if (_typeMap.ContainsKey(typeKey)) _typeMap.Remove(typeKey); _typeMap.Add(typeKey, instance); } } internal class Singleton { protected static readonly Dictionary<Type, object> _typeMap = new Dictionary<Type, object>(); } }
// Original Work Copyright (c) Ethan Moffat 2014-2016 // This file is subject to the GPL v2 License // For additional details, see the LICENSE file using System; using System.Collections.Generic; namespace XNAControls { internal class Singleton<T> : Singleton where T : class { public static T Instance => (T)_typeMap[typeof(T)]; public static void Map(T instance) { var typeKey = typeof(T); if (_typeMap.ContainsKey(typeKey)) _typeMap.Remove(typeKey); _typeMap.Add(typeKey, instance); } public static void MapIfMissing(T instance) { if (!_typeMap.ContainsKey(typeof(T))) Map(instance); } } internal class Singleton<T, U> : Singleton where U : class, T, new() { public static void Map() { var typeKey = typeof(T); if (_typeMap.ContainsKey(typeKey)) _typeMap.Remove(typeKey); _typeMap.Add(typeKey, new U()); } } internal class Singleton { protected static readonly Dictionary<Type, object> _typeMap = new Dictionary<Type, object>(); } }
mit
C#
a04c11d1faf3423e426fe40476b37421c4a3850c
fix bug in .net 4.5 which causes packages to be created incorrectly.
dsplaisted/NuGetPackageExplorer,NuGetPackageExplorer/NuGetPackageExplorer,NuGetPackageExplorer/NuGetPackageExplorer,BreeeZe/NuGetPackageExplorer,campersau/NuGetPackageExplorer
Core/Utility/UriUtility.cs
Core/Utility/UriUtility.cs
using System; using System.IO; using System.IO.Packaging; namespace NuGet { internal static class UriUtility { /// <summary> /// Converts a uri to a path. Only used for local paths. /// </summary> internal static string GetPath(Uri uri) { string path = uri.OriginalString; if (path.StartsWith("/", StringComparison.Ordinal)) { path = path.Substring(1); } // Bug 483: We need the unescaped uri string to ensure that all characters are valid for a path. // Change the direction of the slashes to match the filesystem. return Uri.UnescapeDataString(path.Replace('/', Path.DirectorySeparatorChar)); } internal static Uri CreatePartUri(string path) { var uri = new Uri(path, UriKind.Relative); return PackUriHelper.CreatePartUri(uri); } internal static Uri GetRootUri(Uri uri) { return new Uri(uri.GetComponents(UriComponents.SchemeAndServer, UriFormat.SafeUnescaped)); } } }
using System; using System.IO; using System.IO.Packaging; namespace NuGet { internal static class UriUtility { /// <summary> /// Converts a uri to a path. Only used for local paths. /// </summary> internal static string GetPath(Uri uri) { string path = uri.OriginalString; if (path.StartsWith("/", StringComparison.Ordinal)) { path = path.Substring(1); } // Bug 483: We need the unescaped uri string to ensure that all characters are valid for a path. // Change the direction of the slashes to match the filesystem. return Uri.UnescapeDataString(path.Replace('/', Path.DirectorySeparatorChar)); } internal static Uri CreatePartUri(string path) { return PackUriHelper.CreatePartUri(new Uri(Uri.EscapeDataString(path), UriKind.Relative)); } internal static Uri GetRootUri(Uri uri) { return new Uri(uri.GetComponents(UriComponents.SchemeAndServer, UriFormat.SafeUnescaped)); } } }
mit
C#
2e418214688ac1b2105d609fd8c225024d87af02
update version number
wanlitao/NExpressionTranslator
ExprTranslator.Query/Properties/AssemblyInfo.cs
ExprTranslator.Query/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的常规信息通过以下 // 特性集控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("ExprTranslator.Query")] [assembly: AssemblyDescription("dotnet expression translator")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("GreatBillows")] [assembly: AssemblyProduct("NExprTranslator")] [assembly: AssemblyCopyright("Copyright © GreatBillows 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 使此程序集中的类型 // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, // 则将该类型上的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("e027987d-ab29-4415-85d5-6880395ce3c3")] // 程序集的版本信息由下面四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.4")] [assembly: AssemblyFileVersion("1.0.0.4")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的常规信息通过以下 // 特性集控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("ExprTranslator.Query")] [assembly: AssemblyDescription("dotnet expression translator")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("GreatBillows")] [assembly: AssemblyProduct("NExprTranslator")] [assembly: AssemblyCopyright("Copyright © GreatBillows 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 使此程序集中的类型 // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, // 则将该类型上的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("e027987d-ab29-4415-85d5-6880395ce3c3")] // 程序集的版本信息由下面四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.3")] [assembly: AssemblyFileVersion("1.0.0.3")]
apache-2.0
C#
c68f579253e2d98d3e08668889a372132a2af152
Add TextTags properties to request data
kwokhou/HelloSignNet
HelloSignNet.Core/HSSendSignatureRequestData.cs
HelloSignNet.Core/HSSendSignatureRequestData.cs
using System.Collections.Generic; using System.IO; using System.Linq; namespace HelloSignNet.Core { public class HSSendSignatureRequestData { public string Title { get; set; } public string Subject { get; set; } public string Message { get; set; } public string SigningRedirectUrl { get; set; } public List<HSSigner> Signers { get; set; } public List<string> CcEmailAddresses { get; set; } public List<FileInfo> Files { get; set; } public List<string> FileUrls { get; set; } public int TestMode { get; set; } // true=1, false=0, default=0 public int UseTextTags { get; set; } // true=1, false=0, default=0 public int HideTextTags { get; set; } // true=1, false=0, default=0 public bool IsValid { get { if (Files == null && FileUrls == null) { return false; } // API does not accept both files param in a request if (Files != null && FileUrls != null && Files.Any() && FileUrls.Any()) return false; if (Files != null && FileUrls == null) { if (!Files.Any()) return false; } if (Files == null && FileUrls != null) { if (!FileUrls.Any()) return false; } if (Signers == null || Signers.Count == 0) return false; if (Signers.Any(s => string.IsNullOrEmpty(s.Name) || string.IsNullOrEmpty(s.EmailAddress))) return false; return true; } } } }
using System.Collections.Generic; using System.IO; using System.Linq; namespace HelloSignNet.Core { public class HSSendSignatureRequestData { public string Title { get; set; } public string Subject { get; set; } public string Message { get; set; } public string SigningRedirectUrl { get; set; } public List<HSSigner> Signers { get; set; } public List<string> CcEmailAddresses { get; set; } public List<FileInfo> Files { get; set; } public List<string> FileUrls { get; set; } public int TestMode { get; set; } // true=1, false=0 public bool IsValid { get { if (Files == null && FileUrls == null) { return false; } if (Files != null && FileUrls == null) { if (!Files.Any()) return true; } if (Files == null && FileUrls != null) { if (!FileUrls.Any()) return false; } if (Signers == null || Signers.Count == 0) return false; if (Signers.Any(s => string.IsNullOrEmpty(s.Name) || string.IsNullOrEmpty(s.EmailAddress))) return false; return true; } } } }
mit
C#
78037f891227f075d01f570b2fc65cf3de178e56
Fix bug with answering on masters post on forums
joinrpg/joinrpg-net,leotsarev/joinrpg-net,leotsarev/joinrpg-net,joinrpg/joinrpg-net,kirillkos/joinrpg-net,leotsarev/joinrpg-net,joinrpg/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net,kirillkos/joinrpg-net
Joinrpg/Views/Comments/AddCommentPartial.cshtml
Joinrpg/Views/Comments/AddCommentPartial.cshtml
@model JoinRpg.Web.Models.AddCommentViewModel @{ Model.ActionName = Model.ActionName ?? "Отправить"; } @Html.AntiForgeryToken() <div class="form-horizontal"> @Html.ValidationSummary(true, "", new { @class = "text-danger" }) @Html.HiddenFor(model => model.ProjectId) @Html.HiddenFor(model => model.CommentDiscussionId) @Html.HiddenFor(model => model.ParentCommentId) <div class="form-group"> @Html.LabelFor(model => model.CommentText, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.CommentText, new { htmlAttributes = new { @class = "form-control" } }) </div> </div> @if (Model.EnableHideFromUser && !Model.EnableFinanceAction) { <div class="form-group"> @Html.LabelFor(model => model.HideFromUser, htmlAttributes: new {@class = "control-label col-md-2"}) <div class="col-md-10"> <div class="checkbox"> @if (Model.HideFromUser) { @Html.DisplayFor(model => model.HideFromUser) @Html.HiddenFor(model => model.HideFromUser) } else { @Html.CheckBoxFor(model => model.HideFromUser) } </div> </div> </div> } @if (Model.EnableFinanceAction) { <div class="form-group"> @Html.LabelFor(model => model.FinanceAction, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> <div class="checkbox"> <div class="col-md-10"> @Html.EditorFor(model => model.FinanceAction, new { htmlAttributes = new { @class = "form-control" } }) </div> </div> </div> </div> } <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="@Model.ActionName" class="btn btn-success" /> </div> </div> </div>
@model JoinRpg.Web.Models.AddCommentViewModel @{ Model.ActionName = Model.ActionName ?? "Отправить"; } @Html.AntiForgeryToken() <div class="form-horizontal"> @Html.ValidationSummary(true, "", new { @class = "text-danger" }) @Html.HiddenFor(model => model.ProjectId) @Html.HiddenFor(model => model.CommentDiscussionId) @Html.HiddenFor(model => model.ParentCommentId) <div class="form-group"> @Html.LabelFor(model => model.CommentText, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.CommentText, new { htmlAttributes = new { @class = "form-control" } }) </div> </div> @if (Model.EnableHideFromUser && !Model.EnableFinanceAction) { <div class="form-group"> @Html.LabelFor(model => model.HideFromUser, htmlAttributes: new {@class = "control-label col-md-2"}) <div class="col-md-10"> <div class="checkbox"> @(!Model.HideFromUser ? Html.CheckBoxFor(model => model.HideFromUser) : Html.DisplayFor(model => model.HideFromUser)) </div> </div> </div> } @if (Model.EnableFinanceAction) { <div class="form-group"> @Html.LabelFor(model => model.FinanceAction, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> <div class="checkbox"> <div class="col-md-10"> @Html.EditorFor(model => model.FinanceAction, new { htmlAttributes = new { @class = "form-control" } }) </div> </div> </div> </div> } <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="@Model.ActionName" class="btn btn-success" /> </div> </div> </div>
mit
C#
725cc85ac8b775a7a88091fa3fa8b728532674c1
Fix TimestampProvider tests.
ilya-chumakov/LoggingAdvanced
Bodrocode.LoggingAdvanced.Console.Test/TimestampProviderTest.cs
Bodrocode.LoggingAdvanced.Console.Test/TimestampProviderTest.cs
using System; using Bodrocode.LoggingAdvanced.Console.Timestamps; using Moq; using Xunit; namespace Bodrocode.LoggingAdvanced.Console.Test { public class TimestampProviderTest { private static TimestampProvider CreateIsolatedTimestampProvider(DateTime now) { var mock = new Mock<IDateTimeProvider>(); mock.Setup(x => x.Now()).Returns(now); return new TimestampProvider(mock.Object); } [Theory] [InlineData(null, "UTC", "[01/02/2000 03:04:05]")] [InlineData(null, "Ulaanbaatar Standard Time", "[01/02/2000 11:04:05]")] [InlineData("MM/dd/yyyy HH:mm:ss.fff", "UTC", "[01/02/2000 03:04:05.006]")] [InlineData("yyyy.MM.dd HH:mm:ss", "UTC", "[2000.01.02 03:04:05]")] public void GetTimestamp_InlineData_Test(string format, string timezone, string expected) { var now = new DateTime(2000, 1, 2, 3, 4, 5, 6, DateTimeKind.Utc); var provider = CreateIsolatedTimestampProvider(now); var policy = new TimestampPolicy { Format = format, TimeZone = timezone }; string actual = provider.GetTimestamp(policy); Assert.Equal(expected, actual); } [Fact] public void GetTimestamp_Local_Test() { var now = new DateTime(2000, 1, 2, 3, 4, 5, 6, DateTimeKind.Local); var provider = CreateIsolatedTimestampProvider(now); var policy = new TimestampPolicy { TimeZone = "Local" }; string actual = provider.GetTimestamp(policy); string expected = $"[{now.ToString(policy.Format)}]"; Assert.Equal(expected, actual); } } }
using System; using Bodrocode.LoggingAdvanced.Console.Timestamps; using Moq; using Xunit; namespace Bodrocode.LoggingAdvanced.Console.Test { public class TimestampProviderTest { [Theory] [InlineData(null, "UTC", "[01/02/2000 00:04:05]")] [InlineData(null, "Local", "[01/02/2000 03:04:05]")] [InlineData(null, "Ulaanbaatar Standard Time", "[01/02/2000 08:04:05]")] [InlineData("MM/dd/yyyy HH:mm:ss.fff", "Local", "[01/02/2000 03:04:05.006]")] [InlineData("yyyy.MM.dd HH:mm:ss", "Local", "[2000.01.02 03:04:05]")] public void GetTimestamp_Test(string format, string timezone, string expected) { var now = new DateTime(2000, 1, 2, 3, 4, 5, 6); var mock = new Mock<IDateTimeProvider>(); mock.Setup(x => x.Now()).Returns(now); var provider = new TimestampProvider(mock.Object); var policy = new TimestampPolicy { Format = format, TimeZone = timezone }; string datetime = provider.GetTimestamp(policy); Assert.Equal(expected, datetime); } } }
apache-2.0
C#
9060f30cc0b19b550f7967986ab1528de9c61e27
Fix a LogList link
codingteam/codingteam.org.ru,codingteam/codingteam.org.ru
Views/Home/Resources.cshtml
Views/Home/Resources.cshtml
<h1>Resources</h1> <p>Here is a list of codingteam affiliated online resources:</p> <ul class="fa-ul"> <li> <a href="https://github.com/codingteam/"> <i class="fa-li fa fa-github"></i> GitHub organization </a> </li> <li> <a href="xmpp:codingteam@conference.jabber.ru?join"> <i class="fa-li fa fa-lightbulb-o"></i> XMPP conference </a> </li> <li> <a href="xmpp:codingteam@conference.codingteam.org.ru?join"> <i class="fa-li fa fa-lightbulb-o"></i> XMPP conference (backup channel) </a> </li> <li> <a href="https://gitter.im/codingteam"> <i class="fa-li fa fa-users"></i> Gitter room </a> </li> <li> <a href="https://bitbucket.org/codingteam"> <i class="fa-li fa fa-bitbucket"></i> Bitbucket team </a> </li> <li> <a href="https://gitlab.com/groups/codingteam"> <i class="fa-li fa fa-code-fork"></i> GitLab team </a> </li> <li> <a href="https://loglist.xyz/"> <i class="fa-li fa fa-ambulance"></i> LogList </a> </li> <li> <a href="https://t.me/codingteam"> <i class="fa-li fa fa-envelope-o"></i> Telegram group </a> </li> </ul>
<h1>Resources</h1> <p>Here is a list of codingteam affiliated online resources:</p> <ul class="fa-ul"> <li> <a href="https://github.com/codingteam/"> <i class="fa-li fa fa-github"></i> GitHub organization </a> </li> <li> <a href="xmpp:codingteam@conference.jabber.ru?join"> <i class="fa-li fa fa-lightbulb-o"></i> XMPP conference </a> </li> <li> <a href="xmpp:codingteam@conference.codingteam.org.ru?join"> <i class="fa-li fa fa-lightbulb-o"></i> XMPP conference (backup channel) </a> </li> <li> <a href="https://gitter.im/codingteam"> <i class="fa-li fa fa-users"></i> Gitter room </a> </li> <li> <a href="https://bitbucket.org/codingteam"> <i class="fa-li fa fa-bitbucket"></i> Bitbucket team </a> </li> <li> <a href="https://gitlab.com/groups/codingteam"> <i class="fa-li fa fa-code-fork"></i> GitLab team </a> </li> <li> <a href="https://loglist.net/"> <i class="fa-li fa fa-ambulance"></i> LogList </a> </li> <li> <a href="https://t.me/codingteam"> <i class="fa-li fa fa-envelope-o"></i> Telegram group </a> </li> </ul>
mit
C#
60e3428024a743f0f5472f0e5a59bfbf9cdbceae
Add freeform extra properties to HiveServerConfig
mooso/BlueCoffee,mooso/BlueCoffee,mooso/BlueCoffee,mooso/BlueCoffee
Libraries/Microsoft.Experimental.Azure.Hive/HiveServerConfig.cs
Libraries/Microsoft.Experimental.Azure.Hive/HiveServerConfig.cs
using Microsoft.Experimental.Azure.JavaPlatform; using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Microsoft.Experimental.Azure.Hive { /// <summary> /// Configuration for a Hive server. /// </summary> public sealed class HiveServerConfig : HadoopStyleXmlConfig { private readonly int _port; private readonly string _metastoreUris; private readonly ImmutableDictionary<string, string> _extraProperties; /// <summary> /// Creates the config. /// </summary> /// <param name="port">The port to listen on.</param> /// <param name="metastoreUris">The URI of the metastore service to connect to.</param> /// <param name="extraProperties">Any extra configuration properties to set.</param> public HiveServerConfig(int port, string metastoreUris, ImmutableDictionary<string, string> extraProperties = null) { _port = port; _metastoreUris = metastoreUris; _extraProperties = extraProperties ?? ImmutableDictionary<string, string>.Empty; } /// <summary> /// The configuration properties. /// </summary> protected override IEnumerable<KeyValuePair<string, string>> ConfigurationProperties { get { return _extraProperties.Concat(new Dictionary<string, string>() { { "hive.metastore.uris", _metastoreUris }, { "hive.server2.thrift.port", _port.ToString() }, }); } } } }
using Microsoft.Experimental.Azure.JavaPlatform; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Microsoft.Experimental.Azure.Hive { /// <summary> /// Configuration for a Hive server. /// </summary> public sealed class HiveServerConfig : HadoopStyleXmlConfig { private readonly int _port; private readonly string _metastoreUris; /// <summary> /// Creates the config. /// </summary> /// <param name="port">The port to listen on.</param> /// <param name="metastoreUris">The URI of the metastore service to connect to.</param> public HiveServerConfig(int port, string metastoreUris) { _port = port; _metastoreUris = metastoreUris; } /// <summary> /// The configuration properties. /// </summary> protected override IEnumerable<KeyValuePair<string, string>> ConfigurationProperties { get { return new Dictionary<string, string>() { { "hive.metastore.uris", _metastoreUris }, { "hive.server2.thrift.port", _port.ToString() }, }; } } } }
mit
C#
525d01e0549f46e0f96245808d15bdfe75e3b826
Add item index for multiple items with same name
pleonex/Ninokuni,pleonex/Ninokuni,pleonex/Ninokuni
Programs/Downlitor/Downlitor/ItemInfoControl.cs
Programs/Downlitor/Downlitor/ItemInfoControl.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; namespace Downlitor { public partial class ItemInfoControl : UserControl { public ItemInfoControl(DlcItem dlc) { InitializeComponent(); var manager = ItemManager.Instance; for (int i = 0; i < ItemManager.NumEntries; i++) { var item = manager.GetItem(i); comboItems.Items.Add((item == null) ? "Invalid" : item + " (" + i.ToString("D3") + ")"); } comboItems.SelectedIndex = dlc.Index; comboItems.AutoCompleteMode = AutoCompleteMode.Suggest; comboItems.AutoCompleteSource = AutoCompleteSource.ListItems; comboItems.SelectedIndexChanged += delegate { if ((string)comboItems.SelectedItem == "Invalid") return; dlc.Index = (ushort)comboItems.SelectedIndex; }; } } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; namespace Downlitor { public partial class ItemInfoControl : UserControl { public ItemInfoControl(DlcItem dlc) { InitializeComponent(); var manager = ItemManager.Instance; for (int i = 0; i < ItemManager.NumEntries; i++) { var item = manager.GetItem(i); comboItems.Items.Add((item == null) ? "Invalid" : item); } comboItems.SelectedIndex = dlc.Index; comboItems.AutoCompleteMode = AutoCompleteMode.Suggest; comboItems.AutoCompleteSource = AutoCompleteSource.ListItems; comboItems.SelectedIndexChanged += delegate { if ((string)comboItems.SelectedItem == "Invalid") return; dlc.Index = (ushort)comboItems.SelectedIndex; }; } } }
apache-2.0
C#
f0b6180e60226ddc578f3e6d7cae6897672b779c
Revert "Multiple ininitialisations"
agileobjects/ReadableExpressions
ReadableExpressions.UnitTests/WhenTranslatingObjectCreations.cs
ReadableExpressions.UnitTests/WhenTranslatingObjectCreations.cs
namespace AgileObjects.ReadableExpressions.UnitTests { using System; using System.IO; using System.Linq.Expressions; using Microsoft.VisualStudio.TestTools.UnitTesting; [TestClass] public class WhenTranslatingObjectCreations { [TestMethod] public void ShouldTranslateAParameterlessNewExpression() { Expression<Func<object>> createObject = () => new object(); var translated = createObject.ToReadableString(); Assert.AreEqual("() => new Object()", translated); } [TestMethod] public void ShouldTranslateANewExpressionWithParameters() { Expression<Func<DateTime>> createToday = () => new DateTime(2014, 08, 23); var translated = createToday.ToReadableString(); Assert.AreEqual("() => new DateTime(2014, 8, 23)", translated); } [TestMethod] public void ShouldTranslateANewExpressionWithInitialisation() { Expression<Func<MemoryStream>> createToday = () => new MemoryStream { Position = 0 }; var translated = createToday.ToReadableString(); const string EXPECTED = @"() => new MemoryStream { Position = 0 }"; Assert.AreEqual(EXPECTED, translated); } } }
namespace AgileObjects.ReadableExpressions.UnitTests { using System; using System.IO; using System.Linq.Expressions; using Microsoft.VisualStudio.TestTools.UnitTesting; [TestClass] public class WhenTranslatingObjectCreations { [TestMethod] public void ShouldTranslateAParameterlessNewExpression() { Expression<Func<object>> createObject = () => new object(); var translated = createObject.ToReadableString(); Assert.AreEqual("() => new Object()", translated); } [TestMethod] public void ShouldTranslateANewExpressionWithParameters() { Expression<Func<DateTime>> createToday = () => new DateTime(2014, 08, 23); var translated = createToday.ToReadableString(); Assert.AreEqual("() => new DateTime(2014, 8, 23)", translated); } [TestMethod] public void ShouldTranslateANewExpressionWithInitialisation() { Expression<Func<MemoryStream>> createToday = () => new MemoryStream { Position = 0 }; var translated = createToday.ToReadableString(); const string EXPECTED = @"() => new MemoryStream { Position = 0 }"; Assert.AreEqual(EXPECTED, translated); } [TestMethod] public void ShouldTranslateANewExpressionWithMultipleInitialisations() { Expression<Func<MemoryStream>> createToday = () => new MemoryStream { Capacity = 10000, Position = 100 }; var translated = createToday.ToReadableString(); const string EXPECTED = @"() => new MemoryStream { Capacity = 10000, Position = 100 }"; Assert.AreEqual(EXPECTED, translated); } } }
mit
C#
4d4762699dfe41ed843d4cb140e92d34279aa1f1
Remove redundancy in MachineControlsViewModelTests.
ryanjfitz/SimpSim.NET
SimpSim.NET.Presentation.Tests/MachineControlsViewModelTests.cs
SimpSim.NET.Presentation.Tests/MachineControlsViewModelTests.cs
using NUnit.Framework; using SimpSim.NET.Presentation.ViewModels; namespace SimpSim.NET.Presentation.Tests { [TestFixture] public class MachineControlsViewModelTests { private SimpleSimulator _simulator; private MachineControlsViewModel _viewModel; [SetUp] public void SetUp() { _simulator = new SimpleSimulator(); _viewModel = new MachineControlsViewModel(_simulator); } [Test] public void ClearMemoryCommandShouldClearMemory() { for (int i = 0; i <= byte.MaxValue; i++) _simulator.Memory[(byte)i] = 0xFF; _viewModel.ClearMemoryCommand.Execute(null); for (int i = 0; i <= byte.MaxValue; i++) Assert.AreEqual(0x00, _simulator.Memory[(byte)i]); } [Test] public void ClearRegistersCommandShouldClearRegisters() { for (byte b = 0; b <= 0x0F; b++) _simulator.Registers[b] = 0xFF; _viewModel.ClearRegistersCommand.Execute(null); for (byte b = 0; b <= 0x0F; b++) Assert.AreEqual(0x00, _simulator.Registers[b]); } } }
using NUnit.Framework; using SimpSim.NET.Presentation.ViewModels; namespace SimpSim.NET.Presentation.Tests { [TestFixture] public class MachineControlsViewModelTests { private SimpleSimulator _simulator; [SetUp] public void SetUp() { _simulator = new SimpleSimulator(); } [Test] public void ClearMemoryCommandShouldClearMemory() { for (int i = 0; i <= byte.MaxValue; i++) _simulator.Memory[(byte)i] = 0xFF; MachineControlsViewModel viewModel = new MachineControlsViewModel(_simulator); viewModel.ClearMemoryCommand.Execute(null); for (int i = 0; i <= byte.MaxValue; i++) Assert.AreEqual(0x00, _simulator.Memory[(byte)i]); } [Test] public void ClearRegistersCommandShouldClearRegisters() { for (byte b = 0; b <= 0x0F; b++) _simulator.Registers[b] = 0xFF; MachineControlsViewModel viewModel = new MachineControlsViewModel(_simulator); viewModel.ClearRegistersCommand.Execute(null); for (byte b = 0; b <= 0x0F; b++) Assert.AreEqual(0x00, _simulator.Registers[b]); } } }
mit
C#
d24f3e5438c300242d553e81817b57045f00bf4f
Fix ProgressBar renderer (#439)
Hitcents/Xamarin.Forms,Hitcents/Xamarin.Forms,Hitcents/Xamarin.Forms
Xamarin.Forms.Platform.Android/Renderers/ProgressBarRenderer.cs
Xamarin.Forms.Platform.Android/Renderers/ProgressBarRenderer.cs
using System.ComponentModel; using AProgressBar = Android.Widget.ProgressBar; namespace Xamarin.Forms.Platform.Android { public class ProgressBarRenderer : ViewRenderer<ProgressBar, AProgressBar> { public ProgressBarRenderer() { AutoPackage = false; } protected override AProgressBar CreateNativeControl() { return new AProgressBar(Context, null, global::Android.Resource.Attribute.ProgressBarStyleHorizontal) { Indeterminate = false, Max = 10000 }; } protected override void OnElementChanged(ElementChangedEventArgs<ProgressBar> e) { base.OnElementChanged(e); if (e.NewElement != null) { if (Control == null) { var progressBar = CreateNativeControl(); SetNativeControl(progressBar); } UpdateProgress(); } } protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) { base.OnElementPropertyChanged(sender, e); if (e.PropertyName == ProgressBar.ProgressProperty.PropertyName) UpdateProgress(); } void UpdateProgress() { Control.Progress = (int)(Element.Progress * 10000); } } }
using System.ComponentModel; using AProgressBar = Android.Widget.ProgressBar; namespace Xamarin.Forms.Platform.Android { public class ProgressBarRenderer : ViewRenderer<ProgressBar, AProgressBar> { public ProgressBarRenderer() { AutoPackage = false; } protected override AProgressBar CreateNativeControl() { return new AProgressBar(Context, null, global::Android.Resource.Attribute.ProgressBarStyleHorizontal) { Indeterminate = false, Max = 10000 }; } protected override void OnElementChanged(ElementChangedEventArgs<ProgressBar> e) { base.OnElementChanged(e); if (e.OldElement == null) { var progressBar = CreateNativeControl(); SetNativeControl(progressBar); } UpdateProgress(); } protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) { base.OnElementPropertyChanged(sender, e); if (e.PropertyName == ProgressBar.ProgressProperty.PropertyName) UpdateProgress(); } void UpdateProgress() { Control.Progress = (int)(Element.Progress * 10000); } } }
mit
C#
8b771134ea5fa50e8143b9fc1edd71680ab93055
Add all bounding boxes for the Xmas Candy.
Noxalus/Xmas-Hell
Xmas-Hell/Xmas-Hell-Core/Entities/Bosses/XmasCandy/XmasCandy.cs
Xmas-Hell/Xmas-Hell-Core/Entities/Bosses/XmasCandy/XmasCandy.cs
using BulletML; using Microsoft.Xna.Framework; using XmasHell.Physics.Collision; namespace XmasHell.Entities.Bosses.XmasCandy { class XmasCandy : Boss { public XmasCandy(XmasHell game, PositionDelegate playerPositionDelegate) : base(game, playerPositionDelegate) { InitialLife = 500f; // BulletML // Behaviours Behaviours.Add(new XmasCandyBehaviour1(this)); SpriterFilename = "Graphics/Sprites/Bosses/XmasCandy/xmas-candy"; } protected override void LoadSpriterSprite() { base.LoadSpriterSprite(); CurrentAnimator.StretchOut = false; } protected override void InitializePhysics() { base.InitializePhysics(); // Top part Game.GameManager.CollisionWorld.AddBossHitBox(new SpriterCollisionCircle(this, "body.png", new Vector2(-60, 20), 0.3f)); Game.GameManager.CollisionWorld.AddBossHitBox(new SpriterCollisionCircle(this, "body.png", new Vector2(-55, -20), 0.3f)); Game.GameManager.CollisionWorld.AddBossHitBox(new SpriterCollisionCircle(this, "body.png", new Vector2(-20, -50), 0.3f)); Game.GameManager.CollisionWorld.AddBossHitBox(new SpriterCollisionCircle(this, "body.png", new Vector2(20, -50), 0.3f)); Game.GameManager.CollisionWorld.AddBossHitBox(new SpriterCollisionCircle(this, "body.png", new Vector2(55, -20), 0.3f)); Game.GameManager.CollisionWorld.AddBossHitBox(new SpriterCollisionCircle(this, "body.png", new Vector2(60, 20), 0.3f)); Game.GameManager.CollisionWorld.AddBossHitBox(new SpriterCollisionCircle(this, "body.png", new Vector2(60, 60), 0.3f)); Game.GameManager.CollisionWorld.AddBossHitBox(new SpriterCollisionConvexPolygon(this, "body2.png")); Game.GameManager.CollisionWorld.AddBossHitBox(new SpriterCollisionCircle(this, "body3.png")); } protected override void UpdateBehaviourIndex() { base.UpdateBehaviourIndex(); } } }
using BulletML; using XmasHell.Physics.Collision; namespace XmasHell.Entities.Bosses.XmasCandy { class XmasCandy : Boss { public XmasCandy(XmasHell game, PositionDelegate playerPositionDelegate) : base(game, playerPositionDelegate) { InitialLife = 500f; // BulletML // Behaviours Behaviours.Add(new XmasCandyBehaviour1(this)); SpriterFilename = "Graphics/Sprites/Bosses/XmasCandy/xmas-candy"; } protected override void LoadSpriterSprite() { base.LoadSpriterSprite(); CurrentAnimator.StretchOut = false; } protected override void InitializePhysics() { base.InitializePhysics(); Game.GameManager.CollisionWorld.AddBossHitBox(new SpriterCollisionCircle(this, "body.png")); // TODO: Create 3 rectangle bounding boxes for the body.png part // and one rectangle bounding box for each body2.png and body3.png parts } protected override void UpdateBehaviourIndex() { base.UpdateBehaviourIndex(); } } }
mit
C#
f3501609633c38b8873f606875417174a88d5f51
Add some dumy fix
michael-reichenauer/GitMind
GitMind/GitModel/Branch.cs
GitMind/GitModel/Branch.cs
using System.Collections.Generic; using System.Linq; namespace GitMind.GitModel { // Some extra Branch and some internal class Branch { private readonly Repository repository; private readonly string tipCommitId; private readonly string firstCommitId; private readonly string parentCommitId; private readonly IReadOnlyList<string> commitIds; private readonly string parentBranchId; public Branch( Repository repository, string id, string name, string tipCommitId, string firstCommitId, string parentCommitId, IReadOnlyList<string> commitIds, string parentBranchId, IReadOnlyList<string> childBranchNames, bool isActive, bool isMultiBranch, int localAheadCount, int remoteAheadCount) { this.repository = repository; this.tipCommitId = tipCommitId; this.firstCommitId = firstCommitId; this.parentCommitId = parentCommitId; this.commitIds = commitIds; this.parentBranchId = parentBranchId; Id = id; Name = name; ChildBranchNames = childBranchNames; IsActive = isActive; IsMultiBranch = isMultiBranch; LocalAheadCount = localAheadCount; RemoteAheadCount = remoteAheadCount; } public string Id { get; } public string Name { get; } public IReadOnlyList<string> ChildBranchNames { get; } public bool IsActive { get; } public bool IsMultiBranch { get; } public int LocalAheadCount { get; } public int RemoteAheadCount { get; } public Commit TipCommit => repository.Commits[tipCommitId]; public Commit FirstCommit => repository.Commits[firstCommitId]; public Commit ParentCommit => repository.Commits[parentCommitId]; public IEnumerable<Commit> Commits => commitIds.Select(id => repository.Commits[id]); public bool HasParentBranch => parentBranchId != null; public Branch ParentBranch => repository.Branches[parentBranchId]; public bool IsCurrentBranch => repository.CurrentBranch == this; public bool IsMergeable => IsCurrentBranch && repository.Status.ConflictCount == 0 && repository.Status.StatusCount == 0; public IEnumerable<Branch> GetChildBranches() { foreach (Branch branch in repository.Branches .Where(b => b.HasParentBranch && b.ParentBranch == this) .Distinct() .OrderByDescending(b => b.ParentCommit.CommitDate)) { yield return branch; } } public IEnumerable<Branch> Parents() { Branch current = this; while (current.HasParentBranch) { current = current.ParentBranch; yield return current; } } public override string ToString() => Name; } }
using System.Collections.Generic; using System.Linq; namespace GitMind.GitModel { // Some extra Branch internal class Branch { private readonly Repository repository; private readonly string tipCommitId; private readonly string firstCommitId; private readonly string parentCommitId; private readonly IReadOnlyList<string> commitIds; private readonly string parentBranchId; public Branch( Repository repository, string id, string name, string tipCommitId, string firstCommitId, string parentCommitId, IReadOnlyList<string> commitIds, string parentBranchId, IReadOnlyList<string> childBranchNames, bool isActive, bool isMultiBranch, int localAheadCount, int remoteAheadCount) { this.repository = repository; this.tipCommitId = tipCommitId; this.firstCommitId = firstCommitId; this.parentCommitId = parentCommitId; this.commitIds = commitIds; this.parentBranchId = parentBranchId; Id = id; Name = name; ChildBranchNames = childBranchNames; IsActive = isActive; IsMultiBranch = isMultiBranch; LocalAheadCount = localAheadCount; RemoteAheadCount = remoteAheadCount; } public string Id { get; } public string Name { get; } public IReadOnlyList<string> ChildBranchNames { get; } public bool IsActive { get; } public bool IsMultiBranch { get; } public int LocalAheadCount { get; } public int RemoteAheadCount { get; } public Commit TipCommit => repository.Commits[tipCommitId]; public Commit FirstCommit => repository.Commits[firstCommitId]; public Commit ParentCommit => repository.Commits[parentCommitId]; public IEnumerable<Commit> Commits => commitIds.Select(id => repository.Commits[id]); public bool HasParentBranch => parentBranchId != null; public Branch ParentBranch => repository.Branches[parentBranchId]; public bool IsCurrentBranch => repository.CurrentBranch == this; public bool IsMergeable => IsCurrentBranch && repository.Status.ConflictCount == 0 && repository.Status.StatusCount == 0; public IEnumerable<Branch> GetChildBranches() { foreach (Branch branch in repository.Branches .Where(b => b.HasParentBranch && b.ParentBranch == this) .Distinct() .OrderByDescending(b => b.ParentCommit.CommitDate)) { yield return branch; } } public IEnumerable<Branch> Parents() { Branch current = this; while (current.HasParentBranch) { current = current.ParentBranch; yield return current; } } public override string ToString() => Name; } }
mit
C#
c0cbecf671e4448063f0e04ea380d5c46f274b3c
Add sandbox constant to the send resource, closes #54 closes #46
mailjet/mailjet-apiv3-dotnet
Mailjet.Client/Resources/Send.cs
Mailjet.Client/Resources/Send.cs
namespace Mailjet.Client.Resources { public static class Send { public static readonly ResourceInfo Resource = new ResourceInfo("send", null, ResourceType.Send); public const string SandboxMode = "SandboxMode"; public const string FromEmail = "FromEmail"; public const string FromName = "FromName"; public const string Subject = "Subject"; public const string TextPart = "Text-Part"; public const string HtmlPart = "Html-Part"; public const string Recipients = "Recipients"; public const string Vars = "Vars"; public const string To = "To"; public const string Cc = "cc"; public const string Bcc = "bcc"; public const string MjTemplateID = "Mj-TemplateID"; public const string MjTemplateLanguage = "Mj-TemplateLanguage"; public const string MjTemplateErrorReporting = "Mj-TemplateErrorReporting"; public const string MjTemplateErrorDeliver = "Mj-TemplateErrorDeliver"; public const string Attachments = "Attachments"; public const string InlineAttachments = "Inline_Attachments"; public const string Mjprio = "Mj-prio"; public const string MjCustomID = "Mj-CustomID"; public const string Mjcampaign = "Mj-campaign"; public const string Mjdeduplicatecampaign = "Mj-deduplicatecampaign"; public const string MjEventPayload = "Mj-EventPayload"; public const string Headers = "Headers"; public const string Messages = "Messages"; } }
namespace Mailjet.Client.Resources { public static class Send { public static readonly ResourceInfo Resource = new ResourceInfo("send", null, ResourceType.Send); public const string FromEmail = "FromEmail"; public const string FromName = "FromName"; public const string Subject = "Subject"; public const string TextPart = "Text-Part"; public const string HtmlPart = "Html-Part"; public const string Recipients = "Recipients"; public const string Vars = "Vars"; public const string To = "To"; public const string Cc = "cc"; public const string Bcc = "bcc"; public const string MjTemplateID = "Mj-TemplateID"; public const string MjTemplateLanguage = "Mj-TemplateLanguage"; public const string MjTemplateErrorReporting = "Mj-TemplateErrorReporting"; public const string MjTemplateErrorDeliver = "Mj-TemplateErrorDeliver"; public const string Attachments = "Attachments"; public const string InlineAttachments = "Inline_Attachments"; public const string Mjprio = "Mj-prio"; public const string MjCustomID = "Mj-CustomID"; public const string Mjcampaign = "Mj-campaign"; public const string Mjdeduplicatecampaign = "Mj-deduplicatecampaign"; public const string MjEventPayload = "Mj-EventPayload"; public const string Headers = "Headers"; public const string Messages = "Messages"; } }
mit
C#
d206f6a197a40487db82eb2a37c969d02e5c8d56
TEST for Alexey
maxcriser/CSharpLanguage,maxcriser/CSharpLanguage
PLanguage/GameConsole/Program.cs
PLanguage/GameConsole/Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; using System.Timers; using System.Collections; // TEEEEEEEEEEEEEEEEEEEEEEEEST namespace GameConsole { public class Program { static int max; static int min; static int timerValue = 10000; static bool exit = true; static string gameWord; static string inputWord; static Timer timer = new Timer(timerValue); static Game play; public static void Settings(out int max, out int min) { do { Console.Write("Minimum lenght: "); min = int.Parse(Console.ReadLine()); } while (min < 3 || min > 20); do { Console.Write("Maximum lenght: "); max = int.Parse(Console.ReadLine()); } while (max < min || max > 20); } static void Main(string[] args) { Settings(out max, out min); play = new Game(max,min); gameWord = play.gameWord; Console.WriteLine("Your random word: " + gameWord); timer.Elapsed += Timer_Elapsed; timer.Start(); while (exit) { Console.Write("-> "); inputWord=Console.ReadLine(); play.Test(inputWord); }; } private static void Timer_Elapsed(object sender, ElapsedEventArgs e) { exit = false; timer.Stop(); Console.WriteLine(play.ToString()); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; using System.Timers; using System.Collections; namespace GameConsole { public class Program { static int max; static int min; static int timerValue = 10000; static bool exit = true; static string gameWord; static string inputWord; static Timer timer = new Timer(timerValue); static Game play; public static void Settings(out int max, out int min) { do { Console.Write("Minimum lenght: "); min = int.Parse(Console.ReadLine()); } while (min < 3 || min > 20); do { Console.Write("Maximum lenght: "); max = int.Parse(Console.ReadLine()); } while (max < min || max > 20); } static void Main(string[] args) { Settings(out max, out min); play = new Game(max,min); gameWord = play.gameWord; Console.WriteLine("Your random word: " + gameWord); timer.Elapsed += Timer_Elapsed; timer.Start(); while (exit) { Console.Write("-> "); inputWord=Console.ReadLine(); play.Test(inputWord); }; } private static void Timer_Elapsed(object sender, ElapsedEventArgs e) { exit = false; timer.Stop(); Console.WriteLine(play.ToString()); } } }
apache-2.0
C#
cedf34e1564f376d016a36b9a021bdfb8a014ea0
add more NaturalNumber tests
martinlindhe/Punku
PunkuTests/Math/NaturalNumber.cs
PunkuTests/Math/NaturalNumber.cs
using System; using NUnit.Framework; using Punku; [TestFixture] [Category ("Math")] public class Math_NaturalNumber { [Test] public void ToDecimal01 () { var bb = new NaturalNumber ("12345"); Assert.AreEqual (bb.ToDecimal (), 12345); } [Test] public void ToDecimal02 () { var bb = new NaturalNumber ("00012345"); Assert.AreEqual (bb.ToDecimal (), 12345); } [Test] public void ToDecimal03 () { // NOTE: biggest number that fits in decimal datatype var bb = new NaturalNumber ("79228162514264337593543950335"); Assert.AreEqual (bb.ToDecimal (), 79228162514264337593543950335m); } [Test] [ExpectedException (typeof(OverflowException))] public void ToDecimal04 () { var bb = new NaturalNumber ("79228162514264337593543950336"); bb.ToDecimal (); } [Test] public void Verify01 () { var bb = new NaturalNumber ("123"); Assert.AreEqual ( bb.Digits, new byte[] { 1, 2, 3 } ); } }
using System; using NUnit.Framework; using Punku; [TestFixture] [Category ("Math")] public class Math_NaturalNumber { [Test] public void ToDecimal01 () { var bb = new NaturalNumber ("12345"); Assert.AreEqual (bb.ToDecimal (), 12345); } [Test] public void ToDecimal02 () { var bb = new NaturalNumber ("00012345"); Assert.AreEqual (bb.ToDecimal (), 12345); } }
mit
C#
90bf5cc1b0f2b850888e56753c1009074e1b7b9e
verify that base-2 string decoding works
martinlindhe/Punku
PunkuTests/Math/NaturalNumber.cs
PunkuTests/Math/NaturalNumber.cs
using System; using NUnit.Framework; using Punku; [TestFixture] [Category ("Math")] public class Math_NaturalNumber { [Test] public void ToDecimal01 () { var bb = new NaturalNumber ("12345"); Assert.AreEqual (bb.ToDecimal (), 12345); } [Test] public void ToDecimal02 () { var bb = new NaturalNumber ("00012345"); Assert.AreEqual (bb.ToDecimal (), 12345); } [Test] public void ToDecimal03 () { var bb = new NaturalNumber ("0"); Assert.AreEqual (bb.ToDecimal (), 0); } [Test] [ExpectedException (typeof(FormatException))] public void ToDecimal04 () { var bb = new NaturalNumber (""); } [Test] public void ToDecimal05 () { var bb = new NaturalNumber ("79228162514264337593543950335"); Assert.AreEqual (bb.ToDecimal (), Decimal.MaxValue); } [Test] [ExpectedException (typeof(OverflowException))] public void ToDecimal06 () { var bb = new NaturalNumber ("79228162514264337593543950336"); bb.ToDecimal (); } [Test] public void ToDecimal07 () { var bb = new NaturalNumber ("11111111", 2); Assert.AreEqual (bb.ToDecimal (), 255); } [Test] public void Verify01 () { var bb = new NaturalNumber ("123"); Assert.AreEqual ( bb.Digits, new byte[] { 1, 2, 3 } ); } [Test] public void Verify02 () { var bb = new NaturalNumber ("0"); Assert.AreEqual ( bb.Digits, new byte[] { 0 } ); } }
using System; using NUnit.Framework; using Punku; [TestFixture] [Category ("Math")] public class Math_NaturalNumber { [Test] public void ToDecimal01 () { var bb = new NaturalNumber ("12345"); Assert.AreEqual (bb.ToDecimal (), 12345); } [Test] public void ToDecimal02 () { var bb = new NaturalNumber ("00012345"); Assert.AreEqual (bb.ToDecimal (), 12345); } [Test] public void ToDecimal03 () { var bb = new NaturalNumber ("0"); Assert.AreEqual (bb.ToDecimal (), 0); } [Test] [ExpectedException (typeof(FormatException))] public void ToDecimal04 () { var bb = new NaturalNumber (""); } [Test] public void ToDecimal05 () { var bb = new NaturalNumber ("79228162514264337593543950335"); Assert.AreEqual (bb.ToDecimal (), Decimal.MaxValue); } [Test] [ExpectedException (typeof(OverflowException))] public void ToDecimal06 () { var bb = new NaturalNumber ("79228162514264337593543950336"); bb.ToDecimal (); } [Test] public void Verify01 () { var bb = new NaturalNumber ("123"); Assert.AreEqual ( bb.Digits, new byte[] { 1, 2, 3 } ); } }
mit
C#
20d353eede8c4bf20e664ccf816df0a11933c9e3
Add support for compound index keys to newtonsoft
nkreipke/rethinkdb-net,nkreipke/rethinkdb-net
rethinkdb-net-newtonsoft/Configuration/NewtonSerializer.cs
rethinkdb-net-newtonsoft/Configuration/NewtonSerializer.cs
using RethinkDb.DatumConverters; namespace RethinkDb.Newtonsoft.Configuration { public class NewtonSerializer : AggregateDatumConverterFactory { public NewtonSerializer() : base( PrimitiveDatumConverterFactory.Instance, TupleDatumConverterFactory.Instance, AnonymousTypeDatumConverterFactory.Instance, BoundEnumDatumConverterFactory.Instance, NullableDatumConverterFactory.Instance, NamedValueDictionaryDatumConverterFactory.Instance, CompoundIndexDatumConverterFactory.Instance, NewtonsoftDatumConverterFactory.Instance ) { } } }
using RethinkDb.DatumConverters; namespace RethinkDb.Newtonsoft.Configuration { public class NewtonSerializer : AggregateDatumConverterFactory { public NewtonSerializer() : base( PrimitiveDatumConverterFactory.Instance, TupleDatumConverterFactory.Instance, AnonymousTypeDatumConverterFactory.Instance, BoundEnumDatumConverterFactory.Instance, NullableDatumConverterFactory.Instance, NamedValueDictionaryDatumConverterFactory.Instance, NewtonsoftDatumConverterFactory.Instance ) { } } }
apache-2.0
C#
9b5f19f646c58d864d2ef1f004ccf114b49b70fc
add tahoma font
varbanov88/VarnaTeamProject,varbanov88/VarnaTeamProject
CodeIt/Views/About/About.cshtml
CodeIt/Views/About/About.cshtml
 @{ ViewBag.Title = "About"; } <br/> <br/> <div class="jumbotron" style="padding-top: 40px"> <h1 class="text-center space20">Varna Team</h1> <div class="space20"></div> <div class="space20"></div> <div class="space20"></div> <h3 style="margin-bottom:0">Hello!</h3> <p class="lead"> We are Softuni students and this is our first team project.</p> <div> <p style="font-family:Tahoma"> The aim of our project is to create ASP.net MVC app wich could be helpful for programers. This app give you the opportunity to create your own profile and paste your codes in order ask people for code problems or just to use app like a storege for useful solutions. Here you can edit and delete your own posts and comment the pastes of other users. Also if you dont want to use profile options you can just paste code like a guest user and for example, copy the link and send it or poste it anywhere else. The guest paste can also can be commented. </p> </div> <p> Team members</p> <img src="https://avatars0.githubusercontent.com/u/17138404?v=3&s=400.jpg" alt="Mountain View" style="width:228px;height:228px;"> <img src="https://avatars3.githubusercontent.com/u/20975938?v=3&s=400" alt="Mountain View" style="width:228px;height:228px;"> <img src="https://avatars0.githubusercontent.com/u/25207743?v=3&s=460" alt="Mountain View" style="width:228px;height:228px;"> </div>
 @{ ViewBag.Title = "About"; } <br/> <br/> <div class="jumbotron" style="padding-top: 40px"> <h1 class="text-center space20">Varna Team</h1> <div class="space20"></div> <div class="space20"></div> <div class="space20"></div> <h3 style="margin-bottom:0">Hello!</h3> <p class="lead"> We are Softuni students and this is our first team project.</p> <div> <p class="lead"> The aim of our project is to create ASP.net MVC app wich could be helpful for programers. This app give you the opportunity to create your own profile and paste your codes in order ask people for code problems or just to use app like a storege for useful solutions. Here you can edit and delete your own posts and comment the pastes of other users. Also if you dont want to use profile options you can just paste code like a guest user and for example, copy the link and send it or poste it anywhere else. The guest paste can also can be commented. </p> </div> <p> Team members</p> <img src="https://avatars0.githubusercontent.com/u/17138404?v=3&s=400.jpg" alt="Mountain View" style="width:228px;height:228px;"> <img src="https://avatars3.githubusercontent.com/u/20975938?v=3&s=400" alt="Mountain View" style="width:228px;height:228px;"> <img src="https://avatars0.githubusercontent.com/u/25207743?v=3&s=460" alt="Mountain View" style="width:228px;height:228px;"> </div>
mit
C#
1df9ae69060569ce564014fbbb6897c3190b7d33
Remove comment
clarotech/Verifier
Program.cs
Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace Clarotech.Verifier { static class Program { [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace Clarotech.Verifier { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); } } }
apache-2.0
C#
42e6b6ee8e819d93587b035f0bf29342d2ce465b
Add an error icon on the dialog box that warns about another instance.
kamadak/lurkingwind
Program.cs
Program.cs
// // Copyright (c) 2016 KAMADA Ken'ichi. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. // using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace Lurkingwind { static class Program { const string mutexName = "Lurkingwind"; /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); using (var mutex = new System.Threading.Mutex(true, mutexName)) { if (mutex.WaitOne(0, false)) Application.Run(new MainContext()); else MessageBox.Show("Another instance is running.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
// // Copyright (c) 2016 KAMADA Ken'ichi. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. // using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace Lurkingwind { static class Program { const string mutexName = "Lurkingwind"; /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); using (var mutex = new System.Threading.Mutex(true, mutexName)) { if (mutex.WaitOne(0, false)) Application.Run(new MainContext()); else MessageBox.Show("Another instance is running.", Application.ProductName); } } } }
bsd-2-clause
C#
cbb1b043c152f9faad80c17b22c8cbb60188d782
Remove extra method
yonglehou/msgpack-rpc-cli,yfakariya/msgpack-rpc-cli
src/MsgPack.Rpc.Server/Rpc/Server/Dispatch/OperationDescription.cs
src/MsgPack.Rpc.Server/Rpc/Server/Dispatch/OperationDescription.cs
#region -- License Terms -- // // MessagePack for CLI // // Copyright (C) 2010 FUJIWARA, Yusuke // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #endregion -- License Terms -- using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Reflection; using System.Threading.Tasks; using MsgPack.Serialization; using MsgPack.Rpc.Server.Protocols; namespace MsgPack.Rpc.Server.Dispatch { /// <summary> /// Describes RPC service operation (method). /// </summary> public sealed class OperationDescription { private readonly ServiceDescription _service; public ServiceDescription Service { get { return this._service; } } private readonly MethodInfo _method; private readonly Func<ServerRequestContext, ServerResponseContext, Task> _operation; public Func<ServerRequestContext, ServerResponseContext, Task> Operation { get { return this._operation; } } private readonly string _id; public string Id { get { return this._id; } } private OperationDescription( ServiceDescription service, MethodInfo method, string id, Func<ServerRequestContext, ServerResponseContext, Task> operation ) { this._service = service; this._method = method; this._operation = operation; this._id = id; } public static IEnumerable<OperationDescription> FromServiceDescription( RpcServerConfiguration configuration, SerializationContext serializationContext, ServiceDescription service ) { if ( serializationContext == null ) { throw new ArgumentNullException( "serializationContext" ); } if ( service == null ) { throw new ArgumentNullException( "service" ); } foreach ( var operation in service.ServiceType.GetMethods().Where( method => method.IsDefined( typeof( MessagePackRpcMethodAttribute ), true ) ) ) { yield return FromServiceMethodCore( configuration ?? RpcServerConfiguration.Default, serializationContext, service, operation ); } } private static OperationDescription FromServiceMethodCore( RpcServerConfiguration configuration, SerializationContext serializationContext, ServiceDescription service, MethodInfo operation ) { var serviceInvoker = ServiceInvokerGenerator.Default.GetServiceInvoker( configuration, serializationContext, service, operation ); return new OperationDescription( service, operation, serviceInvoker.OperationId, serviceInvoker.InvokeAsync ); } } }
#region -- License Terms -- // // MessagePack for CLI // // Copyright (C) 2010 FUJIWARA, Yusuke // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #endregion -- License Terms -- using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Reflection; using System.Threading.Tasks; using MsgPack.Serialization; using MsgPack.Rpc.Server.Protocols; namespace MsgPack.Rpc.Server.Dispatch { /// <summary> /// Describes RPC service operation (method). /// </summary> public sealed class OperationDescription { private readonly ServiceDescription _service; public ServiceDescription Service { get { return this._service; } } private readonly MethodInfo _method; private readonly Func<ServerRequestContext, ServerResponseContext, Task> _operation; public Func<ServerRequestContext, ServerResponseContext, Task> Operation { get { return this._operation; } } private readonly string _id; public string Id { get { return this._id; } } private OperationDescription( ServiceDescription service, MethodInfo method, string id, Func<ServerRequestContext, ServerResponseContext, Task> operation ) { this._service = service; this._method = method; this._operation = operation; this._id = id; } public static IEnumerable<OperationDescription> FromServiceDescription( RpcServerConfiguration configuration, SerializationContext serializationContext, ServiceDescription service ) { if ( serializationContext == null ) { throw new ArgumentNullException( "serializationContext" ); } if ( service == null ) { throw new ArgumentNullException( "service" ); } foreach ( var operation in service.ServiceType.GetMethods().Where( method => method.IsDefined( typeof( MessagePackRpcMethodAttribute ), true ) ) ) { yield return FromServiceMethodCore( configuration, serializationContext, service, operation ); } } public static OperationDescription FromServiceMethod( RpcServerConfiguration configuration, SerializationContext serializationContext, ServiceDescription service, MethodInfo operation ) { if ( serializationContext == null ) { throw new ArgumentNullException( "serializationContext" ); } if ( service == null ) { throw new ArgumentNullException( "service" ); } if ( operation == null ) { throw new ArgumentNullException( "operation" ); } if ( !operation.DeclaringType.IsAssignableFrom( service.ServiceType ) ) { throw new ArgumentException( String.Format( CultureInfo.CurrentCulture, "Operation '{0}' is not declared on the service type '{1}' or its ancester types.", operation.Name, service.ServiceType.AssemblyQualifiedName ), "operation" ); } return FromServiceMethodCore( configuration, serializationContext, service, operation ); } private static OperationDescription FromServiceMethodCore( RpcServerConfiguration configuration, SerializationContext serializationContext, ServiceDescription service, MethodInfo operation ) { var serviceInvoker = ServiceInvokerGenerator.Default.GetServiceInvoker( configuration, serializationContext, service, operation ); return new OperationDescription( service, operation, serviceInvoker.OperationId, serviceInvoker.InvokeAsync ); } } }
apache-2.0
C#
05080d7e6d21a45948e2e37efa96751dd2c08a59
Add placeholder in config file to load settings from an external file
Seddryck/NBi,Seddryck/NBi
NBi.NUnit.Runtime/NBiSection.cs
NBi.NUnit.Runtime/NBiSection.cs
using System; using System.Configuration; using System.Linq; namespace NBi.NUnit.Runtime { public class NBiSection : ConfigurationSection { // Create a "remoteOnly" attribute. [ConfigurationProperty("testSuite", IsRequired = true)] public string TestSuiteFilename { get { return (string)this["testSuite"]; } set { this["testSuite"] = value; } } // Create a "remoteOnly" attribute. [ConfigurationProperty("settings", IsRequired = false)] public string SettingsFilename { get { return (string)this["settings"]; } set { this["settings"] = value; } } // Create a "remoteOnly" attribute. [ConfigurationProperty("enableAutoCategories", IsRequired = false, DefaultValue=true)] public bool EnableAutoCategories { get { return (bool)this["enableAutoCategories"]; } set { this["enableAutoCategories"] = value; } } // Create a "remoteOnly" attribute. [ConfigurationProperty("allowDtdProcessing", IsRequired = false, DefaultValue = false)] public bool AllowDtdProcessing { get { return (bool)this["allowDtdProcessing"]; } set { this["allowDtdProcessing"] = value; } } } }
using System; using System.Configuration; using System.Linq; namespace NBi.NUnit.Runtime { public class NBiSection : ConfigurationSection { // Create a "remoteOnly" attribute. [ConfigurationProperty("testSuite", IsRequired = true)] public string TestSuiteFilename { get { return (string)this["testSuite"]; } set { this["testSuite"] = value; } } // Create a "remoteOnly" attribute. [ConfigurationProperty("enableAutoCategories", IsRequired = false, DefaultValue=true)] public bool EnableAutoCategories { get { return (bool)this["enableAutoCategories"]; } set { this["enableAutoCategories"] = value; } } // Create a "remoteOnly" attribute. [ConfigurationProperty("allowDtdProcessing", IsRequired = false, DefaultValue = false)] public bool AllowDtdProcessing { get { return (bool)this["allowDtdProcessing"]; } set { this["allowDtdProcessing"] = value; } } } }
apache-2.0
C#
3bca309e7390d7170ded1b9b21a7c048d062a947
Add Constrain function from Arduino
treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk
NET/API/Treehopper/Utilities.cs
NET/API/Treehopper/Utilities.cs
namespace Treehopper { /// <summary> /// This is a utility class that contains convenient static methods. /// </summary> public static class Utilities { /// <summary> /// Map an input value from the specified range to an alternative range. /// </summary> /// <param name="input">The value to map</param> /// <param name="fromMin">The minimum value the input can take on</param> /// <param name="fromMax">The maximum value the input can take on</param> /// <param name="toMin">The minimum output</param> /// <param name="toMax">The maximum output</param> /// <returns>The mapped value</returns> /// <remarks> /// <para> /// This is a clone of the Arduino map() function (http://arduino.cc/en/reference/map). /// </para> /// </remarks> /// <example> /// Map the AnalogIn voltage (which ranges from 0-5) to a Pwm.Value (which ranges from 0-1). /// <code> /// double pwmVal = Utilities.Map(myTreehopperBoard.Pin1.AnalogIn.Value, 0, 5, 0, 1); /// myTreehopperBoard.Pin2.Pwm.DutyCycle = pwmVal; /// </code> /// </example> public static double Map(double input, double fromMin, double fromMax, double toMin, double toMax) { return (input - fromMin) * (toMax - toMin) / (fromMax - fromMin) + toMin; } /// <summary> /// Constrains a number to be within a range /// </summary> /// <param name="x">the number to constrain</param> /// <param name="a">the lower end of the range</param> /// <param name="b">the upper end of the range</param> /// <returns>the constrained number</returns> public static double Constrain(double x, double a, double b) { if (x < a) return a; if (x > b) return b; return x; } } }
namespace Treehopper { /// <summary> /// This is a utility class that contains convenient static methods. /// </summary> public static class Utilities { /// <summary> /// Map an input value from the specified range to an alternative range. /// </summary> /// <param name="input">The value to map</param> /// <param name="fromMin">The minimum value the input can take on</param> /// <param name="fromMax">The maximum value the input can take on</param> /// <param name="toMin">The minimum output</param> /// <param name="toMax">The maximum output</param> /// <returns>The mapped value</returns> /// <remarks> /// <para> /// This is a clone of the Arduino map() function (http://arduino.cc/en/reference/map). /// </para> /// </remarks> /// <example> /// Map the AnalogIn voltage (which ranges from 0-5) to a Pwm.Value (which ranges from 0-1). /// <code> /// double pwmVal = Utilities.Map(myTreehopperBoard.Pin1.AnalogIn.Value, 0, 5, 0, 1); /// myTreehopperBoard.Pin2.Pwm.DutyCycle = pwmVal; /// </code> /// </example> public static double Map(double input, double fromMin, double fromMax, double toMin, double toMax) { return (input - fromMin) * (toMax - toMin) / (fromMax - fromMin) + toMin; } } }
mit
C#
8fadbef4ae45302a8e9271ec1cca9967c0612182
Fix compile error
dotnetcore/CAP,dotnetcore/CAP,ouraspnet/cap,dotnetcore/CAP
src/DotNetCore.CAP.RedisStreams/IConsumerClientFactory.Redis.cs
src/DotNetCore.CAP.RedisStreams/IConsumerClientFactory.Redis.cs
// Copyright (c) .NET Core Community. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using DotNetCore.CAP.Transport; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; namespace DotNetCore.CAP.RedisStreams { internal class RedisConsumerClientFactory : IConsumerClientFactory { private readonly ILogger<RedisConsumerClient> _logger; private readonly IRedisStreamManager _redis; private readonly IOptions<CapRedisOptions> _redisOptions; public RedisConsumerClientFactory(IOptions<CapRedisOptions> redisOptions, IRedisStreamManager redis, ILogger<RedisConsumerClient> logger) { _redisOptions = redisOptions; _redis = redis; _logger = logger; } public IConsumerClient Create(string groupId) { return new RedisConsumerClient(groupId, _redis, _redisOptions, _logger); } } }
// Copyright (c) .NET Core Community. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using DotNetCore.CAP.Transport; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; namespace DotNetCore.CAP.RedisStreams { internal class RedisConsumerClientFactory : IConsumerClientFactory { private readonly ILogger<RedisConsumerClient> logger; private readonly IRedisStreamManager redis; private readonly CapRedisOptions redisOptions; public RedisConsumerClientFactory(IOptions<CapRedisOptions> redisOptions, IRedisStreamManager redis, ILogger<RedisConsumerClient> logger) { this.redisOptions = redisOptions.Value; this.redis = redis; this.logger = logger; } public IConsumerClient Create(string groupId) { return new RedisConsumerClient(groupId, redis, redisOptions, logger); } } }
mit
C#
37c49c2cff306c623353989c3b3bd997cc21aa89
increment minor version,
jwChung/Experimentalism,jwChung/Experimentalism
build/CommonAssemblyInfo.cs
build/CommonAssemblyInfo.cs
using System.Reflection; using System.Resources; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Jin-Wook Chung")] [assembly: AssemblyCopyright("Copyright (c) 2014, Jin-Wook Chung")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: NeutralResourcesLanguage("en-US")] [assembly: AssemblyProduct("")] [assembly: AssemblyVersion("0.16.0")] [assembly: AssemblyInformationalVersion("0.16.0")] /* * Version 0.16.0 * * - [NEW, BREAKING-CHANGE] Replaces all the old idiomatic assertions with new * assertions to provide simpler and more useful API. * * GuardClauseAssertion -> NullGuardClauseAssertion * ConstructingMemberAssertion -> MemberInitializationAssertion * RestrictingReferenceAssertion -> RestrictiveReferenceAssertion * HidingReferenceAssertion -> IndirectReferenceAssertion * * - [FIX, BREAKING-CHANGE] Rearrange namespace: * Introduces the new namespace 'Jwc.Experiment.Idioms.Assertions' and * rearrages namespaces. */
using System.Reflection; using System.Resources; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Jin-Wook Chung")] [assembly: AssemblyCopyright("Copyright (c) 2014, Jin-Wook Chung")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: NeutralResourcesLanguage("en-US")] [assembly: AssemblyProduct("")] [assembly: AssemblyVersion("0.15.4")] [assembly: AssemblyInformationalVersion("0.15.4")] /* * Version 0.16.0 * * - [NEW, BREAKING-CHANGE] Replaces all the old idiomatic assertions with new * assertions to provide simpler and more useful API. * * GuardClauseAssertion -> NullGuardClauseAssertion * ConstructingMemberAssertion -> MemberInitializationAssertion * RestrictingReferenceAssertion -> RestrictiveReferenceAssertion * HidingReferenceAssertion -> IndirectReferenceAssertion * * - [FIX, BREAKING-CHANGE] Rearrange namespace: * Introduces the new namespace 'Jwc.Experiment.Idioms.Assertions' and * rearrages namespaces. */
mit
C#
e3dcbbbe4c342964fb0247c3c924e0726c2b0cfa
increment patch version,
jwChung/Experimentalism,jwChung/Experimentalism
build/CommonAssemblyInfo.cs
build/CommonAssemblyInfo.cs
using System.Reflection; using System.Resources; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Jin-Wook Chung")] [assembly: AssemblyCopyright("Copyright (c) 2014, Jin-Wook Chung")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: NeutralResourcesLanguage("en-US")] [assembly: AssemblyProduct("")] [assembly: AssemblyVersion("0.15.2")] [assembly: AssemblyInformationalVersion("0.15.2")] /* * Version 0.15.2 * * - [FIX] Improves a display name of a member verified by idiomatic test. */
using System.Reflection; using System.Resources; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Jin-Wook Chung")] [assembly: AssemblyCopyright("Copyright (c) 2014, Jin-Wook Chung")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: NeutralResourcesLanguage("en-US")] [assembly: AssemblyProduct("")] [assembly: AssemblyVersion("0.15.1")] [assembly: AssemblyInformationalVersion("0.15.1")] /* * Version 0.15.2 * * - [FIX] Improves a display name of a member verified by idiomatic test. */
mit
C#
c2a4c99714ed77a517d6af22cd1f8d79a52b8b90
Update match notification email.
jrmitch120/ChallengeBoard,jrmitch120/ChallengeBoard
ChallengeBoard/Email/Templates/MatchNotification.cshtml
ChallengeBoard/Email/Templates/MatchNotification.cshtml
@model ChallengeBoard.Email.Models.MatchNotification <!DOCTYPE html> <html> <head> <title>The Challenge Board: Match Notiication</title> <style> p { margin-bottom: 20px;} </style> </head> <body> <p> Hello @Model.LoserName, </p> <p> We're dropping you a line to let you know that <strong>@Model.WinnerName</strong> has reported a match with you on the <strong>@Model.BoardName</strong> challenge board. If this is accurate, you may want to approve the match so that the result is made official as soon as possible. If this is in err, you will want to reject the match so that it will not count. You have <strong>@Model.AutoVerifies</strong> hour(s) to reject or verify this match before it automatically becomes official. </p> @if (!String.IsNullOrWhiteSpace(@Model.WinnerComment)) { <p> <b>@Model.WinnerName had the following comment:</b><br /> @Model.WinnerComment </p> } <p> Thanks,<br/> The Challenge Board </p> </body> </html>
@model ChallengeBoard.Email.Models.MatchNotification <!DOCTYPE html> <html> <head> <title>The Challenge Board: Match Notiication</title> <style> p { margin-bottom: 20px;} </style> </head> <body> <p> Hello @Model.LoserName, </p> <p> We're just dropping you a line to let you know that <strong>@Model.WinnerName</strong> has reported a match with you on the <strong>@Model.BoardName</strong> challenge board. If this is accurate, there isn't anything you have to do. If this is in err, head on over to reject the match so that it will not count. You have <strong>@Model.AutoVerifies</strong> hour(s) to reject this match. </p> @if (!String.IsNullOrWhiteSpace(@Model.WinnerComment)) { <p> <b>@Model.WinnerName had the following comment:</b><br /> @Model.WinnerComment </p> } <p> Thanks,<br/> The Challenge Board </p> </body> </html>
bsd-3-clause
C#
5df29f16ddd9f79da4081b5948d5e92f44444da9
Fix thread safety of Mapfile exchange provider (#5208)
AlexCatarino/Lean,AlexCatarino/Lean,jameschch/Lean,jameschch/Lean,QuantConnect/Lean,QuantConnect/Lean,JKarathiya/Lean,QuantConnect/Lean,jameschch/Lean,StefanoRaggi/Lean,JKarathiya/Lean,jameschch/Lean,AlexCatarino/Lean,StefanoRaggi/Lean,JKarathiya/Lean,StefanoRaggi/Lean,StefanoRaggi/Lean,AlexCatarino/Lean,jameschch/Lean,StefanoRaggi/Lean,JKarathiya/Lean,QuantConnect/Lean
Common/Data/Auxiliary/MapFilePrimaryExchangeProvider.cs
Common/Data/Auxiliary/MapFilePrimaryExchangeProvider.cs
/* * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. * * 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.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using QuantConnect.Interfaces; namespace QuantConnect.Data.Auxiliary { /// <summary> /// Implementation of IPrimaryExchangeProvider from map files. /// </summary> class MapFilePrimaryExchangeProvider : IPrimaryExchangeProvider { private readonly IMapFileProvider _mapFileProvider; private readonly ConcurrentDictionary<SecurityIdentifier, PrimaryExchange> _primaryExchangeBySid; public MapFilePrimaryExchangeProvider(IMapFileProvider mapFileProvider) { _mapFileProvider = mapFileProvider; _primaryExchangeBySid = new ConcurrentDictionary<SecurityIdentifier, PrimaryExchange>(); } /// <summary> /// Gets the primary exchange for a given security identifier /// </summary> /// <param name="securityIdentifier">The security identifier to get the primary exchange for</param> /// <returns>Returns the primary exchange or null if not found</returns> public string GetPrimaryExchange(SecurityIdentifier securityIdentifier) { PrimaryExchange primaryExchange; if (!_primaryExchangeBySid.TryGetValue(securityIdentifier, out primaryExchange)) { var mapFile = _mapFileProvider.Get(securityIdentifier.Market).ResolveMapFile(securityIdentifier.Symbol, securityIdentifier.Date); if (mapFile != null && mapFile.Any()) { primaryExchange = mapFile.Last().PrimaryExchange; } _primaryExchangeBySid[securityIdentifier] = primaryExchange; } return primaryExchange.ToString(); } } }
/* * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. * * 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.Collections.Generic; using System.Linq; using QuantConnect.Interfaces; namespace QuantConnect.Data.Auxiliary { /// <summary> /// Implementation of IPrimaryExchangeProvider from map files. /// </summary> class MapFilePrimaryExchangeProvider : IPrimaryExchangeProvider { private readonly IMapFileProvider _mapFileProvider; private readonly Dictionary<SecurityIdentifier, PrimaryExchange> _primaryExchangeBySid = new Dictionary<SecurityIdentifier, PrimaryExchange>(); public MapFilePrimaryExchangeProvider(IMapFileProvider mapFileProvider) { _mapFileProvider = mapFileProvider; } /// <summary> /// Gets the primary exchange for a given security identifier /// </summary> /// <param name="securityIdentifier">The security identifier to get the primary exchange for</param> /// <returns>Returns the primary exchange or null if not found</returns> public string GetPrimaryExchange(SecurityIdentifier securityIdentifier) { PrimaryExchange primaryExchange; if (!_primaryExchangeBySid.TryGetValue(securityIdentifier, out primaryExchange)) { var mapFile = _mapFileProvider.Get(securityIdentifier.Market).ResolveMapFile(securityIdentifier.Symbol, securityIdentifier.Date); if (mapFile != null && mapFile.Any()) { primaryExchange = mapFile.Last().PrimaryExchange; } _primaryExchangeBySid[securityIdentifier] = primaryExchange; } return primaryExchange.ToString(); } } }
apache-2.0
C#
5c1dcb66b3297492b807ee0d7c2b1f367fd9bae5
Update padding before child subtrees to ensure they are laid out correctly
peppy/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,ZLima12/osu-framework,smoogipooo/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,peppy/osu-framework,ppy/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,ppy/osu-framework
osu.Framework/Graphics/Containers/EdgeSnappingContainer.cs
osu.Framework/Graphics/Containers/EdgeSnappingContainer.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; namespace osu.Framework.Graphics.Containers { /// <summary> /// A <see cref="Container"/> that will apply negative <see cref="Container.Padding"/> to snap the edges to /// the nearest cached <see cref="ISnapTargetContainer"/>. /// Individual <see cref="Edges"/> may be snapped by setting the <see cref="SnappedEdges"/> property. /// Note that children within the negative padding will not be drawn if a parent <see cref="Drawable"/> /// has <see cref="CompositeDrawable.Masking"/> set to true. /// </summary> public class EdgeSnappingContainer : Container<Drawable> { [Resolved(CanBeNull = true)] private ISnapTargetContainer snapTargetContainer { get; set; } public virtual ISnapTargetContainer SnapTarget => snapTargetContainer; /// <summary> /// The <see cref="Edges"/> that should be snapped to the nearest <see cref="ISnapTargetContainer"/>. /// Defaults to <see cref="Edges.None"/>. /// </summary> public Edges SnappedEdges { get; set; } = Edges.None; protected override void UpdateAfterChildrenLife() { base.UpdateAfterChildrenLife(); UpdatePadding(); } protected void UpdatePadding() => Padding = SnappedPadding(); protected virtual MarginPadding SnappedPadding() { if (SnapTarget == null) return new MarginPadding(); var rect = SnapTarget.SnapRectangleToSpaceOfOtherDrawable(this); var left = SnappedEdges.HasFlag(Edges.Left) ? rect.TopLeft.X : 0; var top = SnappedEdges.HasFlag(Edges.Top) ? rect.TopLeft.Y : 0; var right = SnappedEdges.HasFlag(Edges.Right) ? DrawRectangle.BottomRight.X - rect.BottomRight.X : 0; var bottom = SnappedEdges.HasFlag(Edges.Bottom) ? DrawRectangle.BottomRight.Y - rect.BottomRight.Y : 0; return new MarginPadding { Left = left, Right = right, Top = top, Bottom = bottom }; } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; namespace osu.Framework.Graphics.Containers { /// <summary> /// A <see cref="Container"/> that will apply negative <see cref="Container.Padding"/> to snap the edges to /// the nearest cached <see cref="ISnapTargetContainer"/>. /// Individual <see cref="Edges"/> may be snapped by setting the <see cref="SnappedEdges"/> property. /// Note that children within the negative padding will not be drawn if a parent <see cref="Drawable"/> /// has <see cref="CompositeDrawable.Masking"/> set to true. /// </summary> public class EdgeSnappingContainer : Container<Drawable> { [Resolved(CanBeNull = true)] private ISnapTargetContainer snapTargetContainer { get; set; } public virtual ISnapTargetContainer SnapTarget => snapTargetContainer; /// <summary> /// The <see cref="Edges"/> that should be snapped to the nearest <see cref="ISnapTargetContainer"/>. /// Defaults to <see cref="Edges.None"/>. /// </summary> public Edges SnappedEdges { get; set; } = Edges.None; protected override void UpdateAfterChildren() { base.UpdateAfterChildren(); UpdatePadding(); } protected void UpdatePadding() => Padding = SnappedPadding(); protected virtual MarginPadding SnappedPadding() { if (SnapTarget == null) return new MarginPadding(); var rect = SnapTarget.SnapRectangleToSpaceOfOtherDrawable(this); var left = SnappedEdges.HasFlag(Edges.Left) ? rect.TopLeft.X : 0; var top = SnappedEdges.HasFlag(Edges.Top) ? rect.TopLeft.Y : 0; var right = SnappedEdges.HasFlag(Edges.Right) ? DrawRectangle.BottomRight.X - rect.BottomRight.X : 0; var bottom = SnappedEdges.HasFlag(Edges.Bottom) ? DrawRectangle.BottomRight.Y - rect.BottomRight.Y : 0; return new MarginPadding { Left = left, Right = right, Top = top, Bottom = bottom }; } } }
mit
C#
3d6e00095edc737f247b6a93e20b4608d0206b7b
Remove useless test
NeoAdonis/osu,smoogipooo/osu,peppy/osu-new,ppy/osu,UselessToucan/osu,2yangk23/osu,EVAST9919/osu,ppy/osu,johnneijzen/osu,UselessToucan/osu,johnneijzen/osu,peppy/osu,peppy/osu,NeoAdonis/osu,ppy/osu,peppy/osu,EVAST9919/osu,smoogipoo/osu,smoogipoo/osu,NeoAdonis/osu,smoogipoo/osu,UselessToucan/osu,2yangk23/osu
osu.Game.Tests/Visual/Online/TestSceneCommentsContainer.cs
osu.Game.Tests/Visual/Online/TestSceneCommentsContainer.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; using NUnit.Framework; using osu.Game.Online.API.Requests; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics; using osu.Game.Overlays.Comments; using osu.Game.Overlays; using osu.Framework.Allocation; namespace osu.Game.Tests.Visual.Online { [TestFixture] public class TestSceneCommentsContainer : OsuTestScene { public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(CommentsContainer), typeof(CommentsHeader), typeof(DrawableComment), typeof(HeaderButton), typeof(SortTabControl), typeof(ShowChildrenButton), typeof(DeletedChildrenPlaceholder), typeof(VotePill), typeof(CommentsPage), }; protected override bool UseOnlineAPI => true; [Cached] private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple); public TestSceneCommentsContainer() { BasicScrollContainer scroll; CommentsContainer comments; Add(scroll = new BasicScrollContainer { RelativeSizeAxes = Axes.Both, Child = comments = new CommentsContainer() }); AddStep("Big Black comments", () => comments.ShowComments(CommentableType.Beatmapset, 41823)); AddStep("Airman comments", () => comments.ShowComments(CommentableType.Beatmapset, 24313)); AddStep("Lazer build comments", () => comments.ShowComments(CommentableType.Build, 4772)); AddStep("News comments", () => comments.ShowComments(CommentableType.NewsPost, 715)); AddStep("Idle state", () => { scroll.Clear(); scroll.Add(comments = new CommentsContainer()); }); } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; using NUnit.Framework; using osu.Game.Online.API.Requests; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics; using osu.Game.Overlays.Comments; using osu.Game.Overlays; using osu.Framework.Allocation; namespace osu.Game.Tests.Visual.Online { [TestFixture] public class TestSceneCommentsContainer : OsuTestScene { public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(CommentsContainer), typeof(CommentsHeader), typeof(DrawableComment), typeof(HeaderButton), typeof(SortTabControl), typeof(ShowChildrenButton), typeof(DeletedChildrenPlaceholder), typeof(VotePill), typeof(CommentsPage), }; protected override bool UseOnlineAPI => true; [Cached] private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple); public TestSceneCommentsContainer() { BasicScrollContainer scroll; CommentsContainer comments; Add(scroll = new BasicScrollContainer { RelativeSizeAxes = Axes.Both, Child = comments = new CommentsContainer() }); AddStep("Big Black comments", () => comments.ShowComments(CommentableType.Beatmapset, 41823)); AddStep("Airman comments", () => comments.ShowComments(CommentableType.Beatmapset, 24313)); AddStep("Lazer build comments", () => comments.ShowComments(CommentableType.Build, 4772)); AddStep("News comments", () => comments.ShowComments(CommentableType.NewsPost, 715)); AddStep("Beatmap with no comments", () => comments.ShowComments(CommentableType.Beatmapset, 1288)); AddStep("Idle state", () => { scroll.Clear(); scroll.Add(comments = new CommentsContainer()); }); } } }
mit
C#
2b9d775bd24bf126d16305ba3cf722488d34770c
Update usage notes when crayon.exe is invoked without arguments.
blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon
Compiler/Crayon/Workers/UsageDisplayWorker.cs
Compiler/Crayon/Workers/UsageDisplayWorker.cs
using Common; using System; namespace Crayon { internal class UsageDisplayWorker { private static readonly string USAGE = Util.JoinLines( "Crayon version " + VersionInfo.VersionString, "", "To export:", " crayon BUILD-FILE -target BUILD-TARGET-NAME [OPTIONS...]", "", "To run:", " crayon BUILD-FILE [args...]", "", "Flags:", "", " -target When a build file is specified, selects the", " target within that build file to build.", "", " -vm Output a standalone VM for a platform.", "", " -vmdir Directory to output the VM to (when -vm is", " specified).", "", " -genDefaultProj Generate a default boilerplate project to", " the current directory.", "", " -genDefaultProjES Generates a default project with ES locale.", "", " -genDefaultProjJP Generates a default project with JP locale.", "", " -showLibDepTree Shows a dependency tree of the build.", "", " -showLibStack Stack traces will include libraries. By", " default, stack traces are truncated to only", " show user code.", ""); public void DoWorkImpl() { Console.WriteLine(USAGE); } } }
using Common; using System; namespace Crayon { internal class UsageDisplayWorker { private static readonly string USAGE = Util.JoinLines( "Usage:", " crayon BUILD-FILE -target BUILD-TARGET-NAME [OPTIONS...]", "", "Flags:", "", " -target When a build file is specified, selects the", " target within that build file to build.", "", " -vm Output a standalone VM for a platform.", "", " -vmdir Directory to output the VM to (when -vm is", " specified).", "", " -genDefaultProj Generate a default boilerplate project to", " the current directory.", "", " -genDefaultProjES Generates a default project with ES locale.", "", " -genDefaultProjJP Generates a default project with JP locale.", ""); public void DoWorkImpl() { Console.WriteLine(USAGE); } } }
mit
C#