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
556bcb160d741c8d76c686cabd999fc688dedfff
Add console write to algo runner
tzaavi/Lean,Neoracle/Lean,Mendelone/forex_trading,andrewhart098/Lean,jameschch/Lean,jameschch/Lean,bizcad/LeanJJN,racksen/Lean,jameschch/Lean,bizcad/LeanAbhi,andrewhart098/Lean,iamkingmaker/Lean,squideyes/Lean,AnObfuscator/Lean,wowgeeker/Lean,iamkingmaker/Lean,dpavlenkov/Lean,mabeale/Lean,QuantConnect/Lean,desimonk/Lean,bizcad/LeanAbhi,QuantConnect/Lean,squideyes/Lean,bizcad/LeanJJN,AlexCatarino/Lean,bdilber/Lean,FrancisGauthier/Lean,bizcad/LeanITrend,tomhunter-gh/Lean,florentchandelier/Lean,tzaavi/Lean,iamkingmaker/Lean,desimonk/Lean,Jay-Jay-D/LeanSTP,redmeros/Lean,Phoenix1271/Lean,bizcad/Lean,Neoracle/Lean,young-zhang/Lean,AnshulYADAV007/Lean,bdilber/Lean,Neoracle/Lean,bizcad/LeanITrend,Obawoba/Lean,dalebrubaker/Lean,dalebrubaker/Lean,AlexCatarino/Lean,Neoracle/Lean,AlexCatarino/Lean,racksen/Lean,rchien/Lean,Jay-Jay-D/LeanSTP,devalkeralia/Lean,bizcad/Lean,andrewhart098/Lean,redmeros/Lean,Mendelone/forex_trading,AnObfuscator/Lean,a-hart/Lean,desimonk/Lean,bizcad/LeanAbhi,QuantConnect/Lean,young-zhang/Lean,wowgeeker/Lean,exhau/Lean,racksen/Lean,Jay-Jay-D/LeanSTP,kaffeebrauer/Lean,kaffeebrauer/Lean,rchien/Lean,StefanoRaggi/Lean,jameschch/Lean,desimonk/Lean,florentchandelier/Lean,dpavlenkov/Lean,AnshulYADAV007/Lean,AnshulYADAV007/Lean,exhau/Lean,JKarathiya/Lean,redmeros/Lean,bizcad/Lean,StefanoRaggi/Lean,bizcad/LeanJJN,wowgeeker/Lean,young-zhang/Lean,AnshulYADAV007/Lean,bdilber/Lean,Phoenix1271/Lean,AnshulYADAV007/Lean,StefanoRaggi/Lean,Phoenix1271/Lean,Obawoba/Lean,rchien/Lean,exhau/Lean,squideyes/Lean,Mendelone/forex_trading,bizcad/LeanITrend,devalkeralia/Lean,florentchandelier/Lean,tzaavi/Lean,bizcad/LeanAbhi,dpavlenkov/Lean,young-zhang/Lean,mabeale/Lean,a-hart/Lean,bizcad/LeanITrend,dpavlenkov/Lean,AnObfuscator/Lean,Mendelone/forex_trading,Obawoba/Lean,Phoenix1271/Lean,florentchandelier/Lean,tzaavi/Lean,exhau/Lean,QuantConnect/Lean,kaffeebrauer/Lean,racksen/Lean,Obawoba/Lean,bdilber/Lean,tomhunter-gh/Lean,kaffeebrauer/Lean,jameschch/Lean,devalkeralia/Lean,StefanoRaggi/Lean,AnObfuscator/Lean,StefanoRaggi/Lean,mabeale/Lean,FrancisGauthier/Lean,dalebrubaker/Lean,devalkeralia/Lean,rchien/Lean,JKarathiya/Lean,bizcad/Lean,redmeros/Lean,dalebrubaker/Lean,iamkingmaker/Lean,andrewhart098/Lean,FrancisGauthier/Lean,Jay-Jay-D/LeanSTP,kaffeebrauer/Lean,AlexCatarino/Lean,JKarathiya/Lean,mabeale/Lean,squideyes/Lean,tomhunter-gh/Lean,bizcad/LeanJJN,Jay-Jay-D/LeanSTP,FrancisGauthier/Lean,wowgeeker/Lean,JKarathiya/Lean,tomhunter-gh/Lean
Tests/AlgorithmRunner.cs
Tests/AlgorithmRunner.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; using System.Collections.Generic; using System.Threading.Tasks; using NUnit.Framework; using QuantConnect.Configuration; using QuantConnect.Lean.Engine.Results; namespace QuantConnect.Tests { /// <summary> /// Provides methods for running an algorithm and testing it's performance metrics /// </summary> public static class AlgorithmRunner { public static void RunLocalBacktest(string algorithm, Dictionary<string, string> expectedStatistics) { Console.WriteLine("Running " + algorithm + "..."); // set the configuration up Config.Set("algorithm-type-name", algorithm); Config.Set("local", "true"); Config.Set("live-mode", "false"); Config.Set("messaging-handler", "QuantConnect.Messaging.Messaging"); Config.Set("job-queue-handler", "QuantConnect.Queues.JobQueue"); Config.Set("api-handler", "QuantConnect.Api.Api"); // run the algorithm in its own thread Task.Factory.StartNew(() => Lean.Engine.Engine.Main(null)).Wait(); var consoleResultHandler = (ConsoleResultHandler)Lean.Engine.Engine.ResultHandler; var statistics = consoleResultHandler.FinalStatistics; foreach (var stat in expectedStatistics) { Assert.AreEqual(stat.Value, statistics[stat.Key]); } } } }
/* * 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.Threading.Tasks; using NUnit.Framework; using QuantConnect.Configuration; using QuantConnect.Lean.Engine.Results; namespace QuantConnect.Tests { /// <summary> /// Provides methods for running an algorithm and testing it's performance metrics /// </summary> public static class AlgorithmRunner { public static void RunLocalBacktest(string algorithm, Dictionary<string, string> expectedStatistics) { // set the configuration up Config.Set("algorithm-type-name", algorithm); Config.Set("local", "true"); Config.Set("live-mode", "false"); Config.Set("messaging-handler", "QuantConnect.Messaging.Messaging"); Config.Set("job-queue-handler", "QuantConnect.Queues.JobQueue"); Config.Set("api-handler", "QuantConnect.Api.Api"); // run the algorithm in its own thread Task.Factory.StartNew(() => Lean.Engine.Engine.Main(null)).Wait(); var consoleResultHandler = (ConsoleResultHandler)Lean.Engine.Engine.ResultHandler; var statistics = consoleResultHandler.FinalStatistics; foreach (var stat in expectedStatistics) { Assert.AreEqual(stat.Value, statistics[stat.Key]); } } } }
apache-2.0
C#
db1220bfb312d48fcc93436e2e0a5dd0b92e1a6c
Add comment.
eriawan/roslyn,xasx/roslyn,tmat/roslyn,tmeschter/roslyn,genlu/roslyn,wvdd007/roslyn,jmarolf/roslyn,physhi/roslyn,wvdd007/roslyn,DustinCampbell/roslyn,jamesqo/roslyn,cston/roslyn,VSadov/roslyn,mgoertz-msft/roslyn,diryboy/roslyn,swaroop-sridhar/roslyn,brettfo/roslyn,agocke/roslyn,AmadeusW/roslyn,physhi/roslyn,jasonmalinowski/roslyn,gafter/roslyn,paulvanbrenk/roslyn,jcouv/roslyn,CyrusNajmabadi/roslyn,dotnet/roslyn,weltkante/roslyn,mavasani/roslyn,weltkante/roslyn,VSadov/roslyn,tmeschter/roslyn,tmeschter/roslyn,tannergooding/roslyn,davkean/roslyn,abock/roslyn,KevinRansom/roslyn,nguerrera/roslyn,AlekseyTs/roslyn,jamesqo/roslyn,VSadov/roslyn,tannergooding/roslyn,panopticoncentral/roslyn,bartdesmet/roslyn,eriawan/roslyn,MichalStrehovsky/roslyn,ErikSchierboom/roslyn,genlu/roslyn,sharwell/roslyn,swaroop-sridhar/roslyn,physhi/roslyn,DustinCampbell/roslyn,MichalStrehovsky/roslyn,panopticoncentral/roslyn,diryboy/roslyn,weltkante/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,aelij/roslyn,stephentoub/roslyn,sharwell/roslyn,tmat/roslyn,reaction1989/roslyn,xasx/roslyn,mavasani/roslyn,dotnet/roslyn,aelij/roslyn,aelij/roslyn,brettfo/roslyn,CyrusNajmabadi/roslyn,tmat/roslyn,nguerrera/roslyn,ErikSchierboom/roslyn,ErikSchierboom/roslyn,MichalStrehovsky/roslyn,gafter/roslyn,diryboy/roslyn,abock/roslyn,jasonmalinowski/roslyn,KirillOsenkov/roslyn,panopticoncentral/roslyn,abock/roslyn,mgoertz-msft/roslyn,cston/roslyn,KevinRansom/roslyn,dotnet/roslyn,KevinRansom/roslyn,KirillOsenkov/roslyn,AlekseyTs/roslyn,shyamnamboodiripad/roslyn,agocke/roslyn,bkoelman/roslyn,shyamnamboodiripad/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,mgoertz-msft/roslyn,OmarTawfik/roslyn,cston/roslyn,OmarTawfik/roslyn,paulvanbrenk/roslyn,nguerrera/roslyn,swaroop-sridhar/roslyn,AmadeusW/roslyn,bkoelman/roslyn,dpoeschl/roslyn,stephentoub/roslyn,jcouv/roslyn,sharwell/roslyn,jasonmalinowski/roslyn,dpoeschl/roslyn,davkean/roslyn,jcouv/roslyn,tannergooding/roslyn,OmarTawfik/roslyn,davkean/roslyn,bkoelman/roslyn,bartdesmet/roslyn,jmarolf/roslyn,stephentoub/roslyn,dpoeschl/roslyn,xasx/roslyn,jmarolf/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,reaction1989/roslyn,KirillOsenkov/roslyn,bartdesmet/roslyn,genlu/roslyn,jamesqo/roslyn,heejaechang/roslyn,brettfo/roslyn,shyamnamboodiripad/roslyn,AmadeusW/roslyn,paulvanbrenk/roslyn,agocke/roslyn,heejaechang/roslyn,reaction1989/roslyn,AlekseyTs/roslyn,eriawan/roslyn,DustinCampbell/roslyn,wvdd007/roslyn,mavasani/roslyn,heejaechang/roslyn,gafter/roslyn,CyrusNajmabadi/roslyn
src/EditorFeatures/Core/Implementation/BraceMatching/AbstractEmbeddedLanguageBraceMatcher.cs
src/EditorFeatures/Core/Implementation/BraceMatching/AbstractEmbeddedLanguageBraceMatcher.cs
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.EmbeddedLanguages.LanguageServices; using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.Editor.Implementation.BraceMatching { // Note: this type could be concrete, but we cannot export IBraceMatcher's for multiple // languages at once. So all logic is contained here. The derived types only exist for // exporting purposes. internal abstract class AbstractEmbeddedLanguageBraceMatcher : IBraceMatcher { public async Task<BraceMatchingResult?> FindBracesAsync( Document document, int position, CancellationToken cancellationToken) { var languageProvider = document.GetLanguageService<IEmbeddedLanguageProvider>(); foreach (var language in languageProvider.GetEmbeddedLanguages()) { var braceMatcher = language.BraceMatcher; if (braceMatcher != null) { var result = await braceMatcher.FindBracesAsync( document, position, cancellationToken).ConfigureAwait(false); if (result != null) { return new BraceMatchingResult(result.Value.LeftSpan, result.Value.RightSpan); } } } return null; } } }
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.EmbeddedLanguages.LanguageServices; using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.Editor.Implementation.BraceMatching { internal abstract class AbstractEmbeddedLanguageBraceMatcher : IBraceMatcher { public async Task<BraceMatchingResult?> FindBracesAsync( Document document, int position, CancellationToken cancellationToken) { var languageProvider = document.GetLanguageService<IEmbeddedLanguageProvider>(); foreach (var language in languageProvider.GetEmbeddedLanguages()) { var braceMatcher = language.BraceMatcher; if (braceMatcher != null) { var result = await braceMatcher.FindBracesAsync( document, position, cancellationToken).ConfigureAwait(false); if (result != null) { return new BraceMatchingResult(result.Value.LeftSpan, result.Value.RightSpan); } } } return null; } } }
mit
C#
9e5fa3c8b9d45a0d2433976252c09ebd61995966
Add AuthenticationProvider unit-tests
CogniStreamer/owin-security-cognistreamer
tests/Owin.Security.CogniStreamer.Tests/Provider/CogniStreamerAuthenticationProviderTests.cs
tests/Owin.Security.CogniStreamer.Tests/Provider/CogniStreamerAuthenticationProviderTests.cs
using System; using System.Security.Claims; using System.Threading.Tasks; using Microsoft.Owin; using Microsoft.Owin.Security; using Moq; using Newtonsoft.Json.Linq; using NUnit.Framework; using Owin.Security.CogniStreamer.Provider; namespace Owin.Security.CogniStreamer.Tests.Provider { [TestFixture] public class CogniStreamerAuthenticationProviderTests { private Mock<IOwinContext> owinContextMock; private JObject user; private AuthenticationTicket ticket; private CogniStreamerAuthenticationProvider providerUnderTest; [SetUp] public void SetUp() { this.user = new JObject(); this.ticket = new AuthenticationTicket(new ClaimsIdentity(), new AuthenticationProperties()); this.owinContextMock = new Mock<IOwinContext>(); this.providerUnderTest = new CogniStreamerAuthenticationProvider(); } [Test] public void CogniStreamerAuthenticationProvider_DefaultOnAuthenticatedImplementation_ShouldNotThrowException() { var context = new CogniStreamerAuthenticatedContext(this.owinContextMock.Object, this.user, string.Empty, string.Empty); Assert.That(() => this.providerUnderTest.Authenticated(context), Throws.Nothing); } [Test] public void CogniStreamerAuthenticationProvider_DefaultOnReturnEndpointImplementation_ShouldNotThrowException() { var context = new CogniStreamerReturnEndpointContext(this.owinContextMock.Object, this.ticket); Assert.That(() => this.providerUnderTest.ReturnEndpoint(context), Throws.Nothing); } [Test] public void CogniStreamerAuthenticationProvider_DefaultOnApplyRedirectImplementation_ShouldRedirectResponse() { var options = new CogniStreamerAuthenticationOptions(); var properties = new AuthenticationProperties(); var context = new CogniStreamerApplyRedirectContext(this.owinContextMock.Object, options, properties, "https://www.test.org"); var responseMock = new Mock<IOwinResponse>(); this.owinContextMock.SetupGet(x => x.Response).Returns(responseMock.Object); Assert.That(() => this.providerUnderTest.ApplyRedirect(context), Throws.Nothing); responseMock.Verify(x => x.Redirect("https://www.test.org"), Times.Once); } [Test] public void CogniStreamerAuthenticationProvider_CallAuthenticated_ShouldInvokeOnAuthenticated() { var callbacksMock = new Mock<IProviderCallbacks>(); var context = new CogniStreamerAuthenticatedContext(this.owinContextMock.Object, this.user, string.Empty, string.Empty); this.providerUnderTest.OnAuthenticated = callbacksMock.Object.OnAuthenticated; this.providerUnderTest.Authenticated(context); callbacksMock.Verify(x => x.OnAuthenticated(context), Times.Once); } [Test] public void CogniStreamerAuthenticationProvider_CallReturnEndpoint_ShouldInvokeOnReturnEndpoint() { var callbacksMock = new Mock<IProviderCallbacks>(); var context = new CogniStreamerReturnEndpointContext(this.owinContextMock.Object, this.ticket); this.providerUnderTest.OnReturnEndpoint = callbacksMock.Object.OnReturnEndpoint; this.providerUnderTest.ReturnEndpoint(context); callbacksMock.Verify(x => x.OnReturnEndpoint(context), Times.Once); } [Test] public void CogniStreamerAuthenticationProvider_CallApplyRedirect_ShouldInvokeOnApplyRedirect() { var callbacksMock = new Mock<IProviderCallbacks>(); var options = new CogniStreamerAuthenticationOptions(); var properties = new AuthenticationProperties(); var context = new CogniStreamerApplyRedirectContext(this.owinContextMock.Object, options, properties, "https://www.test.org"); this.providerUnderTest.OnApplyRedirect = callbacksMock.Object.OnApplyRedirect; this.providerUnderTest.ApplyRedirect(context); callbacksMock.Verify(x => x.OnApplyRedirect(context), Times.Once); } public interface IProviderCallbacks { Task OnAuthenticated(CogniStreamerAuthenticatedContext context); Task OnReturnEndpoint(CogniStreamerReturnEndpointContext context); void OnApplyRedirect(CogniStreamerApplyRedirectContext context); } } }
using NUnit.Framework; namespace Owin.Security.CogniStreamer.Tests.Provider { [TestFixture] public class CogniStreamerAuthenticationProviderTests { // TODO } }
apache-2.0
C#
15ff204f462af8ad048d9d6c8286ccbcccb2fa31
Remove todo comment
RubenLaube-Pohto/asp.net-project
Views/ChatView.cshtml
Views/ChatView.cshtml
@model ChatApp.Controllers.ChatMessagesViewModel @addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" @using ChatApp.Models <!DOCTYPE html> <html> <head> <title>ChatApp</title> </head> <body> <table> @foreach (Message msg in Model.OldMessages) { <tr> <td class="author">@msg.Author</td> <td class="text">@msg.Text</td> <td class="timestamp">@msg.Timestamp</td> </tr> } </table> <form asp-action="SendNewMessage" method="post"> <input asp-for="NewMessage.Author"/> <input asp-for="NewMessage.Text"/> <input type="submit" value="Send"/> </form> </body> </html>
@model ChatApp.Controllers.ChatMessagesViewModel @addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" @using ChatApp.Models <!DOCTYPE html> <html> <head> <title>ChatApp</title> </head> <body> <table> @foreach (Message msg in Model.OldMessages) { <tr> <td class="author">@msg.Author</td> <td class="text">@msg.Text</td> <td class="timestamp">@msg.Timestamp</td> </tr> } </table> <!-- TODO: Form for posting new messages --> <form asp-action="SendNewMessage" method="post"> <input asp-for="NewMessage.Author"/> <input asp-for="NewMessage.Text"/> <input type="submit" value="Send"/> </form> </body> </html>
mit
C#
7daf045076640b65ba82693a3b01c1b911601073
Validate invariant.
srivatsn/roslyn,CyrusNajmabadi/roslyn,ErikSchierboom/roslyn,aelij/roslyn,weltkante/roslyn,xasx/roslyn,KevinH-MS/roslyn,heejaechang/roslyn,DustinCampbell/roslyn,tvand7093/roslyn,eriawan/roslyn,diryboy/roslyn,amcasey/roslyn,lorcanmooney/roslyn,mattscheffer/roslyn,tvand7093/roslyn,heejaechang/roslyn,robinsedlaczek/roslyn,dotnet/roslyn,lorcanmooney/roslyn,VSadov/roslyn,pdelvo/roslyn,drognanar/roslyn,panopticoncentral/roslyn,bbarry/roslyn,budcribar/roslyn,jcouv/roslyn,VSadov/roslyn,MichalStrehovsky/roslyn,AnthonyDGreen/roslyn,jkotas/roslyn,bartdesmet/roslyn,sharwell/roslyn,Shiney/roslyn,jcouv/roslyn,swaroop-sridhar/roslyn,ErikSchierboom/roslyn,Pvlerick/roslyn,jasonmalinowski/roslyn,ErikSchierboom/roslyn,ljw1004/roslyn,bkoelman/roslyn,dpoeschl/roslyn,heejaechang/roslyn,jasonmalinowski/roslyn,MatthieuMEZIL/roslyn,kelltrick/roslyn,zooba/roslyn,gafter/roslyn,jhendrixMSFT/roslyn,physhi/roslyn,jkotas/roslyn,VSadov/roslyn,tannergooding/roslyn,tannergooding/roslyn,shyamnamboodiripad/roslyn,Hosch250/roslyn,jamesqo/roslyn,KirillOsenkov/roslyn,AArnott/roslyn,ljw1004/roslyn,yeaicc/roslyn,vslsnap/roslyn,AmadeusW/roslyn,bkoelman/roslyn,gafter/roslyn,wvdd007/roslyn,cston/roslyn,mavasani/roslyn,yeaicc/roslyn,xoofx/roslyn,jeffanders/roslyn,brettfo/roslyn,cston/roslyn,AlekseyTs/roslyn,nguerrera/roslyn,swaroop-sridhar/roslyn,tmat/roslyn,OmarTawfik/roslyn,akrisiun/roslyn,orthoxerox/roslyn,MatthieuMEZIL/roslyn,amcasey/roslyn,KevinRansom/roslyn,robinsedlaczek/roslyn,reaction1989/roslyn,jmarolf/roslyn,balajikris/roslyn,panopticoncentral/roslyn,agocke/roslyn,jkotas/roslyn,mmitche/roslyn,tmeschter/roslyn,AArnott/roslyn,srivatsn/roslyn,khyperia/roslyn,bartdesmet/roslyn,paulvanbrenk/roslyn,Hosch250/roslyn,akrisiun/roslyn,dotnet/roslyn,tmeschter/roslyn,kelltrick/roslyn,zooba/roslyn,budcribar/roslyn,tvand7093/roslyn,bbarry/roslyn,KevinH-MS/roslyn,mattwar/roslyn,zooba/roslyn,brettfo/roslyn,yeaicc/roslyn,orthoxerox/roslyn,genlu/roslyn,KiloBravoLima/roslyn,Pvlerick/roslyn,TyOverby/roslyn,KirillOsenkov/roslyn,drognanar/roslyn,abock/roslyn,Giftednewt/roslyn,tmat/roslyn,MatthieuMEZIL/roslyn,wvdd007/roslyn,xasx/roslyn,paulvanbrenk/roslyn,wvdd007/roslyn,Shiney/roslyn,KiloBravoLima/roslyn,budcribar/roslyn,CyrusNajmabadi/roslyn,MattWindsor91/roslyn,KevinRansom/roslyn,genlu/roslyn,MichalStrehovsky/roslyn,natidea/roslyn,jmarolf/roslyn,AmadeusW/roslyn,khyperia/roslyn,abock/roslyn,a-ctor/roslyn,mgoertz-msft/roslyn,mmitche/roslyn,Giftednewt/roslyn,stephentoub/roslyn,OmarTawfik/roslyn,bartdesmet/roslyn,CaptainHayashi/roslyn,MattWindsor91/roslyn,sharwell/roslyn,pdelvo/roslyn,natidea/roslyn,xasx/roslyn,CyrusNajmabadi/roslyn,jhendrixMSFT/roslyn,xoofx/roslyn,dpoeschl/roslyn,dpoeschl/roslyn,mmitche/roslyn,srivatsn/roslyn,abock/roslyn,TyOverby/roslyn,tannergooding/roslyn,mattscheffer/roslyn,khyperia/roslyn,swaroop-sridhar/roslyn,CaptainHayashi/roslyn,mgoertz-msft/roslyn,jhendrixMSFT/roslyn,jeffanders/roslyn,jasonmalinowski/roslyn,OmarTawfik/roslyn,vslsnap/roslyn,dotnet/roslyn,KevinH-MS/roslyn,paulvanbrenk/roslyn,lorcanmooney/roslyn,agocke/roslyn,MichalStrehovsky/roslyn,DustinCampbell/roslyn,AlekseyTs/roslyn,a-ctor/roslyn,jamesqo/roslyn,ljw1004/roslyn,natidea/roslyn,jamesqo/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,MattWindsor91/roslyn,Hosch250/roslyn,stephentoub/roslyn,amcasey/roslyn,jmarolf/roslyn,davkean/roslyn,diryboy/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,reaction1989/roslyn,bkoelman/roslyn,Shiney/roslyn,AlekseyTs/roslyn,eriawan/roslyn,mgoertz-msft/roslyn,gafter/roslyn,agocke/roslyn,tmat/roslyn,KiloBravoLima/roslyn,physhi/roslyn,stephentoub/roslyn,davkean/roslyn,AnthonyDGreen/roslyn,aelij/roslyn,drognanar/roslyn,panopticoncentral/roslyn,genlu/roslyn,weltkante/roslyn,AmadeusW/roslyn,jeffanders/roslyn,tmeschter/roslyn,physhi/roslyn,nguerrera/roslyn,DustinCampbell/roslyn,CaptainHayashi/roslyn,TyOverby/roslyn,akrisiun/roslyn,mattwar/roslyn,brettfo/roslyn,kelltrick/roslyn,cston/roslyn,xoofx/roslyn,a-ctor/roslyn,jcouv/roslyn,vslsnap/roslyn,aelij/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,shyamnamboodiripad/roslyn,mavasani/roslyn,AArnott/roslyn,KirillOsenkov/roslyn,AnthonyDGreen/roslyn,orthoxerox/roslyn,pdelvo/roslyn,KevinRansom/roslyn,mavasani/roslyn,Giftednewt/roslyn,bbarry/roslyn,robinsedlaczek/roslyn,reaction1989/roslyn,davkean/roslyn,balajikris/roslyn,balajikris/roslyn,sharwell/roslyn,Pvlerick/roslyn,eriawan/roslyn,nguerrera/roslyn,mattscheffer/roslyn,mattwar/roslyn,weltkante/roslyn,diryboy/roslyn,MattWindsor91/roslyn,shyamnamboodiripad/roslyn
src/Features/Core/Portable/FindReferences/DefinitionsAndReferences.cs
src/Features/Core/Portable/FindReferences/DefinitionsAndReferences.cs
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Immutable; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.FindReferences { /// <summary> /// A collection of <see cref="DefinitionItem"/>s and <see cref="SourceReferenceItem"/>s /// that can be presented in an editor and used to navigate to the defintions and /// references found for a symbol. /// </summary> internal struct DefinitionsAndReferences { public static readonly DefinitionsAndReferences Empty = new DefinitionsAndReferences(ImmutableArray<DefinitionItem>.Empty, ImmutableArray<SourceReferenceItem>.Empty); /// <summary> /// All the definitions to show. Note: not all definitions may have references. /// </summary> public ImmutableArray<DefinitionItem> Definitions { get; } /// <summary> /// All the references to show. Note: every <see cref="SourceReferenceItem.Definition"/> /// should be in <see cref="Definitions"/> /// </summary> public ImmutableArray<SourceReferenceItem> References { get; } public DefinitionsAndReferences( ImmutableArray<DefinitionItem> definitions, ImmutableArray<SourceReferenceItem> references) { var definitionSet = definitions.ToSet(); for (int i = 0, n = references.Length; i < n; i++) { var reference = references[i]; if (!definitionSet.Contains(reference.Definition)) { throw new ArgumentException( $"{nameof(references)}[{i}].{nameof(reference.Definition)} not found in '{nameof(definitions)}'"); } } Definitions = definitions; References = references; } } }
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Immutable; namespace Microsoft.CodeAnalysis.FindReferences { /// <summary> /// A collection of <see cref="DefinitionItem"/>s and <see cref="SourceReferenceItem"/>s /// that can be presented in an editor and used to navigate to the defintions and /// references found for a symbol. /// </summary> internal struct DefinitionsAndReferences { public static readonly DefinitionsAndReferences Empty = new DefinitionsAndReferences(ImmutableArray<DefinitionItem>.Empty, ImmutableArray<SourceReferenceItem>.Empty); /// <summary> /// All the definitions to show. Note: not all definitions may have references. /// </summary> public ImmutableArray<DefinitionItem> Definitions { get; } /// <summary> /// All the references to show. Note: every <see cref="SourceReferenceItem.Definition"/> /// should be in <see cref="Definitions"/> /// </summary> public ImmutableArray<SourceReferenceItem> References { get; } public DefinitionsAndReferences( ImmutableArray<DefinitionItem> definitions, ImmutableArray<SourceReferenceItem> references) { Definitions = definitions; References = references; } } }
mit
C#
c6c22122c515c32609523174b1110cd11fdaa1c7
Address feedback
nunit/nunit,nunit/nunit,mjedrzejek/nunit,mjedrzejek/nunit
src/NUnitFramework/framework/Constraints/Comparers/ComparisonState.cs
src/NUnitFramework/framework/Constraints/Comparers/ComparisonState.cs
using System; using NUnit.Framework.Internal; namespace NUnit.Framework.Constraints.Comparers { internal struct ComparisonState { /// <summary> /// Flag indicating whether or not this is the top level comparison. /// </summary> public bool TopLevelComparison { get; } /// <summary> /// A list of tracked comparisons /// </summary> private readonly ImmutableStack<Comparison> _comparisons; public ComparisonState(bool topLevelComparison) : this(topLevelComparison, ImmutableStack<Comparison>.Empty) { } private ComparisonState(bool topLevelComparison, ImmutableStack<Comparison> comparisons) { TopLevelComparison = topLevelComparison; _comparisons = comparisons; } public ComparisonState PushComparison(object x, object y) { return new ComparisonState( false, _comparisons.Push(new Comparison(x, y)) ); } public bool DidCompare(object x, object y) { foreach (var comparison in _comparisons) if (ReferenceEquals(comparison.X, x) && ReferenceEquals(comparison.Y, y)) return true; return false; } private struct Comparison { public object X { get; } public object Y { get; } public Comparison(object x, object y) { X = x; Y = y; } } } }
using System; using NUnit.Framework.Internal; namespace NUnit.Framework.Constraints.Comparers { internal struct ComparisonState { /// <summary> /// Flag indicating whether or not this is the top level comparison. /// </summary> public readonly bool TopLevelComparison; /// <summary> /// A list of tracked comparisons /// </summary> private readonly ImmutableStack<Comparison> _comparisons; public ComparisonState(bool topLevelComparison) : this(topLevelComparison, ImmutableStack<Comparison>.Empty) { } private ComparisonState(bool topLevelComparison, ImmutableStack<Comparison> comparisons) { TopLevelComparison = topLevelComparison; _comparisons = comparisons; } public ComparisonState PushComparison(object x, object y) { return new ComparisonState( false, _comparisons.Push(new Comparison(x, y)) ); } public bool DidCompare(object x, object y) { foreach (var comparison in _comparisons) if (Object.ReferenceEquals(comparison.X, x) && Object.ReferenceEquals(comparison.Y, y)) return true; return false; } private struct Comparison { public object X { get; } public object Y { get; } public Comparison(object x, object y) { X = x; Y = y; } } } }
mit
C#
b48fd188d27f6b9d7077164257a0df86373cbfad
Change log level of duplicate event reference id check.
exceptionless/Exceptionless,exceptionless/Exceptionless,exceptionless/Exceptionless,exceptionless/Exceptionless
src/Exceptionless.Core/Plugins/EventProcessor/Default/05_CheckForDuplicateReferenceIdPlugin.cs
src/Exceptionless.Core/Plugins/EventProcessor/Default/05_CheckForDuplicateReferenceIdPlugin.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Exceptionless.Core.Extensions; using Exceptionless.Core.Pipeline; using Foundatio.Caching; using Microsoft.Extensions.Logging; namespace Exceptionless.Core.Plugins.EventProcessor { [Priority(5)] public sealed class CheckForDuplicateReferenceIdPlugin : EventProcessorPluginBase { private readonly ICacheClient _cacheClient; public CheckForDuplicateReferenceIdPlugin(ICacheClient cacheClient, AppOptions options, ILoggerFactory loggerFactory = null) : base(options, loggerFactory) { _cacheClient = cacheClient; } public override async Task EventProcessingAsync(EventContext context) { if (String.IsNullOrEmpty(context.Event.ReferenceId)) return; if (await _cacheClient.AddAsync(GetCacheKey(context), true, TimeSpan.FromDays(1)).AnyContext()) { context.SetProperty("AddedReferenceId", true); return; } _logger.LogInformation("Discarding event due to duplicate reference id: {ReferenceId}", context.Event.ReferenceId); context.IsCancelled = true; } public override Task EventBatchProcessedAsync(ICollection<EventContext> contexts) { var values = contexts.Where(c => !String.IsNullOrEmpty(c.Event.ReferenceId) && c.GetProperty("AddedReferenceId") == null).ToDictionary(GetCacheKey, v => true); if (values.Count == 0) return Task.CompletedTask; return _cacheClient.SetAllAsync(values, TimeSpan.FromDays(1)); } private string GetCacheKey(EventContext context) { return String.Concat("Project:", context.Project.Id, ":", context.Event.ReferenceId); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Exceptionless.Core.Extensions; using Exceptionless.Core.Pipeline; using Foundatio.Caching; using Microsoft.Extensions.Logging; namespace Exceptionless.Core.Plugins.EventProcessor { [Priority(5)] public sealed class CheckForDuplicateReferenceIdPlugin : EventProcessorPluginBase { private readonly ICacheClient _cacheClient; public CheckForDuplicateReferenceIdPlugin(ICacheClient cacheClient, AppOptions options, ILoggerFactory loggerFactory = null) : base(options, loggerFactory) { _cacheClient = cacheClient; } public override async Task EventProcessingAsync(EventContext context) { if (String.IsNullOrEmpty(context.Event.ReferenceId)) return; if (await _cacheClient.AddAsync(GetCacheKey(context), true, TimeSpan.FromDays(1)).AnyContext()) { context.SetProperty("AddedReferenceId", true); return; } _logger.LogWarning("Discarding event due to duplicate reference id: {ReferenceId}", context.Event.ReferenceId); context.IsCancelled = true; } public override Task EventBatchProcessedAsync(ICollection<EventContext> contexts) { var values = contexts.Where(c => !String.IsNullOrEmpty(c.Event.ReferenceId) && c.GetProperty("AddedReferenceId") == null).ToDictionary(GetCacheKey, v => true); if (values.Count == 0) return Task.CompletedTask; return _cacheClient.SetAllAsync(values, TimeSpan.FromDays(1)); } private string GetCacheKey(EventContext context) { return String.Concat("Project:", context.Project.Id, ":", context.Event.ReferenceId); } } }
apache-2.0
C#
e8333ab38256b9bf171da011064bc80c8b80ea67
bump versions
hudl/HudlFfmpeg
Hudl.Ffmpeg/Properties/AssemblyInfo.cs
Hudl.Ffmpeg/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("Hudl.Ffmpeg")] [assembly: AssemblyDescription("Library for transcoding and creating special media effects.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Hudl")] [assembly: AssemblyProduct("Hudl.Ffmpeg")] [assembly: AssemblyCopyright("Copyright © 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] [assembly: InternalsVisibleTo("Hudl.Ffmpeg.Tests")] [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("06757495-d5ae-4f2d-9d6b-6b17cacbf798")] // 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: AssemblyInformationalVersion("1.2.0.0")] [assembly: AssemblyFileVersion("1.2.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Hudl.Ffmpeg")] [assembly: AssemblyDescription("Library for transcoding and creating special media effects.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Hudl")] [assembly: AssemblyProduct("Hudl.Ffmpeg")] [assembly: AssemblyCopyright("Copyright © 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] [assembly: InternalsVisibleTo("Hudl.Ffmpeg.Tests")] [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("06757495-d5ae-4f2d-9d6b-6b17cacbf798")] // 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: AssemblyInformationalVersion("1.1.0.0")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
apache-2.0
C#
c3e667b31ec51e849dbe202141e32c4c9e78d32f
update version
jefking/King.Mapper
King.Mapper/Properties/AssemblyInfo.cs
King.Mapper/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("King.Mapper")] [assembly: AssemblyDescription("Simple model mapping")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("King.Mapper")] [assembly: AssemblyCopyright("Copyright © Jef King 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("900a2472-c826-4e99-aa69-60b56745f56a")] [assembly: AssemblyVersion("2.0.0.3")] [assembly: AssemblyFileVersion("2.0.0.3")]
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("King.Mapper")] [assembly: AssemblyDescription("High performance model mapping.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("King.Mapper")] [assembly: AssemblyCopyright("Copyright © Jef King 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("900a2472-c826-4e99-aa69-60b56745f56a")] [assembly: AssemblyVersion("2.0.0.2")] [assembly: AssemblyFileVersion("2.0.0.2")]
mit
C#
6683b591144b7f1d36761955b3a626264e652096
Document QR code prefixes.
predictive-technology-laboratory/sensus,predictive-technology-laboratory/sensus,predictive-technology-laboratory/sensus,predictive-technology-laboratory/sensus,predictive-technology-laboratory/sensus,predictive-technology-laboratory/sensus
Sensus.Shared/QrCodePrefix.cs
Sensus.Shared/QrCodePrefix.cs
// Copyright 2014 The Rector & Visitors of the University of Virginia // // 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 Sensus { /// <summary> /// Prefixes to use when generating QR codes used by Sensus. /// </summary> public static class QrCodePrefix { /// <summary> /// Participation barcodes. /// </summary> public const string SENSUS_PARTICIPATION = "sensus-participation:"; /// <summary> /// Sensus protocols. Following this prefix should be an internet-accessible URL from which to download a protocol file via HTTPS. /// </summary> public const string SENSUS_PROTOCOL = "sensus-protocol:"; /// <summary> /// Sensus participant identifiers. Following this prefix should be an arbitrary string denoting a participant. /// </summary> public const string SENSUS_PARTICIPANT_ID = "sensus-participant:"; /// <summary> /// IAM credentials. Following this prefix should be REGION:ACCESSKEY:SECRET, denoting an IAM user. /// </summary> public const string IAM_CREDENTIALS = "iam-credentials:"; } }
// Copyright 2014 The Rector & Visitors of the University of Virginia // // 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 Sensus { /// <summary> /// Prefixes to use when generating QR codes used by Sensus. /// </summary> public static class QrCodePrefix { /// <summary> /// Participation barcodes. /// </summary> public const string SENSUS_PARTICIPATION = "sensus-participation:"; /// <summary> /// Sensus protocols. /// </summary> public const string SENSUS_PROTOCOL = "sensus-protocol:"; /// <summary> /// Sensus participant identifiers. /// </summary> public const string SENSUS_PARTICIPANT_ID = "sensus-participant:"; /// <summary> /// IAM credentials. /// </summary> public const string IAM_CREDENTIALS = "iam-credentials:"; } }
apache-2.0
C#
f229c2925263cc2a3ee191767f5536764a21c646
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.8.6")] [assembly: AssemblyInformationalVersion("0.8.6")] /* * Version 0.8.6 * * Change the FirstClassCommand constructor to use MethodInfo directly * instead of Delegate. * * BREAKING CHNAGE * FirstClassCommand * - before: * FirstClassCommand(IMethodInfo, Delegate, object[]) * after: * FirstClassCommand(IMethodInfo, MethodInfo, object[]) * * - before: * Delegate Delegate * after: * MethodInfo TestCase */
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.8.5")] [assembly: AssemblyInformationalVersion("0.8.5")] /* * Version 0.8.5 * * Introduce ITestFixtureFactory instead of Func<ITestFixture>. * * BREAKING CHNAGE * DefaultTheoremAttribute * - delete: * DefaultTheoremAttribute(Func<ITestFixture>) * * - before: * DefaultTheoremAttribute(Func<MethodInfo, ITestFixture>) * after: * DefaultTheoremAttribute(ITestFixtureFactory) * * - before: * Func<MethodInfo, ITestFixture> FixtureFactory * after: * ITestFixtureFactory FixtureFactory * * - before: * object FixtureType * after: * Type FixtureType * * ITestCase and TestCase * - before: * ITestCommand ConvertToTestCommand(IMethodInfo, Func<MethodInfo, ITestFixture>); * after: * ITestCommand ConvertToTestCommand(IMethodInfo, ITestFixtureFactory); * * DefaultFirstClassTheoremAttribute * - delete: * DefaultTheoremAttribute(Func<ITestFixture>) * * - before: * DefaultTheoremAttribute(Func<MethodInfo, ITestFixture>) * after: * DefaultTheoremAttribute(ITestFixtureFactory) * * - before: * Func<MethodInfo, ITestFixture> FixtureFactory * after: * ITestFixtureFactory FixtureFactory * * Issue * - https://github.com/jwChung/Experimentalism/issues/30 * * Pull request * - https://github.com/jwChung/Experimentalism/pull/31 */
mit
C#
58300d887a2400e644fe91a5fdf4d4939b807876
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.9.4")] [assembly: AssemblyInformationalVersion("0.9.4")] /* * Version 0.9.4 * * Lets AutoFixtureAdapter return itself for the request as type of * ITestFixture and AutoFixtureAdapter. * * BREAKING CHANGE * - AutoFixtureAdapter(ISpecimenContext) -> * AutoFixtureAdapter(IFixture) */
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.9.3")] [assembly: AssemblyInformationalVersion("0.9.3")] /* * Version 0.9.3 * * Removes an unnecessary guard clause in * AutoFixtureFirstClassTheoremAttribute. */
mit
C#
490693c161686018e5de0d19e3d76a71861464a1
refactor scope to public for test method
mattherman/MbDotNet,mattherman/MbDotNet,SuperDrew/MbDotNet
MbDotNet.Acceptance.Tests/AcceptanceTest.cs
MbDotNet.Acceptance.Tests/AcceptanceTest.cs
 using System; using MbDotNet.Acceptance.Tests.AcceptanceTests; namespace MbDotNet.Acceptance.Tests { internal static class AcceptanceTest { public static void CanCreateImposter(MountebankClient client) => new CanCreateImposterTest(client).Run(); public static void CanDeleteImposter(MountebankClient client) => new CanDeleteImposter(client).Run(); } }
 using System; using MbDotNet.Acceptance.Tests.AcceptanceTests; namespace MbDotNet.Acceptance.Tests { internal static class AcceptanceTest { internal static void CanCreateImposter(MountebankClient client) => new CanCreateImposterTest(client).Run(); public static void CanDeleteImposter(MountebankClient client) => new CanDeleteImposter(client).Run(); } }
mit
C#
81dde7cc3b2dd02aff81a3703839c7776ba6ee3a
Increase the timeout used when checking for valid RPC API endpoints
IWBWbiz/MultiMiner,nwoolls/MultiMiner,nwoolls/MultiMiner,IWBWbiz/MultiMiner
MultiMiner.Xgminer.Discovery/MinerFinder.cs
MultiMiner.Xgminer.Discovery/MinerFinder.cs
using MultiMiner.Utility.Net; using System; using System.Collections.Generic; using System.Net; using MultiMiner.Xgminer.Api; namespace MultiMiner.Xgminer.Discovery { public class MinerFinder { public static List<IPEndPoint> Find(string ipRange, int startingPort, int endingPort) { if (startingPort > endingPort) throw new ArgumentException(); List<IPEndPoint> endpoints = PortScanner.Find(ipRange, startingPort, endingPort); List<IPEndPoint> miners = new List<IPEndPoint>(); foreach (IPEndPoint ipEndpoint in endpoints) if (EndpointIsMiner(ipEndpoint)) miners.Add(ipEndpoint); return miners; } public static List<IPEndPoint> Check(List<IPEndPoint> possibleMiners) { List<IPEndPoint> actualMiners = new List<IPEndPoint>(); foreach (IPEndPoint possibleMiner in possibleMiners) if (EndpointIsMiner(possibleMiner)) actualMiners.Add(possibleMiner); return actualMiners; } private static bool EndpointIsMiner(IPEndPoint ipEndpoint) { bool endpointIsMiner = false; ApiContext context = new ApiContext(ipEndpoint.Port, ipEndpoint.Address.ToString()); string response = null; try { //give the call more time than default (500 ms) //we want to minimize removing valid endpoints due to //device resource limitations const int TimeoutMs = 1500; response = context.GetResponse(ApiVerb.Version, TimeoutMs); } catch (Exception) { response = null; } if (!String.IsNullOrEmpty(response) && response.Contains("VERSION")) endpointIsMiner = true; return endpointIsMiner; } } }
using MultiMiner.Utility.Net; using System; using System.Collections.Generic; using System.Net; using MultiMiner.Xgminer.Api; namespace MultiMiner.Xgminer.Discovery { public class MinerFinder { public static List<IPEndPoint> Find(string ipRange, int startingPort, int endingPort) { if (startingPort > endingPort) throw new ArgumentException(); List<IPEndPoint> endpoints = PortScanner.Find(ipRange, startingPort, endingPort); List<IPEndPoint> miners = new List<IPEndPoint>(); foreach (IPEndPoint ipEndpoint in endpoints) if (EndpointIsMiner(ipEndpoint)) miners.Add(ipEndpoint); return miners; } public static List<IPEndPoint> Check(List<IPEndPoint> possibleMiners) { List<IPEndPoint> actualMiners = new List<IPEndPoint>(); foreach (IPEndPoint possibleMiner in possibleMiners) if (EndpointIsMiner(possibleMiner)) actualMiners.Add(possibleMiner); return actualMiners; } private static bool EndpointIsMiner(IPEndPoint ipEndpoint) { bool endpointIsMiner = false; ApiContext context = new ApiContext(ipEndpoint.Port, ipEndpoint.Address.ToString()); string response = null; try { response = context.GetResponse(ApiVerb.Version); } catch (Exception) { response = null; } if (!String.IsNullOrEmpty(response) && response.Contains("VERSION")) endpointIsMiner = true; return endpointIsMiner; } } }
mit
C#
fa60d9582c4c57101b328f4770e0e37b8fa4385e
add class method PostponeNextTime()
NDark/ndinfrastructure,NDark/ndinfrastructure
Unity/Timer/CountDownTimer.cs
Unity/Timer/CountDownTimer.cs
/** MIT License Copyright (c) 2017 NDark 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. */ /** @file CountDownTimer.cs @author NDark @date 20170420 by NDark . add IsActive . add Active() . add Elapsedtime() . add RemainingTime() . add NextTime @date 20170422 by NDark . modify Rewind() and IsReady() to accept argument. */ public class CountDownTimer { public bool IsActive { get; set; } public void Active( bool _Set ) { this.IsActive = _Set; } public void Rewind( float _NowTime ) { m_NextTime = _NowTime + m_IntervalSec; } public bool IsReady( float _NowTime ) { return ( _NowTime > m_NextTime ) ; } public float Elapsedtime( float _NowTime , bool _AlwaysNoneNegative ) { float ret = this.IntervalSec - this.RemainingTime( _NowTime , false ) ; if( true == _AlwaysNoneNegative && ret < 0.0f ) { ret = 0.0f ; } return ret ; } public float RemainingTime( float _NowTime , bool _AlwaysNoneNegative ) { float ret = m_NextTime - _NowTime ; if( true == _AlwaysNoneNegative && ret < 0.0f ) { ret = 0.0f ; } return ret ; } public void PostponeNextTime( float _PostponeSec ) { m_NextTime += _PostponeSec ; } public float NextTime { get { return m_NextTime ; } } float m_NextTime = 0.0f ; public float IntervalSec { get { return m_IntervalSec; } set { m_IntervalSec = value ; } } float m_IntervalSec = float.MaxValue ; }
/** MIT License Copyright (c) 2017 NDark 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. */ /** @file CountDownTimer.cs @author NDark @date 20170420 by NDark . add IsActive . add Active() . add Elapsedtime() . add RemainingTime() . add NextTime @date 20170422 by NDark . modify Rewind() and IsReady() to accept argument. */ public class CountDownTimer { public bool IsActive { get; set; } public void Active( bool _Set ) { this.IsActive = _Set; } public void Rewind( float _NowTime ) { m_NextTime = _NowTime + m_IntervalSec; } public bool IsReady( float _NowTime ) { return ( _NowTime > m_NextTime ) ; } public float Elapsedtime( float _NowTime , bool _AlwaysNoneNegative ) { float ret = this.IntervalSec - this.RemainingTime( _NowTime , false ) ; if( true == _AlwaysNoneNegative && ret < 0.0f ) { ret = 0.0f ; } return ret ; } public float RemainingTime( float _NowTime , bool _AlwaysNoneNegative ) { float ret = m_NextTime - _NowTime ; if( true == _AlwaysNoneNegative && ret < 0.0f ) { ret = 0.0f ; } return ret ; } public float NextTime { get { return m_NextTime ; } } float m_NextTime = 0.0f ; public float IntervalSec { get { return m_IntervalSec; } set { m_IntervalSec = value ; } } float m_IntervalSec = float.MaxValue ; }
mit
C#
6d432764ad69872c245967843304546b03e7c8ef
Add missing reference
ppy/osu-framework,smoogipooo/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,ZLima12/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,ZLima12/osu-framework,ppy/osu-framework,EVAST9919/osu-framework
osu.Framework.iOS/GameViewController.cs
osu.Framework.iOS/GameViewController.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 CoreGraphics; using UIKit; namespace osu.Framework.iOS { internal class GameViewController : UIViewController { public override bool PrefersStatusBarHidden() => true; public override UIRectEdge PreferredScreenEdgesDeferringSystemGestures => UIRectEdge.All; public override void DidReceiveMemoryWarning() { base.DidReceiveMemoryWarning(); SixLabors.ImageSharp.Configuration.Default.MemoryAllocator.ReleaseRetainedResources(); GC.Collect(); } public override void ViewWillTransitionToSize(CGSize toSize, IUIViewControllerTransitionCoordinator coordinator) { coordinator.AnimateAlongsideTransition(_ => { }, _ => UIView.AnimationsEnabled = true); UIView.AnimationsEnabled = false; base.ViewWillTransitionToSize(toSize, coordinator); (View as IOSGameView)?.RequestResizeFrameBuffer(); } } }
// 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 CoreGraphics; using UIKit; namespace osu.Framework.iOS { internal class GameViewController : UIViewController { public override bool PrefersStatusBarHidden() => true; public override UIRectEdge PreferredScreenEdgesDeferringSystemGestures => UIRectEdge.All; public override void DidReceiveMemoryWarning() { base.DidReceiveMemoryWarning(); SixLabors.ImageSharp.Configuration.Default.MemoryAllocator.ReleaseRetainedResources(); GC.Collect(); } public override void ViewWillTransitionToSize(CGSize toSize, IUIViewControllerTransitionCoordinator coordinator) { coordinator.AnimateAlongsideTransition(_ => { }, _ => UIView.AnimationsEnabled = true); UIView.AnimationsEnabled = false; base.ViewWillTransitionToSize(toSize, coordinator); (View as IOSGameView)?.RequestResizeFrameBuffer(); } } }
mit
C#
0acc86f75724e6d1e5f348ee7878b7249be6078c
Split line for readability
UselessToucan/osu,peppy/osu,ppy/osu,peppy/osu,peppy/osu,NeoAdonis/osu,smoogipoo/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu-new,NeoAdonis/osu,UselessToucan/osu,ppy/osu,UselessToucan/osu,smoogipooo/osu,smoogipoo/osu,ppy/osu
osu.Game/Skinning/LegacyScoreCounter.cs
osu.Game/Skinning/LegacyScoreCounter.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; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osuTK; namespace osu.Game.Skinning { public class LegacyScoreCounter : ScoreCounter { private readonly ISkin skin; protected override double RollingDuration => 1000; protected override Easing RollingEasing => Easing.Out; public new Bindable<double> Current { get; } = new Bindable<double>(); public LegacyScoreCounter(ISkin skin) : base(6) { Anchor = Anchor.TopRight; Origin = Anchor.TopRight; this.skin = skin; // base class uses int for display, but externally we bind to ScoreProcessor as a double for now. Current.BindValueChanged(v => base.Current.Value = (int)v.NewValue); Scale = new Vector2(0.96f); Margin = new MarginPadding(10); } protected sealed override OsuSpriteText CreateSpriteText() => (OsuSpriteText)skin.GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ScoreText)) .With(s => s.Anchor = s.Origin = Anchor.TopRight); } }
// 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; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osuTK; namespace osu.Game.Skinning { public class LegacyScoreCounter : ScoreCounter { private readonly ISkin skin; protected override double RollingDuration => 1000; protected override Easing RollingEasing => Easing.Out; public new Bindable<double> Current { get; } = new Bindable<double>(); public LegacyScoreCounter(ISkin skin) : base(6) { Anchor = Anchor.TopRight; Origin = Anchor.TopRight; this.skin = skin; // base class uses int for display, but externally we bind to ScoreProcessor as a double for now. Current.BindValueChanged(v => base.Current.Value = (int)v.NewValue); Scale = new Vector2(0.96f); Margin = new MarginPadding(10); } protected sealed override OsuSpriteText CreateSpriteText() => ((OsuSpriteText)skin.GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ScoreText))).With(s => s.Anchor = s.Origin = Anchor.TopRight); } }
mit
C#
ac4bdc87d8425c678f881673798a05a2c01a94fb
Update the version number.
rockfordlhotka/csla,JasonBock/csla,ronnymgm/csla-light,MarimerLLC/csla,rockfordlhotka/csla,JasonBock/csla,jonnybee/csla,ronnymgm/csla-light,MarimerLLC/csla,BrettJaner/csla,BrettJaner/csla,MarimerLLC/csla,jonnybee/csla,rockfordlhotka/csla,BrettJaner/csla,jonnybee/csla,JasonBock/csla,ronnymgm/csla-light
csla20cs/Csla/Properties/AssemblyInfo.cs
csla20cs/Csla/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("CSLA .NET")] [assembly: AssemblyDescription("CSLA .NET Framework")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Rockford Lhotka")] [assembly: AssemblyProduct("CSLA .NET")] [assembly: AssemblyCopyright("Copyright © Rockford Lhotka 2006")] [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("43110d9d-9176-498d-95e0-2be52fcd11d2")] // 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("2.0.2.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("CSLA .NET")] [assembly: AssemblyDescription("CSLA .NET Framework")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Rockford Lhotka")] [assembly: AssemblyProduct("CSLA .NET")] [assembly: AssemblyCopyright("Copyright © Rockford Lhotka 2006")] [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("43110d9d-9176-498d-95e0-2be52fcd11d2")] // 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("2.0.1.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
16ad4597ac023fc55fc86a30741c53b837f5356a
Update to use private setters as auto setters are not present pre C# 6.0
dwhelan/atdd_training,dwhelan/atdd_training
cs/WebSpecs/Support/Page.cs
cs/WebSpecs/Support/Page.cs
using System.Collections.Generic; using System.Linq; namespace WebSpecs.Support { public abstract class Page { public string Host { get; private set; } public List<string> HostAliases { get; private set; } public string Path { get; private set; } public bool SSL { get; private set; } protected readonly PageBrowserSession Browser; protected Page(PageBrowserSession browser, string host, string path, bool ssl=false, params string[] hostAliases) { Host = host; HostAliases = hostAliases.ToList(); HostAliases.Add(host); Path = path; SSL = ssl; if (browser != null) { Browser = browser; Browser.Configuration.AppHost = host; Browser.Configuration.SSL = SSL; } } public void Visit() { Browser.Visit(Path); } public string Title { get { return Browser.Title; } } } }
using System.Collections.Generic; using System.Linq; namespace WebSpecs.Support { public abstract class Page { public string Host { get; private set; } public List<string> HostAliases { get; } public string Path { get; } public bool SSL { get; } protected readonly PageBrowserSession Browser; protected Page(PageBrowserSession browser, string host, string path, bool ssl=false, params string[] hostAliases) { Host = host; HostAliases = hostAliases.ToList(); HostAliases.Add(host); Path = path; SSL = ssl; if (browser != null) { Browser = browser; Browser.Configuration.AppHost = host; Browser.Configuration.SSL = SSL; } } public void Visit() { Browser.Visit(Path); } public string Title { get { return Browser.Title; } } } }
mit
C#
f8054b7cd5b5e9581cf18a217727caa72d4146de
add EventStreamAppendReadTest
IvanZheng/IFramework,IvanZheng/IFramework,IvanZheng/IFramework
Src/IFramework.Test/EventStoreTests.cs
Src/IFramework.Test/EventStoreTests.cs
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using IFramework.Config; using IFramework.DependencyInjection; using IFramework.DependencyInjection.Autofac; using IFramework.Event; using IFramework.EventStore.Client; using IFramework.JsonNet; using IFramework.Log4Net; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Xunit; namespace IFramework.Test { public class EventStoreTests { public EventStoreTests() { var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json"); var configuration = builder.Build(); var services = new ServiceCollection(); services.AddAutofacContainer() .AddConfiguration(configuration) .AddCommonComponents() //.UseMicrosoftDependencyInjection() //.UseUnityContainer() //.UseAutofacContainer() //.UseConfiguration(configuration) //.UseCommonComponents() .AddJsonNet() .AddLog4Net() .AddEventStoreClient(); ObjectProviderFactory.Instance.Build(services); } [Fact] public async Task EventStreamAppendReadTest() { var streamId = "1"; var expectedVersion = 0; using (var serviceScope = ObjectProviderFactory.CreateScope()) { var eventStore = serviceScope.GetService<IEventStore>(); var events = (await eventStore.GetEvents(streamId) .ConfigureAwait(false)).Cast<IAggregateRootEvent>() .ToArray(); expectedVersion = events.LastOrDefault()?.Version ?? 0; //await eventStore.AppendEvents(streamId, expectedVersion, new []{new AccountModified(), }); } } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using IFramework.Config; using IFramework.DependencyInjection; using IFramework.DependencyInjection.Autofac; using IFramework.Event; using IFramework.EventStore.Client; using IFramework.JsonNet; using IFramework.Log4Net; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Xunit; namespace IFramework.Test { public class EventStoreTests { public EventStoreTests() { var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json"); var configuration = builder.Build(); var services = new ServiceCollection(); services.AddAutofacContainer() .AddConfiguration(configuration) .AddCommonComponents() //.UseMicrosoftDependencyInjection() //.UseUnityContainer() //.UseAutofacContainer() //.UseConfiguration(configuration) //.UseCommonComponents() .AddJsonNet() .AddLog4Net() .AddEventStoreClient(); ObjectProviderFactory.Instance.Build(services); } [Fact] public async Task EventStreamAppendReadTest() { var streamId = "1"; var expectedVersion = 0; using (var serviceScope = ObjectProviderFactory.CreateScope()) { var eventStore = serviceScope.GetService<IEventStore>(); var events = await eventStore.GetEvents(streamId) .ConfigureAwait(false); //expectedVersion = events.FirstOrDefault(). //eventStore.AppendEvents(streamId, expectedVersion, events); } } } }
mit
C#
1ef597afd9ea95c2bb6dfd56174b98ff1e3879c4
Configure context.
beta-tank/TicTacToe,beta-tank/TicTacToe,beta-tank/TicTacToe
TicTacToe/Data/ApplicationDbContext.cs
TicTacToe/Data/ApplicationDbContext.cs
using System.Data.Entity; using TicTacToe.Core; namespace TicTacToe.Web.Data { public class ApplicationDbContext : DbContext { public ApplicationDbContext() : base("DefaultConnection") { Database.SetInitializer<ApplicationDbContext>(new DropCreateDatabaseIfModelChanges<ApplicationDbContext>()); } public virtual void Commit() { SaveChanges(); } public DbSet<Game> Games { get; set; } public DbSet<Field> Fields { get; set; } public DbSet<Move> Moves { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Entity<Game>() .HasMany<Move>(g => g.Moves) .WithRequired(m => m.Game); modelBuilder.Entity<Game>() .HasRequired<Field>(g => g.Field) .WithRequiredDependent(f => f.Game); } } }
using System.Data.Entity; namespace TicTacToe.Web.Data { public class ApplicationDbContext : DbContext { } }
mit
C#
c3e4a08b007a00ac848f89d6a10b580bc1997032
Fix using for Release build
qianlifeng/Wox,lances101/Wox,qianlifeng/Wox,Wox-launcher/Wox,lances101/Wox,Wox-launcher/Wox,qianlifeng/Wox
Wox.Infrastructure/Logger/Log.cs
Wox.Infrastructure/Logger/Log.cs
using NLog; using Wox.Infrastructure.Exception; namespace Wox.Infrastructure.Logger { public class Log { private static NLog.Logger logger = LogManager.GetCurrentClassLogger(); public static void Error(System.Exception e) { #if DEBUG throw e; #else while (e.InnerException != null) { logger.Error(e.Message); logger.Error(e.StackTrace); e = e.InnerException; } #endif } public static void Debug(string msg) { System.Diagnostics.Debug.WriteLine($"DEBUG: {msg}"); logger.Debug(msg); } public static void Info(string msg) { System.Diagnostics.Debug.WriteLine($"INFO: {msg}"); logger.Info(msg); } public static void Warn(string msg) { System.Diagnostics.Debug.WriteLine($"WARN: {msg}"); logger.Warn(msg); } public static void Fatal(System.Exception e) { #if DEBUG throw e; #else logger.Fatal(ExceptionFormatter.FormatExcpetion(e)); #endif } } }
using NLog; namespace Wox.Infrastructure.Logger { public class Log { private static NLog.Logger logger = LogManager.GetCurrentClassLogger(); public static void Error(System.Exception e) { #if DEBUG throw e; #else while (e.InnerException != null) { logger.Error(e.Message); logger.Error(e.StackTrace); e = e.InnerException; } #endif } public static void Debug(string msg) { System.Diagnostics.Debug.WriteLine($"DEBUG: {msg}"); logger.Debug(msg); } public static void Info(string msg) { System.Diagnostics.Debug.WriteLine($"INFO: {msg}"); logger.Info(msg); } public static void Warn(string msg) { System.Diagnostics.Debug.WriteLine($"WARN: {msg}"); logger.Warn(msg); } public static void Fatal(System.Exception e) { #if DEBUG throw e; #else logger.Fatal(ExceptionFormatter.FormatExcpetion(e)); #endif } } }
mit
C#
2079ba3f4de4b204ac2f60531f79a8d63ff60159
Bump version to 1.1.1
rosolko/WebDriverManager.Net
WebDriverManager/Properties/AssemblyInfo.cs
WebDriverManager/Properties/AssemblyInfo.cs
using System; 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("WebDriverManager.Net")] [assembly: AssemblyDescription("Automatic Selenium WebDriver binaries management for .Net")] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif [assembly: AssemblyCompany("Alexander Rosolko")] [assembly: AssemblyProduct("WebDriverManager.Net")] [assembly: AssemblyCopyright("Copyright © Alexander Rosolko 2016")] // 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("0066742e-391b-407c-9dc1-ff71a60bec53")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: //[assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.1.1.0")] [assembly: AssemblyFileVersion("1.1.1.0")]
using System; 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("WebDriverManager.Net")] [assembly: AssemblyDescription("Automatic Selenium WebDriver binaries management for .Net")] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif [assembly: AssemblyCompany("Alexander Rosolko")] [assembly: AssemblyProduct("WebDriverManager.Net")] [assembly: AssemblyCopyright("Copyright © Alexander Rosolko 2016")] // 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("0066742e-391b-407c-9dc1-ff71a60bec53")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: //[assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.1.0.0")] [assembly: AssemblyFileVersion("1.1.0.0")]
mit
C#
0de2961330df2f953ad52d7630c908cdcdd7b6d7
Change the location of where the Enums are generated to be at the same level as the types.
AlexGhiondea/SmugMug.NET
src/tools/SmugMugCodeGen/Options.cs
src/tools/SmugMugCodeGen/Options.cs
// Copyright (c) Alex Ghiondea. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.IO; namespace SmugMugCodeGen { public class Options { public string OutputDir { get; private set; } public string OutputDirEnums { get; private set; } public string[] InputFiles { get; private set; } public Options(string[] args) { OutputDir = args[0]; OutputDirEnums = Path.Combine(OutputDir, @"\..\Enums"); // Copy the input files from the args array. InputFiles = new string[args.Length - 1]; Array.Copy(args, 1, InputFiles, 0, args.Length - 1); } } }
// Copyright (c) Alex Ghiondea. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.IO; namespace SmugMugCodeGen { public class Options { public string OutputDir { get; private set; } public string OutputDirEnums { get; private set; } public string[] InputFiles { get; private set; } public Options(string[] args) { OutputDir = args[0]; OutputDirEnums = Path.Combine(OutputDir, "Enums"); // Copy the input files from the args array. InputFiles = new string[args.Length - 1]; Array.Copy(args, 1, InputFiles, 0, args.Length - 1); } } }
mit
C#
51951e5e4f1dcfbce2b7c98786fb22406fd4c3b6
修改 Delete view (加入Rating欄位).
NemoChenTW/MvcMovie,NemoChenTW/MvcMovie,NemoChenTW/MvcMovie
src/MvcMovie/Views/Movies/Delete.cshtml
src/MvcMovie/Views/Movies/Delete.cshtml
@model MvcMovie.Models.Movie @{ ViewData["Title"] = "Delete"; } <h2>Delete</h2> <h3>Are you sure you want to delete this?</h3> <div> <h4>Movie</h4> <hr /> <dl class="dl-horizontal"> <dt> @Html.DisplayNameFor(model => model.Genre) </dt> <dd> @Html.DisplayFor(model => model.Genre) </dd> <dt> @Html.DisplayNameFor(model => model.Price) </dt> <dd> @Html.DisplayFor(model => model.Price) </dd> <dt> @Html.DisplayNameFor(model => model.ReleaseDate) </dt> <dd> @Html.DisplayFor(model => model.ReleaseDate) </dd> <dt> @Html.DisplayNameFor(model => model.Title) </dt> <dd> @Html.DisplayFor(model => model.Title) </dd> <dt> @Html.DisplayNameFor(model => model.Rating) </dt> <dd> @Html.DisplayFor(model => model.Rating) </dd> </dl> <form asp-action="Delete"> <div class="form-actions no-color"> <input type="submit" value="Delete" class="btn btn-default" /> | <a asp-action="Index">Back to List</a> </div> </form> </div>
@model MvcMovie.Models.Movie @{ ViewData["Title"] = "Delete"; } <h2>Delete</h2> <h3>Are you sure you want to delete this?</h3> <div> <h4>Movie</h4> <hr /> <dl class="dl-horizontal"> <dt> @Html.DisplayNameFor(model => model.Genre) </dt> <dd> @Html.DisplayFor(model => model.Genre) </dd> <dt> @Html.DisplayNameFor(model => model.Price) </dt> <dd> @Html.DisplayFor(model => model.Price) </dd> <dt> @Html.DisplayNameFor(model => model.ReleaseDate) </dt> <dd> @Html.DisplayFor(model => model.ReleaseDate) </dd> <dt> @Html.DisplayNameFor(model => model.Title) </dt> <dd> @Html.DisplayFor(model => model.Title) </dd> </dl> <form asp-action="Delete"> <div class="form-actions no-color"> <input type="submit" value="Delete" class="btn btn-default" /> | <a asp-action="Index">Back to List</a> </div> </form> </div>
apache-2.0
C#
90878c296e003053d424b361421acc02ad7038a2
Update NewOrderResponse.cs
ilkerulutas/BinanceSdk
M3C.Finance.BinanceSdk/ResponseObjects/NewOrderResponse.cs
M3C.Finance.BinanceSdk/ResponseObjects/NewOrderResponse.cs
using Newtonsoft.Json; namespace M3C.Finance.BinanceSdk.ResponseObjects { public class NewOrderResponse { [JsonProperty("symbol")] public string Symbol { get; set; } [JsonProperty("orderId")] public long OrderId { get; set; } [JsonProperty("clientOrderId")] public string ClientOrderId { get; set; } [JsonProperty("transactTime")] public long TransactionTime { get; set; } } }
using Newtonsoft.Json; namespace M3C.Finance.BinanceSdk.ResponseObjects { public class NewOrderResponse { [JsonProperty("symbol")] public string Symbol { get; set; } [JsonProperty("orderId")] public int OrderId { get; set; } [JsonProperty("clientOrderId")] public string ClientOrderId { get; set; } [JsonProperty("transactTime")] public long TransactionTime { get; set; } } }
mit
C#
aec395a0b20bb945c1e59ea23f97546e3f033e4a
Update Specular.cs
matt77hias/cs-smallpt
cs-smallpt/core/Specular.cs
cs-smallpt/core/Specular.cs
using System; namespace cs_smallpt { public static class Specular { public static double Reflectance0(double n1, double n2) { double sqrt_R0 = (n1 - n2) / (n1 + n2); return sqrt_R0 * sqrt_R0; } public static double SchlickReflectance(double n1, double n2, double c) { double R0 = Reflectance0(n1, n2); return R0 + (1 - R0) * c * c * c * c * c; } public static Vector3 IdealSpecularReflect(Vector3 d, Vector3 n) { return d - 2.0 * n.Dot(d) * n; } public static Vector3 IdealSpecularTransmit(Vector3 d, Vector3 n, double n_out, double n_in, out double pr, RNG rng) { Vector3 d_Re = IdealSpecularReflect(d, n); bool out_to_in = n.Dot(d) < 0; Vector3 nl = out_to_in ? n : -n; double nn = out_to_in ? n_out / n_in : n_in / n_out; double cos_theta = d.Dot(nl); double cos2_phi = 1.0 - nn * nn * (1.0 - cos_theta * cos_theta); // Total Internal Reflection if (cos2_phi < 0) { pr = 1.0; return d_Re; } Vector3 d_Tr = (nn * d - nl * (nn * cos_theta + Math.Sqrt(cos2_phi))).Normalize(); double c = 1.0 - (out_to_in ? -cos_theta : d_Tr.Dot(n)); double Re = SchlickReflectance(n_out, n_in, c); double p_Re = 0.25 + 0.5 * Re; if (rng.UniformFloat() < p_Re) { pr = (Re / p_Re); return d_Re; } else { double Tr = 1.0 - Re; double p_Tr = 1.0 - p_Re; pr = (Tr / p_Tr); return d_Tr; } } } }
using System; namespace cs_smallpt { public class Specular { public static double Reflectance0(double n1, double n2) { double sqrt_R0 = (n1 - n2) / (n1 + n2); return sqrt_R0 * sqrt_R0; } public static double SchlickReflectance(double n1, double n2, double c) { double R0 = Reflectance0(n1, n2); return R0 + (1 - R0) * c * c * c * c * c; } public static Vector3 IdealSpecularReflect(Vector3 d, Vector3 n) { return d - 2.0 * n.Dot(d) * n; } public static Vector3 IdealSpecularTransmit(Vector3 d, Vector3 n, double n_out, double n_in, out double pr, RNG rng) { Vector3 d_Re = IdealSpecularReflect(d, n); bool out_to_in = n.Dot(d) < 0; Vector3 nl = out_to_in ? n : -n; double nn = out_to_in ? n_out / n_in : n_in / n_out; double cos_theta = d.Dot(nl); double cos2_phi = 1.0 - nn * nn * (1.0 - cos_theta * cos_theta); // Total Internal Reflection if (cos2_phi < 0) { pr = 1.0; return d_Re; } Vector3 d_Tr = (nn * d - nl * (nn * cos_theta + Math.Sqrt(cos2_phi))).Normalize(); double c = 1.0 - (out_to_in ? -cos_theta : d_Tr.Dot(n)); double Re = SchlickReflectance(n_out, n_in, c); double p_Re = 0.25 + 0.5 * Re; if (rng.UniformFloat() < p_Re) { pr = (Re / p_Re); return d_Re; } else { double Tr = 1.0 - Re; double p_Tr = 1.0 - p_Re; pr = (Tr / p_Tr); return d_Tr; } } } }
mit
C#
2263b65f9d92c0e7e6d4573e95ab7a83156a720c
Update ASP.NET Core sample code to match actual
NickCraver/StackExchange.Exceptional,NickCraver/StackExchange.Exceptional
samples/Samples.AspNetCore/Startup.cs
samples/Samples.AspNetCore/Startup.cs
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; namespace Samples.AspNetCore { public class Startup { public Startup(IConfiguration configuration, IHostingEnvironment env) { Configuration = configuration; HostingEnvironment = env; } public IConfiguration Configuration { get; } public IHostingEnvironment HostingEnvironment { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc(); // Make IOptions<ExceptionalSettings> available for injection everywhere services.AddExceptional(Configuration.GetSection("Exceptional"), settings => { //settings.DefaultStore.ApplicationName = "Samples.AspNetCore"; settings.UseExceptionalPageOnThrow = HostingEnvironment.IsDevelopment(); }); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app) { // Boilerplate we're no longer using with Exceptional //if (env.IsDevelopment()) //{ // app.UseDeveloperExceptionPage(); // app.UseBrowserLink(); //} //else //{ // app.UseExceptionHandler("/Home/Error"); //} app.UseExceptional(); app.UseStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); } } }
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; namespace Samples.AspNetCore { public class Startup { public Startup(IConfiguration configuration, IHostingEnvironment env) { Configuration = configuration; HostingEnvironment = env; } public IConfiguration Configuration { get; } public IHostingEnvironment HostingEnvironment { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc(); // Make IOptions<ExceptionalSettings> available for injection everywhere services.AddExceptional(Configuration.GetSection("Exceptional"), settings => { //settings.ApplicationName = "Samples.AspNetCore"; settings.UseExceptionalPageOnThrow = HostingEnvironment.IsDevelopment(); }); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app) { // Boilerplate we're no longer using with Exceptional //if (env.IsDevelopment()) //{ // app.UseDeveloperExceptionPage(); // app.UseBrowserLink(); //} //else //{ // app.UseExceptionHandler("/Home/Error"); //} app.UseExceptional(); app.UseStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); } } }
apache-2.0
C#
35affff08eabce3c14acbaa4f7e74c3bac3486fc
add P1_headset
Fangh/LoveLetter
Assets/Scripts/LevelManager.cs
Assets/Scripts/LevelManager.cs
using UnityEngine; using System.Collections; using DG.Tweening; using UnityStandardAssets.ImageEffects; public class LevelManager : MonoBehaviour { public static LevelManager Instance; [HideInInspector] public int currentLevel = 0; public GameObject[] levelsContainer; public Vector3[] P1_Offset; public Vector3[] P2_Offset; public int[] scoreTresholds; public GameObject P1, P2; public GameObject P1_heaset, P1_hand, P2_hand; public GameObject sceneryIsland; public GameObject sceneryMoon; void Awake() { Instance = this; } void Update() { if (Input.GetKeyDown (KeyCode.A)) SetupNewScenery (sceneryIsland, sceneryMoon, -1.16f); } public void SetUpNewLevel(int newLevel) { Debug.Log ("going now to level " + newLevel+1); if (levelsContainer[currentLevel] != null) levelsContainer[currentLevel].SetActive(false); if (levelsContainer[newLevel] != null) levelsContainer[newLevel].SetActive(true); currentLevel = newLevel; GameManager.Instance.scoreThreshold = scoreTresholds[newLevel]; P1.transform.localPosition = P1_Offset[newLevel]; P1_heaset.transform.localPosition = P1_Offset[newLevel]; P1_hand.transform.localPosition = P1_Offset[newLevel]; P2.transform.localPosition = P2_Offset[newLevel]; P2_hand.transform.localPosition = P2_Offset[newLevel]; } public void SetupNewScenery(GameObject oldScenery, GameObject newScenery, float newGravity = -9.81f) { DOTween.To (() => GameObject.Find ("CenterEyeAnchor").GetComponent<VignetteAndChromaticAberration> ().intensity, x => GameObject.Find ("CenterEyeAnchor").GetComponent<VignetteAndChromaticAberration> ().intensity = x, 1, 1).SetLoops(2, LoopType.Yoyo); StartCoroutine (ModifyScene(1f, oldScenery, newScenery, newGravity)); } private IEnumerator ModifyScene(float waitTime, GameObject oldScenery, GameObject newScenery, float newGravity) { yield return new WaitForSeconds (waitTime); oldScenery.SetActive (false); newScenery.SetActive (true); Physics.gravity = new Vector3 (0, newGravity, 0); } }
using UnityEngine; using System.Collections; using DG.Tweening; using UnityStandardAssets.ImageEffects; public class LevelManager : MonoBehaviour { public static LevelManager Instance; [HideInInspector] public int currentLevel = 0; public GameObject[] levelsContainer; public Vector3[] P1_Offset; public Vector3[] P2_Offset; public int[] scoreTresholds; public GameObject P1, P2; public GameObject P1_hand, P2_hand; public GameObject sceneryIsland; public GameObject sceneryMoon; void Awake() { Instance = this; } void Update() { if (Input.GetKeyDown (KeyCode.A)) SetupNewScenery (sceneryIsland, sceneryMoon, -1.16f); } public void SetUpNewLevel(int newLevel) { Debug.Log ("going now to level " + newLevel+1); if (levelsContainer[currentLevel] != null) levelsContainer[currentLevel].SetActive(false); if (levelsContainer[newLevel] != null) levelsContainer[newLevel].SetActive(true); currentLevel = newLevel; GameManager.Instance.scoreThreshold = scoreTresholds[newLevel]; P1.transform.localPosition = P1_Offset[newLevel]; P1_hand.transform.localPosition = P1_Offset[newLevel]; P2.transform.localPosition = P2_Offset[newLevel]; P2_hand.transform.localPosition = P2_Offset[newLevel]; } public void SetupNewScenery(GameObject oldScenery, GameObject newScenery, float newGravity = -9.81f) { DOTween.To (() => GameObject.Find ("CenterEyeAnchor").GetComponent<VignetteAndChromaticAberration> ().intensity, x => GameObject.Find ("CenterEyeAnchor").GetComponent<VignetteAndChromaticAberration> ().intensity = x, 1, 1).SetLoops(2, LoopType.Yoyo); StartCoroutine (ModifyScene(1f, oldScenery, newScenery, newGravity)); } private IEnumerator ModifyScene(float waitTime, GameObject oldScenery, GameObject newScenery, float newGravity) { yield return new WaitForSeconds (waitTime); oldScenery.SetActive (false); newScenery.SetActive (true); Physics.gravity = new Vector3 (0, newGravity, 0); } }
unlicense
C#
2f22973d61f2b25c6e26955faa7b59039ec4e338
fix script according to code standard
NataliaDSmirnova/CGAdvanced2017
Assets/Scripts/RenderObject.cs
Assets/Scripts/RenderObject.cs
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class RenderObject : MonoBehaviour { // input objects public Camera mainCamera; public GameObject renderObject; // private objects private RawImage image; private RenderTexture renderTexture; void Start() { // get raw image from scene (see RTSprite) image = GetComponent<RawImage>(); // create temprorary texture of screen size renderTexture = RenderTexture.GetTemporary(Screen.width, Screen.height); } void Update() { // rescale raw image size depending on screen size float imageHeight = image.rectTransform.sizeDelta.y; float imageWidth = imageHeight * Screen.width / (float) Screen.height; image.rectTransform.sizeDelta = new Vector2(imageWidth, imageHeight); // fix position of image in left lower corner image.rectTransform.anchoredPosition = new Vector2((imageWidth - Screen.width) / 2, (imageHeight - Screen.height) / 2); } void OnRenderObject() { // set our temprorary texture as target for rendering Graphics.SetRenderTarget(renderTexture); // clear render texture GL.Clear(false, true, new Color(0f, 0f, 0f)); if (renderObject == null) { Debug.Log("Object for rendering is not set"); return; } // get mesh from input object Mesh objectMesh = renderObject.GetComponent<MeshFilter>().sharedMesh; if (objectMesh == null) { Debug.Log("Can't get mesh from input object"); return; } // get mesh renderer from input object var renderer = renderObject.GetComponent<MeshRenderer>(); if (renderer == null) { Debug.Log("Can't get mesh renderer from input object"); return; } // activate first shader pass for our renderer renderer.material.SetPass(0); // draw mesh of input object to render texture Graphics.DrawMeshNow(objectMesh, renderObject.transform.localToWorldMatrix); // set texture of raw image equals to our render texture image.texture = renderTexture; // render again to backbuffer Graphics.SetRenderTarget(null); } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class RenderObject : MonoBehaviour { // input objects public GameObject renderObject; public Camera mainCamera; // private objects private RenderTexture renderTexture; private RawImage image; void Start() { // get raw image from scene (see RTSprite) image = GetComponent<RawImage>(); // create temprorary texture of screen size renderTexture = RenderTexture.GetTemporary(Screen.width, Screen.height); } void Update() { // rescale raw image size depending on screen size float height = image.rectTransform.sizeDelta.y; float width = height * Screen.width / (float)Screen.height; image.rectTransform.sizeDelta = new Vector2(width, height); // fix position of image in left lower corner image.rectTransform.anchoredPosition = new Vector2((width - Screen.width) / 2, (height - Screen.height) / 2); } void OnRenderObject() { // set our temprorary texture as target for rendering Graphics.SetRenderTarget(renderTexture); // clear render texture GL.Clear(false, true, new Color(0f, 0f, 0f)); if (renderObject == null) { Debug.Log("Object for rendering is not set"); return; } // get mesh from input object Mesh objectMesh = renderObject.GetComponent<MeshFilter>().sharedMesh; if (objectMesh == null) { Debug.Log("Can't get mesh from input object"); return; } // get mesh renderer from input object var renderer = renderObject.GetComponent<MeshRenderer>(); if (renderer == null) { Debug.Log("Can't get mesh renderer from input object"); return; } // activate first shader pass for our renderer renderer.material.SetPass(0); // draw mesh of input object to render texture Graphics.DrawMeshNow(objectMesh, renderObject.transform.localToWorldMatrix); // set texture of raw image equals to our render texture image.texture = renderTexture; // render again to backbuffer Graphics.SetRenderTarget(null); } }
mit
C#
9669e2ab51154d44897c78ed6d6c11b67423f1fd
use nancy
lache/RacingKingLee,lache/RacingKingLee,lache/RacingKingLee,lache/RacingKingLee,lache/RacingKingLee,lache/RacingKingLee,lache/RacingKingLee,lache/RacingKingLee
server/core/api_server/Program.cs
server/core/api_server/Program.cs
namespace api_server { using System; using Nancy.Hosting.Self; class Program { static void Main(string[] args) { var service = new ApiService(ServiceType.NancyFX); service.start(); } } }
namespace api_server { using System; using Nancy.Hosting.Self; class Program { static void Main(string[] args) { var service = new ApiService(ServiceType.AsyncServer); service.start(); } } }
mit
C#
95cad10c973817aba3c033c25a07338883d69682
Add absolute mouse position and selected tile debug values to debug screen.
mitchfizz05/Citysim,pigant/Citysim
Citysim/Views/DebugView.cs
Citysim/Views/DebugView.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using MonoGame.Extended.BitmapFonts; namespace Citysim.Views { public class DebugView : IView { public void LoadContent(ContentManager content) { } public void Render(SpriteBatch spriteBatch, Citysim game, GameTime gameTime) { if (!game.debug) return; // Debug mode disabled StringBuilder sb = new StringBuilder(); sb.AppendLine("Citysim " + Citysim.VERSION); sb.AppendLine("Map size " + game.city.world.height + "x" + game.city.world.width); sb.AppendLine("Camera: " + game.camera.position.X + "," + game.camera.position.Y + " [" + game.camera.speed + "]"); sb.AppendLine("Absolute Mouse Position: " + game.camera.hoveringExact.X + "," + game.camera.hoveringExact.Y); sb.AppendLine("Selected Tile: " + game.camera.hovering.X + "," + game.camera.hovering.Y); spriteBatch.DrawString(game.font, sb, new Vector2(10, 10), Color.Black, 0F, new Vector2(0,0), 0.5F, SpriteEffects.None, 1.0F); } public void Update(Citysim game, GameTime gameTime) { // F3 toggles debug mode if (KeyboardHelper.IsKeyPressed(Keys.F3)) game.debug = !game.debug; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using MonoGame.Extended.BitmapFonts; namespace Citysim.Views { public class DebugView : IView { public void LoadContent(ContentManager content) { } public void Render(SpriteBatch spriteBatch, Citysim game, GameTime gameTime) { if (!game.debug) return; // Debug mode disabled StringBuilder sb = new StringBuilder(); sb.AppendLine("Citysim " + Citysim.VERSION); sb.AppendLine("Map size " + game.city.world.height + "x" + game.city.world.width); sb.AppendLine("Camera: " + game.camera.position.X + "," + game.camera.position.Y + " [" + game.camera.speed + "]"); spriteBatch.DrawString(game.font, sb, new Vector2(10, 10), Color.Black, 0F, new Vector2(0,0), 0.5F, SpriteEffects.None, 1.0F); } public void Update(Citysim game, GameTime gameTime) { // F3 toggles debug mode if (KeyboardHelper.IsKeyPressed(Keys.F3)) game.debug = !game.debug; } } }
mit
C#
862514300b155910d3f8314c39bd59051fa5861f
Update AcceptTermsViewModel
lucasdavid/Gamedalf,lucasdavid/Gamedalf
Gamedalf/ViewModels/TermsViewModels.cs
Gamedalf/ViewModels/TermsViewModels.cs
using Gamedalf.Core.Attributes; using Gamedalf.Core.Models; using System; using System.ComponentModel.DataAnnotations; namespace Gamedalf.ViewModels { public class TermsCreateViewModel { [Required] [StringLength(100, MinimumLength = 1)] public string Title { get; set; } [Required] public string Content { get; set; } } public class TermsEditViewModel { public int Id { get; set; } public string Title { get; set; } [Required] public string Content { get; set; } } public class AcceptTermsViewModel { [EnforceTrue] [Display(Name = "I hereby accept the presented terms")] public bool AcceptTerms { get; set; } public Terms Terms { get; set; } } public class TermsJsonViewModel { public int Id { get; set; } public string Title { get; set; } public string Content { get; set; } public DateTime DateCreated { get; set; } } }
using Gamedalf.Core.Attributes; using System; using System.ComponentModel.DataAnnotations; namespace Gamedalf.ViewModels { public class TermsCreateViewModel { [Required] [StringLength(100, MinimumLength = 1)] public string Title { get; set; } [Required] public string Content { get; set; } } public class TermsEditViewModel { public int Id { get; set; } public string Title { get; set; } [Required] public string Content { get; set; } } public class AcceptTermsViewModel { [EnforceTrue] [Display(Name = "I hereby accept the presented terms")] public bool AcceptTerms { get; set; } } public class TermsJsonViewModel { public int Id { get; set; } public string Title { get; set; } public string Content { get; set; } public DateTime DateCreated { get; set; } } }
mit
C#
49f94ee865c569a113bb6ff5fc744e07ff27e929
add graph output
Pondidum/Dashen,Pondidum/Dashen,Pondidum/Dashen,Pondidum/Dashen
Dashen.Tests/Scratchpad.cs
Dashen.Tests/Scratchpad.cs
using System; using System.Diagnostics; using System.Linq; using System.Threading; using Dashen.Components; using Xunit; namespace Dashen.Tests { public class Scratchpad { [Fact] public void When_running_the_dashboard() { if (Debugger.IsAttached == false) { return; } var dashboard = DashboardBuilder.Create(new DashboardConfiguration { ListenOn = new Uri("http://localhost:3030"), ApplicationName = "UnitTestRunner", ApplicationVersion = "1.3.3.7" }); dashboard.Add<TextModel>(model => { model.Title = "Header"; model.Text = "Testing"; }); var counter = 0; dashboard.Add<TextModel>(model => { model.Title = "Header"; model.Text = counter.ToString(); }); dashboard.Add<HtmlModel>(model => { model.Title = "Html"; model.Html = "<b>Test Bold</b>"; }); dashboard.Add<ListModel>(model => { model.Title = "Listy"; model.Items = new[] {"First", "Second", "Third"}.ToList(); }); dashboard.Add<GraphModel>(model => { model.Title = "Graphy"; model.Columns = 8; model.Points = new[] {new Pair(1, 1), new Pair(2, 10), new Pair(3, 6), new Pair(4, 2), new Pair(5, 3)}; model.XTicks = new[] {new Label(1, "Left"), new Label(3, "Middle"), new Label(5, "Right")}; }); dashboard.Start().Wait(); while (true) { Thread.Sleep(1000); counter++; } } } }
using System; using System.Diagnostics; using System.Linq; using System.Threading; using Dashen.Components; using Xunit; namespace Dashen.Tests { public class Scratchpad { [Fact] public void When_running_the_dashboard() { if (Debugger.IsAttached == false) { return; } var dashboard = DashboardBuilder.Create(new DashboardConfiguration { ListenOn = new Uri("http://localhost:3030"), ApplicationName = "UnitTestRunner", ApplicationVersion = "1.3.3.7" }); dashboard.Add<TextModel>(model => { model.Title = "Header"; model.Text = "Testing"; }); var counter = 0; dashboard.Add<TextModel>(model => { model.Title = "Header"; model.Text = counter.ToString(); }); dashboard.Add<HtmlModel>(model => { model.Title = "Html"; model.Html = "<b>Test Bold</b>"; }); dashboard.Add<ListModel>(model => { model.Title = "Listy"; model.Items = new[] {"First", "Second", "Third"}.ToList(); }); dashboard.Start().Wait(); while (true) { Thread.Sleep(1000); counter++; } } } }
lgpl-2.1
C#
e3d59616c97e4cb6aa2024ead41442d5c62a717b
Add file version use SemVer (for Squirrel)
CalebChalmers/KAGTools
KAGTools/Properties/AssemblyInfo.cs
KAGTools/Properties/AssemblyInfo.cs
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("KAG Tools")] [assembly: AssemblyDescription("A set of useful modding tools for the game King Arthur's Gold.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Caleb Chalmers")] [assembly: AssemblyProduct("KAG Tools")] [assembly: AssemblyCopyright("Copyright © Caleb Chalmers 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyMetadata("SquirrelAwareVersion", "1")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.4.3")] [assembly: AssemblyFileVersion("0.4.3")]
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("KAG Tools")] [assembly: AssemblyDescription("A set of useful modding tools for the game King Arthur's Gold.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Caleb Chalmers")] [assembly: AssemblyProduct("KAG Tools")] [assembly: AssemblyCopyright("Copyright © Caleb Chalmers 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyMetadata("SquirrelAwareVersion", "1")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.4.0.3")]
mit
C#
6a0fd0c0d7378200681ddaed6886104e76d0c47b
bump version to 2.9.1
piwik/piwik-dotnet-tracker,piwik/piwik-dotnet-tracker,piwik/piwik-dotnet-tracker
Piwik.Tracker/Properties/AssemblyInfo.cs
Piwik.Tracker/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("PiwikTracker")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Piwik")] [assembly: AssemblyProduct("PiwikTracker")] [assembly: AssemblyCopyright("")] [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("8121d06f-a801-42d2-a144-0036a0270bf3")] // 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.9.1")]
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("PiwikTracker")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Piwik")] [assembly: AssemblyProduct("PiwikTracker")] [assembly: AssemblyCopyright("")] [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("8121d06f-a801-42d2-a144-0036a0270bf3")] // 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.9.0")]
bsd-3-clause
C#
228950e6ed9e49797f04c4392ba05a21addfa350
Add a few stubbed out methods to the AssemblyLoadContext class (#3606)
krytarowski/corert,gregkalapos/corert,tijoytom/corert,shrah/corert,yizhang82/corert,gregkalapos/corert,gregkalapos/corert,yizhang82/corert,tijoytom/corert,krytarowski/corert,shrah/corert,krytarowski/corert,krytarowski/corert,gregkalapos/corert,shrah/corert,yizhang82/corert,tijoytom/corert,tijoytom/corert,shrah/corert,yizhang82/corert
src/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs
src/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Reflection; using Internal.Reflection.Augments; // This type is just stubbed out to be harmonious with CoreCLR namespace System.Runtime.Loader { public abstract class AssemblyLoadContext { public static Assembly[] GetLoadedAssemblies() => ReflectionAugments.ReflectionCoreCallbacks.GetLoadedAssemblies(); // These events are never called public static event AssemblyLoadEventHandler AssemblyLoad; public static event ResolveEventHandler TypeResolve; public static event ResolveEventHandler ResourceResolve; public static event ResolveEventHandler AssemblyResolve; public event Func<AssemblyLoadContext, AssemblyName, Assembly> Resolving; public event Action<AssemblyLoadContext> Unloading; public static AssemblyLoadContext Default { get; } = new DefaultAssemblyLoadContext(); public static AssemblyLoadContext GetLoadContext(Assembly assembly) { return Default; } public Assembly LoadFromAssemblyPath(string assemblyPath) { throw new PlatformNotSupportedException(); } } /// <summary> /// AssemblyLoadContext is not supported in .NET Native. This is /// just a dummy class to make applications compile. /// </summary> internal class DefaultAssemblyLoadContext : AssemblyLoadContext { } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Reflection; using Internal.Reflection.Augments; // This type is just stubbed out to be harmonious with CoreCLR namespace System.Runtime.Loader { public abstract class AssemblyLoadContext { public static Assembly[] GetLoadedAssemblies() => ReflectionAugments.ReflectionCoreCallbacks.GetLoadedAssemblies(); // These events are never called public static event AssemblyLoadEventHandler AssemblyLoad; public static event ResolveEventHandler TypeResolve; public static event ResolveEventHandler ResourceResolve; public static event ResolveEventHandler AssemblyResolve; } }
mit
C#
308480bfdc39634cc715989abb312edaf8f84c4b
Remove stray integration test call.
AltspaceVR/UnityGLTF,robertlong/UnityGLTFLoader
Assets/GLTF/Scripts/GLTFComponent.cs
Assets/GLTF/Scripts/GLTFComponent.cs
using System; using System.Collections; using UnityEngine; using System.Threading; using UnityEngine.Networking; namespace GLTF { class GLTFComponent : MonoBehaviour { public string Url; public Shader Shader; public bool Multithreaded = true; IEnumerator Start() { var loader = new GLTFLoader(Url, Shader, gameObject.transform); loader.Multithreaded = Multithreaded; yield return loader.Load(); } } }
using System; using System.Collections; using UnityEngine; using System.Threading; using UnityEngine.Networking; namespace GLTF { class GLTFComponent : MonoBehaviour { public string Url; public Shader Shader; public bool Multithreaded = true; IEnumerator Start() { var loader = new GLTFLoader(Url, Shader, gameObject.transform); loader.Multithreaded = Multithreaded; yield return loader.Load(); IntegrationTest.Pass(); } } }
mit
C#
7577187dfb1abd67bb932385f649c4d3994511df
Update PopupNumber
bunashibu/kikan
Assets/Scripts/Effect/PopupNumber.cs
Assets/Scripts/Effect/PopupNumber.cs
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Bunashibu.Kikan { public class PopupNumber : MonoBehaviour { void Start() { Destroy(gameObject, 1.5f); _subtractColor = new Color(0, 0, 0, 0.01f); MonoUtility.Instance.DelaySec(0.5f, () => { _ShouldFadeOut = true; }); } void Update() { MoveUp(); if (_ShouldFadeOut) FadeOut(); } private void MoveUp() { transform.Translate(Vector2.up * 0.002f); } private void FadeOut() { _renderer.color = _renderer.color - _subtractColor; } [SerializeField] private SpriteRenderer _renderer; private Color _subtractColor; private bool _ShouldFadeOut = false; } }
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Bunashibu.Kikan { public class PopupNumber : MonoBehaviour { void Start() { Destroy(gameObject, 1.0f); _subtractColor = new Color(0, 0, 0, 0.008f); } void Update() { MoveUp(); FadeOut(); } private void MoveUp() { transform.Translate(Vector2.up * 0.002f); } private void FadeOut() { _renderer.color = _renderer.color - _subtractColor; } [SerializeField] private SpriteRenderer _renderer; private Color _subtractColor; } }
mit
C#
3fabf453ddab310197cfc301d7e2350c862bfe36
Fix for missing username and password in http to https hop test
InishTech/Sp.Api
Sp.Web.Acceptance/ItemManagementFacts.cs
Sp.Web.Acceptance/ItemManagementFacts.cs
namespace Sp.Web.Acceptance { using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Net; using Ploeh.AutoFixture; using RestSharp; using Sp.Web.Acceptance.Wrappers; using Xunit; using Xunit.Extensions; public static class ItemManagementFacts { [Theory, WebData] public static void GetItemsShouldYieldData( SpWeb webApi ) { var request = new RestRequest( "ItemManagement/" ); var response = webApi.Execute<ItemsPage>( request ); Assert.Equal( ResponseStatus.Completed, response.ResponseStatus ); Assert.Equal( HttpStatusCode.OK, response.StatusCode ); Assert.NotNull( response.Data ); Assert.NotEmpty( response.Data.Items ); Assert.NotNull( response.Data.Items.First().Id ); Assert.NotNull( response.Data.Items.First().Label ); } [Fact] public static void GetFromHttpShouldHopToHttps( ) { var autoFixture = new Fixture(); autoFixture.Customize( new SoftwarePotentialWebHttpConfigurationCustomization() ); autoFixture.Customize( new SkipSSlCertificateValidationIfRequestedCustomization() ); var webApi = autoFixture.CreateAnonymous<SpWeb>(); var request = new RestRequest( "ItemManagement/" ); var response = webApi.Execute<ItemsPage>( request ); Assert.Equal( ResponseStatus.Completed, response.ResponseStatus ); Assert.Equal( HttpStatusCode.OK, response.StatusCode ); Assert.Contains( "https", response.ResponseUri.AbsoluteUri ); } public class ItemsPage { public List<Item> Items { get; set; } } public class Item { public string Id { get; set; } public string Label { get; set; } } public class SoftwarePotentialWebHttpConfigurationCustomization : ICustomization { void ICustomization.Customize( IFixture fixture ) { // Use guest credentials - should authenticate, but not give CanSeeItems claim // Use guest credentials - should authenticate, but not give CanSeeItems claim fixture.Register( ( string username, string password ) => new SpWebConfiguration( ConfigurationManager.AppSettings[ "Username" ], ConfigurationManager.AppSettings[ "Password" ], ConfigurationManager.AppSettings[ "WebBaseUrl" ].Replace( "https", "http" ) ) ); } } } }
namespace Sp.Web.Acceptance { using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Net; using Ploeh.AutoFixture; using RestSharp; using Sp.Web.Acceptance.Wrappers; using Xunit; using Xunit.Extensions; public static class ItemManagementFacts { [Theory, WebData] public static void GetItemsShouldYieldData( SpWeb webApi ) { var request = new RestRequest( "ItemManagement/" ); var response = webApi.Execute<ItemsPage>( request ); Assert.Equal( ResponseStatus.Completed, response.ResponseStatus ); Assert.Equal( HttpStatusCode.OK, response.StatusCode ); Assert.NotNull( response.Data ); Assert.NotEmpty( response.Data.Items ); Assert.NotNull( response.Data.Items.First().Id ); Assert.NotNull( response.Data.Items.First().Label ); } [Fact] public static void GetFromHttpShouldHopToHttps( ) { var autoFixture = new Fixture(); autoFixture.Customize( new SoftwarePotentialWebHttpConfigurationCustomization() ); autoFixture.Customize( new SkipSSlCertificateValidationIfRequestedCustomization() ); var webApi = autoFixture.CreateAnonymous<SpWeb>(); var request = new RestRequest( "ItemManagement/" ); var response = webApi.Execute<ItemsPage>( request ); Assert.Equal( ResponseStatus.Completed, response.ResponseStatus ); Assert.Equal( HttpStatusCode.OK, response.StatusCode ); Assert.Contains( "https", response.ResponseUri.AbsoluteUri ); } public class ItemsPage { public List<Item> Items { get; set; } } public class Item { public string Id { get; set; } public string Label { get; set; } } public class SoftwarePotentialWebHttpConfigurationCustomization : ICustomization { void ICustomization.Customize( IFixture fixture ) { // Use guest credentials - should authenticate, but not give CanSeeItems claim // Use guest credentials - should authenticate, but not give CanSeeItems claim fixture.Register( ( string username, string password ) => new SpWebConfiguration( username, password, ConfigurationManager.AppSettings[ "WebBaseUrl" ].Replace( "https", "http" ) ) ); } } } }
bsd-3-clause
C#
28fdb85e273c84a2f316b56a4c1244b4c02fa11b
Remove private setters of UpdateStatus's properties.
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi/Models/UpdateStatus.cs
WalletWasabi/Models/UpdateStatus.cs
using System; using System.Collections.Generic; using System.Text; namespace WalletWasabi.Models { public class UpdateStatus : IEquatable<UpdateStatus> { public UpdateStatus(bool backendCompatible, bool clientUpToDate, Version legalDocumentsVersion, ushort currentBackendMajorVersion) { BackendCompatible = backendCompatible; ClientUpToDate = clientUpToDate; LegalDocumentsVersion = legalDocumentsVersion; CurrentBackendMajorVersion = currentBackendMajorVersion; } public bool ClientUpToDate { get; } public bool BackendCompatible { get; } public Version LegalDocumentsVersion { get; } public ushort CurrentBackendMajorVersion { get; } #region EqualityAndComparison public override bool Equals(object obj) => Equals(obj as UpdateStatus); public bool Equals(UpdateStatus other) => this == other; public override int GetHashCode() => (ClientUpToDate, BackendCompatible, LegalDocumentsVersion, CurrentBackendMajorVersion).GetHashCode(); public static bool operator ==(UpdateStatus x, UpdateStatus y) => (x?.ClientUpToDate, x?.BackendCompatible, x?.LegalDocumentsVersion, x?.CurrentBackendMajorVersion) == (y?.ClientUpToDate, y?.BackendCompatible, y?.LegalDocumentsVersion, y?.CurrentBackendMajorVersion); public static bool operator !=(UpdateStatus x, UpdateStatus y) => !(x == y); #endregion EqualityAndComparison } }
using System; using System.Collections.Generic; using System.Text; namespace WalletWasabi.Models { public class UpdateStatus : IEquatable<UpdateStatus> { public UpdateStatus(bool backendCompatible, bool clientUpToDate, Version legalDocumentsVersion, ushort currentBackendMajorVersion) { BackendCompatible = backendCompatible; ClientUpToDate = clientUpToDate; LegalDocumentsVersion = legalDocumentsVersion; CurrentBackendMajorVersion = currentBackendMajorVersion; } public bool ClientUpToDate { get; private set; } public bool BackendCompatible { get; private set; } public Version LegalDocumentsVersion { get; private set; } public ushort CurrentBackendMajorVersion { get; private set; } #region EqualityAndComparison public override bool Equals(object obj) => Equals(obj as UpdateStatus); public bool Equals(UpdateStatus other) => this == other; public override int GetHashCode() => (ClientUpToDate, BackendCompatible, LegalDocumentsVersion, CurrentBackendMajorVersion).GetHashCode(); public static bool operator ==(UpdateStatus x, UpdateStatus y) => (x?.ClientUpToDate, x?.BackendCompatible, x?.LegalDocumentsVersion, x?.CurrentBackendMajorVersion) == (y?.ClientUpToDate, y?.BackendCompatible, y?.LegalDocumentsVersion, y?.CurrentBackendMajorVersion); public static bool operator !=(UpdateStatus x, UpdateStatus y) => !(x == y); #endregion EqualityAndComparison } }
mit
C#
19d9288adc76936af0e641c321f3b091140e7235
Fix srv msg
gavazquez/LunaMultiPlayer,DaggerES/LunaMultiPlayer,gavazquez/LunaMultiPlayer,gavazquez/LunaMultiPlayer
Common/Message/Server/AdminSrvMsg.cs
Common/Message/Server/AdminSrvMsg.cs
using Lidgren.Network; using LunaCommon.Enums; using LunaCommon.Message.Data.Admin; using LunaCommon.Message.Server.Base; using LunaCommon.Message.Types; using System; using System.Collections.Generic; namespace LunaCommon.Message.Server { public class AdminSrvMsg : SrvMsgBase<AdminBaseMsgData> { /// <inheritdoc /> internal AdminSrvMsg() { } /// <inheritdoc /> public override string ClassName { get; } = nameof(AdminSrvMsg); protected override Dictionary<ushort, Type> SubTypeDictionary { get; } = new Dictionary<ushort, Type> { [(ushort)AdminMessageType.Reply] = typeof(AdminReplyMsgData), }; public override ServerMessageType MessageType => ServerMessageType.Admin; protected override int DefaultChannel => 16; public override NetDeliveryMethod NetDeliveryMethod => NetDeliveryMethod.ReliableOrdered; } }
using Lidgren.Network; using LunaCommon.Enums; using LunaCommon.Message.Data.Admin; using LunaCommon.Message.Data.Chat; using LunaCommon.Message.Server.Base; using LunaCommon.Message.Types; using System; using System.Collections.Generic; namespace LunaCommon.Message.Server { public class AdminSrvMsg : SrvMsgBase<ChatMsgData> { /// <inheritdoc /> internal AdminSrvMsg() { } /// <inheritdoc /> public override string ClassName { get; } = nameof(AdminSrvMsg); protected override Dictionary<ushort, Type> SubTypeDictionary { get; } = new Dictionary<ushort, Type> { [(ushort)AdminMessageType.Reply] = typeof(AdminReplyMsgData), }; public override ServerMessageType MessageType => ServerMessageType.Admin; protected override int DefaultChannel => 16; public override NetDeliveryMethod NetDeliveryMethod => NetDeliveryMethod.ReliableOrdered; } }
mit
C#
0bda6e8b723112d1e153c1f77a1e86a3646595df
test github hook to jenkins
MassDebaters/DebateApp,MassDebaters/DebateApp,MassDebaters/DebateApp
DebateApp/DebateApp.Domain/Casual.cs
DebateApp/DebateApp.Domain/Casual.cs
using System; using System.Collections.Generic; using System.Text; namespace DebateApp.Domain { public class Casual : Debate { public Casual(int CreatedBy) { //set the default debate state //test commit } } }
using System; using System.Collections.Generic; using System.Text; namespace DebateApp.Domain { public class Casual : Debate { public Casual(int CreatedBy) { //set the default debate state } } }
mit
C#
d8f767eab537a257ac0559b82109acb06fb11485
Fix New-AzureRoleTemplate to use complete path
markcowl/azure-sdk-tools,akromm/azure-sdk-tools,DinoV/azure-sdk-tools,akromm/azure-sdk-tools,akromm/azure-sdk-tools,Madhukarc/azure-sdk-tools,johnkors/azure-sdk-tools,antonba/azure-sdk-tools,markcowl/azure-sdk-tools,Madhukarc/azure-sdk-tools,johnkors/azure-sdk-tools,Madhukarc/azure-sdk-tools,DinoV/azure-sdk-tools,antonba/azure-sdk-tools,akromm/azure-sdk-tools,markcowl/azure-sdk-tools,markcowl/azure-sdk-tools,DinoV/azure-sdk-tools,Madhukarc/azure-sdk-tools,johnkors/azure-sdk-tools,markcowl/azure-sdk-tools,johnkors/azure-sdk-tools,antonba/azure-sdk-tools,antonba/azure-sdk-tools,DinoV/azure-sdk-tools,akromm/azure-sdk-tools,Madhukarc/azure-sdk-tools,DinoV/azure-sdk-tools,johnkors/azure-sdk-tools,antonba/azure-sdk-tools
WindowsAzurePowershell/src/Management.CloudService/Cmdlet/NewAzureRoleTemplate.cs
WindowsAzurePowershell/src/Management.CloudService/Cmdlet/NewAzureRoleTemplate.cs
// ---------------------------------------------------------------------------------- // // Copyright 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.CloudService.Cmdlet { using System.IO; using System.Management.Automation; using System.Reflection; using System.Security.Permissions; using Microsoft.WindowsAzure.Management.CloudService.Model; using Microsoft.WindowsAzure.Management.CloudService.Properties; using Microsoft.WindowsAzure.Management.Cmdlets.Common; using Microsoft.WindowsAzure.Management.Extensions; using Microsoft.WindowsAzure.Management.Utilities; /// <summary> /// Creates new azure template for web/worker role. /// </summary> [Cmdlet(VerbsCommon.New, "AzureRoleTemplate"), OutputType(typeof(PSObject))] public class NewAzureRoleTemplateCommand : CmdletBase { const string DefaultWebRoleTemplate = "WebRoleTemplate"; const string DefaultWorkerRoleTemplate = "WorkerRoleTemplate"; [Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "WebRole", HelpMessage = "Specifies that the generated template should be for web role")] public SwitchParameter Web { get; set; } [Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "WorkerRole", HelpMessage = "Specifies that the generated template should be for worker role")] public SwitchParameter Worker { get; set; } [Parameter(Position = 1, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Output path for the generated template")] public string Output { get; set; } [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] public override void ExecuteCmdlet() { string output = !string.IsNullOrEmpty(Output) ? this.TryResolvePath(Output) : Web.IsPresent ? Path.Combine(CurrentPath(), DefaultWebRoleTemplate) : Path.Combine(CurrentPath(), DefaultWorkerRoleTemplate); string source = Web.IsPresent ? Path.Combine(Resources.GeneralScaffolding, Resources.WebRole) : Path.Combine(Resources.GeneralScaffolding, Resources.WorkerRole); General.DirectoryCopy(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), source), output, true); SafeWriteOutputPSObject(null, Parameters.Path, output); } } }
// ---------------------------------------------------------------------------------- // // Copyright 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.CloudService.Cmdlet { using System.IO; using System.Management.Automation; using System.Security.Permissions; using Microsoft.WindowsAzure.Management.CloudService.Model; using Microsoft.WindowsAzure.Management.CloudService.Properties; using Microsoft.WindowsAzure.Management.Cmdlets.Common; using Microsoft.WindowsAzure.Management.Extensions; using Microsoft.WindowsAzure.Management.Utilities; /// <summary> /// Creates new azure template for web/worker role. /// </summary> [Cmdlet(VerbsCommon.New, "AzureRoleTemplate"), OutputType(typeof(PSObject))] public class NewAzureRoleTemplateCommand : CmdletBase { const string DefaultWebRoleTemplate = "WebRoleTemplate"; const string DefaultWorkerRoleTemplate = "WorkerRoleTemplate"; [Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "WebRole", HelpMessage = "Specifies that the generated template should be for web role")] public SwitchParameter Web { get; set; } [Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "WorkerRole", HelpMessage = "Specifies that the generated template should be for worker role")] public SwitchParameter Worker { get; set; } [Parameter(Position = 1, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Output path for the generated template")] public string Output { get; set; } [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] public override void ExecuteCmdlet() { string output = !string.IsNullOrEmpty(Output) ? this.TryResolvePath(Output) : Web.IsPresent ? Path.Combine(CurrentPath(), DefaultWebRoleTemplate) : Path.Combine(CurrentPath(), DefaultWorkerRoleTemplate); string source = Web.IsPresent ? Path.Combine(Resources.GeneralScaffolding, Resources.WebRole) : Path.Combine(Resources.GeneralScaffolding, Resources.WorkerRole); General.DirectoryCopy(source, output, true); SafeWriteOutputPSObject(null, Parameters.Path, output); } } }
apache-2.0
C#
9457d1bd778ab8fb4eed16d39ab7709694f130bb
Remove mde.js (#8046)
stevetayloruk/Orchard2,xkproject/Orchard2,stevetayloruk/Orchard2,xkproject/Orchard2,stevetayloruk/Orchard2,xkproject/Orchard2,stevetayloruk/Orchard2,xkproject/Orchard2,stevetayloruk/Orchard2,xkproject/Orchard2
src/OrchardCore.Modules/OrchardCore.Markdown/Views/MarkdownBodyPart-Wysiwyg.Edit.cshtml
src/OrchardCore.Modules/OrchardCore.Markdown/Views/MarkdownBodyPart-Wysiwyg.Edit.cshtml
@model MarkdownBodyPartViewModel @using OrchardCore.ContentLocalization @using OrchardCore.ContentManagement.Metadata.Models @using OrchardCore.Markdown.ViewModels @using OrchardCore.Markdown.Settings @{ var settings = Model.TypePartDefinition.GetSettings<MarkdownBodyPartSettings>(); var culture = await Orchard.GetContentCultureAsync(Model.MarkdownBodyPart.ContentItem); } <style asp-name="codemirror"></style> <style asp-name="mdecss" asp-src="~/OrchardCore.Markdown/Styles/mde.min.css" debug-src="~/OrchardCore.Markdown/Styles/mde.css"></style> @await DisplayAsync(await New.ShortcodeModal()) <div class="form-group mde-editor"> <label asp-for="Markdown">@Model.TypePartDefinition.DisplayName()</label> <span class="hint">@T["The markdown text of the content item."]</span> <textarea asp-for="Markdown" rows="5" class="form-control content-preview-text"></textarea> </div> <script at="Foot"> $(function () { var markdownElement = document.getElementById("@Html.IdFor(m => m.Markdown)"); @* When part is rendered by a flow part only the elements scripts are rendered, so the html element will not exist. *@ if (markdownElement) { var mde = new EasyMDE({ element: markdownElement, forceSync: true, toolbar: mdeToolbar, autoDownloadFontAwesome: false }); initializeMdeShortcodeWrapper(mde); mde.codemirror.on('change', function () { $(document).trigger('contentpreview:render'); }); @if (culture.IsRightToLeft()) { <text>$('.editor-toolbar').attr('style', 'direction:rtl;text-align:right'); $('.CodeMirror').attr('style', 'text-align:right');</text> } } }); </script>
@model MarkdownBodyPartViewModel @using OrchardCore.ContentLocalization @using OrchardCore.ContentManagement.Metadata.Models @using OrchardCore.Markdown.ViewModels @using OrchardCore.Markdown.Settings @{ var settings = Model.TypePartDefinition.GetSettings<MarkdownBodyPartSettings>(); var culture = await Orchard.GetContentCultureAsync(Model.MarkdownBodyPart.ContentItem); } <script asp-name="mde" depends-on="admin" asp-src="~/OrchardCore.Markdown/Scripts/mde.min.js" at="Foot"></script> <style asp-name="codemirror"></style> <style asp-name="mdecss" asp-src="~/OrchardCore.Markdown/Styles/mde.min.css" debug-src="~/OrchardCore.Markdown/Styles/mde.css"></style> @await DisplayAsync(await New.ShortcodeModal()) <div class="form-group mde-editor"> <label asp-for="Markdown">@Model.TypePartDefinition.DisplayName()</label> <span class="hint">@T["The markdown text of the content item."]</span> <textarea asp-for="Markdown" rows="5" class="form-control content-preview-text"></textarea> </div> <script at="Foot"> $(function () { var markdownElement = document.getElementById("@Html.IdFor(m => m.Markdown)"); @* When part is rendered by a flow part only the elements scripts are rendered, so the html element will not exist. *@ if (markdownElement) { var mde = new EasyMDE({ element: markdownElement, forceSync: true, toolbar: mdeToolbar, autoDownloadFontAwesome: false }); initializeMdeShortcodeWrapper(mde); mde.codemirror.on('change', function () { $(document).trigger('contentpreview:render'); }); @if (culture.IsRightToLeft()) { <text>$('.editor-toolbar').attr('style', 'direction:rtl;text-align:right'); $('.CodeMirror').attr('style', 'text-align:right');</text> } } }); </script>
bsd-3-clause
C#
8bb9dd4657a98543c531944513badf8c95e9ff35
Update "Insert Include Field" example
asposewords/Aspose_Words_NET,aspose-words/Aspose.Words-for-.NET,aspose-words/Aspose.Words-for-.NET,asposewords/Aspose_Words_NET,aspose-words/Aspose.Words-for-.NET,aspose-words/Aspose.Words-for-.NET,asposewords/Aspose_Words_NET,asposewords/Aspose_Words_NET
Examples/CSharp/Programming-Documents/Fields/InsertIncludeFieldWithoutDocumentBuilder.cs
Examples/CSharp/Programming-Documents/Fields/InsertIncludeFieldWithoutDocumentBuilder.cs
using Aspose.Words.Fields; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Aspose.Words.Examples.CSharp.Programming_Documents.Working_with_Fields { class InsertIncludeFieldWithoutDocumentBuilder { public static void Run() { // ExStart:InsertIncludeFieldWithoutDocumentBuilder // The path to the documents directory. string dataDir = RunExamples.GetDataDir_WorkingWithFields(); Document doc = new Document(dataDir + "in.doc"); // Get paragraph you want to append this INCLUDETEXT field to Paragraph para = (Paragraph)doc.GetChildNodes(NodeType.Paragraph, true)[1]; // We want to insert an INCLUDETEXT field like this: // { INCLUDETEXT "file path" } // Create instance of FieldAsk class and lets build the above field code FieldInclude fieldinclude = (FieldInclude)para.AppendField(FieldType.FieldInclude, false); fieldinclude.BookmarkName = "bookmark"; fieldinclude.SourceFullName = dataDir + @"IncludeText.docx"; doc.FirstSection.Body.AppendChild(para); // Finally update this Include field fieldinclude.Update(); dataDir = dataDir + "InsertIncludeFieldWithoutDocumentBuilder_out.doc"; doc.Save(dataDir); // ExEnd:InsertIncludeFieldWithoutDocumentBuilder Console.WriteLine("\nInclude field without using document builder inserted successfully.\nFile saved at " + dataDir); } } }
using Aspose.Words.Fields; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Aspose.Words.Examples.CSharp.Programming_Documents.Working_with_Fields { class InsertIncludeFieldWithoutDocumentBuilder { public static void Run() { // ExStart:InsertIncludeFieldWithoutDocumentBuilder // The path to the documents directory. string dataDir = RunExamples.GetDataDir_WorkingWithFields(); Document doc = new Document(dataDir + "in.doc"); // Get paragraph you want to append this INCLUDETEXT field to Paragraph para = (Paragraph)doc.GetChildNodes(NodeType.Paragraph, true)[1]; // We want to insert an INCLUDETEXT field like this: // { INCLUDETEXT "file path" } // Create instance of FieldAsk class and lets build the above field code FieldInclude fieldinclude = (FieldInclude)para.AppendField(FieldType.FieldInclude, false); fieldinclude.BookmarkName = "bookmark"; fieldinclude.SourceFullName = dataDir + @"IncludeText.docx"; doc.FirstSection.Body.AppendChild(para); // Finally update this TOA field fieldinclude.Update(); dataDir = dataDir + "InsertIncludeFieldWithoutDocumentBuilder_out.doc"; doc.Save(dataDir); // ExEnd:InsertIncludeFieldWithoutDocumentBuilder Console.WriteLine("\nInclude field without using document builder inserted successfully.\nFile saved at " + dataDir); } } }
mit
C#
93adb5269530a8e06869dd63f710a61bf7214a36
Implement GoogleTaskMapper, map subject, body, due date, completed and status property
aluxnimm/outlookcaldavsynchronizer
CalDavSynchronizer/Implementation/GoogleTasks/GoogleTaskMapper.cs
CalDavSynchronizer/Implementation/GoogleTasks/GoogleTaskMapper.cs
// This file is Part of CalDavSynchronizer (http://outlookcaldavsynchronizer.sourceforge.net/) // Copyright (c) 2015 Gerhard Zehetbauer // Copyright (c) 2015 Alexander Nimmervoll // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // 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 Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. using System; using CalDavSynchronizer.Implementation.ComWrappers; using GenSync.EntityMapping; using GenSync.Logging; using Google.Apis.Tasks.v1.Data; using Microsoft.Office.Interop.Outlook; namespace CalDavSynchronizer.Implementation.GoogleTasks { class GoogleTaskMapper : IEntityMapper<TaskItemWrapper, Task> { private readonly DateTime _dateNull; public GoogleTaskMapper() { _dateNull = new DateTime (4501, 1, 1, 0, 0, 0); } public Task Map1To2 (TaskItemWrapper source, Task target, IEntityMappingLogger logger) { target.Title = source.Inner.Subject; target.Notes = source.Inner.Body; if (source.Inner.DueDate != _dateNull) { target.Due = new DateTime (source.Inner.DueDate.Year, source.Inner.DueDate.Month, source.Inner.DueDate.Day, 23, 59, 59); } else { target.Due = null; } if (source.Inner.Complete && source.Inner.DateCompleted != _dateNull) { target.Completed = source.Inner.DateCompleted.ToUniversalTime(); } else { target.Completed = null; } target.Status = MapStatus1To2 (source.Inner.Status); return target; } private string MapStatus1To2 (OlTaskStatus value) { switch (value) { case OlTaskStatus.olTaskComplete: return "completed"; case OlTaskStatus.olTaskDeferred: case OlTaskStatus.olTaskInProgress: case OlTaskStatus.olTaskWaiting: case OlTaskStatus.olTaskNotStarted: return "needsAction"; } throw new NotImplementedException (string.Format ("Mapping for value '{0}' not implemented.", value)); } public TaskItemWrapper Map2To1 (Task source, TaskItemWrapper target, IEntityMappingLogger logger) { target.Inner.Subject = source.Title; target.Inner.Body = source.Notes; if (source.Due != null) { if (source.Due < target.Inner.StartDate) { target.Inner.StartDate = source.Due.Value; } target.Inner.DueDate = source.Due.Value; } else { target.Inner.DueDate = _dateNull; } if (source.Completed != null) { target.Inner.DateCompleted = source.Completed.Value; target.Inner.Complete = true; } else { target.Inner.Complete = false; } target.Inner.Status = MapStatus2To1 (source.Status); return target; } private OlTaskStatus MapStatus2To1 (string status) { if (status == "completed") return OlTaskStatus.olTaskComplete; else return OlTaskStatus.olTaskInProgress; } } }
// This file is Part of CalDavSynchronizer (http://outlookcaldavsynchronizer.sourceforge.net/) // Copyright (c) 2015 Gerhard Zehetbauer // Copyright (c) 2015 Alexander Nimmervoll // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // 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 Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. using System; using CalDavSynchronizer.Implementation.ComWrappers; using GenSync.EntityMapping; using GenSync.Logging; using Google.Apis.Tasks.v1.Data; namespace CalDavSynchronizer.Implementation.GoogleTasks { class GoogleTaskMapper : IEntityMapper<TaskItemWrapper, Task> { public Task Map1To2 (TaskItemWrapper source, Task target, IEntityMappingLogger logger) { target.Title = source.Inner.Subject; return target; } public TaskItemWrapper Map2To1 (Task source, TaskItemWrapper target, IEntityMappingLogger logger) { target.Inner.Subject = source.Title; return target; } } }
agpl-3.0
C#
be72bd466889f95b6d48a62cd98a666f4461062e
修复文本编辑区控件不能生成内容的错误。
Zongsoft/Zongsoft.Web
src/Controls/Editor.cs
src/Controls/Editor.cs
/* * Authors: * 钟峰(Popeye Zhong) <zongsoft@gmail.com> * * Copyright (C) 2011-2015 Zongsoft Corporation <http://www.zongsoft.com> * * This file is part of Zongsoft.Web. * * Zongsoft.Web 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. * * Zongsoft.Web 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. * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * You should have received a copy of the GNU Lesser General Public * License along with Zongsoft.Web; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.ComponentModel; using System.Collections.Generic; using System.Text; using System.Web; using System.Web.UI; namespace Zongsoft.Web.Controls { public class Editor : TextBoxBase { #region 构造函数 public Editor() { this.CssClass = "editor"; } #endregion #region 重写属性 [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] [DefaultValue(InputBoxType.Text)] public override InputBoxType InputType { get { return base.InputType; } set { if(value != InputBoxType.Text) throw new ArgumentOutOfRangeException(); base.InputType = value; } } #endregion #region 重写方法 protected override void RenderBeginTag(HtmlTextWriter writer) { if(string.IsNullOrWhiteSpace(this.Name) && (!string.IsNullOrWhiteSpace(this.ID))) writer.AddAttribute(HtmlTextWriterAttribute.Name, this.ID); writer.RenderBeginTag(HtmlTextWriterTag.Textarea); } protected override void RenderContent(HtmlTextWriter writer) { writer.WriteEncodedText(this.Value); } #endregion } }
/* * Authors: * 钟峰(Popeye Zhong) <zongsoft@gmail.com> * * Copyright (C) 2011-2015 Zongsoft Corporation <http://www.zongsoft.com> * * This file is part of Zongsoft.Web. * * Zongsoft.Web 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. * * Zongsoft.Web 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. * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * You should have received a copy of the GNU Lesser General Public * License along with Zongsoft.Web; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.ComponentModel; using System.Collections.Generic; using System.Text; using System.Web; using System.Web.UI; namespace Zongsoft.Web.Controls { public class Editor : TextBoxBase { #region 构造函数 public Editor() { this.CssClass = "editor"; } #endregion #region 重写属性 [Browsable(false)] [DefaultValue(InputBoxType.Text)] public override InputBoxType InputType { get { return base.InputType; } set { if(value != InputBoxType.Text) throw new ArgumentOutOfRangeException(); base.InputType = value; } } #endregion #region 重写方法 protected override void RenderBeginTag(HtmlTextWriter writer) { if(string.IsNullOrWhiteSpace(this.Name) && (!string.IsNullOrWhiteSpace(this.ID))) writer.AddAttribute(HtmlTextWriterAttribute.Name, this.ID); writer.RenderBeginTag(HtmlTextWriterTag.Textarea); } #endregion } }
lgpl-2.1
C#
872a3596355b5a43219121112800e63771d3aabe
add of pm fix desc
Appleseed/portal,Appleseed/portal,Appleseed/portal,Appleseed/portal,Appleseed/portal,Appleseed/portal,Appleseed/portal
Master/Appleseed/Projects/PortableAreas/PageManagerTree/Properties/AssemblyInfo.cs
Master/Appleseed/Projects/PortableAreas/PageManagerTree/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("PageManagerTree")] [assembly: AssemblyDescription("Appleseed Portal and Content Management System : MVC Page Manager")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ANANT Corporation")] [assembly: AssemblyProduct("PageManagerTree")] [assembly: AssemblyCopyright("Copyright © ANANT Corporation 2010-2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("1bbaa317-aebe-425c-8db3-a1aee724365d")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.4.98.383")] [assembly: AssemblyFileVersion("1.4.98.383")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("PageManagerTree")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ANANT Corporation")] [assembly: AssemblyProduct("PageManagerTree")] [assembly: AssemblyCopyright("Copyright © ANANT Corporation 2010-2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("1bbaa317-aebe-425c-8db3-a1aee724365d")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.4.98.383")] [assembly: AssemblyFileVersion("1.4.98.383")]
apache-2.0
C#
257307bef70feabeac9d3019566c5080869e89a2
Fix safety bubble
gavazquez/LunaMultiPlayer,gavazquez/LunaMultiPlayer,DaggerES/LunaMultiPlayer,gavazquez/LunaMultiPlayer
Client/Harmony/Vessel_Load.cs
Client/Harmony/Vessel_Load.cs
using Harmony; using LunaClient.Systems.SafetyBubble; // ReSharper disable All namespace LunaClient.Harmony { /// <summary> /// This harmony patch is intended to avoid loading a vessel if it's in safety bubble /// </summary> [HarmonyPatch(typeof(Vessel))] [HarmonyPatch("Load")] public class Vessel_Load { [HarmonyPrefix] private static bool PrefixLoad(Vessel __instance) { if (FlightGlobals.ActiveVessel != null && FlightGlobals.ActiveVessel.loaded && FlightGlobals.ActiveVessel.id != __instance.id) { return !SafetyBubbleSystem.Singleton.IsInSafetyBubble(__instance, false); } return true; } } }
using Harmony; using LunaClient.Systems.SafetyBubble; // ReSharper disable All namespace LunaClient.Harmony { /// <summary> /// This harmony patch is intended to avoid loading a vessel if it's in safety bubble /// </summary> [HarmonyPatch(typeof(Vessel))] [HarmonyPatch("Load")] public class Vessel_Load { [HarmonyPrefix] private static bool PrefixLoad(Vessel __instance) { if (FlightGlobals.ActiveVessel != null && FlightGlobals.ActiveVessel.loaded) { return !SafetyBubbleSystem.Singleton.IsInSafetyBubble(FlightGlobals.ActiveVessel, false); } return true; } } }
mit
C#
42782299604bd6aa4ad57fef56700434d46685e1
Add the track number to the song
flagbug/Espera.Network
Espera.Network/NetworkSong.cs
Espera.Network/NetworkSong.cs
using System; namespace Espera.Network { public class NetworkSong { public string Album { get; set; } public string Artist { get; set; } public TimeSpan Duration { get; set; } public string Genre { get; set; } public Guid Guid { get; set; } public NetworkSongSource Source { get; set; } public string Title { get; set; } public int TrackNumber { get; set; } } }
using System; namespace Espera.Network { public class NetworkSong { public string Album { get; set; } public string Artist { get; set; } public TimeSpan Duration { get; set; } public string Genre { get; set; } public Guid Guid { get; set; } public NetworkSongSource Source { get; set; } public string Title { get; set; } } }
mit
C#
30d88a1628d6375e5eb7389a972617270de2a033
Remove PaginatorModule.FromFunc
DotNetKit/DotNetKit.Wpf.Printing
DotNetKit.Wpf.Printing/Windows/Documents/Paginators/IPaginator.cs
DotNetKit.Wpf.Printing/Windows/Documents/Paginators/IPaginator.cs
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace DotNetKit.Windows.Documents { /// <summary> /// Provides <see cref="Paginate(Size)"/>. /// </summary> public interface IPaginator { /// <summary> /// Paginates the printable into pages. /// </summary> IEnumerable Paginate(object printable, Size pageSize); } }
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace DotNetKit.Windows.Documents { /// <summary> /// Provides <see cref="Paginate(Size)"/>. /// </summary> public interface IPaginator { /// <summary> /// Paginates the printable into pages. /// </summary> IEnumerable Paginate(object printable, Size pageSize); } sealed class AnonymousPaginator<TReport> : IPaginator { readonly Func<TReport, Size, IEnumerable> paginate; public IEnumerable Paginate(TReport page, Size pageSize) { return paginate(page, pageSize); } IEnumerable IPaginator.Paginate(object printable, Size pageSize) { return Paginate((TReport)printable, pageSize); } public AnonymousPaginator(Func<TReport, Size, IEnumerable> paginate) { this.paginate = paginate; } } public static class PaginatorModule { public static IPaginator FromFunc<R>(Func<R, Size, IEnumerable> paginate) { return new AnonymousPaginator<R>(paginate); } } }
mit
C#
c93b3b2cc436e5c5779bc17e3b069459f6278beb
Fix incorrect field name retrieval
klightspeed/EDDiscovery,EDDiscovery/EDDiscovery,klightspeed/EDDiscovery,klightspeed/EDDiscovery,EDDiscovery/EDDiscovery,EDDiscovery/EDDiscovery,andreaspada/EDDiscovery,andreaspada/EDDiscovery
EDDiscovery/EliteDangerous/JournalEvents/JournalEndCrewSession.cs
EDDiscovery/EliteDangerous/JournalEvents/JournalEndCrewSession.cs
/* * Copyright © 2017 EDDiscovery development team * * 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. * * EDDiscovery is not affiliated with Frontier Developments plc. */ using Newtonsoft.Json.Linq; using System.Linq; namespace EDDiscovery.EliteDangerous.JournalEvents { // When written: when the captain in multicrew disbands the crew //Parameters: // OnCrime: (bool) true if crew disbanded as a result of a crime in a lawful session // { "timestamp":"2017-04-12T11:32:30Z", "event":"EndCrewSession", "OnCrime":false } [JournalEntryType(JournalTypeEnum.EndCrewSession)] public class JournalEndCrewSession : JournalEntry { public JournalEndCrewSession(JObject evt) : base(evt, JournalTypeEnum.EndCrewSession) { OnCrime = evt["OnCrime"].Bool(); } public bool OnCrime { get; set; } public override System.Drawing.Bitmap Icon { get { return EDDiscovery.Properties.Resources.crewmemberquits; } } public override void FillInformation(out string summary, out string info, out string detailed) //V { summary = EventTypeStr.SplitCapsWord(); info = Tools.FieldBuilder("; Crime", OnCrime); detailed = ""; } } }
/* * Copyright © 2017 EDDiscovery development team * * 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. * * EDDiscovery is not affiliated with Frontier Developments plc. */ using Newtonsoft.Json.Linq; using System.Linq; namespace EDDiscovery.EliteDangerous.JournalEvents { // When written: when the captain in multicrew disbands the crew //Parameters: // OnCrime: (bool) true if crew disbanded as a result of a crime in a lawful session // { "timestamp":"2017-04-12T11:32:30Z", "event":"EndCrewSession", "OnCrime":false } [JournalEntryType(JournalTypeEnum.EndCrewSession)] public class JournalEndCrewSession : JournalEntry { public JournalEndCrewSession(JObject evt) : base(evt, JournalTypeEnum.EndCrewSession) { OnCrime = evt["Name"].Bool(); } public bool OnCrime { get; set; } public override System.Drawing.Bitmap Icon { get { return EDDiscovery.Properties.Resources.crewmemberquits; } } public override void FillInformation(out string summary, out string info, out string detailed) //V { summary = EventTypeStr.SplitCapsWord(); info = Tools.FieldBuilder("; Crime", OnCrime); detailed = ""; } } }
apache-2.0
C#
056a6b452e8669f9b788d2ce7cd8de95745beb3f
Add filter property to most played shows request.
henrikfroehling/TraktApiSharp
Source/Lib/TraktApiSharp/Requests/WithoutOAuth/Shows/Common/TraktShowsMostPlayedRequest.cs
Source/Lib/TraktApiSharp/Requests/WithoutOAuth/Shows/Common/TraktShowsMostPlayedRequest.cs
namespace TraktApiSharp.Requests.WithoutOAuth.Shows.Common { using Base; using Base.Get; using Enums; using Objects.Basic; using Objects.Get.Shows.Common; using System.Collections.Generic; internal class TraktShowsMostPlayedRequest : TraktGetRequest<TraktPaginationListResult<TraktMostPlayedShow>, TraktMostPlayedShow> { internal TraktShowsMostPlayedRequest(TraktClient client) : base(client) { Period = TraktPeriod.Weekly; } internal TraktPeriod? Period { get; set; } protected override IDictionary<string, object> GetUriPathParameters() { var uriParams = base.GetUriPathParameters(); if (Period.HasValue && Period.Value != TraktPeriod.Unspecified) uriParams.Add("period", Period.Value.AsString()); return uriParams; } protected override string UriTemplate => "shows/played{/period}{?extended,page,limit,query,years,genres,languages,countries,runtimes,ratings,certifications,networks,status}"; protected override TraktAuthorizationRequirement AuthorizationRequirement => TraktAuthorizationRequirement.NotRequired; internal TraktShowFilter Filter { get; set; } protected override bool SupportsPagination => true; protected override bool IsListResult => true; } }
namespace TraktApiSharp.Requests.WithoutOAuth.Shows.Common { using Base.Get; using Enums; using Objects.Basic; using Objects.Get.Shows.Common; using System.Collections.Generic; internal class TraktShowsMostPlayedRequest : TraktGetRequest<TraktPaginationListResult<TraktMostPlayedShow>, TraktMostPlayedShow> { internal TraktShowsMostPlayedRequest(TraktClient client) : base(client) { Period = TraktPeriod.Weekly; } internal TraktPeriod? Period { get; set; } protected override IDictionary<string, object> GetUriPathParameters() { var uriParams = base.GetUriPathParameters(); if (Period.HasValue && Period.Value != TraktPeriod.Unspecified) uriParams.Add("period", Period.Value.AsString()); return uriParams; } protected override string UriTemplate => "shows/played{/period}{?extended,page,limit}"; protected override TraktAuthorizationRequirement AuthorizationRequirement => TraktAuthorizationRequirement.NotRequired; protected override bool SupportsPagination => true; protected override bool IsListResult => true; } }
mit
C#
1ffaa7b4579c44a74456d0de69555fe6e6cdd9a3
Use FormattedLogValues as the event state
serilog/serilog-extensions-logging,serilog/serilog-framework-logging,serilog/serilog-extensions-logging
src/Serilog.Extensions.Logging/Extensions/Logging/LoggerProviderCollectionSink.cs
src/Serilog.Extensions.Logging/Extensions/Logging/LoggerProviderCollectionSink.cs
// Copyright 2019 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using System; using System.Linq; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Internal; using Serilog.Core; using Serilog.Events; using Serilog.Parsing; namespace Serilog.Extensions.Logging { class LoggerProviderCollectionSink : ILogEventSink, IDisposable { readonly LoggerProviderCollection _providers; public LoggerProviderCollectionSink(LoggerProviderCollection providers) { _providers = providers ?? throw new ArgumentNullException(nameof(providers)); } public void Emit(LogEvent logEvent) { string categoryName = null; if (logEvent.Properties.TryGetValue("SourceContext", out var sourceContextProperty) && sourceContextProperty is ScalarValue sourceContextValue && sourceContextValue.Value is string sourceContext) { categoryName = sourceContext; } // Allocates like mad, but first make it work, then make it work fast ;-) var flv = new FormattedLogValues( logEvent.MessageTemplate.Text, logEvent.MessageTemplate.Tokens .OfType<PropertyToken>() .Select(p => { if (!logEvent.Properties.TryGetValue(p.PropertyName, out var value)) return null; if (value is ScalarValue sv) return sv.Value; return value; }) .ToArray()); foreach (var provider in _providers.Providers) { var logger = provider.CreateLogger(categoryName); logger.Log( LevelMapping.ToExtensionsLevel(logEvent.Level), default(EventId), flv, logEvent.Exception, (s, e) => s.ToString()); } } public void Dispose() { _providers.Dispose(); } } }
// Copyright 2019 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using System; using Microsoft.Extensions.Logging; using Serilog.Core; using Serilog.Events; namespace Serilog.Extensions.Logging { class LoggerProviderCollectionSink : ILogEventSink, IDisposable { readonly LoggerProviderCollection _providers; public LoggerProviderCollectionSink(LoggerProviderCollection providers) { _providers = providers ?? throw new ArgumentNullException(nameof(providers)); } public void Emit(LogEvent logEvent) { string categoryName = null; if (logEvent.Properties.TryGetValue("SourceContext", out var sourceContextProperty) && sourceContextProperty is ScalarValue sourceContextValue && sourceContextValue.Value is string sourceContext) { categoryName = sourceContext; } foreach (var provider in _providers.Providers) { var logger = provider.CreateLogger(categoryName); logger.Log( LevelMapping.ToExtensionsLevel(logEvent.Level), default(EventId), logEvent, logEvent.Exception, (s, ex) => s.RenderMessage()); } } public void Dispose() { _providers.Dispose(); } } }
apache-2.0
C#
b3f6e2193f91789de54f4c11b8008e0039c83338
remove unused FailWithException
acple/ParsecSharp
ParsecSharp/Parser/Parser/Implementations/PrimitiveParser.Fail.cs
ParsecSharp/Parser/Parser/Implementations/PrimitiveParser.Fail.cs
using System; namespace ParsecSharp.Internal.Parsers { internal sealed class ParseError<TToken, T> : PrimitiveParser<TToken, T> { protected sealed override Result<TToken, T> Run<TState>(TState state) => Result.Failure<TToken, TState, T>(state); } internal sealed class FailWithMessage<TToken, T> : PrimitiveParser<TToken, T> { private readonly string _message; public FailWithMessage(string message) { this._message = message; } protected sealed override Result<TToken, T> Run<TState>(TState state) => Result.Failure<TToken, TState, T>(this._message, state); } internal sealed class FailWithMessageDelayed<TToken, T> : PrimitiveParser<TToken, T> { private readonly Func<IParsecState<TToken>, string> _message; public FailWithMessageDelayed(Func<IParsecState<TToken>, string> message) { this._message = message; } protected sealed override Result<TToken, T> Run<TState>(TState state) => Result.Failure<TToken, TState, T>(this._message(state.GetState()), state); } }
using System; namespace ParsecSharp.Internal.Parsers { internal sealed class ParseError<TToken, T> : PrimitiveParser<TToken, T> { protected sealed override Result<TToken, T> Run<TState>(TState state) => Result.Failure<TToken, TState, T>(state); } internal sealed class FailWithMessage<TToken, T> : PrimitiveParser<TToken, T> { private readonly string _message; public FailWithMessage(string message) { this._message = message; } protected sealed override Result<TToken, T> Run<TState>(TState state) => Result.Failure<TToken, TState, T>(this._message, state); } internal sealed class FailWithMessageDelayed<TToken, T> : PrimitiveParser<TToken, T> { private readonly Func<IParsecState<TToken>, string> _message; public FailWithMessageDelayed(Func<IParsecState<TToken>, string> message) { this._message = message; } protected sealed override Result<TToken, T> Run<TState>(TState state) => Result.Failure<TToken, TState, T>(this._message(state.GetState()), state); } internal sealed class FailWithException<TToken, T> : PrimitiveParser<TToken, T> { private readonly Exception _exception; public FailWithException(Exception exception) { this._exception = exception; } protected sealed override Result<TToken, T> Run<TState>(TState state) => Result.Failure<TToken, TState, T>(this._exception, state); } }
mit
C#
1d709abc10bbd7b1f9307a331921541d673a14a6
add Identification Code to viewModel
KristianMariyanov/VotingSystem,KristianMariyanov/VotingSystem,KristianMariyanov/VotingSystem
VotingSystem.Web/ViewModels/Votes/VoteWithCandidatesInputModel.cs
VotingSystem.Web/ViewModels/Votes/VoteWithCandidatesInputModel.cs
namespace VotingSystem.Web.ViewModels.Votes { using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using VotingSystem.Models; using VotingSystem.Web.Infrastructure.Mapping; using VotingSystem.Web.ViewModels.Candidates; public class VoteWithCandidatesInputModel : IMapFrom<Vote> { public int Id { get; set; } public string Title { get; set; } public int NumberOfVotes { get; set; } public bool IsPublic { get; set; } public IEnumerable<CandidateInputModel> Candidates { get; set; } public string IdentificationCode { get; set; } } }
namespace VotingSystem.Web.ViewModels.Votes { using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using VotingSystem.Models; using VotingSystem.Web.Infrastructure.Mapping; using VotingSystem.Web.ViewModels.Candidates; public class VoteWithCandidatesInputModel : IMapFrom<Vote> { [Required] public int Id { get; set; } public string Title { get; set; } public int NumberOfVotes { get; set; } public IEnumerable<CandidateInputModel> Candidates { get; set; } } }
mit
C#
ed95391687a5d23e115d72c1ef96d1ec5097f7d7
increment cache version
JetBrains/resharper-unity,JetBrains/resharper-unity,JetBrains/resharper-unity
resharper/resharper-unity/src/CacheVersion.cs
resharper/resharper-unity/src/CacheVersion.cs
using JetBrains.Annotations; using JetBrains.Application.PersistentMap; using JetBrains.Serialization; namespace JetBrains.ReSharper.Plugins.Unity { // Cache version [PolymorphicMarshaller(17)] public class CacheVersion { [UsedImplicitly] public static UnsafeReader.ReadDelegate<object> ReadDelegate = r => new CacheVersion(); [UsedImplicitly] public static UnsafeWriter.WriteDelegate<object> WriteDelegate = (w, o) => { }; } }
using JetBrains.Annotations; using JetBrains.Application.PersistentMap; using JetBrains.Serialization; namespace JetBrains.ReSharper.Plugins.Unity { // Cache version [PolymorphicMarshaller(16)] public class CacheVersion { [UsedImplicitly] public static UnsafeReader.ReadDelegate<object> ReadDelegate = r => new CacheVersion(); [UsedImplicitly] public static UnsafeWriter.WriteDelegate<object> WriteDelegate = (w, o) => { }; } }
apache-2.0
C#
05c98a8e14ad1eca8a8d14167f079571e10aa1e6
resolve arguments against current directory
maxtoroq/sandcastle-md
src/sandcastle-md/Program.cs
src/sandcastle-md/Program.cs
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using Saxon.Api; namespace sandcastle_md { class Program { static void Main(string[] args) { var proc = new Processor(); proc.RegisterExtensionFunction(new MakeRelativeUriExtensionFunction()); var compiler = proc.NewXsltCompiler(); string currentDir = Environment.CurrentDirectory; string inputDir = args[0]; string outputDir = args[1]; if (currentDir.Last() != Path.DirectorySeparatorChar) { currentDir += Path.DirectorySeparatorChar; } if (inputDir.Last() != Path.DirectorySeparatorChar) { inputDir += Path.DirectorySeparatorChar; } if (outputDir.Last() != Path.DirectorySeparatorChar) { outputDir += Path.DirectorySeparatorChar; } var baseUri = new Uri(AppDomain.CurrentDomain.BaseDirectory, UriKind.Absolute); var callerBaseUri = new Uri(currentDir, UriKind.Absolute); var exec = compiler.Compile(new Uri(baseUri, "sandcastle-md-all.xsl")); var transformer = exec.Load(); transformer.InitialTemplate = new QName("main"); transformer.SetParameter(new QName("source-dir"), new XdmAtomicValue(new Uri(callerBaseUri, inputDir))); if (args.Length > 1) { transformer.SetParameter(new QName("output-dir"), new XdmAtomicValue(new Uri(callerBaseUri, outputDir))); } var serializer = new Serializer(); serializer.SetOutputWriter(Console.Out); transformer.Run(serializer); } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using Saxon.Api; namespace sandcastle_md { class Program { static void Main(string[] args) { var proc = new Processor(); proc.RegisterExtensionFunction(new MakeRelativeUriExtensionFunction()); var compiler = proc.NewXsltCompiler(); var baseUri = new Uri(AppDomain.CurrentDomain.BaseDirectory, UriKind.Absolute); var exec = compiler.Compile(new Uri(baseUri, "sandcastle-md-all.xsl")); var transformer = exec.Load(); transformer.InitialTemplate = new QName("main"); transformer.SetParameter(new QName("source-dir"), new XdmAtomicValue(new Uri(baseUri, args[0]))); if (args.Length > 1) { transformer.SetParameter(new QName("output-dir"), new XdmAtomicValue(new Uri(baseUri, args[1]))); } var serializer = new Serializer(); serializer.SetOutputWriter(Console.Out); transformer.Run(serializer); } } }
apache-2.0
C#
af2ac438b672435af3630e27e8b8c8e7d4d25b93
remove database out of constants since it should be private and not a constant
Appleseed/base,Appleseed/base
Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Model/Constants.cs
Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Model/Constants.cs
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Appleseed.Base.Alerts.Model { class Constants { #region App Config Values // Test Settings public static string Mode = System.Configuration.ConfigurationManager.AppSettings["Mode"]; public static string TestEmail = System.Configuration.ConfigurationManager.AppSettings["TestEmail"]; public static string TestSearchQuery = System.Configuration.ConfigurationManager.AppSettings["TestSearchQuery"]; public static string TestSearchLink = System.Configuration.ConfigurationManager.AppSettings["TestSearchLink"]; //SendGridAPI Key public static string APIKey = System.Configuration.ConfigurationManager.AppSettings["SendGridAPIKey"]; //Mail Settings public static string MailFrom = System.Configuration.ConfigurationManager.AppSettings["MailFrom"]; public static string MailFromName = System.Configuration.ConfigurationManager.AppSettings["MailFromName"]; public static string MailSubject = System.Configuration.ConfigurationManager.AppSettings["MailSubject"]; public static string MailHeaderText = System.Configuration.ConfigurationManager.AppSettings["MailHeaderText"]; public static string MailSchedule = System.Configuration.ConfigurationManager.AppSettings["MailSchedule"]; //Search Settings public static string SiteSearchLink = System.Configuration.ConfigurationManager.AppSettings["SiteSearchLink"]; public static string SolrURL = System.Configuration.ConfigurationManager.AppSettings["SolrURL"]; public static string RefreshQuery = System.Configuration.ConfigurationManager.AppSettings["RefreshQuery"]; #endregion } }
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Appleseed.Base.Alerts.Model { class Constants { #region App Config Values // Test Settings public static string Mode = System.Configuration.ConfigurationManager.AppSettings["Mode"]; public static string TestEmail = System.Configuration.ConfigurationManager.AppSettings["TestEmail"]; public static string TestSearchQuery = System.Configuration.ConfigurationManager.AppSettings["TestSearchQuery"]; public static string TestSearchLink = System.Configuration.ConfigurationManager.AppSettings["TestSearchLink"]; //SendGridAPI Key public static string APIKey = System.Configuration.ConfigurationManager.AppSettings["SendGridAPIKey"]; //Mail Settings public static string MailFrom = System.Configuration.ConfigurationManager.AppSettings["MailFrom"]; public static string MailFromName = System.Configuration.ConfigurationManager.AppSettings["MailFromName"]; public static string MailSubject = System.Configuration.ConfigurationManager.AppSettings["MailSubject"]; public static string MailHeaderText = System.Configuration.ConfigurationManager.AppSettings["MailHeaderText"]; public static string MailSchedule = System.Configuration.ConfigurationManager.AppSettings["MailSchedule"]; //Search Settings static string SiteSearchLink = System.Configuration.ConfigurationManager.AppSettings["SiteSearchLink"]; static string SolrURL = System.Configuration.ConfigurationManager.AppSettings["SolrURL"]; static string RefreshQuery = System.Configuration.ConfigurationManager.AppSettings["RefreshQuery"]; //Data Settings static IDbConnection db = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString); #endregion } }
apache-2.0
C#
ef3ca907c7d3cc81dc8e221e4c8c13fd4414de97
Remove editor completely when adding a fieldset to the layout editor.
angelapper/Orchard,Anton-Am/Orchard,cooclsee/Orchard,SzymonSel/Orchard,m2cms/Orchard,qt1/Orchard,stormleoxia/Orchard,DonnotRain/Orchard,sebastienros/msc,andyshao/Orchard,planetClaire/Orchard-LETS,m2cms/Orchard,phillipsj/Orchard,hbulzy/Orchard,hhland/Orchard,yonglehou/Orchard,Codinlab/Orchard,cooclsee/Orchard,neTp9c/Orchard,fortunearterial/Orchard,hhland/Orchard,mgrowan/Orchard,emretiryaki/Orchard,Serlead/Orchard,Anton-Am/Orchard,marcoaoteixeira/Orchard,yonglehou/Orchard,kouweizhong/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,yonglehou/Orchard,omidnasri/Orchard,fassetar/Orchard,abhishekluv/Orchard,JRKelso/Orchard,jtkech/Orchard,jerryshi2007/Orchard,omidnasri/Orchard,JRKelso/Orchard,fortunearterial/Orchard,omidnasri/Orchard,hbulzy/Orchard,dburriss/Orchard,Praggie/Orchard,OrchardCMS/Orchard,planetClaire/Orchard-LETS,hannan-azam/Orchard,TalaveraTechnologySolutions/Orchard,Anton-Am/Orchard,Praggie/Orchard,andyshao/Orchard,tobydodds/folklife,dcinzona/Orchard-Harvest-Website,abhishekluv/Orchard,SeyDutch/Airbrush,sfmskywalker/Orchard,smartnet-developers/Orchard,rtpHarry/Orchard,enspiral-dev-academy/Orchard,abhishekluv/Orchard,luchaoshuai/Orchard,SzymonSel/Orchard,planetClaire/Orchard-LETS,JRKelso/Orchard,Fogolan/OrchardForWork,openbizgit/Orchard,kgacova/Orchard,jersiovic/Orchard,RoyalVeterinaryCollege/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,oxwanawxo/Orchard,hbulzy/Orchard,grapto/Orchard.CloudBust,MetSystem/Orchard,NIKASoftwareDevs/Orchard,harmony7/Orchard,omidnasri/Orchard,li0803/Orchard,johnnyqian/Orchard,mgrowan/Orchard,Fogolan/OrchardForWork,TalaveraTechnologySolutions/Orchard,dozoft/Orchard,LaserSrl/Orchard,tobydodds/folklife,SouleDesigns/SouleDesigns.Orchard,Serlead/Orchard,jtkech/Orchard,arminkarimi/Orchard,armanforghani/Orchard,Praggie/Orchard,jimasp/Orchard,m2cms/Orchard,infofromca/Orchard,armanforghani/Orchard,brownjordaninternational/OrchardCMS,sebastienros/msc,fortunearterial/Orchard,mvarblow/Orchard,mgrowan/Orchard,enspiral-dev-academy/Orchard,dozoft/Orchard,vairam-svs/Orchard,omidnasri/Orchard,rtpHarry/Orchard,stormleoxia/Orchard,bedegaming-aleksej/Orchard,DonnotRain/Orchard,neTp9c/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,angelapper/Orchard,escofieldnaxos/Orchard,mvarblow/Orchard,huoxudong125/Orchard,jersiovic/Orchard,dcinzona/Orchard-Harvest-Website,MetSystem/Orchard,Sylapse/Orchard.HttpAuthSample,xkproject/Orchard,sebastienros/msc,Inner89/Orchard,Dolphinsimon/Orchard,qt1/Orchard,escofieldnaxos/Orchard,TaiAivaras/Orchard,jimasp/Orchard,emretiryaki/Orchard,sebastienros/msc,LaserSrl/Orchard,smartnet-developers/Orchard,Lombiq/Orchard,mvarblow/Orchard,openbizgit/Orchard,smartnet-developers/Orchard,andyshao/Orchard,xkproject/Orchard,geertdoornbos/Orchard,jtkech/Orchard,infofromca/Orchard,NIKASoftwareDevs/Orchard,jimasp/Orchard,fassetar/Orchard,omidnasri/Orchard,AdvantageCS/Orchard,bedegaming-aleksej/Orchard,TalaveraTechnologySolutions/Orchard,armanforghani/Orchard,openbizgit/Orchard,smartnet-developers/Orchard,hannan-azam/Orchard,andyshao/Orchard,emretiryaki/Orchard,AdvantageCS/Orchard,brownjordaninternational/OrchardCMS,harmony7/Orchard,hhland/Orchard,marcoaoteixeira/Orchard,enspiral-dev-academy/Orchard,bedegaming-aleksej/Orchard,SouleDesigns/SouleDesigns.Orchard,luchaoshuai/Orchard,rtpHarry/Orchard,sfmskywalker/Orchard,sebastienros/msc,Codinlab/Orchard,MetSystem/Orchard,kgacova/Orchard,armanforghani/Orchard,cooclsee/Orchard,jersiovic/Orchard,dcinzona/Orchard,spraiin/Orchard,jerryshi2007/Orchard,SouleDesigns/SouleDesigns.Orchard,mvarblow/Orchard,jagraz/Orchard,Serlead/Orchard,fortunearterial/Orchard,patricmutwiri/Orchard,hannan-azam/Orchard,arminkarimi/Orchard,dcinzona/Orchard,aaronamm/Orchard,SzymonSel/Orchard,emretiryaki/Orchard,neTp9c/Orchard,dburriss/Orchard,xiaobudian/Orchard,RoyalVeterinaryCollege/Orchard,DonnotRain/Orchard,fortunearterial/Orchard,IDeliverable/Orchard,hhland/Orchard,dcinzona/Orchard,aaronamm/Orchard,RoyalVeterinaryCollege/Orchard,planetClaire/Orchard-LETS,SzymonSel/Orchard,OrchardCMS/Orchard-Harvest-Website,vairam-svs/Orchard,sfmskywalker/Orchard,stormleoxia/Orchard,fassetar/Orchard,vairam-svs/Orchard,harmony7/Orchard,Fogolan/OrchardForWork,patricmutwiri/Orchard,omidnasri/Orchard,oxwanawxo/Orchard,abhishekluv/Orchard,Sylapse/Orchard.HttpAuthSample,stormleoxia/Orchard,xiaobudian/Orchard,harmony7/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,xiaobudian/Orchard,LaserSrl/Orchard,stormleoxia/Orchard,ehe888/Orchard,yersans/Orchard,geertdoornbos/Orchard,kgacova/Orchard,AdvantageCS/Orchard,Inner89/Orchard,TalaveraTechnologySolutions/Orchard,grapto/Orchard.CloudBust,AdvantageCS/Orchard,huoxudong125/Orchard,jagraz/Orchard,MetSystem/Orchard,brownjordaninternational/OrchardCMS,SouleDesigns/SouleDesigns.Orchard,OrchardCMS/Orchard,escofieldnaxos/Orchard,huoxudong125/Orchard,Lombiq/Orchard,kgacova/Orchard,dcinzona/Orchard,SeyDutch/Airbrush,AndreVolksdorf/Orchard,mgrowan/Orchard,OrchardCMS/Orchard-Harvest-Website,bedegaming-aleksej/Orchard,grapto/Orchard.CloudBust,patricmutwiri/Orchard,m2cms/Orchard,openbizgit/Orchard,vairam-svs/Orchard,Fogolan/OrchardForWork,spraiin/Orchard,kouweizhong/Orchard,qt1/Orchard,m2cms/Orchard,angelapper/Orchard,jagraz/Orchard,marcoaoteixeira/Orchard,Inner89/Orchard,jtkech/Orchard,phillipsj/Orchard,Ermesx/Orchard,TaiAivaras/Orchard,phillipsj/Orchard,omidnasri/Orchard,arminkarimi/Orchard,dcinzona/Orchard-Harvest-Website,Dolphinsimon/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,ehe888/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,Ermesx/Orchard,angelapper/Orchard,OrchardCMS/Orchard,xiaobudian/Orchard,TalaveraTechnologySolutions/Orchard,Ermesx/Orchard,JRKelso/Orchard,luchaoshuai/Orchard,SeyDutch/Airbrush,brownjordaninternational/OrchardCMS,aaronamm/Orchard,Sylapse/Orchard.HttpAuthSample,sfmskywalker/Orchard,TalaveraTechnologySolutions/Orchard,dcinzona/Orchard-Harvest-Website,ehe888/Orchard,geertdoornbos/Orchard,dozoft/Orchard,johnnyqian/Orchard,rtpHarry/Orchard,angelapper/Orchard,huoxudong125/Orchard,hannan-azam/Orchard,escofieldnaxos/Orchard,tobydodds/folklife,gcsuk/Orchard,Sylapse/Orchard.HttpAuthSample,tobydodds/folklife,AndreVolksdorf/Orchard,jchenga/Orchard,dcinzona/Orchard-Harvest-Website,johnnyqian/Orchard,yonglehou/Orchard,dcinzona/Orchard,neTp9c/Orchard,NIKASoftwareDevs/Orchard,RoyalVeterinaryCollege/Orchard,infofromca/Orchard,Codinlab/Orchard,xkproject/Orchard,jersiovic/Orchard,OrchardCMS/Orchard-Harvest-Website,enspiral-dev-academy/Orchard,TalaveraTechnologySolutions/Orchard,TaiAivaras/Orchard,DonnotRain/Orchard,cooclsee/Orchard,hbulzy/Orchard,yersans/Orchard,emretiryaki/Orchard,luchaoshuai/Orchard,yersans/Orchard,infofromca/Orchard,spraiin/Orchard,fassetar/Orchard,alejandroaldana/Orchard,Dolphinsimon/Orchard,gcsuk/Orchard,yonglehou/Orchard,grapto/Orchard.CloudBust,IDeliverable/Orchard,aaronamm/Orchard,mgrowan/Orchard,xkproject/Orchard,geertdoornbos/Orchard,oxwanawxo/Orchard,cooclsee/Orchard,jagraz/Orchard,huoxudong125/Orchard,li0803/Orchard,grapto/Orchard.CloudBust,TaiAivaras/Orchard,kouweizhong/Orchard,OrchardCMS/Orchard-Harvest-Website,LaserSrl/Orchard,neTp9c/Orchard,sfmskywalker/Orchard,gcsuk/Orchard,ehe888/Orchard,johnnyqian/Orchard,Dolphinsimon/Orchard,phillipsj/Orchard,phillipsj/Orchard,jagraz/Orchard,AndreVolksdorf/Orchard,geertdoornbos/Orchard,OrchardCMS/Orchard-Harvest-Website,Serlead/Orchard,openbizgit/Orchard,SouleDesigns/SouleDesigns.Orchard,jchenga/Orchard,Inner89/Orchard,enspiral-dev-academy/Orchard,patricmutwiri/Orchard,omidnasri/Orchard,jersiovic/Orchard,TalaveraTechnologySolutions/Orchard,DonnotRain/Orchard,xiaobudian/Orchard,infofromca/Orchard,ehe888/Orchard,alejandroaldana/Orchard,SzymonSel/Orchard,Ermesx/Orchard,sfmskywalker/Orchard,Anton-Am/Orchard,vairam-svs/Orchard,harmony7/Orchard,NIKASoftwareDevs/Orchard,gcsuk/Orchard,Serlead/Orchard,SeyDutch/Airbrush,sfmskywalker/Orchard,Codinlab/Orchard,grapto/Orchard.CloudBust,jchenga/Orchard,bedegaming-aleksej/Orchard,sfmskywalker/Orchard,arminkarimi/Orchard,LaserSrl/Orchard,yersans/Orchard,IDeliverable/Orchard,Anton-Am/Orchard,dozoft/Orchard,mvarblow/Orchard,jerryshi2007/Orchard,johnnyqian/Orchard,smartnet-developers/Orchard,yersans/Orchard,jchenga/Orchard,abhishekluv/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,li0803/Orchard,rtpHarry/Orchard,tobydodds/folklife,brownjordaninternational/OrchardCMS,AdvantageCS/Orchard,dozoft/Orchard,alejandroaldana/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,qt1/Orchard,dburriss/Orchard,jerryshi2007/Orchard,IDeliverable/Orchard,JRKelso/Orchard,RoyalVeterinaryCollege/Orchard,MetSystem/Orchard,Dolphinsimon/Orchard,jchenga/Orchard,alejandroaldana/Orchard,li0803/Orchard,Inner89/Orchard,OrchardCMS/Orchard-Harvest-Website,Ermesx/Orchard,spraiin/Orchard,Praggie/Orchard,jtkech/Orchard,oxwanawxo/Orchard,oxwanawxo/Orchard,patricmutwiri/Orchard,marcoaoteixeira/Orchard,alejandroaldana/Orchard,OrchardCMS/Orchard,jimasp/Orchard,arminkarimi/Orchard,jimasp/Orchard,xkproject/Orchard,andyshao/Orchard,hbulzy/Orchard,Codinlab/Orchard,NIKASoftwareDevs/Orchard,armanforghani/Orchard,Sylapse/Orchard.HttpAuthSample,OrchardCMS/Orchard,Fogolan/OrchardForWork,SeyDutch/Airbrush,gcsuk/Orchard,hannan-azam/Orchard,luchaoshuai/Orchard,dcinzona/Orchard-Harvest-Website,planetClaire/Orchard-LETS,kouweizhong/Orchard,AndreVolksdorf/Orchard,jerryshi2007/Orchard,dburriss/Orchard,IDeliverable/Orchard,AndreVolksdorf/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,escofieldnaxos/Orchard,abhishekluv/Orchard,Praggie/Orchard,Lombiq/Orchard,kouweizhong/Orchard,fassetar/Orchard,hhland/Orchard,spraiin/Orchard,dburriss/Orchard,TaiAivaras/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,Lombiq/Orchard,Lombiq/Orchard,aaronamm/Orchard,marcoaoteixeira/Orchard,tobydodds/folklife,kgacova/Orchard,qt1/Orchard,li0803/Orchard
src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/Fieldset.cs
src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/Fieldset.cs
using Orchard.Layouts.Helpers; using Orchard.Layouts.Elements; namespace Orchard.DynamicForms.Elements { public class Fieldset : Container { public override string Category { get { return "Forms"; } } public override bool HasEditor { get { return false; } } public string Legend { get { return this.Retrieve(f => f.Legend); } set { this.Store(f => f.Legend, value); } } public Form Form { get { var parent = Container; while (parent != null) { var form = parent as Form; if (form != null) return form; parent = parent.Container; } return null; } } } }
using Orchard.Layouts.Helpers; using Orchard.Layouts.Elements; namespace Orchard.DynamicForms.Elements { public class Fieldset : Container { public override string Category { get { return "Forms"; } } public string Legend { get { return this.Retrieve(f => f.Legend); } set { this.Store(f => f.Legend, value); } } public Form Form { get { var parent = Container; while (parent != null) { var form = parent as Form; if (form != null) return form; parent = parent.Container; } return null; } } } }
bsd-3-clause
C#
7d51d0deffc7ebc150ec608cb0c1dcae12d7e1af
Add logging to Program.cs
Kingloo/Pingy
src/Program.cs
src/Program.cs
using System; using System.Globalization; using Pingy.Common; using Pingy.Gui; namespace Pingy { public static class Program { [STAThread] public static int Main() { App app = new App(); int exitCode = app.Run(); if (exitCode != 0) { string message = string.Format(CultureInfo.CurrentCulture, "exited with code {0}", exitCode); Log.Message(message); } return exitCode; } } }
using System; using Pingy.Gui; namespace Pingy { public static class Program { [STAThread] public static int Main() { App app = new App(); int exitCode = app.Run(); if (exitCode != 0) { // log } return exitCode; } } }
unlicense
C#
1dc81232db728b58c3eb9479afeb4569062e58e6
Add comment
sonvister/Binance
src/Binance/Extensions/TimestampExtensions.cs
src/Binance/Extensions/TimestampExtensions.cs
using System; // ReSharper disable once CheckNamespace namespace Binance { public static class TimestampExtensions { /// <summary> /// Convert a timestamp to UTC <see cref="DateTime"/>. /// </summary> /// <param name="timestamp"></param> /// <returns></returns> public static DateTime ToDateTime(this long timestamp) { return DateTimeOffset.FromUnixTimeMilliseconds(timestamp).UtcDateTime; } } }
using System; namespace Binance { public static class TimestampExtensions { /// <summary> /// Convert a timestamp to UTC <see cref="DateTime"/>. /// </summary> /// <param name="timestamp"></param> /// <returns></returns> public static DateTime ToDateTime(this long timestamp) { return DateTimeOffset.FromUnixTimeMilliseconds(timestamp).UtcDateTime; } } }
mit
C#
c712760841ea71574cfb8ea3bbf6462b51e55a52
Convert scrap errors to warnings
PowerShell/PSScriptAnalyzer
PSCompatibilityAnalyzer/Microsoft.PowerShell.CrossCompatibility/Commands/CommandUtilities.cs
PSCompatibilityAnalyzer/Microsoft.PowerShell.CrossCompatibility/Commands/CommandUtilities.cs
using System; using System.IO; using System.Management.Automation; namespace Microsoft.PowerShell.CrossCompatibility.Commands { internal static class CommandUtilities { private const string COMPATIBILITY_ERROR_ID = "CompatibilityAnalysisError"; public const string MODULE_PREFIX = "PSCompatibility"; public static void WriteExceptionAsWarning( this Cmdlet cmdlet, Exception exception, string errorId = COMPATIBILITY_ERROR_ID, ErrorCategory errorCategory = ErrorCategory.ReadError, object targetObject = null) { cmdlet.WriteWarning(exception.ToString()); } public static string GetNormalizedAbsolutePath(this PSCmdlet cmdlet, string path) { if (Path.IsPathRooted(path)) { return path; } return cmdlet.SessionState.Path.GetUnresolvedProviderPathFromPSPath(path); } private static ErrorRecord CreateCompatibilityErrorRecord( Exception e, string errorId = COMPATIBILITY_ERROR_ID, ErrorCategory errorCategory = ErrorCategory.ReadError, object targetObject = null) { return new ErrorRecord( e, errorId, errorCategory, targetObject); } } }
using System; using System.IO; using System.Management.Automation; namespace Microsoft.PowerShell.CrossCompatibility.Commands { internal static class CommandUtilities { private const string COMPATIBILITY_ERROR_ID = "CompatibilityAnalysisError"; public const string MODULE_PREFIX = "PSCompatibility"; public static void WriteExceptionAsError( this Cmdlet cmdlet, Exception exception, string errorId = COMPATIBILITY_ERROR_ID, ErrorCategory errorCategory = ErrorCategory.ReadError, object targetObject = null) { cmdlet.WriteError(CreateCompatibilityErrorRecord(exception, errorId, errorCategory, targetObject)); } public static string GetNormalizedAbsolutePath(this PSCmdlet cmdlet, string path) { if (Path.IsPathRooted(path)) { return path; } return cmdlet.SessionState.Path.GetUnresolvedProviderPathFromPSPath(path); } private static ErrorRecord CreateCompatibilityErrorRecord( Exception e, string errorId = COMPATIBILITY_ERROR_ID, ErrorCategory errorCategory = ErrorCategory.ReadError, object targetObject = null) { return new ErrorRecord( e, errorId, errorCategory, targetObject); } } }
mit
C#
72086345cbae639e98ab8d8a976f90228100b439
fix #1626 parsed datetimes on datehistogram should be datetimekind.utc
adam-mccoy/elasticsearch-net,adam-mccoy/elasticsearch-net,TheFireCookie/elasticsearch-net,azubanov/elasticsearch-net,TheFireCookie/elasticsearch-net,UdiBen/elasticsearch-net,elastic/elasticsearch-net,TheFireCookie/elasticsearch-net,RossLieberman/NEST,RossLieberman/NEST,RossLieberman/NEST,adam-mccoy/elasticsearch-net,UdiBen/elasticsearch-net,CSGOpenSource/elasticsearch-net,UdiBen/elasticsearch-net,CSGOpenSource/elasticsearch-net,azubanov/elasticsearch-net,azubanov/elasticsearch-net,elastic/elasticsearch-net,CSGOpenSource/elasticsearch-net
src/Nest/Aggregations/Bucket/DateHistogram/DateHistogramBucket.cs
src/Nest/Aggregations/Bucket/DateHistogram/DateHistogramBucket.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Nest { public class DateHistogramBucket : HistogramBucket { // Get a DateTime form of the returned key public DateTime Date => DateTime.SpecifyKind(new DateTime(1970, 1, 1).AddMilliseconds(0 + this.Key), DateTimeKind.Utc); } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Nest { public class DateHistogramBucket : HistogramBucket { // Get a DateTime form of the returned key public DateTime Date => new DateTime(1970, 1, 1).AddMilliseconds(0 + this.Key); } }
apache-2.0
C#
5f2ea51b36e53e264fb2368cdfe7f53491b2f29d
Remove TabTypeUtilities class.
GetTabster/Tabster
Tabster.Core/Types/TabType.cs
Tabster.Core/Types/TabType.cs
namespace Tabster.Core.Types { public enum TabType { Guitar, Chords, Bass, Drum, Ukulele } public static class TabTypeExtensions { public static string ToFriendlyString(this TabType type) { switch (type) { case TabType.Guitar: return "Guitar Tab"; case TabType.Chords: return "Guitar Chords"; case TabType.Bass: return "Bass Tab"; case TabType.Drum: return "Drum Tab"; case TabType.Ukulele: return "Ukulele Tab"; } return null; } } }
#region using System; #endregion namespace Tabster.Core.Types { public enum TabType { Guitar, Chords, Bass, Drum, Ukulele } public static class TabTypeUtilities { internal static readonly string[] _typeStrings = new[] {"Guitar Tab", "Guitar Chords", "Bass Tab", "Drum Tab", "Ukulele Tab"}; public static string ToFriendlyString(this TabType type) { return _typeStrings[(int) type]; } public static string[] FriendlyStrings() { return _typeStrings; } public static TabType? FromFriendlyString(string str) { for (var i = 0; i < _typeStrings.Length; i++) { var typeString = _typeStrings[i]; if (typeString.Equals(str, StringComparison.InvariantCultureIgnoreCase)) { var type = (TabType) i; return type; } } return null; } } }
apache-2.0
C#
71c0f2fc5ed57a01a34e1ace43afc5438e200f42
switch edge transition to Cubic In for exit
OliveTreeBible/Xamarin.Transitions
Transitions/EdgeTransition.cs
Transitions/EdgeTransition.cs
using System; using OliveTree.Transitions.Curves; using Xamarin.Forms; namespace OliveTree.Transitions { public class EdgeTransition : LayoutTransition { private static readonly AnimationCurve Enter = new Spring { Friction = 5 }; private static readonly AnimationCurve Exit = new EasingCurve { Easing = Easing.Cubic, Mode = EasingMode.In }; public override TimeSpan Duration { get; set; } = TimeSpan.FromMilliseconds(400); public override AnimationCurve Curve { get { var e = Element; var p = (VisualElement)Element?.Parent; if (e == null || p == null) return new EasingCurve(); return e.Bounds.IntersectsWith(p.Bounds) ? Enter : Exit; } set { } } } }
using System; using OliveTree.Transitions.Curves; using Xamarin.Forms; namespace OliveTree.Transitions { public class EdgeTransition : LayoutTransition { private static readonly AnimationCurve Enter = new Spring { Friction = 5 }; private static readonly AnimationCurve Exit = new BackCurve { Amplitude = 0.25d, Mode = EasingMode.In }; public override TimeSpan Duration { get; set; } = TimeSpan.FromMilliseconds(400); public override AnimationCurve Curve { get { var e = Element; var p = (VisualElement)Element?.Parent; if (e == null || p == null) return new EasingCurve(); return e.Bounds.IntersectsWith(p.Bounds) ? Enter : Exit; } set { } } } }
mit
C#
ad04dd175089b050afd34b89ac9be7bd1557d5f9
Work around CoreCLR issue
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
samples/angular/MusicStore/Apis/Models/Album.cs
samples/angular/MusicStore/Apis/Models/Album.cs
using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace MusicStore.Models { public class Album { public Album() { // TODO: Temporary hack to populate the orderdetails until EF does this automatically. OrderDetails = new List<OrderDetail>(); } [ScaffoldColumn(false)] public int AlbumId { get; set; } public int GenreId { get; set; } public int ArtistId { get; set; } [Required] [StringLength(160, MinimumLength = 2)] public string Title { get; set; } [Required] [RangeAttribute(typeof(double), "0.01", "100")] // Long-form constructor to work around https://github.com/dotnet/coreclr/issues/2172 [DataType(DataType.Currency)] public decimal Price { get; set; } [Display(Name = "Album Art URL")] [StringLength(1024)] public string AlbumArtUrl { get; set; } public virtual Genre Genre { get; set; } public virtual Artist Artist { get; set; } public virtual ICollection<OrderDetail> OrderDetails { get; set; } } }
using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace MusicStore.Models { public class Album { public Album() { // TODO: Temporary hack to populate the orderdetails until EF does this automatically. OrderDetails = new List<OrderDetail>(); } [ScaffoldColumn(false)] public int AlbumId { get; set; } public int GenreId { get; set; } public int ArtistId { get; set; } [Required] [StringLength(160, MinimumLength = 2)] public string Title { get; set; } [Required] [Range(0.01, 100.00)] [DataType(DataType.Currency)] public decimal Price { get; set; } [Display(Name = "Album Art URL")] [StringLength(1024)] public string AlbumArtUrl { get; set; } public virtual Genre Genre { get; set; } public virtual Artist Artist { get; set; } public virtual ICollection<OrderDetail> OrderDetails { get; set; } } }
apache-2.0
C#
3bac6ad93820e9710c0cebb8678b3ddc4e81ff1a
Check associated object parameter for null. Throw ArgumentNullException if it is null
PedroLamas/XamlBehaviors,PedroLamas/XamlBehaviors,Microsoft/XamlBehaviors,PedroLamas/XamlBehaviors,Microsoft/XamlBehaviors,Microsoft/XamlBehaviors
src/BehaviorsSDKManaged/Microsoft.Xaml.Interactivity/Behavior.cs
src/BehaviorsSDKManaged/Microsoft.Xaml.Interactivity/Behavior.cs
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using Windows.UI.Xaml; namespace Microsoft.Xaml.Interactivity { /// <summary> /// A base class for behaviors, implementing the basic plumbing of IBehavior /// </summary> public abstract class Behavior : DependencyObject, IBehavior { public DependencyObject AssociatedObject { get; private set; } public void Attach(DependencyObject associatedObject) { if (associatedObject == null) throw new ArgumentNullException(nameof(associatedObject)); AssociatedObject = associatedObject; OnAttached(); } public void Detach() { OnDetaching(); } protected virtual void OnAttached() { } protected virtual void OnDetaching() { } } }
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Windows.UI.Xaml; namespace Microsoft.Xaml.Interactivity { /// <summary> /// A base class for behaviors, implementing the basic plumbing of IBehavior /// </summary> public abstract class Behavior : DependencyObject, IBehavior { public DependencyObject AssociatedObject { get; private set; } public void Attach(DependencyObject associatedObject) { AssociatedObject = associatedObject; OnAttached(); } public void Detach() { OnDetaching(); } protected virtual void OnAttached() { } protected virtual void OnDetaching() { } } }
mit
C#
119af7877f5a026dbd9d333be267dd0dbbeb94ba
Update ConvertWorksheetToImageByPage.cs
aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET
Examples/CSharp/Articles/ConvertingWorksheetToImage/ConvertWorksheetToImageByPage.cs
Examples/CSharp/Articles/ConvertingWorksheetToImage/ConvertWorksheetToImageByPage.cs
using System.IO; using Aspose.Cells; using Aspose.Cells.Rendering; namespace Aspose.Cells.Examples.Articles.ConvertingWorksheetToImage { public class ConvertWorksheetToImageByPage { 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); Workbook book = new Workbook(dataDir+ "TestData.xlsx"); Worksheet sheet = book.Worksheets[0]; Aspose.Cells.Rendering.ImageOrPrintOptions options = new Aspose.Cells.Rendering.ImageOrPrintOptions(); options.HorizontalResolution = 200; options.VerticalResolution = 200; options.ImageFormat = System.Drawing.Imaging.ImageFormat.Tiff; //Sheet2Image By Page conversion SheetRender sr = new SheetRender(sheet, options); for (int j = 0; j < sr.PageCount; j++) { sr.ToImage(j, dataDir+ "test" + sheet.Name + " Page" + (j + 1) + ".out.tif"); } //ExEnd:1 } } }
using System.IO; using Aspose.Cells; using Aspose.Cells.Rendering; namespace Aspose.Cells.Examples.Articles.ConvertingWorksheetToImage { public class ConvertWorksheetToImageByPage { public static void Main(string[] args) { // The path to the documents directory. string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); Workbook book = new Workbook(dataDir+ "TestData.xlsx"); Worksheet sheet = book.Worksheets[0]; Aspose.Cells.Rendering.ImageOrPrintOptions options = new Aspose.Cells.Rendering.ImageOrPrintOptions(); options.HorizontalResolution = 200; options.VerticalResolution = 200; options.ImageFormat = System.Drawing.Imaging.ImageFormat.Tiff; //Sheet2Image By Page conversion SheetRender sr = new SheetRender(sheet, options); for (int j = 0; j < sr.PageCount; j++) { sr.ToImage(j, dataDir+ "test" + sheet.Name + " Page" + (j + 1) + ".out.tif"); } } } }
mit
C#
13c7355163c6b15cc67229d41d123f8fbccfbd91
Add Binary TypeMap with maxSize for PostgreSQL.
itn3000/fluentmigrator,wolfascu/fluentmigrator,barser/fluentmigrator,mstancombe/fluentmig,vgrigoriu/fluentmigrator,modulexcite/fluentmigrator,vgrigoriu/fluentmigrator,MetSystem/fluentmigrator,drmohundro/fluentmigrator,wolfascu/fluentmigrator,DefiSolutions/fluentmigrator,amroel/fluentmigrator,fluentmigrator/fluentmigrator,lahma/fluentmigrator,eloekset/fluentmigrator,modulexcite/fluentmigrator,igitur/fluentmigrator,bluefalcon/fluentmigrator,tohagan/fluentmigrator,akema-fr/fluentmigrator,schambers/fluentmigrator,dealproc/fluentmigrator,FabioNascimento/fluentmigrator,mstancombe/fluentmig,alphamc/fluentmigrator,dealproc/fluentmigrator,DefiSolutions/fluentmigrator,eloekset/fluentmigrator,spaccabit/fluentmigrator,drmohundro/fluentmigrator,DefiSolutions/fluentmigrator,jogibear9988/fluentmigrator,lahma/fluentmigrator,swalters/fluentmigrator,FabioNascimento/fluentmigrator,KaraokeStu/fluentmigrator,spaccabit/fluentmigrator,daniellee/fluentmigrator,mstancombe/fluentmigrator,alphamc/fluentmigrator,lcharlebois/fluentmigrator,tommarien/fluentmigrator,daniellee/fluentmigrator,mstancombe/fluentmig,IRlyDontKnow/fluentmigrator,itn3000/fluentmigrator,bluefalcon/fluentmigrator,swalters/fluentmigrator,igitur/fluentmigrator,stsrki/fluentmigrator,fluentmigrator/fluentmigrator,tommarien/fluentmigrator,akema-fr/fluentmigrator,MetSystem/fluentmigrator,IRlyDontKnow/fluentmigrator,tohagan/fluentmigrator,istaheev/fluentmigrator,amroel/fluentmigrator,schambers/fluentmigrator,jogibear9988/fluentmigrator,stsrki/fluentmigrator,tohagan/fluentmigrator,istaheev/fluentmigrator,barser/fluentmigrator,lahma/fluentmigrator,istaheev/fluentmigrator,daniellee/fluentmigrator,lcharlebois/fluentmigrator,mstancombe/fluentmigrator,KaraokeStu/fluentmigrator
src/FluentMigrator.Runner/Generators/Postgres/PostgresTypeMap.cs
src/FluentMigrator.Runner/Generators/Postgres/PostgresTypeMap.cs
using System.Data; using FluentMigrator.Runner.Generators.Base; namespace FluentMigrator.Runner.Generators.Postgres { internal class PostgresTypeMap : TypeMapBase { private const int DecimalCapacity = 1000; private const int PostgresMaxVarcharSize = 10485760; protected override void SetupTypeMaps() { SetTypeMap(DbType.AnsiStringFixedLength, "char(255)"); SetTypeMap(DbType.AnsiStringFixedLength, "char($size)", int.MaxValue); SetTypeMap(DbType.AnsiString, "text"); SetTypeMap(DbType.AnsiString, "varchar($size)", PostgresMaxVarcharSize); SetTypeMap(DbType.AnsiString, "text", int.MaxValue); SetTypeMap(DbType.Binary, "bytea"); SetTypeMap(DbType.Binary, "bytea", int.MaxValue); SetTypeMap(DbType.Boolean, "boolean"); SetTypeMap(DbType.Byte, "smallint"); //no built-in support for single byte unsigned integers SetTypeMap(DbType.Currency, "money"); SetTypeMap(DbType.Date, "date"); SetTypeMap(DbType.DateTime, "timestamp"); SetTypeMap(DbType.Decimal, "decimal(19,5)"); SetTypeMap(DbType.Decimal, "decimal($size,$precision)", DecimalCapacity); SetTypeMap(DbType.Double, "float8"); SetTypeMap(DbType.Guid, "uuid"); SetTypeMap(DbType.Int16, "smallint"); SetTypeMap(DbType.Int32, "integer"); SetTypeMap(DbType.Int64, "bigint"); SetTypeMap(DbType.Single, "float4"); SetTypeMap(DbType.StringFixedLength, "char(255)"); SetTypeMap(DbType.StringFixedLength, "char($size)", int.MaxValue); SetTypeMap(DbType.String, "text"); SetTypeMap(DbType.String, "varchar($size)", PostgresMaxVarcharSize); SetTypeMap(DbType.String, "text", int.MaxValue); SetTypeMap(DbType.Time, "time"); } } }
using System.Data; using FluentMigrator.Runner.Generators.Base; namespace FluentMigrator.Runner.Generators.Postgres { internal class PostgresTypeMap : TypeMapBase { private const int DecimalCapacity = 1000; private const int PostgresMaxVarcharSize = 10485760; protected override void SetupTypeMaps() { SetTypeMap(DbType.AnsiStringFixedLength, "char(255)"); SetTypeMap(DbType.AnsiStringFixedLength, "char($size)", int.MaxValue); SetTypeMap(DbType.AnsiString, "text"); SetTypeMap(DbType.AnsiString, "varchar($size)", PostgresMaxVarcharSize); SetTypeMap(DbType.AnsiString, "text", int.MaxValue); SetTypeMap(DbType.Binary, "bytea"); SetTypeMap(DbType.Boolean, "boolean"); SetTypeMap(DbType.Byte, "smallint"); //no built-in support for single byte unsigned integers SetTypeMap(DbType.Currency, "money"); SetTypeMap(DbType.Date, "date"); SetTypeMap(DbType.DateTime, "timestamp"); SetTypeMap(DbType.Decimal, "decimal(19,5)"); SetTypeMap(DbType.Decimal, "decimal($size,$precision)", DecimalCapacity); SetTypeMap(DbType.Double, "float8"); SetTypeMap(DbType.Guid, "uuid"); SetTypeMap(DbType.Int16, "smallint"); SetTypeMap(DbType.Int32, "integer"); SetTypeMap(DbType.Int64, "bigint"); SetTypeMap(DbType.Single, "float4"); SetTypeMap(DbType.StringFixedLength, "char(255)"); SetTypeMap(DbType.StringFixedLength, "char($size)", int.MaxValue); SetTypeMap(DbType.String, "text"); SetTypeMap(DbType.String, "varchar($size)", PostgresMaxVarcharSize); SetTypeMap(DbType.String, "text", int.MaxValue); SetTypeMap(DbType.Time, "time"); } } }
apache-2.0
C#
7f7468800095b2febd969e3d599538964dd92456
Add bindings
Branimir123/ZobShop,Branimir123/ZobShop,Branimir123/ZobShop
src/ZobShop.Web/App_Start/NinjectModules/DefaultNinjectModule.cs
src/ZobShop.Web/App_Start/NinjectModules/DefaultNinjectModule.cs
using System.IO; using System.Reflection; using System.Web; using Ninject; using Ninject.Activation; using Ninject.Extensions.Conventions; using Ninject.Extensions.Factory; using Ninject.Modules; using ZobShop.Authentication; using ZobShop.ModelViewPresenter.ShoppingCart.Add; using ZobShop.ModelViewPresenter.ShoppingCart.Summary; using ZobShop.Orders; using ZobShop.Orders.Contracts; using ZobShop.Orders.Factories; namespace ZobShop.Web.App_Start.NinjectModules { public class DefaultNinjectModule : NinjectModule { private const string CartSessionKey = "cart"; public override void Load() { this.Bind(x => { { var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); x.FromAssembliesInPath(path) .SelectAllClasses() .BindDefaultInterface(); } }); this.Bind<IAuthenticationProvider>().To<HttpContextAuthenticationProvider>(); this.Bind<ICartLine>().To<CartLine>(); this.Bind<IShoppingCart>().To<Orders.ShoppingCart>(); this.Bind<ICartLineFactory>().ToFactory().InSingletonScope(); this.Bind<IShoppingCart>().ToMethod(this.GetShoppingCart).WhenInjectedInto(typeof(AddToCartPresenter)); this.Bind<IShoppingCart>().ToMethod(this.GetShoppingCart).WhenInjectedInto(typeof(CartSummaryPresenter)); } private IShoppingCart GetShoppingCart(IContext arg) { var cart = (IShoppingCart)HttpContext.Current.Session[CartSessionKey]; if (cart == null) { cart = this.Kernel.Get<IShoppingCart>(); HttpContext.Current.Session[CartSessionKey] = cart; } return cart; } } }
using System.IO; using System.Reflection; using System.Web; using Ninject; using Ninject.Activation; using Ninject.Extensions.Conventions; using Ninject.Extensions.Factory; using Ninject.Modules; using ZobShop.ModelViewPresenter.ShoppingCart.Add; using ZobShop.ModelViewPresenter.ShoppingCart.Summary; using ZobShop.Orders; using ZobShop.Orders.Contracts; using ZobShop.Orders.Factories; namespace ZobShop.Web.App_Start.NinjectModules { public class DefaultNinjectModule : NinjectModule { private const string CartSessionKey = "cart"; public override void Load() { this.Bind(x => { { var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); x.FromAssembliesInPath(path) .SelectAllClasses() .BindDefaultInterface(); } }); this.Bind<ICartLine>().To<CartLine>(); this.Bind<IShoppingCart>().To<Orders.ShoppingCart>(); this.Bind<ICartLineFactory>().ToFactory().InSingletonScope(); this.Bind<IShoppingCart>().ToMethod(this.GetShoppingCart).WhenInjectedInto(typeof(AddToCartPresenter)); this.Bind<IShoppingCart>().ToMethod(this.GetShoppingCart).WhenInjectedInto(typeof(CartSummaryPresenter)); } private IShoppingCart GetShoppingCart(IContext arg) { var cart = (IShoppingCart)HttpContext.Current.Session[CartSessionKey]; if (cart == null) { cart = this.Kernel.Get<IShoppingCart>(); HttpContext.Current.Session[CartSessionKey] = cart; } return cart; } } }
mit
C#
1dc9143f968ef601094f59cfc9924f342ba3b563
Add missing namespace.
aspnetboilerplate/module-zero-core-template,aspnetboilerplate/module-zero-core-template,aspnetboilerplate/module-zero-core-template,aspnetboilerplate/module-zero-core-template,aspnetboilerplate/module-zero-core-template
aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Controllers/AboutController.cs
aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Controllers/AboutController.cs
using Abp.AspNetCore.Mvc.Authorization; using AbpCompanyName.AbpProjectName.Controllers; using Microsoft.AspNetCore.Mvc; namespace AbpCompanyName.AbpProjectName.Web.Controllers { [AbpMvcAuthorize] public class AboutController : AbpProjectNameControllerBase { public ActionResult Index() { return View(); } } }
using AbpCompanyName.AbpProjectName.Controllers; using Microsoft.AspNetCore.Mvc; namespace AbpCompanyName.AbpProjectName.Web.Controllers { [AbpMvcAuthorize] public class AboutController : AbpProjectNameControllerBase { public ActionResult Index() { return View(); } } }
mit
C#
d4ca010043554051944be353e367b2b165504161
Update to Version 0.1.7
akordowski/Cake.Compression,akordowski/Cake.Compression
src/Cake.Compression/Properties/AssemblyInfo.cs
src/Cake.Compression/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Allgemeine Informationen über eine Assembly werden über die folgenden // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // die einer Assembly zugeordnet sind. [assembly: AssemblyTitle("Cake.Compression")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Cake.Compression")] [assembly: AssemblyCopyright("Copyright (c) 2016 Artur Kordowski")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar // für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von // COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. [assembly: ComVisible(false)] // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird [assembly: Guid("dfce574d-731a-4c89-9b74-9ff2a93ed966")] // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: // // Hauptversion // Nebenversion // Buildnummer // Revision // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.1.7")] [assembly: AssemblyFileVersion("0.1.7")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Allgemeine Informationen über eine Assembly werden über die folgenden // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // die einer Assembly zugeordnet sind. [assembly: AssemblyTitle("Cake.Compression")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Cake.Compression")] [assembly: AssemblyCopyright("Copyright (c) 2016 Artur Kordowski")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar // für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von // COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. [assembly: ComVisible(false)] // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird [assembly: Guid("dfce574d-731a-4c89-9b74-9ff2a93ed966")] // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: // // Hauptversion // Nebenversion // Buildnummer // Revision // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.1.6")] [assembly: AssemblyFileVersion("0.1.6")]
mit
C#
92022f2cba0240a6fe25bc5607eeb2ff9e5e9225
add Separator component in OsuMarkdownSeparator
ppy/osu,UselessToucan/osu,peppy/osu,ppy/osu,UselessToucan/osu,smoogipoo/osu,peppy/osu,NeoAdonis/osu,smoogipoo/osu,smoogipooo/osu,NeoAdonis/osu,peppy/osu-new,ppy/osu,UselessToucan/osu,NeoAdonis/osu,peppy/osu,smoogipoo/osu
osu.Game/Graphics/Containers/Markdown/OsuMarkdownSeparator.cs
osu.Game/Graphics/Containers/Markdown/OsuMarkdownSeparator.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers.Markdown; using osu.Framework.Graphics.Shapes; using osu.Game.Overlays; namespace osu.Game.Graphics.Containers.Markdown { public class OsuMarkdownSeparator : MarkdownSeparator { protected override Drawable CreateSeparator() => new Separator(); private class Separator : Box { [BackgroundDependencyLoader] private void load(OverlayColourProvider colourProvider) { RelativeSizeAxes = Axes.X; Height = 1; Colour = colourProvider.Background3; } } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers.Markdown; using osu.Game.Overlays; namespace osu.Game.Graphics.Containers.Markdown { public class OsuMarkdownSeparator : MarkdownSeparator { private Drawable separator; [BackgroundDependencyLoader] private void load(OverlayColourProvider colourProvider) { separator.Colour = colourProvider.Background3; } protected override Drawable CreateSeparator() { return separator = base.CreateSeparator(); } } }
mit
C#
3741b39e099df472236fc6f6f4185a2dc83f67ed
Use extension syntax
khellang/nancy-bootstrapper-prototype
src/Nancy.AspNet/ServiceCollectionExtensions.cs
src/Nancy.AspNet/ServiceCollectionExtensions.cs
namespace Nancy.AspNet { using System; using Microsoft.Extensions.DependencyInjection; using Nancy.Bootstrappers.AspNet; using Nancy.Core; using Nancy.Core.Configuration; public static class ServiceCollectionExtensions { public static IServiceCollection AddNancy(this IServiceCollection services) { return services.AddNancy(configure: null); } public static IServiceCollection AddNancy(this IServiceCollection services, Action<IApplicationConfiguration> configure) { return services.AddNancy(DefaultPlatformServices.Instance, configure); } public static IServiceCollection AddNancy(this IServiceCollection services, IPlatformServices platformServices, Action<IApplicationConfiguration> configure) { Check.NotNull(services, nameof(services)); Check.NotNull(platformServices, nameof(platformServices)); // For ASP.NET it only makes sense to use the AspNetBootstrapper since it handles container // customization etc. Therefore we hide away the whole bootstrapper concept. // We still need to provide a way to configure the application. This // is done by passing a delegate to a special inline bootstrapper. var bootstrapper = new InlineAspNetBootstrapper(configure); bootstrapper.Populate(services, platformServices); // Make sure we add the bootstrapper so it can be resolved in a call to `UseNancy`. return services.AddInstance<IBootstrapper<IDisposableServiceProvider>>(bootstrapper); } private class InlineAspNetBootstrapper : AspNetBootstrapper { private readonly Action<IApplicationConfiguration<IServiceCollection>> configure; public InlineAspNetBootstrapper(Action<IApplicationConfiguration> configure) { this.configure = configure; } protected override void ConfigureApplication(IApplicationConfiguration<IServiceCollection> app) { this.configure?.Invoke(app); } } } }
namespace Nancy.AspNet { using System; using Microsoft.Extensions.DependencyInjection; using Nancy.Bootstrappers.AspNet; using Nancy.Core; using Nancy.Core.Configuration; public static class ServiceCollectionExtensions { public static IServiceCollection AddNancy(this IServiceCollection services) { return AddNancy(services, null); } public static IServiceCollection AddNancy(this IServiceCollection services, Action<IApplicationConfiguration> configure) { return services.AddNancy(DefaultPlatformServices.Instance, configure); } public static IServiceCollection AddNancy(this IServiceCollection services, IPlatformServices platformServices, Action<IApplicationConfiguration> configure) { Check.NotNull(services, nameof(services)); Check.NotNull(platformServices, nameof(platformServices)); // For ASP.NET it only makes sense to use the AspNetBootstrapper since it handles container // customization etc. Therefore we hide away the whole bootstrapper concept. // We still need to provide a way to configure the application. This // is done by passing a delegate to a special inline bootstrapper. var bootstrapper = new InlineAspNetBootstrapper(configure); bootstrapper.Populate(services, platformServices); // Make sure we add the bootstrapper so it can be resolved in a call to `UseNancy`. return services.AddInstance<IBootstrapper<IDisposableServiceProvider>>(bootstrapper); } private class InlineAspNetBootstrapper : AspNetBootstrapper { private readonly Action<IApplicationConfiguration<IServiceCollection>> configure; public InlineAspNetBootstrapper(Action<IApplicationConfiguration> configure) { this.configure = configure; } protected override void ConfigureApplication(IApplicationConfiguration<IServiceCollection> app) { this.configure?.Invoke(app); } } } }
apache-2.0
C#
a6cdd160deb8e0cf57a210905f7f017e934d3714
Fix the subscription drop script
NServiceBusSqlPersistence/NServiceBus.SqlPersistence
src/ScriptBuilder/Writers/SubscriptionWriter.cs
src/ScriptBuilder/Writers/SubscriptionWriter.cs
using System.IO; using NServiceBus.Persistence.Sql.ScriptBuilder; class SubscriptionWriter { public static void WriteSubscriptionScript(string scriptPath, BuildSqlDialect sqlDialect) { var createPath = Path.Combine(scriptPath, "Subscription_Create.sql"); File.Delete(createPath); using (var writer = File.CreateText(createPath)) { SubscriptionScriptBuilder.BuildCreateScript(writer, sqlDialect); } var dropPath = Path.Combine(scriptPath, "Subscription_Drop.sql"); File.Delete(dropPath); using (var writer = File.CreateText(dropPath)) { SubscriptionScriptBuilder.BuildDropScript(writer, sqlDialect); } } }
using System.IO; using NServiceBus.Persistence.Sql.ScriptBuilder; class SubscriptionWriter { public static void WriteSubscriptionScript(string scriptPath, BuildSqlDialect sqlDialect) { var createPath = Path.Combine(scriptPath, "Subscription_Create.sql"); File.Delete(createPath); using (var writer = File.CreateText(createPath)) { SubscriptionScriptBuilder.BuildCreateScript(writer, sqlDialect); } var dropPath = Path.Combine(scriptPath, "Subscription_Drop.sql"); File.Delete(dropPath); using (var writer = File.CreateText(dropPath)) { SubscriptionScriptBuilder.BuildCreateScript(writer, sqlDialect); } } }
mit
C#
1cad2bdc29d94af2190f83393d9466b4b1598cc4
Make addin version assembly to 0.1.
jzeferino/jzeferino.XSAddin,jzeferino/jzeferino.XSAddin
src/jzeferino.XSAddin/Properties/AddinInfo.cs
src/jzeferino.XSAddin/Properties/AddinInfo.cs
using Mono.Addins; using Mono.Addins.Description; [assembly: Addin( Id = "jzeferino.XSAddin", Namespace = "jzeferino.XSAddin", Version = "0.1" )] [assembly: AddinName("jzeferino.XSAddin")] [assembly: AddinCategory("IDE extensions")] [assembly: AddinDescription("This add-in let you create a Xamarin Cross Platform solution (Xamarin.Native) or (Xamarin.Forms)." + "When creating the project the addin will show you a custom wizard wich the user can select the application name, the application identifier and if he wants, .gitignore, readme and cake." + "It already creates some PCL projects to allow the shared code to be separated in different layers using MVVM pattern." + "It also allows you to create some file templates.")] [assembly: AddinAuthor("jzeferino")] [assembly: AddinUrl("https://github.com/jzeferino/jzeferino.XSAddin")]
using Mono.Addins; using Mono.Addins.Description; [assembly: Addin( Id = "jzeferino.XSAddin", Namespace = "jzeferino.XSAddin", Version = "0.0.1" )] [assembly: AddinName("jzeferino.XSAddin")] [assembly: AddinCategory("IDE extensions")] [assembly: AddinDescription("This add-in let you create a Xamarin Cross Platform solution (Xamarin.Native) or (Xamarin.Forms)." + "When creating the project the addin will show you a custom wizard wich the user can select the application name, the application identifier and if he wants, .gitignore, readme and cake." + "It already creates some PCL projects to allow the shared code to be separated in different layers using MVVM pattern." + "It also allows you to create some file templates.")] [assembly: AddinAuthor("jzeferino")] [assembly: AddinUrl("https://github.com/jzeferino/jzeferino.XSAddin")]
mit
C#
1f3fbf148f7b26b7a6a416e38e833d6f03f02aab
Fix MemberwiseClone calls being generated for .GetEnumerator() on dictionary keys/values collections.
sq/JSIL,volkd/JSIL,sq/JSIL,volkd/JSIL,hach-que/JSIL,sander-git/JSIL,volkd/JSIL,mispy/JSIL,acourtney2015/JSIL,mispy/JSIL,x335/JSIL,x335/JSIL,volkd/JSIL,iskiselev/JSIL,acourtney2015/JSIL,x335/JSIL,antiufo/JSIL,antiufo/JSIL,acourtney2015/JSIL,acourtney2015/JSIL,volkd/JSIL,Trattpingvin/JSIL,dmirmilshteyn/JSIL,FUSEEProjectTeam/JSIL,mispy/JSIL,FUSEEProjectTeam/JSIL,FUSEEProjectTeam/JSIL,x335/JSIL,iskiselev/JSIL,acourtney2015/JSIL,TukekeSoft/JSIL,hach-que/JSIL,mispy/JSIL,dmirmilshteyn/JSIL,iskiselev/JSIL,TukekeSoft/JSIL,sq/JSIL,sander-git/JSIL,TukekeSoft/JSIL,sq/JSIL,dmirmilshteyn/JSIL,hach-que/JSIL,sander-git/JSIL,Trattpingvin/JSIL,iskiselev/JSIL,hach-que/JSIL,FUSEEProjectTeam/JSIL,sq/JSIL,dmirmilshteyn/JSIL,Trattpingvin/JSIL,FUSEEProjectTeam/JSIL,iskiselev/JSIL,hach-que/JSIL,sander-git/JSIL,antiufo/JSIL,sander-git/JSIL,Trattpingvin/JSIL,TukekeSoft/JSIL,antiufo/JSIL
Proxies/Collections.cs
Proxies/Collections.cs
using System; using System.Collections; using System.Collections.Generic; using JSIL.Meta; using JSIL.Proxy; namespace JSIL.Proxies { [JSProxy( new[] { "System.Collections.ArrayList", "System.Collections.Hashtable", "System.Collections.Generic.List`1", "System.Collections.Generic.Dictionary`2", "System.Collections.Generic.Stack`1", "System.Collections.Generic.Queue`1", "System.Collections.Generic.HashSet`1", "System.Collections.Hashtable/KeyCollection", "System.Collections.Hashtable/ValueCollection", "System.Collections.Generic.Dictionary`2/KeyCollection", "System.Collections.Generic.Dictionary`2/ValueCollection" }, memberPolicy: JSProxyMemberPolicy.ReplaceNone, inheritable: false )] public abstract class CollectionProxy<T> : IEnumerable { [JSIsPure] [JSResultIsNew] System.Collections.IEnumerator IEnumerable.GetEnumerator () { throw new InvalidOperationException(); } [JSIsPure] [JSResultIsNew] public AnyType GetEnumerator () { throw new InvalidOperationException(); } } }
using System; using System.Collections; using System.Collections.Generic; using JSIL.Meta; using JSIL.Proxy; namespace JSIL.Proxies { [JSProxy( new[] { "System.Collections.ArrayList", "System.Collections.Hashtable", "System.Collections.Generic.List`1", "System.Collections.Generic.Dictionary`2", "System.Collections.Generic.Stack`1", "System.Collections.Generic.Queue`1", "System.Collections.Generic.HashSet`1", }, memberPolicy: JSProxyMemberPolicy.ReplaceNone, inheritable: false )] public abstract class CollectionProxy<T> : IEnumerable { [JSIsPure] [JSResultIsNew] System.Collections.IEnumerator IEnumerable.GetEnumerator () { throw new InvalidOperationException(); } [JSIsPure] [JSResultIsNew] public AnyType GetEnumerator () { throw new InvalidOperationException(); } } }
mit
C#
c33dc1045c2642347359b035987c352294c8d87e
Update comment
killerantz/HoloToolkit-Unity,DDReaper/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity
Assets/MRTK/Core/Interfaces/Devices/IMixedRealityHapticFeedback.cs
Assets/MRTK/Core/Interfaces/Devices/IMixedRealityHapticFeedback.cs
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace Microsoft.MixedReality.Toolkit.Input { /// <summary> /// Provides access to the haptic capabilities of a device. /// </summary> public interface IMixedRealityHapticFeedback { /// <summary> /// Start haptic feedback by the input device. /// </summary> /// <param name="intensity">The 0.0 to 1.0 strength of the haptic feedback based on the capability of the input device.</param> /// <param name="durationInSeconds">The duration in seconds or float.MaxValue for indefinite duration (if supported by the platform).</param> /// <returns>True if haptic feedback was successfully started.</returns> bool StartHapticImpulse(float intensity, float durationInSeconds = float.MaxValue); /// <summary> /// Terminates haptic feedback by the input device. /// </summary> void StopHapticFeedback(); } }
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace Microsoft.MixedReality.Toolkit.Input { /// <summary> /// Provides access to the haptic capabilities of a device. /// </summary> public interface IMixedRealityHapticFeedback { /// <summary> /// Start haptic feedback by the input device. /// </summary> /// <param name="intensity">The 0.0 to 1.0 strength of the haptic feedback based on the capability of the input device.</param> /// <param name="durationInSeconds">The duration in seconds or float.MaxValue for indefinite duration.</param> /// <returns>True if haptic feedback was successfully started.</returns> bool StartHapticImpulse(float intensity, float durationInSeconds = float.MaxValue); /// <summary> /// Terminates haptic feedback by the input device. /// </summary> void StopHapticFeedback(); } }
mit
C#
207d8421e9a5ec91cae2650f3e1c44b2a6b7bebe
fix error
fanwentao/CustomHeaderValueProvider
src/ValueProviders/CustomHeaderValueProvider.cs
src/ValueProviders/CustomHeaderValueProvider.cs
using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Net.Http; using System.Net.Http.Headers; using System.Text; using System.Web.Http.ValueProviders; using System.Web.Http.ValueProviders.Providers; namespace ValueProviders { public class CustomHeaderValueProvider : NameValuePairsValueProvider { private const string CustomHeaderPrefix = "X-"; public CustomHeaderValueProvider(HttpRequestMessage request, CultureInfo culture) : base(GetHeadersValues(request.Headers), culture) { } internal static Dictionary<string, object> GetHeadersValues(HttpRequestHeaders headers) { var dic = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase); foreach (var header in headers.Where(pair => pair.Key.StartsWith(CustomHeaderPrefix, StringComparison.OrdinalIgnoreCase))) { var key = header.Key.Substring(CustomHeaderPrefix.Length).Replace("-", string.Empty); dic[key] = header.Value; } return dic; } } }
using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Net.Http; using System.Net.Http.Headers; using System.Text; using System.Web.Http.ValueProviders; using System.Web.Http.ValueProviders.Providers; namespace ValueProviders { public class CustomHeaderValueProvider : NameValuePairsValueProvider { public CustomHeaderValueProvider(HttpRequestMessage request, CultureInfo culture) : base(GetHeadersValues(request.Headers), culture) { } internal static Dictionary<string, object> GetHeadersValues(HttpRequestHeaders headers) { return headers.ToDictionary(pair => pair.Key, pair => (object)pair.Value.ToList()); } public override ValueProviderResult GetValue(string key) { if (key == null) throw new ArgumentNullException(nameof(key)); key = "X-" + ParseParameterName(key); return base.GetValue(key); } internal static string ParseParameterName(string name) { var sb = new StringBuilder(); for (int i = 0; i < name.Length; i++) { if (char.IsUpper(name[i]) && i != 0) { sb.Append('-'); } sb.Append(name[i]); } return sb.ToString(); } } }
mit
C#
0f6f000188680ec7a375b3b244d7abe8557376ef
Remove difficulty spike nerf
ppy/osu,peppy/osu,peppy/osu,peppy/osu,ppy/osu,ppy/osu
osu.Game.Rulesets.Osu/Difficulty/Skills/Flashlight.cs
osu.Game.Rulesets.Osu/Difficulty/Skills/Flashlight.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; using System.Linq; using osu.Game.Rulesets.Difficulty.Preprocessing; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu.Difficulty.Evaluators; using osu.Game.Rulesets.Osu.Mods; namespace osu.Game.Rulesets.Osu.Difficulty.Skills { /// <summary> /// Represents the skill required to memorise and hit every object in a map with the Flashlight mod enabled. /// </summary> public class Flashlight : OsuStrainSkill { private readonly bool hasHiddenMod; public Flashlight(Mod[] mods) : base(mods) { hasHiddenMod = mods.Any(m => m is OsuModHidden); } private double skillMultiplier => 0.05; private double strainDecayBase => 0.15; protected override double DecayWeight => 1.0; protected override int ReducedSectionCount => -1; private double currentStrain; private double strainDecay(double ms) => Math.Pow(strainDecayBase, ms / 1000); protected override double CalculateInitialStrain(double time, DifficultyHitObject current) => currentStrain * strainDecay(time - current.Previous(0).StartTime); protected override double StrainValueAt(DifficultyHitObject current) { currentStrain *= strainDecay(current.DeltaTime); currentStrain += FlashlightEvaluator.EvaluateDifficultyOf(current, hasHiddenMod) * skillMultiplier; return currentStrain; } } }
// 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; using System.Linq; using osu.Game.Rulesets.Difficulty.Preprocessing; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu.Difficulty.Evaluators; using osu.Game.Rulesets.Osu.Mods; namespace osu.Game.Rulesets.Osu.Difficulty.Skills { /// <summary> /// Represents the skill required to memorise and hit every object in a map with the Flashlight mod enabled. /// </summary> public class Flashlight : OsuStrainSkill { private readonly bool hasHiddenMod; public Flashlight(Mod[] mods) : base(mods) { hasHiddenMod = mods.Any(m => m is OsuModHidden); } private double skillMultiplier => 0.05; private double strainDecayBase => 0.15; protected override double DecayWeight => 1.0; private double currentStrain; private double strainDecay(double ms) => Math.Pow(strainDecayBase, ms / 1000); protected override double CalculateInitialStrain(double time, DifficultyHitObject current) => currentStrain * strainDecay(time - current.Previous(0).StartTime); protected override double StrainValueAt(DifficultyHitObject current) { currentStrain *= strainDecay(current.DeltaTime); currentStrain += FlashlightEvaluator.EvaluateDifficultyOf(current, hasHiddenMod) * skillMultiplier; return currentStrain; } } }
mit
C#
6d6cb3b934a8bf7edbe3c60083c359c36d6db73e
index discriminator
caleblloyd/Pomelo.EntityFrameworkCore.MySql,PomeloFoundation/Pomelo.EntityFrameworkCore.MySql,caleblloyd/Pomelo.EntityFrameworkCore.MySql,PomeloFoundation/Pomelo.EntityFrameworkCore.MySql
test/Pomelo.EntityFrameworkCore.MySql.PerfTests/Models/People.cs
test/Pomelo.EntityFrameworkCore.MySql.PerfTests/Models/People.cs
using System.Collections.Generic; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata; namespace Pomelo.EntityFrameworkCore.MySql.PerfTests.Models { public static class PeopleMeta { public static void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity<PersonKid>(entity => { // index the Discriminator to prevent full table scan entity.Property("Discriminator") .HasMaxLength(63); entity.HasIndex("Discriminator"); entity.HasOne(m => m.Teacher) .WithMany(m => m.Students) .HasForeignKey(m => m.TeacherId) .HasPrincipalKey(m => m.Id) .OnDelete(DeleteBehavior.Restrict); }); } } public abstract class Person { public int Id { get; set; } public string Name { get; set; } public int? TeacherId { get; set; } public PersonFamily Family { get; set; } } public class PersonKid : Person { public int Grade { get; set; } public PersonTeacher Teacher { get; set; } } public class PersonTeacher : Person { public ICollection<PersonKid> Students { get; set; } } public class PersonParent : Person { public string Occupation { get; set; } public bool OnPta { get; set; } } public class PersonFamily { public int Id { get; set; } public string LastName { get; set; } public ICollection<Person> Members { get; set; } } }
using System.Collections.Generic; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata; namespace Pomelo.EntityFrameworkCore.MySql.PerfTests.Models { public static class PeopleMeta { public static void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity<PersonKid>(entity => { entity.HasOne(m => m.Teacher) .WithMany(m => m.Students) .HasForeignKey(m => m.TeacherId) .HasPrincipalKey(m => m.Id) .OnDelete(DeleteBehavior.Restrict); }); } } public abstract class Person { public int Id { get; set; } public string Name { get; set; } public int? TeacherId { get; set; } public PersonFamily Family { get; set; } } public class PersonKid : Person { public int Grade { get; set; } public PersonTeacher Teacher { get; set; } } public class PersonTeacher : Person { public ICollection<PersonKid> Students { get; set; } } public class PersonParent : Person { public string Occupation { get; set; } public bool OnPta { get; set; } } public class PersonFamily { public int Id { get; set; } public string LastName { get; set; } public ICollection<Person> Members { get; set; } } }
mit
C#
04fca8129b384ecc1fe1b910378fde74b9347fd9
Clean up
os2kitos/kitos,miracle-as/kitos,os2kitos/kitos,os2kitos/kitos,miracle-as/kitos,miracle-as/kitos,os2kitos/kitos,miracle-as/kitos
Core.ApplicationServices/CryptoService.cs
Core.ApplicationServices/CryptoService.cs
using System.Security.Cryptography; using System.Text; using System.Web; using Core.DomainServices; namespace Core.ApplicationServices { public class CryptoService : ICryptoService { private readonly SHA256Managed _crypt; public CryptoService() { _crypt = new SHA256Managed(); } public string Encrypt(string str) { byte[] bytes = Encoding.UTF8.GetBytes(str); byte[] encrypted = _crypt.ComputeHash(bytes); return HttpServerUtility.UrlTokenEncode(encrypted); } } }
using System; using System.Security.Cryptography; using System.Text; using System.Web; using Core.DomainServices; namespace Core.ApplicationServices { public class CryptoService : ICryptoService { private readonly SHA256Managed _crypt; public CryptoService() { _crypt = new SHA256Managed(); } public string Encrypt(string str) { byte[] bytes = Encoding.UTF8.GetBytes(str); byte[] encrypted = _crypt.ComputeHash(bytes); return HttpServerUtility.UrlTokenEncode(encrypted); //return Convert.ToBase64String(encrypted); } } }
mpl-2.0
C#
1fae099a4edc60d44636051c66f6a7606515f379
Change artist in tags test
bettiolo/SevenDigital.Api.Wrapper,luiseduardohdbackup/SevenDigital.Api.Wrapper,AnthonySteele/SevenDigital.Api.Wrapper,raoulmillais/SevenDigital.Api.Wrapper,emashliles/SevenDigital.Api.Wrapper,danbadge/SevenDigital.Api.Wrapper,bnathyuw/SevenDigital.Api.Wrapper,mattgray/SevenDigital.Api.Wrapper,danhaller/SevenDigital.Api.Wrapper,minkaotic/SevenDigital.Api.Wrapper,gregsochanik/SevenDigital.Api.Wrapper
src/SevenDigital.Api.Wrapper.Integration.Tests/EndpointTests/TagsEndpoint/ArtistTagsTests.cs
src/SevenDigital.Api.Wrapper.Integration.Tests/EndpointTests/TagsEndpoint/ArtistTagsTests.cs
using System.Linq; using NUnit.Framework; using SevenDigital.Api.Schema.Tags; namespace SevenDigital.Api.Wrapper.Integration.Tests.EndpointTests.TagsEndpoint { [TestFixture] public class ArtistTagsTests { [Test] public void Can_hit_endpoint() { ArtistTags tags = Api<ArtistTags>.Create .WithParameter("artistId", "1") .Please(); Assert.That(tags, Is.Not.Null); Assert.That(tags.TagList.Count, Is.GreaterThan(0)); Assert.That(tags.TagList.FirstOrDefault().Id, Is.Not.Empty); Assert.That(tags.TagList.Where(x => x.Id == "rock").FirstOrDefault().Text, Is.EqualTo("rock")); } [Test] public void Can_hit_endpoint_with_paging() { ArtistTags artistBrowse = Api<ArtistTags>.Create .WithParameter("artistId", "2") .WithParameter("page", "2") .WithParameter("pageSize", "1") .Please(); Assert.That(artistBrowse, Is.Not.Null); Assert.That(artistBrowse.Page, Is.EqualTo(2)); Assert.That(artistBrowse.PageSize, Is.EqualTo(1)); } } }
using System.Linq; using NUnit.Framework; using SevenDigital.Api.Schema.Tags; namespace SevenDigital.Api.Wrapper.Integration.Tests.EndpointTests.TagsEndpoint { [TestFixture] public class ArtistTagsTests { [Test] public void Can_hit_endpoint() { ArtistTags tags = Api<ArtistTags>.Create .WithParameter("artistId", "1") .Please(); Assert.That(tags, Is.Not.Null); Assert.That(tags.TagList.Count, Is.GreaterThan(0)); Assert.That(tags.TagList.FirstOrDefault().Id, Is.Not.Empty); Assert.That(tags.TagList.Where(x => x.Id == "rock").FirstOrDefault().Text, Is.EqualTo("rock")); } [Test] public void Can_hit_endpoint_with_paging() { ArtistTags artistBrowse = Api<ArtistTags>.Create .WithParameter("artistId", "1") .WithParameter("page", "2") .WithParameter("pageSize", "1") .Please(); Assert.That(artistBrowse, Is.Not.Null); Assert.That(artistBrowse.Page, Is.EqualTo(2)); Assert.That(artistBrowse.PageSize, Is.EqualTo(1)); } } }
mit
C#
d8423af4fbb5ef30ffa75f9358b578495003c5ba
Make beauty to extensions API
sunloving/photosphere-mapping
src/Photosphere.Mapping/Extensions/MappingObjectExtensions.cs
src/Photosphere.Mapping/Extensions/MappingObjectExtensions.cs
using Photosphere.Mapping.Static; namespace Photosphere.Mapping.Extensions { public static class MappingObjectExtensions { /// <summary> Map from source to existent object target</summary> public static void MapTo<TSource, TTarget>(this TSource source, TTarget target) where TTarget : class, new() { StaticMapper<TSource, TTarget>.Map(source, target); } /// <summary> Map from object source to existent object target</summary> public static void MapToObject(this object source, object target) { StaticMapper.Map(source, target); } /// <summary> Map from source to new object of TTarget</summary> public static TTarget Map<TSource, TTarget>(this TSource source) where TTarget : class, new() { return StaticMapper<TSource, TTarget>.Map(source); } /// <summary> Map from object source to new object of TTarget</summary> public static TTarget MapObject<TTarget>(this object source) where TTarget : new() { return StaticMapper.Map<TTarget>(source); } } }
using Photosphere.Mapping.Static; namespace Photosphere.Mapping.Extensions { public static class MappingObjectExtensions { /// <summary> Map from source to existent object target</summary> public static void MapTo<TSource, TTarget>(this TSource source, TTarget target) where TTarget : class, new() { StaticMapper<TSource, TTarget>.Map(source, target); } /// <summary> Map from source to new object of TTarget</summary> public static TTarget Map<TSource, TTarget>(this TSource source) where TTarget : class, new() { return StaticMapper<TSource, TTarget>.Map(source); } /// <summary> Map from object source to existent object target</summary> public static void MapToObject(this object source, object target) { StaticMapper.Map(source, target); } /// <summary> Map from object source to new object of TTarget</summary> public static TTarget MapObject<TTarget>(this object source) where TTarget : new() { return StaticMapper.Map<TTarget>(source); } } }
mit
C#
5835ce59d7f974da5d62fc57356f082cabec2a20
Update SplashScreenActivity.cs
MugenMvvmToolkitDocs/HelloLinker
HelloLinker/Views/SplashScreenActivity.cs
HelloLinker/Views/SplashScreenActivity.cs
using Android.App; using MugenMvvmToolkit.Android.Infrastructure; using MugenMvvmToolkit.Android.Views.Activities; namespace HelloLinker.Views { [Activity(Label = "HelloLinker", Theme = "@android:style/Theme.NoTitleBar", MainLauncher = true, Icon = "@drawable/icon", NoHistory = true)] public class SplashScreenActivity : SplashScreenActivityBase { #region Overrides of SplashScreenActivityBase protected override AndroidBootstrapperBase CreateBootstrapper() { return new Setup(); } #endregion } }
using Android.App; using MugenMvvmToolkit.Android.Infrastructure; using MugenMvvmToolkit.Android.Views.Activities; namespace HelloLinker.Views { [Activity(Label = "HelloValidation", Theme = "@android:style/Theme.NoTitleBar", MainLauncher = true, Icon = "@drawable/icon", NoHistory = true)] public class SplashScreenActivity : SplashScreenActivityBase { #region Overrides of SplashScreenActivityBase protected override AndroidBootstrapperBase CreateBootstrapper() { return new Setup(); } #endregion } }
mit
C#
b794cd41011a536f5a649eb9f30abff5a96ec691
improve test case, add a message
splitice/IPTables.Net,splitice/IPTables.Net,splitice/IPTables.Net,splitice/IPTables.Net
IPTables.Net.Tests/CheckInternalTables.cs
IPTables.Net.Tests/CheckInternalTables.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using IPTables.Net.Iptables; using NUnit.Framework; namespace IPTables.Net.Tests { [TestFixture] class CheckInternalTables { [Test] public void TestChains() { TestChain("filter", "INPUT"); TestChain("filter", "FORWARD"); TestChain("filter", "OUTPUT"); TestChain("mangle", "INPUT"); TestChain("mangle", "FORWARD"); TestChain("mangle", "OUTPUT"); TestChain("mangle", "PREROUTING"); TestChain("mangle", "POSTROUTING"); TestChain("nat", "PREROUTING"); TestChain("nat", "POSTROUTING"); TestChain("nat", "OUTPUT"); TestChain("raw", "PREROUTING"); TestChain("raw", "OUTPUT"); } private void TestChain(string table, string chain) { Assert.IsTrue(IPTablesTables.IsInternalChain(table, chain), String.Format("{0}:{1} should be internal", table, chain)); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using IPTables.Net.Iptables; using NUnit.Framework; namespace IPTables.Net.Tests { [TestFixture] class CheckInternalTables { [Test] public void TestChains() { TestChain("filter", "INPUT"); TestChain("filter", "FORWARD"); TestChain("filter", "OUTPUT"); TestChain("mangle", "INPUT"); TestChain("mangle", "FORWARD"); TestChain("mangle", "OUTPUT"); TestChain("mangle", "PREROUTING"); TestChain("mangle", "POSTROUTING"); TestChain("nat", "PREROUTING"); TestChain("nat", "POSTROUTING"); TestChain("nat", "OUTPUT"); TestChain("raw", "PREROUTING"); TestChain("raw", "OUTPUT"); } private void TestChain(string table, string chain) { Assert.IsTrue(IPTablesTables.IsInternalChain(table, chain)); } } }
apache-2.0
C#
2a47af6af08810a57e3553e2ce118fb4084b5e8f
Update the validation messages for uln and cost
SkillsFundingAgency/das-providerapprenticeshipsservice,SkillsFundingAgency/das-providerapprenticeshipsservice,SkillsFundingAgency/das-providerapprenticeshipsservice
src/SFA.DAS.ProviderApprenticeshipsService.Web/Validation/ApprenticeshipViewModelValidator.cs
src/SFA.DAS.ProviderApprenticeshipsService.Web/Validation/ApprenticeshipViewModelValidator.cs
using FluentValidation; using SFA.DAS.ProviderApprenticeshipsService.Web.Models; namespace SFA.DAS.ProviderApprenticeshipsService.Web.Validation { public sealed class ApprenticeshipViewModelValidator : AbstractValidator<ApprenticeshipViewModel> { public ApprenticeshipViewModelValidator() { RuleFor(x => x.ULN).Matches("^$|^[1-9]{1}[0-9]{9}$").WithMessage("Please enter the unique learner number - this should be 10 digits long."); RuleFor(x => x.Cost).Matches("^$|^[1-9]{1}[0-9]*$").WithMessage("Please enter the cost in whole pounds. For example, for £1500 you should enter 1500."); } } }
using FluentValidation; using SFA.DAS.ProviderApprenticeshipsService.Web.Models; namespace SFA.DAS.ProviderApprenticeshipsService.Web.Validation { public sealed class ApprenticeshipViewModelValidator : AbstractValidator<ApprenticeshipViewModel> { public ApprenticeshipViewModelValidator() { RuleFor(x => x.ULN).Matches("^$|^[1-9]{1}[0-9]{9}$").WithMessage("'ULN' is not in the correct format."); RuleFor(x => x.Cost).Matches("^$|^[1-9]{1}[0-9]*$").WithMessage("Cost is not in the correct format"); } } }
mit
C#
ad2206175492154f8e79b5ca98a211875ad01ee0
Build and publish nuget package
bfriesen/Rock.Messaging,RockFramework/Rock.Messaging
Rock.Messaging/Properties/AssemblyInfo.cs
Rock.Messaging/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.Messaging")] [assembly: AssemblyDescription("Rock Messaging.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Quicken Loans")] [assembly: AssemblyProduct("Rock.Messaging")] [assembly: AssemblyCopyright("Copyright © Quicken Loans 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("58c2f915-e27e-436d-bd97-b6cb117ffd6b")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.9.0.0")] [assembly: AssemblyFileVersion("0.9.5")] [assembly: AssemblyInformationalVersion("0.9.5")]
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.Messaging")] [assembly: AssemblyDescription("Rock Messaging.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Quicken Loans")] [assembly: AssemblyProduct("Rock.Messaging")] [assembly: AssemblyCopyright("Copyright © Quicken Loans 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("58c2f915-e27e-436d-bd97-b6cb117ffd6b")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.9.0.0")] [assembly: AssemblyFileVersion("0.9.4")] [assembly: AssemblyInformationalVersion("0.9.4")]
mit
C#
69b0daff5248d9aed8c557238b85c9061508c9b7
Update new-blog.cshtml
daveaglick/daveaglick,mishrsud/sudhanshutheone.com,mishrsud/sudhanshutheone.com,daveaglick/daveaglick,mishrsud/sudhanshutheone.com
Somedave/Views/Blog/Posts/new-blog.cshtml
Somedave/Views/Blog/Posts/new-blog.cshtml
@{ Title = "New Blog"; Lead = "Look, Ma, no database!"; //Published = new DateTime(2014, 9, 4); Tags = new[] { "blog", "meta" }; } <p>It's been a little while coming, but I'm finally launching my new blog. It's built from scratch in ASP.NET MVC. Why go to all the trouble to build a blog engine from scratch when there are a gazillion great engines already out there? That's a very good question, let's break it down.</p> <h1>Own Your Content</h1> <p>I'll thank Scott Hanselman for really driving this point home.</p> <p>So that's <em>why</em> I created this new blog, but what about <em>how</em>? This blog engine uses no database, makes it easy to mix content pages with blog articles, is hosted on GitHub, and uses continuous deployment to automatically publish to an Azure Website.</p>
@{ Title = "New Blog"; Lead = "Look, Ma, no database!" //Published = new DateTime(2014, 9, 4); Tags = new[] { "blog", "meta" }; } <p>It's been a little while coming, but I'm finally launching my new blog. It's built from scratch in ASP.NET MVC. Why go to all the trouble to build a blog engine from scratch when there are a gazillion great engines already out there? That's a very good question, let's break it down.</p> <h1>Own Your Content</h1> <p>I'll thank Scott Hanselman for really driving this point home.</p> <p>So that's <em>why</em> I created this new blog, but what about <em>how</em>? This blog engine uses no database, makes it easy to mix content pages with blog articles, is hosted on GitHub, and uses continuous deployment to automatically publish to an Azure Website.</p>
mit
C#
3bd052db68eeb121e608d2c04e5dc1daf2db0715
Add InsightsApiKey to conf file.
masterrr/mobile,ZhangLeiCharles/mobile,ZhangLeiCharles/mobile,peeedge/mobile,eatskolnikov/mobile,peeedge/mobile,eatskolnikov/mobile,eatskolnikov/mobile,masterrr/mobile
Phoebe/Build.cs
Phoebe/Build.cs
using System; namespace Toggl.Phoebe { public static class Build { #warning Please fill in build settings and make git assume this file is unchanged. #region Phoebe build config public static readonly Uri ApiUrl = new Uri ("https://toggl.com/api/"); public static readonly Uri ReportsApiUrl = new Uri ("https://toggl.com/reports/api/"); public static readonly Uri PrivacyPolicyUrl = new Uri ("https://toggl.com/privacy"); public static readonly Uri TermsOfServiceUrl = new Uri ("https://toggl.com/terms"); public static readonly string GoogleAnalyticsId = ""; public static readonly int GoogleAnalyticsPlanIndex = 1; public static readonly int GoogleAnalyticsExperimentIndex = 2; #endregion #region Joey build configuration #if __ANDROID__ public static readonly string AppIdentifier = "TogglJoey"; public static readonly string GcmSenderId = ""; public static readonly string BugsnagApiKey = ""; public static readonly string XamInsightsApiKey = ""; public static readonly string GooglePlayUrl = "https://play.google.com/store/apps/details?id=com.toggl.timer"; #endif #endregion #region Ross build configuration #if __IOS__ public static readonly string AppStoreUrl = "itms-apps://itunes.com/apps/toggl/toggltimer"; public static readonly string AppIdentifier = "TogglRoss"; public static readonly string BugsnagApiKey = ""; public static readonly string GoogleOAuthClientId = ""; #endif #endregion } }
using System; namespace Toggl.Phoebe { public static class Build { #warning Please fill in build settings and make git assume this file is unchanged. #region Phoebe build config public static readonly Uri ApiUrl = new Uri ("https://toggl.com/api/"); public static readonly Uri ReportsApiUrl = new Uri ("https://toggl.com/reports/api/"); public static readonly Uri PrivacyPolicyUrl = new Uri ("https://toggl.com/privacy"); public static readonly Uri TermsOfServiceUrl = new Uri ("https://toggl.com/terms"); public static readonly string GoogleAnalyticsId = ""; public static readonly int GoogleAnalyticsPlanIndex = 1; public static readonly int GoogleAnalyticsExperimentIndex = 2; #endregion #region Joey build configuration #if __ANDROID__ public static readonly string AppIdentifier = "TogglJoey"; public static readonly string GcmSenderId = ""; public static readonly string BugsnagApiKey = ""; public static readonly string GooglePlayUrl = "https://play.google.com/store/apps/details?id=com.toggl.timer"; #endif #endregion #region Ross build configuration #if __IOS__ public static readonly string AppStoreUrl = "itms-apps://itunes.com/apps/toggl/toggltimer"; public static readonly string AppIdentifier = "TogglRoss"; public static readonly string BugsnagApiKey = ""; public static readonly string GoogleOAuthClientId = ""; #endif #endregion } }
bsd-3-clause
C#
7e64b3a449126b288233d0873ea2780bfac3f3fe
Add code documentation to the EnumPalmValue
haefele/PalmDB
src/PalmDB/Serialization/EnumPalmValue.cs
src/PalmDB/Serialization/EnumPalmValue.cs
using System; using System.Threading.Tasks; namespace PalmDB.Serialization { /// <summary> /// Represents a <see cref="int"/> based <see cref="Enum"/> value inside a palm database. /// </summary> /// <typeparam name="T"></typeparam> internal class EnumPalmValue<T> : IPalmValue<T> where T : struct { /// <summary> /// Gets the length of this enum block. /// </summary> public int Length { get; } /// <summary> /// Initializes a new instance of the <see cref="EnumPalmValue{T}"/> class. /// </summary> /// <param name="length">The length of the enum block.</param> public EnumPalmValue(int length) { Guard.NotNegative(length, nameof(length)); this.Length = length; } /// <summary> /// Reads the <typeparamref name="T"/> using the specified <paramref name="reader"/>. /// </summary> /// <param name="reader">The reader.</param> public async Task<T> ReadValueAsync(AsyncBinaryReader reader) { Guard.NotNull(reader, nameof(reader)); var internalValue = new UintPalmValue(this.Length); var data = await internalValue.ReadValueAsync(reader); return (T)(object)(int)data; } /// <summary> /// Writes the specified <paramref name="value"/> using the specified <paramref name="writer"/>. /// </summary> /// <param name="writer">The writer.</param> /// <param name="value">The value.</param> public async Task WriteValueAsync(AsyncBinaryWriter writer, T value) { Guard.NotNull(writer, nameof(writer)); Guard.NotNull(value, nameof(value)); var internalValue = new UintPalmValue(this.Length); var data = (uint)(int)(object)value; await internalValue.WriteValueAsync(writer, data); } } }
using System.Threading.Tasks; namespace PalmDB.Serialization { internal class EnumPalmValue<T> : IPalmValue<T> where T : struct { public int Length { get; } public EnumPalmValue(int length) { Guard.NotNegative(length, nameof(length)); this.Length = length; } public async Task<T> ReadValueAsync(AsyncBinaryReader reader) { Guard.NotNull(reader, nameof(reader)); var internalValue = new UintPalmValue(this.Length); var data = await internalValue.ReadValueAsync(reader); return (T)(object)(int)data; } public async Task WriteValueAsync(AsyncBinaryWriter writer, T value) { Guard.NotNull(writer, nameof(writer)); Guard.NotNull(value, nameof(value)); var internalValue = new UintPalmValue(this.Length); var data = (uint)(int)(object)value; await internalValue.WriteValueAsync(writer, data); } } }
mit
C#
333f64ad717d612120ba8df16f2d7a2b7d49171d
bump version
rabbit-link/rabbit-link,rabbit-link/rabbit-link
src/RabbitLink/Properties/AssemblyInfo.cs
src/RabbitLink/Properties/AssemblyInfo.cs
#region Usings using System.Reflection; using System.Runtime.InteropServices; #endregion // 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("RabbitLink")] [assembly: AssemblyDescription("Advanced .Net API for RabbitMQ")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("RabbitLink")] [assembly: AssemblyCopyright("Copyright © Artur Kraev 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("b2148830-a507-44a5-bc99-efda7f36e21d")] // 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.3.4.0")] [assembly: AssemblyFileVersion("0.3.4.0")]
#region Usings using System.Reflection; using System.Runtime.InteropServices; #endregion // 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("RabbitLink")] [assembly: AssemblyDescription("Advanced .Net API for RabbitMQ")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("RabbitLink")] [assembly: AssemblyCopyright("Copyright © Artur Kraev 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("b2148830-a507-44a5-bc99-efda7f36e21d")] // 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.3.3.0")] [assembly: AssemblyFileVersion("0.3.3.0")]
mit
C#
b44f67e5457fb4847825096d7cf82a7a2e7cd8cc
Update Version : 1.7.171.0 URL Changes + Fix User Manager Delete
Appleseed/portal,Appleseed/portal,Appleseed/portal,Appleseed/portal,Appleseed/portal,Appleseed/portal,Appleseed/portal
Master/Appleseed/WebSites/Appleseed/Properties/AssemblyInfo.cs
Master/Appleseed/WebSites/Appleseed/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Appleseed Portal")] [assembly: AssemblyDescription("Appleseed Portal and Content Management System")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ANANT Corporation")] [assembly: AssemblyProduct("Appleseed Portal")] [assembly: AssemblyCopyright("Copyright © ANANT Corporation 2010-2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("2040171a-ea5e-4c30-be7b-1d59f138009e")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.7.171.0")] [assembly: AssemblyFileVersion("1.7.171.0")] [assembly: NeutralResourcesLanguageAttribute("en-US")]
using System.Reflection; using System.Runtime.InteropServices; using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Appleseed Portal")] [assembly: AssemblyDescription("Appleseed Portal and Content Management System")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ANANT Corporation")] [assembly: AssemblyProduct("Appleseed Portal")] [assembly: AssemblyCopyright("Copyright © ANANT Corporation 2010-2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("2040171a-ea5e-4c30-be7b-1d59f138009e")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.6.160.540")] [assembly: AssemblyFileVersion("1.6.160.540")] [assembly: NeutralResourcesLanguageAttribute("en-US")]
apache-2.0
C#
1a5951a7fa3a193b1aebd894a4e10156124ea980
add event code
NCTU-Isolated-Island/Isolated-Island-Game
IsolatedIslandGame/IsolatedIslandGame.Protocol.Communication/EventCodes/PlayerEventCode.cs
IsolatedIslandGame/IsolatedIslandGame.Protocol.Communication/EventCodes/PlayerEventCode.cs
namespace IsolatedIslandGame.Protocol.Communication.EventCodes { public enum PlayerEventCode : byte { SyncData, GetBlueprint } }
namespace IsolatedIslandGame.Protocol.Communication.EventCodes { public enum PlayerEventCode : byte { SyncData } }
apache-2.0
C#
11bb6c2680f47ab15163b830cf24985d15cc631f
Fix the wrapper for tests to pass Models.Th155AllScoreDataTests
y-iihoshi/ThScoreFileConverter,y-iihoshi/ThScoreFileConverter
ThScoreFileConverterTests/Models/Wrappers/Th155StoryWrapper.cs
ThScoreFileConverterTests/Models/Wrappers/Th155StoryWrapper.cs
using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Diagnostics.CodeAnalysis; using ThScoreFileConverter.Models; namespace ThScoreFileConverterTests.Models.Wrappers { // NOTE: Setting the accessibility as public causes CS0053. internal sealed class Th155StoryWrapper { private static Type ConverterType = typeof(Th155Converter); private static string AssemblyNameToTest = ConverterType.Assembly.GetName().Name; private static string TypeNameToTest = ConverterType.FullName + "+AllScoreData+Story"; private readonly PrivateObject pobj = null; public Th155StoryWrapper() => this.pobj = new PrivateObject(AssemblyNameToTest, TypeNameToTest); public Th155StoryWrapper(object obj) => this.pobj = new PrivateObject(obj); [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] public object Target => this.pobj.Target; public int? Stage { get { return this.pobj.GetField(nameof(this.Stage)) as int?; } set { this.pobj.SetField(nameof(this.Stage), value.Value); } } public Th155Converter.LevelFlag? Ed { get { return this.pobj.GetField(nameof(this.Ed)) as Th155Converter.LevelFlag?; } set { this.pobj.SetField(nameof(this.Ed), value.Value); } } public bool? Available { get { return this.pobj.GetField(nameof(this.Available)) as bool?; } set { this.pobj.SetField(nameof(this.Available), value.Value); } } public int? OverDrive { get { return this.pobj.GetField(nameof(this.OverDrive)) as int?; } set { this.pobj.SetField(nameof(this.OverDrive), value.Value); } } public int? StageOverDrive { get { return this.pobj.GetField(nameof(this.StageOverDrive)) as int?; } set { this.pobj.SetField(nameof(this.StageOverDrive), value.Value); } } } }
using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Diagnostics.CodeAnalysis; using ThScoreFileConverter.Models; namespace ThScoreFileConverterTests.Models.Wrappers { // NOTE: Setting the accessibility as public causes CS0053. internal sealed class Th155StoryWrapper { private static Type ConverterType = typeof(Th155Converter); private static string AssemblyNameToTest = ConverterType.Assembly.GetName().Name; private static string TypeNameToTest = ConverterType.FullName + "+AllScoreData+Story"; private readonly PrivateObject pobj = null; public Th155StoryWrapper() => this.pobj = new PrivateObject(AssemblyNameToTest, TypeNameToTest); public Th155StoryWrapper(object obj) => this.pobj = new PrivateObject(obj); [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] public object Target => this.pobj.Target; public int? Stage { get { return this.pobj.GetField("stage") as int?; } set { this.pobj.SetField("stage", value.Value); } } public Th155Converter.LevelFlag? Ed { get { return this.pobj.GetField("ed") as Th155Converter.LevelFlag?; } set { this.pobj.SetField("ed", value.Value); } } public bool? Available { get { return this.pobj.GetField("available") as bool?; } set { this.pobj.SetField("available", value.Value); } } public int? OverDrive { get { return this.pobj.GetField("overDrive") as int?; } set { this.pobj.SetField("overDrive", value.Value); } } public int? StageOverDrive { get { return this.pobj.GetField("stageOverDrive") as int?; } set { this.pobj.SetField("stageOverDrive", value.Value); } } } }
bsd-2-clause
C#
afbe0e28ab6c0b00ba7365675c36898a984851c4
Fix typo
picklesdoc/pickles,dirkrombauts/pickles,magicmonty/pickles,picklesdoc/pickles,magicmonty/pickles,magicmonty/pickles,picklesdoc/pickles,picklesdoc/pickles,ludwigjossieaux/pickles,magicmonty/pickles,dirkrombauts/pickles,ludwigjossieaux/pickles,dirkrombauts/pickles,dirkrombauts/pickles,ludwigjossieaux/pickles
src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs
src/Pickles/Pickles.TestFrameworks.UnitTests/CucumberJson/WhenParsingCucumberJsonResultsFile.cs
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="WhenParsingCucumberJsonResultsFile.cs" company="PicklesDoc"> // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors // // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // </copyright> // -------------------------------------------------------------------------------------------------------------------- using System; using NFluent; using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.TestFrameworks.CucumberJson; using Feature = PicklesDoc.Pickles.ObjectModel.Feature; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.CucumberJson { [TestFixture] public class WhenParsingCucumberJsonResultsFile : WhenParsingTestResultFiles<CucumberJsonResults> { public WhenParsingCucumberJsonResultsFile() : base("CucumberJson." + "results-example-json.json") { } [Test] public void ThenCanReadFeatureResultSuccessfully() { var results = ParseResultsFile(); var feature = new Feature { Name = "Test Feature" }; TestResult result = results.GetFeatureResult(feature); Check.That(result).IsEqualTo(TestResult.Failed); } [Test] public void ThenCanReadScenarioResultSuccessfully() { var results = ParseResultsFile(); var feature = new Feature { Name = "Test Feature" }; var scenario1 = new Scenario { Name = "Passing", Feature = feature }; TestResult result1 = results.GetScenarioResult(scenario1); Check.That(result1).IsEqualTo(TestResult.Passed); var scenario2 = new Scenario { Name = "Failing", Feature = feature }; TestResult result2 = results.GetScenarioResult(scenario2); Check.That(result2).IsEqualTo(TestResult.Failed); } [Test] public void ThenCanReadFeatureWithoutScenariosSuccessfully_ShouldReturnInconclusive() { var results = ParseResultsFile(); var feature = new Feature { Name = "Feature Without Scenarios" }; TestResult result = results.GetFeatureResult(feature); Check.That(result).IsEqualTo(TestResult.Inconclusive); } } }
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="WhenParsingCucumberJsonResultsFile.cs" company="PicklesDoc"> // Copyright 2011 Jeffrey Cameron // Copyright 2012-present PicklesDoc team and community contributors // // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // </copyright> // -------------------------------------------------------------------------------------------------------------------- using System; using NFluent; using NUnit.Framework; using PicklesDoc.Pickles.ObjectModel; using PicklesDoc.Pickles.TestFrameworks.CucumberJson; using Feature = PicklesDoc.Pickles.ObjectModel.Feature; namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.CucumberJson { [TestFixture] public class WhenParsingCucumberJsonResultsFile : WhenParsingTestResultFiles<CucumberJsonResults> { public WhenParsingCucumberJsonResultsFile() : base("CucumberJson." + "results-example-json.json") { } [Test] public void ThenCanReadFeatureResultSuccesfully() { var results = ParseResultsFile(); var feature = new Feature { Name = "Test Feature" }; TestResult result = results.GetFeatureResult(feature); Check.That(result).IsEqualTo(TestResult.Failed); } [Test] public void ThenCanReadScenarioResultSuccessfully() { var results = ParseResultsFile(); var feature = new Feature { Name = "Test Feature" }; var scenario1 = new Scenario { Name = "Passing", Feature = feature }; TestResult result1 = results.GetScenarioResult(scenario1); Check.That(result1).IsEqualTo(TestResult.Passed); var scenario2 = new Scenario { Name = "Failing", Feature = feature }; TestResult result2 = results.GetScenarioResult(scenario2); Check.That(result2).IsEqualTo(TestResult.Failed); } [Test] public void ThenCanReadFeatureWithoutScenariosSuccessfully_ShouldReturnInconclusive() { var results = ParseResultsFile(); var feature = new Feature { Name = "Feature Without Scenarios" }; TestResult result = results.GetFeatureResult(feature); Check.That(result).IsEqualTo(TestResult.Inconclusive); } } }
apache-2.0
C#
8e938e3d131663ac9b3c45b3109ef128f649caec
Bump version to 0.1.5.
FacilityApi/Facility,ejball/Facility
SolutionInfo.cs
SolutionInfo.cs
using System.Reflection; [assembly: AssemblyVersion("0.1.5.0")] [assembly: AssemblyCompany("")] [assembly: AssemblyCopyright("Copyright 2016 Ed Ball")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")]
using System.Reflection; [assembly: AssemblyVersion("0.1.4.0")] [assembly: AssemblyCompany("")] [assembly: AssemblyCopyright("Copyright 2016 Ed Ball")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")]
mit
C#
7735a42a85e021fce5f56d03437cef2c54ad82bc
Remove unused wrapper
james-andrewsmith/consul-net,yonglehou/consul-net
src/Consul.Net/Services/Client.cs
src/Consul.Net/Services/Client.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Net; using System.Net.Http; using System.Net.Http.Headers; namespace Consul.Net { public sealed partial class ConsulClient { // constructor #region // Constructor // public ConsulClient() : this(ConsulConfiguration.Instance) { } public ConsulClient(ConsulConfiguration config) { _config = config; HttpClientHandler handler = new HttpClientHandler(); handler.AllowAutoRedirect = true; handler.AutomaticDecompression = DecompressionMethods.GZip; _client = new HttpClient(handler); } #endregion #region // Properties // private readonly ConsulConfiguration _config; private readonly HttpClient _client; #endregion private Uri GetRequestUri(string suffix) { return new Uri("http://" + _config.Agent + "/v1/" + suffix); } private Task<HttpResponseMessage> Execute(HttpRequestMessage request) { request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("*/*")); return _client.SendAsync(request); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Net; using System.Net.Http; using System.Net.Http.Headers; namespace Consul.Net { public sealed class ConsulRequest { // wait public string Url { get; set; } public HttpMethod Method { get; set; } } public sealed class ConsulResponse { public Exception Exception { get; set; } } public sealed partial class ConsulClient { // constructor #region // Constructor // public ConsulClient() : this(ConsulConfiguration.Instance) { } public ConsulClient(ConsulConfiguration config) { _config = config; HttpClientHandler handler = new HttpClientHandler(); handler.AllowAutoRedirect = true; handler.AutomaticDecompression = DecompressionMethods.GZip; _client = new HttpClient(handler); } #endregion #region // Properties // private readonly ConsulConfiguration _config; private readonly HttpClient _client; #endregion private Uri GetRequestUri(string suffix) { return new Uri("http://" + _config.Agent + "/v1/" + suffix); } private Task<HttpResponseMessage> Execute(HttpRequestMessage request) { request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("*/*")); return _client.SendAsync(request); } } }
apache-2.0
C#